Merge tag 'qcom-dts-for-5.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorArnd Bergmann <arnd@arndb.de>
Thu, 21 Jul 2022 12:55:25 +0000 (14:55 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 21 Jul 2022 12:55:25 +0000 (14:55 +0200)
More Qualcomm DTS updates for v5.20

This adds an additional GSBI, hwclock, smem and tsens nodes for IPQ8064,
in addition to fixing up and improving the existing descriptions of the
platform.

USB interrupts are reordered to please the Devicetree binding.

The Light Pulse Generator is defined for PM8941 and LEDs are defined for
the FairPhone2, Nexus 5 and Sony Xperia devices.

* tag 'qcom-dts-for-5.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
  ARM: dts: qcom: add rpmcc missing clocks for apq/ipq8064 and msm8660
  ARM: dts: qcom: msm8974: Disable remoteprocs by default
  ARM: dts: qcom: ipq8064: add missing smem compatible
  ARM: dts: qcom: ipq8064: add missing hwlock
  ARM: dts: qcom: ipq8064: add speedbin efuse nvmem node
  ARM: dts: qcom: ipq8064: fix and add some missing gsbi node
  ARM: dts: qcom: ipq8064: reduce pci IO size to 64K
  ARM: dts: qcom: ipq8064: disable usb phy by default
  ARM: dts: qcom: ipq8064: add missing snps,dwmac compatible for gmac
  ARM: dts: qcom: ipq8064: add specific dtsi with smb208 rpm regulators
  ARM: dts: qcom: ipq8064: add gsbi6 missing definition
  ARM: dts: qcom: ipq8064: add multiple missing pin definition
  ARM: dts: qcom: msm8974-hammerhead: Add notification LED
  ARM: dts: qcom: msm8974-FP2: Add notification LED
  ARM: dts: qcom: msm8974-sony: Enable LPG
  ARM: dts: qcom: Add LPG node to pm8941
  ARM: dts: qcom: sdx65: reorder USB interrupts
  ARM: dts: qcom: apq8064: create tsens device node

Link: https://lore.kernel.org/r/20220720231111.2114025-1-bjorn.andersson@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2021 files changed:
.mailmap
Documentation/ABI/testing/sysfs-ata
Documentation/ABI/testing/sysfs-bus-iio-vf610
Documentation/ABI/testing/sysfs-devices-system-cpu
Documentation/ABI/testing/sysfs-driver-bd9571mwv-regulator
Documentation/admin-guide/hw-vuln/index.rst
Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst [new file with mode: 0644]
Documentation/admin-guide/kernel-parameters.txt
Documentation/arm/google/chromebook-boot-flow.rst [new file with mode: 0644]
Documentation/arm/index.rst
Documentation/arm/tcm.rst
Documentation/arm64/sme.rst
Documentation/devicetree/bindings/arm/altera.yaml
Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/bcm/brcm,bcm4708.yaml
Documentation/devicetree/bindings/arm/bcm/brcm,bcmbca.yaml
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt [deleted file]
Documentation/devicetree/bindings/arm/fsl.yaml
Documentation/devicetree/bindings/arm/marvell/marvell,ac5.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/mediatek.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,pericfg.yaml
Documentation/devicetree/bindings/arm/qcom.yaml
Documentation/devicetree/bindings/arm/renesas,prr.yaml [deleted file]
Documentation/devicetree/bindings/arm/rockchip.yaml
Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/stm32/stm32.yaml
Documentation/devicetree/bindings/arm/sunxi.yaml
Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra-ccplex-cluster.yaml
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/clock/allwinner,sun8i-a83t-de2-clk.yaml
Documentation/devicetree/bindings/clock/fsl,scu-clk.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/clock/idt,versaclock5.yaml
Documentation/devicetree/bindings/clock/qcom,dispcc-sm8x50.yaml
Documentation/devicetree/bindings/clock/qcom,gpucc-sm8350.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/clock/qcom,sm8450-camcc.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/clock/samsung,exynos7885-clock.yaml
Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.yaml
Documentation/devicetree/bindings/cpufreq/brcm,stb-avs-cpu-freq.txt
Documentation/devicetree/bindings/display/arm,malidp.yaml
Documentation/devicetree/bindings/display/msm/dpu-sc7180.yaml
Documentation/devicetree/bindings/display/msm/dpu-sc7280.yaml
Documentation/devicetree/bindings/display/msm/dpu-sdm845.yaml
Documentation/devicetree/bindings/display/msm/dsi-controller-main.yaml
Documentation/devicetree/bindings/display/msm/dsi-phy-10nm.yaml
Documentation/devicetree/bindings/display/msm/dsi-phy-14nm.yaml
Documentation/devicetree/bindings/display/msm/dsi-phy-20nm.yaml
Documentation/devicetree/bindings/display/msm/dsi-phy-28nm.yaml
Documentation/devicetree/bindings/display/msm/dsi-phy-common.yaml
Documentation/devicetree/bindings/firmware/fsl,scu.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/gpio/gpio-zynq.yaml
Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/hwmon/ti,tmp401.yaml
Documentation/devicetree/bindings/hwmon/vexpress.txt
Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
Documentation/devicetree/bindings/input/fsl,scu-key.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/interrupt-controller/socionext,uniphier-aidet.yaml
Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml
Documentation/devicetree/bindings/mfd/maxim,max77714.yaml
Documentation/devicetree/bindings/mmc/brcm,sdhci-brcmstb.yaml
Documentation/devicetree/bindings/mmc/marvell,xenon-sdhci.yaml
Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
Documentation/devicetree/bindings/nvmem/fsl,scu-ocotp.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/phy/phy-stih407-usb.txt
Documentation/devicetree/bindings/phy/qcom,qmp-usb3-dp-phy.yaml
Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml
Documentation/devicetree/bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/fsl,scu-pinctrl.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/pinctrl/pinctrl-rk805.txt
Documentation/devicetree/bindings/pinctrl/ralink,mt7620-pinctrl.yaml
Documentation/devicetree/bindings/pinctrl/ralink,rt305x-pinctrl.yaml
Documentation/devicetree/bindings/power/fsl,scu-pd.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/power/supply/maxim,max77976.yaml
Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
Documentation/devicetree/bindings/regulator/vexpress.txt
Documentation/devicetree/bindings/rtc/fsl,scu-rtc.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt [deleted file]
Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
Documentation/devicetree/bindings/spi/microchip,mpfs-spi.yaml
Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
Documentation/devicetree/bindings/thermal/fsl,scu-thermal.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/timer/nvidia,tegra186-timer.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.yaml
Documentation/devicetree/bindings/usb/atmel-usb.txt
Documentation/devicetree/bindings/usb/dwc3-st.txt
Documentation/devicetree/bindings/usb/ehci-st.txt
Documentation/devicetree/bindings/usb/generic-ehci.yaml
Documentation/devicetree/bindings/usb/generic-ohci.yaml
Documentation/devicetree/bindings/usb/ohci-st.txt
Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
Documentation/devicetree/bindings/vendor-prefixes.yaml
Documentation/devicetree/bindings/watchdog/allwinner,sun4i-a10-wdt.yaml
Documentation/devicetree/bindings/watchdog/fsl,scu-wdt.yaml [new file with mode: 0644]
Documentation/driver-api/gpio/board.rst
Documentation/driver-api/gpio/consumer.rst
Documentation/driver-api/gpio/intro.rst
Documentation/driver-api/hte/hte.rst [new file with mode: 0644]
Documentation/driver-api/hte/index.rst [new file with mode: 0644]
Documentation/driver-api/hte/tegra194-hte.rst [new file with mode: 0644]
Documentation/driver-api/index.rst
Documentation/features/core/cBPF-JIT/arch-support.txt
Documentation/features/core/eBPF-JIT/arch-support.txt
Documentation/features/core/generic-idle-thread/arch-support.txt
Documentation/features/core/jump-labels/arch-support.txt
Documentation/features/core/thread-info-in-task/arch-support.txt
Documentation/features/core/tracehook/arch-support.txt
Documentation/features/debug/KASAN/arch-support.txt
Documentation/features/debug/debug-vm-pgtable/arch-support.txt
Documentation/features/debug/gcov-profile-all/arch-support.txt
Documentation/features/debug/kcov/arch-support.txt
Documentation/features/debug/kgdb/arch-support.txt
Documentation/features/debug/kmemleak/arch-support.txt
Documentation/features/debug/kprobes-on-ftrace/arch-support.txt
Documentation/features/debug/kprobes/arch-support.txt
Documentation/features/debug/kretprobes/arch-support.txt
Documentation/features/debug/optprobes/arch-support.txt
Documentation/features/debug/stackprotector/arch-support.txt
Documentation/features/debug/uprobes/arch-support.txt
Documentation/features/debug/user-ret-profiler/arch-support.txt
Documentation/features/io/dma-contiguous/arch-support.txt
Documentation/features/locking/cmpxchg-local/arch-support.txt
Documentation/features/locking/lockdep/arch-support.txt
Documentation/features/locking/queued-rwlocks/arch-support.txt
Documentation/features/locking/queued-spinlocks/arch-support.txt
Documentation/features/perf/kprobes-event/arch-support.txt
Documentation/features/perf/perf-regs/arch-support.txt
Documentation/features/perf/perf-stackdump/arch-support.txt
Documentation/features/sched/membarrier-sync-core/arch-support.txt
Documentation/features/sched/numa-balancing/arch-support.txt
Documentation/features/seccomp/seccomp-filter/arch-support.txt
Documentation/features/time/arch-tick-broadcast/arch-support.txt
Documentation/features/time/clockevents/arch-support.txt
Documentation/features/time/context-tracking/arch-support.txt
Documentation/features/time/irq-time-acct/arch-support.txt
Documentation/features/time/virt-cpuacct/arch-support.txt
Documentation/features/vm/ELF-ASLR/arch-support.txt
Documentation/features/vm/PG_uncached/arch-support.txt
Documentation/features/vm/THP/arch-support.txt
Documentation/features/vm/TLB/arch-support.txt
Documentation/features/vm/huge-vmap/arch-support.txt
Documentation/features/vm/ioremap_prot/arch-support.txt
Documentation/features/vm/pte_special/arch-support.txt
Documentation/filesystems/btrfs.rst
Documentation/filesystems/ext4/attributes.rst
Documentation/filesystems/ext4/bigalloc.rst
Documentation/filesystems/ext4/bitmaps.rst
Documentation/filesystems/ext4/blockgroup.rst
Documentation/filesystems/ext4/blockmap.rst
Documentation/filesystems/ext4/checksums.rst
Documentation/filesystems/ext4/directory.rst
Documentation/filesystems/ext4/eainode.rst
Documentation/filesystems/ext4/group_descr.rst
Documentation/filesystems/ext4/ifork.rst
Documentation/filesystems/ext4/inlinedata.rst
Documentation/filesystems/ext4/inodes.rst
Documentation/filesystems/ext4/journal.rst
Documentation/filesystems/ext4/mmp.rst
Documentation/filesystems/ext4/overview.rst
Documentation/filesystems/ext4/special_inodes.rst
Documentation/filesystems/ext4/super.rst
Documentation/filesystems/netfs_library.rst
Documentation/hte/hte.rst [deleted file]
Documentation/hte/index.rst [deleted file]
Documentation/hte/tegra194-hte.rst [deleted file]
Documentation/index.rst
Documentation/kbuild/llvm.rst
Documentation/loongarch/introduction.rst
Documentation/loongarch/irq-chip-model.rst
Documentation/networking/ip-sysctl.rst
Documentation/networking/phy.rst
Documentation/process/changes.rst
Documentation/translations/zh_CN/loongarch/introduction.rst
Documentation/translations/zh_CN/loongarch/irq-chip-model.rst
Documentation/usb/usbmon.rst
Documentation/vm/hwpoison.rst
MAINTAINERS
Makefile
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/alpine.dtsi
arch/arm/boot/dts/am335x-boneblack-wireless.dts
arch/arm/boot/dts/am335x-boneblack.dts
arch/arm/boot/dts/am335x-boneblue.dts
arch/arm/boot/dts/am335x-bonegreen-wireless.dts
arch/arm/boot/dts/am335x-cm-t335.dts
arch/arm/boot/dts/am335x-evm.dts
arch/arm/boot/dts/am335x-guardian.dts
arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi
arch/arm/boot/dts/am335x-moxa-uc-8100-common.dtsi
arch/arm/boot/dts/am335x-pcm-953.dtsi
arch/arm/boot/dts/am335x-pepper.dts
arch/arm/boot/dts/am335x-sancloud-bbe-extended-wifi.dts
arch/arm/boot/dts/am335x-shc.dts
arch/arm/boot/dts/am3517-evm-ui.dtsi
arch/arm/boot/dts/am3517-evm.dts
arch/arm/boot/dts/am3874-iceboard.dts
arch/arm/boot/dts/am437x-idk-evm.dts
arch/arm/boot/dts/am437x-l4.dtsi
arch/arm/boot/dts/animeo_ip.dts
arch/arm/boot/dts/armada-370-c200-v2.dts
arch/arm/boot/dts/armada-370-rd.dts
arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi
arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi
arch/arm/boot/dts/armada-381-netgear-gs110emx.dts
arch/arm/boot/dts/armada-385-clearfog-gtr.dtsi
arch/arm/boot/dts/armada-385-linksys.dtsi
arch/arm/boot/dts/armada-385-turris-omnia.dts
arch/arm/boot/dts/armada-388-clearfog-base.dts
arch/arm/boot/dts/armada-388-clearfog.dts
arch/arm/boot/dts/armada-xp-axpwifiap.dts
arch/arm/boot/dts/armada-xp-linksys-mamba.dts
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
arch/arm/boot/dts/aspeed-ast2500-evb.dts
arch/arm/boot/dts/aspeed-ast2600-evb-a1.dts
arch/arm/boot/dts/aspeed-ast2600-evb.dts
arch/arm/boot/dts/aspeed-bmc-ampere-mtjade.dts
arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts [deleted file]
arch/arm/boot/dts/aspeed-bmc-bytedance-g220a.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-inspur-fp5280g2.dts
arch/arm/boot/dts/aspeed-bmc-nuvia-dc-scm.dts [deleted file]
arch/arm/boot/dts/aspeed-bmc-opp-mihawk.dts
arch/arm/boot/dts/aspeed-bmc-opp-mowgli.dts
arch/arm/boot/dts/aspeed-bmc-opp-nicole.dts
arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts
arch/arm/boot/dts/aspeed-bmc-opp-swift.dts
arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts
arch/arm/boot/dts/aspeed-bmc-opp-vesnin.dts
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts
arch/arm/boot/dts/aspeed-bmc-opp-zaius.dts
arch/arm/boot/dts/aspeed-bmc-portwell-neptune.dts
arch/arm/boot/dts/aspeed-bmc-qcom-dc-scm-v1.dts [new file with mode: 0644]
arch/arm/boot/dts/aspeed-bmc-quanta-s6q.dts
arch/arm/boot/dts/at91-foxg20.dts
arch/arm/boot/dts/at91-gatwick.dts
arch/arm/boot/dts/at91-kizbox.dts
arch/arm/boot/dts/at91-kizbox2-common.dtsi
arch/arm/boot/dts/at91-kizbox3-hs.dts
arch/arm/boot/dts/at91-kizboxmini-common.dtsi
arch/arm/boot/dts/at91-nattis-2-natte-2.dts
arch/arm/boot/dts/at91-qil_a9260.dts
arch/arm/boot/dts/at91-sam9x60ek.dts
arch/arm/boot/dts/at91-sama5d27_som1.dtsi
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
arch/arm/boot/dts/at91-sama5d2_icp.dts
arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
arch/arm/boot/dts/at91-sama5d2_xplained.dts
arch/arm/boot/dts/at91-sama5d3_ksz9477_evb.dts
arch/arm/boot/dts/at91-sama5d3_xplained.dts
arch/arm/boot/dts/at91-sama5d4_xplained.dts
arch/arm/boot/dts/at91-sama5d4ek.dts
arch/arm/boot/dts/at91-sama7g5ek.dts
arch/arm/boot/dts/at91-wb45n.dts
arch/arm/boot/dts/at91-wb50n.dts
arch/arm/boot/dts/at91sam9260.dtsi
arch/arm/boot/dts/at91sam9260ek.dts
arch/arm/boot/dts/at91sam9261.dtsi
arch/arm/boot/dts/at91sam9261ek.dts
arch/arm/boot/dts/at91sam9263.dtsi
arch/arm/boot/dts/at91sam9263ek.dts
arch/arm/boot/dts/at91sam9g20ek_common.dtsi
arch/arm/boot/dts/at91sam9g25-gardena-smart-gateway.dts
arch/arm/boot/dts/at91sam9g45.dtsi
arch/arm/boot/dts/at91sam9m10g45ek.dts
arch/arm/boot/dts/at91sam9n12.dtsi
arch/arm/boot/dts/at91sam9n12ek.dts
arch/arm/boot/dts/at91sam9rl.dtsi
arch/arm/boot/dts/at91sam9rlek.dts
arch/arm/boot/dts/at91sam9x5.dtsi
arch/arm/boot/dts/axm5516-cpus.dtsi
arch/arm/boot/dts/bcm2711-rpi-400.dts
arch/arm/boot/dts/bcm2711-rpi.dtsi
arch/arm/boot/dts/bcm2711.dtsi
arch/arm/boot/dts/bcm28155-ap.dts
arch/arm/boot/dts/bcm2835-common.dtsi
arch/arm/boot/dts/bcm283x.dtsi
arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dts
arch/arm/boot/dts/bcm4708-asus-rt-ac68u.dts
arch/arm/boot/dts/bcm4708-buffalo-wzr-1166dhp-common.dtsi
arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
arch/arm/boot/dts/bcm4708-linksys-ea6300-v1.dts
arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
arch/arm/boot/dts/bcm4708-luxul-xap-1510.dts
arch/arm/boot/dts/bcm4708-luxul-xwc-1000.dts
arch/arm/boot/dts/bcm4708-netgear-r6250.dts
arch/arm/boot/dts/bcm4708-netgear-r6300-v2.dts
arch/arm/boot/dts/bcm4708-smartrg-sr400ac.dts
arch/arm/boot/dts/bcm47081-asus-rt-n18u.dts
arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
arch/arm/boot/dts/bcm47081-buffalo-wzr-900dhp.dts
arch/arm/boot/dts/bcm47081-luxul-xap-1410.dts
arch/arm/boot/dts/bcm47081-luxul-xwr-1200.dts
arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts
arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts
arch/arm/boot/dts/bcm4709-linksys-ea9200.dts
arch/arm/boot/dts/bcm4709-netgear-r7000.dts
arch/arm/boot/dts/bcm4709-netgear-r8000.dts
arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts
arch/arm/boot/dts/bcm47094-dlink-dir-885l.dts
arch/arm/boot/dts/bcm47094-linksys-panamera.dts
arch/arm/boot/dts/bcm47094-luxul-abr-4500.dts
arch/arm/boot/dts/bcm47094-luxul-xap-1610.dts
arch/arm/boot/dts/bcm47094-luxul-xbr-4500.dts
arch/arm/boot/dts/bcm47094-luxul-xwc-2000.dts
arch/arm/boot/dts/bcm47094-luxul-xwr-3100.dts
arch/arm/boot/dts/bcm47094-luxul-xwr-3150-v1.dts
arch/arm/boot/dts/bcm47094-netgear-r8500.dts
arch/arm/boot/dts/bcm47094-phicomm-k3.dts
arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts
arch/arm/boot/dts/bcm47189-luxul-xap-810.dts
arch/arm/boot/dts/bcm47189-tenda-ac9.dts
arch/arm/boot/dts/bcm47622.dtsi
arch/arm/boot/dts/bcm53015-meraki-mr26.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm53016-meraki-mr32.dts
arch/arm/boot/dts/bcm5301x.dtsi
arch/arm/boot/dts/bcm63138.dtsi
arch/arm/boot/dts/bcm63148.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm63178.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm6756.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm6846.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm6855.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm6878.dtsi [new file with mode: 0644]
arch/arm/boot/dts/bcm911360_entphn.dts
arch/arm/boot/dts/bcm947189acdbmr.dts
arch/arm/boot/dts/bcm953012er.dts
arch/arm/boot/dts/bcm958625-meraki-alamo.dtsi
arch/arm/boot/dts/bcm958625-meraki-kingpin.dtsi
arch/arm/boot/dts/bcm963138.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm963138dvt.dts
arch/arm/boot/dts/bcm963148.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm963178.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm96756.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm96846.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm96855.dts [new file with mode: 0644]
arch/arm/boot/dts/bcm96878.dts [new file with mode: 0644]
arch/arm/boot/dts/da850-evm.dts
arch/arm/boot/dts/da850.dtsi
arch/arm/boot/dts/dm8148-evm.dts
arch/arm/boot/dts/dm8168-evm.dts
arch/arm/boot/dts/dra62x-j5eco-evm.dts
arch/arm/boot/dts/dra76x.dtsi
arch/arm/boot/dts/e60k02.dtsi
arch/arm/boot/dts/e70k02.dtsi
arch/arm/boot/dts/ecx-common.dtsi
arch/arm/boot/dts/en7523-evb.dts
arch/arm/boot/dts/en7523.dtsi
arch/arm/boot/dts/exynos-pinctrl.h [new file with mode: 0644]
arch/arm/boot/dts/exynos3250-artik5.dtsi
arch/arm/boot/dts/exynos3250-pinctrl.dtsi
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-trats.dts
arch/arm/boot/dts/exynos4412-galaxy-s3.dtsi
arch/arm/boot/dts/exynos4412-itop-elite.dts
arch/arm/boot/dts/exynos4412-midas.dtsi
arch/arm/boot/dts/exynos4412-odroidu3.dts
arch/arm/boot/dts/exynos4412-odroidx.dts
arch/arm/boot/dts/exynos4412-p4note.dtsi
arch/arm/boot/dts/exynos4412-pinctrl.dtsi
arch/arm/boot/dts/exynos4412-tiny4412.dts
arch/arm/boot/dts/exynos5.dtsi
arch/arm/boot/dts/exynos5250-arndale.dts
arch/arm/boot/dts/exynos5250-pinctrl.dtsi
arch/arm/boot/dts/exynos5250-snow-common.dtsi
arch/arm/boot/dts/exynos5250-spring.dts
arch/arm/boot/dts/exynos5260-pinctrl.dtsi
arch/arm/boot/dts/exynos5410-pinctrl.dtsi
arch/arm/boot/dts/exynos5420-arndale-octa.dts
arch/arm/boot/dts/exynos5420-peach-pit.dts
arch/arm/boot/dts/exynos5420-pinctrl.dtsi
arch/arm/boot/dts/exynos5422-odroidhc1.dts
arch/arm/boot/dts/exynos5422-odroidxu4.dts
arch/arm/boot/dts/exynos54xx-odroidxu-leds.dtsi
arch/arm/boot/dts/exynos5800-peach-pi.dts
arch/arm/boot/dts/imx25.dtsi
arch/arm/boot/dts/imx27.dtsi
arch/arm/boot/dts/imx31.dtsi
arch/arm/boot/dts/imx50.dtsi
arch/arm/boot/dts/imx51-ts4800.dts
arch/arm/boot/dts/imx51.dtsi
arch/arm/boot/dts/imx53.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/imx6dl.dtsi
arch/arm/boot/dts/imx6q-apalis-eval.dts
arch/arm/boot/dts/imx6q-apalis-ixora-v1.1.dts
arch/arm/boot/dts/imx6q-apalis-ixora-v1.2.dts [new file with mode: 0644]
arch/arm/boot/dts/imx6q-apalis-ixora.dts
arch/arm/boot/dts/imx6q-bosch-acc.dts
arch/arm/boot/dts/imx6q-skov-reve-mi1010ait-1cp1.dts
arch/arm/boot/dts/imx6q.dtsi
arch/arm/boot/dts/imx6qdl-apalis.dtsi
arch/arm/boot/dts/imx6qdl-colibri.dtsi
arch/arm/boot/dts/imx6qdl-prti6q.dtsi
arch/arm/boot/dts/imx6qdl-skov-cpu-revc.dtsi
arch/arm/boot/dts/imx6qdl-skov-cpu.dtsi
arch/arm/boot/dts/imx6qdl.dtsi
arch/arm/boot/dts/imx6sl-tolino-shine2hd.dts
arch/arm/boot/dts/imx6sx.dtsi
arch/arm/boot/dts/imx6ul-kontron-n6x1x-s.dtsi
arch/arm/boot/dts/imx6ul-phytec-segin.dtsi
arch/arm/boot/dts/imx6ul-tqma6ul2l.dtsi
arch/arm/boot/dts/imx6ul.dtsi
arch/arm/boot/dts/imx6ull-colibri.dtsi
arch/arm/boot/dts/imx6ull-tqma6ull2.dtsi
arch/arm/boot/dts/imx6ull-tqma6ull2l.dtsi
arch/arm/boot/dts/imx6ull.dtsi
arch/arm/boot/dts/imx6ulz-bsh-smm-m2.dts
arch/arm/boot/dts/imx7-colibri-aster.dtsi
arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
arch/arm/boot/dts/imx7-colibri-iris-v2.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx7-colibri-iris.dtsi [new file with mode: 0644]
arch/arm/boot/dts/imx7-colibri.dtsi
arch/arm/boot/dts/imx7d-colibri-aster.dts
arch/arm/boot/dts/imx7d-colibri-emmc-aster.dts
arch/arm/boot/dts/imx7d-colibri-emmc-eval-v3.dts
arch/arm/boot/dts/imx7d-colibri-emmc-iris-v2.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7d-colibri-emmc-iris.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7d-colibri-emmc.dtsi
arch/arm/boot/dts/imx7d-colibri-eval-v3.dts
arch/arm/boot/dts/imx7d-colibri-iris-v2.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7d-colibri-iris.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7d-colibri.dtsi
arch/arm/boot/dts/imx7d-sdb.dts
arch/arm/boot/dts/imx7d-smegw01.dts
arch/arm/boot/dts/imx7d.dtsi
arch/arm/boot/dts/imx7s-colibri-aster.dts
arch/arm/boot/dts/imx7s-colibri-eval-v3.dts
arch/arm/boot/dts/imx7s-colibri-iris-v2.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7s-colibri-iris.dts [new file with mode: 0644]
arch/arm/boot/dts/imx7s-colibri.dtsi
arch/arm/boot/dts/imx7s.dtsi
arch/arm/boot/dts/imxrt1050.dtsi
arch/arm/boot/dts/keystone-k2e-netcp.dtsi
arch/arm/boot/dts/keystone-k2e.dtsi
arch/arm/boot/dts/keystone-k2g-netcp.dtsi
arch/arm/boot/dts/keystone-k2g.dtsi
arch/arm/boot/dts/keystone-k2hk-netcp.dtsi
arch/arm/boot/dts/keystone-k2hk.dtsi
arch/arm/boot/dts/keystone-k2l-netcp.dtsi
arch/arm/boot/dts/keystone-k2l.dtsi
arch/arm/boot/dts/keystone.dtsi
arch/arm/boot/dts/lan966x-kontron-kswitch-d10-mmt.dtsi
arch/arm/boot/dts/lan966x-pcb8291.dts
arch/arm/boot/dts/lan966x.dtsi
arch/arm/boot/dts/lpc18xx.dtsi
arch/arm/boot/dts/ls1021a-iot.dts
arch/arm/boot/dts/ls1021a.dtsi
arch/arm/boot/dts/meson.dtsi
arch/arm/boot/dts/meson8.dtsi
arch/arm/boot/dts/meson8b.dtsi
arch/arm/boot/dts/mt2701.dtsi
arch/arm/boot/dts/mt7623.dtsi
arch/arm/boot/dts/mt7623a-rfb-emmc.dts
arch/arm/boot/dts/mt7623a-rfb-nand.dts
arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
arch/arm/boot/dts/mt7623n-rfb-emmc.dts
arch/arm/boot/dts/mt7629-rfb.dts
arch/arm/boot/dts/nuvoton-common-npcm7xx.dtsi
arch/arm/boot/dts/nuvoton-npcm750.dtsi
arch/arm/boot/dts/omap2420-h4.dts
arch/arm/boot/dts/omap3-evm-37xx.dts
arch/arm/boot/dts/omap3-evm.dts
arch/arm/boot/dts/omap3-gta04.dtsi
arch/arm/boot/dts/omap3-igep.dtsi
arch/arm/boot/dts/omap3-ldp.dts
arch/arm/boot/dts/omap3-lilly-a83x.dtsi
arch/arm/boot/dts/omap3-n900.dts
arch/arm/boot/dts/omap3-n950-n9.dtsi
arch/arm/boot/dts/omap3-overo-base.dtsi
arch/arm/boot/dts/omap3-pandora-common.dtsi
arch/arm/boot/dts/omap3430-sdp.dts
arch/arm/boot/dts/omap5-l4.dtsi
arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
arch/arm/boot/dts/r7s9210-rza2mevb.dts
arch/arm/boot/dts/r8a7790-lager.dts
arch/arm/boot/dts/r8a7790-stout.dts
arch/arm/boot/dts/r8a7791-koelsch.dts
arch/arm/boot/dts/r8a7791-porter.dts
arch/arm/boot/dts/r8a7792-blanche.dts
arch/arm/boot/dts/r8a7793-gose.dts
arch/arm/boot/dts/r8a7794-alt.dts
arch/arm/boot/dts/r8a7794-silk.dts
arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi [deleted file]
arch/arm/boot/dts/r9a06g032-rzn1d400-db.dts
arch/arm/boot/dts/r9a06g032.dtsi
arch/arm/boot/dts/rk3066a-bqcurie2.dts
arch/arm/boot/dts/rk3066a-mk808.dts
arch/arm/boot/dts/rk3066a-rayeager.dts
arch/arm/boot/dts/rk3188-bqedison2qc.dts
arch/arm/boot/dts/rk3188-px3-evb.dts
arch/arm/boot/dts/rk3188-radxarock.dts
arch/arm/boot/dts/rk3229-evb.dts
arch/arm/boot/dts/rk3288-evb.dtsi
arch/arm/boot/dts/rk3288-firefly-reload.dts
arch/arm/boot/dts/rk3288-firefly.dtsi
arch/arm/boot/dts/rk3288-phycore-rdk.dts
arch/arm/boot/dts/rk3288-popmetal.dts
arch/arm/boot/dts/rk3288-r89.dts
arch/arm/boot/dts/rk3288-rock2-square.dts
arch/arm/boot/dts/rk3288-tinker.dtsi
arch/arm/boot/dts/rk3288-veyron-broadcom-bluetooth.dtsi
arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
arch/arm/boot/dts/rk3288-veyron-minnie.dts
arch/arm/boot/dts/rk3288-veyron-pinky.dts
arch/arm/boot/dts/rk3288-veyron.dtsi
arch/arm/boot/dts/rv1108-elgin-r1.dts
arch/arm/boot/dts/rv1108-evb.dts
arch/arm/boot/dts/rv1108.dtsi
arch/arm/boot/dts/s3c2410-pinctrl.h [new file with mode: 0644]
arch/arm/boot/dts/s3c2416-pinctrl.dtsi
arch/arm/boot/dts/s3c2416.dtsi
arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
arch/arm/boot/dts/s3c64xx-pinctrl.h [new file with mode: 0644]
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/s5pv210-pinctrl.h [new file with mode: 0644]
arch/arm/boot/dts/s5pv210.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/sd5203.dts
arch/arm/boot/dts/socfpga_arria10.dtsi
arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts [new file with mode: 0644]
arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts [deleted file]
arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dtsi [new file with mode: 0644]
arch/arm/boot/dts/spear1310-evb.dts
arch/arm/boot/dts/spear1340-evb.dts
arch/arm/boot/dts/spear1340.dtsi
arch/arm/boot/dts/spear300-evb.dts
arch/arm/boot/dts/spear310-evb.dts
arch/arm/boot/dts/spear320-evb.dts
arch/arm/boot/dts/spear320-hmi.dts
arch/arm/boot/dts/spear320.dtsi
arch/arm/boot/dts/ste-ab8500.dtsi
arch/arm/boot/dts/ste-dbx5x0.dtsi
arch/arm/boot/dts/ste-hrefv60plus.dtsi
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-janice.dts
arch/arm/boot/dts/stih407-family.dtsi
arch/arm/boot/dts/stih407.dtsi
arch/arm/boot/dts/stih410.dtsi
arch/arm/boot/dts/stihxxx-b2120.dtsi
arch/arm/boot/dts/stm32429i-eval.dts
arch/arm/boot/dts/stm32h743.dtsi
arch/arm/boot/dts/stm32h743i-disco.dts
arch/arm/boot/dts/stm32h743i-eval.dts
arch/arm/boot/dts/stm32h750i-art-pi.dts
arch/arm/boot/dts/stm32mp131.dtsi
arch/arm/boot/dts/stm32mp133.dtsi
arch/arm/boot/dts/stm32mp135f-dk.dts
arch/arm/boot/dts/stm32mp13xc.dtsi
arch/arm/boot/dts/stm32mp13xf.dtsi
arch/arm/boot/dts/stm32mp15-pinctrl.dtsi
arch/arm/boot/dts/stm32mp15-scmi.dtsi [new file with mode: 0644]
arch/arm/boot/dts/stm32mp151.dtsi
arch/arm/boot/dts/stm32mp153c-dhcor-drc-compact.dts [new file with mode: 0644]
arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts
arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts
arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts
arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts
arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi [new file with mode: 0644]
arch/arm/boot/dts/stm32mp15xx-dhcor-io1v8.dtsi
arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi
arch/arm/boot/dts/stm32mp15xx-osd32.dtsi
arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts
arch/arm/boot/dts/sun4i-a10-pcduino.dts
arch/arm/boot/dts/sun5i-a13-licheepi-one.dts
arch/arm/boot/dts/sun6i-a31.dtsi
arch/arm/boot/dts/sun7i-a20-pcduino3.dts
arch/arm/boot/dts/sun8i-a23-a33.dtsi
arch/arm/boot/dts/sun8i-h2-plus-bananapi-m2-zero.dts
arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
arch/arm/boot/dts/sun8i-h3-mapleboard-mp130.dts
arch/arm/boot/dts/sun8i-h3-nanopi-duo2.dts
arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
arch/arm/boot/dts/sun8i-h3-nanopi-r1.dts
arch/arm/boot/dts/sun8i-h3-nanopi.dtsi
arch/arm/boot/dts/sun8i-h3-orangepi-2.dts
arch/arm/boot/dts/sun8i-h3-orangepi-lite.dts
arch/arm/boot/dts/sun8i-h3-orangepi-one.dts
arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts
arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts
arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sun8i-r40-feta40i.dtsi
arch/arm/boot/dts/sun8i-r40.dtsi
arch/arm/boot/dts/sun8i-t3-cqa3t-bv3.dts
arch/arm/boot/dts/sun8i-v3s.dtsi
arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
arch/arm/boot/dts/sunxi-bananapi-m2-plus.dtsi
arch/arm/boot/dts/sunxi-h3-h5-emlid-neutis.dtsi
arch/arm/boot/dts/sunxi-h3-h5.dtsi
arch/arm/boot/dts/sunxi-libretech-all-h3-cc.dtsi
arch/arm/boot/dts/tegra114-asus-tf701t.dts
arch/arm/boot/dts/tegra114-dalmore.dts
arch/arm/boot/dts/tegra114-roth.dts
arch/arm/boot/dts/tegra114-tn7.dts
arch/arm/boot/dts/tegra124-apalis-eval.dts
arch/arm/boot/dts/tegra124-apalis-v1.2-eval.dts
arch/arm/boot/dts/tegra124-jetson-tk1.dts
arch/arm/boot/dts/tegra124-nyan.dtsi
arch/arm/boot/dts/tegra124-venice2.dts
arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
arch/arm/boot/dts/tegra20-asus-tf101.dts
arch/arm/boot/dts/tegra20-colibri-eval-v3.dts
arch/arm/boot/dts/tegra20-colibri-iris.dts
arch/arm/boot/dts/tegra20-harmony.dts
arch/arm/boot/dts/tegra20-paz00.dts
arch/arm/boot/dts/tegra20-seaboard.dts
arch/arm/boot/dts/tegra20-trimslice.dts
arch/arm/boot/dts/tegra20-ventana.dts
arch/arm/boot/dts/tegra30-apalis-eval.dts
arch/arm/boot/dts/tegra30-apalis-v1.1-eval.dts
arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
arch/arm/boot/dts/tegra30-asus-nexus7-tilapia.dtsi
arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
arch/arm/boot/dts/tegra30-cardhu.dtsi
arch/arm/boot/dts/tegra30-colibri-eval-v3.dts
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/zynq-zc702.dts
arch/arm/boot/dts/zynq-zturn-common.dtsi
arch/arm/include/asm/xen/xen-ops.h [new file with mode: 0644]
arch/arm/mach-axxia/platsmp.c
arch/arm/mach-cns3xxx/core.c
arch/arm/mach-exynos/exynos.c
arch/arm/mach-spear/time.c
arch/arm/mm/dma-mapping.c
arch/arm/xen/enlighten.c
arch/arm64/Kconfig.platforms
arch/arm64/boot/dts/allwinner/Makefile
arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s-h5.dts
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-lite2.dts
arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts [new file with mode: 0644]
arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts [new file with mode: 0644]
arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/altera/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/altera/socfpga_stratix10_swvp.dts [new file with mode: 0644]
arch/arm64/boot/dts/amd/amd-overdrive-rev-b0.dts
arch/arm64/boot/dts/amd/amd-overdrive-rev-b1.dts
arch/arm64/boot/dts/amlogic/meson-axg.dtsi
arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts
arch/arm64/boot/dts/amlogic/meson-g12b-gtking-pro.dts
arch/arm64/boot/dts/amlogic/meson-gx.dtsi
arch/arm64/boot/dts/amlogic/meson-gxbb-kii-pro.dts
arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts
arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-mecool-kii-pro.dts
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
arch/arm64/boot/dts/amlogic/meson-gxl-s905d-vero4k-plus.dts
arch/arm64/boot/dts/amlogic/meson-gxl-s905w-jethome-jethub-j80.dts
arch/arm64/boot/dts/amlogic/meson-gxm-mecool-kiii-pro.dts
arch/arm64/boot/dts/amlogic/meson-gxm-minix-neo-u9h.dts
arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
arch/arm64/boot/dts/amlogic/meson-gxm-wetek-core2.dts
arch/arm64/boot/dts/amlogic/meson-s4.dtsi
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
arch/arm64/boot/dts/apm/apm-merlin.dts
arch/arm64/boot/dts/apm/apm-mustang.dts
arch/arm64/boot/dts/apm/apm-shadowcat.dtsi
arch/arm64/boot/dts/apm/apm-storm.dtsi
arch/arm64/boot/dts/arm/fvp-base-revc.dts
arch/arm64/boot/dts/arm/juno-base.dtsi
arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi
arch/arm64/boot/dts/arm/juno-r1.dts
arch/arm64/boot/dts/arm/juno-r2.dts
arch/arm64/boot/dts/arm/juno-scmi.dtsi
arch/arm64/boot/dts/arm/juno.dts
arch/arm64/boot/dts/broadcom/Makefile
arch/arm64/boot/dts/broadcom/bcm4908/bcm4906-tplink-archer-c2300-v1.dts
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
arch/arm64/boot/dts/broadcom/bcmbca/Makefile [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts [new file with mode: 0644]
arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi
arch/arm64/boot/dts/exynos/exynos-pinctrl.h [new file with mode: 0644]
arch/arm64/boot/dts/exynos/exynos5433-pinctrl.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/exynos7885-jackpotlte.dts
arch/arm64/boot/dts/exynos/exynos7885-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynos7885.dtsi
arch/arm64/boot/dts/exynos/exynos850-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynosautov9-pinctrl.dtsi
arch/arm64/boot/dts/exynos/exynosautov9-sadk.dts
arch/arm64/boot/dts/exynos/exynosautov9.dtsi
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts
arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
arch/arm64/boot/dts/freescale/fsl-lx2160a-qds.dts
arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi
arch/arm64/boot/dts/freescale/fsl-lx2162a-qds.dts
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi
arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
arch/arm64/boot/dts/freescale/imx8mm-icore-mx8mm.dtsi
arch/arm64/boot/dts/freescale/imx8mm-mx8menlo.dts
arch/arm64/boot/dts/freescale/imx8mm-phyboard-polis-rdk.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mm-var-som-symphony.dts
arch/arm64/boot/dts/freescale/imx8mm-venice-gw700x.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
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
arch/arm64/boot/dts/freescale/imx8mm.dtsi
arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
arch/arm64/boot/dts/freescale/imx8mn-var-som-symphony.dts
arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts
arch/arm64/boot/dts/freescale/imx8mn.dtsi
arch/arm64/boot/dts/freescale/imx8mp-dhcom-pdk2.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mp-evk.dts
arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
arch/arm64/boot/dts/freescale/imx8mp.dtsi
arch/arm64/boot/dts/freescale/imx8mq-evk.dts
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
arch/arm64/boot/dts/freescale/imx8mq-zii-ultra.dtsi
arch/arm64/boot/dts/freescale/imx8mq.dtsi
arch/arm64/boot/dts/freescale/imx8qm.dtsi
arch/arm64/boot/dts/freescale/imx8qxp-colibri-eval-v3.dtsi
arch/arm64/boot/dts/freescale/imx8qxp.dtsi
arch/arm64/boot/dts/freescale/imx8ulp.dtsi
arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx93-pinfunc.h [new file with mode: 0755]
arch/arm64/boot/dts/freescale/imx93.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/mba8mx.dtsi
arch/arm64/boot/dts/freescale/s32g2.dtsi
arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts
arch/arm64/boot/dts/hisilicon/hi3660.dtsi
arch/arm64/boot/dts/hisilicon/hi3670.dtsi
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
arch/arm64/boot/dts/hisilicon/hip05-d02.dts
arch/arm64/boot/dts/hisilicon/hip06.dtsi
arch/arm64/boot/dts/hisilicon/hip07.dtsi
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
arch/arm64/boot/dts/lg/lg1312.dtsi
arch/arm64/boot/dts/lg/lg1313.dtsi
arch/arm64/boot/dts/marvell/Makefile
arch/arm64/boot/dts/marvell/ac5-98dx25xx.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/marvell/ac5-98dx35xx-rd.dts [new file with mode: 0644]
arch/arm64/boot/dts/marvell/ac5-98dx35xx.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts
arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtsi
arch/arm64/boot/dts/marvell/armada-8040-puzzle-m801.dts
arch/arm64/boot/dts/marvell/cn9130-db.dtsi
arch/arm64/boot/dts/mediatek/Makefile
arch/arm64/boot/dts/mediatek/mt2712-evb.dts
arch/arm64/boot/dts/mediatek/mt2712e.dtsi
arch/arm64/boot/dts/mediatek/mt6795.dtsi
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts
arch/arm64/boot/dts/mediatek/mt7622.dtsi
arch/arm64/boot/dts/mediatek/mt7986a.dtsi
arch/arm64/boot/dts/mediatek/mt8173-elm-hana-rev7.dts
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
arch/arm64/boot/dts/mediatek/mt8173-evb.dts
arch/arm64/boot/dts/mediatek/mt8173.dtsi
arch/arm64/boot/dts/mediatek/mt8183-evb.dts
arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi.dtsi
arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
arch/arm64/boot/dts/mediatek/mt8183-pumpkin.dts
arch/arm64/boot/dts/mediatek/mt8183.dtsi
arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8192.dtsi
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/mediatek/mt8195-evb.dts
arch/arm64/boot/dts/mediatek/mt8195.dtsi
arch/arm64/boot/dts/mediatek/pumpkin-common.dtsi
arch/arm64/boot/dts/microchip/sparx5_pcb134_board.dtsi
arch/arm64/boot/dts/microchip/sparx5_pcb135_board.dtsi
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
arch/arm64/boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts
arch/arm64/boot/dts/nvidia/tegra186.dtsi
arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
arch/arm64/boot/dts/nvidia/tegra194-p2972-0000.dts
arch/arm64/boot/dts/nvidia/tegra194-p3509-0000.dtsi
arch/arm64/boot/dts/nvidia/tegra194.dtsi
arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts
arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi
arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts
arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
arch/arm64/boot/dts/nvidia/tegra210.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/apq8096-db820c.dts
arch/arm64/boot/dts/qcom/ipq6018-cp01-c1.dts
arch/arm64/boot/dts/qcom/ipq6018.dtsi
arch/arm64/boot/dts/qcom/ipq8074.dtsi
arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts
arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
arch/arm64/boot/dts/qcom/msm8916-samsung-a3u-eur.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-a5u-eur.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
arch/arm64/boot/dts/qcom/msm8916.dtsi
arch/arm64/boot/dts/qcom/msm8953.dtsi
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi
arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts
arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi
arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi
arch/arm64/boot/dts/qcom/msm8994.dtsi
arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts [deleted file]
arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts [deleted file]
arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts [deleted file]
arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
arch/arm64/boot/dts/qcom/msm8996-xiaomi-common.dtsi
arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dts
arch/arm64/boot/dts/qcom/msm8996-xiaomi-natrium.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dts
arch/arm64/boot/dts/qcom/msm8996.dtsi
arch/arm64/boot/dts/qcom/msm8998-asus-novago-tp370ql.dts
arch/arm64/boot/dts/qcom/msm8998-clamshell.dtsi
arch/arm64/boot/dts/qcom/msm8998-fxtec-pro1.dts
arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dts
arch/arm64/boot/dts/qcom/msm8998-lenovo-miix-630.dts
arch/arm64/boot/dts/qcom/msm8998-mtp.dts
arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi [deleted file]
arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts
arch/arm64/boot/dts/qcom/msm8998-oneplus-common.dtsi
arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dts
arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dts
arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino.dtsi
arch/arm64/boot/dts/qcom/msm8998.dtsi
arch/arm64/boot/dts/qcom/pm6350.dtsi
arch/arm64/boot/dts/qcom/pm660.dtsi
arch/arm64/boot/dts/qcom/pm660l.dtsi
arch/arm64/boot/dts/qcom/pm8005.dtsi
arch/arm64/boot/dts/qcom/pm8009.dtsi
arch/arm64/boot/dts/qcom/pm8150.dtsi
arch/arm64/boot/dts/qcom/pm8150b.dtsi
arch/arm64/boot/dts/qcom/pm8150l.dtsi
arch/arm64/boot/dts/qcom/pm8350.dtsi
arch/arm64/boot/dts/qcom/pm8350b.dtsi
arch/arm64/boot/dts/qcom/pm8916.dtsi
arch/arm64/boot/dts/qcom/pm8994.dtsi
arch/arm64/boot/dts/qcom/pmi8994.dtsi
arch/arm64/boot/dts/qcom/pmi8998.dtsi
arch/arm64/boot/dts/qcom/pmm8155au_1.dtsi
arch/arm64/boot/dts/qcom/pmm8155au_2.dtsi
arch/arm64/boot/dts/qcom/pmr735b.dtsi
arch/arm64/boot/dts/qcom/pms405.dtsi
arch/arm64/boot/dts/qcom/qcs404-evb.dtsi
arch/arm64/boot/dts/qcom/qcs404.dtsi
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
arch/arm64/boot/dts/qcom/sa8295p-adp.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sa8540p.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-idp.dts
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-kingoftown-r0.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor.dtsi
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0-auo.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0-boe.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev1-auo.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev1-boe.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-lte-parade.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-lte-ti.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-parade.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-ti.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi
arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick-r0-lte.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick-r0.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-r1.dts
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0-boe.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0-inx.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe-rt5682s.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx-rt5682s.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
arch/arm64/boot/dts/qcom/sc7180.dtsi
arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi
arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-wcd9385.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc7280-herobrine-crd.dts
arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts
arch/arm64/boot/dts/qcom/sc7280-herobrine-villager-r0.dts
arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi
arch/arm64/boot/dts/qcom/sc7280.dtsi
arch/arm64/boot/dts/qcom/sc8280xp-crd.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sc8280xp.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
arch/arm64/boot/dts/qcom/sdm630.dtsi
arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
arch/arm64/boot/dts/qcom/sdm636-sony-xperia-ganges-mermaid.dts
arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
arch/arm64/boot/dts/qcom/sdm660.dtsi
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
arch/arm64/boot/dts/qcom/sdm845-db845c.dts
arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm845-lg-judyp.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dts
arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama.dtsi
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts
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
arch/arm64/boot/dts/qcom/sm6125-sony-xperia-seine-pdx201.dts
arch/arm64/boot/dts/qcom/sm6125.dtsi
arch/arm64/boot/dts/qcom/sm6350.dtsi
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
arch/arm64/boot/dts/qcom/sm8150-hdk.dts
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
arch/arm64/boot/dts/qcom/sm8150.dtsi
arch/arm64/boot/dts/qcom/sm8250-hdk.dts
arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi
arch/arm64/boot/dts/qcom/sm8250.dtsi
arch/arm64/boot/dts/qcom/sm8350-microsoft-surface-duo2.dts
arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
arch/arm64/boot/dts/qcom/sm8350.dtsi
arch/arm64/boot/dts/qcom/sm8450-hdk.dts
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/draak-ebisu-panel-aa104xd12.dts [new file with mode: 0644]
arch/arm64/boot/dts/renesas/draak.dtsi
arch/arm64/boot/dts/renesas/ebisu.dtsi
arch/arm64/boot/dts/renesas/hihope-common.dtsi
arch/arm64/boot/dts/renesas/panel-aa104xd12.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/renesas/r8a774c0.dtsi
arch/arm64/boot/dts/renesas/r8a77990.dtsi
arch/arm64/boot/dts/renesas/r8a779a0.dtsi
arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
arch/arm64/boot/dts/renesas/r8a779f0-spider.dts
arch/arm64/boot/dts/renesas/r8a779f0.dtsi
arch/arm64/boot/dts/renesas/r8a779m8.dtsi
arch/arm64/boot/dts/renesas/r9a07g043.dtsi
arch/arm64/boot/dts/renesas/r9a07g043u11-smarc.dts
arch/arm64/boot/dts/renesas/r9a07g054l2-smarc.dts
arch/arm64/boot/dts/renesas/r9a09g011-v2mevk2.dts
arch/arm64/boot/dts/renesas/r9a09g011.dtsi
arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi
arch/arm64/boot/dts/renesas/rzg2lc-smarc-som.dtsi
arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi
arch/arm64/boot/dts/renesas/rzg2ul-smarc-som.dtsi
arch/arm64/boot/dts/renesas/rzg2ul-smarc.dtsi
arch/arm64/boot/dts/renesas/salvator-common.dtsi
arch/arm64/boot/dts/renesas/salvator-panel-aa104xd12.dts [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/px30.dtsi
arch/arm64/boot/dts/rockchip/rk3308-evb.dts
arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts [new file with mode: 0644]
arch/arm64/boot/dts/rockchip/rk3326-odroid-go2.dts
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts
arch/arm64/boot/dts/rockchip/rk3368-evb.dtsi
arch/arm64/boot/dts/rockchip/rk3368-geekbox.dts
arch/arm64/boot/dts/rockchip/rk3368-orion-r68-meta.dts
arch/arm64/boot/dts/rockchip/rk3368-px5-evb.dts
arch/arm64/boot/dts/rockchip/rk3368-r88.dts
arch/arm64/boot/dts/rockchip/rk3368.dtsi
arch/arm64/boot/dts/rockchip/rk3399-evb.dts
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
arch/arm64/boot/dts/rockchip/rk3399-gru-chromebook.dtsi
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi
arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dtsi
arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator.dts
arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
arch/arm64/boot/dts/rockchip/rk3399pro-vmarc-som.dtsi
arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi
arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts
arch/arm64/boot/dts/rockchip/rk3566.dtsi
arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dts
arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
arch/arm64/boot/dts/rockchip/rk3568.dtsi
arch/arm64/boot/dts/rockchip/rk356x.dtsi
arch/arm64/boot/dts/sprd/sc9836.dtsi
arch/arm64/boot/dts/sprd/sc9863a.dtsi
arch/arm64/boot/dts/sprd/whale2.dtsi
arch/arm64/boot/dts/tesla/fsd-evb.dts
arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi
arch/arm64/boot/dts/tesla/fsd-pinctrl.h [new file with mode: 0644]
arch/arm64/boot/dts/tesla/fsd.dtsi
arch/arm64/boot/dts/ti/k3-am62-main.dtsi
arch/arm64/boot/dts/ti/k3-am625-sk.dts
arch/arm64/boot/dts/ti/k3-am64-main.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-wakeup.dtsi
arch/arm64/boot/dts/ti/k3-am654-base-board.dts
arch/arm64/boot/dts/ti/k3-j7200-mcu-wakeup.dtsi
arch/arm64/boot/dts/ti/k3-j721e-common-proc-board.dts
arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi
arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi
arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi
arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi
arch/arm64/boot/dts/xilinx/zynqmp-sm-k26-revA.dts
arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts
arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts
arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts
arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts
arch/arm64/boot/dts/xilinx/zynqmp.dtsi
arch/arm64/include/asm/kvm_host.h
arch/arm64/include/asm/sysreg.h
arch/arm64/include/asm/virt.h
arch/arm64/include/asm/xen/xen-ops.h [new file with mode: 0644]
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/entry-ftrace.S
arch/arm64/kernel/fpsimd.c
arch/arm64/kernel/ftrace.c
arch/arm64/kernel/mte.c
arch/arm64/kernel/setup.c
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/arm.c
arch/arm64/kvm/fpsimd.c
arch/arm64/kvm/hyp/nvhe/mem_protect.c
arch/arm64/kvm/hyp/nvhe/sys_regs.c
arch/arm64/kvm/vgic/vgic-mmio-v2.c
arch/arm64/kvm/vgic/vgic-mmio-v3.c
arch/arm64/kvm/vgic/vgic-mmio.c
arch/arm64/kvm/vgic/vgic-mmio.h
arch/arm64/kvm/vmid.c
arch/arm64/mm/cache.S
arch/arm64/mm/dma-mapping.c
arch/arm64/net/bpf_jit_comp.c
arch/arm64/tools/gen-sysreg.awk
arch/loongarch/Kconfig
arch/loongarch/include/asm/branch.h
arch/loongarch/include/asm/hardirq.h
arch/loongarch/include/asm/percpu.h
arch/loongarch/include/asm/pgtable.h
arch/loongarch/include/asm/smp.h
arch/loongarch/include/asm/timex.h
arch/loongarch/kernel/acpi.c
arch/loongarch/kernel/cacheinfo.c
arch/loongarch/kernel/cpu-probe.c
arch/loongarch/kernel/head.S
arch/loongarch/kernel/irq.c
arch/loongarch/kernel/process.c
arch/loongarch/kernel/setup.c
arch/loongarch/kernel/smp.c
arch/loongarch/kernel/traps.c
arch/loongarch/kernel/vmlinux.lds.S
arch/loongarch/mm/tlb.c
arch/mips/boot/dts/ingenic/x1000.dtsi
arch/mips/boot/dts/ingenic/x1830.dtsi
arch/mips/generic/board-ranchu.c
arch/mips/lantiq/falcon/sysctrl.c
arch/mips/lantiq/irq.c
arch/mips/lantiq/xway/sysctrl.c
arch/mips/mti-malta/malta-time.c
arch/mips/pic32/pic32mzda/init.c
arch/mips/pic32/pic32mzda/time.c
arch/mips/ralink/of.c
arch/mips/vr41xx/common/icu.c
arch/parisc/Kconfig
arch/parisc/include/asm/fb.h
arch/parisc/kernel/cache.c
arch/parisc/math-emu/decode_exc.c
arch/powerpc/Kconfig
arch/powerpc/include/asm/thread_info.h
arch/powerpc/kernel/Makefile
arch/powerpc/kernel/process.c
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/ptrace/ptrace-fpu.c
arch/powerpc/kernel/ptrace/ptrace.c
arch/powerpc/kernel/rtas.c
arch/powerpc/kernel/setup-common.c
arch/powerpc/kexec/crash.c
arch/powerpc/mm/nohash/kaslr_booke.c
arch/powerpc/platforms/microwatt/microwatt.h [new file with mode: 0644]
arch/powerpc/platforms/microwatt/rng.c
arch/powerpc/platforms/microwatt/setup.c
arch/powerpc/platforms/powernv/Makefile
arch/powerpc/platforms/powernv/powernv.h
arch/powerpc/platforms/powernv/rng.c
arch/powerpc/platforms/powernv/setup.c
arch/powerpc/platforms/pseries/papr_scm.c
arch/powerpc/platforms/pseries/pseries.h
arch/powerpc/platforms/pseries/rng.c
arch/powerpc/platforms/pseries/setup.c
arch/riscv/Kconfig
arch/riscv/Kconfig.erratas
arch/riscv/boot/dts/microchip/mpfs.dtsi
arch/riscv/include/asm/errata_list.h
arch/riscv/kernel/cpufeature.c
arch/riscv/kvm/vmid.c
arch/s390/Kconfig
arch/s390/Makefile
arch/s390/kernel/crash_dump.c
arch/s390/kernel/perf_cpum_cf.c
arch/s390/kernel/perf_pai_crypto.c
arch/s390/mm/init.c
arch/um/drivers/virt-pci.c
arch/x86/Kconfig
arch/x86/coco/tdx/tdx.c
arch/x86/hyperv/hv_init.c
arch/x86/hyperv/ivm.c
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/e820/api.h
arch/x86/include/asm/efi.h
arch/x86/include/asm/kvm_host.h
arch/x86/include/asm/mshyperv.h
arch/x86/include/asm/msr-index.h
arch/x86/include/asm/nospec-branch.h
arch/x86/include/asm/pci_x86.h
arch/x86/include/asm/setup.h
arch/x86/include/asm/uaccess.h
arch/x86/kernel/Makefile
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/ftrace_64.S
arch/x86/kernel/resource.c
arch/x86/kernel/setup.c
arch/x86/kernel/vmlinux.lds.S
arch/x86/kvm/lapic.c
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/tdp_iter.c
arch/x86/kvm/mmu/tdp_iter.h
arch/x86/kvm/mmu/tdp_mmu.c
arch/x86/kvm/svm/avic.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/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h
arch/x86/kvm/x86.c
arch/x86/kvm/xen.h
arch/x86/mm/mem_encrypt.c
arch/x86/mm/mem_encrypt_amd.c
arch/x86/net/bpf_jit_comp.c
arch/x86/pci/acpi.c
arch/x86/xen/enlighten_hvm.c
arch/x86/xen/enlighten_pv.c
arch/xtensa/kernel/entry.S
arch/xtensa/kernel/time.c
arch/xtensa/platforms/xtfpga/setup.c
block/bfq-iosched.c
block/bio.c
block/blk-core.c
block/blk-ia-ranges.c
block/blk-mq-debugfs.c
block/blk-mq-debugfs.h
block/blk-mq-sched.c
block/blk-mq.c
block/blk-rq-qos.c
block/blk-rq-qos.h
block/blk-sysfs.c
block/genhd.c
block/holder.c
block/kyber-iosched.c
block/mq-deadline.c
certs/.gitignore
certs/Makefile
certs/blacklist.c
certs/blacklist_hashes.c
certs/common.c [deleted file]
certs/common.h [deleted file]
certs/extract-cert.c
certs/system_keyring.c
crypto/Kconfig
crypto/Makefile
crypto/asymmetric_keys/Kconfig
crypto/asymmetric_keys/Makefile
crypto/asymmetric_keys/selftest.c [new file with mode: 0644]
crypto/asymmetric_keys/x509_loader.c [new file with mode: 0644]
crypto/asymmetric_keys/x509_parser.h
crypto/asymmetric_keys/x509_public_key.c
crypto/memneq.c [deleted file]
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/libata-transport.c
drivers/ata/pata_octeon_cf.c
drivers/base/cpu.c
drivers/base/init.c
drivers/base/memory.c
drivers/base/regmap/regmap-irq.c
drivers/base/regmap/regmap.c
drivers/block/xen-blkfront.c
drivers/bus/bt1-apb.c
drivers/bus/bt1-axi.c
drivers/bus/fsl-mc/fsl-mc-bus.c
drivers/char/Kconfig
drivers/char/hw_random/virtio-rng.c
drivers/char/lp.c
drivers/char/random.c
drivers/clocksource/hyperv_timer.c
drivers/comedi/drivers/vmk80xx.c
drivers/dma-buf/udmabuf.c
drivers/firewire/core-cdev.c
drivers/firewire/core-device.c
drivers/firmware/arm_scmi/base.c
drivers/firmware/arm_scmi/clock.c
drivers/firmware/arm_scmi/perf.c
drivers/firmware/arm_scmi/power.c
drivers/firmware/arm_scmi/protocols.h
drivers/firmware/arm_scmi/reset.c
drivers/firmware/arm_scmi/sensors.c
drivers/firmware/arm_scmi/voltage.c
drivers/firmware/efi/sysfb_efi.c
drivers/gpio/gpio-crystalcove.c
drivers/gpio/gpio-dln2.c
drivers/gpio/gpio-dwapb.c
drivers/gpio/gpio-grgpio.c
drivers/gpio/gpio-merrifield.c
drivers/gpio/gpio-mxs.c
drivers/gpio/gpio-realtek-otto.c
drivers/gpio/gpio-sch.c
drivers/gpio/gpio-vr41xx.c
drivers/gpio/gpio-wcove.c
drivers/gpio/gpio-winbond.c
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.h
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
drivers/gpu/drm/amd/amdgpu/nv.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
drivers/gpu/drm/amd/amdkfd/kfd_crat.c
drivers/gpu/drm/amd/amdkfd/kfd_device.c
drivers/gpu/drm/amd/amdkfd/kfd_migrate.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.h
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.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/dcn20/dcn20_dpp.c
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dccg.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c
drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr.h
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h
drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.c
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn31.h
drivers/gpu/drm/amd/display/include/ddc_service_types.h
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0_7_pptable.h
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v11_0_pptable.h
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0_7_pptable.h
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0_pptable.h
drivers/gpu/drm/ast/ast_dp.c
drivers/gpu/drm/ast/ast_dp501.c
drivers/gpu/drm/ast/ast_drv.h
drivers/gpu/drm/ast/ast_main.c
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/ast/ast_post.c
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
drivers/gpu/drm/bridge/ti-sn65dsi83.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_panel_orientation_quirks.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_mic.c
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dpll_mgr.c
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gt/intel_gt.c
drivers/gpu/drm/i915/gt/intel_gt_sysfs.c
drivers/gpu/drm/i915/gt/intel_gt_sysfs.h
drivers/gpu/drm/i915/gt/intel_gt_types.h
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
drivers/gpu/drm/i915/i915_drm_client.c
drivers/gpu/drm/i915/i915_sysfs.c
drivers/gpu/drm/i915/i915_vma.c
drivers/gpu/drm/imx/ipuv3-crtc.c
drivers/gpu/drm/msm/adreno/adreno_gpu.c
drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
drivers/gpu/drm/msm/dp/dp_ctrl.c
drivers/gpu/drm/msm/dp/dp_ctrl.h
drivers/gpu/drm/msm/dp/dp_display.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_drv.h
drivers/gpu/drm/msm/msm_fence.c
drivers/gpu/drm/msm/msm_gem.c
drivers/gpu/drm/msm/msm_gem.h
drivers/gpu/drm/msm/msm_gem_prime.c
drivers/gpu/drm/msm/msm_gem_submit.c
drivers/gpu/drm/msm/msm_gem_vma.c
drivers/gpu/drm/msm/msm_gpu.c
drivers/gpu/drm/msm/msm_iommu.c
drivers/gpu/drm/msm/msm_ringbuffer.c
drivers/gpu/drm/panfrost/panfrost_drv.c
drivers/gpu/drm/panfrost/panfrost_job.c
drivers/gpu/drm/panfrost/panfrost_job.h
drivers/gpu/drm/sun4i/sun4i_drv.c
drivers/gpu/drm/sun4i/sun4i_layer.c
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_device.c
drivers/gpu/drm/ttm/ttm_resource.c
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_gem.c
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hvs.c
drivers/gpu/drm/vc4/vc4_irq.c
drivers/gpu/drm/vc4/vc4_kms.c
drivers/gpu/drm/vc4/vc4_perfmon.c
drivers/gpu/drm/vc4/vc4_plane.c
drivers/gpu/drm/vc4/vc4_render_cl.c
drivers/gpu/drm/vc4/vc4_v3d.c
drivers/gpu/drm/vc4/vc4_validate.c
drivers/gpu/drm/vc4/vc4_validate_shaders.c
drivers/gpu/drm/xen/xen_drm_front_gem.c
drivers/hid/hid-hyperv.c
drivers/hv/channel_mgmt.c
drivers/hv/hv_kvp.c
drivers/hv/vmbus_drv.c
drivers/hwmon/asus-ec-sensors.c
drivers/hwmon/occ/common.c
drivers/i2c/busses/i2c-designware-common.c
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/i2c/busses/i2c-mt65xx.c
drivers/i2c/busses/i2c-npcm7xx.c
drivers/idle/intel_idle.c
drivers/iio/accel/bma180.c
drivers/iio/accel/kxcjk-1013.c
drivers/iio/accel/mma8452.c
drivers/iio/accel/mxc4005.c
drivers/iio/adc/adi-axi-adc.c
drivers/iio/adc/aspeed_adc.c
drivers/iio/adc/axp288_adc.c
drivers/iio/adc/rzg2l_adc.c
drivers/iio/adc/stm32-adc-core.c
drivers/iio/adc/stm32-adc.c
drivers/iio/adc/ti-ads131e08.c
drivers/iio/adc/xilinx-ams.c
drivers/iio/afe/iio-rescale.c
drivers/iio/chemical/ccs811.c
drivers/iio/frequency/admv1014.c
drivers/iio/gyro/mpu3050-core.c
drivers/iio/humidity/hts221_buffer.c
drivers/iio/imu/inv_icm42600/inv_icm42600.h
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
drivers/iio/magnetometer/yamaha-yas530.c
drivers/iio/proximity/sx9324.c
drivers/iio/test/Kconfig
drivers/iio/test/Makefile
drivers/iio/trigger/iio-trig-sysfs.c
drivers/input/joystick/Kconfig
drivers/input/misc/soc_button_array.c
drivers/input/mouse/bcm5974.c
drivers/iommu/ipmmu-vmsa.c
drivers/irqchip/Kconfig
drivers/irqchip/irq-apple-aic.c
drivers/irqchip/irq-gic-realview.c
drivers/irqchip/irq-gic-v3.c
drivers/irqchip/irq-loongson-liointc.c
drivers/irqchip/irq-realtek-rtl.c
drivers/irqchip/irq-uniphier-aidet.c
drivers/md/dm-core.h
drivers/md/dm-era-target.c
drivers/md/dm-log.c
drivers/md/dm-raid.c
drivers/md/dm-rq.c
drivers/md/dm-table.c
drivers/md/dm.c
drivers/md/dm.h
drivers/md/md.c
drivers/md/md.h
drivers/md/raid5-ppl.c
drivers/memory/Kconfig
drivers/memory/mtk-smi.c
drivers/memory/samsung/exynos5422-dmc.c
drivers/misc/atmel-ssc.c
drivers/misc/cardreader/rts5261.c
drivers/misc/eeprom/at25.c
drivers/misc/mei/hbm.c
drivers/misc/mei/hw-me-regs.h
drivers/misc/mei/hw-me.c
drivers/misc/mei/pci-me.c
drivers/mmc/core/block.c
drivers/mmc/host/mtk-sd.c
drivers/mmc/host/sdhci-pci-gli.c
drivers/mmc/host/sdhci-pci-o2micro.c
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
drivers/mtd/nand/raw/nand_ids.c
drivers/net/amt.c
drivers/net/bonding/bond_main.c
drivers/net/dsa/lantiq_gswip.c
drivers/net/dsa/mv88e6xxx/serdes.c
drivers/net/dsa/qca8k.c
drivers/net/dsa/qca8k.h
drivers/net/dsa/realtek/rtl8365mb.c
drivers/net/ethernet/altera/altera_tse_main.c
drivers/net/ethernet/amd/au1000_eth.c
drivers/net/ethernet/amd/au1000_eth.h
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/amd/xgbe/xgbe-platform.c
drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
drivers/net/ethernet/broadcom/bgmac-bcma.c
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h
drivers/net/ethernet/huawei/hinic/hinic_devlink.c
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
drivers/net/ethernet/intel/iavf/iavf_main.c
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_lib.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp.h
drivers/net/ethernet/intel/ice/ice_tc_lib.c
drivers/net/ethernet/intel/ice/ice_vf_lib.c
drivers/net/ethernet/intel/ice/ice_virtchnl.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c
drivers/net/ethernet/mediatek/mtk_eth_soc.c
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/dev.c
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
drivers/net/ethernet/mellanox/mlx5/core/en/params.c
drivers/net/ethernet/mellanox/mlx5/core/en_common.c
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.h
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_cnt.h
drivers/net/ethernet/netronome/nfp/flower/conntrack.c
drivers/net/ethernet/netronome/nfp/flower/match.c
drivers/net/ethernet/netronome/nfp/nfp_net_sriov.c
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
drivers/net/hamradio/6pack.c
drivers/net/phy/aquantia_main.c
drivers/net/phy/at803x.c
drivers/net/phy/dp83867.c
drivers/net/phy/mdio_bus.c
drivers/net/phy/smsc.c
drivers/net/usb/ax88179_178a.c
drivers/net/veth.c
drivers/net/virtio_net.c
drivers/nfc/nfcmrvl/usb.c
drivers/nfc/st21nfca/se.c
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
drivers/nvme/host/pci.c
drivers/platform/mellanox/Kconfig
drivers/platform/mellanox/nvsw-sn2201.c
drivers/platform/mips/Kconfig
drivers/platform/x86/barco-p50-gpio.c
drivers/platform/x86/gigabyte-wmi.c
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/intel/hid.c
drivers/platform/x86/intel/pmc/core.c
drivers/platform/x86/intel/pmt/crashlog.c
drivers/regulator/qcom_smd-regulator.c
drivers/scsi/ibmvscsi/ibmvfc.c
drivers/scsi/ibmvscsi/ibmvfc.h
drivers/scsi/ipr.c
drivers/scsi/lpfc/lpfc_crtn.h
drivers/scsi/lpfc/lpfc_ct.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/lpfc/lpfc_nvme.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_version.h
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/pmcraid.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_transport_iscsi.c
drivers/scsi/sd.c
drivers/scsi/storvsc_drv.c
drivers/scsi/vmw_pvscsi.h
drivers/soc/bcm/brcmstb/pm/pm-arm.c
drivers/soc/imx/imx8m-blk-ctrl.c
drivers/spi/spi-cadence.c
drivers/spi/spi-mem.c
drivers/spi/spi-rockchip.c
drivers/staging/olpc_dcon/Kconfig
drivers/staging/r8188eu/core/rtw_xmit.c
drivers/staging/r8188eu/os_dep/ioctl_linux.c
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
drivers/tty/goldfish.c
drivers/tty/n_gsm.c
drivers/tty/serial/8250/8250_port.c
drivers/tty/serial/qcom_geni_serial.c
drivers/tty/serial/serial_core.c
drivers/tty/sysrq.c
drivers/ufs/core/ufshcd.c
drivers/usb/cdns3/cdnsp-ring.c
drivers/usb/chipidea/udc.c
drivers/usb/dwc2/hcd.c
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-pci.c
drivers/usb/dwc3/gadget.c
drivers/usb/gadget/function/f_fs.c
drivers/usb/gadget/function/u_ether.c
drivers/usb/gadget/function/uvc_video.c
drivers/usb/gadget/legacy/raw_gadget.c
drivers/usb/gadget/udc/lpc32xx_udc.c
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/serial/io_ti.c
drivers/usb/serial/io_usbvend.h
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/typec/tcpm/Kconfig
drivers/vdpa/mlx5/net/mlx5_vnet.c
drivers/vdpa/vdpa_user/vduse_dev.c
drivers/vhost/vdpa.c
drivers/vhost/vringh.c
drivers/video/console/sticore.c
drivers/video/fbdev/au1100fb.c
drivers/video/fbdev/cirrusfb.c
drivers/video/fbdev/intelfb/intelfbdrv.c
drivers/video/fbdev/intelfb/intelfbhw.c
drivers/video/fbdev/omap/sossi.c
drivers/video/fbdev/omap2/omapfb/dss/hdmi_phy.c
drivers/video/fbdev/pxa3xx-gcu.c
drivers/video/fbdev/simplefb.c
drivers/video/fbdev/skeletonfb.c
drivers/virtio/Kconfig
drivers/virtio/virtio.c
drivers/virtio/virtio_mmio.c
drivers/virtio/virtio_pci_modern_dev.c
drivers/watchdog/gxp-wdt.c
drivers/xen/Kconfig
drivers/xen/Makefile
drivers/xen/features.c
drivers/xen/gntdev-common.h
drivers/xen/gntdev.c
drivers/xen/grant-dma-iommu.c [new file with mode: 0644]
drivers/xen/grant-dma-ops.c [new file with mode: 0644]
drivers/xen/grant-table.c
drivers/xen/xlate_mmu.c
fs/9p/cache.c
fs/9p/fid.c
fs/9p/v9fs.c
fs/9p/v9fs.h
fs/9p/vfs_addr.c
fs/9p/vfs_inode.c
fs/9p/vfs_inode_dotl.c
fs/afs/callback.c
fs/afs/dir.c
fs/afs/dir_edit.c
fs/afs/dir_silly.c
fs/afs/dynroot.c
fs/afs/file.c
fs/afs/fs_operation.c
fs/afs/inode.c
fs/afs/internal.h
fs/afs/super.c
fs/afs/volume.c
fs/afs/write.c
fs/attr.c
fs/btrfs/block-group.h
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/locking.c
fs/btrfs/reflink.c
fs/btrfs/super.c
fs/btrfs/zoned.c
fs/btrfs/zoned.h
fs/ceph/addr.c
fs/ceph/cache.c
fs/ceph/cache.h
fs/ceph/caps.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/snap.c
fs/ceph/super.c
fs/ceph/super.h
fs/ceph/xattr.c
fs/cifs/cifs_debug.c
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/cifsglob.h
fs/cifs/cifsproto.h
fs/cifs/connect.c
fs/cifs/file.c
fs/cifs/fscache.c
fs/cifs/fscache.h
fs/cifs/inode.c
fs/cifs/misc.c
fs/cifs/sess.c
fs/cifs/smb2ops.c
fs/cifs/smb2pdu.c
fs/cifs/trace.h
fs/exfat/namei.c
fs/ext2/dir.c
fs/ext2/inode.c
fs/ext4/inode.c
fs/ext4/mballoc.c
fs/ext4/migrate.c
fs/ext4/namei.c
fs/ext4/page-io.c
fs/ext4/resize.c
fs/ext4/super.c
fs/ext4/xattr.c
fs/f2fs/iostat.c
fs/f2fs/namei.c
fs/f2fs/node.c
fs/fs-writeback.c
fs/hugetlbfs/inode.c
fs/inode.c
fs/io_uring.c
fs/jbd2/transaction.c
fs/netfs/buffered_read.c
fs/netfs/internal.h
fs/netfs/objects.c
fs/nfs/callback_proc.c
fs/nfs/dir.c
fs/nfs/nfs4file.c
fs/nfs/pnfs.c
fs/nfs/pnfs.h
fs/nfsd/filecache.c
fs/quota/dquot.c
fs/tracefs/inode.c
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_attr.h
fs/xfs/libxfs/xfs_attr_leaf.c
fs/xfs/libxfs/xfs_da_btree.h
fs/xfs/xfs_attr_item.c
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_xattr.c
fs/zonefs/super.c
include/asm-generic/Kbuild
include/asm-generic/platform-feature.h [new file with mode: 0644]
include/drm/drm_atomic.h
include/drm/ttm/ttm_resource.h
include/dt-bindings/clock/exynos7885.h
include/dt-bindings/clock/qcom,dispcc-sm8350.h [new symlink]
include/dt-bindings/clock/qcom,gcc-ipq8074.h
include/dt-bindings/clock/qcom,gpucc-sm8350.h [new file with mode: 0644]
include/dt-bindings/clock/qcom,sm8450-camcc.h [new file with mode: 0644]
include/dt-bindings/clock/tegra234-clock.h
include/dt-bindings/mailbox/qcom-ipcc.h
include/dt-bindings/memory/tegra234-mc.h
include/dt-bindings/net/pcs-rzn1-miic.h [new file with mode: 0644]
include/dt-bindings/power/tegra234-powergate.h
include/dt-bindings/reset/tegra234-reset.h
include/dt-bindings/soc/samsung,boot-mode.h [new file with mode: 0644]
include/keys/asymmetric-type.h
include/linux/backing-dev.h
include/linux/bio.h
include/linux/blkdev.h
include/linux/console.h
include/linux/cpu.h
include/linux/crc-itu-t.h
include/linux/gpio/driver.h
include/linux/libata.h
include/linux/mm.h
include/linux/mm_types.h
include/linux/netfs.h
include/linux/nvme.h
include/linux/objtool.h
include/linux/platform-feature.h [new file with mode: 0644]
include/linux/printk.h
include/linux/random.h
include/linux/ratelimit_types.h
include/linux/scmi_protocol.h
include/linux/serial_core.h
include/linux/sunrpc/xdr.h
include/linux/vdpa.h
include/linux/virtio_config.h
include/linux/visorbus.h [deleted file]
include/linux/vmalloc.h
include/linux/workqueue.h
include/linux/xarray.h
include/net/flow_offload.h
include/net/inet_connection_sock.h
include/net/inet_hashtables.h
include/net/inet_sock.h
include/net/ipv6.h
include/net/netfilter/nf_tables.h
include/net/netfilter/nf_tables_offload.h
include/net/sock.h
include/trace/events/io_uring.h
include/trace/events/libata.h
include/trace/events/workqueue.h
include/uapi/linux/io_uring.h
include/uapi/linux/tls.h
include/xen/arm/xen-ops.h [new file with mode: 0644]
include/xen/grant_table.h
include/xen/xen-ops.h
include/xen/xen.h
init/Kconfig
kernel/Makefile
kernel/auditsc.c
kernel/bpf/btf.c
kernel/cfi.c
kernel/dma/debug.c
kernel/dma/direct.c
kernel/dma/swiotlb.c
kernel/entry/kvm.c
kernel/hung_task.c
kernel/irq/chip.c
kernel/kthread.c
kernel/locking/lockdep.c
kernel/panic.c
kernel/platform-feature.c [new file with mode: 0644]
kernel/power/hibernate.c
kernel/printk/printk.c
kernel/rcu/tree_stall.h
kernel/reboot.c
kernel/sched/core.c
kernel/sched/sched.h
kernel/trace/blktrace.c
kernel/trace/bpf_trace.c
kernel/trace/ftrace.c
kernel/trace/rethook.c
kernel/trace/trace.c
kernel/trace/trace_kprobe.c
kernel/trace/trace_uprobe.c
kernel/watchdog.c
kernel/watchdog_hld.c
kernel/workqueue.c
lib/Kconfig
lib/Kconfig.ubsan
lib/Makefile
lib/crc-itu-t.c
lib/crypto/Kconfig
lib/iov_iter.c
lib/memneq.c [new file with mode: 0644]
lib/vsprintf.c
lib/xarray.c
mm/backing-dev.c
mm/damon/reclaim.c
mm/filemap.c
mm/huge_memory.c
mm/hwpoison-inject.c
mm/kfence/core.c
mm/madvise.c
mm/memcontrol.c
mm/memory-failure.c
mm/migrate.c
mm/page_isolation.c
mm/readahead.c
mm/slub.c
mm/swap.c
mm/usercopy.c
mm/vmalloc.c
net/ax25/af_ax25.c
net/core/dev.c
net/core/filter.c
net/core/flow_offload.c
net/core/net-sysfs.c
net/core/skmsg.c
net/dccp/proto.c
net/ethtool/eeprom.c
net/ipv4/inet_connection_sock.c
net/ipv4/inet_hashtables.c
net/ipv4/ip_gre.c
net/ipv4/ping.c
net/ipv4/tcp.c
net/ipv4/tcp_bpf.c
net/ipv4/xfrm4_protocol.c
net/ipv6/ip6_gre.c
net/ipv6/ip6_output.c
net/ipv6/seg6_hmac.c
net/ipv6/seg6_local.c
net/l2tp/l2tp_ip6.c
net/netfilter/nf_dup_netdev.c
net/netfilter/nf_tables_api.c
net/netfilter/nf_tables_offload.c
net/netfilter/nfnetlink_cttimeout.c
net/netfilter/nft_meta.c
net/netfilter/nft_nat.c
net/netfilter/nft_numgen.c
net/openvswitch/actions.c
net/openvswitch/conntrack.c
net/openvswitch/flow.c
net/sched/sch_netem.c
net/sunrpc/clnt.c
net/sunrpc/xdr.c
net/sunrpc/xprtrdma/svc_rdma_rw.c
net/tipc/core.c
net/tls/tls_main.c
net/unix/af_unix.c
net/xdp/xsk.c
net/xdp/xsk_queue.h
samples/fprobe/fprobe_example.c
scripts/Makefile.build
scripts/check-local-export
scripts/faddr2line
scripts/gdb/linux/config.py
scripts/gen_autoksyms.sh
scripts/mod/modpost.c
scripts/nsdeps
scripts/sign-file.c
security/keys/trusted-keys/trusted_tpm2.c
security/selinux/hooks.c
sound/core/memalloc.c
sound/hda/hdac_device.c
sound/hda/hdac_i915.c
sound/hda/intel-dsp-config.c
sound/hda/intel-nhlt.c
sound/pci/hda/hda_auto_parser.c
sound/pci/hda/hda_intel.c
sound/pci/hda/hda_local.h
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c
sound/pci/hda/patch_via.c
sound/soc/codecs/cs35l36.c
sound/soc/codecs/cs42l51.c
sound/soc/codecs/cs42l52.c
sound/soc/codecs/cs42l56.c
sound/soc/codecs/cs53l30.c
sound/soc/codecs/es8328.c
sound/soc/codecs/nau8822.c
sound/soc/codecs/nau8822.h
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm_adsp.c
sound/soc/fsl/fsl_sai.c
sound/soc/intel/boards/sof_cirrus_common.c
sound/soc/qcom/lpass-platform.c
sound/soc/sof/sof-audio.c
sound/soc/sof/sof-client-ipc-msg-injector.c
sound/usb/mixer_us16x08.c
sound/usb/pcm.c
sound/usb/quirks-table.h
sound/x86/intel_hdmi_audio.c
tools/arch/arm64/include/asm/cputype.h
tools/arch/x86/include/asm/cpufeatures.h
tools/arch/x86/include/asm/disabled-features.h
tools/arch/x86/include/asm/msr-index.h
tools/arch/x86/include/uapi/asm/kvm.h
tools/arch/x86/include/uapi/asm/svm.h
tools/include/linux/objtool.h
tools/include/uapi/drm/i915_drm.h
tools/include/uapi/linux/prctl.h
tools/include/uapi/linux/vhost.h
tools/kvm/kvm_stat/kvm_stat
tools/lib/perf/evsel.c
tools/perf/builtin-inject.c
tools/perf/builtin-stat.c
tools/perf/tests/bp_account.c
tools/perf/tests/expr.c
tools/perf/tests/shell/lib/perf_csv_output_lint.py [deleted file]
tools/perf/tests/shell/stat+csv_output.sh
tools/perf/tests/shell/test_arm_callgraph_fp.sh
tools/perf/tests/topology.c
tools/perf/trace/beauty/arch_errno_names.sh
tools/perf/trace/beauty/include/linux/socket.h
tools/perf/util/arm-spe.c
tools/perf/util/build-id.c
tools/perf/util/expr.l
tools/perf/util/header.c
tools/perf/util/header.h
tools/perf/util/metricgroup.c
tools/perf/util/unwind-libunwind-local.c
tools/testing/selftests/bpf/prog_tests/bpf_cookie.c
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c
tools/testing/selftests/bpf/prog_tests/tailcalls.c
tools/testing/selftests/bpf/progs/freplace_global_func.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/kprobe_multi.c
tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c [new file with mode: 0644]
tools/testing/selftests/dma/Makefile
tools/testing/selftests/dma/dma_map_benchmark.c
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/dirty_log_perf_test.c
tools/testing/selftests/kvm/include/perf_test_util.h
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/include/x86_64/vmx.h
tools/testing/selftests/kvm/lib/aarch64/ucall.c
tools/testing/selftests/kvm/lib/perf_test_util.c
tools/testing/selftests/kvm/lib/x86_64/perf_test_util.c [new file with mode: 0644]
tools/testing/selftests/kvm/lib/x86_64/processor.c
tools/testing/selftests/kvm/lib/x86_64/vmx.c
tools/testing/selftests/kvm/max_guest_memory_test.c
tools/testing/selftests/kvm/x86_64/hyperv_clock.c
tools/testing/selftests/kvm/x86_64/mmu_role_test.c
tools/testing/selftests/lib.mk
tools/testing/selftests/net/.gitignore
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/bind_bhash_test.c [deleted file]
tools/testing/selftests/net/bpf/Makefile
tools/testing/selftests/net/fcnal-test.sh
tools/testing/selftests/netfilter/nft_concat_range.sh
tools/testing/selftests/netfilter/nft_nat.sh
tools/testing/selftests/vm/gup_test.c
tools/testing/selftests/vm/ksm_tests.c
tools/testing/selftests/wireguard/qemu/Makefile
tools/testing/selftests/wireguard/qemu/init.c
tools/testing/selftests/wireguard/qemu/kernel.config
virt/kvm/kvm_main.c

index 825fae8..2ed1cf8 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -10,6 +10,8 @@
 # Please keep this list dictionary sorted.
 #
 Aaron Durbin <adurbin@google.com>
+Abel Vesa <abelvesa@kernel.org> <abel.vesa@nxp.com>
+Abel Vesa <abelvesa@kernel.org> <abelvesa@gmail.com>
 Abhinav Kumar <quic_abhinavk@quicinc.com> <abhinavk@codeaurora.org>
 Adam Oldham <oldhamca@gmail.com>
 Adam Radford <aradford@gmail.com>
@@ -85,6 +87,7 @@ 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>
+Christian Marangi <ansuelsmth@gmail.com>
 Christophe Ricard <christophe.ricard@gmail.com>
 Christoph Hellwig <hch@lst.de>
 Colin Ian King <colin.king@intel.com> <colin.king@canonical.com>
@@ -165,6 +168,7 @@ Jan Glauber <jan.glauber@gmail.com> <jang@de.ibm.com>
 Jan Glauber <jan.glauber@gmail.com> <jang@linux.vnet.ibm.com>
 Jan Glauber <jan.glauber@gmail.com> <jglauber@cavium.com>
 Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@linux.intel.com>
+Jarkko Sakkinen <jarkko@kernel.org> <jarkko@profian.com>
 Jason Gunthorpe <jgg@ziepe.ca> <jgg@mellanox.com>
 Jason Gunthorpe <jgg@ziepe.ca> <jgg@nvidia.com>
 Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com>
index 2f726c9..3daecac 100644 (file)
@@ -107,13 +107,14 @@ Description:
                                described in ATA8 7.16 and 7.17. Only valid if
                                the device is not a PM.
 
-               pio_mode:       (RO) Transfer modes supported by the device when
-                               in PIO mode. Mostly used by PATA device.
+               pio_mode:       (RO) PIO transfer mode used by the device.
+                               Mostly used by PATA devices.
 
-               xfer_mode:      (RO) Current transfer mode
+               xfer_mode:      (RO) Current transfer mode. Mostly used by
+                               PATA devices.
 
-               dma_mode:       (RO) Transfer modes supported by the device when
-                               in DMA mode. Mostly used by PATA device.
+               dma_mode:       (RO) DMA transfer mode used by the device.
+                               Mostly used by PATA devices.
 
                class:          (RO) Device class. Can be "ata" for disk,
                                "atapi" for packet device, "pmp" for PM, or
index 308a675..491ead8 100644 (file)
@@ -1,4 +1,4 @@
-What:          /sys/bus/iio/devices/iio:deviceX/conversion_mode
+What:          /sys/bus/iio/devices/iio:deviceX/in_conversion_mode
 KernelVersion: 4.2
 Contact:       linux-iio@vger.kernel.org
 Description:
index 2ad01ca..bcc974d 100644 (file)
@@ -526,6 +526,7 @@ What:               /sys/devices/system/cpu/vulnerabilities
                /sys/devices/system/cpu/vulnerabilities/srbds
                /sys/devices/system/cpu/vulnerabilities/tsx_async_abort
                /sys/devices/system/cpu/vulnerabilities/itlb_multihit
+               /sys/devices/system/cpu/vulnerabilities/mmio_stale_data
 Date:          January 2018
 Contact:       Linux kernel mailing list <linux-kernel@vger.kernel.org>
 Description:   Information about CPU vulnerabilities
index 42214b4..90596d8 100644 (file)
@@ -26,6 +26,6 @@ Description:  Read/write the current state of DDR Backup Mode, which controls
                     DDR Backup Mode must be explicitly enabled by the user,
                     to invoke step 1.
 
-               See also Documentation/devicetree/bindings/mfd/bd9571mwv.txt.
+               See also Documentation/devicetree/bindings/mfd/rohm,bd9571mwv.yaml.
 Users:         User space applications for embedded boards equipped with a
                BD9571MWV PMIC.
index 8cbc711..4df436e 100644 (file)
@@ -17,3 +17,4 @@ are configurable at compile, boot or run time.
    special-register-buffer-data-sampling.rst
    core-scheduling.rst
    l1d_flush.rst
+   processor_mmio_stale_data.rst
diff --git a/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst b/Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
new file mode 100644 (file)
index 0000000..9393c50
--- /dev/null
@@ -0,0 +1,246 @@
+=========================================
+Processor MMIO Stale Data Vulnerabilities
+=========================================
+
+Processor MMIO Stale Data Vulnerabilities are a class of memory-mapped I/O
+(MMIO) vulnerabilities that can expose data. The sequences of operations for
+exposing data range from simple to very complex. Because most of the
+vulnerabilities require the attacker to have access to MMIO, many environments
+are not affected. System environments using virtualization where MMIO access is
+provided to untrusted guests may need mitigation. These vulnerabilities are
+not transient execution attacks. However, these vulnerabilities may propagate
+stale data into core fill buffers where the data can subsequently be inferred
+by an unmitigated transient execution attack. Mitigation for these
+vulnerabilities includes a combination of microcode update and software
+changes, depending on the platform and usage model. Some of these mitigations
+are similar to those used to mitigate Microarchitectural Data Sampling (MDS) or
+those used to mitigate Special Register Buffer Data Sampling (SRBDS).
+
+Data Propagators
+================
+Propagators are operations that result in stale data being copied or moved from
+one microarchitectural buffer or register to another. Processor MMIO Stale Data
+Vulnerabilities are operations that may result in stale data being directly
+read into an architectural, software-visible state or sampled from a buffer or
+register.
+
+Fill Buffer Stale Data Propagator (FBSDP)
+-----------------------------------------
+Stale data may propagate from fill buffers (FB) into the non-coherent portion
+of the uncore on some non-coherent writes. Fill buffer propagation by itself
+does not make stale data architecturally visible. Stale data must be propagated
+to a location where it is subject to reading or sampling.
+
+Sideband Stale Data Propagator (SSDP)
+-------------------------------------
+The sideband stale data propagator (SSDP) is limited to the client (including
+Intel Xeon server E3) uncore implementation. The sideband response buffer is
+shared by all client cores. For non-coherent reads that go to sideband
+destinations, the uncore logic returns 64 bytes of data to the core, including
+both requested data and unrequested stale data, from a transaction buffer and
+the sideband response buffer. As a result, stale data from the sideband
+response and transaction buffers may now reside in a core fill buffer.
+
+Primary Stale Data Propagator (PSDP)
+------------------------------------
+The primary stale data propagator (PSDP) is limited to the client (including
+Intel Xeon server E3) uncore implementation. Similar to the sideband response
+buffer, the primary response buffer is shared by all client cores. For some
+processors, MMIO primary reads will return 64 bytes of data to the core fill
+buffer including both requested data and unrequested stale data. This is
+similar to the sideband stale data propagator.
+
+Vulnerabilities
+===============
+Device Register Partial Write (DRPW) (CVE-2022-21166)
+-----------------------------------------------------
+Some endpoint MMIO registers incorrectly handle writes that are smaller than
+the register size. Instead of aborting the write or only copying the correct
+subset of bytes (for example, 2 bytes for a 2-byte write), more bytes than
+specified by the write transaction may be written to the register. On
+processors affected by FBSDP, this may expose stale data from the fill buffers
+of the core that created the write transaction.
+
+Shared Buffers Data Sampling (SBDS) (CVE-2022-21125)
+----------------------------------------------------
+After propagators may have moved data around the uncore and copied stale data
+into client core fill buffers, processors affected by MFBDS can leak data from
+the fill buffer. It is limited to the client (including Intel Xeon server E3)
+uncore implementation.
+
+Shared Buffers Data Read (SBDR) (CVE-2022-21123)
+------------------------------------------------
+It is similar to Shared Buffer Data Sampling (SBDS) except that the data is
+directly read into the architectural software-visible state. It is limited to
+the client (including Intel Xeon server E3) uncore implementation.
+
+Affected Processors
+===================
+Not all the CPUs are affected by all the variants. For instance, most
+processors for the server market (excluding Intel Xeon E3 processors) are
+impacted by only Device Register Partial Write (DRPW).
+
+Below is the list of affected Intel processors [#f1]_:
+
+   ===================  ============  =========
+   Common name          Family_Model  Steppings
+   ===================  ============  =========
+   HASWELL_X            06_3FH        2,4
+   SKYLAKE_L            06_4EH        3
+   BROADWELL_X          06_4FH        All
+   SKYLAKE_X            06_55H        3,4,6,7,11
+   BROADWELL_D          06_56H        3,4,5
+   SKYLAKE              06_5EH        3
+   ICELAKE_X            06_6AH        4,5,6
+   ICELAKE_D            06_6CH        1
+   ICELAKE_L            06_7EH        5
+   ATOM_TREMONT_D       06_86H        All
+   LAKEFIELD            06_8AH        1
+   KABYLAKE_L           06_8EH        9 to 12
+   ATOM_TREMONT         06_96H        1
+   ATOM_TREMONT_L       06_9CH        0
+   KABYLAKE             06_9EH        9 to 13
+   COMETLAKE            06_A5H        2,3,5
+   COMETLAKE_L          06_A6H        0,1
+   ROCKETLAKE           06_A7H        1
+   ===================  ============  =========
+
+If a CPU is in the affected processor list, but not affected by a variant, it
+is indicated by new bits in MSR IA32_ARCH_CAPABILITIES. As described in a later
+section, mitigation largely remains the same for all the variants, i.e. to
+clear the CPU fill buffers via VERW instruction.
+
+New bits in MSRs
+================
+Newer processors and microcode update on existing affected processors added new
+bits to IA32_ARCH_CAPABILITIES MSR. These bits can be used to enumerate
+specific variants of Processor MMIO Stale Data vulnerabilities and mitigation
+capability.
+
+MSR IA32_ARCH_CAPABILITIES
+--------------------------
+Bit 13 - SBDR_SSDP_NO - When set, processor is not affected by either the
+        Shared Buffers Data Read (SBDR) vulnerability or the sideband stale
+        data propagator (SSDP).
+Bit 14 - FBSDP_NO - When set, processor is not affected by the Fill Buffer
+        Stale Data Propagator (FBSDP).
+Bit 15 - PSDP_NO - When set, processor is not affected by Primary Stale Data
+        Propagator (PSDP).
+Bit 17 - FB_CLEAR - When set, VERW instruction will overwrite CPU fill buffer
+        values as part of MD_CLEAR operations. Processors that do not
+        enumerate MDS_NO (meaning they are affected by MDS) but that do
+        enumerate support for both L1D_FLUSH and MD_CLEAR implicitly enumerate
+        FB_CLEAR as part of their MD_CLEAR support.
+Bit 18 - FB_CLEAR_CTRL - Processor supports read and write to MSR
+        IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]. On such processors, the FB_CLEAR_DIS
+        bit can be set to cause the VERW instruction to not perform the
+        FB_CLEAR action. Not all processors that support FB_CLEAR will support
+        FB_CLEAR_CTRL.
+
+MSR IA32_MCU_OPT_CTRL
+---------------------
+Bit 3 - FB_CLEAR_DIS - When set, VERW instruction does not perform the FB_CLEAR
+action. This may be useful to reduce the performance impact of FB_CLEAR in
+cases where system software deems it warranted (for example, when performance
+is more critical, or the untrusted software has no MMIO access). Note that
+FB_CLEAR_DIS has no impact on enumeration (for example, it does not change
+FB_CLEAR or MD_CLEAR enumeration) and it may not be supported on all processors
+that enumerate FB_CLEAR.
+
+Mitigation
+==========
+Like MDS, all variants of Processor MMIO Stale Data vulnerabilities  have the
+same mitigation strategy to force the CPU to clear the affected buffers before
+an attacker can extract the secrets.
+
+This is achieved by using the otherwise unused and obsolete VERW instruction in
+combination with a microcode update. The microcode clears the affected CPU
+buffers when the VERW instruction is executed.
+
+Kernel reuses the MDS function to invoke the buffer clearing:
+
+       mds_clear_cpu_buffers()
+
+On MDS affected CPUs, the kernel already invokes CPU buffer clear on
+kernel/userspace, hypervisor/guest and C-state (idle) transitions. No
+additional mitigation is needed on such CPUs.
+
+For CPUs not affected by MDS or TAA, mitigation is needed only for the attacker
+with MMIO capability. Therefore, VERW is not required for kernel/userspace. For
+virtualization case, VERW is only needed at VMENTER for a guest with MMIO
+capability.
+
+Mitigation points
+-----------------
+Return to user space
+^^^^^^^^^^^^^^^^^^^^
+Same mitigation as MDS when affected by MDS/TAA, otherwise no mitigation
+needed.
+
+C-State transition
+^^^^^^^^^^^^^^^^^^
+Control register writes by CPU during C-state transition can propagate data
+from fill buffer to uncore buffers. Execute VERW before C-state transition to
+clear CPU fill buffers.
+
+Guest entry point
+^^^^^^^^^^^^^^^^^
+Same mitigation as MDS when processor is also affected by MDS/TAA, otherwise
+execute VERW at VMENTER only for MMIO capable guests. On CPUs not affected by
+MDS/TAA, guest without MMIO access cannot extract secrets using Processor MMIO
+Stale Data vulnerabilities, so there is no need to execute VERW for such guests.
+
+Mitigation control on the kernel command line
+---------------------------------------------
+The kernel command line allows to control the Processor MMIO Stale Data
+mitigations at boot time with the option "mmio_stale_data=". The valid
+arguments for this option are:
+
+  ==========  =================================================================
+  full        If the CPU is vulnerable, enable mitigation; CPU buffer clearing
+              on exit to userspace and when entering a VM. Idle transitions are
+              protected as well. It does not automatically disable SMT.
+  full,nosmt  Same as full, with SMT disabled on vulnerable CPUs. This is the
+              complete mitigation.
+  off         Disables mitigation completely.
+  ==========  =================================================================
+
+If the CPU is affected and mmio_stale_data=off is not supplied on the kernel
+command line, then the kernel selects the appropriate mitigation.
+
+Mitigation status information
+-----------------------------
+The Linux kernel provides a sysfs interface to enumerate the current
+vulnerability status of the system: whether the system is vulnerable, and
+which mitigations are active. The relevant sysfs file is:
+
+       /sys/devices/system/cpu/vulnerabilities/mmio_stale_data
+
+The possible values in this file are:
+
+  .. list-table::
+
+     * - 'Not affected'
+       - The processor is not vulnerable
+     * - 'Vulnerable'
+       - The processor is vulnerable, but no mitigation enabled
+     * - 'Vulnerable: Clear CPU buffers attempted, no microcode'
+       - The processor is vulnerable, but microcode is not updated. The
+         mitigation is enabled on a best effort basis.
+     * - 'Mitigation: Clear CPU buffers'
+       - The processor is vulnerable and the CPU buffer clearing mitigation is
+         enabled.
+
+If the processor is vulnerable then the following information is appended to
+the above information:
+
+  ========================  ===========================================
+  'SMT vulnerable'          SMT is enabled
+  'SMT disabled'            SMT is disabled
+  'SMT Host state unknown'  Kernel runs in a VM, Host SMT state unknown
+  ========================  ===========================================
+
+References
+----------
+.. [#f1] Affected Processors
+   https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
index 8090130..2522b11 100644 (file)
 
                        protected: nVHE-based mode with support for guests whose
                                   state is kept private from the host.
-                                  Not valid if the kernel is running in EL2.
 
                        Defaults to VHE/nVHE based on hardware support. Setting
                        mode to "protected" will disable kexec and hibernation
                                               srbds=off [X86,INTEL]
                                               no_entry_flush [PPC]
                                               no_uaccess_flush [PPC]
+                                              mmio_stale_data=off [X86]
 
                                Exceptions:
                                               This does not have any effect on
                                Equivalent to: l1tf=flush,nosmt [X86]
                                               mds=full,nosmt [X86]
                                               tsx_async_abort=full,nosmt [X86]
+                                              mmio_stale_data=full,nosmt [X86]
 
        mminit_loglevel=
                        [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
                        log everything. Information is printed at KERN_DEBUG
                        so loglevel=8 may also need to be specified.
 
+       mmio_stale_data=
+                       [X86,INTEL] Control mitigation for the Processor
+                       MMIO Stale Data vulnerabilities.
+
+                       Processor MMIO Stale Data is a class of
+                       vulnerabilities that may expose data after an MMIO
+                       operation. Exposed data could originate or end in
+                       the same CPU buffers as affected by MDS and TAA.
+                       Therefore, similar to MDS and TAA, the mitigation
+                       is to clear the affected CPU buffers.
+
+                       This parameter controls the mitigation. The
+                       options are:
+
+                       full       - Enable mitigation on vulnerable CPUs
+
+                       full,nosmt - Enable mitigation and disable SMT on
+                                    vulnerable CPUs.
+
+                       off        - Unconditionally disable mitigation
+
+                       On MDS or TAA affected machines,
+                       mmio_stale_data=off can be prevented by an active
+                       MDS or TAA mitigation as these vulnerabilities are
+                       mitigated with the same mechanism so in order to
+                       disable this mitigation, you need to specify
+                       mds=off and tsx_async_abort=off too.
+
+                       Not specifying this option is equivalent to
+                       mmio_stale_data=full.
+
+                       For details see:
+                       Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
+
        module.sig_enforce
                        [KNL] When CONFIG_MODULE_SIG is set, this means that
                        modules without (valid) signatures will fail to load.
diff --git a/Documentation/arm/google/chromebook-boot-flow.rst b/Documentation/arm/google/chromebook-boot-flow.rst
new file mode 100644 (file)
index 0000000..36da776
--- /dev/null
@@ -0,0 +1,69 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+======================================
+Chromebook Boot Flow
+======================================
+
+Most recent Chromebooks that use device tree are using the opensource
+depthcharge_ bootloader. Depthcharge_ expects the OS to be packaged as a `FIT
+Image`_ which contains an OS image as well as a collection of device trees. It
+is up to depthcharge_ to pick the right device tree from the `FIT Image`_ and
+provide it to the OS.
+
+The scheme that depthcharge_ uses to pick the device tree takes into account
+three variables:
+
+- Board name, specified at depthcharge_ compile time. This is $(BOARD) below.
+- Board revision number, determined at runtime (perhaps by reading GPIO
+  strappings, perhaps via some other method). This is $(REV) below.
+- SKU number, read from GPIO strappings at boot time. This is $(SKU) below.
+
+For recent Chromebooks, depthcharge_ creates a match list that looks like this:
+
+- google,$(BOARD)-rev$(REV)-sku$(SKU)
+- google,$(BOARD)-rev$(REV)
+- google,$(BOARD)-sku$(SKU)
+- google,$(BOARD)
+
+Note that some older Chromebooks use a slightly different list that may
+not include SKU matching or may prioritize SKU/rev differently.
+
+Note that for some boards there may be extra board-specific logic to inject
+extra compatibles into the list, but this is uncommon.
+
+Depthcharge_ will look through all device trees in the `FIT Image`_ trying to
+find one that matches the most specific compatible. It will then look
+through all device trees in the `FIT Image`_ trying to find the one that
+matches the *second most* specific compatible, etc.
+
+When searching for a device tree, depthcharge_ doesn't care where the
+compatible string falls within a device tree's root compatible string array.
+As an example, if we're on board "lazor", rev 4, SKU 0 and we have two device
+trees:
+
+- "google,lazor-rev5-sku0", "google,lazor-rev4-sku0", "qcom,sc7180"
+- "google,lazor", "qcom,sc7180"
+
+Then depthcharge_ will pick the first device tree even though
+"google,lazor-rev4-sku0" was the second compatible listed in that device tree.
+This is because it is a more specific compatible than "google,lazor".
+
+It should be noted that depthcharge_ does not have any smarts to try to
+match board or SKU revisions that are "close by". That is to say that
+if depthcharge_ knows it's on "rev4" of a board but there is no "rev4"
+device tree then depthcharge_ *won't* look for a "rev3" device tree.
+
+In general when any significant changes are made to a board the board
+revision number is increased even if none of those changes need to
+be reflected in the device tree. Thus it's fairly common to see device
+trees with multiple revisions.
+
+It should be noted that, taking into account the above system that
+depthcharge_ has, the most flexibility is achieved if the device tree
+supporting the newest revision(s) of a board omits the "-rev{REV}"
+compatible strings. When this is done then if you get a new board
+revision and try to run old software on it then we'll at pick the
+newest device tree we know about.
+
+.. _depthcharge: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/depthcharge/
+.. _`FIT Image`: https://doc.coreboot.org/lib/payloads/fit.html
index 2bda546..495ada7 100644 (file)
@@ -31,6 +31,8 @@ SoC-specific documents
 .. toctree::
    :maxdepth: 1
 
+   google/chromebook-boot-flow
+
    ixp4xx
 
    marvell
index b256f97..1dc6c39 100644 (file)
@@ -34,7 +34,7 @@ CPU so it is usually wise not to overlap any physical RAM with
 the TCM.
 
 The TCM memory can then be remapped to another address again using
-the MMU, but notice that the TCM if often used in situations where
+the MMU, but notice that the TCM is often used in situations where
 the MMU is turned off. To avoid confusion the current Linux
 implementation will map the TCM 1 to 1 from physical to virtual
 memory in the location specified by the kernel. Currently Linux
index 8ba677b..937147f 100644 (file)
@@ -371,7 +371,7 @@ The regset data starts with struct user_za_header, containing:
 Appendix A.  SME programmer's model (informative)
 =================================================
 
-This section provides a minimal description of the additions made by SVE to the
+This section provides a minimal description of the additions made by SME to the
 ARMv8-A programmer's model that are relevant to this document.
 
 Note: This section is for information only and not intended to be complete or
index 5e2017c..e6de1d7 100644 (file)
@@ -25,7 +25,14 @@ properties:
         items:
           - enum:
               - altr,socfpga-arria10-socdk
-              - enclustra,mercury-aa1
+          - const: altr,socfpga-arria10
+          - const: altr,socfpga
+
+      - description: Mercury+ AA1 boards
+        items:
+          - enum:
+              - google,chameleon-v3
+          - const: enclustra,mercury-aa1
           - const: altr,socfpga-arria10
           - const: altr,socfpga
 
@@ -47,6 +54,7 @@ properties:
         items:
           - enum:
               - altr,socfpga-stratix10-socdk
+              - altr,socfpga-stratix10-swvp
           - const: altr,socfpga-stratix10
 
       - description: SoCFPGA VT
diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml
new file mode 100644 (file)
index 0000000..1895ce9
--- /dev/null
@@ -0,0 +1,87 @@
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/aspeed/aspeed.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Aspeed SoC based boards
+
+maintainers:
+  - Joel Stanley <joel@jms.id.au>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: AST2400 based boards
+        items:
+          - enum:
+              - facebook,galaxy100-bmc
+              - facebook,wedge100-bmc
+              - facebook,wedge40-bmc
+              - microsoft,olympus-bmc
+              - quanta,q71l-bmc
+              - tyan,palmetto-bmc
+              - yadro,vesnin-bmc
+          - const: aspeed,ast2400
+
+      - description: AST2500 based boards
+        items:
+          - enum:
+              - amd,ethanolx-bmc
+              - ampere,mtjade-bmc
+              - aspeed,ast2500-evb
+              - asrock,e3c246d4i-bmc
+              - asrock,romed8hm3-bmc
+              - bytedance,g220a-bmc
+              - facebook,cmm-bmc
+              - facebook,minipack-bmc
+              - facebook,tiogapass-bmc
+              - facebook,yamp-bmc
+              - facebook,yosemitev2-bmc
+              - facebook,wedge400-bmc
+              - hxt,stardragon4800-rep2-bmc
+              - ibm,mihawk-bmc
+              - ibm,mowgli-bmc
+              - ibm,romulus-bmc
+              - ibm,swift-bmc
+              - ibm,witherspoon-bmc
+              - ingrasys,zaius-bmc
+              - inspur,fp5280g2-bmc
+              - inspur,nf5280m6-bmc
+              - inspur,on5263m5-bmc
+              - intel,s2600wf-bmc
+              - inventec,lanyang-bmc
+              - lenovo,hr630-bmc
+              - lenovo,hr855xg2-bmc
+              - portwell,neptune-bmc
+              - qcom,centriq2400-rep-bmc
+              - supermicro,x11spi-bmc
+              - tyan,s7106-bmc
+              - tyan,s8036-bmc
+              - yadro,nicole-bmc
+              - yadro,vegman-n110-bmc
+              - yadro,vegman-rx20-bmc
+              - yadro,vegman-sx20-bmc
+          - const: aspeed,ast2500
+
+      - description: AST2600 based boards
+        items:
+          - enum:
+              - aspeed,ast2600-evb
+              - aspeed,ast2600-evb-a1
+              - facebook,bletchley-bmc
+              - facebook,cloudripper-bmc
+              - facebook,elbert-bmc
+              - facebook,fuji-bmc
+              - ibm,everest-bmc
+              - ibm,rainier-bmc
+              - ibm,tacoma-bmc
+              - inventec,transformer-bmc
+              - jabil,rbp-bmc
+              - nuvia,dc-scm-bmc
+              - quanta,s6q-bmc
+          - const: aspeed,ast2600
+
+additionalProperties: true
index 8b7e87f..958df32 100644 (file)
@@ -87,6 +87,13 @@ properties:
           - const: brcm,bcm53012
           - const: brcm,bcm4708
 
+      - description: BCM53015 based boards
+        items:
+          - enum:
+              - meraki,mr26
+          - const: brcm,bcm53015
+          - const: brcm,bcm4708
+
       - description: BCM53016 based boards
         items:
           - enum:
index 5fb4558..324e591 100644 (file)
@@ -28,6 +28,99 @@ properties:
           - const: brcm,bcm47622
           - const: brcm,bcmbca
 
+      - description: BCM4912 based boards
+        items:
+          - enum:
+              - asus,gt-ax6000
+              - brcm,bcm94912
+          - const: brcm,bcm4912
+          - const: brcm,bcmbca
+
+      - description: BCM63138 based boards
+        items:
+          - enum:
+              - brcm,bcm963138
+              - brcm,BCM963138DVT
+          - const: brcm,bcm63138
+          - const: brcm,bcmbca
+
+      - description: BCM63146 based boards
+        items:
+          - enum:
+              - brcm,bcm963146
+          - const: brcm,bcm63146
+          - const: brcm,bcmbca
+
+      - description: BCM63148 based boards
+        items:
+          - enum:
+              - brcm,bcm963148
+          - const: brcm,bcm63148
+          - const: brcm,bcmbca
+
+      - description: BCM63158 based boards
+        items:
+          - enum:
+              - brcm,bcm963158
+          - const: brcm,bcm63158
+          - const: brcm,bcmbca
+
+      - description: BCM63178 based boards
+        items:
+          - enum:
+              - brcm,bcm963178
+          - const: brcm,bcm63178
+          - const: brcm,bcmbca
+
+      - description: BCM6756 based boards
+        items:
+          - enum:
+              - brcm,bcm96756
+          - const: brcm,bcm6756
+          - const: brcm,bcmbca
+
+      - description: BCM6813 based boards
+        items:
+          - enum:
+              - brcm,bcm96813
+          - const: brcm,bcm6813
+          - const: brcm,bcmbca
+
+      - description: BCM6846 based boards
+        items:
+          - enum:
+              - brcm,bcm96846
+          - const: brcm,bcm6846
+          - const: brcm,bcmbca
+
+      - description: BCM6855 based boards
+        items:
+          - enum:
+              - brcm,bcm96855
+          - const: brcm,bcm6855
+          - const: brcm,bcmbca
+
+      - description: BCM6856 based boards
+        items:
+          - enum:
+              - brcm,bcm96856
+          - const: brcm,bcm6856
+          - const: brcm,bcmbca
+
+      - description: BCM6858 based boards
+        items:
+          - enum:
+              - brcm,bcm96858
+          - const: brcm,bcm6858
+          - const: brcm,bcmbca
+
+      - description: BCM6878 based boards
+        items:
+          - enum:
+              - brcm,bcm96878
+          - const: brcm,bcm6878
+          - const: brcm,bcmbca
+
 additionalProperties: true
 
 ...
diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt
deleted file mode 100644 (file)
index a87ec15..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-NXP i.MX System Controller Firmware (SCFW)
---------------------------------------------------------------------
-
-The System Controller Firmware (SCFW) is a low-level system function
-which runs on a dedicated Cortex-M core to provide power, clock, and
-resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
-(QM, QP), and i.MX8QX (QXP, DX).
-
-The AP communicates with the SC using a multi-ported MU module found
-in the LSIO subsystem. The current definition of this MU module provides
-5 remote AP connections to the SC to support up to 5 execution environments
-(TZ, HV, standard Linux, etc.). The SC side of this MU module interfaces
-with the LSIO DSC IP bus. The SC firmware will communicate with this MU
-using the MSI bus.
-
-System Controller Device Node:
-============================================================
-
-The scu node with the following properties shall be under the /firmware/ node.
-
-Required properties:
--------------------
-- compatible:  should be "fsl,imx-scu".
-- mbox-names:  should include "tx0", "tx1", "tx2", "tx3",
-                              "rx0", "rx1", "rx2", "rx3";
-               include "gip3" if want to support general MU interrupt.
-- mboxes:      List of phandle of 4 MU channels for tx, 4 MU channels for
-               rx, and 1 optional MU channel for general interrupt.
-               All MU channels must be in the same MU instance.
-               Cross instances are not allowed. The MU instance can only
-               be one of LSIO MU0~M4 for imx8qxp and imx8qm. Users need
-               to make sure use the one which is not conflict with other
-               execution environments. e.g. ATF.
-               Note:
-               Channel 0 must be "tx0" or "rx0".
-               Channel 1 must be "tx1" or "rx1".
-               Channel 2 must be "tx2" or "rx2".
-               Channel 3 must be "tx3" or "rx3".
-               General interrupt rx channel must be "gip3".
-               e.g.
-               mboxes = <&lsio_mu1 0 0
-                         &lsio_mu1 0 1
-                         &lsio_mu1 0 2
-                         &lsio_mu1 0 3
-                         &lsio_mu1 1 0
-                         &lsio_mu1 1 1
-                         &lsio_mu1 1 2
-                         &lsio_mu1 1 3
-                         &lsio_mu1 3 3>;
-               See Documentation/devicetree/bindings/mailbox/fsl,mu.yaml
-               for detailed mailbox binding.
-
-Note: Each mu which supports general interrupt should have an alias correctly
-numbered in "aliases" node.
-e.g.
-aliases {
-       mu1 = &lsio_mu1;
-};
-
-i.MX SCU Client Device Node:
-============================================================
-
-Client nodes are maintained as children of the relevant IMX-SCU device node.
-
-Power domain bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-This binding for the SCU power domain providers uses the generic power
-domain binding[2].
-
-Required properties:
-- compatible:          Should be one of:
-                         "fsl,imx8qm-scu-pd",
-                         "fsl,imx8qxp-scu-pd"
-                       followed by "fsl,scu-pd"
-
-- #power-domain-cells: Must be 1. Contains the Resource ID used by
-                       SCU commands.
-                       See detailed Resource ID list from:
-                       include/dt-bindings/firmware/imx/rsrc.h
-
-Clock bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-This binding uses the common clock binding[1].
-
-Required properties:
-- compatible:          Should be one of:
-                         "fsl,imx8dxl-clk"
-                         "fsl,imx8qm-clk"
-                         "fsl,imx8qxp-clk"
-                       followed by "fsl,scu-clk"
-- #clock-cells:                Should be 2.
-                       Contains the Resource and Clock ID value.
-- clocks:              List of clock specifiers, must contain an entry for
-                       each required entry in clock-names
-- clock-names:         Should include entries "xtal_32KHz", "xtal_24MHz"
-
-The clock consumer should specify the desired clock by having the clock
-ID in its "clocks" phandle cell.
-
-See the full list of clock IDs from:
-include/dt-bindings/clock/imx8qxp-clock.h
-
-Pinctrl bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-This binding uses the i.MX common pinctrl binding[3].
-
-Required properties:
-- compatible:          Should be one of:
-                       "fsl,imx8qm-iomuxc",
-                       "fsl,imx8qxp-iomuxc",
-                       "fsl,imx8dxl-iomuxc".
-
-Required properties for Pinctrl sub nodes:
-- fsl,pins:            Each entry consists of 3 integers which represents
-                       the mux and config setting for one pin. The first 2
-                       integers <pin_id mux_mode> are specified using a
-                       PIN_FUNC_ID macro, which can be found in
-                       <dt-bindings/pinctrl/pads-imx8qm.h>,
-                       <dt-bindings/pinctrl/pads-imx8qxp.h>,
-                       <dt-bindings/pinctrl/pads-imx8dxl.h>.
-                       The last integer CONFIG is the pad setting value like
-                       pull-up on this pin.
-
-                       Please refer to i.MX8QXP Reference Manual for detailed
-                       CONFIG settings.
-
-[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
-[2] Documentation/devicetree/bindings/power/power-domain.yaml
-[3] Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
-
-RTC bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-Required properties:
-- compatible: should be "fsl,imx8qxp-sc-rtc";
-
-OCOTP bindings based on SCU Message Protocol
-------------------------------------------------------------
-Required properties:
-- compatible:          Should be one of:
-                       "fsl,imx8qm-scu-ocotp",
-                       "fsl,imx8qxp-scu-ocotp".
-- #address-cells:      Must be 1. Contains byte index
-- #size-cells:         Must be 1. Contains byte length
-
-Optional Child nodes:
-
-- Data cells of ocotp:
-  Detailed bindings are described in bindings/nvmem/nvmem.txt
-
-Watchdog bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-Required properties:
-- compatible: should be:
-              "fsl,imx8qxp-sc-wdt"
-              followed by "fsl,imx-sc-wdt";
-Optional properties:
-- timeout-sec: contains the watchdog timeout in seconds.
-
-SCU key bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-Required properties:
-- compatible: should be:
-              "fsl,imx8qxp-sc-key"
-              followed by "fsl,imx-sc-key";
-- linux,keycodes: See Documentation/devicetree/bindings/input/input.yaml
-
-Thermal bindings based on SCU Message Protocol
-------------------------------------------------------------
-
-Required properties:
-- compatible:                  Should be :
-                                 "fsl,imx8qxp-sc-thermal"
-                               followed by "fsl,imx-sc-thermal";
-
-- #thermal-sensor-cells:       See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml
-                               for a description.
-
-Example (imx8qxp):
--------------
-aliases {
-       mu1 = &lsio_mu1;
-};
-
-lsio_mu1: mailbox@5d1c0000 {
-       ...
-       #mbox-cells = <2>;
-};
-
-firmware {
-       scu {
-               compatible = "fsl,imx-scu";
-               mbox-names = "tx0", "tx1", "tx2", "tx3",
-                            "rx0", "rx1", "rx2", "rx3",
-                            "gip3";
-               mboxes = <&lsio_mu1 0 0
-                         &lsio_mu1 0 1
-                         &lsio_mu1 0 2
-                         &lsio_mu1 0 3
-                         &lsio_mu1 1 0
-                         &lsio_mu1 1 1
-                         &lsio_mu1 1 2
-                         &lsio_mu1 1 3
-                         &lsio_mu1 3 3>;
-
-               clk: clk {
-                       compatible = "fsl,imx8qxp-clk", "fsl,scu-clk";
-                       #clock-cells = <2>;
-               };
-
-               iomuxc {
-                       compatible = "fsl,imx8qxp-iomuxc";
-
-                       pinctrl_lpuart0: lpuart0grp {
-                               fsl,pins = <
-                                       SC_P_UART0_RX_ADMA_UART0_RX     0x06000020
-                                       SC_P_UART0_TX_ADMA_UART0_TX     0x06000020
-                               >;
-                       };
-                       ...
-               };
-
-               ocotp: imx8qx-ocotp {
-                       compatible = "fsl,imx8qxp-scu-ocotp";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       fec_mac0: mac@2c4 {
-                               reg = <0x2c4 8>;
-                       };
-               };
-
-               pd: imx8qx-pd {
-                       compatible = "fsl,imx8qxp-scu-pd", "fsl,scu-pd";
-                       #power-domain-cells = <1>;
-               };
-
-               rtc: rtc {
-                       compatible = "fsl,imx8qxp-sc-rtc";
-               };
-
-               scu_key: scu-key {
-                       compatible = "fsl,imx8qxp-sc-key", "fsl,imx-sc-key";
-                       linux,keycodes = <KEY_POWER>;
-               };
-
-               watchdog {
-                       compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
-                       timeout-sec = <60>;
-               };
-
-               tsens: thermal-sensor {
-                       compatible = "fsl,imx8qxp-sc-thermal", "fsl,imx-sc-thermal";
-                       #thermal-sensor-cells = <1>;
-               };
-       };
-};
-
-serial@5a060000 {
-       ...
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_lpuart0>;
-       clocks = <&uart0_clk IMX_SC_R_UART_0 IMX_SC_PM_CLK_PER>;
-       clock-names = "ipg";
-       power-domains = <&pd IMX_SC_R_UART_0>;
-};
index ef52437..7431579 100644 (file)
@@ -321,6 +321,7 @@ properties:
           - enum:
               - toradex,apalis_imx6q-ixora      # Apalis iMX6Q/D Module on Ixora Carrier Board
               - toradex,apalis_imx6q-ixora-v1.1 # Apalis iMX6Q/D Module on Ixora V1.1 Carrier Board
+              - toradex,apalis_imx6q-ixora-v1.2 # Apalis iMX6Q/D Module on Ixora V1.2 Carrier Board
               - toradex,apalis_imx6q-eval       # Apalis iMX6Q/D Module on Apalis Evaluation Board
           - const: toradex,apalis_imx6q
           - const: fsl,imx6q
@@ -670,30 +671,30 @@ properties:
       - description: i.MX6ULL Boards with Toradex Colibri iMX6ULL Modules
         items:
           - enum:
-              - toradex,colibri-imx6ull-aster     # Colibri iMX6ULL Module on Aster Carrier Board
-              - toradex,colibri-imx6ull-eval      # Colibri iMX6ULL Module on Colibri Evaluation Board V3
-              - toradex,colibri-imx6ull-iris      # Colibri iMX6ULL Module on Iris Carrier Board
-              - toradex,colibri-imx6ull-iris-v2   # Colibri iMX6ULL Module on Iris V2 Carrier Board
+              - toradex,colibri-imx6ull-aster     # Aster Carrier Board
+              - toradex,colibri-imx6ull-eval      # Colibri Evaluation Board V3
+              - toradex,colibri-imx6ull-iris      # Iris Carrier Board
+              - toradex,colibri-imx6ull-iris-v2   # Iris V2 Carrier Board
           - const: toradex,colibri-imx6ull        # Colibri iMX6ULL Module
           - const: fsl,imx6ull
 
       - description: i.MX6ULL Boards with Toradex Colibri iMX6ULL 1GB (eMMC) Module
         items:
           - enum:
-              - toradex,colibri-imx6ull-emmc-aster     # Colibri iMX6ULL 1G (eMMC) on Aster Carrier Board
-              - toradex,colibri-imx6ull-emmc-eval      # Colibri iMX6ULL 1G (eMMC) on Colibri Evaluation B. V3
-              - toradex,colibri-imx6ull-emmc-iris      # Colibri iMX6ULL 1G (eMMC) on Iris Carrier Board
-              - toradex,colibri-imx6ull-emmc-iris-v2   # Colibri iMX6ULL 1G (eMMC) on Iris V2 Carrier Board
+              - toradex,colibri-imx6ull-emmc-aster     # Aster Carrier Board
+              - toradex,colibri-imx6ull-emmc-eval      # Colibri Evaluation B. V3
+              - toradex,colibri-imx6ull-emmc-iris      # Iris Carrier Board
+              - toradex,colibri-imx6ull-emmc-iris-v2   # Iris V2 Carrier Board
           - const: toradex,colibri-imx6ull-emmc        # Colibri iMX6ULL 1GB (eMMC) Module
           - const: fsl,imx6ull
 
       - description: i.MX6ULL Boards with Toradex Colibri iMX6ULL Wi-Fi / BT Modules
         items:
           - enum:
-              - toradex,colibri-imx6ull-wifi-eval     # Colibri iMX6ULL Wi-Fi / BT M. on Colibri Eval. B. V3
-              - toradex,colibri-imx6ull-wifi-aster    # Colibri iMX6ULL Wi-Fi / BT M. on Aster Carrier Board
-              - toradex,colibri-imx6ull-wifi-iris     # Colibri iMX6ULL Wi-Fi / BT M. on Iris Carrier Board
-              - toradex,colibri-imx6ull-wifi-iris-v2  # Colibri iMX6ULL Wi-Fi / BT M. on Iris V2 Carrier Board
+              - toradex,colibri-imx6ull-wifi-eval     # Colibri Eval. B. V3
+              - toradex,colibri-imx6ull-wifi-aster    # Aster Carrier Board
+              - toradex,colibri-imx6ull-wifi-iris     # Iris Carrier Board
+              - toradex,colibri-imx6ull-wifi-iris-v2  # Iris V2 Carrier Board
           - const: toradex,colibri-imx6ull-wifi       # Colibri iMX6ULL Wi-Fi / BT Module
           - const: fsl,imx6ull
 
@@ -738,6 +739,8 @@ properties:
           - enum:
               - toradex,colibri-imx7s-aster     # Module on Aster Carrier Board
               - toradex,colibri-imx7s-eval-v3   # Module on Colibri Evaluation Board V3
+              - toradex,colibri-imx7s-iris      # Module on Iris Carrier Board
+              - toradex,colibri-imx7s-iris-v2   # Module on Iris Carrier Board V2
           - const: toradex,colibri-imx7s
           - const: fsl,imx7s
 
@@ -789,8 +792,10 @@ properties:
       - description: i.MX7D Boards with Toradex Colibri i.MX7D Module
         items:
           - enum:
-              - toradex,colibri-imx7d-aster   # Colibri iMX7D Module on Aster Carrier Board
-              - toradex,colibri-imx7d-eval-v3 # Colibri iMX7D Module on Colibri Evaluation Board V3
+              - toradex,colibri-imx7d-aster   # Aster Carrier Board
+              - toradex,colibri-imx7d-eval-v3 # Colibri Evaluation Board V3
+              - toradex,colibri-imx7d-iris    # Iris Carrier Board
+              - toradex,colibri-imx7d-iris-v2 # Iris Carrier Board V2
           - const: toradex,colibri-imx7d
           - const: fsl,imx7d
 
@@ -799,6 +804,8 @@ properties:
           - enum:
               - toradex,colibri-imx7d-emmc-aster    # Module on Aster Carrier Board
               - toradex,colibri-imx7d-emmc-eval-v3  # Module on Colibri Evaluation Board V3
+              - toradex,colibri-imx7d-emmc-iris     # Module on Iris Carrier Board
+              - toradex,colibri-imx7d-emmc-iris-v2  # Module on Iris Carrier Board V2
           - const: toradex,colibri-imx7d-emmc
           - const: fsl,imx7d
 
@@ -865,6 +872,12 @@ properties:
           - const: toradex,verdin-imx8mm          # Verdin iMX8M Mini Module
           - const: fsl,imx8mm
 
+      - description: PHYTEC phyCORE-i.MX8MM SoM based boards
+        items:
+          - const: phytec,imx8mm-phyboard-polis-rdk # phyBOARD-Polis RDK
+          - const: phytec,imx8mm-phycore-som        # phyCORE-i.MX8MM SoM
+          - const: fsl,imx8mm
+
       - description: Variscite VAR-SOM-MX8MM based boards
         items:
           - const: variscite,var-som-mx8mm-symphony
@@ -914,6 +927,8 @@ properties:
       - description: i.MX8MP based Boards
         items:
           - enum:
+              - dh,imx8mp-dhcom-som       # i.MX8MP DHCOM SoM
+              - dh,imx8mp-dhcom-pdk2      # i.MX8MP DHCOM SoM on PDK2 board
               - fsl,imx8mp-evk            # i.MX8MP EVK Board
               - gateworks,imx8mp-gw74xx   # i.MX8MP Gateworks Board
               - toradex,verdin-imx8mp     # Verdin iMX8M Plus Modules
@@ -952,6 +967,18 @@ properties:
           - const: toradex,verdin-imx8mp          # Verdin iMX8M Plus Module
           - const: fsl,imx8mp
 
+      - description:
+          TQMa8MPxL is a series of LGA SOM featuring NXP i.MX8MP system-on-chip
+          variants. It is designed to be soldered on different carrier boards.
+          All CPU variants use the same device tree hence only one compatible
+          is needed. MBa8MPxL mainboard can be used as starterkit or in a boxed
+          version as an industrial computing device.
+        items:
+          - enum:
+              - tq,imx8mp-tqma8mpql-mba8mpxl # TQ-Systems GmbH i.MX8MP TQMa8MPQL SOM on MBa8MPxL
+          - const: tq,imx8mp-tqma8mpql       # TQ-Systems GmbH i.MX8MP TQMa8MPQL SOM
+          - const: fsl,imx8mp
+
       - description: i.MX8MQ based Boards
         items:
           - enum:
@@ -1020,6 +1047,12 @@ properties:
               - fsl,imx8ulp-evk           # i.MX8ULP EVK Board
           - const: fsl,imx8ulp
 
+      - description: i.MX93 based Boards
+        items:
+          - enum:
+              - fsl,imx93-11x11-evk       # i.MX93 11x11 EVK Board
+          - const: fsl,imx93
+
       - description:
           Freescale Vybrid Platform Device Tree Bindings
 
diff --git a/Documentation/devicetree/bindings/arm/marvell/marvell,ac5.yaml b/Documentation/devicetree/bindings/arm/marvell/marvell,ac5.yaml
new file mode 100644 (file)
index 0000000..8960fb8
--- /dev/null
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/marvell/marvell,ac5.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Marvell Alleycat5/5X Platforms
+
+maintainers:
+  - Chris Packham <chris.packham@alliedtelesis.co.nz>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: Alleycat5 (98DX25xx) Reference Design
+        items:
+          - enum:
+              - marvell,rd-ac5
+          - const: marvell,ac5
+
+      - description: Alleycat5X (98DX35xx) Reference Design
+        items:
+          - enum:
+              - marvell,rd-ac5x
+          - const: marvell,ac5x
+          - const: marvell,ac5
+
+additionalProperties: true
+
+...
index 4a2bd97..07c0ea9 100644 (file)
@@ -131,6 +131,36 @@ properties:
           - enum:
               - mediatek,mt8183-evb
           - const: mediatek,mt8183
+      - description: Google Hayato
+        items:
+          - const: google,hayato-rev1
+          - const: google,hayato
+          - const: mediatek,mt8192
+      - description: Google Spherion (Acer Chromebook 514)
+        items:
+          - const: google,spherion-rev3
+          - const: google,spherion-rev2
+          - const: google,spherion-rev1
+          - const: google,spherion-rev0
+          - const: google,spherion
+          - const: mediatek,mt8192
+      - description: Acer Tomato (Acer Chromebook Spin 513 CP513-2H)
+        items:
+          - enum:
+              - google,tomato-rev2
+              - google,tomato-rev1
+          - const: google,tomato
+          - const: mediatek,mt8195
+      - description: Acer Tomato rev3 - 4 (Acer Chromebook Spin 513 CP513-2H)
+        items:
+          - const: google,tomato-rev4
+          - const: google,tomato-rev3
+          - const: google,tomato
+          - const: mediatek,mt8195
+      - items:
+          - enum:
+              - mediatek,mt8186-evb
+          - const: mediatek,mt8186
       - items:
           - enum:
               - mediatek,mt8192-evb
index 611f666..8585f6f 100644 (file)
@@ -26,6 +26,7 @@ properties:
               - mediatek,mt8135-pericfg
               - mediatek,mt8173-pericfg
               - mediatek,mt8183-pericfg
+              - mediatek,mt8186-pericfg
               - mediatek,mt8195-pericfg
               - mediatek,mt8516-pericfg
           - const: syscon
index 5c06d1b..fffd596 100644 (file)
@@ -44,6 +44,7 @@ description: |
         sc7280
         sc8180x
         sc8280xp
+        sda660
         sdm630
         sdm632
         sdm660
@@ -90,6 +91,11 @@ description: |
   A dragonboard board v0.1 of subtype 1 with an apq8074 SoC version 2, made in
   foundry 2.
 
+  There are many devices in the list below that run the standard ChromeOS
+  bootloader setup and use the open source depthcharge bootloader to boot the
+  OS. These devices do not use the scheme described above. For details, see:
+  https://docs.kernel.org/arm/google/chromebook-boot-flow.html
+
 properties:
   $nodename:
     const: "/"
@@ -190,6 +196,7 @@ properties:
               - sony,kagura-row
               - sony,keyaki-row
               - xiaomi,gemini
+              - xiaomi,natrium
               - xiaomi,scorpio
           - const: qcom,msm8996
 
@@ -214,19 +221,317 @@ properties:
               - qcom,ipq8074-hk10-c2
           - const: qcom,ipq8074
 
-      - items:
+      - description: Qualcomm Technologies, Inc. SC7180 IDP
+        items:
           - enum:
               - qcom,sc7180-idp
           - const: qcom,sc7180
 
-      - items:
-          - enum:
-              - qcom,sc7280-crd
-              - qcom,sc7280-idp
-              - qcom,sc7280-idp2
-              - google,hoglin
-              - google,piglin
-              - google,senor
+      - description: HP Chromebook x2 11c (rev1 - 2)
+        items:
+          - const: google,coachz-rev1
+          - const: google,coachz-rev2
+          - const: qcom,sc7180
+
+      - description: HP Chromebook x2 11c (newest rev)
+        items:
+          - const: google,coachz
+          - const: qcom,sc7180
+
+      - description: HP Chromebook x2 11c with LTE (rev1 - 2)
+        items:
+          - const: google,coachz-rev1-sku0
+          - const: google,coachz-rev2-sku0
+          - const: qcom,sc7180
+
+      - description: HP Chromebook x2 11c with LTE (newest rev)
+        items:
+          - const: google,coachz-sku0
+          - const: qcom,sc7180
+
+      - description: Lenovo Chromebook Duet 5 13 (rev2)
+        items:
+          - const: google,homestar-rev2
+          - const: google,homestar-rev23
+          - const: qcom,sc7180
+
+      - description: Lenovo Chromebook Duet 5 13 (rev3)
+        items:
+          - const: google,homestar-rev3
+          - const: qcom,sc7180
+
+      - description: Lenovo Chromebook Duet 5 13 (newest rev)
+        items:
+          - const: google,homestar
+          - const: qcom,sc7180
+
+      - description: Google Kingoftown (rev0)
+        items:
+          - const: google,kingoftown-rev0
+          - const: qcom,sc7180
+
+      - description: Google Kingoftown (newest rev)
+        items:
+          - const: google,kingoftown
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 (rev0)
+        items:
+          - const: google,lazor-rev0
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 (rev1 - 2)
+        items:
+          - const: google,lazor-rev1
+          - const: google,lazor-rev2
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 (rev3 - 8)
+        items:
+          - const: google,lazor-rev3
+          - const: google,lazor-rev4
+          - const: google,lazor-rev5
+          - const: google,lazor-rev6
+          - const: google,lazor-rev7
+          - const: google,lazor-rev8
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 (newest rev)
+        items:
+          - const: google,lazor
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 with KB Backlight (rev1 - 2)
+        items:
+          - const: google,lazor-rev1-sku2
+          - const: google,lazor-rev2-sku2
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 with KB Backlight (rev3 - 8)
+        items:
+          - const: google,lazor-rev3-sku2
+          - const: google,lazor-rev4-sku2
+          - const: google,lazor-rev5-sku2
+          - const: google,lazor-rev6-sku2
+          - const: google,lazor-rev7-sku2
+          - const: google,lazor-rev8-sku2
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 with KB Backlight (newest rev)
+        items:
+          - const: google,lazor-sku2
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 with LTE (rev1 - 2)
+        items:
+          - const: google,lazor-rev1-sku0
+          - const: google,lazor-rev2-sku0
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 with LTE (rev3 - 8)
+        items:
+          - const: google,lazor-rev3-sku0
+          - const: google,lazor-rev4-sku0
+          - const: google,lazor-rev5-sku0
+          - const: google,lazor-rev6-sku0
+          - const: google,lazor-rev7-sku0
+          - const: google,lazor-rev8-sku0
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook Spin 513 with LTE (newest rev)
+        items:
+          - const: google,lazor-sku0
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook 511 (rev4 - rev8)
+        items:
+          - const: google,lazor-rev4-sku4
+          - const: google,lazor-rev5-sku4
+          - const: google,lazor-rev6-sku4
+          - const: google,lazor-rev7-sku4
+          - const: google,lazor-rev8-sku4
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook 511 (newest rev)
+        items:
+          - const: google,lazor-sku4
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook 511 without Touchscreen (rev4)
+        items:
+          - const: google,lazor-rev4-sku5
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook 511 without Touchscreen (rev5 - rev8)
+        items:
+          - const: google,lazor-rev5-sku5
+          - const: google,lazor-rev5-sku6
+          - const: google,lazor-rev6-sku6
+          - const: google,lazor-rev7-sku6
+          - const: google,lazor-rev8-sku6
+          - const: qcom,sc7180
+
+      - description: Acer Chromebook 511 without Touchscreen (newest rev)
+        items:
+          - const: google,lazor-sku6
+          - const: qcom,sc7180
+
+      - description: Google Mrbland with AUO panel (rev0)
+        items:
+          - const: google,mrbland-rev0-sku0
+          - const: qcom,sc7180
+
+      - description: Google Mrbland with AUO panel (newest rev)
+        items:
+          - const: google,mrbland-sku1536
+          - const: qcom,sc7180
+
+      - description: Google Mrbland with BOE panel (rev0)
+        items:
+          - const: google,mrbland-rev0-sku16
+          - const: qcom,sc7180
+
+      - description: Google Mrbland with BOE panel (newest rev)
+        items:
+          - const: google,mrbland-sku1024
+          - const: google,mrbland-sku768
+          - const: qcom,sc7180
+
+      - description: Google Pazquel with Parade (newest rev)
+        items:
+          - const: google,pazquel-sku5
+          - const: qcom,sc7180
+
+      - description: Google Pazquel with TI (newest rev)
+        items:
+          - const: google,pazquel-sku1
+          - const: qcom,sc7180
+
+      - description: Google Pazquel with LTE and Parade (newest rev)
+        items:
+          - const: google,pazquel-sku4
+          - const: qcom,sc7180
+
+      - description: Google Pazquel with LTE and TI (newest rev)
+        items:
+          - const: google,pazquel-sku0
+          - const: google,pazquel-sku2
+          - const: qcom,sc7180
+
+      - description: Sharp Dynabook Chromebook C1 (rev1)
+        items:
+          - const: google,pompom-rev1
+          - const: qcom,sc7180
+
+      - description: Sharp Dynabook Chromebook C1 (rev2)
+        items:
+          - const: google,pompom-rev2
+          - const: qcom,sc7180
+
+      - description: Sharp Dynabook Chromebook C1 (newest rev)
+        items:
+          - const: google,pompom
+          - const: qcom,sc7180
+
+      - description: Sharp Dynabook Chromebook C1 with LTE (rev1)
+        items:
+          - const: google,pompom-rev1-sku0
+          - const: qcom,sc7180
+
+      - description: Sharp Dynabook Chromebook C1 with LTE (rev2)
+        items:
+          - const: google,pompom-rev2-sku0
+          - const: qcom,sc7180
+
+      - description: Sharp Dynabook Chromebook C1 with LTE (newest rev)
+        items:
+          - const: google,pompom-sku0
+          - const: qcom,sc7180
+
+      - description: Google Quackingstick (newest rev)
+        items:
+          - const: google,quackingstick-sku1537
+          - const: qcom,sc7180
+
+      - description: Google Quackingstick with LTE (newest rev)
+        items:
+          - const: google,quackingstick-sku1536
+          - const: qcom,sc7180
+
+      - description: Google Trogdor (newest rev)
+        items:
+          - const: google,trogdor
+          - const: qcom,sc7180
+
+      - description: Google Trogdor with LTE (newest rev)
+        items:
+          - const: google,trogdor-sku0
+          - const: qcom,sc7180
+
+      - description: Lenovo IdeaPad Chromebook Duet 3 with BOE panel (rev0)
+        items:
+          - const: google,wormdingler-rev0-sku16
+          - const: qcom,sc7180
+
+      - description: Lenovo IdeaPad Chromebook Duet 3 with BOE panel (newest rev)
+        items:
+          - const: google,wormdingler-sku1024
+          - const: qcom,sc7180
+
+      - description: Lenovo IdeaPad Chromebook Duet 3 with BOE panel and rt5682s (newest rev)
+        items:
+          - const: google,wormdingler-sku1025
+          - const: qcom,sc7180
+
+      - description: Lenovo IdeaPad Chromebook Duet 3 with INX panel (rev0)
+        items:
+          - const: google,wormdingler-rev0-sku0
+          - const: qcom,sc7180
+
+      - description: Lenovo IdeaPad Chromebook Duet 3 with INX panel (newest rev)
+        items:
+          - const: google,wormdingler-sku0
+          - const: qcom,sc7180
+
+      - description: Lenovo IdeaPad Chromebook Duet 3 with INX panel and rt5682s (newest rev)
+        items:
+          - const: google,wormdingler-sku1
+          - const: qcom,sc7180
+
+      - description: Qualcomm Technologies, Inc. sc7280 CRD platform (rev3 - 4)
+        items:
+          - const: qcom,sc7280-crd
+          - const: google,hoglin-rev3
+          - const: google,hoglin-rev4
+          - const: google,piglin-rev3
+          - const: google,piglin-rev4
+          - const: qcom,sc7280
+
+      - description: Qualcomm Technologies, Inc. sc7280 CRD platform (newest rev)
+        items:
+          - const: google,hoglin
+          - const: qcom,sc7280
+
+      - description: Qualcomm Technologies, Inc. sc7280 IDP SKU1 platform
+        items:
+          - const: qcom,sc7280-idp
+          - const: google,senor
+          - const: qcom,sc7280
+
+      - description: Qualcomm Technologies, Inc. sc7280 IDP SKU2 platform
+        items:
+          - const: qcom,sc7280-idp2
+          - const: google,piglin
+          - const: qcom,sc7280
+
+      - description: Google Herobrine (newest rev)
+        items:
+          - const: google,herobrine
+          - const: qcom,sc7280
+
+      - description: Google Villager (newest rev)
+        items:
+          - const: google,villager
           - const: qcom,sc7280
 
       - items:
@@ -238,9 +543,16 @@ properties:
 
       - items:
           - enum:
+              - lenovo,thinkpad-x13s
+              - qcom,sc8280xp-crd
               - qcom,sc8280xp-qrd
           - const: qcom,sc8280xp
 
+      - items:
+          - enum:
+              - inforce,ifc6560
+          - const: qcom,sda660
+
       - items:
           - enum:
               - fairphone,fp3
diff --git a/Documentation/devicetree/bindings/arm/renesas,prr.yaml b/Documentation/devicetree/bindings/arm/renesas,prr.yaml
deleted file mode 100644 (file)
index 1f80767..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-%YAML 1.2
----
-$id: http://devicetree.org/schemas/arm/renesas,prr.yaml#
-$schema: http://devicetree.org/meta-schemas/core.yaml#
-
-title: Renesas Product Register
-
-maintainers:
-  - Geert Uytterhoeven <geert+renesas@glider.be>
-  - Magnus Damm <magnus.damm@gmail.com>
-
-description: |
-  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
-  Register that allows to retrieve SoC product and revision information.
-  If present, a device node for this register should be added.
-
-properties:
-  compatible:
-    enum:
-      - renesas,prr
-      - renesas,bsid
-  reg:
-    maxItems: 1
-
-required:
-  - compatible
-  - reg
-
-additionalProperties: false
-
-examples:
-  - |
-    prr: chipid@ff000044 {
-        compatible = "renesas,prr";
-        reg = <0xff000044 4>;
-    };
index cf9eb1e..7811ba6 100644 (file)
@@ -554,6 +554,11 @@ properties:
           - const: vamrs,rk3399pro-vmarc-som
           - const: rockchip,rk3399pro
 
+      - description: Radxa ROCK Pi S
+        items:
+          - const: radxa,rockpis
+          - const: rockchip,rk3308
+
       - description: Radxa Rock2 Square
         items:
           - const: radxa,rock2-square
diff --git a/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml b/Documentation/devicetree/bindings/arm/samsung/samsung-soc.yaml
new file mode 100644 (file)
index 0000000..653f859
--- /dev/null
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/samsung/samsung-soc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C, S5P and Exynos SoC compatibles naming convention
+
+maintainers:
+  - Krzysztof Kozlowski <krzk@kernel.org>
+
+description: |
+  Guidelines for new compatibles for SoC blocks/components.
+  When adding new compatibles in new bindings, use the format::
+    samsung,SoC-IP
+
+  For example::
+    samsung,exynos5433-cmu-isp
+
+select:
+  properties:
+    compatible:
+      pattern: "^samsung,.*(s3c|s5pv|exynos)[0-9a-z]+.*$"
+  required:
+    - compatible
+
+properties:
+  compatible:
+    oneOf:
+      - description: Preferred naming style for compatibles of SoC components
+        pattern: "^samsung,(s3c|s5pv|exynos|exynosautov)[0-9]+-.*$"
+
+      # Legacy compatibles with wild-cards - list cannot grow with new bindings:
+      - enum:
+          - samsung,exynos4x12-pinctrl
+          - samsung,exynos4x12-usb2-phy
+          - samsung,s3c64xx-pinctrl
+          - samsung,s3c64xx-wakeup-eint
+
+additionalProperties: true
index 8b31565..4c605bc 100644 (file)
@@ -59,12 +59,18 @@ properties:
               - prt,prtt1s   # Protonic PRTT1S
           - const: st,stm32mp151
 
-      - description: DH STM32MP153 SoM based Boards
+      - description: DH STM32MP153 DHCOM SoM based Boards
         items:
           - const: dh,stm32mp153c-dhcom-drc02
           - const: dh,stm32mp153c-dhcom-som
           - const: st,stm32mp153
 
+      - description: DH STM32MP153 DHCOR SoM based Boards
+        items:
+          - const: dh,stm32mp153c-dhcor-drc-compact
+          - const: dh,stm32mp153c-dhcor-som
+          - const: st,stm32mp153
+
       - items:
           - enum:
               - shiratech,stm32mp157a-iot-box # IoT Box
index 95278a6..0c23567 100644 (file)
@@ -863,6 +863,11 @@ properties:
           - const: yones-toptech,bs1078-v2
           - const: allwinner,sun6i-a31s
 
+      - description: X96 Mate TV box
+        items:
+          - const: hechuang,x96-mate
+          - const: allwinner,sun50i-h616
+
       - description: Xunlong OrangePi
         items:
           - const: xunlong,orangepi
@@ -963,4 +968,9 @@ properties:
           - const: xunlong,orangepi-zero-plus2-h3
           - const: allwinner,sun8i-h3
 
+      - description: Xunlong OrangePi Zero 2
+        items:
+          - const: xunlong,orangepi-zero2
+          - const: allwinner,sun50i-h616
+
 additionalProperties: true
index 8eee312..9956668 100644 (file)
@@ -29,10 +29,20 @@ properties:
   compatible:
     enum:
       - allwinner,sun5i-a13-mbus
+      - allwinner,sun8i-a33-mbus
+      - allwinner,sun8i-a50-mbus
+      - allwinner,sun8i-a83t-mbus
       - allwinner,sun8i-h3-mbus
       - allwinner,sun8i-r40-mbus
+      - allwinner,sun8i-v3s-mbus
+      - allwinner,sun8i-v536-mbus
+      - allwinner,sun20i-d1-mbus
       - allwinner,sun50i-a64-mbus
+      - allwinner,sun50i-a100-mbus
       - allwinner,sun50i-h5-mbus
+      - allwinner,sun50i-h6-mbus
+      - allwinner,sun50i-h616-mbus
+      - allwinner,sun50i-r329-mbus
 
   reg:
     minItems: 1
@@ -81,13 +91,13 @@ required:
   - dma-ranges
 
 if:
-  properties:
-    compatible:
-      contains:
-        enum:
-          - allwinner,sun8i-h3-mbus
-          - allwinner,sun50i-a64-mbus
-          - allwinner,sun50i-h5-mbus
+  not:
+    properties:
+      compatible:
+        contains:
+          enum:
+            - allwinner,sun5i-a13-mbus
+            - allwinner,sun8i-r40-mbus
 
 then:
   properties:
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-axi2apb.yaml
new file mode 100644 (file)
index 0000000..788a13f
--- /dev/null
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/tegra/nvidia,tegra194-axi2apb.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: NVIDIA Tegra194 AXI2APB bridge
+
+maintainers:
+  - Sumit Gupta <sumitg@nvidia.com>
+
+properties:
+  $nodename:
+    pattern: "^axi2apb@([0-9a-f]+)$"
+
+  compatible:
+    enum:
+      - nvidia,tegra194-axi2apb
+
+  reg:
+    maxItems: 6
+    description: Physical base address and length of registers for all bridges
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    axi2apb: axi2apb@2390000 {
+      compatible = "nvidia,tegra194-axi2apb";
+      reg = <0x02390000 0x1000>,
+            <0x023a0000 0x1000>,
+            <0x023b0000 0x1000>,
+            <0x023c0000 0x1000>,
+            <0x023d0000 0x1000>,
+            <0x023e0000 0x1000>;
+    };
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra194-cbb.yaml
new file mode 100644 (file)
index 0000000..debb2b0
--- /dev/null
@@ -0,0 +1,97 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/tegra/nvidia,tegra194-cbb.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: NVIDIA Tegra194 CBB 1.0 bindings
+
+maintainers:
+  - Sumit Gupta <sumitg@nvidia.com>
+
+description: |+
+  The Control Backbone (CBB) is comprised of the physical path from an
+  initiator to a target's register configuration space. CBB 1.0 has
+  multiple hierarchical sub-NOCs (Network-on-Chip) and connects various
+  initiators and targets using different bridges like AXIP2P, AXI2APB.
+
+  This driver handles errors due to illegal register accesses reported
+  by the NOCs inside the CBB. NOCs reporting errors are cluster NOCs
+  "AON-NOC, SCE-NOC, RCE-NOC, BPMP-NOC, CV-NOC" and "CBB Central NOC"
+  which is the main NOC.
+
+  By default, the access issuing initiator is informed about the error
+  using SError or Data Abort exception unless the ERD (Error Response
+  Disable) is enabled/set for that initiator. If the ERD is enabled, then
+  SError or Data Abort is masked and the error is reported with interrupt.
+
+  - For CCPLEX (CPU Complex) initiator, the driver sets ERD bit. So, the
+    errors due to illegal accesses from CCPLEX are reported by interrupts.
+    If ERD is not set, then error is reported by SError.
+  - For other initiators, the ERD is disabled. So, the access issuing
+    initiator is informed about the illegal access by Data Abort exception.
+    In addition, an interrupt is also generated to CCPLEX. These initiators
+    include all engines using Cortex-R5 (which is ARMv7 CPU cluster) and
+    engines like TSEC (Security co-processor), NVDEC (NVIDIA Video Decoder
+    engine) etc which can initiate transactions.
+
+  The driver prints relevant debug information like Error Code, Error
+  Description, Master, Address, AXI ID, Cache, Protection, Security Group
+  etc on receiving error notification.
+
+properties:
+  $nodename:
+    pattern: "^[a-z]+-noc@[0-9a-f]+$"
+
+  compatible:
+    enum:
+      - nvidia,tegra194-cbb-noc
+      - nvidia,tegra194-aon-noc
+      - nvidia,tegra194-bpmp-noc
+      - nvidia,tegra194-rce-noc
+      - nvidia,tegra194-sce-noc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      CCPLEX receives secure or nonsecure interrupt depending on error type.
+      A secure interrupt is received for SEC(firewall) & SLV errors and a
+      non-secure interrupt is received for TMO & DEC errors.
+    items:
+      - description: non-secure interrupt
+      - description: secure interrupt
+
+  nvidia,axi2apb:
+    $ref: '/schemas/types.yaml#/definitions/phandle'
+    description:
+      Specifies the node having all axi2apb bridges which need to be checked
+      for any error logged in their status register.
+
+  nvidia,apbmisc:
+    $ref: '/schemas/types.yaml#/definitions/phandle'
+    description:
+      Specifies the apbmisc node which need to be used for reading the ERD
+      register.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - nvidia,apbmisc
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    cbb-noc@2300000 {
+        compatible = "nvidia,tegra194-cbb-noc";
+        reg = <0x02300000 0x1000>;
+        interrupts = <GIC_SPI 230 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>;
+        nvidia,axi2apb = <&axi2apb>;
+        nvidia,apbmisc = <&apbmisc>;
+    };
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra234-cbb.yaml
new file mode 100644 (file)
index 0000000..7b1fe50
--- /dev/null
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/arm/tegra/nvidia,tegra234-cbb.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: NVIDIA Tegra CBB 2.0 bindings
+
+maintainers:
+  - Sumit Gupta <sumitg@nvidia.com>
+
+description: |+
+  The Control Backbone (CBB) is comprised of the physical path from an
+  initiator to a target's register configuration space. CBB 2.0 consists
+  of multiple sub-blocks connected to each other to create a topology.
+  The Tegra234 SoC has different fabrics based on CBB 2.0 architecture
+  which include cluster fabrics BPMP, AON, PSC, SCE, RCE, DCE, FSI and
+  "CBB central fabric".
+
+  In CBB 2.0, each initiator which can issue transactions connects to a
+  Root Master Node (MN) before it connects to any other element of the
+  fabric. Each Root MN contains a Error Monitor (EM) which detects and
+  logs error. Interrupts from various EM blocks are collated by Error
+  Notifier (EN) which is per fabric and presents a single interrupt from
+  fabric to the SoC interrupt controller.
+
+  The driver handles errors from CBB due to illegal register accesses
+  and prints debug information about failed transaction on receiving
+  the interrupt from EN. Debug information includes Error Code, Error
+  Description, MasterID, Fabric, SlaveID, Address, Cache, Protection,
+  Security Group etc on receiving error notification.
+
+  If the Error Response Disable (ERD) is set/enabled for an initiator,
+  then SError or Data abort exception error response is masked and an
+  interrupt is used for reporting errors due to illegal accesses from
+  that initiator. The value returned on read failures is '0xFFFFFFFF'
+  for compatibility with PCIE.
+
+properties:
+  $nodename:
+    pattern: "^[a-z]+-fabric@[0-9a-f]+$"
+
+  compatible:
+    enum:
+      - nvidia,tegra234-aon-fabric
+      - nvidia,tegra234-bpmp-fabric
+      - nvidia,tegra234-cbb-fabric
+      - nvidia,tegra234-dce-fabric
+      - nvidia,tegra234-rce-fabric
+      - nvidia,tegra234-sce-fabric
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    items:
+      - description: secure interrupt from error notifier
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    cbb-fabric@1300000 {
+      compatible = "nvidia,tegra234-cbb-fabric";
+      reg = <0x13a00000 0x400000>;
+      interrupts = <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>;
+    };
index e79eeac..17caf78 100644 (file)
@@ -28,6 +28,9 @@ properties:
       - items:
           - const: allwinner,sun8i-r40-de2-clk
           - const: allwinner,sun8i-h3-de2-clk
+      - items:
+          - const: allwinner,sun20i-d1-de2-clk
+          - const: allwinner,sun50i-h5-de2-clk
 
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/clock/fsl,scu-clk.yaml b/Documentation/devicetree/bindings/clock/fsl,scu-clk.yaml
new file mode 100644 (file)
index 0000000..f2c4846
--- /dev/null
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/fsl,scu-clk.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - Clock bindings based on SCU Message Protocol
+
+maintainers:
+  - Abel Vesa <abel.vesa@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+  This binding uses the common clock binding.
+  (Documentation/devicetree/bindings/clock/clock-bindings.txt)
+  The clock consumer should specify the desired clock by having the clock
+  ID in its "clocks" phandle cell. See the full list of clock IDs from
+  include/dt-bindings/clock/imx8qxp-clock.h
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - fsl,imx8dxl-clk
+          - fsl,imx8qm-clk
+          - fsl,imx8qxp-clk
+      - const: fsl,scu-clk
+
+  '#clock-cells':
+    const: 2
+
+required:
+  - compatible
+  - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    clock-controller {
+        compatible = "fsl,imx8qxp-clk", "fsl,scu-clk";
+        #clock-cells = <2>;
+    };
index be66f1e..7c331bf 100644 (file)
@@ -45,7 +45,7 @@ description: |
   The case where SH and SP are both 1 is likely not very interesting.
 
 maintainers:
-  - Luca Ceresoli <luca@lucaceresoli.net>
+  - Luca Ceresoli <luca.ceresoli@bootlin.com>
 
 properties:
   compatible:
index 3149767..7a8d375 100644 (file)
@@ -4,18 +4,19 @@
 $id: http://devicetree.org/schemas/clock/qcom,dispcc-sm8x50.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Qualcomm Display Clock & Reset Controller Binding for SM8150/SM8250
+title: Qualcomm Display Clock & Reset Controller Binding for SM8150/SM8250/SM8350
 
 maintainers:
   - Jonathan Marek <jonathan@marek.ca>
 
 description: |
   Qualcomm display clock control module which supports the clocks, resets and
-  power domains on SM8150 and SM8250.
+  power domains on SM8150/SM8250/SM8350.
 
   See also:
     dt-bindings/clock/qcom,dispcc-sm8150.h
     dt-bindings/clock/qcom,dispcc-sm8250.h
+    dt-bindings/clock/qcom,dispcc-sm8350.h
 
 properties:
   compatible:
@@ -23,6 +24,7 @@ properties:
       - qcom,sc8180x-dispcc
       - qcom,sm8150-dispcc
       - qcom,sm8250-dispcc
+      - qcom,sm8350-dispcc
 
   clocks:
     items:
diff --git a/Documentation/devicetree/bindings/clock/qcom,gpucc-sm8350.yaml b/Documentation/devicetree/bindings/clock/qcom,gpucc-sm8350.yaml
new file mode 100644 (file)
index 0000000..0a0546c
--- /dev/null
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,gpucc-sm8350.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Graphics Clock & Reset Controller Binding
+
+maintainers:
+  - Robert Foss <robert.foss@linaro.org>
+
+description: |
+  Qualcomm graphics clock control module which supports the clocks, resets and
+  power domains on Qualcomm SoCs.
+
+  See also:
+    dt-bindings/clock/qcom,gpucc-sm8350.h
+
+properties:
+  compatible:
+    enum:
+      - qcom,sm8350-gpucc
+
+  clocks:
+    items:
+      - description: Board XO source
+      - description: GPLL0 main branch source
+      - description: GPLL0 div branch source
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - '#clock-cells'
+  - '#reset-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sm8350.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        clock-controller@3d90000 {
+            compatible = "qcom,sm8350-gpucc";
+            reg = <0 0x03d90000 0 0x9000>;
+            clocks = <&rpmhcc RPMH_CXO_CLK>,
+                     <&gcc GCC_GPU_GPLL0_CLK_SRC>,
+                     <&gcc GCC_GPU_GPLL0_DIV_CLK_SRC>;
+            #clock-cells = <1>;
+            #reset-cells = <1>;
+            #power-domain-cells = <1>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/clock/qcom,sm8450-camcc.yaml b/Documentation/devicetree/bindings/clock/qcom,sm8450-camcc.yaml
new file mode 100644 (file)
index 0000000..268f4c6
--- /dev/null
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,sm8450-camcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Camera Clock & Reset Controller Binding for SM8450
+
+maintainers:
+  - Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
+
+description: |
+  Qualcomm camera clock control module which supports the clocks, resets and
+  power domains on SM8450.
+
+  See also include/dt-bindings/clock/qcom,sm8450-camcc.h
+
+properties:
+  compatible:
+    const: qcom,sm8450-camcc
+
+  clocks:
+    items:
+      - description: Camera AHB clock from GCC
+      - description: Board XO source
+      - description: Board active XO source
+      - description: Sleep clock source
+
+  power-domains:
+    maxItems: 1
+    description:
+      A phandle and PM domain specifier for the MMCX power domain.
+
+  required-opps:
+    description:
+      A phandle to an OPP node describing required MMCX performance point.
+
+  '#clock-cells':
+    const: 1
+
+  '#reset-cells':
+    const: 1
+
+  '#power-domain-cells':
+    const: 1
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - power-domains
+  - required-opps
+  - '#clock-cells'
+  - '#reset-cells'
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-sm8450.h>
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    #include <dt-bindings/power/qcom-rpmpd.h>
+    clock-controller@ade0000 {
+      compatible = "qcom,sm8450-camcc";
+      reg = <0xade0000 0x20000>;
+      clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+               <&rpmhcc RPMH_CXO_CLK>,
+               <&rpmhcc RPMH_CXO_CLK_A>,
+               <&sleep_clk>;
+      power-domains = <&rpmhpd SM8450_MMCX>;
+      required-opps = <&rpmhpd_opp_low_svs>;
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+      #power-domain-cells = <1>;
+    };
+...
index 5073e56..006d33a 100644 (file)
@@ -33,6 +33,7 @@ properties:
     enum:
       - samsung,exynos7885-cmu-top
       - samsung,exynos7885-cmu-core
+      - samsung,exynos7885-cmu-fsys
       - samsung,exynos7885-cmu-peri
 
   clocks:
@@ -88,6 +89,32 @@ allOf:
             - const: dout_core_cci
             - const: dout_core_g3d
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: samsung,exynos7885-cmu-fsys
+
+    then:
+      properties:
+        clocks:
+          items:
+            - description: External reference clock (26 MHz)
+            - description: CMU_FSYS bus clock (from CMU_TOP)
+            - description: MMC_CARD clock (from CMU_TOP)
+            - description: MMC_EMBD clock (from CMU_TOP)
+            - description: MMC_SDIO clock (from CMU_TOP)
+            - description: USB30DRD clock (from CMU_TOP)
+
+        clock-names:
+          items:
+            - const: oscclk
+            - const: dout_fsys_bus
+            - const: dout_fsys_mmc_card
+            - const: dout_fsys_mmc_embd
+            - const: dout_fsys_mmc_sdio
+            - const: dout_fsys_usb30drd
+
   - if:
       properties:
         compatible:
index f8c4742..242fe92 100644 (file)
@@ -78,6 +78,7 @@ if:
       contains:
         enum:
           - st,stm32mp1-rcc-secure
+          - st,stm32mp13-rcc
 then:
   properties:
     clocks:
index 73470ec..ce91a91 100644 (file)
@@ -16,7 +16,7 @@ has been processed. See [2] for more information on the brcm,l2-intc node.
 firmware. On some SoCs, this firmware supports DFS and DVFS in addition to
 Adaptive Voltage Scaling.
 
-[2] Documentation/devicetree/bindings/interrupt-controller/brcm,l2-intc.txt
+[2] Documentation/devicetree/bindings/interrupt-controller/brcm,l2-intc.yaml
 
 
 Node brcm,avs-cpu-data-mem
index 795a08a..2a17ec6 100644 (file)
@@ -71,11 +71,6 @@ properties:
       - description: number of output lines for the green channel (G)
       - description: number of output lines for the blue channel (B)
 
-  arm,malidp-arqos-high-level:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description:
-      integer describing the ARQoS levels of DP500's QoS signaling
-
   arm,malidp-arqos-value:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -113,7 +108,7 @@ examples:
         clocks = <&oscclk2>, <&fpgaosc0>, <&fpgaosc1>, <&fpgaosc1>;
         clock-names = "pxlclk", "mclk", "aclk", "pclk";
         arm,malidp-output-port-lines = /bits/ 8 <8 8 8>;
-        arm,malidp-arqos-high-level = <0xd000d000>;
+        arm,malidp-arqos-value = <0xd000d000>;
 
         port {
             dp0_output: endpoint {
index b41991e..d3c3e4b 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DPU dt properties for SC7180 target
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 description: |
   Device tree bindings for MSM Mobile Display Subsystem(MDSS) that encapsulates
index 6e417d0..f427eec 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DPU dt properties for SC7280
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 description: |
   Device tree bindings for MSM Mobile Display Subsystem (MDSS) that encapsulates
index 1a42491..2bb8896 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DPU dt properties for SDM845 target
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 description: |
   Device tree bindings for MSM Mobile Display Subsystem(MDSS) that encapsulates
index 7095ec3..880bfe9 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DSI controller
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 allOf:
   - $ref: "../dsi-controller.yaml#"
index 2d5a766..716f921 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DSI 10nm PHY
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 allOf:
   - $ref: dsi-phy-common.yaml#
index 81dbee4..1342d74 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DSI 14nm PHY
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 allOf:
   - $ref: dsi-phy-common.yaml#
index b8de785..9c1f914 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DSI 20nm PHY
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 allOf:
   - $ref: dsi-phy-common.yaml#
index 69eecaa..3d8540a 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm Display DSI 28nm PHY
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 allOf:
   - $ref: dsi-phy-common.yaml#
index 502bdda..76d40f7 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Description of Qualcomm Display DSI PHY common dt properties
 
 maintainers:
-  - Krishna Manikandan <mkrishn@codeaurora.org>
+  - Krishna Manikandan <quic_mkrishn@quicinc.com>
 
 description: |
   This defines the DSI PHY dt properties which are common for all
diff --git a/Documentation/devicetree/bindings/firmware/fsl,scu.yaml b/Documentation/devicetree/bindings/firmware/fsl,scu.yaml
new file mode 100644 (file)
index 0000000..b40b0ef
--- /dev/null
@@ -0,0 +1,210 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/fsl,scu.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX System Controller Firmware (SCFW)
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description:
+  The System Controller Firmware (SCFW) is a low-level system function
+  which runs on a dedicated Cortex-M core to provide power, clock, and
+  resource management. It exists on some i.MX8 processors. e.g. i.MX8QM
+  (QM, QP), and i.MX8QX (QXP, DX).
+  The AP communicates with the SC using a multi-ported MU module found
+  in the LSIO subsystem. The current definition of this MU module provides
+  5 remote AP connections to the SC to support up to 5 execution environments
+  (TZ, HV, standard Linux, etc.). The SC side of this MU module interfaces
+  with the LSIO DSC IP bus. The SC firmware will communicate with this MU
+  using the MSI bus.
+
+properties:
+  compatible:
+    const: fsl,imx-scu
+
+  clock-controller:
+    description:
+      Clock controller node that provides the clocks controlled by the SCU
+    $ref: /schemas/clock/fsl,scu-clk.yaml
+
+  ocotp:
+    description:
+      OCOTP controller node provided by the SCU
+    $ref: /schemas/nvmem/fsl,scu-ocotp.yaml
+
+  keys:
+    description:
+      Keys provided by the SCU
+    $ref: /schemas/input/fsl,scu-key.yaml
+
+  mboxes:
+    description:
+      A list of phandles of TX MU channels followed by a list of phandles of
+      RX MU channels. The list may include at the end one more optional MU
+      channel for general interrupt. The number of expected tx and rx
+      channels is 1 TX and 1 RX channels if MU instance is "fsl,imx8-mu-scu"
+      compatible, 4 TX and 4 RX channels otherwise. All MU channels must be
+      within the same MU instance. Cross instances are not allowed. The MU
+      instance can only be one of LSIO MU0~M4 for imx8qxp and imx8qm. Users
+      need to ensure that one is used that does not conflict with other
+      execution environments such as ATF.
+    oneOf:
+      - items:
+          - description: TX0 MU channel
+          - description: RX0 MU channel
+      - items:
+          - description: TX0 MU channel
+          - description: RX0 MU channel
+          - description: optional MU channel for general interrupt
+      - items:
+          - description: TX0 MU channel
+          - description: TX1 MU channel
+          - description: TX2 MU channel
+          - description: TX3 MU channel
+          - description: RX0 MU channel
+          - description: RX1 MU channel
+          - description: RX2 MU channel
+          - description: RX3 MU channel
+      - items:
+          - description: TX0 MU channel
+          - description: TX1 MU channel
+          - description: TX2 MU channel
+          - description: TX3 MU channel
+          - description: RX0 MU channel
+          - description: RX1 MU channel
+          - description: RX2 MU channel
+          - description: RX3 MU channel
+          - description: optional MU channel for general interrupt
+
+  mbox-names:
+    oneOf:
+      - items:
+          - const: tx0
+          - const: rx0
+      - items:
+          - const: tx0
+          - const: rx0
+          - const: gip3
+      - items:
+          - const: tx0
+          - const: tx1
+          - const: tx2
+          - const: tx3
+          - const: rx0
+          - const: rx1
+          - const: rx2
+          - const: rx3
+      - items:
+          - const: tx0
+          - const: tx1
+          - const: tx2
+          - const: tx3
+          - const: rx0
+          - const: rx1
+          - const: rx2
+          - const: rx3
+          - const: gip3
+
+  pinctrl:
+    description:
+      Pin controller provided by the SCU
+    $ref: /schemas/pinctrl/fsl,scu-pinctrl.yaml
+
+  power-controller:
+    description:
+      Power domains controller node that provides the power domains
+      controlled by the SCU
+    $ref: /schemas/power/fsl,scu-pd.yaml
+
+  rtc:
+    description:
+      RTC controller provided by the SCU
+    $ref: /schemas/rtc/fsl,scu-rtc.yaml
+
+  thermal-sensor:
+    description:
+      Thermal sensor provided by the SCU
+    $ref: /schemas/thermal/fsl,scu-thermal.yaml
+
+  watchdog:
+    description:
+      Watchdog controller provided by the SCU
+    $ref: /schemas/watchdog/fsl,scu-wdt.yaml
+
+required:
+  - compatible
+  - mbox-names
+  - mboxes
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/firmware/imx/rsrc.h>
+    #include <dt-bindings/input/input.h>
+    #include <dt-bindings/pinctrl/pads-imx8qxp.h>
+
+    firmware {
+        system-controller {
+            compatible = "fsl,imx-scu";
+            mbox-names = "tx0", "tx1", "tx2", "tx3",
+                         "rx0", "rx1", "rx2", "rx3",
+                         "gip3";
+            mboxes = <&lsio_mu1 0 0 &lsio_mu1 0 1 &lsio_mu1 0 2 &lsio_mu1 0 3
+                      &lsio_mu1 1 0 &lsio_mu1 1 1 &lsio_mu1 1 2 &lsio_mu1 1 3
+                      &lsio_mu1 3 3>;
+
+            clock-controller {
+                compatible = "fsl,imx8qxp-clk", "fsl,scu-clk";
+                #clock-cells = <2>;
+            };
+
+            pinctrl {
+                compatible = "fsl,imx8qxp-iomuxc";
+
+                pinctrl_lpuart0: lpuart0grp {
+                    fsl,pins = <
+                        IMX8QXP_UART0_RX_ADMA_UART0_RX   0x06000020
+                        IMX8QXP_UART0_TX_ADMA_UART0_TX   0x06000020
+                    >;
+                };
+            };
+
+            ocotp {
+                compatible = "fsl,imx8qxp-scu-ocotp";
+                #address-cells = <1>;
+                #size-cells = <1>;
+
+                fec_mac0: mac@2c4 {
+                    reg = <0x2c4 6>;
+                };
+            };
+
+            power-controller {
+                compatible = "fsl,imx8qxp-scu-pd", "fsl,scu-pd";
+                #power-domain-cells = <1>;
+            };
+
+            rtc {
+                compatible = "fsl,imx8qxp-sc-rtc";
+            };
+
+            keys {
+                compatible = "fsl,imx8qxp-sc-key", "fsl,imx-sc-key";
+                linux,keycodes = <KEY_POWER>;
+            };
+
+            watchdog {
+                compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
+                timeout-sec = <60>;
+            };
+
+            thermal-sensor {
+                compatible = "fsl,imx8qxp-sc-thermal", "fsl,imx-sc-thermal";
+                #thermal-sensor-cells = <1>;
+            };
+        };
+    };
index 378da26..29c27ea 100644 (file)
@@ -11,7 +11,11 @@ maintainers:
 
 properties:
   compatible:
-    const: xlnx,zynq-gpio-1.0
+    enum:
+      - xlnx,zynq-gpio-1.0
+      - xlnx,zynqmp-gpio-1.0
+      - xlnx,versal-gpio-1.0
+      - xlnx,pmc-gpio-1.0
 
   reg:
     maxItems: 1
@@ -24,6 +28,11 @@ properties:
 
   gpio-controller: true
 
+  gpio-line-names:
+    description: strings describing the names of each gpio line
+    minItems: 58
+    maxItems: 174
+
   interrupt-controller: true
 
   "#interrupt-cells":
@@ -32,6 +41,54 @@ properties:
   clocks:
     maxItems: 1
 
+  power-domains:
+    maxItems: 1
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          enum:
+            - xlnx,zynqmp-gpio-1.0
+    then:
+      properties:
+        gpio-line-names:
+          minItems: 174
+          maxItems: 174
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - xlnx,zynq-gpio-1.0
+    then:
+      properties:
+        gpio-line-names:
+          minItems: 118
+          maxItems: 118
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - xlnx,versal-gpio-1.0
+    then:
+      properties:
+        gpio-line-names:
+          minItems: 58
+          maxItems: 58
+
+  - if:
+      properties:
+        compatible:
+          enum:
+            - xlnx,pmc-gpio-1.0
+    then:
+      properties:
+        gpio-line-names:
+          minItems: 116
+          maxItems: 116
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml b/Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml
new file mode 100644 (file)
index 0000000..792f371
--- /dev/null
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwinfo/renesas,prr.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Product Register
+
+maintainers:
+  - Geert Uytterhoeven <geert+renesas@glider.be>
+  - Magnus Damm <magnus.damm@gmail.com>
+
+description: |
+  Most Renesas ARM SoCs have a Product Register or Boundary Scan ID
+  Register that allows to retrieve SoC product and revision information.
+  If present, a device node for this register should be added.
+
+properties:
+  compatible:
+    enum:
+      - renesas,prr
+      - renesas,bsid
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    prr: chipid@ff000044 {
+        compatible = "renesas,prr";
+        reg = <0xff000044 4>;
+    };
index fe0ac08..0e8ddf0 100644 (file)
@@ -40,9 +40,8 @@ properties:
       value to be used for converting remote channel measurements to
       temperature.
     $ref: /schemas/types.yaml#/definitions/int32
-    items:
-      minimum: -128
-      maximum: 127
+    minimum: -128
+    maximum: 127
 
   ti,beta-compensation:
     description:
index 9c27ed6..4a4df4f 100644 (file)
@@ -9,7 +9,7 @@ Requires node properties:
        "arm,vexpress-power"
        "arm,vexpress-energy"
 - "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg
-  (see Documentation/devicetree/bindings/arm/vexpress-sysreg.txt
+  (see Documentation/devicetree/bindings/arm/vexpress-config.yaml
   for more details)
 
 Optional node properties:
index f771c09..0ec033e 100644 (file)
@@ -21,10 +21,18 @@ properties:
           - enum:
               - allwinner,sun8i-a23-i2c
               - allwinner,sun8i-a83t-i2c
+              - allwinner,sun8i-v536-i2c
               - allwinner,sun50i-a64-i2c
-              - allwinner,sun50i-a100-i2c
               - allwinner,sun50i-h6-i2c
+          - const: allwinner,sun6i-a31-i2c
+      - description: Allwinner SoCs with offload support
+        items:
+          - enum:
+              - allwinner,sun20i-d1-i2c
+              - allwinner,sun50i-a100-i2c
               - allwinner,sun50i-h616-i2c
+              - allwinner,sun50i-r329-i2c
+          - const: allwinner,sun8i-v536-i2c
           - const: allwinner,sun6i-a31-i2c
       - const: marvell,mv64xxx-i2c
       - const: marvell,mv78230-i2c
diff --git a/Documentation/devicetree/bindings/input/fsl,scu-key.yaml b/Documentation/devicetree/bindings/input/fsl,scu-key.yaml
new file mode 100644 (file)
index 0000000..e6266d1
--- /dev/null
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/fsl,scu-key.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - SCU key bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+
+allOf:
+  - $ref: input.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8qxp-sc-key
+      - const: fsl,imx-sc-key
+
+  linux,keycodes:
+    maxItems: 1
+
+required:
+  - compatible
+  - linux,keycodes
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/input/input.h>
+
+    keys {
+        compatible = "fsl,imx8qxp-sc-key", "fsl,imx-sc-key";
+        linux,keycodes = <KEY_POWER>;
+    };
index f89ebde..de7c5e5 100644 (file)
@@ -30,6 +30,7 @@ properties:
       - socionext,uniphier-ld11-aidet
       - socionext,uniphier-ld20-aidet
       - socionext,uniphier-pxs3-aidet
+      - socionext,uniphier-nx1-aidet
 
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml b/Documentation/devicetree/bindings/iommu/xen,grant-dma.yaml
new file mode 100644 (file)
index 0000000..be1539d
--- /dev/null
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iommu/xen,grant-dma.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Xen specific IOMMU for virtualized devices (e.g. virtio)
+
+maintainers:
+  - Stefano Stabellini <sstabellini@kernel.org>
+
+description:
+  The Xen IOMMU represents the Xen grant table interface. Grant mappings
+  are to be used with devices connected to the Xen IOMMU using the "iommus"
+  property, which also specifies the ID of the backend domain.
+  The binding is required to restrict memory access using Xen grant mappings.
+
+properties:
+  compatible:
+    const: xen,grant-dma
+
+  '#iommu-cells':
+    const: 1
+    description:
+      The single cell is the domid (domain ID) of the domain where the backend
+      is running.
+
+required:
+  - compatible
+  - "#iommu-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    iommu {
+        compatible = "xen,grant-dma";
+        #iommu-cells = <1>;
+    };
index c7cfa6c..935d63d 100644 (file)
@@ -150,7 +150,6 @@ allOf:
           description: 5 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          maxItems: 6
           items:
             - const: sid
             - const: broadcast
@@ -170,7 +169,6 @@ allOf:
           description: 17 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          minItems: 18
           items:
             - const: sid
             - const: broadcast
@@ -202,7 +200,6 @@ allOf:
           description: 17 memory controller channels and 1 for stream-id registers
 
         reg-names:
-          minItems: 18
           items:
             - const: sid
             - const: broadcast
index 74a6867..edac14a 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: MAX77714 PMIC with GPIO, RTC and watchdog from Maxim Integrated.
 
 maintainers:
-  - Luca Ceresoli <luca@lucaceresoli.net>
+  - Luca Ceresoli <luca.ceresoli@bootlin.com>
 
 description: |
   MAX77714 is a Power Management IC with 4 buck regulators, 9
index b672202..5ecdac9 100644 (file)
@@ -75,7 +75,6 @@ examples:
       sd-uhs-sdr104;
       sdhci,auto-cmd12;
       interrupts = <0x0 0x26 0x4>;
-      interrupt-names = "sdio0_0";
       clocks = <&scmi_clk 245>;
       clock-names = "sw_sdio";
     };
@@ -94,7 +93,6 @@ examples:
       non-removable;
       bus-width = <0x8>;
       interrupts = <0x0 0x27 0x4>;
-      interrupt-names = "sdio1_0";
       clocks = <&scmi_clk 245>;
       clock-names = "sw_sdio";
     };
index c79639e..3ee7588 100644 (file)
@@ -56,6 +56,9 @@ properties:
       - const: core
       - const: axi
 
+  interrupts:
+    maxItems: 1
+
   marvell,xenon-sdhc-id:
     $ref: /schemas/types.yaml#/definitions/uint32
     minimum: 0
@@ -145,7 +148,6 @@ allOf:
           items:
             - description: Xenon IP registers
             - description: Armada 3700 SoC PHY PAD Voltage Control register
-          minItems: 2
 
         marvell,pad-type:
           $ref: /schemas/types.yaml#/definitions/string
index 6a4831f..55fc620 100644 (file)
@@ -22,6 +22,7 @@ properties:
           - enum:
               - allwinner,sun20i-d1-emac
               - allwinner,sun50i-h6-emac
+              - allwinner,sun50i-h616-emac0
           - const: allwinner,sun50i-a64-emac
 
   reg:
diff --git a/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml b/Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
new file mode 100644 (file)
index 0000000..2d33bba
--- /dev/null
@@ -0,0 +1,171 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/pcs/renesas,rzn1-miic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/N1 MII converter
+
+maintainers:
+  - Clément Léger <clement.leger@bootlin.com>
+
+description: |
+  This MII converter is present on the Renesas RZ/N1 SoC family. It is
+  responsible to do MII passthrough or convert it to RMII/RGMII.
+
+properties:
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+  compatible:
+    items:
+      - enum:
+          - renesas,r9a06g032-miic
+      - const: renesas,rzn1-miic
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: MII reference clock
+      - description: RGMII reference clock
+      - description: RMII reference clock
+      - description: AHB clock used for the MII converter register interface
+
+  clock-names:
+    items:
+      - const: mii_ref
+      - const: rgmii_ref
+      - const: rmii_ref
+      - const: hclk
+
+  renesas,miic-switch-portin:
+    description: MII Switch PORTIN configuration. This value should use one of
+      the values defined in dt-bindings/net/pcs-rzn1-miic.h.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [1, 2]
+
+  power-domains:
+    maxItems: 1
+
+patternProperties:
+  "^mii-conv@[0-5]$":
+    type: object
+    description: MII converter port
+
+    properties:
+      reg:
+        description: MII Converter port number.
+        enum: [1, 2, 3, 4, 5]
+
+      renesas,miic-input:
+        description: Converter input port configuration. This value should use
+          one of the values defined in dt-bindings/net/pcs-rzn1-miic.h.
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+    required:
+      - reg
+      - renesas,miic-input
+
+    additionalProperties: false
+
+    allOf:
+      - if:
+          properties:
+            reg:
+              const: 1
+        then:
+          properties:
+            renesas,miic-input:
+              const: 0
+      - if:
+          properties:
+            reg:
+              const: 2
+        then:
+          properties:
+            renesas,miic-input:
+              enum: [1, 11]
+      - if:
+          properties:
+            reg:
+              const: 3
+        then:
+          properties:
+            renesas,miic-input:
+              enum: [7, 10]
+      - if:
+          properties:
+            reg:
+              const: 4
+        then:
+          properties:
+            renesas,miic-input:
+              enum: [4, 6, 9, 13]
+      - if:
+          properties:
+            reg:
+              const: 5
+        then:
+          properties:
+            renesas,miic-input:
+              enum: [3, 5, 8, 12]
+
+required:
+  - '#address-cells'
+  - '#size-cells'
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - power-domains
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/net/pcs-rzn1-miic.h>
+    #include <dt-bindings/clock/r9a06g032-sysctrl.h>
+
+    eth-miic@44030000 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      compatible = "renesas,r9a06g032-miic", "renesas,rzn1-miic";
+      reg = <0x44030000 0x10000>;
+      clocks = <&sysctrl R9A06G032_CLK_MII_REF>,
+              <&sysctrl R9A06G032_CLK_RGMII_REF>,
+              <&sysctrl R9A06G032_CLK_RMII_REF>,
+              <&sysctrl R9A06G032_HCLK_SWITCH_RG>;
+      clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
+      renesas,miic-switch-portin = <MIIC_GMAC2_PORT>;
+      power-domains = <&sysctrl>;
+
+      mii_conv1: mii-conv@1 {
+        renesas,miic-input = <MIIC_GMAC1_PORT>;
+        reg = <1>;
+      };
+
+      mii_conv2: mii-conv@2 {
+        renesas,miic-input = <MIIC_SWITCH_PORTD>;
+        reg = <2>;
+      };
+
+      mii_conv3: mii-conv@3 {
+        renesas,miic-input = <MIIC_SWITCH_PORTC>;
+        reg = <3>;
+      };
+
+      mii_conv4: mii-conv@4 {
+        renesas,miic-input = <MIIC_SWITCH_PORTB>;
+        reg = <4>;
+      };
+
+      mii_conv5: mii-conv@5 {
+        renesas,miic-input = <MIIC_SWITCH_PORTA>;
+        reg = <5>;
+      };
+    };
index ddff923..34dd1cc 100644 (file)
@@ -55,7 +55,6 @@ properties:
     maxItems: 1
 
   apple,sart:
-    maxItems: 1
     $ref: /schemas/types.yaml#/definitions/phandle
     description: |
       Reference to the SART address filter.
diff --git a/Documentation/devicetree/bindings/nvmem/fsl,scu-ocotp.yaml b/Documentation/devicetree/bindings/nvmem/fsl,scu-ocotp.yaml
new file mode 100644 (file)
index 0000000..6826882
--- /dev/null
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/fsl,scu-ocotp.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - OCOTP bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+
+allOf:
+  - $ref: nvmem.yaml#
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx8qm-scu-ocotp
+      - fsl,imx8qxp-scu-ocotp
+
+patternProperties:
+  '^mac@[0-9a-f]*$':
+    type: object
+    description:
+      MAC address.
+
+    properties:
+      reg:
+        description:
+          Byte offset within OCOTP where the MAC address is stored
+        maxItems: 1
+
+    required:
+      - reg
+
+    additionalProperties: false
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    ocotp {
+        compatible = "fsl,imx8qxp-scu-ocotp";
+        #address-cells = <1>;
+        #size-cells = <1>;
+
+        fec_mac0: mac@2c4 {
+            reg = <0x2c4 6>;
+        };
+    };
index de6a706..35f03df 100644 (file)
@@ -9,7 +9,7 @@ Required properties:
 - resets               : list of phandle and reset specifier pairs. There should be two entries, one
                          for the whole phy and one for the port
 - reset-names          : list of reset signal names. Should be "global" and "port"
-See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/st,stih407-powerdown.yaml
 See: Documentation/devicetree/bindings/reset/reset.txt
 
 Example:
index 60dc278..b078009 100644 (file)
@@ -8,7 +8,7 @@ $schema: "http://devicetree.org/meta-schemas/core.yaml#"
 title: Qualcomm QMP USB3 DP PHY controller
 
 maintainers:
-  - Manu Gautam <mgautam@codeaurora.org>
+  - Wesley Cheng <quic_wcheng@quicinc.com>
 
 properties:
   compatible:
index 0ab3dad..d68ab49 100644 (file)
@@ -8,7 +8,7 @@ $schema: "http://devicetree.org/meta-schemas/core.yaml#"
 title: Qualcomm QUSB2 phy controller
 
 maintainers:
-  - Manu Gautam <mgautam@codeaurora.org>
+  - Wesley Cheng <quic_wcheng@quicinc.com>
 
 description:
   QUSB2 controller supports LS/FS/HS usb connectivity on Qualcomm chipsets.
index 1ce251d..7a0e6a9 100644 (file)
@@ -7,7 +7,7 @@ $schema: "http://devicetree.org/meta-schemas/core.yaml#"
 title: Qualcomm Synopsys Femto High-Speed USB PHY V2
 
 maintainers:
-  - Wesley Cheng <wcheng@codeaurora.org>
+  - Wesley Cheng <quic_wcheng@quicinc.com>
 
 description: |
   Qualcomm High-Speed USB PHY
index bfce850..0681b9a 100644 (file)
@@ -127,20 +127,17 @@ patternProperties:
 
     additionalProperties: false
 
-  "^vcc-p[a-hlm]-supply$":
+  "^vcc-p[a-ilm]-supply$":
     description:
       Power supplies for pin banks.
 
 required:
   - "#gpio-cells"
-  - "#interrupt-cells"
   - compatible
   - reg
-  - interrupts
   - clocks
   - clock-names
   - gpio-controller
-  - interrupt-controller
 
 allOf:
   # FIXME: We should have the pin bank supplies here, but not a lot of
@@ -148,6 +145,19 @@ allOf:
   # warnings.
 
   - $ref: "pinctrl.yaml#"
+  - if:
+      not:
+        properties:
+          compatible:
+            enum:
+              - allwinner,sun50i-h616-r-pinctrl
+
+    then:
+      required:
+        - "#interrupt-cells"
+        - interrupts
+        - interrupt-controller
+
   - if:
       properties:
         compatible:
diff --git a/Documentation/devicetree/bindings/pinctrl/fsl,scu-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/fsl,scu-pinctrl.yaml
new file mode 100644 (file)
index 0000000..45ea565
--- /dev/null
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/fsl,scu-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - Pinctrl bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+  This binding uses the i.MX common pinctrl binding.
+  (Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt)
+
+allOf:
+  - $ref: pinctrl.yaml#
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx8qm-iomuxc
+      - fsl,imx8qxp-iomuxc
+      - fsl,imx8dxl-iomuxc
+
+patternProperties:
+  'grp$':
+    type: object
+    description:
+      Pinctrl node's client devices use subnodes for desired pin configuration.
+      Client device subnodes use below standard properties.
+
+    properties:
+      fsl,pins:
+        description:
+          each entry consists of 3 integers and represents the pin ID, the mux value
+          and pad setting for the pin. The first 2 integers - pin_id and mux_val - are
+          specified using a PIN_FUNC_ID macro, which can be found in
+          <include/dt-bindings/pinctrl/pads-imx8qxp.h>. The last integer is
+          the pad setting value like pull-up on this pin. Please refer to the
+          appropriate i.MX8 Reference Manual for detailed pad CONFIG settings.
+        $ref: /schemas/types.yaml#/definitions/uint32-matrix
+        items:
+          items:
+            - description: |
+                "pin_id" indicates the pin ID
+            - description: |
+                "mux_val" indicates the mux value to be applied.
+            - description: |
+                "pad_setting" indicates the pad configuration value to be applied.
+
+    required:
+      - fsl,pins
+
+    additionalProperties: false
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    pinctrl {
+        compatible = "fsl,imx8qxp-iomuxc";
+
+        pinctrl_lpuart0: lpuart0grp {
+            fsl,pins = <
+                111 0 0x06000020
+                112 0 0x06000020
+            >;
+        };
+    };
index cbcbd31..939cb5b 100644 (file)
@@ -27,7 +27,7 @@ Required properties:
 - pins: List of pins. Valid values of pins properties are: gpio0, gpio1.
 
 First 2 properties must be added in the RK805 PMIC node, documented in
-Documentation/devicetree/bindings/mfd/rk808.txt
+Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
 
 Optional properties:
 -------------------
index 4d820df..6f17f39 100644 (file)
@@ -32,31 +32,37 @@ patternProperties:
           groups:
             description: The pin group to select.
             enum: [
+              # common
+              i2c, spi, wdt,
+
               # For MT7620 SoC
-              ephy, i2c, mdio, nd_sd, pa, pcie, rgmii1, rgmii2, spi, spi refclk,
-              uartf, uartlite, wdt, wled,
+              ephy, mdio, nd_sd, pa, pcie, rgmii1, rgmii2, spi refclk,
+              uartf, uartlite, wled,
 
               # For MT7628 and MT7688 SoCs
-              gpio, i2c, i2s, p0led_an, p0led_kn, p1led_an, p1led_kn, p2led_an,
+              gpio, i2s, p0led_an, p0led_kn, p1led_an, p1led_kn, p2led_an,
               p2led_kn, p3led_an, p3led_kn, p4led_an, p4led_kn, perst, pwm0,
-              pwm1, refclk, sdmode, spi, spi cs1, spis, uart0, uart1, uart2,
-              wdt, wled_an, wled_kn,
+              pwm1, refclk, sdmode, spi cs1, spis, uart0, uart1, uart2,
+              wled_an, wled_kn,
             ]
 
           function:
             description: The mux function to select.
             enum: [
+              # common
+              gpio, i2c, refclk, spi,
+
               # For MT7620 SoC
-              ephy, gpio, gpio i2s, gpio uartf, i2c, i2s uartf, mdio, nand, pa,
-              pcie refclk, pcie rst, pcm gpio, pcm i2s, pcm uartf, refclk,
-              rgmii1, rgmii2, sd, spi, spi refclk, uartf, uartlite, wdt refclk,
+              ephy, gpio i2s, gpio uartf, i2s uartf, mdio, nand, pa,
+              pcie refclk, pcie rst, pcm gpio, pcm i2s, pcm uartf,
+              rgmii1, rgmii2, sd, spi refclk, uartf, uartlite, wdt refclk,
               wdt rst, wled,
 
               # For MT7628 and MT7688 SoCs
-              antenna, debug, gpio, i2c, i2s, jtag, p0led_an, p0led_kn,
+              antenna, debug, i2s, jtag, p0led_an, p0led_kn,
               p1led_an, p1led_kn, p2led_an, p2led_kn, p3led_an, p3led_kn,
               p4led_an, p4led_kn, pcie, pcm, perst, pwm, pwm0, pwm1, pwm_uart2,
-              refclk, rsvd, sdxc, sdxc d5 d4, sdxc d6, sdxc d7, spi, spi cs1,
+              rsvd, sdxc, sdxc d5 d4, sdxc d6, sdxc d7, spi cs1,
               spis, sw_r, uart0, uart1, uart2, utif, wdt, wled_an, wled_kn, -,
             ]
 
index 425401c..f602a5d 100644 (file)
@@ -33,32 +33,29 @@ patternProperties:
           groups:
             description: The pin group to select.
             enum: [
+              # common
+              i2c, jtag, led, mdio, rgmii, spi, spi_cs1, uartf, uartlite,
+
               # For RT3050, RT3052 and RT3350 SoCs
-              i2c, jtag, mdio, rgmii, sdram, spi, uartf, uartlite,
+              sdram,
 
               # For RT3352 SoC
-              i2c, jtag, led, lna, mdio, pa, rgmii, spi, spi_cs1, uartf,
-              uartlite,
-
-              # For RT5350 SoC
-              i2c, jtag, led, spi, spi_cs1, uartf, uartlite,
+              lna, pa
             ]
 
           function:
             description: The mux function to select.
             enum: [
+              # common
+              gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, mdio,
+              pcm gpio, pcm i2s, pcm uartf, rgmii, spi, spi_cs1, uartf,
+              uartlite, wdg_cs1,
+
               # For RT3050, RT3052 and RT3350 SoCs
-              gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, mdio, pcm gpio,
-              pcm i2s, pcm uartf, rgmii, sdram, spi, uartf, uartlite,
+              sdram,
 
               # For RT3352 SoC
-              gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, lna, mdio,
-              pa, pcm gpio, pcm i2s, pcm uartf, rgmii, spi, spi_cs1, uartf,
-              uartlite, wdg_cs1,
-
-              # For RT5350 SoC
-              gpio, gpio i2s, gpio uartf, i2c, i2s uartf, jtag, led, pcm gpio,
-              pcm i2s, pcm uartf, spi, spi_cs1, uartf, uartlite, wdg_cs1,
+              lna, pa
             ]
 
         required:
diff --git a/Documentation/devicetree/bindings/power/fsl,scu-pd.yaml b/Documentation/devicetree/bindings/power/fsl,scu-pd.yaml
new file mode 100644 (file)
index 0000000..1f72b18
--- /dev/null
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/fsl,scu-pd.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - Power domain bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+  Power domain bindings based on SCU Message Protocol
+
+allOf:
+  - $ref: power-domain.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - fsl,imx8qm-scu-pd
+          - fsl,imx8qxp-scu-pd
+      - const: fsl,scu-pd
+
+  '#power-domain-cells':
+    const: 1
+
+required:
+  - compatible
+  - '#power-domain-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    power-controller {
+        compatible = "fsl,imx8qxp-scu-pd", "fsl,scu-pd";
+        #power-domain-cells = <1>;
+    };
index 675b9b2..f23dcc5 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Maxim Integrated MAX77976 Battery charger
 
 maintainers:
-  - Luca Ceresoli <luca@lucaceresoli.net>
+  - Luca Ceresoli <luca.ceresoli@bootlin.com>
 
 description: |
   The Maxim MAX77976 is a 19Vin / 5.5A, 1-Cell Li+ battery charger
index 12ed98c..dbe78cd 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: The Qualcomm PMIC VBUS output regulator driver
 
 maintainers:
-  - Wesley Cheng <wcheng@codeaurora.org>
+  - Wesley Cheng <quic_wcheng@quicinc.com>
 
 description: |
   This regulator driver controls the VBUS output by the Qualcomm PMIC.  This
index d775f72..1c2e92c 100644 (file)
@@ -4,7 +4,7 @@ Versatile Express voltage regulators
 Requires node properties:
 - "compatible" value: "arm,vexpress-volt"
 - "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg
-  (see Documentation/devicetree/bindings/arm/vexpress-sysreg.txt
+  (see Documentation/devicetree/bindings/arm/vexpress-config.yaml
   for more details)
 
 Required regulator properties:
diff --git a/Documentation/devicetree/bindings/rtc/fsl,scu-rtc.yaml b/Documentation/devicetree/bindings/rtc/fsl,scu-rtc.yaml
new file mode 100644 (file)
index 0000000..8c102b7
--- /dev/null
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/fsl,scu-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - RTC bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+
+allOf:
+  - $ref: rtc.yaml#
+
+properties:
+  compatible:
+    const: fsl,imx8qxp-sc-rtc
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    rtc {
+        compatible = "fsl,imx8qxp-sc-rtc";
+    };
diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.txt
deleted file mode 100644 (file)
index 72ff033..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-BCM2835 PM (Power domains, watchdog)
-
-The PM block controls power domains and some reset lines, and includes
-a watchdog timer.  This binding supersedes the brcm,bcm2835-pm-wdt
-binding which covered some of PM's register range and functionality.
-
-Required properties:
-
-- compatible:          Should be "brcm,bcm2835-pm"
-- reg:                 Specifies base physical address and size of the two
-                         register ranges ("PM" and "ASYNC_BRIDGE" in that
-                         order)
-- clocks:              a) v3d: The V3D clock from CPRMAN
-                       b) peri_image: The PERI_IMAGE clock from CPRMAN
-                       c) h264: The H264 clock from CPRMAN
-                       d) isp: The ISP clock from CPRMAN
-- #reset-cells:        Should be 1.  This property follows the reset controller
-                         bindings[1].
-- #power-domain-cells: Should be 1.  This property follows the power domain
-                         bindings[2].
-
-Optional properties:
-
-- timeout-sec:         Contains the watchdog timeout in seconds
-- system-power-controller: Whether the watchdog is controlling the
-    system power.  This node follows the power controller bindings[3].
-
-[1] Documentation/devicetree/bindings/reset/reset.txt
-[2] Documentation/devicetree/bindings/power/power-domain.yaml
-[3] Documentation/devicetree/bindings/power/power-controller.txt
-
-Example:
-
-pm {
-       compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
-       #power-domain-cells = <1>;
-       #reset-cells = <1>;
-       reg = <0x7e100000 0x114>,
-             <0x7e00a000 0x24>;
-       clocks = <&clocks BCM2835_CLOCK_V3D>,
-                <&clocks BCM2835_CLOCK_PERI_IMAGE>,
-                <&clocks BCM2835_CLOCK_H264>,
-                <&clocks BCM2835_CLOCK_ISP>;
-       clock-names = "v3d", "peri_image", "h264", "isp";
-       system-power-controller;
-};
diff --git a/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml b/Documentation/devicetree/bindings/soc/bcm/brcm,bcm2835-pm.yaml
new file mode 100644 (file)
index 0000000..8947866
--- /dev/null
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/soc/bcm/brcm,bcm2835-pm.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: BCM2835 PM (Power domains, watchdog)
+
+description: |
+  The PM block controls power domains and some reset lines, and includes a
+  watchdog timer.
+
+maintainers:
+  - Nicolas Saenz Julienne <nsaenz@kernel.org>
+
+allOf:
+  - $ref: ../../watchdog/watchdog.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - brcm,bcm2835-pm
+          - brcm,bcm2711-pm
+      - const: brcm,bcm2835-pm-wdt
+
+  reg:
+    minItems: 2
+    maxItems: 3
+
+  reg-names:
+    minItems: 2
+    items:
+      - const: pm
+      - const: asb
+      - const: rpivid_asb
+
+  "#power-domain-cells":
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  clocks:
+    minItems: 4
+    maxItems: 4
+
+  clock-names:
+    items:
+      - const: v3d
+      - const: peri_image
+      - const: h264
+      - const: isp
+
+  system-power-controller:
+    type: boolean
+
+  timeout-sec: true
+
+required:
+  - compatible
+  - reg
+  - "#power-domain-cells"
+  - "#reset-cells"
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/bcm2835.h>
+
+    watchdog@7e100000 {
+        compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
+        #power-domain-cells = <1>;
+        #reset-cells = <1>;
+        reg = <0x7e100000 0x114>,
+              <0x7e00a000 0x24>;
+        reg-names = "pm", "asb";
+        clocks = <&clocks BCM2835_CLOCK_V3D>,
+               <&clocks BCM2835_CLOCK_PERI_IMAGE>,
+               <&clocks BCM2835_CLOCK_H264>,
+               <&clocks BCM2835_CLOCK_ISP>;
+        clock-names = "v3d", "peri_image", "h264", "isp";
+        system-power-controller;
+    };
index c30a643..13bb8df 100644 (file)
@@ -49,9 +49,6 @@ properties:
   reg:
     maxItems: 1
 
-  assigned-clock-parents: true
-  assigned-clocks: true
-
   '#clock-cells':
     const: 1
 
@@ -77,14 +74,20 @@ properties:
       Must be identical to the that of the parent interrupt controller.
     const: 3
 
+  reboot-mode:
+    $ref: /schemas/power/reset/syscon-reboot-mode.yaml
+    type: object
+    description:
+      Reboot mode to alter bootloader behavior for the next boot
+
   syscon-poweroff:
-    $ref: "../../power/reset/syscon-poweroff.yaml#"
+    $ref: /schemas/power/reset/syscon-poweroff.yaml#
     type: object
     description:
       Node for power off method
 
   syscon-reboot:
-    $ref: "../../power/reset/syscon-reboot.yaml#"
+    $ref: /schemas/power/reset/syscon-reboot.yaml#
     type: object
     description:
       Node for reboot method
index fde886a..60b4956 100644 (file)
@@ -22,8 +22,12 @@ properties:
     pattern: "^usi@[0-9a-f]+$"
 
   compatible:
-    enum:
-      - samsung,exynos850-usi   # for USIv2 (Exynos850, ExynosAutoV9)
+    oneOf:
+      - items:
+          - const: samsung,exynosautov9-usi
+          - const: samsung,exynos850-usi
+      - enum:
+          - samsung,exynos850-usi
 
   reg: true
 
index ece261b..7326c0a 100644 (file)
@@ -47,6 +47,5 @@ examples:
         clocks = <&clkcfg CLK_SPI0>;
         interrupt-parent = <&plic>;
         interrupts = <54>;
-        spi-max-frequency = <25000000>;
     };
 ...
index e2c7b93..78ceb9d 100644 (file)
@@ -110,7 +110,6 @@ examples:
         pinctrl-names = "default";
         pinctrl-0 = <&qup_spi1_default>;
         interrupts = <GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>;
-        spi-max-frequency = <50000000>;
         #address-cells = <1>;
         #size-cells = <0>;
     };
diff --git a/Documentation/devicetree/bindings/thermal/fsl,scu-thermal.yaml b/Documentation/devicetree/bindings/thermal/fsl,scu-thermal.yaml
new file mode 100644 (file)
index 0000000..f9e4b3c
--- /dev/null
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/fsl,scu-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - Thermal bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+
+allOf:
+  - $ref: thermal-sensor.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8qxp-sc-thermal
+      - const: fsl,imx-sc-thermal
+
+  '#thermal-sensor-cells':
+    const: 1
+
+required:
+  - compatible
+  - '#thermal-sensor-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    thermal-sensor {
+        compatible = "fsl,imx8qxp-sc-thermal", "fsl,imx-sc-thermal";
+        #thermal-sensor-cells = <1>;
+    };
diff --git a/Documentation/devicetree/bindings/timer/nvidia,tegra186-timer.yaml b/Documentation/devicetree/bindings/timer/nvidia,tegra186-timer.yaml
new file mode 100644 (file)
index 0000000..db8b559
--- /dev/null
@@ -0,0 +1,109 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/timer/nvidia,tegra186-timer.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: NVIDIA Tegra186 timer
+
+maintainers:
+  - Thierry Reding <treding@nvidia.com>
+
+description: >
+  The Tegra timer provides 29-bit timer counters and a 32-bit timestamp
+  counter. Each NV timer selects its timing reference signal from the 1 MHz
+  reference generated by USEC, TSC or either clk_m or OSC. Each TMR can be
+  programmed to generate one-shot, periodic, or watchdog interrupts.
+
+
+properties:
+  compatible:
+    oneOf:
+      - const: nvidia,tegra186-timer
+        description: >
+          The Tegra186 timer provides ten 29-bit timer counters.
+      - const: nvidia,tegra234-timer
+        description: >
+          The Tegra234 timer provides sixteen 29-bit timer counters.
+
+  reg:
+    maxItems: 1
+
+  interrupts: true
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra186-timer
+    then:
+      properties:
+        interrupts:
+          maxItems: 10
+          description: >
+            One per each timer channels 0 through 9.
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nvidia,tegra234-timer
+    then:
+      properties:
+        interrupts:
+          maxItems: 16
+          description: >
+            One per each timer channels 0 through 15.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    timer@3010000 {
+        compatible = "nvidia,tegra186-timer";
+        reg = <0x03010000 0x000e0000>;
+        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>;
+    };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    timer@2080000 {
+        compatible = "nvidia,tegra234-timer";
+        reg = <0x02080000 0x00121000>;
+        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>;
+    };
index 933fa35..e5dbf41 100644 (file)
@@ -20,6 +20,7 @@ properties:
       - items:
           - enum:
               - allwinner,sun8i-a83t-musb
+              - allwinner,sun20i-d1-musb
               - allwinner,sun50i-h6-musb
           - const: allwinner,sun8i-a33-musb
       - items:
index f512f02..12183ef 100644 (file)
@@ -87,6 +87,9 @@ Required properties:
               "atmel,at91sam9g45-udc"
               "atmel,sama5d3-udc"
               "microchip,sam9x60-udc"
+              "microchip,lan9662-udc"
+              For "microchip,lan9662-udc" the fallback "atmel,sama5d3-udc"
+              is required.
  - reg: Address and length of the register set for the device
  - interrupts: Should contain usba interrupt
  - clocks: Should reference the peripheral and host clocks
index bf73de0..4aa3684 100644 (file)
@@ -13,7 +13,7 @@ Required properties:
  - resets      : list of phandle and reset specifier pairs. There should be two entries, one
                  for the powerdown and softreset lines of the usb3 IP
  - reset-names : list of reset signal names. Names should be "powerdown" and "softreset"
-See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/st,stih407-powerdown.yaml
 See: Documentation/devicetree/bindings/reset/reset.txt
 
  - #address-cells, #size-cells : should be '1' if the device has sub-nodes
index 065c91d..d6f2bde 100644 (file)
@@ -17,7 +17,7 @@ See: Documentation/devicetree/bindings/clock/clock-bindings.txt
  - resets              : phandle + reset specifier pairs to the powerdown and softreset lines
                          of the USB IP
  - reset-names         : should be "power" and "softreset"
-See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/st,stih407-powerdown.yaml
 See: Documentation/devicetree/bindings/reset/reset.txt
 
 Example:
index 0b4524b..25a6c14 100644 (file)
@@ -38,6 +38,7 @@ properties:
               - allwinner,sun8i-h3-ehci
               - allwinner,sun8i-r40-ehci
               - allwinner,sun9i-a80-ehci
+              - allwinner,sun20i-d1-ehci
               - aspeed,ast2400-ehci
               - aspeed,ast2500-ehci
               - aspeed,ast2600-ehci
@@ -136,7 +137,8 @@ properties:
       Phandle of a companion.
 
   phys:
-    maxItems: 1
+    minItems: 1
+    maxItems: 3
 
   phy-names:
     const: usb
index e2ac846..180361b 100644 (file)
@@ -28,6 +28,7 @@ properties:
               - allwinner,sun8i-h3-ohci
               - allwinner,sun8i-r40-ohci
               - allwinner,sun9i-a80-ohci
+              - allwinner,sun20i-d1-ohci
               - brcm,bcm3384-ohci
               - brcm,bcm63268-ohci
               - brcm,bcm6328-ohci
@@ -103,7 +104,8 @@ properties:
       Overrides the detected port count
 
   phys:
-    maxItems: 1
+    minItems: 1
+    maxItems: 3
 
   phy-names:
     const: usb
index 44c998c..1c73557 100644 (file)
@@ -15,7 +15,7 @@ See: Documentation/devicetree/bindings/clock/clock-bindings.txt
 
  - resets              : phandle to the powerdown and reset controller for the USB IP
  - reset-names         : should be "power" and "softreset".
-See: Documentation/devicetree/bindings/reset/st,sti-powerdown.txt
+See: Documentation/devicetree/bindings/reset/st,stih407-powerdown.yaml
 See: Documentation/devicetree/bindings/reset/reset.txt
 
 Example:
index e336fe2..749e196 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: Qualcomm SuperSpeed DWC3 USB SoC controller
 
 maintainers:
-  - Manu Gautam <mgautam@codeaurora.org>
+  - Wesley Cheng <quic_wcheng@quicinc.com>
 
 properties:
   compatible:
index 6bb20b4..f0db732 100644 (file)
@@ -143,6 +143,9 @@ patternProperties:
     description: ASPEED Technology Inc.
   "^asus,.*":
     description: AsusTek Computer Inc.
+  "^atheros,.*":
+    description: Qualcomm Atheros, Inc. (deprecated, use qca)
+    deprecated: true
   "^atlas,.*":
     description: Atlas Scientific LLC
   "^atmel,.*":
@@ -507,6 +510,8 @@ patternProperties:
     description: Haoyu Microelectronic Co. Ltd.
   "^hardkernel,.*":
     description: Hardkernel Co., Ltd
+  "^hechuang,.*":
+    description: Shenzhen Hechuang Intelligent Co.
   "^hideep,.*":
     description: HiDeep Inc.
   "^himax,.*":
index cbcf19f..ed6c1ca 100644 (file)
@@ -64,7 +64,6 @@ if:
 then:
   properties:
     clocks:
-      minItems: 2
       items:
         - description: High-frequency oscillator input, divided internally
         - description: Low-frequency oscillator input
diff --git a/Documentation/devicetree/bindings/watchdog/fsl,scu-wdt.yaml b/Documentation/devicetree/bindings/watchdog/fsl,scu-wdt.yaml
new file mode 100644 (file)
index 0000000..f84c45d
--- /dev/null
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/fsl,scu-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: i.MX SCU Client Device Node - Watchdog bindings based on SCU Message Protocol
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+description: i.MX SCU Client Device Node
+  Client nodes are maintained as children of the relevant IMX-SCU device node.
+
+allOf:
+  - $ref: watchdog.yaml#
+
+properties:
+  compatible:
+    items:
+      - const: fsl,imx8qxp-sc-wdt
+      - const: fsl,imx-sc-wdt
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    watchdog {
+        compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
+        timeout-sec = <60>;
+    };
index 4e3adf3..b33aa04 100644 (file)
@@ -6,7 +6,7 @@ This document explains how GPIOs can be assigned to given devices and functions.
 
 Note that it only applies to the new descriptor-based interface. For a
 description of the deprecated integer-based GPIO interface please refer to
-gpio-legacy.txt (actually, there is no real mapping possible with the old
+legacy.rst (actually, there is no real mapping possible with the old
 interface; you just fetch an integer from somewhere and request the
 corresponding GPIO).
 
index 47869ca..72bcf5f 100644 (file)
@@ -4,7 +4,7 @@ GPIO Descriptor Consumer Interface
 
 This document describes the consumer interface of the GPIO framework. Note that
 it describes the new descriptor-based interface. For a description of the
-deprecated integer-based GPIO interface please refer to gpio-legacy.txt.
+deprecated integer-based GPIO interface please refer to legacy.rst.
 
 
 Guidelines for GPIOs consumers
@@ -78,7 +78,7 @@ whether the line is configured active high or active low (see
 
 The two last flags are used for use cases where open drain is mandatory, such
 as I2C: if the line is not already configured as open drain in the mappings
-(see board.txt), then open drain will be enforced anyway and a warning will be
+(see board.rst), then open drain will be enforced anyway and a warning will be
 printed that the board configuration needs to be updated to match the use case.
 
 Both functions return either a valid GPIO descriptor, or an error code checkable
@@ -270,7 +270,7 @@ driven.
 The same is applicable for open drain or open source output lines: those do not
 actively drive their output high (open drain) or low (open source), they just
 switch their output to a high impedance value. The consumer should not need to
-care. (For details read about open drain in driver.txt.)
+care. (For details read about open drain in driver.rst.)
 
 With this, all the gpiod_set_(array)_value_xxx() functions interpret the
 parameter "value" as "asserted" ("1") or "de-asserted" ("0"). The physical line
index 2e924fb..c9c1924 100644 (file)
@@ -14,12 +14,12 @@ Due to the history of GPIO interfaces in the kernel, there are two different
 ways to obtain and use GPIOs:
 
   - The descriptor-based interface is the preferred way to manipulate GPIOs,
-    and is described by all the files in this directory excepted gpio-legacy.txt.
+    and is described by all the files in this directory excepted legacy.rst.
   - The legacy integer-based interface which is considered deprecated (but still
-    usable for compatibility reasons) is documented in gpio-legacy.txt.
+    usable for compatibility reasons) is documented in legacy.rst.
 
 The remainder of this document applies to the new descriptor-based interface.
-gpio-legacy.txt contains the same information applied to the legacy
+legacy.rst contains the same information applied to the legacy
 integer-based interface.
 
 
diff --git a/Documentation/driver-api/hte/hte.rst b/Documentation/driver-api/hte/hte.rst
new file mode 100644 (file)
index 0000000..153f323
--- /dev/null
@@ -0,0 +1,79 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+============================================
+The Linux Hardware Timestamping Engine (HTE)
+============================================
+
+:Author: Dipen Patel
+
+Introduction
+------------
+
+Certain devices have built in hardware timestamping engines which can
+monitor sets of system signals, lines, buses etc... in realtime for state
+change; upon detecting the change they can automatically store the timestamp at
+the moment of occurrence. Such functionality may help achieve better accuracy
+in obtaining timestamps than using software counterparts i.e. ktime and
+friends.
+
+This document describes the API that can be used by hardware timestamping
+engine provider and consumer drivers that want to use the hardware timestamping
+engine (HTE) framework. Both consumers and providers must include
+``#include <linux/hte.h>``.
+
+The HTE framework APIs for the providers
+----------------------------------------
+
+.. kernel-doc:: drivers/hte/hte.c
+   :functions: devm_hte_register_chip hte_push_ts_ns
+
+The HTE framework APIs for the consumers
+----------------------------------------
+
+.. kernel-doc:: drivers/hte/hte.c
+   :functions: hte_init_line_attr hte_ts_get hte_ts_put devm_hte_request_ts_ns hte_request_ts_ns hte_enable_ts hte_disable_ts of_hte_req_count hte_get_clk_src_info
+
+The HTE framework public structures
+-----------------------------------
+.. kernel-doc:: include/linux/hte.h
+
+More on the HTE timestamp data
+------------------------------
+The ``struct hte_ts_data`` is used to pass timestamp details between the
+consumers and the providers. It expresses timestamp data in nanoseconds in
+u64. An example of the typical timestamp data life cycle, for the GPIO line is
+as follows::
+
+ - Monitors GPIO line change.
+ - Detects the state change on GPIO line.
+ - Converts timestamps in nanoseconds.
+ - Stores GPIO raw level in raw_level variable if the provider has that
+ hardware capability.
+ - Pushes this hte_ts_data object to HTE subsystem.
+ - HTE subsystem increments seq counter and invokes consumer provided callback.
+ Based on callback return value, the HTE core invokes secondary callback in
+ the thread context.
+
+HTE subsystem debugfs attributes
+--------------------------------
+HTE subsystem creates debugfs attributes at ``/sys/kernel/debug/hte/``.
+It also creates line/signal-related debugfs attributes at
+``/sys/kernel/debug/hte/<provider>/<label or line id>/``. Note that these
+attributes are read-only.
+
+`ts_requested`
+               The total number of entities requested from the given provider,
+               where entity is specified by the provider and could represent
+               lines, GPIO, chip signals, buses etc...
+                The attribute will be available at
+               ``/sys/kernel/debug/hte/<provider>/``.
+
+`total_ts`
+               The total number of entities supported by the provider.
+                The attribute will be available at
+               ``/sys/kernel/debug/hte/<provider>/``.
+
+`dropped_timestamps`
+               The dropped timestamps for a given line.
+                The attribute will be available at
+               ``/sys/kernel/debug/hte/<provider>/<label or line id>/``.
diff --git a/Documentation/driver-api/hte/index.rst b/Documentation/driver-api/hte/index.rst
new file mode 100644 (file)
index 0000000..9f43301
--- /dev/null
@@ -0,0 +1,22 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+============================================
+The Linux Hardware Timestamping Engine (HTE)
+============================================
+
+The HTE Subsystem
+=================
+
+.. toctree::
+   :maxdepth: 1
+
+   hte
+
+HTE Tegra Provider
+==================
+
+.. toctree::
+   :maxdepth: 1
+
+   tegra194-hte
+
diff --git a/Documentation/driver-api/hte/tegra194-hte.rst b/Documentation/driver-api/hte/tegra194-hte.rst
new file mode 100644 (file)
index 0000000..41983e0
--- /dev/null
@@ -0,0 +1,49 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+HTE Kernel provider driver
+==========================
+
+Description
+-----------
+The Nvidia tegra194 HTE provider driver implements two GTE
+(Generic Timestamping Engine) instances: 1) GPIO GTE and 2) LIC
+(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the
+timestamp from the system counter TSC which has 31.25MHz clock rate, and the
+driver converts clock tick rate to nanoseconds before storing it as timestamp
+value.
+
+GPIO GTE
+--------
+
+This GTE instance timestamps GPIO in real time. For that to happen GPIO
+needs to be configured as input. The always on (AON) GPIO controller instance
+supports timestamping GPIOs in real time and it has 39 GPIO lines. The GPIO GTE
+and AON GPIO controller are tightly coupled as it requires very specific bits
+to be set in GPIO config register before GPIO GTE can be used, for that GPIOLIB
+adds two optional APIs as below. The GPIO GTE code supports both kernel
+and userspace consumers. The kernel space consumers can directly talk to HTE
+subsystem while userspace consumers timestamp requests go through GPIOLIB CDEV
+framework to HTE subsystem.
+
+.. kernel-doc:: drivers/gpio/gpiolib.c
+   :functions: gpiod_enable_hw_timestamp_ns gpiod_disable_hw_timestamp_ns
+
+For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag must be
+specified during IOCTL calls. Refer to ``tools/gpio/gpio-event-mon.c``, which
+returns the timestamp in nanoseconds.
+
+LIC (Legacy Interrupt Controller) IRQ GTE
+-----------------------------------------
+
+This GTE instance timestamps LIC IRQ lines in real time. There are 352 IRQ
+lines which this instance can add timestamps to in real time. The hte
+devicetree binding described at ``Documentation/devicetree/bindings/hte/``
+provides an example of how a consumer can request an IRQ line. Since it is a
+one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ
+number that they are interested in. There is no userspace consumer support for
+this GTE instance in the HTE framework.
+
+The provider source code of both IRQ and GPIO GTE instances is located at
+``drivers/hte/hte-tegra194.c``. The test driver
+``drivers/hte/hte-tegra194-test.c`` demonstrates HTE API usage for both IRQ
+and GPIO GTE.
index d76a60d..a6d525c 100644 (file)
@@ -108,6 +108,7 @@ available subsections can be seen below.
    xilinx/index
    xillybus
    zorro
+   hte/index
 
 .. only::  subproject and html
 
index 10482de..a053667 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index bcefb5a..c0bb9c9 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index d80d994..c9bfff2 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: |  ok  |
     |        ia64: |  ok  |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 53eab15..35e2a44 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 9492645..9b3e2ce 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index b4274b8..9c7ffec 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: |  ok  |
     |        ia64: |  ok  |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index c15bb4b..2fd5fb6 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index 4c31fc9..c45711e 100644 (file)
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
     |       nios2: | TODO |
     |    openrisc: | TODO |
-    |      parisc: | TODO |
+    |      parisc: |  ok  |
     |     powerpc: |  ok  |
     |       riscv: |  ok  |
     |        s390: |  ok  |
index d7a5ac4..502c1d4 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: |  ok  |
     |        mips: |  ok  |
@@ -24,7 +25,7 @@
     |        s390: |  ok  |
     |          sh: |  ok  |
     |       sparc: | TODO |
-    |          um: | TODO |
+    |          um: |  ok  |
     |         x86: |  ok  |
     |      xtensa: | TODO |
     -----------------------
index 136e14c..afb90be 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 5b3f3d8..04120d2 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: |  ok  |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: |  ok  |
     |        mips: |  ok  |
index 7a2eab4..e487c35 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: |  ok  |
     |        mips: |  ok  |
index db02ab1..b3697f4 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index ec186e7..452385a 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: |  ok  |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 4b7865e..daecf04 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: |  ok  |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 5d9befa..adb1bd0 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index d97fd38..ddcd716 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index d30e347..2512120 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 9ae1fa2..f2fcff8 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index 9e09988..95e485c 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: |  ok  |
     |        mips: |  ok  |
index 5c4ec31..8b1a8d9 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index 65007c1..ab69e8f 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: |  ok  |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: |  ok  |
     |        mips: |  ok  |
index 2005667..0bfb72a 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
@@ -20,7 +21,7 @@
     |    openrisc: |  ok  |
     |      parisc: | TODO |
     |     powerpc: |  ok  |
-    |       riscv: | TODO |
+    |       riscv: |  ok  |
     |        s390: | TODO |
     |          sh: | TODO |
     |       sparc: |  ok  |
index 707514f..d2f2201 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 9f31ce9..0d0647b 100644 (file)
@@ -7,12 +7,13 @@
     |         arch |status|
     -----------------------
     |       alpha: | TODO |
-    |         arc: | TODO |
+    |         arc: |  ok  |
     |         arm: |  ok  |
     |       arm64: |  ok  |
     |        csky: |  ok  |
     |     hexagon: |  ok  |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index f148c43..13c297b 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 32c88b6..931687e 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index d82a1f0..336d728 100644 (file)
@@ -36,6 +36,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index 2687564..76d0121 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ..  |
     |     hexagon: |  ..  |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: |  ..  |
     |  microblaze: |  ..  |
     |        mips: | TODO |
index 1b41091..a86b8b1 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 2732725..364169f 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index b9a4bda..6ea2747 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: |  ok  |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: |  ok  |
     |        mips: |  ok  |
index 4aa51c9..c9e0a16 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 0306ece..fd17d8d 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: |  ..  |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 5d64e40..1a859ac 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ok  |
     |     hexagon: | TODO |
     |        ia64: |  ok  |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 92c9db2..b122995 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 7424fea..02f325f 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: |  ok  |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index 6098506..9bfff97 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: |  ..  |
     |     hexagon: |  ..  |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: |  ..  |
     |  microblaze: |  ..  |
     |        mips: |  ok  |
index f2dcbec..039e4e9 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: |  ..  |
     |  microblaze: |  ..  |
     |        mips: | TODO |
index 680090d..13b4940 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: | TODO |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: | TODO |
index 205a90e..b01bf7b 100644 (file)
@@ -13,6 +13,7 @@
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
index 9f16d6e..fc3687b 100644 (file)
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
+    |       loong: |  ok  |
     |        m68k: | TODO |
     |  microblaze: | TODO |
     |        mips: |  ok  |
     |       nios2: | TODO |
     |    openrisc: | TODO |
-    |      parisc: | TODO |
+    |      parisc: |  ok  |
     |     powerpc: |  ok  |
     |       riscv: |  ok  |
     |        s390: |  ok  |
index d0904f6..992eddb 100644 (file)
@@ -19,13 +19,23 @@ The main Btrfs features include:
     * Subvolumes (separate internal filesystem roots)
     * Object level mirroring and striping
     * Checksums on data and metadata (multiple algorithms available)
-    * Compression
+    * Compression (multiple algorithms available)
+    * Reflink, deduplication
+    * Scrub (on-line checksum verification)
+    * Hierarchical quota groups (subvolume and snapshot support)
     * Integrated multiple device support, with several raid algorithms
     * Offline filesystem check
-    * Efficient incremental backup and FS mirroring
+    * Efficient incremental backup and FS mirroring (send/receive)
+    * Trim/discard
     * Online filesystem defragmentation
+    * Swapfile support
+    * Zoned mode
+    * Read/write metadata verification
+    * Online resize (shrink, grow)
 
-For more information please refer to the wiki
+For more information please refer to the documentation site or wiki
+
+  https://btrfs.readthedocs.io
 
   https://btrfs.wiki.kernel.org
 
index 871d2da..8781469 100644 (file)
@@ -13,8 +13,8 @@ disappeared as of Linux 3.0.
 
 There are two places where extended attributes can be found. The first
 place is between the end of each inode entry and the beginning of the
-next inode entry. For example, if inode.i\_extra\_isize = 28 and
-sb.inode\_size = 256, then there are 256 - (128 + 28) = 100 bytes
+next inode entry. For example, if inode.i_extra_isize = 28 and
+sb.inode_size = 256, then there are 256 - (128 + 28) = 100 bytes
 available for in-inode extended attribute storage. The second place
 where extended attributes can be found is in the block pointed to by
 ``inode.i_file_acl``. As of Linux 3.11, it is not possible for this
@@ -38,8 +38,8 @@ Extended attributes, when stored after the inode, have a header
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - h\_magic
+     - __le32
+     - h_magic
      - Magic number for identification, 0xEA020000. This value is set by the
        Linux driver, though e2fsprogs doesn't seem to check it(?)
 
@@ -55,28 +55,28 @@ The beginning of an extended attribute block is in
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - h\_magic
+     - __le32
+     - h_magic
      - Magic number for identification, 0xEA020000.
    * - 0x4
-     - \_\_le32
-     - h\_refcount
+     - __le32
+     - h_refcount
      - Reference count.
    * - 0x8
-     - \_\_le32
-     - h\_blocks
+     - __le32
+     - h_blocks
      - Number of disk blocks used.
    * - 0xC
-     - \_\_le32
-     - h\_hash
+     - __le32
+     - h_hash
      - Hash value of all attributes.
    * - 0x10
-     - \_\_le32
-     - h\_checksum
+     - __le32
+     - h_checksum
      - Checksum of the extended attribute block.
    * - 0x14
-     - \_\_u32
-     - h\_reserved[3]
+     - __u32
+     - h_reserved[3]
      - Zero.
 
 The checksum is calculated against the FS UUID, the 64-bit block number
@@ -100,46 +100,46 @@ Attributes stored inside an inode do not need be stored in sorted order.
      - Name
      - Description
    * - 0x0
-     - \_\_u8
-     - e\_name\_len
+     - __u8
+     - e_name_len
      - Length of name.
    * - 0x1
-     - \_\_u8
-     - e\_name\_index
+     - __u8
+     - e_name_index
      - Attribute name index. There is a discussion of this below.
    * - 0x2
-     - \_\_le16
-     - e\_value\_offs
+     - __le16
+     - e_value_offs
      - Location of this attribute's value on the disk block where it is stored.
        Multiple attributes can share the same value. For an inode attribute
        this value is relative to the start of the first entry; for a block this
        value is relative to the start of the block (i.e. the header).
    * - 0x4
-     - \_\_le32
-     - e\_value\_inum
+     - __le32
+     - e_value_inum
      - The inode where the value is stored. Zero indicates the value is in the
        same block as this entry. This field is only used if the
-       INCOMPAT\_EA\_INODE feature is enabled.
+       INCOMPAT_EA_INODE feature is enabled.
    * - 0x8
-     - \_\_le32
-     - e\_value\_size
+     - __le32
+     - e_value_size
      - Length of attribute value.
    * - 0xC
-     - \_\_le32
-     - e\_hash
+     - __le32
+     - e_hash
      - Hash value of attribute name and attribute value. The kernel doesn't
        update the hash for in-inode attributes, so for that case this value
        must be zero, because e2fsck validates any non-zero hash regardless of
        where the xattr lives.
    * - 0x10
      - char
-     - e\_name[e\_name\_len]
+     - e_name[e_name_len]
      - Attribute name. Does not include trailing NULL.
 
 Attribute values can follow the end of the entry table. There appears to
 be a requirement that they be aligned to 4-byte boundaries. The values
 are stored starting at the end of the block and grow towards the
-xattr\_header/xattr\_entry table. When the two collide, the overflow is
+xattr_header/xattr_entry table. When the two collide, the overflow is
 put into a separate disk block. If the disk block fills up, the
 filesystem returns -ENOSPC.
 
@@ -167,15 +167,15 @@ the key name. Here is a map of name index values to key prefixes:
    * - 1
      - “user.”
    * - 2
-     - “system.posix\_acl\_access”
+     - “system.posix_acl_access”
    * - 3
-     - “system.posix\_acl\_default”
+     - “system.posix_acl_default”
    * - 4
      - “trusted.”
    * - 6
      - “security.”
    * - 7
-     - “system.” (inline\_data only?)
+     - “system.” (inline_data only?)
    * - 8
      - “system.richacl” (SuSE kernels only?)
 
index 72075aa..976a180 100644 (file)
@@ -23,7 +23,7 @@ means that a block group addresses 32 gigabytes instead of 128 megabytes,
 also shrinking the amount of file system overhead for metadata.
 
 The administrator can set a block cluster size at mkfs time (which is
-stored in the s\_log\_cluster\_size field in the superblock); from then
+stored in the s_log_cluster_size field in the superblock); from then
 on, the block bitmaps track clusters, not individual blocks. This means
 that block groups can be several gigabytes in size (instead of just
 128MiB); however, the minimum allocation unit becomes a cluster, not a
index c7546db..91c45d8 100644 (file)
@@ -9,15 +9,15 @@ group.
 The inode bitmap records which entries in the inode table are in use.
 
 As with most bitmaps, one bit represents the usage status of one data
-block or inode table entry. This implies a block group size of 8 \*
-number\_of\_bytes\_in\_a\_logical\_block.
+block or inode table entry. This implies a block group size of 8 *
+number_of_bytes_in_a_logical_block.
 
 NOTE: If ``BLOCK_UNINIT`` is set for a given block group, various parts
 of the kernel and e2fsprogs code pretends that the block bitmap contains
 zeros (i.e. all blocks in the group are free). However, it is not
 necessarily the case that no blocks are in use -- if ``meta_bg`` is set,
 the bitmaps and group descriptor live inside the group. Unfortunately,
-ext2fs\_test\_block\_bitmap2() will return '0' for those locations,
+ext2fs_test_block_bitmap2() will return '0' for those locations,
 which produces confusing debugfs output.
 
 Inode Table
index d5d652a..46d78f8 100644 (file)
@@ -56,39 +56,39 @@ established that the super block and the group descriptor table, if
 present, will be at the beginning of the block group. The bitmaps and
 the inode table can be anywhere, and it is quite possible for the
 bitmaps to come after the inode table, or for both to be in different
-groups (flex\_bg). Leftover space is used for file data blocks, indirect
+groups (flex_bg). Leftover space is used for file data blocks, indirect
 block maps, extent tree blocks, and extended attributes.
 
 Flexible Block Groups
 ---------------------
 
 Starting in ext4, there is a new feature called flexible block groups
-(flex\_bg). In a flex\_bg, several block groups are tied together as one
+(flex_bg). In a flex_bg, several block groups are tied together as one
 logical block group; the bitmap spaces and the inode table space in the
-first block group of the flex\_bg are expanded to include the bitmaps
-and inode tables of all other block groups in the flex\_bg. For example,
-if the flex\_bg size is 4, then group 0 will contain (in order) the
+first block group of the flex_bg are expanded to include the bitmaps
+and inode tables of all other block groups in the flex_bg. For example,
+if the flex_bg size is 4, then group 0 will contain (in order) the
 superblock, group descriptors, data block bitmaps for groups 0-3, inode
 bitmaps for groups 0-3, inode tables for groups 0-3, and the remaining
 space in group 0 is for file data. The effect of this is to group the
 block group metadata close together for faster loading, and to enable
 large files to be continuous on disk. Backup copies of the superblock
 and group descriptors are always at the beginning of block groups, even
-if flex\_bg is enabled. The number of block groups that make up a
-flex\_bg is given by 2 ^ ``sb.s_log_groups_per_flex``.
+if flex_bg is enabled. The number of block groups that make up a
+flex_bg is given by 2 ^ ``sb.s_log_groups_per_flex``.
 
 Meta Block Groups
 -----------------
 
-Without the option META\_BG, for safety concerns, all block group
+Without the option META_BG, for safety concerns, all block group
 descriptors copies are kept in the first block group. Given the default
 128MiB(2^27 bytes) block group size and 64-byte group descriptors, ext4
 can have at most 2^27/64 = 2^21 block groups. This limits the entire
 filesystem size to 2^21 * 2^27 = 2^48bytes or 256TiB.
 
 The solution to this problem is to use the metablock group feature
-(META\_BG), which is already in ext3 for all 2.6 releases. With the
-META\_BG feature, ext4 filesystems are partitioned into many metablock
+(META_BG), which is already in ext3 for all 2.6 releases. With the
+META_BG feature, ext4 filesystems are partitioned into many metablock
 groups. Each metablock group is a cluster of block groups whose group
 descriptor structures can be stored in a single disk block. For ext4
 filesystems with 4 KB block size, a single metablock group partition
@@ -110,7 +110,7 @@ bytes, a meta-block group contains 32 block groups for filesystems with
 a 1KB block size, and 128 block groups for filesystems with a 4KB
 blocksize. Filesystems can either be created using this new block group
 descriptor layout, or existing filesystems can be resized on-line, and
-the field s\_first\_meta\_bg in the superblock will indicate the first
+the field s_first_meta_bg in the superblock will indicate the first
 block group using this new layout.
 
 Please see an important note about ``BLOCK_UNINIT`` in the section about
@@ -121,15 +121,15 @@ Lazy Block Group Initialization
 
 A new feature for ext4 are three block group descriptor flags that
 enable mkfs to skip initializing other parts of the block group
-metadata. Specifically, the INODE\_UNINIT and BLOCK\_UNINIT flags mean
+metadata. Specifically, the INODE_UNINIT and BLOCK_UNINIT flags mean
 that the inode and block bitmaps for that group can be calculated and
 therefore the on-disk bitmap blocks are not initialized. This is
 generally the case for an empty block group or a block group containing
-only fixed-location block group metadata. The INODE\_ZEROED flag means
+only fixed-location block group metadata. The INODE_ZEROED flag means
 that the inode table has been initialized; mkfs will unset this flag and
 rely on the kernel to initialize the inode tables in the background.
 
 By not writing zeroes to the bitmaps and inode table, mkfs time is
-reduced considerably. Note the feature flag is RO\_COMPAT\_GDT\_CSUM,
-but the dumpe2fs output prints this as “uninit\_bg”. They are the same
+reduced considerably. Note the feature flag is RO_COMPAT_GDT_CSUM,
+but the dumpe2fs output prints this as “uninit_bg”. They are the same
 thing.
index 30e2575..2bd9904 100644 (file)
@@ -1,7 +1,7 @@
 .. SPDX-License-Identifier: GPL-2.0
 
 +---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-| i.i\_block Offset   | Where It Points                                                                                                                                                                                                              |
+| i.i_block Offset   | Where It Points                                                                                                                                                                                                              |
 +=====================+==============================================================================================================================================================================================================================+
 | 0 to 11             | Direct map to file blocks 0 to 11.                                                                                                                                                                                           |
 +---------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
index 5519e25..e232749 100644 (file)
@@ -4,7 +4,7 @@ Checksums
 ---------
 
 Starting in early 2012, metadata checksums were added to all major ext4
-and jbd2 data structures. The associated feature flag is metadata\_csum.
+and jbd2 data structures. The associated feature flag is metadata_csum.
 The desired checksum algorithm is indicated in the superblock, though as
 of October 2012 the only supported algorithm is crc32c. Some data
 structures did not have space to fit a full 32-bit checksum, so only the
@@ -20,7 +20,7 @@ encounters directory blocks that lack sufficient empty space to add a
 checksum, it will request that you run ``e2fsck -D`` to have the
 directories rebuilt with checksums. This has the added benefit of
 removing slack space from the directory files and rebalancing the htree
-indexes. If you \_ignore\_ this step, your directories will not be
+indexes. If you _ignore_ this step, your directories will not be
 protected by a checksum!
 
 The following table describes the data elements that go into each type
@@ -35,39 +35,39 @@ of checksum. The checksum function is whatever the superblock describes
      - Length
      - Ingredients
    * - Superblock
-     - \_\_le32
+     - __le32
      - The entire superblock up to the checksum field. The UUID lives inside
        the superblock.
    * - MMP
-     - \_\_le32
+     - __le32
      - UUID + the entire MMP block up to the checksum field.
    * - Extended Attributes
-     - \_\_le32
+     - __le32
      - UUID + the entire extended attribute block. The checksum field is set to
        zero.
    * - Directory Entries
-     - \_\_le32
+     - __le32
      - UUID + inode number + inode generation + the directory block up to the
        fake entry enclosing the checksum field.
    * - HTREE Nodes
-     - \_\_le32
+     - __le32
      - UUID + inode number + inode generation + all valid extents + HTREE tail.
        The checksum field is set to zero.
    * - Extents
-     - \_\_le32
+     - __le32
      - UUID + inode number + inode generation + the entire extent block up to
        the checksum field.
    * - Bitmaps
-     - \_\_le32 or \_\_le16
+     - __le32 or __le16
      - UUID + the entire bitmap. Checksums are stored in the group descriptor,
        and truncated if the group descriptor size is 32 bytes (i.e. ^64bit)
    * - Inodes
-     - \_\_le32
+     - __le32
      - UUID + inode number + inode generation + the entire inode. The checksum
        field is set to zero. Each inode has its own checksum.
    * - Group Descriptors
-     - \_\_le16
-     - If metadata\_csum, then UUID + group number + the entire descriptor;
-       else if gdt\_csum, then crc16(UUID + group number + the entire
+     - __le16
+     - If metadata_csum, then UUID + group number + the entire descriptor;
+       else if gdt_csum, then crc16(UUID + group number + the entire
        descriptor). In all cases, only the lower 16 bits are stored.
 
index 55f618b..6eece8e 100644 (file)
@@ -42,24 +42,24 @@ is at most 263 bytes long, though on disk you'll need to reference
      - Name
      - Description
    * - 0x0
-     - \_\_le32
+     - __le32
      - inode
      - Number of the inode that this directory entry points to.
    * - 0x4
-     - \_\_le16
-     - rec\_len
+     - __le16
+     - rec_len
      - Length of this directory entry. Must be a multiple of 4.
    * - 0x6
-     - \_\_le16
-     - name\_len
+     - __le16
+     - name_len
      - Length of the file name.
    * - 0x8
      - char
-     - name[EXT4\_NAME\_LEN]
+     - name[EXT4_NAME_LEN]
      - File name.
 
 Since file names cannot be longer than 255 bytes, the new directory
-entry format shortens the name\_len field and uses the space for a file
+entry format shortens the name_len field and uses the space for a file
 type flag, probably to avoid having to load every inode during directory
 tree traversal. This format is ``ext4_dir_entry_2``, which is at most
 263 bytes long, though on disk you'll need to reference
@@ -74,24 +74,24 @@ tree traversal. This format is ``ext4_dir_entry_2``, which is at most
      - Name
      - Description
    * - 0x0
-     - \_\_le32
+     - __le32
      - inode
      - Number of the inode that this directory entry points to.
    * - 0x4
-     - \_\_le16
-     - rec\_len
+     - __le16
+     - rec_len
      - Length of this directory entry.
    * - 0x6
-     - \_\_u8
-     - name\_len
+     - __u8
+     - name_len
      - Length of the file name.
    * - 0x7
-     - \_\_u8
-     - file\_type
+     - __u8
+     - file_type
      - File type code, see ftype_ table below.
    * - 0x8
      - char
-     - name[EXT4\_NAME\_LEN]
+     - name[EXT4_NAME_LEN]
      - File name.
 
 .. _ftype:
@@ -137,19 +137,19 @@ entry uses this extension, it may be up to 271 bytes.
      - Name
      - Description
    * - 0x0
-     - \_\_le32
+     - __le32
      - hash
      - The hash of the directory name
    * - 0x4
-     - \_\_le32
-     - minor\_hash
+     - __le32
+     - minor_hash
      - The minor hash of the directory name
 
 
 In order to add checksums to these classic directory blocks, a phony
 ``struct ext4_dir_entry`` is placed at the end of each leaf block to
 hold the checksum. The directory entry is 12 bytes long. The inode
-number and name\_len fields are set to zero to fool old software into
+number and name_len fields are set to zero to fool old software into
 ignoring an apparently empty directory entry, and the checksum is stored
 in the place where the name normally goes. The structure is
 ``struct ext4_dir_entry_tail``:
@@ -163,24 +163,24 @@ in the place where the name normally goes. The structure is
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - det\_reserved\_zero1
+     - __le32
+     - det_reserved_zero1
      - Inode number, which must be zero.
    * - 0x4
-     - \_\_le16
-     - det\_rec\_len
+     - __le16
+     - det_rec_len
      - Length of this directory entry, which must be 12.
    * - 0x6
-     - \_\_u8
-     - det\_reserved\_zero2
+     - __u8
+     - det_reserved_zero2
      - Length of the file name, which must be zero.
    * - 0x7
-     - \_\_u8
-     - det\_reserved\_ft
+     - __u8
+     - det_reserved_ft
      - File type, which must be 0xDE.
    * - 0x8
-     - \_\_le32
-     - det\_checksum
+     - __le32
+     - det_checksum
      - Directory leaf block checksum.
 
 The leaf directory block checksum is calculated against the FS UUID, the
@@ -194,7 +194,7 @@ Hash Tree Directories
 A linear array of directory entries isn't great for performance, so a
 new feature was added to ext3 to provide a faster (but peculiar)
 balanced tree keyed off a hash of the directory entry name. If the
-EXT4\_INDEX\_FL (0x1000) flag is set in the inode, this directory uses a
+EXT4_INDEX_FL (0x1000) flag is set in the inode, this directory uses a
 hashed btree (htree) to organize and find directory entries. For
 backwards read-only compatibility with ext2, this tree is actually
 hidden inside the directory file, masquerading as “empty” directory data
@@ -206,14 +206,14 @@ rest of the directory block is empty so that it moves on.
 The root of the tree always lives in the first data block of the
 directory. By ext2 custom, the '.' and '..' entries must appear at the
 beginning of this first block, so they are put here as two
-``struct ext4_dir_entry_2``\ s and not stored in the tree. The rest of
+``struct ext4_dir_entry_2`` s and not stored in the tree. The rest of
 the root node contains metadata about the tree and finally a hash->block
 map to find nodes that are lower in the htree. If
 ``dx_root.info.indirect_levels`` is non-zero then the htree has two
 levels; the data block pointed to by the root node's map is an interior
 node, which is indexed by a minor hash. Interior nodes in this tree
 contains a zeroed out ``struct ext4_dir_entry_2`` followed by a
-minor\_hash->block map to find leafe nodes. Leaf nodes contain a linear
+minor_hash->block map to find leafe nodes. Leaf nodes contain a linear
 array of all ``struct ext4_dir_entry_2``; all of these entries
 (presumably) hash to the same value. If there is an overflow, the
 entries simply overflow into the next leaf node, and the
@@ -245,83 +245,83 @@ of a data block:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
+     - __le32
      - dot.inode
      - inode number of this directory.
    * - 0x4
-     - \_\_le16
-     - dot.rec\_len
+     - __le16
+     - dot.rec_len
      - Length of this record, 12.
    * - 0x6
      - u8
-     - dot.name\_len
+     - dot.name_len
      - Length of the name, 1.
    * - 0x7
      - u8
-     - dot.file\_type
+     - dot.file_type
      - File type of this entry, 0x2 (directory) (if the feature flag is set).
    * - 0x8
      - char
      - dot.name[4]
-     - “.\\0\\0\\0”
+     - “.\0\0\0”
    * - 0xC
-     - \_\_le32
+     - __le32
      - dotdot.inode
      - inode number of parent directory.
    * - 0x10
-     - \_\_le16
-     - dotdot.rec\_len
-     - block\_size - 12. The record length is long enough to cover all htree
+     - __le16
+     - dotdot.rec_len
+     - block_size - 12. The record length is long enough to cover all htree
        data.
    * - 0x12
      - u8
-     - dotdot.name\_len
+     - dotdot.name_len
      - Length of the name, 2.
    * - 0x13
      - u8
-     - dotdot.file\_type
+     - dotdot.file_type
      - File type of this entry, 0x2 (directory) (if the feature flag is set).
    * - 0x14
      - char
-     - dotdot\_name[4]
-     - “..\\0\\0”
+     - dotdot_name[4]
+     - “..\0\0”
    * - 0x18
-     - \_\_le32
-     - struct dx\_root\_info.reserved\_zero
+     - __le32
+     - struct dx_root_info.reserved_zero
      - Zero.
    * - 0x1C
      - u8
-     - struct dx\_root\_info.hash\_version
+     - struct dx_root_info.hash_version
      - Hash type, see dirhash_ table below.
    * - 0x1D
      - u8
-     - struct dx\_root\_info.info\_length
+     - struct dx_root_info.info_length
      - Length of the tree information, 0x8.
    * - 0x1E
      - u8
-     - struct dx\_root\_info.indirect\_levels
-     - Depth of the htree. Cannot be larger than 3 if the INCOMPAT\_LARGEDIR
+     - struct dx_root_info.indirect_levels
+     - Depth of the htree. Cannot be larger than 3 if the INCOMPAT_LARGEDIR
        feature is set; cannot be larger than 2 otherwise.
    * - 0x1F
      - u8
-     - struct dx\_root\_info.unused\_flags
+     - struct dx_root_info.unused_flags
      -
    * - 0x20
-     - \_\_le16
+     - __le16
      - limit
-     - Maximum number of dx\_entries that can follow this header, plus 1 for
+     - Maximum number of dx_entries that can follow this header, plus 1 for
        the header itself.
    * - 0x22
-     - \_\_le16
+     - __le16
      - count
-     - Actual number of dx\_entries that follow this header, plus 1 for the
+     - Actual number of dx_entries that follow this header, plus 1 for the
        header itself.
    * - 0x24
-     - \_\_le32
+     - __le32
      - block
      - The block number (within the directory file) that goes with hash=0.
    * - 0x28
-     - struct dx\_entry
+     - struct dx_entry
      - entries[0]
      - As many 8-byte ``struct dx_entry`` as fits in the rest of the data block.
 
@@ -362,38 +362,38 @@ also the full length of a data block:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
+     - __le32
      - fake.inode
      - Zero, to make it look like this entry is not in use.
    * - 0x4
-     - \_\_le16
-     - fake.rec\_len
-     - The size of the block, in order to hide all of the dx\_node data.
+     - __le16
+     - fake.rec_len
+     - The size of the block, in order to hide all of the dx_node data.
    * - 0x6
      - u8
-     - name\_len
+     - name_len
      - Zero. There is no name for this “unused” directory entry.
    * - 0x7
      - u8
-     - file\_type
+     - file_type
      - Zero. There is no file type for this “unused” directory entry.
    * - 0x8
-     - \_\_le16
+     - __le16
      - limit
-     - Maximum number of dx\_entries that can follow this header, plus 1 for
+     - Maximum number of dx_entries that can follow this header, plus 1 for
        the header itself.
    * - 0xA
-     - \_\_le16
+     - __le16
      - count
-     - Actual number of dx\_entries that follow this header, plus 1 for the
+     - Actual number of dx_entries that follow this header, plus 1 for the
        header itself.
    * - 0xE
-     - \_\_le32
+     - __le32
      - block
      - The block number (within the directory file) that goes with the lowest
        hash value of this block. This value is stored in the parent block.
    * - 0x12
-     - struct dx\_entry
+     - struct dx_entry
      - entries[0]
      - As many 8-byte ``struct dx_entry`` as fits in the rest of the data block.
 
@@ -410,11 +410,11 @@ long:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
+     - __le32
      - hash
      - Hash code.
    * - 0x4
-     - \_\_le32
+     - __le32
      - block
      - Block number (within the directory file, not filesystem blocks) of the
        next node in the htree.
@@ -423,13 +423,13 @@ long:
 author.)
 
 If metadata checksums are enabled, the last 8 bytes of the directory
-block (precisely the length of one dx\_entry) are used to store a
+block (precisely the length of one dx_entry) are used to store a
 ``struct dx_tail``, which contains the checksum. The ``limit`` and
-``count`` entries in the dx\_root/dx\_node structures are adjusted as
-necessary to fit the dx\_tail into the block. If there is no space for
-the dx\_tail, the user is notified to run e2fsck -D to rebuild the
+``count`` entries in the dx_root/dx_node structures are adjusted as
+necessary to fit the dx_tail into the block. If there is no space for
+the dx_tail, the user is notified to run e2fsck -D to rebuild the
 directory index (which will ensure that there's space for the checksum.
-The dx\_tail structure is 8 bytes long and looks like this:
+The dx_tail structure is 8 bytes long and looks like this:
 
 .. list-table::
    :widths: 8 8 24 40
@@ -441,13 +441,13 @@ The dx\_tail structure is 8 bytes long and looks like this:
      - Description
    * - 0x0
      - u32
-     - dt\_reserved
+     - dt_reserved
      - Zero.
    * - 0x4
-     - \_\_le32
-     - dt\_checksum
+     - __le32
+     - dt_checksum
      - Checksum of the htree directory block.
 
 The checksum is calculated against the FS UUID, the htree index header
-(dx\_root or dx\_node), all of the htree indices (dx\_entry) that are in
-use, and the tail block (dx\_tail).
+(dx_root or dx_node), all of the htree indices (dx_entry) that are in
+use, and the tail block (dx_tail).
index ecc0d01..7a2ef26 100644 (file)
@@ -5,14 +5,14 @@ Large Extended Attribute Values
 
 To enable ext4 to store extended attribute values that do not fit in the
 inode or in the single extended attribute block attached to an inode,
-the EA\_INODE feature allows us to store the value in the data blocks of
+the EA_INODE feature allows us to store the value in the data blocks of
 a regular file inode. This “EA inode” is linked only from the extended
 attribute name index and must not appear in a directory entry. The
-inode's i\_atime field is used to store a checksum of the xattr value;
-and i\_ctime/i\_version store a 64-bit reference count, which enables
+inode's i_atime field is used to store a checksum of the xattr value;
+and i_ctime/i_version store a 64-bit reference count, which enables
 sharing of large xattr values between multiple owning inodes. For
 backward compatibility with older versions of this feature, the
-i\_mtime/i\_generation *may* store a back-reference to the inode number
-and i\_generation of the **one** owning inode (in cases where the EA
+i_mtime/i_generation *may* store a back-reference to the inode number
+and i_generation of the **one** owning inode (in cases where the EA
 inode is not referenced by multiple inodes) to verify that the EA inode
 is the correct one being accessed.
index 7ba6114..392ec44 100644 (file)
@@ -7,34 +7,34 @@ Each block group on the filesystem has one of these descriptors
 associated with it. As noted in the Layout section above, the group
 descriptors (if present) are the second item in the block group. The
 standard configuration is for each block group to contain a full copy of
-the block group descriptor table unless the sparse\_super feature flag
+the block group descriptor table unless the sparse_super feature flag
 is set.
 
 Notice how the group descriptor records the location of both bitmaps and
 the inode table (i.e. they can float). This means that within a block
 group, the only data structures with fixed locations are the superblock
-and the group descriptor table. The flex\_bg mechanism uses this
+and the group descriptor table. The flex_bg mechanism uses this
 property to group several block groups into a flex group and lay out all
 of the groups' bitmaps and inode tables into one long run in the first
 group of the flex group.
 
-If the meta\_bg feature flag is set, then several block groups are
-grouped together into a meta group. Note that in the meta\_bg case,
+If the meta_bg feature flag is set, then several block groups are
+grouped together into a meta group. Note that in the meta_bg case,
 however, the first and last two block groups within the larger meta
 group contain only group descriptors for the groups inside the meta
 group.
 
-flex\_bg and meta\_bg do not appear to be mutually exclusive features.
+flex_bg and meta_bg do not appear to be mutually exclusive features.
 
 In ext2, ext3, and ext4 (when the 64bit feature is not enabled), the
 block group descriptor was only 32 bytes long and therefore ends at
-bg\_checksum. On an ext4 filesystem with the 64bit feature enabled, the
+bg_checksum. On an ext4 filesystem with the 64bit feature enabled, the
 block group descriptor expands to at least the 64 bytes described below;
 the size is stored in the superblock.
 
-If gdt\_csum is set and metadata\_csum is not set, the block group
+If gdt_csum is set and metadata_csum is not set, the block group
 checksum is the crc16 of the FS UUID, the group number, and the group
-descriptor structure. If metadata\_csum is set, then the block group
+descriptor structure. If metadata_csum is set, then the block group
 checksum is the lower 16 bits of the checksum of the FS UUID, the group
 number, and the group descriptor structure. Both block and inode bitmap
 checksums are calculated against the FS UUID, the group number, and the
@@ -51,59 +51,59 @@ The block group descriptor is laid out in ``struct ext4_group_desc``.
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - bg\_block\_bitmap\_lo
+     - __le32
+     - bg_block_bitmap_lo
      - Lower 32-bits of location of block bitmap.
    * - 0x4
-     - \_\_le32
-     - bg\_inode\_bitmap\_lo
+     - __le32
+     - bg_inode_bitmap_lo
      - Lower 32-bits of location of inode bitmap.
    * - 0x8
-     - \_\_le32
-     - bg\_inode\_table\_lo
+     - __le32
+     - bg_inode_table_lo
      - Lower 32-bits of location of inode table.
    * - 0xC
-     - \_\_le16
-     - bg\_free\_blocks\_count\_lo
+     - __le16
+     - bg_free_blocks_count_lo
      - Lower 16-bits of free block count.
    * - 0xE
-     - \_\_le16
-     - bg\_free\_inodes\_count\_lo
+     - __le16
+     - bg_free_inodes_count_lo
      - Lower 16-bits of free inode count.
    * - 0x10
-     - \_\_le16
-     - bg\_used\_dirs\_count\_lo
+     - __le16
+     - bg_used_dirs_count_lo
      - Lower 16-bits of directory count.
    * - 0x12
-     - \_\_le16
-     - bg\_flags
+     - __le16
+     - bg_flags
      - Block group flags. See the bgflags_ table below.
    * - 0x14
-     - \_\_le32
-     - bg\_exclude\_bitmap\_lo
+     - __le32
+     - bg_exclude_bitmap_lo
      - Lower 32-bits of location of snapshot exclusion bitmap.
    * - 0x18
-     - \_\_le16
-     - bg\_block\_bitmap\_csum\_lo
+     - __le16
+     - bg_block_bitmap_csum_lo
      - Lower 16-bits of the block bitmap checksum.
    * - 0x1A
-     - \_\_le16
-     - bg\_inode\_bitmap\_csum\_lo
+     - __le16
+     - bg_inode_bitmap_csum_lo
      - Lower 16-bits of the inode bitmap checksum.
    * - 0x1C
-     - \_\_le16
-     - bg\_itable\_unused\_lo
+     - __le16
+     - bg_itable_unused_lo
      - Lower 16-bits of unused inode count. If set, we needn't scan past the
-       ``(sb.s_inodes_per_group - gdt.bg_itable_unused)``\ th entry in the
+       ``(sb.s_inodes_per_group - gdt.bg_itable_unused)`` th entry in the
        inode table for this group.
    * - 0x1E
-     - \_\_le16
-     - bg\_checksum
-     - Group descriptor checksum; crc16(sb\_uuid+group\_num+bg\_desc) if the
-       RO\_COMPAT\_GDT\_CSUM feature is set, or
-       crc32c(sb\_uuid+group\_num+bg\_desc) & 0xFFFF if the
-       RO\_COMPAT\_METADATA\_CSUM feature is set.  The bg\_checksum
-       field in bg\_desc is skipped when calculating crc16 checksum,
+     - __le16
+     - bg_checksum
+     - Group descriptor checksum; crc16(sb_uuid+group_num+bg_desc) if the
+       RO_COMPAT_GDT_CSUM feature is set, or
+       crc32c(sb_uuid+group_num+bg_desc) & 0xFFFF if the
+       RO_COMPAT_METADATA_CSUM feature is set.  The bg_checksum
+       field in bg_desc is skipped when calculating crc16 checksum,
        and set to zero if crc32c checksum is used.
    * -
      -
@@ -111,48 +111,48 @@ The block group descriptor is laid out in ``struct ext4_group_desc``.
      - These fields only exist if the 64bit feature is enabled and s_desc_size
        > 32.
    * - 0x20
-     - \_\_le32
-     - bg\_block\_bitmap\_hi
+     - __le32
+     - bg_block_bitmap_hi
      - Upper 32-bits of location of block bitmap.
    * - 0x24
-     - \_\_le32
-     - bg\_inode\_bitmap\_hi
+     - __le32
+     - bg_inode_bitmap_hi
      - Upper 32-bits of location of inodes bitmap.
    * - 0x28
-     - \_\_le32
-     - bg\_inode\_table\_hi
+     - __le32
+     - bg_inode_table_hi
      - Upper 32-bits of location of inodes table.
    * - 0x2C
-     - \_\_le16
-     - bg\_free\_blocks\_count\_hi
+     - __le16
+     - bg_free_blocks_count_hi
      - Upper 16-bits of free block count.
    * - 0x2E
-     - \_\_le16
-     - bg\_free\_inodes\_count\_hi
+     - __le16
+     - bg_free_inodes_count_hi
      - Upper 16-bits of free inode count.
    * - 0x30
-     - \_\_le16
-     - bg\_used\_dirs\_count\_hi
+     - __le16
+     - bg_used_dirs_count_hi
      - Upper 16-bits of directory count.
    * - 0x32
-     - \_\_le16
-     - bg\_itable\_unused\_hi
+     - __le16
+     - bg_itable_unused_hi
      - Upper 16-bits of unused inode count.
    * - 0x34
-     - \_\_le32
-     - bg\_exclude\_bitmap\_hi
+     - __le32
+     - bg_exclude_bitmap_hi
      - Upper 32-bits of location of snapshot exclusion bitmap.
    * - 0x38
-     - \_\_le16
-     - bg\_block\_bitmap\_csum\_hi
+     - __le16
+     - bg_block_bitmap_csum_hi
      - Upper 16-bits of the block bitmap checksum.
    * - 0x3A
-     - \_\_le16
-     - bg\_inode\_bitmap\_csum\_hi
+     - __le16
+     - bg_inode_bitmap_csum_hi
      - Upper 16-bits of the inode bitmap checksum.
    * - 0x3C
-     - \_\_u32
-     - bg\_reserved
+     - __u32
+     - bg_reserved
      - Padding to 64 bytes.
 
 .. _bgflags:
@@ -166,8 +166,8 @@ Block group flags can be any combination of the following:
    * - Value
      - Description
    * - 0x1
-     - inode table and bitmap are not initialized (EXT4\_BG\_INODE\_UNINIT).
+     - inode table and bitmap are not initialized (EXT4_BG_INODE_UNINIT).
    * - 0x2
-     - block bitmap is not initialized (EXT4\_BG\_BLOCK\_UNINIT).
+     - block bitmap is not initialized (EXT4_BG_BLOCK_UNINIT).
    * - 0x4
-     - inode table is zeroed (EXT4\_BG\_INODE\_ZEROED).
+     - inode table is zeroed (EXT4_BG_INODE_ZEROED).
index b9816d5..dc31f50 100644 (file)
@@ -1,6 +1,6 @@
 .. SPDX-License-Identifier: GPL-2.0
 
-The Contents of inode.i\_block
+The Contents of inode.i_block
 ------------------------------
 
 Depending on the type of file an inode describes, the 60 bytes of
@@ -47,7 +47,7 @@ In ext4, the file to logical block map has been replaced with an extent
 tree. Under the old scheme, allocating a contiguous run of 1,000 blocks
 requires an indirect block to map all 1,000 entries; with extents, the
 mapping is reduced to a single ``struct ext4_extent`` with
-``ee_len = 1000``. If flex\_bg is enabled, it is possible to allocate
+``ee_len = 1000``. If flex_bg is enabled, it is possible to allocate
 very large files with a single extent, at a considerable reduction in
 metadata block use, and some improvement in disk efficiency. The inode
 must have the extents flag (0x80000) flag set for this feature to be in
@@ -76,28 +76,28 @@ which is 12 bytes long:
      - Name
      - Description
    * - 0x0
-     - \_\_le16
-     - eh\_magic
+     - __le16
+     - eh_magic
      - Magic number, 0xF30A.
    * - 0x2
-     - \_\_le16
-     - eh\_entries
+     - __le16
+     - eh_entries
      - Number of valid entries following the header.
    * - 0x4
-     - \_\_le16
-     - eh\_max
+     - __le16
+     - eh_max
      - Maximum number of entries that could follow the header.
    * - 0x6
-     - \_\_le16
-     - eh\_depth
+     - __le16
+     - eh_depth
      - Depth of this extent node in the extent tree. 0 = this extent node
        points to data blocks; otherwise, this extent node points to other
        extent nodes. The extent tree can be at most 5 levels deep: a logical
        block number can be at most ``2^32``, and the smallest ``n`` that
        satisfies ``4*(((blocksize - 12)/12)^n) >= 2^32`` is 5.
    * - 0x8
-     - \_\_le32
-     - eh\_generation
+     - __le32
+     - eh_generation
      - Generation of the tree. (Used by Lustre, but not standard ext4).
 
 Internal nodes of the extent tree, also known as index nodes, are
@@ -112,22 +112,22 @@ recorded as ``struct ext4_extent_idx``, and are 12 bytes long:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - ei\_block
+     - __le32
+     - ei_block
      - This index node covers file blocks from 'block' onward.
    * - 0x4
-     - \_\_le32
-     - ei\_leaf\_lo
+     - __le32
+     - ei_leaf_lo
      - Lower 32-bits of the block number of the extent node that is the next
        level lower in the tree. The tree node pointed to can be either another
        internal node or a leaf node, described below.
    * - 0x8
-     - \_\_le16
-     - ei\_leaf\_hi
+     - __le16
+     - ei_leaf_hi
      - Upper 16-bits of the previous field.
    * - 0xA
-     - \_\_u16
-     - ei\_unused
+     - __u16
+     - ei_unused
      -
 
 Leaf nodes of the extent tree are recorded as ``struct ext4_extent``,
@@ -142,24 +142,24 @@ and are also 12 bytes long:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - ee\_block
+     - __le32
+     - ee_block
      - First file block number that this extent covers.
    * - 0x4
-     - \_\_le16
-     - ee\_len
+     - __le16
+     - ee_len
      - Number of blocks covered by extent. If the value of this field is <=
        32768, the extent is initialized. If the value of the field is > 32768,
        the extent is uninitialized and the actual extent length is ``ee_len`` -
        32768. Therefore, the maximum length of a initialized extent is 32768
        blocks, and the maximum length of an uninitialized extent is 32767.
    * - 0x6
-     - \_\_le16
-     - ee\_start\_hi
+     - __le16
+     - ee_start_hi
      - Upper 16-bits of the block number to which this extent points.
    * - 0x8
-     - \_\_le32
-     - ee\_start\_lo
+     - __le32
+     - ee_start_lo
      - Lower 32-bits of the block number to which this extent points.
 
 Prior to the introduction of metadata checksums, the extent header +
@@ -182,8 +182,8 @@ including) the checksum itself.
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - eb\_checksum
+     - __le32
+     - eb_checksum
      - Checksum of the extent block, crc32c(uuid+inum+igeneration+extentblock)
 
 Inline Data
index d107517..a728af0 100644 (file)
@@ -11,12 +11,12 @@ file is smaller than 60 bytes, then the data are stored inline in
 attribute space, then it might be found as an extended attribute
 “system.data” within the inode body (“ibody EA”). This of course
 constrains the amount of extended attributes one can attach to an inode.
-If the data size increases beyond i\_block + ibody EA, a regular block
+If the data size increases beyond i_block + ibody EA, a regular block
 is allocated and the contents moved to that block.
 
 Pending a change to compact the extended attribute key used to store
 inline data, one ought to be able to store 160 bytes of data in a
-256-byte inode (as of June 2015, when i\_extra\_isize is 28). Prior to
+256-byte inode (as of June 2015, when i_extra_isize is 28). Prior to
 that, the limit was 156 bytes due to inefficient use of inode space.
 
 The inline data feature requires the presence of an extended attribute
@@ -25,12 +25,12 @@ for “system.data”, even if the attribute value is zero length.
 Inline Directories
 ~~~~~~~~~~~~~~~~~~
 
-The first four bytes of i\_block are the inode number of the parent
+The first four bytes of i_block are the inode number of the parent
 directory. Following that is a 56-byte space for an array of directory
 entries; see ``struct ext4_dir_entry``. If there is a “system.data”
 attribute in the inode body, the EA value is an array of
 ``struct ext4_dir_entry`` as well. Note that for inline directories, the
-i\_block and EA space are treated as separate dirent blocks; directory
+i_block and EA space are treated as separate dirent blocks; directory
 entries cannot span the two.
 
 Inline directory entries are not checksummed, as the inode checksum
index 6c5ce66..cfc6c16 100644 (file)
@@ -38,138 +38,138 @@ The inode table entry is laid out in ``struct ext4_inode``.
      - Name
      - Description
    * - 0x0
-     - \_\_le16
-     - i\_mode
+     - __le16
+     - i_mode
      - File mode. See the table i_mode_ below.
    * - 0x2
-     - \_\_le16
-     - i\_uid
+     - __le16
+     - i_uid
      - Lower 16-bits of Owner UID.
    * - 0x4
-     - \_\_le32
-     - i\_size\_lo
+     - __le32
+     - i_size_lo
      - Lower 32-bits of size in bytes.
    * - 0x8
-     - \_\_le32
-     - i\_atime
-     - Last access time, in seconds since the epoch. However, if the EA\_INODE
+     - __le32
+     - i_atime
+     - Last access time, in seconds since the epoch. However, if the EA_INODE
        inode flag is set, this inode stores an extended attribute value and
        this field contains the checksum of the value.
    * - 0xC
-     - \_\_le32
-     - i\_ctime
+     - __le32
+     - i_ctime
      - Last inode change time, in seconds since the epoch. However, if the
-       EA\_INODE inode flag is set, this inode stores an extended attribute
+       EA_INODE inode flag is set, this inode stores an extended attribute
        value and this field contains the lower 32 bits of the attribute value's
        reference count.
    * - 0x10
-     - \_\_le32
-     - i\_mtime
+     - __le32
+     - i_mtime
      - Last data modification time, in seconds since the epoch. However, if the
-       EA\_INODE inode flag is set, this inode stores an extended attribute
+       EA_INODE inode flag is set, this inode stores an extended attribute
        value and this field contains the number of the inode that owns the
        extended attribute.
    * - 0x14
-     - \_\_le32
-     - i\_dtime
+     - __le32
+     - i_dtime
      - Deletion Time, in seconds since the epoch.
    * - 0x18
-     - \_\_le16
-     - i\_gid
+     - __le16
+     - i_gid
      - Lower 16-bits of GID.
    * - 0x1A
-     - \_\_le16
-     - i\_links\_count
+     - __le16
+     - i_links_count
      - Hard link count. Normally, ext4 does not permit an inode to have more
        than 65,000 hard links. This applies to files as well as directories,
        which means that there cannot be more than 64,998 subdirectories in a
        directory (each subdirectory's '..' entry counts as a hard link, as does
-       the '.' entry in the directory itself). With the DIR\_NLINK feature
+       the '.' entry in the directory itself). With the DIR_NLINK feature
        enabled, ext4 supports more than 64,998 subdirectories by setting this
        field to 1 to indicate that the number of hard links is not known.
    * - 0x1C
-     - \_\_le32
-     - i\_blocks\_lo
-     - Lower 32-bits of “block” count. If the huge\_file feature flag is not
+     - __le32
+     - i_blocks_lo
+     - Lower 32-bits of “block” count. If the huge_file feature flag is not
        set on the filesystem, the file consumes ``i_blocks_lo`` 512-byte blocks
-       on disk. If huge\_file is set and EXT4\_HUGE\_FILE\_FL is NOT set in
+       on disk. If huge_file is set and EXT4_HUGE_FILE_FL is NOT set in
        ``inode.i_flags``, then the file consumes ``i_blocks_lo + (i_blocks_hi
-       << 32)`` 512-byte blocks on disk. If huge\_file is set and
-       EXT4\_HUGE\_FILE\_FL IS set in ``inode.i_flags``, then this file
+       << 32)`` 512-byte blocks on disk. If huge_file is set and
+       EXT4_HUGE_FILE_FL IS set in ``inode.i_flags``, then this file
        consumes (``i_blocks_lo + i_blocks_hi`` << 32) filesystem blocks on
        disk.
    * - 0x20
-     - \_\_le32
-     - i\_flags
+     - __le32
+     - i_flags
      - Inode flags. See the table i_flags_ below.
    * - 0x24
      - 4 bytes
-     - i\_osd1
+     - i_osd1
      - See the table i_osd1_ for more details.
    * - 0x28
      - 60 bytes
-     - i\_block[EXT4\_N\_BLOCKS=15]
-     - Block map or extent tree. See the section “The Contents of inode.i\_block”.
+     - i_block[EXT4_N_BLOCKS=15]
+     - Block map or extent tree. See the section “The Contents of inode.i_block”.
    * - 0x64
-     - \_\_le32
-     - i\_generation
+     - __le32
+     - i_generation
      - File version (for NFS).
    * - 0x68
-     - \_\_le32
-     - i\_file\_acl\_lo
+     - __le32
+     - i_file_acl_lo
      - Lower 32-bits of extended attribute block. ACLs are of course one of
        many possible extended attributes; I think the name of this field is a
        result of the first use of extended attributes being for ACLs.
    * - 0x6C
-     - \_\_le32
-     - i\_size\_high / i\_dir\_acl
+     - __le32
+     - i_size_high / i_dir_acl
      - Upper 32-bits of file/directory size. In ext2/3 this field was named
-       i\_dir\_acl, though it was usually set to zero and never used.
+       i_dir_acl, though it was usually set to zero and never used.
    * - 0x70
-     - \_\_le32
-     - i\_obso\_faddr
+     - __le32
+     - i_obso_faddr
      - (Obsolete) fragment address.
    * - 0x74
      - 12 bytes
-     - i\_osd2
+     - i_osd2
      - See the table i_osd2_ for more details.
    * - 0x80
-     - \_\_le16
-     - i\_extra\_isize
+     - __le16
+     - i_extra_isize
      - Size of this inode - 128. Alternately, the size of the extended inode
        fields beyond the original ext2 inode, including this field.
    * - 0x82
-     - \_\_le16
-     - i\_checksum\_hi
+     - __le16
+     - i_checksum_hi
      - Upper 16-bits of the inode checksum.
    * - 0x84
-     - \_\_le32
-     - i\_ctime\_extra
+     - __le32
+     - i_ctime_extra
      - Extra change time bits. This provides sub-second precision. See Inode
        Timestamps section.
    * - 0x88
-     - \_\_le32
-     - i\_mtime\_extra
+     - __le32
+     - i_mtime_extra
      - Extra modification time bits. This provides sub-second precision.
    * - 0x8C
-     - \_\_le32
-     - i\_atime\_extra
+     - __le32
+     - i_atime_extra
      - Extra access time bits. This provides sub-second precision.
    * - 0x90
-     - \_\_le32
-     - i\_crtime
+     - __le32
+     - i_crtime
      - File creation time, in seconds since the epoch.
    * - 0x94
-     - \_\_le32
-     - i\_crtime\_extra
+     - __le32
+     - i_crtime_extra
      - Extra file creation time bits. This provides sub-second precision.
    * - 0x98
-     - \_\_le32
-     - i\_version\_hi
+     - __le32
+     - i_version_hi
      - Upper 32-bits for version number.
    * - 0x9C
-     - \_\_le32
-     - i\_projid
+     - __le32
+     - i_projid
      - Project ID.
 
 .. _i_mode:
@@ -183,45 +183,45 @@ The ``i_mode`` value is a combination of the following flags:
    * - Value
      - Description
    * - 0x1
-     - S\_IXOTH (Others may execute)
+     - S_IXOTH (Others may execute)
    * - 0x2
-     - S\_IWOTH (Others may write)
+     - S_IWOTH (Others may write)
    * - 0x4
-     - S\_IROTH (Others may read)
+     - S_IROTH (Others may read)
    * - 0x8
-     - S\_IXGRP (Group members may execute)
+     - S_IXGRP (Group members may execute)
    * - 0x10
-     - S\_IWGRP (Group members may write)
+     - S_IWGRP (Group members may write)
    * - 0x20
-     - S\_IRGRP (Group members may read)
+     - S_IRGRP (Group members may read)
    * - 0x40
-     - S\_IXUSR (Owner may execute)
+     - S_IXUSR (Owner may execute)
    * - 0x80
-     - S\_IWUSR (Owner may write)
+     - S_IWUSR (Owner may write)
    * - 0x100
-     - S\_IRUSR (Owner may read)
+     - S_IRUSR (Owner may read)
    * - 0x200
-     - S\_ISVTX (Sticky bit)
+     - S_ISVTX (Sticky bit)
    * - 0x400
-     - S\_ISGID (Set GID)
+     - S_ISGID (Set GID)
    * - 0x800
-     - S\_ISUID (Set UID)
+     - S_ISUID (Set UID)
    * -
      - These are mutually-exclusive file types:
    * - 0x1000
-     - S\_IFIFO (FIFO)
+     - S_IFIFO (FIFO)
    * - 0x2000
-     - S\_IFCHR (Character device)
+     - S_IFCHR (Character device)
    * - 0x4000
-     - S\_IFDIR (Directory)
+     - S_IFDIR (Directory)
    * - 0x6000
-     - S\_IFBLK (Block device)
+     - S_IFBLK (Block device)
    * - 0x8000
-     - S\_IFREG (Regular file)
+     - S_IFREG (Regular file)
    * - 0xA000
-     - S\_IFLNK (Symbolic link)
+     - S_IFLNK (Symbolic link)
    * - 0xC000
-     - S\_IFSOCK (Socket)
+     - S_IFSOCK (Socket)
 
 .. _i_flags:
 
@@ -234,56 +234,56 @@ The ``i_flags`` field is a combination of these values:
    * - Value
      - Description
    * - 0x1
-     - This file requires secure deletion (EXT4\_SECRM\_FL). (not implemented)
+     - This file requires secure deletion (EXT4_SECRM_FL). (not implemented)
    * - 0x2
      - This file should be preserved, should undeletion be desired
-       (EXT4\_UNRM\_FL). (not implemented)
+       (EXT4_UNRM_FL). (not implemented)
    * - 0x4
-     - File is compressed (EXT4\_COMPR\_FL). (not really implemented)
+     - File is compressed (EXT4_COMPR_FL). (not really implemented)
    * - 0x8
-     - All writes to the file must be synchronous (EXT4\_SYNC\_FL).
+     - All writes to the file must be synchronous (EXT4_SYNC_FL).
    * - 0x10
-     - File is immutable (EXT4\_IMMUTABLE\_FL).
+     - File is immutable (EXT4_IMMUTABLE_FL).
    * - 0x20
-     - File can only be appended (EXT4\_APPEND\_FL).
+     - File can only be appended (EXT4_APPEND_FL).
    * - 0x40
-     - The dump(1) utility should not dump this file (EXT4\_NODUMP\_FL).
+     - The dump(1) utility should not dump this file (EXT4_NODUMP_FL).
    * - 0x80
-     - Do not update access time (EXT4\_NOATIME\_FL).
+     - Do not update access time (EXT4_NOATIME_FL).
    * - 0x100
-     - Dirty compressed file (EXT4\_DIRTY\_FL). (not used)
+     - Dirty compressed file (EXT4_DIRTY_FL). (not used)
    * - 0x200
-     - File has one or more compressed clusters (EXT4\_COMPRBLK\_FL). (not used)
+     - File has one or more compressed clusters (EXT4_COMPRBLK_FL). (not used)
    * - 0x400
-     - Do not compress file (EXT4\_NOCOMPR\_FL). (not used)
+     - Do not compress file (EXT4_NOCOMPR_FL). (not used)
    * - 0x800
-     - Encrypted inode (EXT4\_ENCRYPT\_FL). This bit value previously was
-       EXT4\_ECOMPR\_FL (compression error), which was never used.
+     - Encrypted inode (EXT4_ENCRYPT_FL). This bit value previously was
+       EXT4_ECOMPR_FL (compression error), which was never used.
    * - 0x1000
-     - Directory has hashed indexes (EXT4\_INDEX\_FL).
+     - Directory has hashed indexes (EXT4_INDEX_FL).
    * - 0x2000
-     - AFS magic directory (EXT4\_IMAGIC\_FL).
+     - AFS magic directory (EXT4_IMAGIC_FL).
    * - 0x4000
      - File data must always be written through the journal
-       (EXT4\_JOURNAL\_DATA\_FL).
+       (EXT4_JOURNAL_DATA_FL).
    * - 0x8000
-     - File tail should not be merged (EXT4\_NOTAIL\_FL). (not used by ext4)
+     - File tail should not be merged (EXT4_NOTAIL_FL). (not used by ext4)
    * - 0x10000
      - All directory entry data should be written synchronously (see
-       ``dirsync``) (EXT4\_DIRSYNC\_FL).
+       ``dirsync``) (EXT4_DIRSYNC_FL).
    * - 0x20000
-     - Top of directory hierarchy (EXT4\_TOPDIR\_FL).
+     - Top of directory hierarchy (EXT4_TOPDIR_FL).
    * - 0x40000
-     - This is a huge file (EXT4\_HUGE\_FILE\_FL).
+     - This is a huge file (EXT4_HUGE_FILE_FL).
    * - 0x80000
-     - Inode uses extents (EXT4\_EXTENTS\_FL).
+     - Inode uses extents (EXT4_EXTENTS_FL).
    * - 0x100000
-     - Verity protected file (EXT4\_VERITY\_FL).
+     - Verity protected file (EXT4_VERITY_FL).
    * - 0x200000
      - Inode stores a large extended attribute value in its data blocks
-       (EXT4\_EA\_INODE\_FL).
+       (EXT4_EA_INODE_FL).
    * - 0x400000
-     - This file has blocks allocated past EOF (EXT4\_EOFBLOCKS\_FL).
+     - This file has blocks allocated past EOF (EXT4_EOFBLOCKS_FL).
        (deprecated)
    * - 0x01000000
      - Inode is a snapshot (``EXT4_SNAPFILE_FL``). (not in mainline)
@@ -294,21 +294,21 @@ The ``i_flags`` field is a combination of these values:
      - Snapshot shrink has completed (``EXT4_SNAPFILE_SHRUNK_FL``). (not in
        mainline)
    * - 0x10000000
-     - Inode has inline data (EXT4\_INLINE\_DATA\_FL).
+     - Inode has inline data (EXT4_INLINE_DATA_FL).
    * - 0x20000000
-     - Create children with the same project ID (EXT4\_PROJINHERIT\_FL).
+     - Create children with the same project ID (EXT4_PROJINHERIT_FL).
    * - 0x80000000
-     - Reserved for ext4 library (EXT4\_RESERVED\_FL).
+     - Reserved for ext4 library (EXT4_RESERVED_FL).
    * -
      - Aggregate flags:
    * - 0x705BDFFF
      - User-visible flags.
    * - 0x604BC0FF
-     - User-modifiable flags. Note that while EXT4\_JOURNAL\_DATA\_FL and
-       EXT4\_EXTENTS\_FL can be set with setattr, they are not in the kernel's
-       EXT4\_FL\_USER\_MODIFIABLE mask, since it needs to handle the setting of
+     - User-modifiable flags. Note that while EXT4_JOURNAL_DATA_FL and
+       EXT4_EXTENTS_FL can be set with setattr, they are not in the kernel's
+       EXT4_FL_USER_MODIFIABLE mask, since it needs to handle the setting of
        these flags in a special manner and they are masked out of the set of
-       flags that are saved directly to i\_flags.
+       flags that are saved directly to i_flags.
 
 .. _i_osd1:
 
@@ -325,9 +325,9 @@ Linux:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - l\_i\_version
-     - Inode version. However, if the EA\_INODE inode flag is set, this inode
+     - __le32
+     - l_i_version
+     - Inode version. However, if the EA_INODE inode flag is set, this inode
        stores an extended attribute value and this field contains the upper 32
        bits of the attribute value's reference count.
 
@@ -342,8 +342,8 @@ Hurd:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - h\_i\_translator
+     - __le32
+     - h_i_translator
      - ??
 
 Masix:
@@ -357,8 +357,8 @@ Masix:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - m\_i\_reserved
+     - __le32
+     - m_i_reserved
      - ??
 
 .. _i_osd2:
@@ -376,30 +376,30 @@ Linux:
      - Name
      - Description
    * - 0x0
-     - \_\_le16
-     - l\_i\_blocks\_high
+     - __le16
+     - l_i_blocks_high
      - Upper 16-bits of the block count. Please see the note attached to
-       i\_blocks\_lo.
+       i_blocks_lo.
    * - 0x2
-     - \_\_le16
-     - l\_i\_file\_acl\_high
+     - __le16
+     - l_i_file_acl_high
      - Upper 16-bits of the extended attribute block (historically, the file
        ACL location). See the Extended Attributes section below.
    * - 0x4
-     - \_\_le16
-     - l\_i\_uid\_high
+     - __le16
+     - l_i_uid_high
      - Upper 16-bits of the Owner UID.
    * - 0x6
-     - \_\_le16
-     - l\_i\_gid\_high
+     - __le16
+     - l_i_gid_high
      - Upper 16-bits of the GID.
    * - 0x8
-     - \_\_le16
-     - l\_i\_checksum\_lo
+     - __le16
+     - l_i_checksum_lo
      - Lower 16-bits of the inode checksum.
    * - 0xA
-     - \_\_le16
-     - l\_i\_reserved
+     - __le16
+     - l_i_reserved
      - Unused.
 
 Hurd:
@@ -413,24 +413,24 @@ Hurd:
      - Name
      - Description
    * - 0x0
-     - \_\_le16
-     - h\_i\_reserved1
+     - __le16
+     - h_i_reserved1
      - ??
    * - 0x2
-     - \_\_u16
-     - h\_i\_mode\_high
+     - __u16
+     - h_i_mode_high
      - Upper 16-bits of the file mode.
    * - 0x4
-     - \_\_le16
-     - h\_i\_uid\_high
+     - __le16
+     - h_i_uid_high
      - Upper 16-bits of the Owner UID.
    * - 0x6
-     - \_\_le16
-     - h\_i\_gid\_high
+     - __le16
+     - h_i_gid_high
      - Upper 16-bits of the GID.
    * - 0x8
-     - \_\_u32
-     - h\_i\_author
+     - __u32
+     - h_i_author
      - Author code?
 
 Masix:
@@ -444,17 +444,17 @@ Masix:
      - Name
      - Description
    * - 0x0
-     - \_\_le16
-     - h\_i\_reserved1
+     - __le16
+     - h_i_reserved1
      - ??
    * - 0x2
-     - \_\_u16
-     - m\_i\_file\_acl\_high
+     - __u16
+     - m_i_file_acl_high
      - Upper 16-bits of the extended attribute block (historically, the file
        ACL location).
    * - 0x4
-     - \_\_u32
-     - m\_i\_reserved2[2]
+     - __u32
+     - m_i_reserved2[2]
      - ??
 
 Inode Size
@@ -466,11 +466,11 @@ In ext2 and ext3, the inode structure size was fixed at 128 bytes
 on-disk inode at format time for all inodes in the filesystem to provide
 space beyond the end of the original ext2 inode. The on-disk inode
 record size is recorded in the superblock as ``s_inode_size``. The
-number of bytes actually used by struct ext4\_inode beyond the original
+number of bytes actually used by struct ext4_inode beyond the original
 128-byte ext2 inode is recorded in the ``i_extra_isize`` field for each
-inode, which allows struct ext4\_inode to grow for a new kernel without
+inode, which allows struct ext4_inode to grow for a new kernel without
 having to upgrade all of the on-disk inodes. Access to fields beyond
-EXT2\_GOOD\_OLD\_INODE\_SIZE should be verified to be within
+EXT2_GOOD_OLD_INODE_SIZE should be verified to be within
 ``i_extra_isize``. By default, ext4 inode records are 256 bytes, and (as
 of August 2019) the inode structure is 160 bytes
 (``i_extra_isize = 32``). The extra space between the end of the inode
@@ -516,7 +516,7 @@ creation time (crtime); this field is 64-bits wide and decoded in the
 same manner as 64-bit [cma]time. Neither crtime nor dtime are accessible
 through the regular stat() interface, though debugfs will report them.
 
-We use the 32-bit signed time value plus (2^32 \* (extra epoch bits)).
+We use the 32-bit signed time value plus (2^32 * (extra epoch bits)).
 In other words:
 
 .. list-table::
@@ -525,8 +525,8 @@ In other words:
 
    * - Extra epoch bits
      - MSB of 32-bit time
-     - Adjustment for signed 32-bit to 64-bit tv\_sec
-     - Decoded 64-bit tv\_sec
+     - Adjustment for signed 32-bit to 64-bit tv_sec
+     - Decoded 64-bit tv_sec
      - valid time range
    * - 0 0
      - 1
index 5fad388..a6bef52 100644 (file)
@@ -63,8 +63,8 @@ Generally speaking, the journal has this format:
    :header-rows: 1
 
    * - Superblock
-     - descriptor\_block (data\_blocks or revocation\_block) [more data or
-       revocations] commmit\_block
+     - descriptor_block (data_blocks or revocation_block) [more data or
+       revocations] commmit_block
      - [more transactions...]
    * - 
      - One transaction
@@ -93,8 +93,8 @@ superblock.
    * - 1024 bytes of padding
      - ext4 Superblock
      - Journal Superblock
-     - descriptor\_block (data\_blocks or revocation\_block) [more data or
-       revocations] commmit\_block
+     - descriptor_block (data_blocks or revocation_block) [more data or
+       revocations] commmit_block
      - [more transactions...]
    * - 
      -
@@ -117,17 +117,17 @@ Every block in the journal starts with a common 12-byte header
      - Name
      - Description
    * - 0x0
-     - \_\_be32
-     - h\_magic
+     - __be32
+     - h_magic
      - jbd2 magic number, 0xC03B3998.
    * - 0x4
-     - \_\_be32
-     - h\_blocktype
+     - __be32
+     - h_blocktype
      - Description of what this block contains. See the jbd2_blocktype_ table
        below.
    * - 0x8
-     - \_\_be32
-     - h\_sequence
+     - __be32
+     - h_sequence
      - The transaction ID that goes with this block.
 
 .. _jbd2_blocktype:
@@ -177,99 +177,99 @@ which is 1024 bytes long:
      -
      - Static information describing the journal.
    * - 0x0
-     - journal\_header\_t (12 bytes)
-     - s\_header
+     - journal_header_t (12 bytes)
+     - s_header
      - Common header identifying this as a superblock.
    * - 0xC
-     - \_\_be32
-     - s\_blocksize
+     - __be32
+     - s_blocksize
      - Journal device block size.
    * - 0x10
-     - \_\_be32
-     - s\_maxlen
+     - __be32
+     - s_maxlen
      - Total number of blocks in this journal.
    * - 0x14
-     - \_\_be32
-     - s\_first
+     - __be32
+     - s_first
      - First block of log information.
    * -
      -
      -
      - Dynamic information describing the current state of the log.
    * - 0x18
-     - \_\_be32
-     - s\_sequence
+     - __be32
+     - s_sequence
      - First commit ID expected in log.
    * - 0x1C
-     - \_\_be32
-     - s\_start
+     - __be32
+     - s_start
      - Block number of the start of log. Contrary to the comments, this field
        being zero does not imply that the journal is clean!
    * - 0x20
-     - \_\_be32
-     - s\_errno
-     - Error value, as set by jbd2\_journal\_abort().
+     - __be32
+     - s_errno
+     - Error value, as set by jbd2_journal_abort().
    * -
      -
      -
      - The remaining fields are only valid in a v2 superblock.
    * - 0x24
-     - \_\_be32
-     - s\_feature\_compat;
+     - __be32
+     - s_feature_compat;
      - Compatible feature set. See the table jbd2_compat_ below.
    * - 0x28
-     - \_\_be32
-     - s\_feature\_incompat
+     - __be32
+     - s_feature_incompat
      - Incompatible feature set. See the table jbd2_incompat_ below.
    * - 0x2C
-     - \_\_be32
-     - s\_feature\_ro\_compat
+     - __be32
+     - s_feature_ro_compat
      - Read-only compatible feature set. There aren't any of these currently.
    * - 0x30
-     - \_\_u8
-     - s\_uuid[16]
+     - __u8
+     - s_uuid[16]
      - 128-bit uuid for journal. This is compared against the copy in the ext4
        super block at mount time.
    * - 0x40
-     - \_\_be32
-     - s\_nr\_users
+     - __be32
+     - s_nr_users
      - Number of file systems sharing this journal.
    * - 0x44
-     - \_\_be32
-     - s\_dynsuper
+     - __be32
+     - s_dynsuper
      - Location of dynamic super block copy. (Not used?)
    * - 0x48
-     - \_\_be32
-     - s\_max\_transaction
+     - __be32
+     - s_max_transaction
      - Limit of journal blocks per transaction. (Not used?)
    * - 0x4C
-     - \_\_be32
-     - s\_max\_trans\_data
+     - __be32
+     - s_max_trans_data
      - Limit of data blocks per transaction. (Not used?)
    * - 0x50
-     - \_\_u8
-     - s\_checksum\_type
+     - __u8
+     - s_checksum_type
      - Checksum algorithm used for the journal.  See jbd2_checksum_type_ for
        more info.
    * - 0x51
-     - \_\_u8[3]
-     - s\_padding2
+     - __u8[3]
+     - s_padding2
      -
    * - 0x54
-     - \_\_be32
-     - s\_num\_fc\_blocks
+     - __be32
+     - s_num_fc_blocks
      - Number of fast commit blocks in the journal.
    * - 0x58
-     - \_\_u32
-     - s\_padding[42]
+     - __u32
+     - s_padding[42]
      -
    * - 0xFC
-     - \_\_be32
-     - s\_checksum
+     - __be32
+     - s_checksum
      - Checksum of the entire superblock, with this field set to zero.
    * - 0x100
-     - \_\_u8
-     - s\_users[16\*48]
+     - __u8
+     - s_users[16*48]
      - ids of all file systems sharing the log. e2fsprogs/Linux don't allow
        shared external journals, but I imagine Lustre (or ocfs2?), which use
        the jbd2 code, might.
@@ -286,7 +286,7 @@ The journal compat features are any combination of the following:
      - Description
    * - 0x1
      - Journal maintains checksums on the data blocks.
-       (JBD2\_FEATURE\_COMPAT\_CHECKSUM)
+       (JBD2_FEATURE_COMPAT_CHECKSUM)
 
 .. _jbd2_incompat:
 
@@ -299,23 +299,23 @@ The journal incompat features are any combination of the following:
    * - Value
      - Description
    * - 0x1
-     - Journal has block revocation records. (JBD2\_FEATURE\_INCOMPAT\_REVOKE)
+     - Journal has block revocation records. (JBD2_FEATURE_INCOMPAT_REVOKE)
    * - 0x2
      - Journal can deal with 64-bit block numbers.
-       (JBD2\_FEATURE\_INCOMPAT\_64BIT)
+       (JBD2_FEATURE_INCOMPAT_64BIT)
    * - 0x4
-     - Journal commits asynchronously. (JBD2\_FEATURE\_INCOMPAT\_ASYNC\_COMMIT)
+     - Journal commits asynchronously. (JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT)
    * - 0x8
      - This journal uses v2 of the checksum on-disk format. Each journal
        metadata block gets its own checksum, and the block tags in the
        descriptor table contain checksums for each of the data blocks in the
-       journal. (JBD2\_FEATURE\_INCOMPAT\_CSUM\_V2)
+       journal. (JBD2_FEATURE_INCOMPAT_CSUM_V2)
    * - 0x10
      - This journal uses v3 of the checksum on-disk format. This is the same as
        v2, but the journal block tag size is fixed regardless of the size of
-       block numbers. (JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3)
+       block numbers. (JBD2_FEATURE_INCOMPAT_CSUM_V3)
    * - 0x20
-     - Journal has fast commit blocks. (JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT)
+     - Journal has fast commit blocks. (JBD2_FEATURE_INCOMPAT_FAST_COMMIT)
 
 .. _jbd2_checksum_type:
 
@@ -355,11 +355,11 @@ Descriptor blocks consume at least 36 bytes, but use a full block:
      - Name
      - Descriptor
    * - 0x0
-     - journal\_header\_t
+     - journal_header_t
      - (open coded)
      - Common block header.
    * - 0xC
-     - struct journal\_block\_tag\_s
+     - struct journal_block_tag_s
      - open coded array[]
      - Enough tags either to fill up the block or to describe all the data
        blocks that follow this descriptor block.
@@ -367,7 +367,7 @@ Descriptor blocks consume at least 36 bytes, but use a full block:
 Journal block tags have any of the following formats, depending on which
 journal feature and block tag flags are set.
 
-If JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3 is set, the journal block tag is
+If JBD2_FEATURE_INCOMPAT_CSUM_V3 is set, the journal block tag is
 defined as ``struct journal_block_tag3_s``, which looks like the
 following. The size is 16 or 32 bytes.
 
@@ -380,24 +380,24 @@ following. The size is 16 or 32 bytes.
      - Name
      - Descriptor
    * - 0x0
-     - \_\_be32
-     - t\_blocknr
+     - __be32
+     - t_blocknr
      - Lower 32-bits of the location of where the corresponding data block
        should end up on disk.
    * - 0x4
-     - \_\_be32
-     - t\_flags
+     - __be32
+     - t_flags
      - Flags that go with the descriptor. See the table jbd2_tag_flags_ for
        more info.
    * - 0x8
-     - \_\_be32
-     - t\_blocknr\_high
+     - __be32
+     - t_blocknr_high
      - Upper 32-bits of the location of where the corresponding data block
-       should end up on disk. This is zero if JBD2\_FEATURE\_INCOMPAT\_64BIT is
+       should end up on disk. This is zero if JBD2_FEATURE_INCOMPAT_64BIT is
        not enabled.
    * - 0xC
-     - \_\_be32
-     - t\_checksum
+     - __be32
+     - t_checksum
      - Checksum of the journal UUID, the sequence number, and the data block.
    * -
      -
@@ -433,7 +433,7 @@ The journal tag flags are any combination of the following:
    * - 0x8
      - This is the last tag in this descriptor block.
 
-If JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3 is NOT set, the journal block tag
+If JBD2_FEATURE_INCOMPAT_CSUM_V3 is NOT set, the journal block tag
 is defined as ``struct journal_block_tag_s``, which looks like the
 following. The size is 8, 12, 24, or 28 bytes:
 
@@ -446,18 +446,18 @@ following. The size is 8, 12, 24, or 28 bytes:
      - Name
      - Descriptor
    * - 0x0
-     - \_\_be32
-     - t\_blocknr
+     - __be32
+     - t_blocknr
      - Lower 32-bits of the location of where the corresponding data block
        should end up on disk.
    * - 0x4
-     - \_\_be16
-     - t\_checksum
+     - __be16
+     - t_checksum
      - Checksum of the journal UUID, the sequence number, and the data block.
        Note that only the lower 16 bits are stored.
    * - 0x6
-     - \_\_be16
-     - t\_flags
+     - __be16
+     - t_flags
      - Flags that go with the descriptor. See the table jbd2_tag_flags_ for
        more info.
    * -
@@ -466,8 +466,8 @@ following. The size is 8, 12, 24, or 28 bytes:
      - This next field is only present if the super block indicates support for
        64-bit block numbers.
    * - 0x8
-     - \_\_be32
-     - t\_blocknr\_high
+     - __be32
+     - t_blocknr_high
      - Upper 32-bits of the location of where the corresponding data block
        should end up on disk.
    * -
@@ -483,8 +483,8 @@ following. The size is 8, 12, 24, or 28 bytes:
        ``j_uuid`` field in ``struct journal_s``, but only tune2fs touches that
        field.
 
-If JBD2\_FEATURE\_INCOMPAT\_CSUM\_V2 or
-JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3 are set, the end of the block is a
+If JBD2_FEATURE_INCOMPAT_CSUM_V2 or
+JBD2_FEATURE_INCOMPAT_CSUM_V3 are set, the end of the block is a
 ``struct jbd2_journal_block_tail``, which looks like this:
 
 .. list-table::
@@ -496,8 +496,8 @@ JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3 are set, the end of the block is a
      - Name
      - Descriptor
    * - 0x0
-     - \_\_be32
-     - t\_checksum
+     - __be32
+     - t_checksum
      - Checksum of the journal UUID + the descriptor block, with this field set
        to zero.
 
@@ -538,25 +538,25 @@ length, but use a full block:
      - Name
      - Description
    * - 0x0
-     - journal\_header\_t
-     - r\_header
+     - journal_header_t
+     - r_header
      - Common block header.
    * - 0xC
-     - \_\_be32
-     - r\_count
+     - __be32
+     - r_count
      - Number of bytes used in this block.
    * - 0x10
-     - \_\_be32 or \_\_be64
+     - __be32 or __be64
      - blocks[0]
      - Blocks to revoke.
 
-After r\_count is a linear array of block numbers that are effectively
+After r_count is a linear array of block numbers that are effectively
 revoked by this transaction. The size of each block number is 8 bytes if
 the superblock advertises 64-bit block number support, or 4 bytes
 otherwise.
 
-If JBD2\_FEATURE\_INCOMPAT\_CSUM\_V2 or
-JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3 are set, the end of the revocation
+If JBD2_FEATURE_INCOMPAT_CSUM_V2 or
+JBD2_FEATURE_INCOMPAT_CSUM_V3 are set, the end of the revocation
 block is a ``struct jbd2_journal_revoke_tail``, which has this format:
 
 .. list-table::
@@ -568,8 +568,8 @@ block is a ``struct jbd2_journal_revoke_tail``, which has this format:
      - Name
      - Description
    * - 0x0
-     - \_\_be32
-     - r\_checksum
+     - __be32
+     - r_checksum
      - Checksum of the journal UUID + revocation block
 
 Commit Block
@@ -592,38 +592,38 @@ bytes long (but uses a full block):
      - Name
      - Descriptor
    * - 0x0
-     - journal\_header\_s
+     - journal_header_s
      - (open coded)
      - Common block header.
    * - 0xC
      - unsigned char
-     - h\_chksum\_type
+     - h_chksum_type
      - The type of checksum to use to verify the integrity of the data blocks
        in the transaction. See jbd2_checksum_type_ for more info.
    * - 0xD
      - unsigned char
-     - h\_chksum\_size
+     - h_chksum_size
      - The number of bytes used by the checksum. Most likely 4.
    * - 0xE
      - unsigned char
-     - h\_padding[2]
+     - h_padding[2]
      -
    * - 0x10
-     - \_\_be32
-     - h\_chksum[JBD2\_CHECKSUM\_BYTES]
+     - __be32
+     - h_chksum[JBD2_CHECKSUM_BYTES]
      - 32 bytes of space to store checksums. If
-       JBD2\_FEATURE\_INCOMPAT\_CSUM\_V2 or JBD2\_FEATURE\_INCOMPAT\_CSUM\_V3
+       JBD2_FEATURE_INCOMPAT_CSUM_V2 or JBD2_FEATURE_INCOMPAT_CSUM_V3
        are set, the first ``__be32`` is the checksum of the journal UUID and
        the entire commit block, with this field zeroed. If
-       JBD2\_FEATURE\_COMPAT\_CHECKSUM is set, the first ``__be32`` is the
+       JBD2_FEATURE_COMPAT_CHECKSUM is set, the first ``__be32`` is the
        crc32 of all the blocks already written to the transaction.
    * - 0x30
-     - \_\_be64
-     - h\_commit\_sec
+     - __be64
+     - h_commit_sec
      - The time that the transaction was committed, in seconds since the epoch.
    * - 0x38
-     - \_\_be32
-     - h\_commit\_nsec
+     - __be32
+     - h_commit_nsec
      - Nanoseconds component of the above timestamp.
 
 Fast commits
index 2566098..174dd65 100644 (file)
@@ -7,8 +7,8 @@ Multiple mount protection (MMP) is a feature that protects the
 filesystem against multiple hosts trying to use the filesystem
 simultaneously. When a filesystem is opened (for mounting, or fsck,
 etc.), the MMP code running on the node (call it node A) checks a
-sequence number. If the sequence number is EXT4\_MMP\_SEQ\_CLEAN, the
-open continues. If the sequence number is EXT4\_MMP\_SEQ\_FSCK, then
+sequence number. If the sequence number is EXT4_MMP_SEQ_CLEAN, the
+open continues. If the sequence number is EXT4_MMP_SEQ_FSCK, then
 fsck is (hopefully) running, and open fails immediately. Otherwise, the
 open code will wait for twice the specified MMP check interval and check
 the sequence number again. If the sequence number has changed, then the
@@ -40,38 +40,38 @@ The MMP structure (``struct mmp_struct``) is as follows:
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - mmp\_magic
+     - __le32
+     - mmp_magic
      - Magic number for MMP, 0x004D4D50 (“MMP”).
    * - 0x4
-     - \_\_le32
-     - mmp\_seq
+     - __le32
+     - mmp_seq
      - Sequence number, updated periodically.
    * - 0x8
-     - \_\_le64
-     - mmp\_time
+     - __le64
+     - mmp_time
      - Time that the MMP block was last updated.
    * - 0x10
      - char[64]
-     - mmp\_nodename
+     - mmp_nodename
      - Hostname of the node that opened the filesystem.
    * - 0x50
      - char[32]
-     - mmp\_bdevname
+     - mmp_bdevname
      - Block device name of the filesystem.
    * - 0x70
-     - \_\_le16
-     - mmp\_check\_interval
+     - __le16
+     - mmp_check_interval
      - The MMP re-check interval, in seconds.
    * - 0x72
-     - \_\_le16
-     - mmp\_pad1
+     - __le16
+     - mmp_pad1
      - Zero.
    * - 0x74
-     - \_\_le32[226]
-     - mmp\_pad2
+     - __le32[226]
+     - mmp_pad2
      - Zero.
    * - 0x3FC
-     - \_\_le32
-     - mmp\_checksum
+     - __le32
+     - mmp_checksum
      - Checksum of the MMP block.
index 123ebfd..0fad6ed 100644 (file)
@@ -7,7 +7,7 @@ An ext4 file system is split into a series of block groups. To reduce
 performance difficulties due to fragmentation, the block allocator tries
 very hard to keep each file's blocks within the same group, thereby
 reducing seek times. The size of a block group is specified in
-``sb.s_blocks_per_group`` blocks, though it can also calculated as 8 \*
+``sb.s_blocks_per_group`` blocks, though it can also calculated as 8 *
 ``block_size_in_bytes``. With the default block size of 4KiB, each group
 will contain 32,768 blocks, for a length of 128MiB. The number of block
 groups is the size of the device divided by the size of a block group.
index 94f304e..fc06369 100644 (file)
@@ -34,7 +34,7 @@ ext4 reserves some inode for special features, as follows:
    * - 10
      - Replica inode, used for some non-upstream feature?
    * - 11
-     - Traditional first non-reserved inode. Usually this is the lost+found directory. See s\_first\_ino in the superblock.
+     - Traditional first non-reserved inode. Usually this is the lost+found directory. See s_first_ino in the superblock.
 
 Note that there are also some inodes allocated from non-reserved inode numbers
 for other filesystem features which are not referenced from standard directory
@@ -47,9 +47,9 @@ hierarchy. These are generally reference from the superblock. They are:
    * - Superblock field
      - Description
 
-   * - s\_lpf\_ino
+   * - s_lpf_ino
      - Inode number of lost+found directory.
-   * - s\_prj\_quota\_inum
+   * - s_prj_quota_inum
      - Inode number of quota file tracking project quotas
-   * - s\_orphan\_file\_inum
+   * - s_orphan_file_inum
      - Inode number of file tracking orphan inodes.
index f6a548e..2688885 100644 (file)
@@ -7,7 +7,7 @@ The superblock records various information about the enclosing
 filesystem, such as block counts, inode counts, supported features,
 maintenance information, and more.
 
-If the sparse\_super feature flag is set, redundant copies of the
+If the sparse_super feature flag is set, redundant copies of the
 superblock and group descriptors are kept only in the groups whose group
 number is either 0 or a power of 3, 5, or 7. If the flag is not set,
 redundant copies are kept in all groups.
@@ -27,107 +27,107 @@ The ext4 superblock is laid out as follows in
      - Name
      - Description
    * - 0x0
-     - \_\_le32
-     - s\_inodes\_count
+     - __le32
+     - s_inodes_count
      - Total inode count.
    * - 0x4
-     - \_\_le32
-     - s\_blocks\_count\_lo
+     - __le32
+     - s_blocks_count_lo
      - Total block count.
    * - 0x8
-     - \_\_le32
-     - s\_r\_blocks\_count\_lo
+     - __le32
+     - s_r_blocks_count_lo
      - This number of blocks can only be allocated by the super-user.
    * - 0xC
-     - \_\_le32
-     - s\_free\_blocks\_count\_lo
+     - __le32
+     - s_free_blocks_count_lo
      - Free block count.
    * - 0x10
-     - \_\_le32
-     - s\_free\_inodes\_count
+     - __le32
+     - s_free_inodes_count
      - Free inode count.
    * - 0x14
-     - \_\_le32
-     - s\_first\_data\_block
+     - __le32
+     - s_first_data_block
      - First data block. This must be at least 1 for 1k-block filesystems and
        is typically 0 for all other block sizes.
    * - 0x18
-     - \_\_le32
-     - s\_log\_block\_size
-     - Block size is 2 ^ (10 + s\_log\_block\_size).
+     - __le32
+     - s_log_block_size
+     - Block size is 2 ^ (10 + s_log_block_size).
    * - 0x1C
-     - \_\_le32
-     - s\_log\_cluster\_size
-     - Cluster size is 2 ^ (10 + s\_log\_cluster\_size) blocks if bigalloc is
-       enabled. Otherwise s\_log\_cluster\_size must equal s\_log\_block\_size.
+     - __le32
+     - s_log_cluster_size
+     - Cluster size is 2 ^ (10 + s_log_cluster_size) blocks if bigalloc is
+       enabled. Otherwise s_log_cluster_size must equal s_log_block_size.
    * - 0x20
-     - \_\_le32
-     - s\_blocks\_per\_group
+     - __le32
+     - s_blocks_per_group
      - Blocks per group.
    * - 0x24
-     - \_\_le32
-     - s\_clusters\_per\_group
+     - __le32
+     - s_clusters_per_group
      - Clusters per group, if bigalloc is enabled. Otherwise
-       s\_clusters\_per\_group must equal s\_blocks\_per\_group.
+       s_clusters_per_group must equal s_blocks_per_group.
    * - 0x28
-     - \_\_le32
-     - s\_inodes\_per\_group
+     - __le32
+     - s_inodes_per_group
      - Inodes per group.
    * - 0x2C
-     - \_\_le32
-     - s\_mtime
+     - __le32
+     - s_mtime
      - Mount time, in seconds since the epoch.
    * - 0x30
-     - \_\_le32
-     - s\_wtime
+     - __le32
+     - s_wtime
      - Write time, in seconds since the epoch.
    * - 0x34
-     - \_\_le16
-     - s\_mnt\_count
+     - __le16
+     - s_mnt_count
      - Number of mounts since the last fsck.
    * - 0x36
-     - \_\_le16
-     - s\_max\_mnt\_count
+     - __le16
+     - s_max_mnt_count
      - Number of mounts beyond which a fsck is needed.
    * - 0x38
-     - \_\_le16
-     - s\_magic
+     - __le16
+     - s_magic
      - Magic signature, 0xEF53
    * - 0x3A
-     - \_\_le16
-     - s\_state
+     - __le16
+     - s_state
      - File system state. See super_state_ for more info.
    * - 0x3C
-     - \_\_le16
-     - s\_errors
+     - __le16
+     - s_errors
      - Behaviour when detecting errors. See super_errors_ for more info.
    * - 0x3E
-     - \_\_le16
-     - s\_minor\_rev\_level
+     - __le16
+     - s_minor_rev_level
      - Minor revision level.
    * - 0x40
-     - \_\_le32
-     - s\_lastcheck
+     - __le32
+     - s_lastcheck
      - Time of last check, in seconds since the epoch.
    * - 0x44
-     - \_\_le32
-     - s\_checkinterval
+     - __le32
+     - s_checkinterval
      - Maximum time between checks, in seconds.
    * - 0x48
-     - \_\_le32
-     - s\_creator\_os
+     - __le32
+     - s_creator_os
      - Creator OS. See the table super_creator_ for more info.
    * - 0x4C
-     - \_\_le32
-     - s\_rev\_level
+     - __le32
+     - s_rev_level
      - Revision level. See the table super_revision_ for more info.
    * - 0x50
-     - \_\_le16
-     - s\_def\_resuid
+     - __le16
+     - s_def_resuid
      - Default uid for reserved blocks.
    * - 0x52
-     - \_\_le16
-     - s\_def\_resgid
+     - __le16
+     - s_def_resgid
      - Default gid for reserved blocks.
    * -
      -
@@ -143,50 +143,50 @@ The ext4 superblock is laid out as follows in
        about a feature in either the compatible or incompatible feature set, it
        must abort and not try to meddle with things it doesn't understand...
    * - 0x54
-     - \_\_le32
-     - s\_first\_ino
+     - __le32
+     - s_first_ino
      - First non-reserved inode.
    * - 0x58
-     - \_\_le16
-     - s\_inode\_size
+     - __le16
+     - s_inode_size
      - Size of inode structure, in bytes.
    * - 0x5A
-     - \_\_le16
-     - s\_block\_group\_nr
+     - __le16
+     - s_block_group_nr
      - Block group # of this superblock.
    * - 0x5C
-     - \_\_le32
-     - s\_feature\_compat
+     - __le32
+     - s_feature_compat
      - Compatible feature set flags. Kernel can still read/write this fs even
        if it doesn't understand a flag; fsck should not do that. See the
        super_compat_ table for more info.
    * - 0x60
-     - \_\_le32
-     - s\_feature\_incompat
+     - __le32
+     - s_feature_incompat
      - Incompatible feature set. If the kernel or fsck doesn't understand one
        of these bits, it should stop. See the super_incompat_ table for more
        info.
    * - 0x64
-     - \_\_le32
-     - s\_feature\_ro\_compat
+     - __le32
+     - s_feature_ro_compat
      - Readonly-compatible feature set. If the kernel doesn't understand one of
        these bits, it can still mount read-only. See the super_rocompat_ table
        for more info.
    * - 0x68
-     - \_\_u8
-     - s\_uuid[16]
+     - __u8
+     - s_uuid[16]
      - 128-bit UUID for volume.
    * - 0x78
      - char
-     - s\_volume\_name[16]
+     - s_volume_name[16]
      - Volume label.
    * - 0x88
      - char
-     - s\_last\_mounted[64]
+     - s_last_mounted[64]
      - Directory where filesystem was last mounted.
    * - 0xC8
-     - \_\_le32
-     - s\_algorithm\_usage\_bitmap
+     - __le32
+     - s_algorithm_usage_bitmap
      - For compression (Not used in e2fsprogs/Linux)
    * -
      -
@@ -194,18 +194,18 @@ The ext4 superblock is laid out as follows in
      - Performance hints.  Directory preallocation should only happen if the
        EXT4_FEATURE_COMPAT_DIR_PREALLOC flag is on.
    * - 0xCC
-     - \_\_u8
-     - s\_prealloc\_blocks
+     - __u8
+     - s_prealloc_blocks
      - #. of blocks to try to preallocate for ... files? (Not used in
        e2fsprogs/Linux)
    * - 0xCD
-     - \_\_u8
-     - s\_prealloc\_dir\_blocks
+     - __u8
+     - s_prealloc_dir_blocks
      - #. of blocks to preallocate for directories. (Not used in
        e2fsprogs/Linux)
    * - 0xCE
-     - \_\_le16
-     - s\_reserved\_gdt\_blocks
+     - __le16
+     - s_reserved_gdt_blocks
      - Number of reserved GDT entries for future filesystem expansion.
    * -
      -
@@ -213,281 +213,281 @@ The ext4 superblock is laid out as follows in
      - Journalling support is valid only if EXT4_FEATURE_COMPAT_HAS_JOURNAL is
        set.
    * - 0xD0
-     - \_\_u8
-     - s\_journal\_uuid[16]
+     - __u8
+     - s_journal_uuid[16]
      - UUID of journal superblock
    * - 0xE0
-     - \_\_le32
-     - s\_journal\_inum
+     - __le32
+     - s_journal_inum
      - inode number of journal file.
    * - 0xE4
-     - \_\_le32
-     - s\_journal\_dev
+     - __le32
+     - s_journal_dev
      - Device number of journal file, if the external journal feature flag is
        set.
    * - 0xE8
-     - \_\_le32
-     - s\_last\_orphan
+     - __le32
+     - s_last_orphan
      - Start of list of orphaned inodes to delete.
    * - 0xEC
-     - \_\_le32
-     - s\_hash\_seed[4]
+     - __le32
+     - s_hash_seed[4]
      - HTREE hash seed.
    * - 0xFC
-     - \_\_u8
-     - s\_def\_hash\_version
+     - __u8
+     - s_def_hash_version
      - Default hash algorithm to use for directory hashes. See super_def_hash_
        for more info.
    * - 0xFD
-     - \_\_u8
-     - s\_jnl\_backup\_type
-     - If this value is 0 or EXT3\_JNL\_BACKUP\_BLOCKS (1), then the
+     - __u8
+     - s_jnl_backup_type
+     - If this value is 0 or EXT3_JNL_BACKUP_BLOCKS (1), then the
        ``s_jnl_blocks`` field contains a duplicate copy of the inode's
        ``i_block[]`` array and ``i_size``.
    * - 0xFE
-     - \_\_le16
-     - s\_desc\_size
+     - __le16
+     - s_desc_size
      - Size of group descriptors, in bytes, if the 64bit incompat feature flag
        is set.
    * - 0x100
-     - \_\_le32
-     - s\_default\_mount\_opts
+     - __le32
+     - s_default_mount_opts
      - Default mount options. See the super_mountopts_ table for more info.
    * - 0x104
-     - \_\_le32
-     - s\_first\_meta\_bg
-     - First metablock block group, if the meta\_bg feature is enabled.
+     - __le32
+     - s_first_meta_bg
+     - First metablock block group, if the meta_bg feature is enabled.
    * - 0x108
-     - \_\_le32
-     - s\_mkfs\_time
+     - __le32
+     - s_mkfs_time
      - When the filesystem was created, in seconds since the epoch.
    * - 0x10C
-     - \_\_le32
-     - s\_jnl\_blocks[17]
+     - __le32
+     - s_jnl_blocks[17]
      - Backup copy of the journal inode's ``i_block[]`` array in the first 15
-       elements and i\_size\_high and i\_size in the 16th and 17th elements,
+       elements and i_size_high and i_size in the 16th and 17th elements,
        respectively.
    * -
      -
      -
      - 64bit support is valid only if EXT4_FEATURE_COMPAT_64BIT is set.
    * - 0x150
-     - \_\_le32
-     - s\_blocks\_count\_hi
+     - __le32
+     - s_blocks_count_hi
      - High 32-bits of the block count.
    * - 0x154
-     - \_\_le32
-     - s\_r\_blocks\_count\_hi
+     - __le32
+     - s_r_blocks_count_hi
      - High 32-bits of the reserved block count.
    * - 0x158
-     - \_\_le32
-     - s\_free\_blocks\_count\_hi
+     - __le32
+     - s_free_blocks_count_hi
      - High 32-bits of the free block count.
    * - 0x15C
-     - \_\_le16
-     - s\_min\_extra\_isize
+     - __le16
+     - s_min_extra_isize
      - All inodes have at least # bytes.
    * - 0x15E
-     - \_\_le16
-     - s\_want\_extra\_isize
+     - __le16
+     - s_want_extra_isize
      - New inodes should reserve # bytes.
    * - 0x160
-     - \_\_le32
-     - s\_flags
+     - __le32
+     - s_flags
      - Miscellaneous flags. See the super_flags_ table for more info.
    * - 0x164
-     - \_\_le16
-     - s\_raid\_stride
+     - __le16
+     - s_raid_stride
      - RAID stride. This is the number of logical blocks read from or written
        to the disk before moving to the next disk. This affects the placement
        of filesystem metadata, which will hopefully make RAID storage faster.
    * - 0x166
-     - \_\_le16
-     - s\_mmp\_interval
+     - __le16
+     - s_mmp_interval
      - #. seconds to wait in multi-mount prevention (MMP) checking. In theory,
        MMP is a mechanism to record in the superblock which host and device
        have mounted the filesystem, in order to prevent multiple mounts. This
        feature does not seem to be implemented...
    * - 0x168
-     - \_\_le64
-     - s\_mmp\_block
+     - __le64
+     - s_mmp_block
      - Block # for multi-mount protection data.
    * - 0x170
-     - \_\_le32
-     - s\_raid\_stripe\_width
+     - __le32
+     - s_raid_stripe_width
      - RAID stripe width. This is the number of logical blocks read from or
        written to the disk before coming back to the current disk. This is used
        by the block allocator to try to reduce the number of read-modify-write
        operations in a RAID5/6.
    * - 0x174
-     - \_\_u8
-     - s\_log\_groups\_per\_flex
+     - __u8
+     - s_log_groups_per_flex
      - Size of a flexible block group is 2 ^ ``s_log_groups_per_flex``.
    * - 0x175
-     - \_\_u8
-     - s\_checksum\_type
+     - __u8
+     - s_checksum_type
      - Metadata checksum algorithm type. The only valid value is 1 (crc32c).
    * - 0x176
-     - \_\_le16
-     - s\_reserved\_pad
+     - __le16
+     - s_reserved_pad
      -
    * - 0x178
-     - \_\_le64
-     - s\_kbytes\_written
+     - __le64
+     - s_kbytes_written
      - Number of KiB written to this filesystem over its lifetime.
    * - 0x180
-     - \_\_le32
-     - s\_snapshot\_inum
+     - __le32
+     - s_snapshot_inum
      - inode number of active snapshot. (Not used in e2fsprogs/Linux.)
    * - 0x184
-     - \_\_le32
-     - s\_snapshot\_id
+     - __le32
+     - s_snapshot_id
      - Sequential ID of active snapshot. (Not used in e2fsprogs/Linux.)
    * - 0x188
-     - \_\_le64
-     - s\_snapshot\_r\_blocks\_count
+     - __le64
+     - s_snapshot_r_blocks_count
      - Number of blocks reserved for active snapshot's future use. (Not used in
        e2fsprogs/Linux.)
    * - 0x190
-     - \_\_le32
-     - s\_snapshot\_list
+     - __le32
+     - s_snapshot_list
      - inode number of the head of the on-disk snapshot list. (Not used in
        e2fsprogs/Linux.)
    * - 0x194
-     - \_\_le32
-     - s\_error\_count
+     - __le32
+     - s_error_count
      - Number of errors seen.
    * - 0x198
-     - \_\_le32
-     - s\_first\_error\_time
+     - __le32
+     - s_first_error_time
      - First time an error happened, in seconds since the epoch.
    * - 0x19C
-     - \_\_le32
-     - s\_first\_error\_ino
+     - __le32
+     - s_first_error_ino
      - inode involved in first error.
    * - 0x1A0
-     - \_\_le64
-     - s\_first\_error\_block
+     - __le64
+     - s_first_error_block
      - Number of block involved of first error.
    * - 0x1A8
-     - \_\_u8
-     - s\_first\_error\_func[32]
+     - __u8
+     - s_first_error_func[32]
      - Name of function where the error happened.
    * - 0x1C8
-     - \_\_le32
-     - s\_first\_error\_line
+     - __le32
+     - s_first_error_line
      - Line number where error happened.
    * - 0x1CC
-     - \_\_le32
-     - s\_last\_error\_time
+     - __le32
+     - s_last_error_time
      - Time of most recent error, in seconds since the epoch.
    * - 0x1D0
-     - \_\_le32
-     - s\_last\_error\_ino
+     - __le32
+     - s_last_error_ino
      - inode involved in most recent error.
    * - 0x1D4
-     - \_\_le32
-     - s\_last\_error\_line
+     - __le32
+     - s_last_error_line
      - Line number where most recent error happened.
    * - 0x1D8
-     - \_\_le64
-     - s\_last\_error\_block
+     - __le64
+     - s_last_error_block
      - Number of block involved in most recent error.
    * - 0x1E0
-     - \_\_u8
-     - s\_last\_error\_func[32]
+     - __u8
+     - s_last_error_func[32]
      - Name of function where the most recent error happened.
    * - 0x200
-     - \_\_u8
-     - s\_mount\_opts[64]
+     - __u8
+     - s_mount_opts[64]
      - ASCIIZ string of mount options.
    * - 0x240
-     - \_\_le32
-     - s\_usr\_quota\_inum
+     - __le32
+     - s_usr_quota_inum
      - Inode number of user `quota <quota>`__ file.
    * - 0x244
-     - \_\_le32
-     - s\_grp\_quota\_inum
+     - __le32
+     - s_grp_quota_inum
      - Inode number of group `quota <quota>`__ file.
    * - 0x248
-     - \_\_le32
-     - s\_overhead\_blocks
+     - __le32
+     - s_overhead_blocks
      - Overhead blocks/clusters in fs. (Huh? This field is always zero, which
        means that the kernel calculates it dynamically.)
    * - 0x24C
-     - \_\_le32
-     - s\_backup\_bgs[2]
-     - Block groups containing superblock backups (if sparse\_super2)
+     - __le32
+     - s_backup_bgs[2]
+     - Block groups containing superblock backups (if sparse_super2)
    * - 0x254
-     - \_\_u8
-     - s\_encrypt\_algos[4]
+     - __u8
+     - s_encrypt_algos[4]
      - Encryption algorithms in use. There can be up to four algorithms in use
        at any time; valid algorithm codes are given in the super_encrypt_ table
        below.
    * - 0x258
-     - \_\_u8
-     - s\_encrypt\_pw\_salt[16]
+     - __u8
+     - s_encrypt_pw_salt[16]
      - Salt for the string2key algorithm for encryption.
    * - 0x268
-     - \_\_le32
-     - s\_lpf\_ino
+     - __le32
+     - s_lpf_ino
      - Inode number of lost+found
    * - 0x26C
-     - \_\_le32
-     - s\_prj\_quota\_inum
+     - __le32
+     - s_prj_quota_inum
      - Inode that tracks project quotas.
    * - 0x270
-     - \_\_le32
-     - s\_checksum\_seed
-     - Checksum seed used for metadata\_csum calculations. This value is
-       crc32c(~0, $orig\_fs\_uuid).
+     - __le32
+     - s_checksum_seed
+     - Checksum seed used for metadata_csum calculations. This value is
+       crc32c(~0, $orig_fs_uuid).
    * - 0x274
-     - \_\_u8
-     - s\_wtime_hi
+     - __u8
+     - s_wtime_hi
      - Upper 8 bits of the s_wtime field.
    * - 0x275
-     - \_\_u8
-     - s\_mtime_hi
+     - __u8
+     - s_mtime_hi
      - Upper 8 bits of the s_mtime field.
    * - 0x276
-     - \_\_u8
-     - s\_mkfs_time_hi
+     - __u8
+     - s_mkfs_time_hi
      - Upper 8 bits of the s_mkfs_time field.
    * - 0x277
-     - \_\_u8
-     - s\_lastcheck_hi
+     - __u8
+     - s_lastcheck_hi
      - Upper 8 bits of the s_lastcheck_hi field.
    * - 0x278
-     - \_\_u8
-     - s\_first_error_time_hi
+     - __u8
+     - s_first_error_time_hi
      - Upper 8 bits of the s_first_error_time_hi field.
    * - 0x279
-     - \_\_u8
-     - s\_last_error_time_hi
+     - __u8
+     - s_last_error_time_hi
      - Upper 8 bits of the s_last_error_time_hi field.
    * - 0x27A
-     - \_\_u8
-     - s\_pad[2]
+     - __u8
+     - s_pad[2]
      - Zero padding.
    * - 0x27C
-     - \_\_le16
-     - s\_encoding
+     - __le16
+     - s_encoding
      - Filename charset encoding.
    * - 0x27E
-     - \_\_le16
-     - s\_encoding_flags
+     - __le16
+     - s_encoding_flags
      - Filename charset encoding flags.
    * - 0x280
-     - \_\_le32
-     - s\_orphan\_file\_inum
+     - __le32
+     - s_orphan_file_inum
      - Orphan file inode number.
    * - 0x284
-     - \_\_le32
-     - s\_reserved[94]
+     - __le32
+     - s_reserved[94]
      - Padding to the end of the block.
    * - 0x3FC
-     - \_\_le32
-     - s\_checksum
+     - __le32
+     - s_checksum
      - Superblock checksum.
 
 .. _super_state:
@@ -574,44 +574,44 @@ following:
    * - Value
      - Description
    * - 0x1
-     - Directory preallocation (COMPAT\_DIR\_PREALLOC).
+     - Directory preallocation (COMPAT_DIR_PREALLOC).
    * - 0x2
      - “imagic inodes”. Not clear from the code what this does
-       (COMPAT\_IMAGIC\_INODES).
+       (COMPAT_IMAGIC_INODES).
    * - 0x4
-     - Has a journal (COMPAT\_HAS\_JOURNAL).
+     - Has a journal (COMPAT_HAS_JOURNAL).
    * - 0x8
-     - Supports extended attributes (COMPAT\_EXT\_ATTR).
+     - Supports extended attributes (COMPAT_EXT_ATTR).
    * - 0x10
      - Has reserved GDT blocks for filesystem expansion
-       (COMPAT\_RESIZE\_INODE). Requires RO\_COMPAT\_SPARSE\_SUPER.
+       (COMPAT_RESIZE_INODE). Requires RO_COMPAT_SPARSE_SUPER.
    * - 0x20
-     - Has directory indices (COMPAT\_DIR\_INDEX).
+     - Has directory indices (COMPAT_DIR_INDEX).
    * - 0x40
      - “Lazy BG”. Not in Linux kernel, seems to have been for uninitialized
-       block groups? (COMPAT\_LAZY\_BG)
+       block groups? (COMPAT_LAZY_BG)
    * - 0x80
-     - “Exclude inode”. Not used. (COMPAT\_EXCLUDE\_INODE).
+     - “Exclude inode”. Not used. (COMPAT_EXCLUDE_INODE).
    * - 0x100
      - “Exclude bitmap”. Seems to be used to indicate the presence of
        snapshot-related exclude bitmaps? Not defined in kernel or used in
-       e2fsprogs (COMPAT\_EXCLUDE\_BITMAP).
+       e2fsprogs (COMPAT_EXCLUDE_BITMAP).
    * - 0x200
-     - Sparse Super Block, v2. If this flag is set, the SB field s\_backup\_bgs
+     - Sparse Super Block, v2. If this flag is set, the SB field s_backup_bgs
        points to the two block groups that contain backup superblocks
-       (COMPAT\_SPARSE\_SUPER2).
+       (COMPAT_SPARSE_SUPER2).
    * - 0x400
      - Fast commits supported. Although fast commits blocks are
        backward incompatible, fast commit blocks are not always
        present in the journal. If fast commit blocks are present in
        the journal, JBD2 incompat feature
-       (JBD2\_FEATURE\_INCOMPAT\_FAST\_COMMIT) gets
-       set (COMPAT\_FAST\_COMMIT).
+       (JBD2_FEATURE_INCOMPAT_FAST_COMMIT) gets
+       set (COMPAT_FAST_COMMIT).
    * - 0x1000
      - Orphan file allocated. This is the special file for more efficient
        tracking of unlinked but still open inodes. When there may be any
        entries in the file, we additionally set proper rocompat feature
-       (RO\_COMPAT\_ORPHAN\_PRESENT).
+       (RO_COMPAT_ORPHAN_PRESENT).
 
 .. _super_incompat:
 
@@ -625,45 +625,45 @@ following:
    * - Value
      - Description
    * - 0x1
-     - Compression (INCOMPAT\_COMPRESSION).
+     - Compression (INCOMPAT_COMPRESSION).
    * - 0x2
-     - Directory entries record the file type. See ext4\_dir\_entry\_2 below
-       (INCOMPAT\_FILETYPE).
+     - Directory entries record the file type. See ext4_dir_entry_2 below
+       (INCOMPAT_FILETYPE).
    * - 0x4
-     - Filesystem needs recovery (INCOMPAT\_RECOVER).
+     - Filesystem needs recovery (INCOMPAT_RECOVER).
    * - 0x8
-     - Filesystem has a separate journal device (INCOMPAT\_JOURNAL\_DEV).
+     - Filesystem has a separate journal device (INCOMPAT_JOURNAL_DEV).
    * - 0x10
      - Meta block groups. See the earlier discussion of this feature
-       (INCOMPAT\_META\_BG).
+       (INCOMPAT_META_BG).
    * - 0x40
-     - Files in this filesystem use extents (INCOMPAT\_EXTENTS).
+     - Files in this filesystem use extents (INCOMPAT_EXTENTS).
    * - 0x80
-     - Enable a filesystem size of 2^64 blocks (INCOMPAT\_64BIT).
+     - Enable a filesystem size of 2^64 blocks (INCOMPAT_64BIT).
    * - 0x100
-     - Multiple mount protection (INCOMPAT\_MMP).
+     - Multiple mount protection (INCOMPAT_MMP).
    * - 0x200
      - Flexible block groups. See the earlier discussion of this feature
-       (INCOMPAT\_FLEX\_BG).
+       (INCOMPAT_FLEX_BG).
    * - 0x400
      - Inodes can be used to store large extended attribute values
-       (INCOMPAT\_EA\_INODE).
+       (INCOMPAT_EA_INODE).
    * - 0x1000
-     - Data in directory entry (INCOMPAT\_DIRDATA). (Not implemented?)
+     - Data in directory entry (INCOMPAT_DIRDATA). (Not implemented?)
    * - 0x2000
      - Metadata checksum seed is stored in the superblock. This feature enables
-       the administrator to change the UUID of a metadata\_csum filesystem
+       the administrator to change the UUID of a metadata_csum filesystem
        while the filesystem is mounted; without it, the checksum definition
-       requires all metadata blocks to be rewritten (INCOMPAT\_CSUM\_SEED).
+       requires all metadata blocks to be rewritten (INCOMPAT_CSUM_SEED).
    * - 0x4000
-     - Large directory >2GB or 3-level htree (INCOMPAT\_LARGEDIR). Prior to
+     - Large directory >2GB or 3-level htree (INCOMPAT_LARGEDIR). Prior to
        this feature, directories could not be larger than 4GiB and could not
        have an htree more than 2 levels deep. If this feature is enabled,
        directories can be larger than 4GiB and have a maximum htree depth of 3.
    * - 0x8000
-     - Data in inode (INCOMPAT\_INLINE\_DATA).
+     - Data in inode (INCOMPAT_INLINE_DATA).
    * - 0x10000
-     - Encrypted inodes are present on the filesystem. (INCOMPAT\_ENCRYPT).
+     - Encrypted inodes are present on the filesystem. (INCOMPAT_ENCRYPT).
 
 .. _super_rocompat:
 
@@ -678,54 +678,54 @@ the following:
      - Description
    * - 0x1
      - Sparse superblocks. See the earlier discussion of this feature
-       (RO\_COMPAT\_SPARSE\_SUPER).
+       (RO_COMPAT_SPARSE_SUPER).
    * - 0x2
      - This filesystem has been used to store a file greater than 2GiB
-       (RO\_COMPAT\_LARGE\_FILE).
+       (RO_COMPAT_LARGE_FILE).
    * - 0x4
-     - Not used in kernel or e2fsprogs (RO\_COMPAT\_BTREE\_DIR).
+     - Not used in kernel or e2fsprogs (RO_COMPAT_BTREE_DIR).
    * - 0x8
      - This filesystem has files whose sizes are represented in units of
        logical blocks, not 512-byte sectors. This implies a very large file
-       indeed! (RO\_COMPAT\_HUGE\_FILE)
+       indeed! (RO_COMPAT_HUGE_FILE)
    * - 0x10
      - Group descriptors have checksums. In addition to detecting corruption,
        this is useful for lazy formatting with uninitialized groups
-       (RO\_COMPAT\_GDT\_CSUM).
+       (RO_COMPAT_GDT_CSUM).
    * - 0x20
      - Indicates that the old ext3 32,000 subdirectory limit no longer applies
-       (RO\_COMPAT\_DIR\_NLINK). A directory's i\_links\_count will be set to 1
+       (RO_COMPAT_DIR_NLINK). A directory's i_links_count will be set to 1
        if it is incremented past 64,999.
    * - 0x40
      - Indicates that large inodes exist on this filesystem
-       (RO\_COMPAT\_EXTRA\_ISIZE).
+       (RO_COMPAT_EXTRA_ISIZE).
    * - 0x80
-     - This filesystem has a snapshot (RO\_COMPAT\_HAS\_SNAPSHOT).
+     - This filesystem has a snapshot (RO_COMPAT_HAS_SNAPSHOT).
    * - 0x100
-     - `Quota <Quota>`__ (RO\_COMPAT\_QUOTA).
+     - `Quota <Quota>`__ (RO_COMPAT_QUOTA).
    * - 0x200
      - This filesystem supports “bigalloc”, which means that file extents are
        tracked in units of clusters (of blocks) instead of blocks
-       (RO\_COMPAT\_BIGALLOC).
+       (RO_COMPAT_BIGALLOC).
    * - 0x400
      - This filesystem supports metadata checksumming.
-       (RO\_COMPAT\_METADATA\_CSUM; implies RO\_COMPAT\_GDT\_CSUM, though
-       GDT\_CSUM must not be set)
+       (RO_COMPAT_METADATA_CSUM; implies RO_COMPAT_GDT_CSUM, though
+       GDT_CSUM must not be set)
    * - 0x800
      - Filesystem supports replicas. This feature is neither in the kernel nor
-       e2fsprogs. (RO\_COMPAT\_REPLICA)
+       e2fsprogs. (RO_COMPAT_REPLICA)
    * - 0x1000
      - Read-only filesystem image; the kernel will not mount this image
        read-write and most tools will refuse to write to the image.
-       (RO\_COMPAT\_READONLY)
+       (RO_COMPAT_READONLY)
    * - 0x2000
-     - Filesystem tracks project quotas. (RO\_COMPAT\_PROJECT)
+     - Filesystem tracks project quotas. (RO_COMPAT_PROJECT)
    * - 0x8000
-     - Verity inodes may be present on the filesystem. (RO\_COMPAT\_VERITY)
+     - Verity inodes may be present on the filesystem. (RO_COMPAT_VERITY)
    * - 0x10000
      - Indicates orphan file may have valid orphan entries and thus we need
        to clean them up when mounting the filesystem
-       (RO\_COMPAT\_ORPHAN\_PRESENT).
+       (RO_COMPAT_ORPHAN_PRESENT).
 
 .. _super_def_hash:
 
@@ -761,36 +761,36 @@ The ``s_default_mount_opts`` field is any combination of the following:
    * - Value
      - Description
    * - 0x0001
-     - Print debugging info upon (re)mount. (EXT4\_DEFM\_DEBUG)
+     - Print debugging info upon (re)mount. (EXT4_DEFM_DEBUG)
    * - 0x0002
      - New files take the gid of the containing directory (instead of the fsgid
-       of the current process). (EXT4\_DEFM\_BSDGROUPS)
+       of the current process). (EXT4_DEFM_BSDGROUPS)
    * - 0x0004
-     - Support userspace-provided extended attributes. (EXT4\_DEFM\_XATTR\_USER)
+     - Support userspace-provided extended attributes. (EXT4_DEFM_XATTR_USER)
    * - 0x0008
-     - Support POSIX access control lists (ACLs). (EXT4\_DEFM\_ACL)
+     - Support POSIX access control lists (ACLs). (EXT4_DEFM_ACL)
    * - 0x0010
-     - Do not support 32-bit UIDs. (EXT4\_DEFM\_UID16)
+     - Do not support 32-bit UIDs. (EXT4_DEFM_UID16)
    * - 0x0020
      - All data and metadata are commited to the journal.
-       (EXT4\_DEFM\_JMODE\_DATA)
+       (EXT4_DEFM_JMODE_DATA)
    * - 0x0040
      - All data are flushed to the disk before metadata are committed to the
-       journal. (EXT4\_DEFM\_JMODE\_ORDERED)
+       journal. (EXT4_DEFM_JMODE_ORDERED)
    * - 0x0060
      - Data ordering is not preserved; data may be written after the metadata
-       has been written. (EXT4\_DEFM\_JMODE\_WBACK)
+       has been written. (EXT4_DEFM_JMODE_WBACK)
    * - 0x0100
-     - Disable write flushes. (EXT4\_DEFM\_NOBARRIER)
+     - Disable write flushes. (EXT4_DEFM_NOBARRIER)
    * - 0x0200
      - Track which blocks in a filesystem are metadata and therefore should not
        be used as data blocks. This option will be enabled by default on 3.18,
-       hopefully. (EXT4\_DEFM\_BLOCK\_VALIDITY)
+       hopefully. (EXT4_DEFM_BLOCK_VALIDITY)
    * - 0x0400
      - Enable DISCARD support, where the storage device is told about blocks
-       becoming unused. (EXT4\_DEFM\_DISCARD)
+       becoming unused. (EXT4_DEFM_DISCARD)
    * - 0x0800
-     - Disable delayed allocation. (EXT4\_DEFM\_NODELALLOC)
+     - Disable delayed allocation. (EXT4_DEFM_NODELALLOC)
 
 .. _super_flags:
 
@@ -820,12 +820,12 @@ The ``s_encrypt_algos`` list can contain any of the following:
    * - Value
      - Description
    * - 0
-     - Invalid algorithm (ENCRYPTION\_MODE\_INVALID).
+     - Invalid algorithm (ENCRYPTION_MODE_INVALID).
    * - 1
-     - 256-bit AES in XTS mode (ENCRYPTION\_MODE\_AES\_256\_XTS).
+     - 256-bit AES in XTS mode (ENCRYPTION_MODE_AES_256_XTS).
    * - 2
-     - 256-bit AES in GCM mode (ENCRYPTION\_MODE\_AES\_256\_GCM).
+     - 256-bit AES in GCM mode (ENCRYPTION_MODE_AES_256_GCM).
    * - 3
-     - 256-bit AES in CBC mode (ENCRYPTION\_MODE\_AES\_256\_CBC).
+     - 256-bit AES in CBC mode (ENCRYPTION_MODE_AES_256_CBC).
 
 Total size of the superblock is 1024 bytes.
index a80a599..4d19b19 100644 (file)
@@ -37,30 +37,31 @@ The network filesystem helper library needs a place to store a bit of state for
 its use on each netfs inode it is helping to manage.  To this end, a context
 structure is defined::
 
-       struct netfs_i_context {
+       struct netfs_inode {
+               struct inode inode;
                const struct netfs_request_ops *ops;
-               struct fscache_cookie   *cache;
+               struct fscache_cookie *cache;
        };
 
-A network filesystem that wants to use netfs lib must place one of these
-directly after the VFS ``struct inode`` it allocates, usually as part of its
-own struct.  This can be done in a way similar to the following::
+A network filesystem that wants to use netfs lib must place one of these in its
+inode wrapper struct instead of the VFS ``struct inode``.  This can be done in
+a way similar to the following::
 
        struct my_inode {
-               struct {
-                       /* These must be contiguous */
-                       struct inode            vfs_inode;
-                       struct netfs_i_context  netfs_ctx;
-               };
+               struct netfs_inode netfs; /* Netfslib context and vfs inode */
                ...
        };
 
-This allows netfslib to find its state by simple offset from the inode pointer,
-thereby allowing the netfslib helper functions to be pointed to directly by the
-VFS/VM operation tables.
+This allows netfslib to find its state by using ``container_of()`` from the
+inode pointer, thereby allowing the netfslib helper functions to be pointed to
+directly by the VFS/VM operation tables.
 
 The structure contains the following fields:
 
+ * ``inode``
+
+   The VFS inode structure.
+
  * ``ops``
 
    The set of operations provided by the network filesystem to netfslib.
@@ -78,19 +79,17 @@ To help deal with the per-inode context, a number helper functions are
 provided.  Firstly, a function to perform basic initialisation on a context and
 set the operations table pointer::
 
-       void netfs_i_context_init(struct inode *inode,
-                                 const struct netfs_request_ops *ops);
+       void netfs_inode_init(struct netfs_inode *ctx,
+                             const struct netfs_request_ops *ops);
 
-then two functions to cast between the VFS inode structure and the netfs
-context::
+then a function to cast from the VFS inode structure to the netfs context::
 
-       struct netfs_i_context *netfs_i_context(struct inode *inode);
-       struct inode *netfs_inode(struct netfs_i_context *ctx);
+       struct netfs_inode *netfs_node(struct inode *inode);
 
 and finally, a function to get the cache cookie pointer from the context
 attached to an inode (or NULL if fscache is disabled)::
 
-       struct fscache_cookie *netfs_i_cookie(struct inode *inode);
+       struct fscache_cookie *netfs_i_cookie(struct netfs_inode *ctx);
 
 
 Buffered Read Helpers
@@ -137,8 +136,9 @@ Three read helpers are provided::
 
        void netfs_readahead(struct readahead_control *ractl);
        int netfs_read_folio(struct file *file,
-                          struct folio *folio);
-       int netfs_write_begin(struct file *file,
+                            struct folio *folio);
+       int netfs_write_begin(struct netfs_inode *ctx,
+                             struct file *file,
                              struct address_space *mapping,
                              loff_t pos,
                              unsigned int len,
@@ -158,9 +158,10 @@ The helpers manage the read request, calling back into the network filesystem
 through the suppplied table of operations.  Waits will be performed as
 necessary before returning for helpers that are meant to be synchronous.
 
-If an error occurs and netfs_priv is non-NULL, ops->cleanup() will be called to
-deal with it.  If some parts of the request are in progress when an error
-occurs, the request will get partially completed if sufficient data is read.
+If an error occurs, the ->free_request() will be called to clean up the
+netfs_io_request struct allocated.  If some parts of the request are in
+progress when an error occurs, the request will get partially completed if
+sufficient data is read.
 
 Additionally, there is::
 
@@ -208,8 +209,7 @@ The above fields are the ones the netfs can use.  They are:
  * ``netfs_priv``
 
    The network filesystem's private data.  The value for this can be passed in
-   to the helper functions or set during the request.  The ->cleanup() op will
-   be called if this is non-NULL at the end.
+   to the helper functions or set during the request.
 
  * ``start``
  * ``len``
@@ -294,6 +294,7 @@ through which it can issue requests and negotiate::
 
        struct netfs_request_ops {
                void (*init_request)(struct netfs_io_request *rreq, struct file *file);
+               void (*free_request)(struct netfs_io_request *rreq);
                int (*begin_cache_operation)(struct netfs_io_request *rreq);
                void (*expand_readahead)(struct netfs_io_request *rreq);
                bool (*clamp_length)(struct netfs_io_subrequest *subreq);
@@ -302,7 +303,6 @@ through which it can issue requests and negotiate::
                int (*check_write_begin)(struct file *file, loff_t pos, unsigned len,
                                         struct folio *folio, void **_fsdata);
                void (*done)(struct netfs_io_request *rreq);
-               void (*cleanup)(struct address_space *mapping, void *netfs_priv);
        };
 
 The operations are as follows:
@@ -310,7 +310,12 @@ The operations are as follows:
  * ``init_request()``
 
    [Optional] This is called to initialise the request structure.  It is given
-   the file for reference and can modify the ->netfs_priv value.
+   the file for reference.
+
+ * ``free_request()``
+
+   [Optional] This is called as the request is being deallocated so that the
+   filesystem can clean up any state it has attached there.
 
  * ``begin_cache_operation()``
 
@@ -384,11 +389,6 @@ The operations are as follows:
    [Optional] This is called after the folios in the request have all been
    unlocked (and marked uptodate if applicable).
 
- * ``cleanup``
-
-   [Optional] This is called as the request is being deallocated so that the
-   filesystem can clean up ->netfs_priv.
-
 
 
 Read Helper Procedure
diff --git a/Documentation/hte/hte.rst b/Documentation/hte/hte.rst
deleted file mode 100644 (file)
index 153f323..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0+
-
-============================================
-The Linux Hardware Timestamping Engine (HTE)
-============================================
-
-:Author: Dipen Patel
-
-Introduction
-------------
-
-Certain devices have built in hardware timestamping engines which can
-monitor sets of system signals, lines, buses etc... in realtime for state
-change; upon detecting the change they can automatically store the timestamp at
-the moment of occurrence. Such functionality may help achieve better accuracy
-in obtaining timestamps than using software counterparts i.e. ktime and
-friends.
-
-This document describes the API that can be used by hardware timestamping
-engine provider and consumer drivers that want to use the hardware timestamping
-engine (HTE) framework. Both consumers and providers must include
-``#include <linux/hte.h>``.
-
-The HTE framework APIs for the providers
-----------------------------------------
-
-.. kernel-doc:: drivers/hte/hte.c
-   :functions: devm_hte_register_chip hte_push_ts_ns
-
-The HTE framework APIs for the consumers
-----------------------------------------
-
-.. kernel-doc:: drivers/hte/hte.c
-   :functions: hte_init_line_attr hte_ts_get hte_ts_put devm_hte_request_ts_ns hte_request_ts_ns hte_enable_ts hte_disable_ts of_hte_req_count hte_get_clk_src_info
-
-The HTE framework public structures
------------------------------------
-.. kernel-doc:: include/linux/hte.h
-
-More on the HTE timestamp data
-------------------------------
-The ``struct hte_ts_data`` is used to pass timestamp details between the
-consumers and the providers. It expresses timestamp data in nanoseconds in
-u64. An example of the typical timestamp data life cycle, for the GPIO line is
-as follows::
-
- - Monitors GPIO line change.
- - Detects the state change on GPIO line.
- - Converts timestamps in nanoseconds.
- - Stores GPIO raw level in raw_level variable if the provider has that
- hardware capability.
- - Pushes this hte_ts_data object to HTE subsystem.
- - HTE subsystem increments seq counter and invokes consumer provided callback.
- Based on callback return value, the HTE core invokes secondary callback in
- the thread context.
-
-HTE subsystem debugfs attributes
---------------------------------
-HTE subsystem creates debugfs attributes at ``/sys/kernel/debug/hte/``.
-It also creates line/signal-related debugfs attributes at
-``/sys/kernel/debug/hte/<provider>/<label or line id>/``. Note that these
-attributes are read-only.
-
-`ts_requested`
-               The total number of entities requested from the given provider,
-               where entity is specified by the provider and could represent
-               lines, GPIO, chip signals, buses etc...
-                The attribute will be available at
-               ``/sys/kernel/debug/hte/<provider>/``.
-
-`total_ts`
-               The total number of entities supported by the provider.
-                The attribute will be available at
-               ``/sys/kernel/debug/hte/<provider>/``.
-
-`dropped_timestamps`
-               The dropped timestamps for a given line.
-                The attribute will be available at
-               ``/sys/kernel/debug/hte/<provider>/<label or line id>/``.
diff --git a/Documentation/hte/index.rst b/Documentation/hte/index.rst
deleted file mode 100644 (file)
index 9f43301..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0
-
-============================================
-The Linux Hardware Timestamping Engine (HTE)
-============================================
-
-The HTE Subsystem
-=================
-
-.. toctree::
-   :maxdepth: 1
-
-   hte
-
-HTE Tegra Provider
-==================
-
-.. toctree::
-   :maxdepth: 1
-
-   tegra194-hte
-
diff --git a/Documentation/hte/tegra194-hte.rst b/Documentation/hte/tegra194-hte.rst
deleted file mode 100644 (file)
index 41983e0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0+
-
-HTE Kernel provider driver
-==========================
-
-Description
------------
-The Nvidia tegra194 HTE provider driver implements two GTE
-(Generic Timestamping Engine) instances: 1) GPIO GTE and 2) LIC
-(Legacy Interrupt Controller) IRQ GTE. Both GTE instances get the
-timestamp from the system counter TSC which has 31.25MHz clock rate, and the
-driver converts clock tick rate to nanoseconds before storing it as timestamp
-value.
-
-GPIO GTE
---------
-
-This GTE instance timestamps GPIO in real time. For that to happen GPIO
-needs to be configured as input. The always on (AON) GPIO controller instance
-supports timestamping GPIOs in real time and it has 39 GPIO lines. The GPIO GTE
-and AON GPIO controller are tightly coupled as it requires very specific bits
-to be set in GPIO config register before GPIO GTE can be used, for that GPIOLIB
-adds two optional APIs as below. The GPIO GTE code supports both kernel
-and userspace consumers. The kernel space consumers can directly talk to HTE
-subsystem while userspace consumers timestamp requests go through GPIOLIB CDEV
-framework to HTE subsystem.
-
-.. kernel-doc:: drivers/gpio/gpiolib.c
-   :functions: gpiod_enable_hw_timestamp_ns gpiod_disable_hw_timestamp_ns
-
-For userspace consumers, GPIO_V2_LINE_FLAG_EVENT_CLOCK_HTE flag must be
-specified during IOCTL calls. Refer to ``tools/gpio/gpio-event-mon.c``, which
-returns the timestamp in nanoseconds.
-
-LIC (Legacy Interrupt Controller) IRQ GTE
------------------------------------------
-
-This GTE instance timestamps LIC IRQ lines in real time. There are 352 IRQ
-lines which this instance can add timestamps to in real time. The hte
-devicetree binding described at ``Documentation/devicetree/bindings/hte/``
-provides an example of how a consumer can request an IRQ line. Since it is a
-one-to-one mapping with IRQ GTE provider, consumers can simply specify the IRQ
-number that they are interested in. There is no userspace consumer support for
-this GTE instance in the HTE framework.
-
-The provider source code of both IRQ and GPIO GTE instances is located at
-``drivers/hte/hte-tegra194.c``. The test driver
-``drivers/hte/hte-tegra194-test.c`` demonstrates HTE API usage for both IRQ
-and GPIO GTE.
index 8f9be0e..67036a0 100644 (file)
@@ -137,7 +137,6 @@ needed).
    scheduler/index
    mhi/index
    peci/index
-   hte/index
 
 Architecture-agnostic documentation
 -----------------------------------
index b854bb4..6b2bac8 100644 (file)
@@ -129,18 +129,24 @@ yet. Bug reports are always welcome at the issue tracker below!
    * - arm64
      - Supported
      - ``LLVM=1``
+   * - hexagon
+     - Maintained
+     - ``LLVM=1``
    * - mips
      - Maintained
-     - ``CC=clang``
+     - ``LLVM=1``
    * - powerpc
      - Maintained
      - ``CC=clang``
    * - riscv
      - Maintained
-     - ``CC=clang``
+     - ``LLVM=1``
    * - s390
      - Maintained
      - ``CC=clang``
+   * - um (User Mode)
+     - Maintained
+     - ``LLVM=1``
    * - x86
      - Supported
      - ``LLVM=1``
index 2bf40ad..216b3f3 100644 (file)
@@ -45,10 +45,12 @@ Name              Alias           Usage               Preserved
 ``$r23``-``$r31`` ``$s0``-``$s8`` Static registers    Yes
 ================= =============== =================== ============
 
-Note: The register ``$r21`` is reserved in the ELF psABI, but used by the Linux
-kernel for storing the percpu base address. It normally has no ABI name, but is
-called ``$u0`` in the kernel. You may also see ``$v0`` or ``$v1`` in some old code,
-however they are deprecated aliases of ``$a0`` and ``$a1`` respectively.
+.. Note::
+    The register ``$r21`` is reserved in the ELF psABI, but used by the Linux
+    kernel for storing the percpu base address. It normally has no ABI name,
+    but is called ``$u0`` in the kernel. You may also see ``$v0`` or ``$v1``
+    in some old code,however they are deprecated aliases of ``$a0`` and ``$a1``
+    respectively.
 
 FPRs
 ----
@@ -69,8 +71,9 @@ Name              Alias              Usage               Preserved
 ``$f24``-``$f31`` ``$fs0``-``$fs7``  Static registers    Yes
 ================= ================== =================== ============
 
-Note: You may see ``$fv0`` or ``$fv1`` in some old code, however they are deprecated
-aliases of ``$fa0`` and ``$fa1`` respectively.
+.. Note::
+    You may see ``$fv0`` or ``$fv1`` in some old code, however they are
+    deprecated aliases of ``$fa0`` and ``$fa1`` respectively.
 
 VRs
 ----
index 8d88f7a..7988f41 100644 (file)
@@ -145,12 +145,16 @@ Documentation of Loongson's LS7A chipset:
 
   https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-7A1000-usermanual-2.00-EN.pdf (in English)
 
-Note: CPUINTC is CSR.ECFG/CSR.ESTAT and its interrupt controller described
-in Section 7.4 of "LoongArch Reference Manual, Vol 1"; LIOINTC is "Legacy I/O
-Interrupts" described in Section 11.1 of "Loongson 3A5000 Processor Reference
-Manual"; EIOINTC is "Extended I/O Interrupts" described in Section 11.2 of
-"Loongson 3A5000 Processor Reference Manual"; HTVECINTC is "HyperTransport
-Interrupts" described in Section 14.3 of "Loongson 3A5000 Processor Reference
-Manual"; PCH-PIC/PCH-MSI is "Interrupt Controller" described in Section 5 of
-"Loongson 7A1000 Bridge User Manual"; PCH-LPC is "LPC Interrupts" described in
-Section 24.3 of "Loongson 7A1000 Bridge User Manual".
+.. Note::
+    - CPUINTC is CSR.ECFG/CSR.ESTAT and its interrupt controller described
+      in Section 7.4 of "LoongArch Reference Manual, Vol 1";
+    - LIOINTC is "Legacy I/OInterrupts" described in Section 11.1 of
+      "Loongson 3A5000 Processor Reference Manual";
+    - EIOINTC is "Extended I/O Interrupts" described in Section 11.2 of
+      "Loongson 3A5000 Processor Reference Manual";
+    - HTVECINTC is "HyperTransport Interrupts" described in Section 14.3 of
+      "Loongson 3A5000 Processor Reference Manual";
+    - PCH-PIC/PCH-MSI is "Interrupt Controller" described in Section 5 of
+      "Loongson 7A1000 Bridge User Manual";
+    - PCH-LPC is "LPC Interrupts" described in Section 24.3 of
+      "Loongson 7A1000 Bridge User Manual".
index 0421656..9f41961 100644 (file)
@@ -2925,6 +2925,43 @@ plpmtud_probe_interval - INTEGER
 
        Default: 0
 
+reconf_enable - BOOLEAN
+        Enable or disable extension of Stream Reconfiguration functionality
+        specified in RFC6525. This extension provides the ability to "reset"
+        a stream, and it includes the Parameters of "Outgoing/Incoming SSN
+        Reset", "SSN/TSN Reset" and "Add Outgoing/Incoming Streams".
+
+       - 1: Enable extension.
+       - 0: Disable extension.
+
+       Default: 0
+
+intl_enable - BOOLEAN
+        Enable or disable extension of User Message Interleaving functionality
+        specified in RFC8260. This extension allows the interleaving of user
+        messages sent on different streams. With this feature enabled, I-DATA
+        chunk will replace DATA chunk to carry user messages if also supported
+        by the peer. Note that to use this feature, one needs to set this option
+        to 1 and also needs to set socket options SCTP_FRAGMENT_INTERLEAVE to 2
+        and SCTP_INTERLEAVING_SUPPORTED to 1.
+
+       - 1: Enable extension.
+       - 0: Disable extension.
+
+       Default: 0
+
+ecn_enable - BOOLEAN
+        Control use of Explicit Congestion Notification (ECN) by SCTP.
+        Like in TCP, ECN is used only when both ends of the SCTP connection
+        indicate support for it. This feature is useful in avoiding losses
+        due to congestion by allowing supporting routers to signal congestion
+        before having to drop packets.
+
+        1: Enable ecn.
+        0: Disable ecn.
+
+        Default: 1
+
 
 ``/proc/sys/net/core/*``
 ========================
index d43da70..704f31d 100644 (file)
@@ -104,7 +104,7 @@ Whenever possible, use the PHY side RGMII delay for these reasons:
 
 * PHY device drivers in PHYLIB being reusable by nature, being able to
   configure correctly a specified delay enables more designs with similar delay
-  requirements to be operate correctly
+  requirements to be operated correctly
 
 For cases where the PHY is not capable of providing this delay, but the
 Ethernet MAC driver is capable of doing so, the correct phy_interface_t value
index 34415ae..19c286c 100644 (file)
@@ -32,6 +32,7 @@ you probably needn't concern yourself with pcmciautils.
 GNU C                  5.1              gcc --version
 Clang/LLVM (optional)  11.0.0           clang --version
 GNU make               3.81             make --version
+bash                   4.2              bash --version
 binutils               2.23             ld -v
 flex                   2.5.35           flex --version
 bison                  2.0              bison --version
@@ -84,6 +85,12 @@ Make
 
 You will need GNU make 3.81 or later to build the kernel.
 
+Bash
+----
+
+Some bash scripts are used for the kernel build.
+Bash 4.2 or newer is needed.
+
 Binutils
 --------
 
@@ -362,6 +369,11 @@ Make
 
 - <ftp://ftp.gnu.org/gnu/make/>
 
+Bash
+----
+
+- <ftp://ftp.gnu.org/gnu/bash/>
+
 Binutils
 --------
 
index e31a1a9..11686ee 100644 (file)
@@ -46,10 +46,11 @@ LA64中每个寄存器为64位宽。 ``$r0`` 的内容总是固定为0,而其
 ``$r23``-``$r31`` ``$s0``-``$s8`` 静态寄存器          是
 ================= =============== =================== ==========
 
-注意:``$r21``寄存器在ELF psABI中保留未使用,但是在Linux内核用于保存每CPU
-变量基地址。该寄存器没有ABI命名,不过在内核中称为``$u0``。在一些遗留代码
-中有时可能见到``$v0``和``$v1``,它们是``$a0``和``$a1``的别名,属于已经废弃
-的用法。
+.. note::
+    注意: ``$r21`` 寄存器在ELF psABI中保留未使用,但是在Linux内核用于保
+    存每CPU变量基地址。该寄存器没有ABI命名,不过在内核中称为 ``$u0`` 。在
+    一些遗留代码中有时可能见到 ``$v0`` 和 ``$v1`` ,它们是 ``$a0`` 和
+    ``$a1`` 的别名,属于已经废弃的用法。
 
 浮点寄存器
 ----------
@@ -68,8 +69,9 @@ LA64中每个寄存器为64位宽。 ``$r0`` 的内容总是固定为0,而其
 ``$f24``-``$f31`` ``$fs0``-``$fs7``  静态寄存器          是
 ================= ================== =================== ==========
 
-注意:在一些遗留代码中有时可能见到 ``$v0`` 和 ``$v1`` ,它们是 ``$a0``
-和 ``$a1`` 的别名,属于已经废弃的用法。
+.. note::
+    注意:在一些遗留代码中有时可能见到 ``$v0`` 和 ``$v1`` ,它们是
+    ``$a0`` 和 ``$a1`` 的别名,属于已经废弃的用法。
 
 
 向量寄存器
index 2a4c3ad..fb5d23b 100644 (file)
@@ -147,9 +147,11 @@ PCH-LPC::
 
   https://github.com/loongson/LoongArch-Documentation/releases/latest/download/Loongson-7A1000-usermanual-2.00-EN.pdf (英文版)
 
-注:CPUINTC即《龙芯架构参考手册卷一》第7.4节所描述的CSR.ECFG/CSR.ESTAT寄存器及其中断
-控制逻辑;LIOINTC即《龙芯3A5000处理器使用手册》第11.1节所描述的“传统I/O中断”;EIOINTC
-即《龙芯3A5000处理器使用手册》第11.2节所描述的“扩展I/O中断”;HTVECINTC即《龙芯3A5000
-处理器使用手册》第14.3节所描述的“HyperTransport中断”;PCH-PIC/PCH-MSI即《龙芯7A1000桥
-片用户手册》第5章所描述的“中断控制器”;PCH-LPC即《龙芯7A1000桥片用户手册》第24.3节所
-描述的“LPC中断”。
+.. note::
+    - CPUINTC:即《龙芯架构参考手册卷一》第7.4节所描述的CSR.ECFG/CSR.ESTAT寄存器及其
+      中断控制逻辑;
+    - LIOINTC:即《龙芯3A5000处理器使用手册》第11.1节所描述的“传统I/O中断”;
+    - EIOINTC:即《龙芯3A5000处理器使用手册》第11.2节所描述的“扩展I/O中断”;
+    - HTVECINTC:即《龙芯3A5000处理器使用手册》第14.3节所描述的“HyperTransport中断”;
+    - PCH-PIC/PCH-MSI:即《龙芯7A1000桥片用户手册》第5章所描述的“中断控制器”;
+    - PCH-LPC:即《龙芯7A1000桥片用户手册》第24.3节所描述的“LPC中断”。
index b0bd510..6d5ec1e 100644 (file)
@@ -42,7 +42,7 @@ if usbmon is built into the kernel::
        # modprobe usbmon
        #
 
-Verify that bus sockets are present:
+Verify that bus sockets are present::
 
        # ls /sys/kernel/debug/usb/usbmon
        0s  0u  1s  1t  1u  2s  2t  2u  3s  3t  3u  4s  4t  4u
index c742de1..b9d5253 100644 (file)
@@ -120,7 +120,8 @@ Testing
   unpoison-pfn
        Software-unpoison page at PFN echoed into this file. This way
        a page can be reused again.  This only works for Linux
-       injected failures, not for real memory failures.
+       injected failures, not for real memory failures. Once any hardware
+       memory failure happens, this feature is disabled.
 
   Note these injection interfaces are not stable and might change between
   kernel versions
index a6d3bd9..7541206 100644 (file)
@@ -427,6 +427,7 @@ ACPI VIOT DRIVER
 M:     Jean-Philippe Brucker <jean-philippe@linaro.org>
 L:     linux-acpi@vger.kernel.org
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Maintained
 F:     drivers/acpi/viot.c
 F:     include/linux/acpi_viot.h
@@ -960,6 +961,7 @@ AMD IOMMU (AMD-VI)
 M:     Joerg Roedel <joro@8bytes.org>
 R:     Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 F:     drivers/iommu/amd/
@@ -1507,7 +1509,7 @@ F:        drivers/clocksource/arm_arch_timer.c
 ARM HDLCD DRM DRIVER
 M:     Liviu Dudau <liviu.dudau@arm.com>
 S:     Supported
-F:     Documentation/devicetree/bindings/display/arm,hdlcd.txt
+F:     Documentation/devicetree/bindings/display/arm,hdlcd.yaml
 F:     drivers/gpu/drm/arm/hdlcd_*
 
 ARM INTEGRATOR, VERSATILE AND REALVIEW SUPPORT
@@ -1542,7 +1544,7 @@ M:        Mihail Atanassov <mihail.atanassov@arm.com>
 L:     Mali DP Maintainers <malidp@foss.arm.com>
 S:     Supported
 T:     git git://anongit.freedesktop.org/drm/drm-misc
-F:     Documentation/devicetree/bindings/display/arm,komeda.txt
+F:     Documentation/devicetree/bindings/display/arm,komeda.yaml
 F:     Documentation/gpu/komeda-kms.rst
 F:     drivers/gpu/drm/arm/display/include/
 F:     drivers/gpu/drm/arm/display/komeda/
@@ -1564,7 +1566,7 @@ M:        Brian Starkey <brian.starkey@arm.com>
 L:     Mali DP Maintainers <malidp@foss.arm.com>
 S:     Supported
 T:     git git://anongit.freedesktop.org/drm/drm-misc
-F:     Documentation/devicetree/bindings/display/arm,malidp.txt
+F:     Documentation/devicetree/bindings/display/arm,malidp.yaml
 F:     Documentation/gpu/afbc.rst
 F:     drivers/gpu/drm/arm/
 
@@ -1893,6 +1895,7 @@ L:        linux-aspeed@lists.ozlabs.org (moderated for non-subscribers)
 S:     Supported
 Q:     https://patchwork.ozlabs.org/project/linux-aspeed/list/
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed.git
+F:     Documentation/devicetree/bindings/arm/aspeed/
 F:     arch/arm/boot/dts/aspeed-*
 F:     arch/arm/mach-aspeed/
 N:     aspeed
@@ -2009,7 +2012,7 @@ L:        linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 T:     git git://github.com/ulli-kroll/linux.git
 F:     Documentation/devicetree/bindings/arm/gemini.yaml
-F:     Documentation/devicetree/bindings/net/cortina,gemini-ethernet.txt
+F:     Documentation/devicetree/bindings/net/cortina,gemini-ethernet.yaml
 F:     Documentation/devicetree/bindings/pinctrl/cortina,gemini-pinctrl.txt
 F:     Documentation/devicetree/bindings/rtc/faraday,ftrtc010.yaml
 F:     arch/arm/boot/dts/gemini*
@@ -2467,6 +2470,7 @@ ARM/NXP S32G ARCHITECTURE
 M:     Chester Lin <clin@suse.com>
 R:     Andreas Färber <afaerber@suse.de>
 R:     Matthias Brugger <mbrugger@suse.com>
+R:     NXP S32 Linux Team <s32@nxp.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm64/boot/dts/freescale/s32g*.dts*
@@ -2537,6 +2541,7 @@ W:        http://www.armlinux.org.uk/
 ARM/QUALCOMM SUPPORT
 M:     Andy Gross <agross@kernel.org>
 M:     Bjorn Andersson <bjorn.andersson@linaro.org>
+R:     Konrad Dybcio <konrad.dybcio@somainline.org>
 L:     linux-arm-msm@vger.kernel.org
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git
@@ -2615,6 +2620,8 @@ 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:     Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml
+F:     Documentation/devicetree/bindings/soc/renesas/
 F:     arch/arm64/boot/dts/renesas/
 F:     drivers/soc/renesas/
 F:     include/linux/soc/renesas/
@@ -2733,6 +2740,7 @@ 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:     Documentation/devicetree/bindings/soc/renesas/
 F:     arch/arm/boot/dts/emev2*
 F:     arch/arm/boot/dts/gr-peach*
 F:     arch/arm/boot/dts/iwg20d-q7*
@@ -3662,7 +3670,7 @@ BPF JIT for ARM
 M:     Shubham Bansal <illusionist.neo@gmail.com>
 L:     netdev@vger.kernel.org
 L:     bpf@vger.kernel.org
-S:     Maintained
+S:     Odd Fixes
 F:     arch/arm/net/
 
 BPF JIT for ARM64
@@ -3686,14 +3694,15 @@ BPF JIT for NFP NICs
 M:     Jakub Kicinski <kuba@kernel.org>
 L:     netdev@vger.kernel.org
 L:     bpf@vger.kernel.org
-S:     Supported
+S:     Odd Fixes
 F:     drivers/net/ethernet/netronome/nfp/bpf/
 
 BPF JIT for POWERPC (32-BIT AND 64-BIT)
 M:     Naveen N. Rao <naveen.n.rao@linux.ibm.com>
+M:     Michael Ellerman <mpe@ellerman.id.au>
 L:     netdev@vger.kernel.org
 L:     bpf@vger.kernel.org
-S:     Maintained
+S:     Supported
 F:     arch/powerpc/net/
 
 BPF JIT for RISC-V (32-bit)
@@ -3719,7 +3728,7 @@ M:        Heiko Carstens <hca@linux.ibm.com>
 M:     Vasily Gorbik <gor@linux.ibm.com>
 L:     netdev@vger.kernel.org
 L:     bpf@vger.kernel.org
-S:     Maintained
+S:     Supported
 F:     arch/s390/net/
 X:     arch/s390/net/pnet.c
 
@@ -3727,14 +3736,14 @@ BPF JIT for SPARC (32-BIT AND 64-BIT)
 M:     David S. Miller <davem@davemloft.net>
 L:     netdev@vger.kernel.org
 L:     bpf@vger.kernel.org
-S:     Maintained
+S:     Odd Fixes
 F:     arch/sparc/net/
 
 BPF JIT for X86 32-BIT
 M:     Wang YanQing <udknight@gmail.com>
 L:     netdev@vger.kernel.org
 L:     bpf@vger.kernel.org
-S:     Maintained
+S:     Odd Fixes
 F:     arch/x86/net/bpf_jit_comp32.c
 
 BPF JIT for X86 64-BIT
@@ -3757,6 +3766,26 @@ F:       include/linux/bpf_lsm.h
 F:     kernel/bpf/bpf_lsm.c
 F:     security/bpf/
 
+BPF L7 FRAMEWORK
+M:     John Fastabend <john.fastabend@gmail.com>
+M:     Jakub Sitnicki <jakub@cloudflare.com>
+L:     netdev@vger.kernel.org
+L:     bpf@vger.kernel.org
+S:     Maintained
+F:     include/linux/skmsg.h
+F:     net/core/skmsg.c
+F:     net/core/sock_map.c
+F:     net/ipv4/tcp_bpf.c
+F:     net/ipv4/udp_bpf.c
+F:     net/unix/unix_bpf.c
+
+BPFTOOL
+M:     Quentin Monnet <quentin@isovalent.com>
+L:     bpf@vger.kernel.org
+S:     Maintained
+F:     kernel/bpf/disasm.*
+F:     tools/bpf/bpftool/
+
 BROADCOM B44 10/100 ETHERNET DRIVER
 M:     Michael Chan <michael.chan@broadcom.com>
 L:     netdev@vger.kernel.org
@@ -3789,12 +3818,12 @@ N:      bcmbca
 N:     bcm[9]?47622
 
 BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE
-M:     Nicolas Saenz Julienne <nsaenz@kernel.org>
+M:     Florian Fainelli <f.fainelli@gmail.com>
 R:     Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
 L:     linux-rpi-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/nsaenz/linux-rpi.git
+T:     git git://github.com/broadcom/stblinux.git
 F:     Documentation/devicetree/bindings/pci/brcm,stb-pcie.yaml
 F:     drivers/pci/controller/pcie-brcmstb.c
 F:     drivers/staging/vc04_services
@@ -5955,6 +5984,7 @@ M:        Christoph Hellwig <hch@lst.de>
 M:     Marek Szyprowski <m.szyprowski@samsung.com>
 R:     Robin Murphy <robin.murphy@arm.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Supported
 W:     http://git.infradead.org/users/hch/dma-mapping.git
 T:     git git://git.infradead.org/users/hch/dma-mapping.git
@@ -5967,6 +5997,7 @@ F:        kernel/dma/
 DMA MAPPING BENCHMARK
 M:     Xiang Chen <chenxiang66@hisilicon.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 F:     kernel/dma/map_benchmark.c
 F:     tools/testing/selftests/dma/
 
@@ -6078,7 +6109,7 @@ M:        Sakari Ailus <sakari.ailus@linux.intel.com>
 L:     linux-media@vger.kernel.org
 S:     Maintained
 T:     git git://linuxtv.org/media_tree.git
-F:     Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.txt
+F:     Documentation/devicetree/bindings/media/i2c/dongwoon,dw9807-vcm.yaml
 F:     drivers/media/i2c/dw9807-vcm.c
 
 DOUBLETALK DRIVER
@@ -7551,6 +7582,7 @@ F:        drivers/gpu/drm/exynos/exynos_dp*
 EXYNOS SYSMMU (IOMMU) driver
 M:     Marek Szyprowski <m.szyprowski@samsung.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Maintained
 F:     drivers/iommu/exynos-iommu.c
 
@@ -7647,6 +7679,7 @@ F:        include/uapi/scsi/fc/
 
 FILE LOCKING (flock() and fcntl()/lockf())
 M:     Jeff Layton <jlayton@kernel.org>
+M:     Chuck Lever <chuck.lever@oracle.com>
 L:     linux-fsdevel@vger.kernel.org
 S:     Maintained
 F:     fs/fcntl.c
@@ -8471,6 +8504,7 @@ F:        Documentation/devicetree/bindings/gpio/
 F:     Documentation/driver-api/gpio/
 F:     drivers/gpio/
 F:     include/asm-generic/gpio.h
+F:     include/dt-bindings/gpio/
 F:     include/linux/gpio.h
 F:     include/linux/gpio/
 F:     include/linux/of_gpio.h
@@ -9081,7 +9115,7 @@ HTE SUBSYSTEM
 M:     Dipen Patel <dipenp@nvidia.com>
 S:     Maintained
 F:     Documentation/devicetree/bindings/timestamp/
-F:     Documentation/hte/
+F:     Documentation/driver-api/hte/
 F:     drivers/hte/
 F:     include/linux/hte.h
 
@@ -9124,6 +9158,7 @@ F:        drivers/media/platform/st/sti/hva
 
 HWPOISON MEMORY FAILURE HANDLING
 M:     Naoya Horiguchi <naoya.horiguchi@nec.com>
+R:     Miaohe Lin <linmiaohe@huawei.com>
 L:     linux-mm@kvack.org
 S:     Maintained
 F:     mm/hwpoison-inject.c
@@ -9268,6 +9303,7 @@ T:        git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
 F:     Documentation/devicetree/bindings/i2c/i2c.txt
 F:     Documentation/i2c/
 F:     drivers/i2c/*
+F:     include/dt-bindings/i2c/i2c.h
 F:     include/linux/i2c-dev.h
 F:     include/linux/i2c-smbus.h
 F:     include/linux/i2c.h
@@ -9283,6 +9319,7 @@ T:        git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
 F:     Documentation/devicetree/bindings/i2c/
 F:     drivers/i2c/algos/
 F:     drivers/i2c/busses/
+F:     include/dt-bindings/i2c/
 
 I2C-TAOS-EVM DRIVER
 M:     Jean Delvare <jdelvare@suse.com>
@@ -9967,6 +10004,7 @@ INTEL IOMMU (VT-d)
 M:     David Woodhouse <dwmw2@infradead.org>
 M:     Lu Baolu <baolu.lu@linux.intel.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Supported
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 F:     drivers/iommu/intel/
@@ -10346,6 +10384,7 @@ IOMMU DRIVERS
 M:     Joerg Roedel <joro@8bytes.org>
 M:     Will Deacon <will@kernel.org>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 F:     Documentation/devicetree/bindings/iommu/
@@ -10739,6 +10778,7 @@ W:      http://kernelnewbies.org/KernelJanitors
 
 KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
 M:     Chuck Lever <chuck.lever@oracle.com>
+M:     Jeff Layton <jlayton@kernel.org>
 L:     linux-nfs@vger.kernel.org
 S:     Supported
 W:     http://nfs.sourceforge.net/
@@ -10821,6 +10861,7 @@ M:      Marc Zyngier <maz@kernel.org>
 R:     James Morse <james.morse@arm.com>
 R:     Alexandru Elisei <alexandru.elisei@arm.com>
 R:     Suzuki K Poulose <suzuki.poulose@arm.com>
+R:     Oliver Upton <oliver.upton@linux.dev>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     kvmarm@lists.cs.columbia.edu (moderated for non-subscribers)
 S:     Maintained
@@ -10863,7 +10904,6 @@ F:      arch/riscv/include/asm/kvm*
 F:     arch/riscv/include/uapi/asm/kvm*
 F:     arch/riscv/kvm/
 F:     tools/testing/selftests/kvm/*/riscv/
-F:     tools/testing/selftests/kvm/riscv/
 
 KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
 M:     Christian Borntraeger <borntraeger@linux.ibm.com>
@@ -10888,28 +10928,51 @@ F:    tools/testing/selftests/kvm/*/s390x/
 F:     tools/testing/selftests/kvm/s390x/
 
 KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
+M:     Sean Christopherson <seanjc@google.com>
 M:     Paolo Bonzini <pbonzini@redhat.com>
-R:     Sean Christopherson <seanjc@google.com>
-R:     Vitaly Kuznetsov <vkuznets@redhat.com>
-R:     Wanpeng Li <wanpengli@tencent.com>
-R:     Jim Mattson <jmattson@google.com>
-R:     Joerg Roedel <joro@8bytes.org>
 L:     kvm@vger.kernel.org
 S:     Supported
-W:     http://www.linux-kvm.org
 T:     git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
 F:     arch/x86/include/asm/kvm*
-F:     arch/x86/include/asm/pvclock-abi.h
 F:     arch/x86/include/asm/svm.h
 F:     arch/x86/include/asm/vmx*.h
 F:     arch/x86/include/uapi/asm/kvm*
 F:     arch/x86/include/uapi/asm/svm.h
 F:     arch/x86/include/uapi/asm/vmx.h
-F:     arch/x86/kernel/kvm.c
-F:     arch/x86/kernel/kvmclock.c
 F:     arch/x86/kvm/
 F:     arch/x86/kvm/*/
 
+KVM PARAVIRT (KVM/paravirt)
+M:     Paolo Bonzini <pbonzini@redhat.com>
+R:     Wanpeng Li <wanpengli@tencent.com>
+R:     Vitaly Kuznetsov <vkuznets@redhat.com>
+L:     kvm@vger.kernel.org
+S:     Supported
+T:     git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+F:     arch/x86/kernel/kvm.c
+F:     arch/x86/kernel/kvmclock.c
+F:     arch/x86/include/asm/pvclock-abi.h
+F:     include/linux/kvm_para.h
+F:     include/uapi/linux/kvm_para.h
+F:     include/uapi/asm-generic/kvm_para.h
+F:     include/asm-generic/kvm_para.h
+F:     arch/um/include/asm/kvm_para.h
+F:     arch/x86/include/asm/kvm_para.h
+F:     arch/x86/include/uapi/asm/kvm_para.h
+
+KVM X86 HYPER-V (KVM/hyper-v)
+M:     Vitaly Kuznetsov <vkuznets@redhat.com>
+M:     Sean Christopherson <seanjc@google.com>
+M:     Paolo Bonzini <pbonzini@redhat.com>
+L:     kvm@vger.kernel.org
+S:     Supported
+T:     git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
+F:     arch/x86/kvm/hyperv.*
+F:     arch/x86/kvm/kvm_onhyperv.*
+F:     arch/x86/kvm/svm/hyperv.*
+F:     arch/x86/kvm/svm/svm_onhyperv.*
+F:     arch/x86/kvm/vmx/evmcs.*
+
 KERNFS
 M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 M:     Tejun Heo <tj@kernel.org>
@@ -11088,20 +11151,6 @@ S:     Maintained
 F:     include/net/l3mdev.h
 F:     net/l3mdev
 
-L7 BPF FRAMEWORK
-M:     John Fastabend <john.fastabend@gmail.com>
-M:     Daniel Borkmann <daniel@iogearbox.net>
-M:     Jakub Sitnicki <jakub@cloudflare.com>
-L:     netdev@vger.kernel.org
-L:     bpf@vger.kernel.org
-S:     Maintained
-F:     include/linux/skmsg.h
-F:     net/core/skmsg.c
-F:     net/core/sock_map.c
-F:     net/ipv4/tcp_bpf.c
-F:     net/ipv4/udp_bpf.c
-F:     net/unix/unix_bpf.c
-
 LANDLOCK SECURITY MODULE
 M:     Mickaël Salaün <mic@digikod.net>
 L:     linux-security-module@vger.kernel.org
@@ -11257,6 +11306,7 @@ M:      Damien Le Moal <damien.lemoal@opensource.wdc.com>
 L:     linux-ide@vger.kernel.org
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata.git
+F:     Documentation/ABI/testing/sysfs-ata
 F:     Documentation/devicetree/bindings/ata/
 F:     drivers/ata/
 F:     include/linux/ata.h
@@ -11580,6 +11630,7 @@ F:      drivers/gpu/drm/bridge/lontium-lt8912b.c
 LOONGARCH
 M:     Huacai Chen <chenhuacai@kernel.org>
 R:     WANG Xuerui <kernel@xen0n.name>
+L:     loongarch@lists.linux.dev
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson.git
 F:     arch/loongarch/
@@ -12493,6 +12544,7 @@ F:      drivers/i2c/busses/i2c-mt65xx.c
 MEDIATEK IOMMU DRIVER
 M:     Yong Wu <yong.wu@mediatek.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 L:     linux-mediatek@lists.infradead.org (moderated for non-subscribers)
 S:     Supported
 F:     Documentation/devicetree/bindings/iommu/mediatek*
@@ -12696,7 +12748,6 @@ L:      netdev@vger.kernel.org
 S:     Supported
 W:     http://www.mellanox.com
 Q:     https://patchwork.kernel.org/project/netdevbpf/list/
-F:     drivers/net/ethernet/mellanox/mlx5/core/accel/*
 F:     drivers/net/ethernet/mellanox/mlx5/core/en_accel/*
 F:     drivers/net/ethernet/mellanox/mlx5/core/fpga/*
 F:     include/linux/mlx5/mlx5_ifc_fpga.h
@@ -12836,9 +12887,8 @@ M:      Andrew Morton <akpm@linux-foundation.org>
 L:     linux-mm@kvack.org
 S:     Maintained
 W:     http://www.linux-mm.org
-T:     quilt https://ozlabs.org/~akpm/mmotm/
-T:     quilt https://ozlabs.org/~akpm/mmots/
-T:     git git://github.com/hnaz/linux-mm.git
+T:     git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
+T:     quilt git://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new
 F:     include/linux/gfp.h
 F:     include/linux/memory_hotplug.h
 F:     include/linux/mm.h
@@ -12848,6 +12898,18 @@ F:     include/linux/vmalloc.h
 F:     mm/
 F:     tools/testing/selftests/vm/
 
+MEMORY HOT(UN)PLUG
+M:     David Hildenbrand <david@redhat.com>
+M:     Oscar Salvador <osalvador@suse.de>
+L:     linux-mm@kvack.org
+S:     Maintained
+F:     Documentation/admin-guide/mm/memory-hotplug.rst
+F:     Documentation/core-api/memory-hotplug.rst
+F:     drivers/base/memory.c
+F:     include/linux/memory_hotplug.h
+F:     mm/memory_hotplug.c
+F:     tools/testing/selftests/memory-hotplug/
+
 MEMORY TECHNOLOGY DEVICES (MTD)
 M:     Miquel Raynal <miquel.raynal@bootlin.com>
 M:     Richard Weinberger <richard@nod.at>
@@ -13792,6 +13854,7 @@ T:      git git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git
 F:     Documentation/devicetree/bindings/net/
 F:     drivers/connector/
 F:     drivers/net/
+F:     include/dt-bindings/net/
 F:     include/linux/etherdevice.h
 F:     include/linux/fcdevice.h
 F:     include/linux/fddidevice.h
@@ -13943,7 +14006,6 @@ F:      net/ipv6/tcp*.c
 NETWORKING [TLS]
 M:     Boris Pismenny <borisp@nvidia.com>
 M:     John Fastabend <john.fastabend@gmail.com>
-M:     Daniel Borkmann <daniel@iogearbox.net>
 M:     Jakub Kicinski <kuba@kernel.org>
 L:     netdev@vger.kernel.org
 S:     Maintained
@@ -14252,7 +14314,7 @@ F:      drivers/iio/gyro/fxas21002c_i2c.c
 F:     drivers/iio/gyro/fxas21002c_spi.c
 
 NXP i.MX CLOCK DRIVERS
-M:     Abel Vesa <abel.vesa@nxp.com>
+M:     Abel Vesa <abelvesa@kernel.org>
 L:     linux-clk@vger.kernel.org
 L:     linux-imx@nxp.com
 S:     Maintained
@@ -14860,6 +14922,7 @@ F:      include/dt-bindings/
 
 OPENCOMPUTE PTP CLOCK DRIVER
 M:     Jonathan Lemon <jonathan.lemon@gmail.com>
+M:     Vadim Fedorenko <vadfed@fb.com>
 L:     netdev@vger.kernel.org
 S:     Maintained
 F:     drivers/ptp/ptp_ocp.c
@@ -15824,6 +15887,14 @@ S:     Maintained
 F:     Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.yaml
 F:     drivers/iio/chemical/pms7003.c
 
+PLATFORM FEATURE INFRASTRUCTURE
+M:     Juergen Gross <jgross@suse.com>
+S:     Maintained
+F:     arch/*/include/asm/platform-feature.h
+F:     include/asm-generic/platform-feature.h
+F:     include/linux/platform-feature.h
+F:     kernel/platform-feature.c
+
 PLDMFW LIBRARY
 M:     Jacob Keller <jacob.e.keller@intel.com>
 S:     Maintained
@@ -16471,7 +16542,7 @@ F:      Documentation/devicetree/bindings/opp/opp-v2-kryo-cpu.yaml
 F:     drivers/cpufreq/qcom-cpufreq-nvmem.c
 
 QUALCOMM CRYPTO DRIVERS
-M:     Thara Gopinath <thara.gopinath@linaro.org>
+M:     Thara Gopinath <thara.gopinath@gmail.com>
 L:     linux-crypto@vger.kernel.org
 L:     linux-arm-msm@vger.kernel.org
 S:     Maintained
@@ -16526,6 +16597,7 @@ F:      drivers/i2c/busses/i2c-qcom-cci.c
 QUALCOMM IOMMU
 M:     Rob Clark <robdclark@gmail.com>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 L:     linux-arm-msm@vger.kernel.org
 S:     Maintained
 F:     drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -16581,7 +16653,7 @@ F:      include/linux/if_rmnet.h
 
 QUALCOMM TSENS THERMAL DRIVER
 M:     Amit Kucheria <amitk@kernel.org>
-M:     Thara Gopinath <thara.gopinath@linaro.org>
+M:     Thara Gopinath <thara.gopinath@gmail.com>
 L:     linux-pm@vger.kernel.org
 L:     linux-arm-msm@vger.kernel.org
 S:     Maintained
@@ -19151,6 +19223,7 @@ F:      arch/x86/boot/video*
 SWIOTLB SUBSYSTEM
 M:     Christoph Hellwig <hch@infradead.org>
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Supported
 W:     http://git.infradead.org/users/hch/dma-mapping.git
 T:     git git://git.infradead.org/users/hch/dma-mapping.git
@@ -19220,7 +19293,7 @@ F:      arch/arc/plat-axs10x
 SYNOPSYS AXS10x RESET CONTROLLER DRIVER
 M:     Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
 S:     Supported
-F:     Documentation/devicetree/bindings/reset/snps,axs10x-reset.txt
+F:     Documentation/devicetree/bindings/reset/snps,axs10x-reset.yaml
 F:     drivers/reset/reset-axs10x.c
 
 SYNOPSYS CREG GPIO DRIVER
@@ -19288,7 +19361,7 @@ R:      Andy Shevchenko <andriy.shevchenko@linux.intel.com>
 R:     Mika Westerberg <mika.westerberg@linux.intel.com>
 R:     Jan Dabros <jsd@semihalf.com>
 L:     linux-i2c@vger.kernel.org
-S:     Maintained
+S:     Supported
 F:     drivers/i2c/busses/i2c-designware-*
 
 SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER
@@ -20695,6 +20768,7 @@ T:      git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
 F:     Documentation/devicetree/bindings/usb/
 F:     Documentation/usb/
 F:     drivers/usb/
+F:     include/dt-bindings/usb/
 F:     include/linux/usb.h
 F:     include/linux/usb/
 
@@ -21825,6 +21899,7 @@ M:      Juergen Gross <jgross@suse.com>
 M:     Stefano Stabellini <sstabellini@kernel.org>
 L:     xen-devel@lists.xenproject.org (moderated for non-subscribers)
 L:     iommu@lists.linux-foundation.org
+L:     iommu@lists.linux.dev
 S:     Supported
 F:     arch/x86/xen/*swiotlb*
 F:     drivers/xen/*swiotlb*
index c43d825..8973b28 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 19
 SUBLEVEL = 0
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc4
 NAME = Superb Owl
 
 # *DOCUMENTATION*
@@ -788,6 +788,7 @@ stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG)      := -fstack-protector-strong
 KBUILD_CFLAGS += $(stackp-flags-y)
 
 KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror
+KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds
 KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
 
 ifdef CONFIG_CC_IS_CLANG
@@ -805,6 +806,9 @@ endif
 KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
 KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
 
+# These result in bogus false positives
+KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer)
+
 ifdef CONFIG_FRAME_POINTER
 KBUILD_CFLAGS  += -fno-omit-frame-pointer -fno-optimize-sibling-calls
 else
@@ -1137,7 +1141,7 @@ KBUILD_MODULES := 1
 
 autoksyms_recursive: descend modules.order
        $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
-         "$(MAKE) -f $(srctree)/Makefile vmlinux"
+         "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive"
 endif
 
 autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h)
index 1848998..fca5400 100644 (file)
@@ -135,6 +135,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \
        bcm47094-luxul-xwr-3150-v1.dtb \
        bcm47094-netgear-r8500.dtb \
        bcm47094-phicomm-k3.dtb \
+       bcm53015-meraki-mr26.dtb \
        bcm53016-meraki-mr32.dtb \
        bcm94708.dtb \
        bcm94709.dtb \
@@ -146,8 +147,6 @@ dtb-$(CONFIG_ARCH_BCM_53573) += \
        bcm47189-luxul-xap-810.dtb \
        bcm47189-tenda-ac9.dtb \
        bcm947189acdbmr.dtb
-dtb-$(CONFIG_ARCH_BCM_63XX) += \
-       bcm963138dvt.dtb
 dtb-$(CONFIG_ARCH_BCM_CYGNUS) += \
        bcm911360_entphn.dtb \
        bcm911360k.dtb \
@@ -182,7 +181,15 @@ dtb-$(CONFIG_ARCH_BERLIN) += \
 dtb-$(CONFIG_ARCH_BRCMSTB) += \
        bcm7445-bcm97445svmb.dtb
 dtb-$(CONFIG_ARCH_BCMBCA) += \
-       bcm947622.dtb
+       bcm947622.dtb \
+       bcm963138.dtb \
+       bcm963138dvt.dtb \
+       bcm963148.dtb \
+       bcm963178.dtb \
+       bcm96756.dtb \
+       bcm96846.dtb \
+       bcm96855.dtb \
+       bcm96878.dtb
 dtb-$(CONFIG_ARCH_CLPS711X) += \
        ep7211-edb7211.dtb
 dtb-$(CONFIG_ARCH_DAVINCI) += \
@@ -550,6 +557,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
        imx6q-apalis-eval.dtb \
        imx6q-apalis-ixora.dtb \
        imx6q-apalis-ixora-v1.1.dtb \
+       imx6q-apalis-ixora-v1.2.dtb \
        imx6q-apf6dev.dtb \
        imx6q-arm2.dtb \
        imx6q-b450v3.dtb \
@@ -741,8 +749,12 @@ dtb-$(CONFIG_SOC_IMX7D) += \
        imx7d-cl-som-imx7.dtb \
        imx7d-colibri-aster.dtb \
        imx7d-colibri-emmc-aster.dtb \
+       imx7d-colibri-emmc-iris.dtb \
+       imx7d-colibri-emmc-iris-v2.dtb \
        imx7d-colibri-emmc-eval-v3.dtb \
        imx7d-colibri-eval-v3.dtb \
+       imx7d-colibri-iris.dtb \
+       imx7d-colibri-iris-v2.dtb \
        imx7d-flex-concentrator.dtb \
        imx7d-flex-concentrator-mfg.dtb \
        imx7d-mba7.dtb \
@@ -762,6 +774,8 @@ dtb-$(CONFIG_SOC_IMX7D) += \
        imx7d-zii-rpu2.dtb \
        imx7s-colibri-aster.dtb \
        imx7s-colibri-eval-v3.dtb \
+       imx7s-colibri-iris.dtb \
+       imx7s-colibri-iris-v2.dtb \
        imx7s-mba7.dtb \
        imx7s-warp.dtb
 dtb-$(CONFIG_SOC_IMX7ULP) += \
@@ -1148,7 +1162,7 @@ dtb-$(CONFIG_ARCH_S5PV210) += \
        s5pv210-torbreck.dtb
 dtb-$(CONFIG_ARCH_INTEL_SOCFPGA) += \
        socfpga_arria5_socdk.dtb \
-       socfpga_arria10_mercury_aa1.dtb \
+       socfpga_arria10_chameleonv3.dtb \
        socfpga_arria10_socdk_nand.dtb \
        socfpga_arria10_socdk_qspi.dtb \
        socfpga_arria10_socdk_sdmmc.dtb \
@@ -1192,6 +1206,7 @@ dtb-$(CONFIG_ARCH_STM32) += \
        stm32mp151a-prtt1c.dtb \
        stm32mp151a-prtt1s.dtb \
        stm32mp153c-dhcom-drc02.dtb \
+       stm32mp153c-dhcor-drc-compact.dtb \
        stm32mp157a-avenger96.dtb \
        stm32mp157a-dhcor-avenger96.dtb \
        stm32mp157a-dk1.dtb \
@@ -1558,7 +1573,6 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
        aspeed-ast2600-evb.dtb \
        aspeed-bmc-amd-ethanolx.dtb \
        aspeed-bmc-ampere-mtjade.dtb \
-       aspeed-bmc-arm-centriq2400-rep.dtb \
        aspeed-bmc-arm-stardragon4800-rep2.dtb \
        aspeed-bmc-asrock-e3c246d4i.dtb \
        aspeed-bmc-asrock-romed8hm3.dtb \
@@ -1586,7 +1600,6 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
        aspeed-bmc-lenovo-hr630.dtb \
        aspeed-bmc-lenovo-hr855xg2.dtb \
        aspeed-bmc-microsoft-olympus.dtb \
-       aspeed-bmc-nuvia-dc-scm.dtb \
        aspeed-bmc-opp-lanyang.dtb \
        aspeed-bmc-opp-mihawk.dtb \
        aspeed-bmc-opp-mowgli.dtb \
@@ -1599,6 +1612,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
        aspeed-bmc-opp-witherspoon.dtb \
        aspeed-bmc-opp-zaius.dtb \
        aspeed-bmc-portwell-neptune.dtb \
+       aspeed-bmc-qcom-dc-scm-v1.dtb \
        aspeed-bmc-quanta-q71l.dtb \
        aspeed-bmc-quanta-s6q.dtb \
        aspeed-bmc-supermicro-x11spi.dtb \
index 3b0675a..4be9887 100644 (file)
                        reg = <0x0 0xfbc00000 0x0 0x100000>;
                        interrupt-map-mask = <0xf800 0 0 7>;
                        /* Add legacy interrupts for SATA devices only */
-                       interrupt-map = <0x4000 0 0 1 &gic 0 43 4>,
+                       interrupt-map = <0x4000 0 0 1 &gic 0 43 4>,
                                        <0x4800 0 0 1 &gic 0 44 4>;
 
                        /* 32 bit non prefetchable memory space */
index c72b09a..207d2b6 100644 (file)
@@ -19,7 +19,7 @@
                regulator-name = "wlan-en-regulator";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               startup-delay-us= <70000>;
+               startup-delay-us = <70000>;
 
                /* WL_EN */
                gpio = <&gpio3 9 0>;
index 9312197..b956e2f 100644 (file)
                "NC",
                "NC";
 };
+
+&baseboard_eeprom {
+       vcc-supply = <&ldo4_reg>;
+};
index 147c00d..34579e9 100644 (file)
                regulator-name = "wlan-en-regulator";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               startup-delay-us= <70000>;
+               startup-delay-us = <70000>;
 
                /* WL_EN */
                gpio = <&gpio3 9 0>;
index 215f279..d388cff 100644 (file)
@@ -18,7 +18,7 @@
                regulator-name = "wlan-en-regulator";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <1800000>;
-               startup-delay-us= <70000>;
+               startup-delay-us = <70000>;
 
                /* WL_EN */
                gpio = <&gpio0 26 0>;
index d9f003d..993b134 100644 (file)
@@ -325,7 +325,7 @@ status = "okay";
        tlv320aic23: codec@1a {
                compatible = "ti,tlv320aic23";
                reg = <0x1a>;
-               #sound-dai-cells= <0>;
+               #sound-dai-cells = <0>;
                status = "okay";
        };
 };
@@ -491,7 +491,7 @@ status = "okay";
                tx-num-evt = <1>;
                rx-num-evt = <1>;
 
-               #sound-dai-cells= <0>;
+               #sound-dai-cells = <0>;
                status = "okay";
 };
 
index b9745a2..25c6ac9 100644 (file)
                                0x0201006c>;    /* DOWN */
        };
 
-       gpio_keys: volume_keys0 {
+       gpio_keys: volume-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
-               switch9 {
+               switch-9 {
                        label = "volume-up";
                        linux,code = <115>;
                        gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
                        wakeup-source;
                };
 
-               switch10 {
+               switch-10 {
                        label = "volume-down";
                        linux,code = <114>;
                        gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
index 1a7e187..f635626 100644 (file)
@@ -33,8 +33,6 @@
                pinctrl-names = "default";
                pinctrl-0 = <&guardian_button_pins>;
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
                select-button {
                        label = "guardian-select-button";
index 92a0e98..7b40ca9 100644 (file)
 &buttons {
        pinctrl-names = "default";
        pinctrl-0 = <&push_button_pins>;
-       #address-cells = <1>;
-       #size-cells = <0>;
 
-       button@0 {
+       button-0 {
                label = "push_button";
                linux,code = <0x100>;
                gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
index e7e439a..e0364ad 100644 (file)
 &buttons {
        pinctrl-names = "default";
        pinctrl-0 = <&push_button_pins>;
-       #address-cells = <1>;
-       #size-cells = <0>;
 
-       button@0 {
+       button-0 {
                label = "push_button";
                linux,code = <0x100>;
                gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
index 124026f..dae4480 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&user_buttons_pins>;
 
-               button@0 {
+               button-0 {
                        label = "home";
                        linux,code = <KEY_HOME>;
                        gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>;
                        wakeup-source;
                };
 
-               button@1 {
+               button-1 {
                        label = "menu";
                        linux,code = <KEY_MENU>;
                        gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
index b5e88e6..8691eec 100644 (file)
 &buttons {
        pinctrl-names = "default";
        pinctrl-0 = <&user_buttons_pins>;
-       #address-cells = <1>;
-       #size-cells = <0>;
 
-       button0 {
+       button-0 {
                label = "home";
                linux,code = <KEY_HOME>;
                gpios = <&gpio1 22 GPIO_ACTIVE_LOW>;
                wakeup-source;
        };
 
-       button1 {
+       button-1 {
                label = "menu";
                linux,code = <KEY_MENU>;
                gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
                wakeup-source;
        };
 
-       buttons2 {
+       button-2 {
                label = "power";
                linux,code = <KEY_POWER>;
                gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
index 246a1a9..a2676d1 100644 (file)
@@ -23,7 +23,7 @@
                regulator-name = "wlan-en-regulator";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               startup-delay-us= <100000>;
+               startup-delay-us = <100000>;
        };
 };
 
index 6b98775..c497200 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               back_button {
+               back-button {
                        label = "Back Button";
                        gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_BACK>;
@@ -47,7 +47,7 @@
                        wakeup-source;
                };
 
-               front_button {
+               front-button {
                        label = "Front Button";
                        gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_FRONT>;
index 7d8f32b..75ad421 100644 (file)
                compatible = "gpio-keys-polled";
                poll-interval = <100>;
 
-               record {
+               key-record {
                        label = "Record";
                        /* linux,code = <BTN_0>; */
                        gpios = <&tca6416_2 15 GPIO_ACTIVE_LOW>;
                };
 
-               play {
+               key-play {
                        label = "Play";
                        linux,code = <KEY_PLAY>;
                        gpios = <&tca6416_2 14 GPIO_ACTIVE_LOW>;
                };
 
-               Stop {
+               key-stop {
                        label = "Stop";
                        linux,code = <KEY_STOP>;
                        gpios = <&tca6416_2 13 GPIO_ACTIVE_LOW>;
                };
 
-               fwd {
+               key-fwd {
                        label = "FWD";
                        linux,code = <KEY_FASTFORWARD>;
                        gpios = <&tca6416_2 12 GPIO_ACTIVE_LOW>;
                };
 
-               rwd {
+               key-rwd {
                        label = "RWD";
                        linux,code = <KEY_REWIND>;
                        gpios = <&tca6416_2 11 GPIO_ACTIVE_LOW>;
                };
 
-               shift {
+               key-shift {
                        label = "Shift";
                        linux,code = <KEY_LEFTSHIFT>;
                        gpios = <&tca6416_2 10 GPIO_ACTIVE_LOW>;
                };
 
-               Mode {
+               key-mode {
                        label = "Mode";
                        linux,code = <BTN_MODE>;
                        gpios = <&tca6416_2 9 GPIO_ACTIVE_LOW>;
                };
 
-               Menu {
+               key-menu {
                        label = "Menu";
                        linux,code = <KEY_MENU>;
                        gpios = <&tca6416_2 8 GPIO_ACTIVE_LOW>;
                };
 
-               Up {
+               key-up {
                        label = "Up";
                        linux,code = <KEY_UP>;
                        gpios = <&tca6416_2 7 GPIO_ACTIVE_LOW>;
                };
 
-               Down {
+               key-down {
                        label = "Down";
                        linux,code = <KEY_DOWN>;
                        gpios = <&tca6416_2 6 GPIO_ACTIVE_LOW>;
        tlv320aic23_1: codec@1a {
                compatible = "ti,tlv320aic23";
                reg = <0x1a>;
-               #sound-dai-cells= <0>;
+               #sound-dai-cells = <0>;
                status = "okay";
        };
 
        tlv320aic23_2: codec@1b {
                compatible = "ti,tlv320aic23";
                reg = <0x1b>;
-               #sound-dai-cells= <0>;
+               #sound-dai-cells = <0>;
                status = "okay";
        };
 };
        tlv320aic23_3: codec@1a {
                compatible = "ti,tlv320aic23";
                reg = <0x1a>;
-               #sound-dai-cells= <0>;
+               #sound-dai-cells = <0>;
                status = "okay";
        };
 
index c8b80f1..35b6530 100644 (file)
                compatible = "gpio-keys-polled";
                poll-interval = <100>;
 
-               user_pb {
+               button-user {
                        label = "User Push Button";
                        linux,code = <BTN_0>;
                        gpios = <&tca6416 5 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_1 {
+               switch-1 {
                        label = "User Switch 1";
                        linux,code = <BTN_1>;
                        gpios = <&tca6416 8 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_2 {
+               switch-2 {
                        label = "User Switch 2";
                        linux,code = <BTN_2>;
                        gpios = <&tca6416 9 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_3 {
+               switch-3 {
                        label = "User Switch 3";
                        linux,code = <BTN_3>;
                        gpios = <&tca6416 10 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_4 {
+               switch-4 {
                        label = "User Switch 4";
                        linux,code = <BTN_4>;
                        gpios = <&tca6416 11 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_5 {
+               switch-5 {
                        label = "User Switch 5";
                        linux,code = <BTN_5>;
                        gpios = <&tca6416 12 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_6 {
+               switch-6 {
                        label = "User Switch 6";
                        linux,code = <BTN_6>;
                        gpios = <&tca6416 13 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_7 {
+               switch-7 {
                        label = "User Switch 7";
                        linux,code = <BTN_7>;
                        gpios = <&tca6416 14 GPIO_ACTIVE_LOW>;
                };
 
-               user_sw_8 {
+               switch-8 {
                        label = "User Switch 8";
                        linux,code = <BTN_8>;
                        gpios = <&tca6416 15 GPIO_ACTIVE_LOW>;
index c9323d1..d039af8 100644 (file)
 
                        u48: pca9575@22 {
                                compatible = "nxp,pca9575";
-                               reg=<0x22>;
+                               reg = <0x22>;
                                gpio-controller;
                                #gpio-cells = <2>;
 
 
                        u59: pca9575@23 {
                                compatible = "nxp,pca9575";
-                               reg=<0x23>;
+                               reg = <0x23>;
                                gpio-controller;
                                #gpio-cells = <2>;
                                gpio-line-names =
index 5a74b83..123a95f 100644 (file)
                vin-supply = <&v1_5dreg>;
        };
 
-       gpio_keys: gpio_keys {
+       gpio_keys: gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pins_default>;
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               switch0 {
+               switch-0 {
                        label = "power-button";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
index 8f2268c..415210b 100644 (file)
 
                                adc {
                                        #io-channel-cells = <1>;
-                                       compatible ="ti,am4372-adc";
+                                       compatible = "ti,am4372-adc";
                                };
                        };
                };
index 7da718a..29936bf 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               keyswitch_in {
+               key-switch-in {
                        label = "keyswitch_in";
                        gpios = <&pioB 1 GPIO_ACTIVE_HIGH>;
                        linux,code = <28>;
                        wakeup-source;
                };
 
-               error_in {
+               key-error-in {
                        label = "error_in";
                        gpios = <&pioB 2 GPIO_ACTIVE_HIGH>;
                        linux,code = <29>;
                        wakeup-source;
                };
 
-               btn {
+               key-s {
                        label = "btn";
                        gpios = <&pioC 23 GPIO_ACTIVE_HIGH>;
                        linux,code = <31>;
index 1a4a09b..84d40e1 100644 (file)
                pinctrl-0 = <&pmx_buttons>;
                pinctrl-names = "default";
 
-               power {
+               button-power {
                        label = "Power Button";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
                };
 
-               reset {
+               button-reset {
                        label = "Reset Button";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
                };
 
-               usb1 {
+               button-usb1 {
                        label = "USB1 Button";
                        linux,code = <BTN_0>;
                        gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
                };
 
-               usb2 {
+               button-usb2 {
                        label = "USB2 Button";
                        linux,code = <BTN_1>;
                        gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
index c910d15..6ba7699 100644 (file)
@@ -84,8 +84,6 @@
 
                        gpio-keys {
                                compatible = "gpio-keys";
-                               #address-cells = <1>;
-                               #size-cells = <0>;
                                button {
                                        label = "Software Button";
                                        linux,code = <KEY_POWER>;
index b52634e..866b863 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               power {
+               button-power {
                        label = "Power button";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
                        debounce-interval = <100>;
                };
-               backup {
+               button-backup {
                        label = "Backup button";
                        linux,code = <KEY_OPTION>;
                        gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
                        debounce-interval = <100>;
                };
-               reset {
+               button-reset {
                        label = "Reset Button";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
index 0abac5f..702a85a 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               power {
+               button-power {
                        label = "Power button";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>;
                        debounce-interval = <100>;
                };
-               reset {
+               button-reset {
                        label = "Reset Button";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
                        debounce-interval = <100>;
                };
-               button {
+               button-usb {
                        label = "USB VBUS error";
                        linux,code = <KEY_UNKNOWN>;
                        gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
index 3961720..095df55 100644 (file)
@@ -24,7 +24,7 @@
                pinctrl-0 = <&front_button_pins>;
                pinctrl-names = "default";
 
-               factory_default {
+               key-factory-default {
                        label = "Factory Default";
                        gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
index 10ad46f..d1452a0 100644 (file)
                pinctrl-0 = <&cf_gtr_rear_button_pins &cf_gtr_front_button_pins>;
                pinctrl-names = "default";
 
-               button_0 {
+               button-0 {
                        label = "Rear Button";
                        gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
                        linux,can-disable;
                        linux,code = <BTN_0>;
                };
 
-               button_1 {
+               button-1 {
                        label = "Front Button";
                        gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
                        linux,can-disable;
index fb9c8a0..116aca5 100644 (file)
                pinctrl-0 = <&gpio_keys_pins>;
                pinctrl-names = "default";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
                };
 
-               reset {
+               button-reset {
                        label = "Factory Reset Button";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
index f4878df..d1e0db6 100644 (file)
                                reg = <0x2b>;
                                #address-cells = <1>;
                                #size-cells = <0>;
+                               status = "okay";
 
                                /*
                                 * LEDs are controlled by MCU (STM32F0) at
                                 * address 0x2b.
                                 *
-                                * The driver does not support HW control mode
-                                * for the LEDs yet. Disable the LEDs for now.
-                                *
-                                * Also LED functions are not stable yet:
+                                * LED functions are not stable yet:
                                 * - there are 3 LEDs connected via MCU to PCIe
                                 *   ports. One of these ports supports mSATA.
                                 *   There is no mSATA nor PCIe function.
                                 *   B. Again there is no such function defined.
                                 *   For now we use LED_FUNCTION_INDICATOR
                                 */
-                               status = "disabled";
 
                                multi-led@0 {
                                        reg = <0x0>;
        phy1: ethernet-phy@1 {
                compatible = "ethernet-phy-ieee802.3-c22";
                reg = <1>;
-               marvell,reg-init = <3 18 0 0x4985>;
+               marvell,reg-init = <3 18 0 0x4985>,
+                                  <3 16 0xfff0 0x0001>;
 
                /* irq is connected to &pcawan pin 7 */
        };
index 53b4bd3..f7daa3b 100644 (file)
@@ -19,7 +19,7 @@
                pinctrl-0 = <&rear_button_pins>;
                pinctrl-names = "default";
 
-               button_0 {
+               button-0 {
                        /* The rear SW3 button */
                        label = "Rear Button";
                        gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
index 4140a53..9529916 100644 (file)
@@ -35,7 +35,7 @@
                pinctrl-0 = <&rear_button_pins>;
                pinctrl-names = "default";
 
-               button_0 {
+               button-0 {
                        /* The rear SW3 button */
                        label = "Rear Button";
                        gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
index 3e77b43..5a74197 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                pinctrl-0 = <&keys_pin>;
                pinctrl-names = "default";
 
-               reset {
+               button-reset {
                        label = "Factory Reset Button";
                        linux,code = <KEY_SETUP>;
                        gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
index 36932e3..622ac40 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                pinctrl-0 = <&keys_pin>;
                pinctrl-names = "default";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
                };
 
-               reset {
+               button-reset {
                        label = "Factory Reset Button";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
index 0efcc16..1ecf72a 100644 (file)
                                };
                        };
 
-                       gpio_keys {
+                       gpio-keys {
                                compatible = "gpio-keys";
-                               #address-cells = <1>;
-                               #size-cells = <0>;
 
-                               init {
+                               button-init {
                                        label = "Init Button";
                                        linux,code = <KEY_POWER>;
                                        gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
index 1d24b39..a497dd1 100644 (file)
@@ -5,7 +5,7 @@
 
 / {
        model = "AST2500 EVB";
-       compatible = "aspeed,ast2500";
+       compatible = "aspeed,ast2500-evb", "aspeed,ast2500";
 
        aliases {
                serial4 = &uart5;
index dd71480..d0a5c2f 100644 (file)
@@ -5,6 +5,7 @@
 
 / {
        model = "AST2600 A1 EVB";
+       compatible = "aspeed,ast2600-evb-a1", "aspeed,ast2600";
 
        /delete-node/regulator-vcc-sdhci0;
        /delete-node/regulator-vcc-sdhci1;
index 5a6063b..c698e65 100644 (file)
@@ -8,7 +8,7 @@
 
 / {
        model = "AST2600 EVB";
-       compatible = "aspeed,ast2600";
+       compatible = "aspeed,ast2600-evb-a1", "aspeed,ast2600";
 
        aliases {
                serial4 = &uart5;
index 1b2e7ad..82a6f14 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               shutdown_ack {
+               event-shutdown-ack {
                        label = "SHUTDOWN_ACK";
                        gpios = <&gpio ASPEED_GPIO(G, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(G, 2)>;
                };
 
-               reboot_ack {
+               event-reboot-ack {
                        label = "REBOOT_ACK";
                        gpios = <&gpio ASPEED_GPIO(J, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 3)>;
                };
 
-               S0_overtemp {
+               event-s0-overtemp {
                        label = "S0_OVERTEMP";
                        gpios = <&gpio ASPEED_GPIO(G, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(G, 3)>;
                };
 
-               S0_hightemp {
+               event-s0-hightemp {
                        label = "S0_HIGHTEMP";
                        gpios = <&gpio ASPEED_GPIO(J, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 0)>;
                };
 
-               S0_cpu_fault {
+               event-s0-cpu-fault {
                        label = "S0_CPU_FAULT";
                        gpios = <&gpio ASPEED_GPIO(J, 1) GPIO_ACTIVE_HIGH>;
                        linux,code = <ASPEED_GPIO(J, 1)>;
                };
 
-               S0_scp_auth_fail {
+               event-s0-scp-auth-fail {
                        label = "S0_SCP_AUTH_FAIL";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
                };
 
-               S1_scp_auth_fail {
+               event-s1-scp-auth-fail {
                        label = "S1_SCP_AUTH_FAIL";
                        gpios = <&gpio ASPEED_GPIO(Z, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Z, 5)>;
                };
 
-               S1_overtemp {
+               event-s1-overtemp {
                        label = "S1_OVERTEMP";
                        gpios = <&gpio ASPEED_GPIO(Z, 6) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Z, 6)>;
                };
 
-               S1_hightemp {
+               event-s1-hightemp {
                        label = "S1_HIGHTEMP";
                        gpios = <&gpio ASPEED_GPIO(AB, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(AB, 0)>;
                };
 
-               S1_cpu_fault {
+               event-s1-cpu-fault {
                        label = "S1_CPU_FAULT";
                        gpios = <&gpio ASPEED_GPIO(Z, 1) GPIO_ACTIVE_HIGH>;
                        linux,code = <ASPEED_GPIO(Z, 1)>;
                };
 
-               id_button {
+               event-id {
                        label = "ID_BUTTON";
                        gpios = <&gpio ASPEED_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Q, 5)>;
                };
 
-               psu1_vin_good {
+               event-psu1-vin-good {
                        label = "PSU1_VIN_GOOD";
                        gpios = <&gpio ASPEED_GPIO(H, 4) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(H, 4)>;
                };
 
-               psu2_vin_good {
+               event-psu2-vin-good {
                        label = "PSU2_VIN_GOOD";
                        gpios = <&gpio ASPEED_GPIO(H, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(H, 5)>;
                };
 
-               psu1_present {
+               event-psu1-present {
                        label = "PSU1_PRESENT";
                        gpios = <&gpio ASPEED_GPIO(I, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(I, 0)>;
                };
 
-               psu2_present {
+               event-psu2-present {
                        label = "PSU2_PRESENT";
                        gpios = <&gpio ASPEED_GPIO(I, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(I, 1)>;
diff --git a/arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts b/arch/arm/boot/dts/aspeed-bmc-arm-centriq2400-rep.dts
deleted file mode 100644 (file)
index 3395de9..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/dts-v1/;
-
-#include "aspeed-g5.dtsi"
-#include <dt-bindings/gpio/aspeed-gpio.h>
-
-/ {
-       model = "Qualcomm Centriq 2400  REP AST2520";
-       compatible = "qualcomm,centriq2400-rep-bmc", "aspeed,ast2500";
-
-       chosen {
-               stdout-path = &uart5;
-               bootargs = "console=ttyS4,115200 earlycon";
-       };
-
-       memory@80000000 {
-               reg = <0x80000000 0x40000000>;
-       };
-
-       iio-hwmon {
-               compatible = "iio-hwmon";
-               io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
-                        <&adc 4>, <&adc 5>, <&adc 6>, <&adc 8>;
-       };
-
-       iio-hwmon-battery {
-               compatible = "iio-hwmon";
-               io-channels = <&adc 7>;
-       };
-
-       leds {
-               compatible = "gpio-leds";
-
-               uid_led {
-                       label = "UID_LED";
-                       gpios = <&gpio ASPEED_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
-               };
-
-               ras_error_led {
-                       label = "RAS_ERROR_LED";
-                       gpios = <&gpio ASPEED_GPIO(F, 6) GPIO_ACTIVE_LOW>;
-               };
-
-               system_fault {
-                       label = "System_fault";
-                       gpios = <&gpio ASPEED_GPIO(A, 1) GPIO_ACTIVE_LOW>;
-               };
-       };
-};
-
-&fmc {
-       status = "okay";
-       flash@0 {
-               status = "okay";
-               m25p,fast-read;
-               label = "bmc";
-#include "openbmc-flash-layout.dtsi"
-       };
-};
-
-&spi1 {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_spi1_default>;
-       flash@0 {
-               status = "okay";
-       };
-};
-
-&spi2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_spi2ck_default
-                       &pinctrl_spi2miso_default
-                       &pinctrl_spi2mosi_default
-                       &pinctrl_spi2cs0_default>;
-};
-
-&uart3 {
-       status = "okay";
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_txd3_default &pinctrl_rxd3_default>;
-       current-speed = <115200>;
-};
-
-&uart5 {
-       status = "okay";
-};
-
-&mac0 {
-       status = "okay";
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
-};
-
-&i2c0 {
-       status = "okay";
-};
-
-&i2c1 {
-       status = "okay";
-
-       tmp421@1e {
-               compatible = "ti,tmp421";
-               reg = <0x1e>;
-       };
-       tmp421@2a {
-               compatible = "ti,tmp421";
-               reg = <0x2a>;
-       };
-       tmp421@4e {
-               compatible = "ti,tmp421";
-               reg = <0x4e>;
-       };
-       tmp421@1c {
-               compatible = "ti,tmp421";
-               reg = <0x1c>;
-       };
-};
-
-&i2c2 {
-       status = "okay";
-};
-
-&i2c3 {
-       status = "okay";
-};
-
-&i2c4 {
-       status = "okay";
-};
-
-&i2c5 {
-       status = "okay";
-};
-
-&i2c6 {
-       status = "okay";
-
-       tmp421@1d {
-               compatible = "ti,tmp421";
-               reg = <0x1d>;
-       };
-       tmp421@1f {
-               compatible = "ti,tmp421";
-               reg = <0x1f>;
-       };
-       tmp421@4d {
-               compatible = "ti,tmp421";
-               reg = <0x4d>;
-       };
-       tmp421@4f {
-               compatible = "ti,tmp421";
-               reg = <0x4f>;
-       };
-       nvt210@4c {
-               compatible = "nvt210";
-               reg = <0x4c>;
-       };
-       eeprom@50 {
-               compatible = "atmel,24c128";
-               reg = <0x50>;
-               pagesize = <128>;
-       };
-};
-
-&i2c7 {
-       status = "okay";
-};
-
-&i2c8 {
-       status = "okay";
-
-       pca9641@70 {
-               compatible = "nxp,pca9641";
-               reg = <0x70>;
-               i2c-arb {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       tmp421@1d {
-                               compatible = "tmp421";
-                               reg = <0x1d>;
-                       };
-                       adm1278@12 {
-                               compatible = "adi,adm1278";
-                               reg = <0x12>;
-                               Rsense = <500>;
-                       };
-                       eeprom@50 {
-                               compatible = "atmel,24c02";
-                               reg = <0x50>;
-                       };
-                       ds1100@58 {
-                               compatible = "ds1100";
-                               reg = <0x58>;
-                       };
-               };
-       };
-};
-
-&i2c9 {
-       status = "okay";
-};
-
-&vuart {
-       status = "okay";
-};
-
-&gfx {
-       status = "okay";
-};
-
-&pinctrl {
-       aspeed,external-nodes = <&gfx &lhc>;
-};
-
-&gpio {
-       pin_gpio_c7 {
-               gpio-hog;
-               gpios = <ASPEED_GPIO(C, 7) GPIO_ACTIVE_HIGH>;
-               output;
-               line-name = "BIOS_SPI_MUX_S";
-       };
-};
index 0d1fb5c..f75cad4 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               burn-in-signal {
+               event-burn-in-signal {
                        label = "burn-in";
                        gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(R, 5)>;
                compatible = "gpio-keys-polled";
                poll-interval = <1000>;
 
-               rear-riser1-presence {
+               event-rear-riser1-presence {
                        label = "rear-riser1-presence";
                        gpios = <&pca0 1 GPIO_ACTIVE_LOW>;
                        linux,code = <1>;
                };
 
-               alrt-pvddq-cpu0 {
+               event-alrt-pvddq-cpu0 {
                        label = "alrt-pvddq-cpu0";
                        gpios = <&pca0 8 GPIO_ACTIVE_LOW>;
                        linux,code = <2>;
                };
 
-               rear-riser0-presence {
+               event-rear-riser0-presence {
                        label = "rear-riser0-presence";
                        gpios = <&pca0 9 GPIO_ACTIVE_LOW>;
                        linux,code = <3>;
                };
 
-               fault-pvddq-cpu0 {
+               event-fault-pvddq-cpu0 {
                        label = "fault-pvddq-cpu0";
                        gpios = <&pca0 10 GPIO_ACTIVE_LOW>;
                        linux,code = <4>;
                };
 
-               alrt-pvddq-cpu1 {
+               event-alrt-pvddq-cpu1 {
                        label = "alrt-pvddq-cpu1";
                        gpios = <&pca0 11 GPIO_ACTIVE_LOW>;
                        linux,code = <5>;
                };
 
-               fault-pvddq-cpu1 {
+               event-fault-pvddq-cpu1 {
                        label = "alrt-pvddq-cpu1";
                        gpios = <&pca0 12 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               fault-pvccin-cpu1 {
+               event-fault-pvccin-cpu1 {
                        label = "fault-pvccin-cpuq";
                        gpios = <&pca0 13 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
                };
 
-               bmc-rom0-wp {
+               event-bmc-rom0-wp {
                        label = "bmc-rom0-wp";
                        gpios = <&pca1 0 GPIO_ACTIVE_LOW>;
                        linux,code = <8>;
                };
 
-               bmc-rom1-wp {
+               event-bmc-rom1-wp {
                        label = "bmc-rom1-wp";
                        gpios = <&pca1 1 GPIO_ACTIVE_LOW>;
                        linux,code = <9>;
                };
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca1 2 GPIO_ACTIVE_LOW>;
                        linux,code = <10>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca1 3 GPIO_ACTIVE_LOW>;
                        linux,code = <11>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca1 4 GPIO_ACTIVE_LOW>;
                        linux,code = <12>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca1 5 GPIO_ACTIVE_LOW>;
                        linux,code = <13>;
                };
 
-               fan4-presence {
+               event-fan4-presence {
                        label = "fan4-presence";
                        gpios = <&pca1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <14>;
                };
 
-               fan5-presence {
+               event-fan5-presence {
                        label = "fan5-presence";
                        gpios = <&pca1 7 GPIO_ACTIVE_LOW>;
                        linux,code = <15>;
                };
 
-               front-bp1-presence {
+               event-front-bp1-presence {
                        label = "front-bp1-presence";
                        gpios = <&pca1 8 GPIO_ACTIVE_LOW>;
                        linux,code = <16>;
                };
 
-               rear-bp-presence {
+               event-rear-bp-presence {
                        label = "rear-bp-presence";
                        gpios = <&pca1 9 GPIO_ACTIVE_LOW>;
                        linux,code = <17>;
                };
 
-               fault-pvccin-cpu0 {
+               event-fault-pvccin-cpu0 {
                        label = "fault-pvccin-cpu0";
                        gpios = <&pca1 10 GPIO_ACTIVE_LOW>;
                        linux,code = <18>;
                };
 
-               alrt-p1v05-pvcc {
+               event-alrt-p1v05-pvcc {
                        label = "alrt-p1v05-pvcc1";
                        gpios = <&pca1 11 GPIO_ACTIVE_LOW>;
                        linux,code = <19>;
                };
 
-               fault-p1v05-pvccio {
+               event-fault-p1v05-pvccio {
                        label = "alrt-p1v05-pvcc1";
                        gpios = <&pca1 12 GPIO_ACTIVE_LOW>;
                        linux,code = <20>;
                };
 
-               alrt-p1v8-pvccio {
+               event-alrt-p1v8-pvccio {
                        label = "alrt-p1v8-pvccio";
                        gpios = <&pca1 13 GPIO_ACTIVE_LOW>;
                        linux,code = <21>;
                };
 
-               fault-p1v8-pvccio {
+               event-fault-p1v8-pvccio {
                        label = "fault-p1v8-pvccio";
                        gpios = <&pca1 14 GPIO_ACTIVE_LOW>;
                        linux,code = <22>;
                };
 
-               front-bp0-presence {
+               event-front-bp0-presence {
                        label = "front-bp0-presence";
                        gpios = <&pca1 15 GPIO_ACTIVE_LOW>;
                        linux,code = <23>;
index 382da79..a6a2bc3 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca0 15 GPIO_ACTIVE_LOW>;
                        linux,code = <15>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca0 14 GPIO_ACTIVE_LOW>;
                        linux,code = <14>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca0 13 GPIO_ACTIVE_LOW>;
                        linux,code = <13>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca0 12 GPIO_ACTIVE_LOW>;
                        linux,code = <12>;
index 7213434..bf59a99 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca0 8 GPIO_ACTIVE_LOW>;
                        linux,code = <8>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca0 9 GPIO_ACTIVE_LOW>;
                        linux,code = <9>;
                };
 
-               fan4-presence {
+               event-fan4-presence {
                        label = "fan4-presence";
                        gpios = <&pca0 10 GPIO_ACTIVE_LOW>;
                        linux,code = <10>;
                };
 
-               fan5-presence {
+               event-fan5-presence {
                        label = "fan5-presence";
                        gpios = <&pca0 11 GPIO_ACTIVE_LOW>;
                        linux,code = <11>;
index 60a39ea..208b0f0 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(B, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(B, 3)>;
                };
 
-               ps0-presence {
+               event-ps0-presence {
                        label = "ps0-presence";
                        gpios = <&gpio ASPEED_GPIO(F, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 0)>;
                };
 
-               ps1-presence {
+               event-ps1-presence {
                        label = "ps1-presence";
                        gpios = <&gpio ASPEED_GPIO(F, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 1)>;
                compatible = "gpio-keys-polled";
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca1 0 GPIO_ACTIVE_LOW>;
                        linux,code = <1>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca1 1 GPIO_ACTIVE_LOW>;
                        linux,code = <2>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca1 2 GPIO_ACTIVE_LOW>;
                        linux,code = <3>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca1 3 GPIO_ACTIVE_LOW>;
                        linux,code = <4>;
                };
 
-               fan4-presence {
+               event-fan4-presence {
                        label = "fan4-presence";
                        gpios = <&pca1 4 GPIO_ACTIVE_LOW>;
                        linux,code = <5>;
                };
 
-               fan5-presence {
+               event-fan5-presence {
                        label = "fan5-presence";
                        gpios = <&pca1 5 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               fan6-presence {
+               event-fan6-presence {
                        label = "fan6-presence";
                        gpios = <&pca1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
                };
 
-               fan7-presence {
+               event-fan7-presence {
                        label = "fan7-presence";
                        gpios = <&pca1 7 GPIO_ACTIVE_LOW>;
                        linux,code = <8>;
diff --git a/arch/arm/boot/dts/aspeed-bmc-nuvia-dc-scm.dts b/arch/arm/boot/dts/aspeed-bmc-nuvia-dc-scm.dts
deleted file mode 100644 (file)
index f4a97cf..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-// Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
-
-/dts-v1/;
-
-#include "aspeed-g6.dtsi"
-
-/ {
-       model = "Nuvia DC-SCM BMC";
-       compatible = "nuvia,dc-scm-bmc", "aspeed,ast2600";
-
-       aliases {
-               serial4 = &uart5;
-       };
-
-       chosen {
-               stdout-path = &uart5;
-               bootargs = "console=ttyS4,115200n8";
-       };
-
-       memory@80000000 {
-               device_type = "memory";
-               reg = <0x80000000 0x40000000>;
-       };
-};
-
-&mdio3 {
-       status = "okay";
-
-       ethphy3: ethernet-phy@1 {
-               compatible = "ethernet-phy-ieee802.3-c22";
-               reg = <1>;
-       };
-};
-
-&mac2 {
-       status = "okay";
-
-       /* Bootloader sets up the MAC to insert delay */
-       phy-mode = "rgmii";
-       phy-handle = <&ethphy3>;
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_rgmii3_default>;
-};
-
-&mac3 {
-       status = "okay";
-
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_rmii4_default>;
-
-       use-ncsi;
-};
-
-&rtc {
-       status = "okay";
-};
-
-&fmc {
-       status = "okay";
-
-       flash@0 {
-               status = "okay";
-               m25p,fast-read;
-               label = "bmc";
-               spi-max-frequency = <133000000>;
-#include "openbmc-flash-layout-64.dtsi"
-       };
-
-       flash@1 {
-               status = "okay";
-               m25p,fast-read;
-               label = "alt-bmc";
-               spi-max-frequency = <133000000>;
-#include "openbmc-flash-layout-64-alt.dtsi"
-       };
-};
-
-&spi1 {
-       status = "okay";
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_spi1_default>;
-
-       flash@0 {
-               status = "okay";
-               m25p,fast-read;
-               label = "bios";
-               spi-max-frequency = <133000000>;
-       };
-};
-
-&gpio0 {
-       gpio-line-names =
-       /*A0-A7*/       "","","","","","","","",
-       /*B0-B7*/       "BMC_FLASH_MUX_SEL","","","","","","","",
-       /*C0-C7*/       "","","","","","","","",
-       /*D0-D7*/       "","","","","","","","",
-       /*E0-E7*/       "","","","","","","","",
-       /*F0-F7*/       "","","","","","","","",
-       /*G0-G7*/       "","","","","","","","",
-       /*H0-H7*/       "","","","","","","","",
-       /*I0-I7*/       "","","","","","","","",
-       /*J0-J7*/       "","","","","","","","",
-       /*K0-K7*/       "","","","","","","","",
-       /*L0-L7*/       "","","","","","","","",
-       /*M0-M7*/       "","","","","","","","",
-       /*N0-N7*/       "BMC_FWSPI_RST_N","","GPIO_1_BMC_3V3","","","","","",
-       /*O0-O7*/       "JTAG_MUX_A","JTAG_MUX_B","","","","","","",
-       /*P0-P7*/       "","","","","","","","",
-       /*Q0-Q7*/       "","","","","","","","",
-       /*R0-R7*/       "","","","","","","","",
-       /*S0-S7*/       "","","","","","","","",
-       /*T0-T7*/       "","","","","","","","",
-       /*U0-U7*/       "","","","","","","","",
-       /*V0-V7*/       "","","","SCMFPGA_SPARE_GPIO1_3V3",
-                       "SCMFPGA_SPARE_GPIO2_3V3","SCMFPGA_SPARE_GPIO3_3V3",
-                       "SCMFPGA_SPARE_GPIO4_3V3","SCMFPGA_SPARE_GPIO5_3V3",
-       /*W0-W7*/       "","","","","","","","",
-       /*X0-X7*/       "","","","","","","","",
-       /*Y0-Y7*/       "","","","","","","","",
-       /*Z0-Z7*/       "","","","","","","","",
-       /*AA0-AA7*/     "","","","","","","","",
-       /*AB0-AB7*/     "","","","","","","","",
-       /*AC0-AC7*/     "","","","","","","","";
-};
-
-&gpio1 {
-       gpio-line-names =
-       /*A0-A7*/       "GPI_1_BMC_1V8","","","","","",
-                       "SCMFPGA_SPARE_GPIO1_1V8","SCMFPGA_SPARE_GPIO2_1V8",
-       /*B0-B7*/       "SCMFPGA_SPARE_GPIO3_1V8","SCMFPGA_SPARE_GPIO4_1V8",
-                       "SCMFPGA_SPARE_GPIO5_1V8","","","","","",
-       /*C0-C7*/       "","","","","","","","",
-       /*D0-D7*/       "","BMC_SPI1_RST_N","BIOS_FLASH_MUX_SEL","",
-                       "","TPM2_PIRQ_N","TPM2_RST_N","",
-       /*E0-E7*/       "","","","","","","","";
-};
-
-&i2c2 {
-       status = "okay";
-};
-
-&i2c4 {
-       status = "okay";
-};
-
-&i2c5 {
-       status = "okay";
-};
-
-&i2c6 {
-       status = "okay";
-};
-
-&i2c7 {
-       status = "okay";
-};
-
-&i2c8 {
-       status = "okay";
-};
-
-&i2c9 {
-       status = "okay";
-};
-
-&i2c10 {
-       status = "okay";
-};
-
-&i2c12 {
-       status = "okay";
-};
-
-&i2c13 {
-       status = "okay";
-};
-
-&i2c14 {
-       status = "okay";
-};
-
-&i2c15 {
-       status = "okay";
-};
-
-&vhub {
-       status = "okay";
-};
index a52a289..48776fb 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               air-water {
+               event-air-water {
                        label = "air-water";
                        gpios = <&gpio ASPEED_GPIO(F, 6) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 6)>;
                };
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
                };
 
-               ps0-presence {
+               event-ps0-presence {
                        label = "ps0-presence";
                        gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Z, 2)>;
                };
 
-               ps1-presence {
+               event-ps1-presence {
                        label = "ps1-presence";
                        gpios = <&gpio ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Z, 0)>;
                };
-               id-button {
+
+               button-id {
                        label = "id-button";
                        gpios = <&gpio ASPEED_GPIO(F, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 1)>;
                compatible = "gpio-keys-polled";
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca9552 9 GPIO_ACTIVE_LOW>;
                        linux,code = <9>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca9552 10 GPIO_ACTIVE_LOW>;
                        linux,code = <10>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca9552 11 GPIO_ACTIVE_LOW>;
                        linux,code = <11>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca9552 12 GPIO_ACTIVE_LOW>;
                        linux,code = <12>;
                };
 
-               fan4-presence {
+               event-fan4-presence {
                        label = "fan4-presence";
                        gpios = <&pca9552 13 GPIO_ACTIVE_LOW>;
                        linux,code = <13>;
                };
 
-               fan5-presence {
+               event-fan5-presence {
                        label = "fan5-presence";
                        gpios = <&pca9552 14 GPIO_ACTIVE_LOW>;
                        linux,code = <14>;
index 7d38d12..31ff19e 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               air-water {
+               event-air-water {
                        label = "air-water";
                        gpios = <&gpio ASPEED_GPIO(F, 6) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 6)>;
                };
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
                };
 
-               ps0-presence {
+               event-ps0-presence {
                        label = "ps0-presence";
                        gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Z, 2)>;
                };
 
-               ps1-presence {
+               event-ps1-presence {
                        label = "ps1-presence";
                        gpios = <&gpio ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(Z, 0)>;
                };
 
-               id-button {
+               button-id {
                        label = "id-button";
                        gpios = <&gpio ASPEED_GPIO(F, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 1)>;
                compatible = "gpio-keys-polled";
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca9552 9 GPIO_ACTIVE_LOW>;
                        linux,code = <9>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca9552 10 GPIO_ACTIVE_LOW>;
                        linux,code = <10>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca9552 11 GPIO_ACTIVE_LOW>;
                        linux,code = <11>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca9552 12 GPIO_ACTIVE_LOW>;
                        linux,code = <12>;
                };
 
-               fan4-presence {
+               event-fan4-presence {
                        label = "fan4-presence";
                        gpios = <&pca9552 13 GPIO_ACTIVE_LOW>;
                        linux,code = <13>;
index 3d4bdad..ac0d666 100644 (file)
@@ -96,7 +96,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
index cd660c1..45631b4 100644 (file)
@@ -73,7 +73,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(P, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(P, 5)>;
index 084f548..893e621 100644 (file)
@@ -87,7 +87,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
index 4816486..bbf864f 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               air-water {
+               event-air-water {
                        label = "air-water";
                        gpios = <&gpio ASPEED_GPIO(B, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(B, 5)>;
                };
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
                };
 
-               ps0-presence {
+               event-ps0-presence {
                        label = "ps0-presence";
                        gpios = <&gpio ASPEED_GPIO(R, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(R, 7)>;
                };
 
-               ps1-presence {
+               event-ps1-presence {
                        label = "ps1-presence";
                        gpios = <&gpio ASPEED_GPIO(N, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(N, 0)>;
                };
 
-               oppanel-presence {
+               event-oppanel-presence {
                        label = "oppanel-presence";
                        gpios = <&gpio ASPEED_GPIO(A, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(A, 7)>;
                };
 
-               opencapi-riser-presence {
+               event-opencapi-riser-presence {
                        label = "opencapi-riser-presence";
                        gpios = <&gpio ASPEED_GPIO(I, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(I, 0)>;
                compatible = "gpio-keys-polled";
                poll-interval = <1000>;
 
-               scm0-presence {
+               event-scm0-presence {
                        label = "scm0-presence";
                        gpios = <&pca9552 6 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               scm1-presence {
+               event-scm1-presence {
                        label = "scm1-presence";
                        gpios = <&pca9552 7 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
                };
 
-               cpu0vrm-presence {
+               event-cpu0vrm-presence {
                        label = "cpu0vrm-presence";
                        gpios = <&pca9552 12 GPIO_ACTIVE_LOW>;
                        linux,code = <12>;
                };
 
-               cpu1vrm-presence {
+               event-cpu1vrm-presence {
                        label = "cpu1vrm-presence";
                        gpios = <&pca9552 13 GPIO_ACTIVE_LOW>;
                        linux,code = <13>;
                };
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
                        linux,code = <5>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca0 8 GPIO_ACTIVE_LOW>;
                        linux,code = <8>;
                };
 
-               fanboost-presence {
+               event-fanboost-presence {
                        label = "fanboost-presence";
                        gpios = <&pca0 9 GPIO_ACTIVE_LOW>;
                        linux,code = <9>;
index 72b7a66..3f6010e 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               ps0-presence {
+               event-ps0-presence {
                        label = "ps0-presence";
                        gpios = <&gpio0 ASPEED_GPIO(H, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(H, 3)>;
                };
 
-               ps1-presence {
+               event-ps1-presence {
                        label = "ps1-presence";
                        gpios = <&gpio0 ASPEED_GPIO(E, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(E, 5)>;
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca0 4 GPIO_ACTIVE_LOW>;
                        linux,code = <4>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
                        linux,code = <5>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
index 328ef47..8a7fb55 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               button_checkstop {
+               event-checkstop {
                        label = "checkstop";
                        linux,code = <74>;
                        gpios = <&gpio ASPEED_GPIO(P, 5) GPIO_ACTIVE_LOW>;
                };
 
-               button_identify {
+               event-identify {
                        label = "identify";
                        linux,code = <152>;
                        gpios = <&gpio ASPEED_GPIO(O, 7) GPIO_ACTIVE_LOW>;
index 230f358..a20a532 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               air-water {
+               event-air-water {
                        label = "air-water";
                        gpios = <&gpio ASPEED_GPIO(B, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(B, 5)>;
                };
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(J, 2)>;
                };
 
-               ps0-presence {
+               event-ps0-presence {
                        label = "ps0-presence";
                        gpios = <&gpio ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(P, 7)>;
                };
 
-               ps1-presence {
+               event-ps1-presence {
                        label = "ps1-presence";
                        gpios = <&gpio ASPEED_GPIO(N, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(N, 0)>;
                compatible = "gpio-keys-polled";
                poll-interval = <1000>;
 
-               fan0-presence {
+               event-fan0-presence {
                        label = "fan0-presence";
                        gpios = <&pca0 4 GPIO_ACTIVE_LOW>;
                        linux,code = <4>;
                };
 
-               fan1-presence {
+               event-fan1-presence {
                        label = "fan1-presence";
                        gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
                        linux,code = <5>;
                };
 
-               fan2-presence {
+               event-fan2-presence {
                        label = "fan2-presence";
                        gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
                        linux,code = <6>;
                };
 
-               fan3-presence {
+               event-fan3-presence {
                        label = "fan3-presence";
                        gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
                        linux,code = <7>;
index 7ae4ea0..0cb7b20 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               checkstop {
+               event-checkstop {
                        label = "checkstop";
                        gpios = <&gpio ASPEED_GPIO(F, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(F, 7)>;
                };
 
-               pcie-e2b-present{
+               event-pcie-e2b-present{
                        label = "pcie-e2b-present";
                        gpios = <&gpio ASPEED_GPIO(E, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <ASPEED_GPIO(E, 7)>;
index 61bc74b..a5e64cc 100644 (file)
        leds {
                compatible = "gpio-leds";
                postcode0 {
-                       label="BMC_UP";
+                       label = "BMC_UP";
                        gpios = <&gpio ASPEED_GPIO(H, 0) GPIO_ACTIVE_HIGH>;
                        default-state = "on";
                };
                postcode1 {
-                       label="BMC_HB";
+                       label = "BMC_HB";
                        gpios = <&gpio ASPEED_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
                };
                postcode2 {
-                       label="FAULT";
+                       label = "FAULT";
                        gpios = <&gpio ASPEED_GPIO(H, 2) GPIO_ACTIVE_HIGH>;
                };
                // postcode3-7 are GPIOH3-H7
diff --git a/arch/arm/boot/dts/aspeed-bmc-qcom-dc-scm-v1.dts b/arch/arm/boot/dts/aspeed-bmc-qcom-dc-scm-v1.dts
new file mode 100644 (file)
index 0000000..259ef3f
--- /dev/null
@@ -0,0 +1,190 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+// Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+
+/dts-v1/;
+
+#include "aspeed-g6.dtsi"
+
+/ {
+       model = "Qualcomm DC-SCM V1 BMC";
+       compatible = "qcom,dc-scm-v1-bmc", "aspeed,ast2600";
+
+       aliases {
+               serial4 = &uart5;
+       };
+
+       chosen {
+               stdout-path = &uart5;
+               bootargs = "console=ttyS4,115200n8";
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x40000000>;
+       };
+};
+
+&mdio3 {
+       status = "okay";
+
+       ethphy3: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
+&mac2 {
+       status = "okay";
+
+       /* Bootloader sets up the MAC to insert delay */
+       phy-mode = "rgmii";
+       phy-handle = <&ethphy3>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_rgmii3_default>;
+};
+
+&mac3 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_rmii4_default>;
+
+       use-ncsi;
+};
+
+&rtc {
+       status = "okay";
+};
+
+&fmc {
+       status = "okay";
+
+       flash@0 {
+               status = "okay";
+               m25p,fast-read;
+               label = "bmc";
+               spi-max-frequency = <133000000>;
+#include "openbmc-flash-layout-64.dtsi"
+       };
+
+       flash@1 {
+               status = "okay";
+               m25p,fast-read;
+               label = "alt-bmc";
+               spi-max-frequency = <133000000>;
+#include "openbmc-flash-layout-64-alt.dtsi"
+       };
+};
+
+&spi1 {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_spi1_default>;
+
+       flash@0 {
+               status = "okay";
+               m25p,fast-read;
+               label = "bios";
+               spi-max-frequency = <133000000>;
+       };
+};
+
+&gpio0 {
+       gpio-line-names =
+       /*A0-A7*/       "","","","","","","","",
+       /*B0-B7*/       "BMC_FLASH_MUX_SEL","","","","","","","",
+       /*C0-C7*/       "","","","","","","","",
+       /*D0-D7*/       "","","","","","","","",
+       /*E0-E7*/       "","","","","","","","",
+       /*F0-F7*/       "","","","","","","","",
+       /*G0-G7*/       "","","","","","","","",
+       /*H0-H7*/       "","","","","","","","",
+       /*I0-I7*/       "","","","","","","","",
+       /*J0-J7*/       "","","","","","","","",
+       /*K0-K7*/       "","","","","","","","",
+       /*L0-L7*/       "","","","","","","","",
+       /*M0-M7*/       "","","","","","","","",
+       /*N0-N7*/       "BMC_FWSPI_RST_N","","GPIO_1_BMC_3V3","","","","","",
+       /*O0-O7*/       "JTAG_MUX_A","JTAG_MUX_B","","","","","","",
+       /*P0-P7*/       "","","","","","","","",
+       /*Q0-Q7*/       "","","","","","","","",
+       /*R0-R7*/       "","","","","","","","",
+       /*S0-S7*/       "","","","","","","","",
+       /*T0-T7*/       "","","","","","","","",
+       /*U0-U7*/       "","","","","","","","",
+       /*V0-V7*/       "","","","SCMFPGA_SPARE_GPIO1_3V3",
+                       "SCMFPGA_SPARE_GPIO2_3V3","SCMFPGA_SPARE_GPIO3_3V3",
+                       "SCMFPGA_SPARE_GPIO4_3V3","SCMFPGA_SPARE_GPIO5_3V3",
+       /*W0-W7*/       "","","","","","","","",
+       /*X0-X7*/       "","","","","","","","",
+       /*Y0-Y7*/       "","","","","","","","",
+       /*Z0-Z7*/       "","","","","","","","",
+       /*AA0-AA7*/     "","","","","","","","",
+       /*AB0-AB7*/     "","","","","","","","",
+       /*AC0-AC7*/     "","","","","","","","";
+};
+
+&gpio1 {
+       gpio-line-names =
+       /*A0-A7*/       "GPI_1_BMC_1V8","","","","","",
+                       "SCMFPGA_SPARE_GPIO1_1V8","SCMFPGA_SPARE_GPIO2_1V8",
+       /*B0-B7*/       "SCMFPGA_SPARE_GPIO3_1V8","SCMFPGA_SPARE_GPIO4_1V8",
+                       "SCMFPGA_SPARE_GPIO5_1V8","","","","","",
+       /*C0-C7*/       "","","","","","","","",
+       /*D0-D7*/       "","BMC_SPI1_RST_N","BIOS_FLASH_MUX_SEL","",
+                       "","TPM2_PIRQ_N","TPM2_RST_N","",
+       /*E0-E7*/       "","","","","","","","";
+};
+
+&i2c2 {
+       status = "okay";
+};
+
+&i2c4 {
+       status = "okay";
+};
+
+&i2c5 {
+       status = "okay";
+};
+
+&i2c6 {
+       status = "okay";
+};
+
+&i2c7 {
+       status = "okay";
+};
+
+&i2c8 {
+       status = "okay";
+};
+
+&i2c9 {
+       status = "okay";
+};
+
+&i2c10 {
+       status = "okay";
+};
+
+&i2c12 {
+       status = "okay";
+};
+
+&i2c13 {
+       status = "okay";
+};
+
+&i2c14 {
+       status = "okay";
+};
+
+&i2c15 {
+       status = "okay";
+};
+
+&vhub {
+       status = "okay";
+};
index 69e1bd2..46cbba6 100644 (file)
                compatible = "gpio-leds";
 
                BMC_HEARTBEAT_N {
-                       label="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";
+                       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";
+                       label = "FM_ID_LED_N";
                        gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_LOW>;
                        default-state = "off";
                };
index 7edf057..9dfd5de 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               btn {
+               button {
                        label = "Button";
                        gpios = <&pioC 4 GPIO_ACTIVE_LOW>;
                        linux,code = <0x103>;
index 5a81cab..2c718cf 100644 (file)
@@ -13,7 +13,7 @@
        model = "Laird Workgroup Bridge 50N - Project Gatwick";
        compatible = "laird,gatwick", "laird,wb50n", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
 
index 3b8812f..307663b 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               reset {
+               button-reset {
                        label = "PB_RST";
                        gpios = <&pioB 30 GPIO_ACTIVE_HIGH>;
                        linux,code = <0x100>;
                        wakeup-source;
                };
 
-               user {
+               button-user {
                        label = "PB_USER";
                        gpios = <&pioB 31 GPIO_ACTIVE_HIGH>;
                        linux,code = <0x101>;
index c08834d..e5e21df 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               prog {
+               button-prog {
                        label = "PB_PROG";
                        gpios = <&pioE 27 GPIO_ACTIVE_LOW>;
                        linux,code = <0x102>;
                        wakeup-source;
                };
 
-               reset {
+               button-reset {
                        label = "PB_RST";
                        gpios = <&pioE 29 GPIO_ACTIVE_LOW>;
                        linux,code = <0x100>;
                        wakeup-source;
                };
 
-               user {
+               button-user {
                        label = "PB_USER";
                        gpios = <&pioE 31 GPIO_ACTIVE_HIGH>;
                        linux,code = <0x101>;
index 2799b2a..7075df6 100644 (file)
@@ -55,7 +55,7 @@
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default" , "default", "default",
                                "default", "default" ;
                             &pinctrl_pio_zbe_rst>;
                pinctrl-4 = <&pinctrl_pio_input>;
 
-               SW1 {
+               switch-1 {
                        label = "SW1";
                        gpios = <&pioA PIN_PA29 GPIO_ACTIVE_LOW>;
                        linux,code = <0x101>;
                        wakeup-source;
                };
 
-               SW2 {
+               switch-2 {
                        label = "SW2";
                        gpios = <&pioA PIN_PA18 GPIO_ACTIVE_LOW>;
                        linux,code = <0x102>;
                        wakeup-source;
                };
 
-               SW3 {
+               switch-3 {
                        label = "SW3";
                        gpios = <&pioA PIN_PA22 GPIO_ACTIVE_LOW>;
                        linux,code = <0x103>;
                        wakeup-source;
                };
 
-               SW7 {
+               switch-7 {
                        label = "SW7";
                        gpios = <&pioA PIN_PA26 GPIO_ACTIVE_LOW>;
                        linux,code = <0x107>;
                        wakeup-source;
                };
 
-               SW8 {
+               switch-8 {
                        label = "SW8";
                        gpios = <&pioA PIN_PA24 GPIO_ACTIVE_LOW>;
                        linux,code = <0x108>;
 
 &pioA {
        pinctrl_key_gpio_default: key_gpio_default {
-               pinmux <PIN_PA22__GPIO>,
+               pinmux = <PIN_PA22__GPIO>,
                <PIN_PA24__GPIO>,
                <PIN_PA26__GPIO>,
                <PIN_PA29__GPIO>,
index 9c62289..42640fe 100644 (file)
 
        gpio_keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               prog {
+               key-prog {
                        label = "PB_PROG";
                        gpios = <&pioC 17 GPIO_ACTIVE_LOW>;
                        linux,code = <0x102>;
                        wakeup-source;
                };
 
-               reset {
+               key-reset {
                        label = "PB_RST";
                        gpios = <&pioC 16 GPIO_ACTIVE_LOW>;
                        linux,code = <0x100>;
index 4f12347..f71377c 100644 (file)
@@ -18,7 +18,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "Wakeup";
                        linux,code = <10>;
                        wakeup-source;
index 969d990..9d26f99 100644 (file)
 
        gpio_keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               user_pb {
+               button-user {
                        label = "user_pb";
                        gpios = <&pioB 10 GPIO_ACTIVE_LOW>;
                        linux,code = <28>;
index 7719ea3..3b5cbc9 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
-               status = "okay";
 
-               sw1 {
+               button-1 {
                        label = "SW1";
                        gpios = <&pioD 18 GPIO_ACTIVE_LOW>;
-                       linux,code=<KEY_PROG1>;
+                       linux,code = <KEY_PROG1>;
                        wakeup-source;
                };
        };
index a4623cc..8aa9e8d 100644 (file)
@@ -15,7 +15,7 @@
        compatible = "atmel,sama5d27-som1", "atmel,sama5d27", "atmel,sama5d2", "atmel,sama5";
 
        aliases {
-               i2c0    = &i2c0;
+               i2c0 = &i2c0;
        };
 
        clocks {
@@ -83,6 +83,8 @@
                        macb0: ethernet@f8008000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_macb0_default>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                phy-mode = "rmii";
 
                                ethernet-phy@7 {
index 08f0d4b..0dc6ca3 100644 (file)
@@ -21,8 +21,8 @@
                serial0 = &uart1;       /* DBGU */
                serial1 = &uart4;       /* mikro BUS 1 */
                serial2 = &uart2;       /* mikro BUS 2 */
-               i2c1    = &i2c1;
-               i2c2    = &i2c3;
+               i2c1 = &i2c1;
+               i2c2 = &i2c3;
        };
 
        chosen {
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
 
-               pb4 {
+               button {
                        label = "USER";
                        gpios = <&pioA PIN_PA29 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index ba62178..76b2025 100644 (file)
 &macb0 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_macb0_default>;
+       #address-cells = <1>;
+       #size-cells = <0>;
        phy-mode = "rmii";
 
        ethernet-phy@0 {
index 5e8755f..b665ddc 100644 (file)
                serial1 = &uart6;       /* BT */
                serial2 = &uart5;       /* mikro BUS 2 */
                serial3 = &uart3;       /* mikro BUS 1 */
-               i2c1    = &i2c1;
+               i2c1 = &i2c1;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
-               status = "okay";
 
-               sw4 {
+               button-1 {
                        label = "USER BUTTON";
                        gpios = <&pioA PIN_PB2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 806eb1d..48b5a3d 100644 (file)
@@ -24,8 +24,8 @@
                serial1 = &uart1;       /* mikro BUS 3 */
                serial3 = &uart3;       /* mikro BUS 2 */
                serial5 = &uart7;       /* flx2 */
-               i2c0    = &i2c0;
-               i2c1    = &i2c1;
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
        };
 
        chosen {
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
-               status = "okay";
 
-               sw4 {
+               button-1 {
                        label = "USER_PB1";
                        gpios = <&pioA PIN_PD0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 8ed58af..76a711b 100644 (file)
@@ -20,9 +20,9 @@
 
        aliases {
                serial0 = &uart0;       /* DBGU */
-               i2c0    = &i2c0;        /* mikroBUS 1 */
-               i2c1    = &i2c1;        /* XPRO EXT1 */
-               i2c2    = &i2c2;
+               i2c0 = &i2c0;   /* mikroBUS 1 */
+               i2c1 = &i2c1;   /* XPRO EXT1 */
+               i2c2 = &i2c2;
        };
 
        chosen {
                        macb0: ethernet@f8008000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                phy-mode = "rmii";
                                status = "okay";
 
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
 
-               bp1 {
+               button-1 {
                        label = "PB_USER";
                        gpios = <&pioA PIN_PA10 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index cdfe891..85949c2 100644 (file)
                        macb0: ethernet@f8008000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_macb0_default &pinctrl_macb0_phy_irq>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                phy-mode = "rmii";
                                status = "okay";
 
 
                                                        regulator-state-mem {
                                                                regulator-on-in-suspend;
-                                                               regulator-suspend-min-microvolt=<1400000>;
-                                                               regulator-suspend-max-microvolt=<1400000>;
+                                                               regulator-suspend-min-microvolt = <1400000>;
+                                                               regulator-suspend-max-microvolt = <1400000>;
                                                                regulator-changeable-in-suspend;
-                                                               regulator-mode=<ACT8945A_REGULATOR_MODE_LOWPOWER>;
+                                                               regulator-mode = <ACT8945A_REGULATOR_MODE_LOWPOWER>;
                                                        };
                                                };
 
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
 
-               bp1 {
+               button {
                        label = "PB_USER";
                        gpios = <&pioA PIN_PB9 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 443e8b0..14af1fd 100644 (file)
                        port@0 {
                                reg = <0>;
                                label = "lan1";
+                               phy-mode = "internal";
                        };
 
                        port@1 {
                                reg = <1>;
                                label = "lan2";
+                               phy-mode = "internal";
                        };
 
                        port@2 {
                                reg = <2>;
                                label = "lan3";
+                               phy-mode = "internal";
                        };
 
                        port@3 {
                                reg = <3>;
                                label = "lan4";
+                               phy-mode = "internal";
                        };
 
                        port@4 {
                                reg = <4>;
                                label = "lan5";
+                               phy-mode = "internal";
                        };
 
                        port@5 {
index a49c296..1f42a6a 100644 (file)
                regulator-always-on;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio>;
 
-               bp3 {
+               button {
                        label = "PB_USER";
                        gpios = <&pioE 29 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index e519d27..f122f30 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio>;
 
-               pb_user1 {
+               button {
                        label = "pb_user1";
                        gpios = <&pioE 8 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_PROG1>;
index 7017f62..fce4e93 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio>;
 
-               pb_user1 {
+               button {
                        label = "pb_user1";
                        gpios = <&pioE 13 GPIO_ACTIVE_HIGH>;
                        linux,code = <0x100>;
index 1035446..de44da2 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_key_gpio_default>;
 
-               bp1 {
+               button {
                        label = "PB_USER";
                        gpios = <&pioA PIN_PA12 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 54d130c..ef73f72 100644 (file)
        model = "Laird Workgroup Bridge 45N - Atmel AT91SAM (dt)";
        compatible = "laird,wb45n", "laird,wbxx", "atmel,at91sam9x5", "atmel,at91sam9";
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               irqbtn@18 {
-                       reg = <18>;
+               button {
                        label = "IRQBTN";
                        linux,code = <99>;
                        gpios = <&pioB 18 GPIO_ACTIVE_LOW>;
index 89f0f71..ec2becf 100644 (file)
        model = "Laird Workgroup Bridge 50N - Atmel SAMA5D";
        compatible = "laird,wb50n", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5";
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               btn0@10 {
-                       reg = <10>;
+               button-0 {
                        label = "BTNESC";
                        linux,code = <1>; /* ESC button */
                        gpios = <&pioA 10 GPIO_ACTIVE_LOW>;
                        wakeup-source;
                };
 
-               irqbtn@31 {
-                       reg = <31>;
+               button-1 {
                        label = "IRQBTN";
                        linux,code = <99>; /* SysReq button */
                        gpios = <&pioE 31 GPIO_ACTIVE_LOW>;
index 7368347..9d9820d 100644 (file)
                                clock-names = "slow_xtal", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&pmc PMC_TYPE_CORE PMC_SLOW>;
index 6381088..bb72f05 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               btn3 {
+               button-3 {
                        label = "Button 3";
                        gpios = <&pioA 30 GPIO_ACTIVE_LOW>;
                        linux,code = <0x103>;
                        wakeup-source;
                };
 
-               btn4 {
+               button-4 {
                        label = "Button 4";
                        gpios = <&pioA 31 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 7adc36c..259aca5 100644 (file)
                                clock-names = "slow_xtal", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&slow_xtal>;
index 6fb4fe4..88869ca 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               button_0 {
+               button-0 {
                        label = "button_0";
                        gpios = <&pioA 27 GPIO_ACTIVE_LOW>;
                        linux,code = <256>;
                        wakeup-source;
                };
 
-               button_1 {
+               button-1 {
                        label = "button_1";
                        gpios = <&pioA 26 GPIO_ACTIVE_LOW>;
                        linux,code = <257>;
                        wakeup-source;
                };
 
-               button_2 {
+               button-2 {
                        label = "button_2";
                        gpios = <&pioA 25 GPIO_ACTIVE_LOW>;
                        linux,code = <258>;
                        wakeup-source;
                };
 
-               button_3 {
+               button-3 {
                        label = "button_3";
                        gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
                        linux,code = <259>;
index fe45d96..c080df8 100644 (file)
                                clock-names = "t0_clk", "slow_clk";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&slow_xtal>;
index e732565..ce8baff 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               left_click {
+               button-left-click {
                        label = "left_click";
                        gpios = <&pioC 5 GPIO_ACTIVE_LOW>;
                        linux,code = <272>;
                        wakeup-source;
                };
 
-               right_click {
+               button-right-click {
                        label = "right_click";
                        gpios = <&pioC 4 GPIO_ACTIVE_LOW>;
                        linux,code = <273>;
index 85c17dd..60d6129 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               btn3 {
+               button-3 {
                        label = "Button 3";
                        gpios = <&pioA 30 GPIO_ACTIVE_LOW>;
                        linux,code = <0x103>;
                        wakeup-source;
                };
 
-               btn4 {
+               button-4 {
                        label = "Button 4";
                        gpios = <&pioA 31 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 7da70ae..92f2c05 100644 (file)
@@ -23,7 +23,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               user_btn1 {
+               button {
                        label = "USER_BTN1";
                        gpios = <&pioA 24 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PROG1>;
index 2ab730f..0979456 100644 (file)
                                clock-names = "slow_clk", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9g45-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&clk32k>;
index e5db198..7f45e81 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               left_click {
+               button-left-click {
                        label = "left_click";
                        gpios = <&pioB 6 GPIO_ACTIVE_LOW>;
                        linux,code = <272>;
                        wakeup-source;
                };
 
-               right_click {
+               button-right-click {
                        label = "right_click";
                        gpios = <&pioB 7 GPIO_ACTIVE_LOW>;
                        linux,code = <273>;
                        wakeup-source;
                };
 
-               left {
+               button-left {
                        label = "Joystick Left";
                        gpios = <&pioB 14 GPIO_ACTIVE_LOW>;
                        linux,code = <105>;
                };
 
-               right {
+               button-right {
                        label = "Joystick Right";
                        gpios = <&pioB 15 GPIO_ACTIVE_LOW>;
                        linux,code = <106>;
                };
 
-               up {
+               button-up {
                        label = "Joystick Up";
                        gpios = <&pioB 16 GPIO_ACTIVE_LOW>;
                        linux,code = <103>;
                };
 
-               down {
+               button-down {
                        label = "Joystick Down";
                        gpios = <&pioB 17 GPIO_ACTIVE_LOW>;
                        linux,code = <108>;
                };
 
-               enter {
+               button-enter {
                        label = "Joystick Press";
                        gpios = <&pioB 18 GPIO_ACTIVE_LOW>;
                        linux,code = <28>;
index 0785389..556f35c 100644 (file)
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                        };
 
-                       rstc@fffffe00 {
+                       reset-controller@fffffe00 {
                                compatible = "atmel,at91sam9g45-rstc";
                                reg = <0xfffffe00 0x10>;
                                clocks = <&clk32k>;
index c905d7b..4c644d4 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               enter {
+               button-enter {
                        label = "Enter";
                        gpios = <&pioB 3 GPIO_ACTIVE_LOW>;
                        linux,code = <28>;
index 730d118..12c6348 100644 (file)
                                clock-names = "slow_clk", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&clk32k>;
index ddaadfe..a573512 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               right_click {
+               button-right-click {
                        label = "right_click";
                        gpios = <&pioB 0 GPIO_ACTIVE_LOW>;
                        linux,code = <273>;
                        wakeup-source;
                };
 
-               left_click {
+               button-left-click {
                        label = "left_click";
                        gpios = <&pioB 1 GPIO_ACTIVE_LOW>;
                        linux,code = <272>;
index 395e883..ea3b113 100644 (file)
                                clock-names = "slow_clk", "main_xtal";
                        };
 
-                       reset_controller: rstc@fffffe00 {
+                       reset_controller: reset-controller@fffffe00 {
                                compatible = "atmel,at91sam9g45-rstc";
                                reg = <0xfffffe00 0x10>;
                                clocks = <&clk32k>;
index 3bcf4e0..f13ef80 100644 (file)
@@ -73,7 +73,7 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x00>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
@@ -81,7 +81,7 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x01>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
@@ -89,7 +89,7 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x02>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
@@ -97,7 +97,7 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x03>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x100>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x101>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x102>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x103>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x200>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x201>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x202>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x203>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x300>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x301>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x302>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
 
                        device_type = "cpu";
                        compatible = "arm,cortex-a15";
                        reg = <0x303>;
-                       clock-frequency= <1400000000>;
+                       clock-frequency = <1400000000>;
                        cpu-release-addr = <0>; // Fixed by the boot loader
                };
        };
index f4d2fc2..c53d9eb 100644 (file)
 &expgpio {
        gpio-line-names = "BT_ON",
                          "WL_ON",
-                         "",
+                         "PWR_LED_OFF",
                          "GLOBAL_RESET",
                          "VDD_SD_IO_SEL",
-                         "CAM_GPIO",
+                         "GLOBAL_SHUTDOWN",
                          "SD_PWR_ON",
-                         "SD_OC_N";
+                         "SHUTDOWN_REQUEST";
 };
 
 &genet_mdio {
index ca266c5..98817a6 100644 (file)
        };
 };
 
+&v3d {
+       clocks = <&firmware_clocks 5>;
+};
+
 &vchiq {
        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
 };
index 89af574..941c4d1 100644 (file)
                };
 
                pm: watchdog@7e100000 {
-                       compatible = "brcm,bcm2835-pm", "brcm,bcm2835-pm-wdt";
+                       compatible = "brcm,bcm2711-pm", "brcm,bcm2835-pm-wdt";
                        #power-domain-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x7e100000 0x114>,
                              <0x7e00a000 0x24>,
                              <0x7ec11000 0x20>;
+                       reg-names = "pm", "asb", "rpivid_asb";
                        clocks = <&clocks BCM2835_CLOCK_V3D>,
                                 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
                                 <&clocks BCM2835_CLOCK_H264>,
                                #size-cells = <0x0>;
                        };
                };
+
+               v3d: gpu@7ec00000 {
+                       compatible = "brcm,2711-v3d";
+                       reg = <0x0 0x7ec00000 0x4000>,
+                             <0x0 0x7ec04000 0x4000>;
+                       reg-names = "hub", "core0";
+
+                       power-domains = <&pm BCM2835_POWER_DOMAIN_GRAFX_V3D>;
+                       resets = <&pm BCM2835_RESET_V3D>;
+                       interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+               };
        };
 };
 
index ead6e98..78465ad 100644 (file)
        };
 
        i2c@3e016000 {
-               status="okay";
+               status = "okay";
                clock-frequency = <400000>;
        };
 
        i2c@3e017000 {
-               status="okay";
+               status = "okay";
                clock-frequency = <400000>;
        };
 
        i2c@3e018000 {
-               status="okay";
+               status = "okay";
                clock-frequency = <400000>;
        };
 
        i2c@3500d000 {
-               status="okay";
+               status = "okay";
                clock-frequency = <100000>;
 
                pmu: pmu@8 {
index c25e797..a037d2b 100644 (file)
@@ -62,6 +62,7 @@
                        #reset-cells = <1>;
                        reg = <0x7e100000 0x114>,
                              <0x7e00a000 0x24>;
+                       reg-names = "pm", "asb";
                        clocks = <&clocks BCM2835_CLOCK_V3D>,
                                 <&clocks BCM2835_CLOCK_PERI_IMAGE>,
                                 <&clocks BCM2835_CLOCK_H264>,
index c113661..d2d9c6e 100644 (file)
@@ -50,9 +50,9 @@
 
                        trips {
                                cpu-crit {
-                                       temperature     = <90000>;
-                                       hysteresis      = <0>;
-                                       type            = "critical";
+                                       temperature = <90000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
                                };
                        };
 
                        clocks = <&clocks BCM2835_CLOCK_VPU>,
                                 <&clocks BCM2835_CLOCK_DPI>;
                        clock-names = "core", "pixel";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
                        status = "disabled";
                };
 
index 8ed4037..09ee3e4 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
index 667b118..32619c6 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               brightness {
+               button-brightness {
                        label = "Backlight";
                        linux,code = <KEY_BRIGHTNESS_ZERO>;
                        gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
                };
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
index d659e40..a658b9b 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
                };
 
-               aoss {
+               button-aoss {
                        label = "AOSS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>;
                };
 
                /* Commit mode set by switch? */
-               mode {
+               button-mode {
                        label = "Mode";
                        linux,code = <KEY_SETUP>;
                        gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
                };
 
                /* Switch: AP mode */
-               sw_ap {
+               button-sw-ap {
                        label = "AP";
                        linux,code = <BTN_0>;
                        gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
                };
 
-               eject {
+               button-eject {
                        label = "USB eject";
                        linux,code = <KEY_EJECTCD>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
index ff31ce4..f8f5345 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
                };
 
-               aoss {
+               button-aoss {
                        label = "AOSS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 12 GPIO_ACTIVE_LOW>;
                };
 
                /* Commit mode set by switch? */
-               mode {
+               button-mode {
                        label = "Mode";
                        linux,code = <KEY_SETUP>;
                        gpios = <&chipcommon 13 GPIO_ACTIVE_LOW>;
                };
 
                /* Switch: AP mode */
-               sw_ap {
+               button-sw-ap {
                        label = "AP";
                        linux,code = <BTN_0>;
                        gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
                };
 
-               eject {
+               button-eject {
                        label = "USB eject";
                        linux,code = <KEY_EJECTCD>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
index 5bac1e1..0ed25bf 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index cd797b4..f1412ba 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index 5b4a481..14ee410 100644 (file)
@@ -45,7 +45,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index c81944c..600ab08 100644 (file)
@@ -52,7 +52,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
index 43a5d67..fd6d8d2 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
                };
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
index 4c60eda..76fc109 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
                };
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
index 9ca6d1b..6bcdfb7 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index 0e273c5..ca47cc4 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index d00495a..0edc254 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               aoss {
+               button-aoss {
                        label = "AOSS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
                };
 
                /* Switch device mode? */
-               mode {
+               button-mode {
                        label = "Mode";
                        linux,code = <KEY_SETUP>;
                        gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
                };
 
-               eject {
+               button-eject {
                        label = "USB eject";
                        linux,code = <KEY_EJECTCD>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
index 8b1a05a..1f0998f 100644 (file)
@@ -96,7 +96,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index 68aaf0a..c8c0237 100644 (file)
@@ -45,7 +45,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index 9316a36..3b35a7a 100644 (file)
@@ -94,7 +94,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index 12e34a0..19a7971 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
index 7546c8d..f52a75c 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 2 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
index beae9ea..5ff6c58 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               power {
+               button-power {
                        label = "Power";
                        linux,code = <KEY_POWER>;
                        gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
                };
 
-               aoss {
+               button-aoss {
                        label = "AOSS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>;
                };
 
                /* Commit mode set by switch? */
-               mode {
+               button-mode {
                        label = "Mode";
                        linux,code = <KEY_SETUP>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
                };
 
                /* Switch: AP mode */
-               sw_ap {
+               button-sw-ap {
                        label = "AP";
                        linux,code = <BTN_0>;
                        gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
                };
 
-               eject {
+               button-eject {
                        label = "USB eject";
                        linux,code = <KEY_EJECTCD>;
                        gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
index 7879f7d..99253fd 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index 56d309d..de961fb 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
                };
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
index 89f992a..087f7f6 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 5 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
                };
 
-               brightness {
+               button-brightness {
                        label = "Backlight";
                        linux,code = <KEY_BRIGHTNESS_ZERO>;
                        gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
index c2a266a..11d1068 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 0 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
index d850375..a5fec56 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
                };
 
-               reset {
+               button-reset {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
                };
 
-               wifi {
+               button-wifi {
                        label = "Wi-Fi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 18 GPIO_ACTIVE_LOW>;
                };
 
-               led {
+               button-led {
                        label = "Backlight";
                        linux,code = <KEY_BRIGHTNESS_ZERO>;
                        gpios = <&chipcommon 4 GPIO_ACTIVE_LOW>;
index 60bfd52..2c38b64 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
                /* Switch: router / extender */
-               extender {
+               button-extender {
                        label = "Extender";
                        linux,code = <BTN_0>;
                        gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index 9bef6b9..86c7cc0 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
                };
 
-               rfkill {
+               button-rfkill {
                                label = "WiFi";
                                linux,code = <KEY_RFKILL>;
                                gpios = <&chipcommon 16 GPIO_ACTIVE_LOW>;
                };
 
-               reset {
+               button-reset {
                                label = "Reset";
                                linux,code = <KEY_RESTART>;
                                gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index b51a0ee..9ad15bc 100644 (file)
@@ -49,7 +49,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index 6fa101f..ee24d37 100644 (file)
@@ -43,7 +43,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index b959a95..6549d07 100644 (file)
@@ -49,7 +49,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index b0d8a68..654fcce 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 19 GPIO_ACTIVE_LOW>;
index cbe8c8e..bf053a2 100644 (file)
@@ -89,7 +89,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index 9efcb24..78a90dd 100644 (file)
@@ -67,7 +67,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index 42097a4..f850dce 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               brightness {
+               button-brightness {
                        label = "Backlight";
                        linux,code = <KEY_BRIGHTNESS_ZERO>;
                        gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 10 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 14 GPIO_ACTIVE_LOW>;
                };
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 20 GPIO_ACTIVE_LOW>;
index a2566ad..3bf6e24 100644 (file)
@@ -22,7 +22,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
index 57ca1cf..e20b6d2 100644 (file)
@@ -39,7 +39,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
index 2e1a7e3..9d86357 100644 (file)
@@ -49,7 +49,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
index 07eb3a8..55b9264 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               rfkill {
+               button-rfkill {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&chipcommon 3 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
index c016e12..2df0452 100644 (file)
@@ -32,6 +32,7 @@
                        next-level-cache = <&L2_0>;
                        enable-method = "psci";
                };
+
                CA7_2: cpu@2 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a7";
@@ -39,6 +40,7 @@
                        next-level-cache = <&L2_0>;
                        enable-method = "psci";
                };
+
                CA7_3: cpu@3 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a7";
@@ -46,6 +48,7 @@
                        next-level-cache = <&L2_0>;
                        enable-method = "psci";
                };
+
                L2_0: l2-cache0 {
                        compatible = "cache";
                };
@@ -76,6 +79,7 @@
                        #clock-cells = <0>;
                        clock-frequency = <200000000>;
                };
+
                uart_clk: uart-clk {
                        compatible = "fixed-factor-clock";
                        #clock-cells = <0>;
        psci {
                compatible = "arm,psci-0.2";
                method = "smc";
-               cpu_off = <1>;
-               cpu_on = <2>;
        };
 
        axi@81000000 {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
-               ranges = <0 0x81000000 0x818000>;
+               ranges = <0 0x81000000 0x8000>;
 
                gic: interrupt-controller@1000 {
                        compatible = "arm,cortex-a7-gic";
                        #interrupt-cells = <3>;
-                       #address-cells = <0>;
                        interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
                        reg = <0x1000 0x1000>,
-                               <0x2000 0x2000>;
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
                };
        };
 
diff --git a/arch/arm/boot/dts/bcm53015-meraki-mr26.dts b/arch/arm/boot/dts/bcm53015-meraki-mr26.dts
new file mode 100644 (file)
index 0000000..14f5803
--- /dev/null
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Broadcom BCM470X / BCM5301X ARM platform code.
+ * DTS for Meraki MR26 / Codename: Venom
+ *
+ * Copyright (C) 2022 Christian Lamparter <chunkeey@gmail.com>
+ */
+
+/dts-v1/;
+
+#include "bcm4708.dtsi"
+#include "bcm5301x-nand-cs0-bch8.dtsi"
+#include <dt-bindings/leds/common.h>
+
+/ {
+       compatible = "meraki,mr26", "brcm,bcm53015", "brcm,bcm4708";
+       model = "Meraki MR26";
+
+       memory@0 {
+               reg = <0x00000000 0x08000000>;
+               device_type = "memory";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led-0 {
+                       function = LED_FUNCTION_FAULT;
+                       color = <LED_COLOR_ID_AMBER>;
+                       gpios = <&chipcommon 13 GPIO_ACTIVE_HIGH>;
+                       panic-indicator;
+               };
+               led-1 {
+                       function = LED_FUNCTION_INDICATOR;
+                       color = <LED_COLOR_ID_WHITE>;
+                       gpios = <&chipcommon 12 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               key-restart {
+                       label = "Reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&uart0 {
+       clock-frequency = <50000000>;
+       /delete-property/ clocks;
+};
+
+&uart1 {
+       status = "disabled";
+};
+
+&gmac0 {
+       status = "okay";
+};
+
+&gmac1 {
+       status = "disabled";
+};
+&gmac2 {
+       status = "disabled";
+};
+&gmac3 {
+       status = "disabled";
+};
+
+&nandcs {
+       nand-ecc-algo = "hw";
+
+       partitions {
+               compatible = "fixed-partitions";
+               #address-cells = <0x1>;
+               #size-cells = <0x1>;
+
+               partition@0 {
+                       label = "u-boot";
+                       reg = <0x0 0x200000>;
+                       read-only;
+               };
+
+               partition@200000 {
+                       label = "u-boot-env";
+                       reg = <0x200000 0x200000>;
+                       /* empty */
+               };
+
+               partition@400000 {
+                       label = "u-boot-backup";
+                       reg = <0x400000 0x200000>;
+                       /* empty */
+               };
+
+               partition@600000 {
+                       label = "u-boot-env-backup";
+                       reg = <0x600000 0x200000>;
+                       /* empty */
+               };
+
+               partition@800000 {
+                       label = "ubi";
+                       reg = <0x800000 0x7780000>;
+               };
+       };
+};
+
+&srab {
+       status = "okay";
+
+       ports {
+               port@0 {
+                       reg = <0>;
+                       label = "poe";
+               };
+
+               port@5 {
+                       reg = <5>;
+                       label = "cpu";
+                       ethernet = <&gmac0>;
+
+                       fixed-link {
+                               speed = <1000>;
+                               duplex-full;
+                       };
+               };
+       };
+};
+
+&i2c0 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinmux_i2c>;
+
+       clock-frequency = <100000>;
+
+       ina219@40 {
+               compatible = "ti,ina219"; /* PoE power */
+               reg = <0x40>;
+               shunt-resistor = <60000>; /* = 60 mOhms */
+       };
+
+       eeprom@56 {
+               compatible = "atmel,24c64";
+               reg = <0x56>;
+               pagesize = <32>;
+               read-only;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               /* it's empty */
+       };
+};
+
+&thermal {
+       status = "disabled";
+       /* does not work, reads 418 degree Celsius */
+};
index daca63f..e678bc0 100644 (file)
 
        keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 21 GPIO_ACTIVE_LOW>;
index 65f8a75..5fc1b84 100644 (file)
 
                        trips {
                                cpu-crit {
-                                       temperature     = <125000>;
-                                       hysteresis      = <0>;
-                                       type            = "critical";
+                                       temperature = <125000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
                                };
                        };
 
index cca49a2..b774a8d 100644 (file)
@@ -9,8 +9,8 @@
 / {
        #address-cells = <1>;
        #size-cells = <1>;
-       compatible = "brcm,bcm63138";
-       model = "Broadcom BCM63138 DSL SoC";
+       compatible = "brcm,bcm63138", "brcm,bcmbca";
+       model = "Broadcom BCM963138 Reference Board";
        interrupt-parent = <&gic>;
 
        aliases {
diff --git a/arch/arm/boot/dts/bcm63148.dtsi b/arch/arm/boot/dts/bcm63148.dtsi
new file mode 100644 (file)
index 0000000..df5307b
--- /dev/null
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "brcm,bcm63148", "brcm,bcmbca";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               B15_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "brcm,brahma-b15";
+                       reg = <0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B15_1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "brcm,brahma-b15";
+                       reg = <0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       timer {
+               compatible = "arm,armv7-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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a15-pmu";
+               interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&B15_0>, <&B15_1>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <50000000>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@80030000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x80030000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,cortex-a15-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
+                                       IRQ_TYPE_LEVEL_HIGH)>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0xfffe8000 0x8000>;
+
+               uart0: serial@600 {
+                       compatible = "brcm,bcm6345-uart";
+                       reg = <0x600 0x20>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&periph_clk>;
+                       clock-names = "refclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm63178.dtsi b/arch/arm/boot/dts/bcm63178.dtsi
new file mode 100644 (file)
index 0000000..5463443
--- /dev/null
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "brcm,bcm63178", "brcm,bcmbca";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               CA7_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+               CA7_2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&CA7_0>, <&CA7_1>,
+                       <&CA7_2>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+               cpu_off = <1>;
+               cpu_on = <2>;
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x81000000 0x4000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,cortex-a7-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm6756.dtsi b/arch/arm/boot/dts/bcm6756.dtsi
new file mode 100644 (file)
index 0000000..ce1b59f
--- /dev/null
@@ -0,0 +1,130 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "brcm,bcm6756", "brcm,bcmbca";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               CA7_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x3>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupts = <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>;
+               interrupt-affinity = <&CA7_0>, <&CA7_1>,
+                       <&CA7_2>, <&CA7_3>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,cortex-a7-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm6846.dtsi b/arch/arm/boot/dts/bcm6846.dtsi
new file mode 100644 (file)
index 0000000..e610c10
--- /dev/null
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "brcm,bcm6846", "brcm,bcmbca";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               CA7_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&CA7_0>, <&CA7_1>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+               cpu_off = <1>;
+               cpu_on = <2>;
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x81000000 0x4000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,cortex-a7-gic";
+                       #interrupt-cells = <3>;
+                       #address-cells = <0>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0xff800000 0x800000>;
+
+               uart0: serial@640 {
+                       compatible = "brcm,bcm6345-uart";
+                       reg = <0x640 0x1b>;
+                       interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&periph_clk>;
+                       clock-names = "refclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm6855.dtsi b/arch/arm/boot/dts/bcm6855.dtsi
new file mode 100644 (file)
index 0000000..620f51a
--- /dev/null
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "brcm,bcm6855", "brcm,bcmbca";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               CA7_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       timer {
+               compatible = "arm,armv7-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(3) | IRQ_TYPE_LEVEL_LOW)>,
+                       <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(3) | IRQ_TYPE_LEVEL_LOW)>,
+                       <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(3) | IRQ_TYPE_LEVEL_LOW)>,
+                       <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(3) | IRQ_TYPE_LEVEL_LOW)>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&CA7_0>, <&CA7_1>, <&CA7_2>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,cortex-a7-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(3) | IRQ_TYPE_LEVEL_HIGH)>;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/bcm6878.dtsi b/arch/arm/boot/dts/bcm6878.dtsi
new file mode 100644 (file)
index 0000000..a7dff59
--- /dev/null
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       compatible = "brcm,bcm6878", "brcm,bcmbca";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               CA7_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               CA7_1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a7";
+                       reg = <0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&CA7_0>, <&CA7_1>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,cortex-a7-gic";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
+                                       IRQ_TYPE_LEVEL_HIGH)>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
index a76c74b..363009e 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               hook {
+               button-hook {
                        label = "HOOK";
                        linux,code = <KEY_O>;
                        gpios = <&gpio_asiu 48 0>;
index b0b8c77..16e70a2 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 7 GPIO_ACTIVE_HIGH>;
                };
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 9 GPIO_ACTIVE_LOW>;
index dd63a14..4fe3b36 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wps {
+               button-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&chipcommon 6 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               button-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&chipcommon 15 GPIO_ACTIVE_LOW>;
index 58b7d9f..c54451d 100644 (file)
@@ -13,7 +13,7 @@
                autorepeat;
                poll-interval = <20>;
 
-               reset {
+               button-reset {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
index 576cfc5..1830844 100644 (file)
@@ -14,7 +14,7 @@
                autorepeat;
                poll-interval = <20>;
 
-               reset {
+               button-reset {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpioa 6 GPIO_ACTIVE_LOW>;
diff --git a/arch/arm/boot/dts/bcm963138.dts b/arch/arm/boot/dts/bcm963138.dts
new file mode 100644 (file)
index 0000000..d28c4f1
--- /dev/null
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm63138.dtsi"
+
+/ {
+       model = "Broadcom BCM963138 Reference Board";
+       compatible = "brcm,bcm963138", "brcm,bcm63138", "brcm,bcmbca";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &serial0;
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&serial0 {
+       status = "okay";
+};
index df5c8ab..15bec75 100644 (file)
@@ -8,7 +8,7 @@
 #include "bcm63138.dtsi"
 
 / {
-       compatible = "brcm,BCM963138DVT", "brcm,bcm63138";
+       compatible = "brcm,BCM963138DVT", "brcm,bcm63138", "brcm,bcmbca";
        model = "Broadcom BCM963138DVT";
 
        chosen {
diff --git a/arch/arm/boot/dts/bcm963148.dts b/arch/arm/boot/dts/bcm963148.dts
new file mode 100644 (file)
index 0000000..98f6a6d
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2019 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm63148.dtsi"
+
+/ {
+       model = "Broadcom BCM963148 Reference Board";
+       compatible = "brcm,bcm963148", "brcm,bcm63148", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm963178.dts b/arch/arm/boot/dts/bcm963178.dts
new file mode 100644 (file)
index 0000000..fa096e9
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2019 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm63178.dtsi"
+
+/ {
+       model = "Broadcom BCM963178 Reference Board";
+       compatible = "brcm,bcm963178", "brcm,bcm63178", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm96756.dts b/arch/arm/boot/dts/bcm96756.dts
new file mode 100644 (file)
index 0000000..9a4a87b
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2019 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6756.dtsi"
+
+/ {
+       model = "Broadcom BCM96756 Reference Board";
+       compatible = "brcm,bcm96756", "brcm,bcm6756", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm96846.dts b/arch/arm/boot/dts/bcm96846.dts
new file mode 100644 (file)
index 0000000..c70ebcc
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6846.dtsi"
+
+/ {
+       model = "Broadcom BCM96846 Reference Board";
+       compatible = "brcm,bcm96846", "brcm,bcm6846", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm96855.dts b/arch/arm/boot/dts/bcm96855.dts
new file mode 100644 (file)
index 0000000..4438152
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2019 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6855.dtsi"
+
+/ {
+       model = "Broadcom BCM96855 Reference Board";
+       compatible = "brcm,bcm96855", "brcm,bcm6855", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/bcm96878.dts b/arch/arm/boot/dts/bcm96878.dts
new file mode 100644 (file)
index 0000000..8fbc175
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2019 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6878.dtsi"
+
+/ {
+       model = "Broadcom BCM96878 Reference Board";
+       compatible = "brcm,bcm96878", "brcm,bcm6878", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index e9aecac..1fdd9a2 100644 (file)
                enable-gpios = <&gpio 40 GPIO_ACTIVE_HIGH>; /* lcd_panel_pwr */
 
                panel-info {
-                       ac-bias         = <255>;
-                       ac-bias-intrpt  = <0>;
-                       dma-burst-sz    = <16>;
-                       bpp             = <16>;
-                       fdd             = <0x80>;
-                       sync-edge       = <0>;
-                       sync-ctrl       = <1>;
-                       raster-order    = <0>;
-                       fifo-th         = <0>;
+                       ac-bias = <255>;
+                       ac-bias-intrpt = <0>;
+                       dma-burst-sz = <16>;
+                       bpp = <16>;
+                       fdd = <0x80>;
+                       sync-edge = <0>;
+                       sync-ctrl = <1>;
+                       raster-order = <0>;
+                       fifo-th = <0>;
                };
 
                display-timings {
index 0386376..e46e4d2 100644 (file)
                edma0: edma@0 {
                        compatible = "ti,edma3-tpcc";
                        /* eDMA3 CC0: 0x01c0 0000 - 0x01c0 7fff */
-                       reg =   <0x0 0x8000>;
+                       reg = <0x0 0x8000>;
                        reg-names = "edma3_cc";
                        interrupts = <11 12>;
                        interrupt-names = "edma3_ccint", "edma3_ccerrint";
                };
                edma0_tptc0: tptc@8000 {
                        compatible = "ti,edma3-tptc";
-                       reg =   <0x8000 0x400>;
+                       reg = <0x8000 0x400>;
                        interrupts = <13>;
                        interrupt-names = "edm3_tcerrint";
                        power-domains = <&psc0 1>;
                };
                edma0_tptc1: tptc@8400 {
                        compatible = "ti,edma3-tptc";
-                       reg =   <0x8400 0x400>;
+                       reg = <0x8400 0x400>;
                        interrupts = <32>;
                        interrupt-names = "edm3_tcerrint";
                        power-domains = <&psc0 2>;
                edma1: edma@230000 {
                        compatible = "ti,edma3-tpcc";
                        /* eDMA3 CC1: 0x01e3 0000 - 0x01e3 7fff */
-                       reg =   <0x230000 0x8000>;
+                       reg = <0x230000 0x8000>;
                        reg-names = "edma3_cc";
                        interrupts = <93 94>;
                        interrupt-names = "edma3_ccint", "edma3_ccerrint";
                };
                edma1_tptc0: tptc@238000 {
                        compatible = "ti,edma3-tptc";
-                       reg =   <0x238000 0x400>;
+                       reg = <0x238000 0x400>;
                        interrupts = <95>;
                        interrupt-names = "edm3_tcerrint";
                        power-domains = <&psc1 21>;
 
                        cppi41dma: dma-controller@201000 {
                                compatible = "ti,da830-cppi41";
-                               reg =  <0x201000 0x1000
+                               reg = <0x201000 0x1000
                                        0x202000 0x1000
                                        0x204000 0x4000>;
                                reg-names = "controller",
index 8ef48c0..fe3f9a9 100644 (file)
@@ -51,7 +51,7 @@
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "micron,mt29f2g16aadwp";
+               linux,mtd-name = "micron,mt29f2g16aadwp";
                #address-cells = <1>;
                #size-cells = <1>;
                ti,nand-ecc-opt = "bch8";
index 778796c..244a957 100644 (file)
 
        nand@0,0 {
                compatible = "ti,omap2-nand";
-               linux,mtd-name= "micron,mt29f2g16aadwp";
+               linux,mtd-name = "micron,mt29f2g16aadwp";
                reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
index c16e183..577114c 100644 (file)
@@ -51,7 +51,7 @@
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "micron,mt29f2g16aadwp";
+               linux,mtd-name = "micron,mt29f2g16aadwp";
                #address-cells = <1>;
                #size-cells = <1>;
                ti,nand-ecc-opt = "bch8";
index bc4ae91..931db79 100644 (file)
@@ -90,8 +90,8 @@
                clocks = <&dpll_gmac_x2_ck>;
                ti,max-div = <63>;
                reg = <0x03fc>;
-               ti,bit-shift=<20>;
-               ti,latch-bit=<26>;
+               ti,bit-shift = <20>;
+               ti,latch-bit = <26>;
                assigned-clocks = <&dpll_gmac_h14x2_ctrl_ck>;
                assigned-clock-rates = <80000000>;
        };
                clocks = <&dpll_gmac_ck>, <&dpll_gmac_h14x2_ctrl_ck>;
                reg = <0x3fc>;
                ti,bit-shift = <29>;
-               ti,latch-bit=<26>;
+               ti,latch-bit = <26>;
                assigned-clocks = <&dpll_gmac_h14x2_ctrl_mux_ck>;
                assigned-clock-parents = <&dpll_gmac_h14x2_ctrl_ck>;
        };
index 1a49f15..935e235 100644 (file)
        gpio_keys: gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               cover {
+               key-cover {
                        label = "Cover";
                        gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
                        linux,code = <SW_LID>;
index 156de65..27ef9a6 100644 (file)
        gpio_keys: gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio4 25 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               cover {
+               key-cover {
                        label = "Cover";
                        gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
                        linux,code = <SW_LID>;
                        wakeup-source;
                };
 
-               pageup {
+               key-pageup {
                        label = "PageUp";
                        gpios = <&gpio4 0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PAGEUP>;
                };
 
-               pagedown {
+               key-pagedown {
                        label = "PageDown";
                        gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_PAGEDOWN>;
index 57a028a..ce5221c 100644 (file)
@@ -9,11 +9,11 @@
        };
 
        psci {
-               compatible      = "arm,psci";
-               method          = "smc";
-               cpu_suspend     = <0x84000002>;
-               cpu_off         = <0x84000004>;
-               cpu_on          = <0x84000006>;
+               compatible = "arm,psci";
+               method = "smc";
+               cpu_suspend = <0x84000002>;
+               cpu_off = <0x84000004>;
+               cpu_on = <0x84000006>;
        };
 
        soc {
index a8d8bb0..f23a25c 100644 (file)
 &gpio1 {
        status = "okay";
 };
+
+&pcie0 {
+       status = "okay";
+};
+
+&pcie1 {
+       status = "okay";
+};
index 36597f5..7f83933 100644 (file)
@@ -3,6 +3,7 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/en7523-clk.h>
 
 / {
        interrupt-parent = <&gic>;
                };
        };
 
+       scu: system-controller@1fa20000 {
+               compatible = "airoha,en7523-scu";
+               reg = <0x1fa20000 0x400>,
+                     <0x1fb00000 0x1000>;
+               #clock-cells = <1>;
+       };
+
        gic: interrupt-controller@9000000 {
                compatible = "arm,gic-v3";
                interrupt-controller;
                gpio-controller;
                #gpio-cells = <2>;
        };
+
+       pcie0: pcie@1fa91000 {
+               compatible = "airoha,en7523-pcie", "mediatek,mt7622-pcie";
+               device_type = "pci";
+               reg = <0x1fa91000 0x1000>;
+               reg-names = "port0";
+               linux,pci-domain = <0>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "pcie_irq";
+               clocks = <&scu EN7523_CLK_PCIE>;
+               clock-names = "sys_ck0";
+               bus-range = <0x00 0xff>;
+               ranges = <0x82000000 0 0x20000000  0x20000000  0 0x8000000>;
+               status = "disabled";
+
+               #interrupt-cells = <1>;
+               interrupt-map-mask = <0 0 0 7>;
+               interrupt-map = <0 0 0 1 &pcie_intc0 0>,
+                               <0 0 0 2 &pcie_intc0 1>,
+                               <0 0 0 3 &pcie_intc0 2>,
+                               <0 0 0 4 &pcie_intc0 3>;
+               pcie_intc0: interrupt-controller {
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <1>;
+               };
+       };
+
+       pcie1: pcie@1fa92000 {
+               compatible = "airoha,en7523-pcie", "mediatek,mt7622-pcie";
+               device_type = "pci";
+               reg = <0x1fa92000 0x1000>;
+               reg-names = "port1";
+               linux,pci-domain = <1>;
+               #address-cells = <3>;
+               #size-cells = <2>;
+               interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "pcie_irq";
+               clocks = <&scu EN7523_CLK_PCIE>;
+               clock-names = "sys_ck1";
+               bus-range = <0x00 0xff>;
+               ranges = <0x82000000 0 0x28000000  0x28000000  0 0x8000000>;
+               status = "disabled";
+
+               #interrupt-cells = <1>;
+               interrupt-map-mask = <0 0 0 7>;
+               interrupt-map = <0 0 0 1 &pcie_intc1 0>,
+                               <0 0 0 2 &pcie_intc1 1>,
+                               <0 0 0 3 &pcie_intc1 2>,
+                               <0 0 0 4 &pcie_intc1 3>;
+               pcie_intc1: interrupt-controller {
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       #interrupt-cells = <1>;
+               };
+       };
 };
diff --git a/arch/arm/boot/dts/exynos-pinctrl.h b/arch/arm/boot/dts/exynos-pinctrl.h
new file mode 100644 (file)
index 0000000..e3a6df9
--- /dev/null
@@ -0,0 +1,55 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Samsung Exynos DTS pinctrl constants
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ */
+
+#ifndef __DTS_ARM_SAMSUNG_EXYNOS_PINCTRL_H__
+#define __DTS_ARM_SAMSUNG_EXYNOS_PINCTRL_H__
+
+#define EXYNOS_PIN_PULL_NONE           0
+#define EXYNOS_PIN_PULL_DOWN           1
+#define EXYNOS_PIN_PULL_UP             3
+
+/* Pin function in power down mode */
+#define EXYNOS_PIN_PDN_OUT0            0
+#define EXYNOS_PIN_PDN_OUT1            1
+#define EXYNOS_PIN_PDN_INPUT           2
+#define EXYNOS_PIN_PDN_PREV            3
+
+/* Drive strengths for Exynos3250, Exynos4 (all) and Exynos5250 */
+#define EXYNOS4_PIN_DRV_LV1            0
+#define EXYNOS4_PIN_DRV_LV2            2
+#define EXYNOS4_PIN_DRV_LV3            1
+#define EXYNOS4_PIN_DRV_LV4            3
+
+/* Drive strengths for Exynos5260 */
+#define EXYNOS5260_PIN_DRV_LV1         0
+#define EXYNOS5260_PIN_DRV_LV2         1
+#define EXYNOS5260_PIN_DRV_LV4         2
+#define EXYNOS5260_PIN_DRV_LV6         3
+
+/*
+ * Drive strengths for Exynos5410, Exynos542x, Exynos5800 and Exynos850 (except
+ * GPIO_HSI block)
+ */
+#define EXYNOS5420_PIN_DRV_LV1         0
+#define EXYNOS5420_PIN_DRV_LV2         1
+#define EXYNOS5420_PIN_DRV_LV3         2
+#define EXYNOS5420_PIN_DRV_LV4         3
+
+#define EXYNOS_PIN_FUNC_INPUT          0
+#define EXYNOS_PIN_FUNC_OUTPUT         1
+#define EXYNOS_PIN_FUNC_2              2
+#define EXYNOS_PIN_FUNC_3              3
+#define EXYNOS_PIN_FUNC_4              4
+#define EXYNOS_PIN_FUNC_5              5
+#define EXYNOS_PIN_FUNC_6              6
+#define EXYNOS_PIN_FUNC_EINT           0xf
+#define EXYNOS_PIN_FUNC_F              EXYNOS_PIN_FUNC_EINT
+
+#endif /* __DTS_ARM_SAMSUNG_EXYNOS_PINCTRL_H__ */
index 7b42962..0ac3f28 100644 (file)
 
 &pinctrl_1 {
        bten: bten-pins {
-               samsung,pins ="gpx1-7";
+               samsung,pins = "gpx1-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
                samsung,pin-con-pdn = <EXYNOS_PIN_PDN_PREV>;
index cc30d15..011ba2e 100644 (file)
@@ -9,7 +9,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 #define PIN_IN(_pin, _pull, _drv)                                      \
        pin- ## _pin {                                                  \
index 78dad23..326b9e0 100644 (file)
                        status = "disabled";
                };
 
-               mshc_0: mshc@12510000 {
+               mshc_0: mmc@12510000 {
                        compatible = "samsung,exynos5420-dw-mshc";
                        reg = <0x12510000 0x1000>;
                        interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               mshc_1: mshc@12520000 {
+               mshc_1: mmc@12520000 {
                        compatible = "samsung,exynos5420-dw-mshc";
                        reg = <0x12520000 0x1000>;
                        interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               mshc_2: mshc@12530000 {
+               mshc_2: mmc@12530000 {
                        compatible = "samsung,exynos5250-dw-mshc";
                        reg = <0x12530000 0x1000>;
                        interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
index 6f0ca33..5c4ecda 100644 (file)
                        status = "disabled";
                };
 
-               sdhci_0: sdhci@12510000 {
+               sdhci_0: mmc@12510000 {
                        compatible = "samsung,exynos4210-sdhci";
                        reg = <0x12510000 0x100>;
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               sdhci_1: sdhci@12520000 {
+               sdhci_1: mmc@12520000 {
                        compatible = "samsung,exynos4210-sdhci";
                        reg = <0x12520000 0x100>;
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               sdhci_2: sdhci@12530000 {
+               sdhci_2: mmc@12530000 {
                        compatible = "samsung,exynos4210-sdhci";
                        reg = <0x12530000 0x100>;
                        interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               sdhci_3: sdhci@12540000 {
+               sdhci_3: mmc@12540000 {
                        compatible = "samsung,exynos4210-sdhci";
                        reg = <0x12540000 0x100>;
                        interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
index 3c0a18b..bba8501 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               vol-down {
+               key-vol-down {
                        gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                        label = "volume down";
                        debounce-interval = <10>;
                };
 
-               vol-up {
+               key-vol-up {
                        gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        label = "volume up";
                        debounce-interval = <10>;
                };
 
-               power {
+               key-power {
                        gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "power";
                        wakeup-source;
                };
 
-               ok {
+               key-ok {
                        gpios = <&gpx3 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_OK>;
                        label = "ok";
index a08ce2f..5f37b75 100644 (file)
@@ -15,6 +15,7 @@
 #include "exynos4210.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include "exynos-mfc-reserved-memory.dtsi"
 
 / {
        gpio-keys {
                compatible = "gpio-keys";
 
-               up {
+               key-up {
                        label = "Up";
                        gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_UP>;
                        wakeup-source;
                };
 
-               down {
+               key-down {
                        label = "Down";
                        gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_DOWN>;
                        wakeup-source;
                };
 
-               back {
+               key-back {
                        label = "Back";
                        gpios = <&gpx1 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BACK>;
                        wakeup-source;
                };
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&gpx1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                        wakeup-source;
                };
 
-               menu {
+               key-menu {
                        label = "Menu";
                        gpios = <&gpx1 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_MENU>;
@@ -86,6 +87,7 @@
                compatible = "gpio-leds";
                status {
                        gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
+                       function = LED_FUNCTION_HEARTBEAT;
                        linux,default-trigger = "heartbeat";
                };
        };
index 6373009..76f44ae 100644 (file)
@@ -11,7 +11,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_0 {
        gpa0: gpa0-gpio-bank {
index 01f44d9..b8e9dd2 100644 (file)
                vdd3-supply = <&vcclcd_reg>;
                vci-supply = <&vlcd_reg>;
                reset-gpios = <&gpy4 5 GPIO_ACTIVE_HIGH>;
-               power-on-delay= <50>;
+               power-on-delay = <50>;
                reset-delay = <100>;
                init-delay = <100>;
                flip-horizontal;
index 03dffc6..94122e9 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "exynos4412-midas.dtsi"
 
 / {
@@ -25,8 +26,9 @@
                pinctrl-1 = <&camera_flash_host>;
                pinctrl-2 = <&camera_flash_isp>;
 
-               flash-led {
-                       label = "flash";
+               led {
+                       function = LED_FUNCTION_FLASH;
+                       color = <LED_COLOR_ID_WHITE>;
                        led-max-microamp = <520833>;
                        flash-max-microamp = <1012500>;
                        flash-max-timeout-us = <1940000>;
                vdd3-supply = <&lcd_vdd3_reg>;
                vci-supply = <&ldo25_reg>;
                reset-gpios = <&gpf2 1 GPIO_ACTIVE_HIGH>;
-               power-on-delay= <50>;
+               power-on-delay = <50>;
                reset-delay = <100>;
                init-delay = <100>;
                flip-horizontal;
index a940628..202ab0f 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pwm/pwm.h>
 #include <dt-bindings/sound/samsung-i2s.h>
 #include "exynos4412-itop-scp-core.dtsi"
@@ -28,7 +29,8 @@
                compatible = "gpio-leds";
 
                led2 {
-                       label = "red:system";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&gpx1 0 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                        linux,default-trigger = "heartbeat";
@@ -36,6 +38,7 @@
 
                led3 {
                        label = "red:user";
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&gpk1 1 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
        gpio-keys {
                compatible = "gpio-keys";
 
-               home {
+               key-home {
                        label = "GPIO Key Home";
                        linux,code = <KEY_HOME>;
                        gpios = <&gpx1 1 GPIO_ACTIVE_LOW>;
                };
 
-               back {
+               key-back {
                        label = "GPIO Key Back";
                        linux,code = <KEY_BACK>;
                        gpios = <&gpx1 2 GPIO_ACTIVE_LOW>;
                };
 
-               sleep {
+               key-sleep {
                        label = "GPIO Key Sleep";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
                };
 
-               vol-up {
+               key-vol-up {
                        label = "GPIO Key Vol+";
                        linux,code = <KEY_UP>;
                        gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                };
 
-               vol-down {
+               key-vol-down {
                        label = "GPIO Key Vol-";
                        linux,code = <KEY_DOWN>;
                        gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
index 23f50c9..b967397 100644 (file)
 /dts-v1/;
 #include "exynos4412.dtsi"
 #include "exynos4412-ppmu-common.dtsi"
+
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/clock/maxim,max77686.h>
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 / {
        compatible = "samsung,midas", "samsung,exynos4412", "samsung,exynos4";
index 36c369c..a5ad88b 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "exynos4412-odroid-common.dtsi"
 #include "exynos4412-prime.dtsi"
 
@@ -37,7 +38,8 @@
        leds {
                compatible = "gpio-leds";
                led1 {
-                       label = "led1:heart";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&gpc1 0 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                        linux,default-trigger = "heartbeat";
index 1f17cc3..68d589e 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "exynos4412-odroid-common.dtsi"
 
 / {
        leds {
                compatible = "gpio-leds";
                led1 {
-                       label = "led1:heart";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&gpc1 0 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                        linux,default-trigger = "heartbeat";
                };
                led2 {
                        label = "led2:mmc0";
+                       function = LED_FUNCTION_DISK_ACTIVITY;
                        gpios = <&gpc1 2 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                        linux,default-trigger = "mmc0";
index 97f131b..7a515b8 100644 (file)
@@ -15,8 +15,8 @@
 #include <dt-bindings/gpio/gpio.h>
 #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>
+#include "exynos-pinctrl.h"
 
 / {
        compatible = "samsung,p4note", "samsung,exynos4412", "samsung,exynos4";
                regulator-always-on;
        };
 
+       panel_vdd: voltage-regulator-4 {
+               compatible = "regulator-fixed";
+               regulator-name = "LCD_ENABLE";
+               pinctrl-names = "default";
+               pinctrl-0 = <&lcd_enable>;
+               gpios = <&gpc0 1 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               regulator-boot-on;
+       };
+
        wlan_pwrseq: sdhci3-pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&gpm3 5 GPIO_ACTIVE_LOW>;
                        monitored-battery = <&battery_cell>;
                };
        };
+
+       panel {
+               compatible = "samsung,ltl101al01";
+               pinctrl-0 = <&lvds_nshdn>;
+               pinctrl-names = "default";
+               power-supply = <&panel_vdd>;
+               enable-gpios = <&gpm0 5 GPIO_ACTIVE_HIGH>;
+               backlight = <&backlight>;
+
+               port {
+                       lcd_ep: endpoint {
+                               remote-endpoint = <&fimd_ep>;
+                       };
+               };
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pinctrl-0 = <&led_bl_reset>;
+               pinctrl-names = "default";
+               enable-gpios = <&gpm0 1 GPIO_ACTIVE_HIGH>;
+               pwms = <&pwm 1 78770 0>;
+               brightness-levels = <0 48 128 255>;
+               num-interpolated-steps = <8>;
+               default-brightness-level = <12>;
+       };
 };
 
 &adc {
 };
 
 &fimd {
-       pinctrl-0 = <&lcd_clk &lcd_data24 &pwm1_out>;
+       pinctrl-0 = <&lcd_clk &lcd_data24>;
        pinctrl-names = "default";
+       #address-cells = <1>;
+       #size-cells = <0>;
        status = "okay";
 
-       display-timings {
-               timing0 {
-                       clock-frequency = <66666666>;
-                       hactive = <1280>;
-                       vactive = <800>;
-                       hfront-porch = <18>;
-                       hback-porch = <36>;
-                       hsync-len = <16>;
-                       vback-porch = <16>;
-                       vfront-porch = <4>;
-                       vsync-len = <3>;
-                       hsync-active = <1>;
+       samsung,invert-vclk;
+
+       port@3 {
+               reg = <3>;
+
+               fimd_ep: endpoint {
+                       remote-endpoint = <&lcd_ep>;
                };
        };
 };
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
+       lcd_enable: lcd-enable-pins {
+               samsung,pins = "gpc0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
        sleep0: sleep-state {
                PIN_SLP(gpa0-0, INPUT, NONE);
                PIN_SLP(gpa0-1, OUT0, NONE);
                /* 0 = CP, 1 = AP (serial output) */
        };
 
+       led_bl_reset: led-bl-reset-pins {
+               samsung,pins = "gpm0-1";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
        tsp_rst: tsp-rst-pins {
                samsung,pins = "gpm0-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
        };
 
+       lvds_nshdn: lvds-nshdn-pins {
+               samsung,pins = "gpm0-5";
+               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
+       };
+
        tsp_irq: tsp-irq-pins {
                samsung,pins = "gpm2-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_F>;
        assigned-clock-parents = <&clock CLK_XUSBXTI>;
 };
 
+&pwm {
+       pinctrl-0 = <&pwm1_out>;
+       pinctrl-names = "default";
+       samsung,pwm-outputs = <1>;
+       status = "okay";
+};
+
 &rtc {
        clocks = <&clock CLK_RTC>, <&max77686 MAX77686_CLK_AP>;
        clock-names = "rtc", "rtc_src";
index 88b8afd..58847d4 100644 (file)
@@ -9,7 +9,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 #define PIN_SLP(_pin, _mode, _pull)                                    \
        _pin {                                                          \
index 017b261..04388c5 100644 (file)
@@ -11,6 +11,7 @@
 /dts-v1/;
 #include "exynos4412.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        model = "FriendlyARM TINY4412 board based on Exynos4412";
@@ -30,6 +31,7 @@
 
                led1 {
                        label = "led1";
+                       function = LED_FUNCTION_HEARTBEAT;
                        gpios = <&gpm4 0 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                        linux,default-trigger = "heartbeat";
@@ -49,6 +51,7 @@
 
                led4 {
                        label = "led4";
+                       function = LED_FUNCTION_DISK_ACTIVITY;
                        gpios = <&gpm4 3 GPIO_ACTIVE_LOW>;
                        default-state = "off";
                        linux,default-trigger = "mmc0";
index 9ce9fb3..c8da0d4 100644 (file)
@@ -89,7 +89,7 @@
                        compatible = "arm,gic-400", "arm,cortex-a15-gic";
                        #interrupt-cells = <3>;
                        interrupt-controller;
-                       reg =   <0x10481000 0x1000>,
+                       reg = <0x10481000 0x1000>,
                                <0x10482000 0x2000>,
                                <0x10484000 0x2000>,
                                <0x10486000 0x2000>;
index f7795f2..71c0e87 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               menu {
+               key-menu {
                        label = "SW-TACT2";
                        gpios = <&gpx1 4 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_MENU>;
                        wakeup-source;
                };
 
-               home {
+               key-home {
                        label = "SW-TACT3";
                        gpios = <&gpx1 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                        wakeup-source;
                };
 
-               up {
+               key-up {
                        label = "SW-TACT4";
                        gpios = <&gpx1 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_UP>;
                        wakeup-source;
                };
 
-               down {
+               key-down {
                        label = "SW-TACT5";
                        gpios = <&gpx1 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_DOWN>;
                        wakeup-source;
                };
 
-               back {
+               key-back {
                        label = "SW-TACT6";
                        gpios = <&gpx2 0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BACK>;
                        wakeup-source;
                };
 
-               wakeup {
+               key-wakeup {
                        label = "SW-TACT7";
                        gpios = <&gpx2 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index 918947a..48732ed 100644 (file)
@@ -9,7 +9,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_0 {
        gpa0: gpa0-gpio-bank {
index c15ecfc..3d84b9c 100644 (file)
@@ -32,7 +32,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&power_key_irq &lid_irq>;
 
-               power {
+               power-key {
                        label = "Power";
                        gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 24609bb..5eca10e 100644 (file)
@@ -33,7 +33,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&power_key_irq>, <&lid_irq>;
 
-               power {
+               power-key {
                        label = "Power";
                        gpios = <&gpx1 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 150607f..43e4a54 100644 (file)
@@ -9,7 +9,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_0 {
        gpa0: gpa0-gpio-bank {
index 6c7814b..f7b9233 100644 (file)
@@ -6,7 +6,7 @@
  *              https://www.hardkernel.com
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_0 {
        gpa0: gpa0-gpio-bank {
index 946b791..55b7759 100644 (file)
@@ -42,7 +42,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "SW-TACT1";
                        gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index d6434ec..9e21234 100644 (file)
@@ -60,7 +60,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&power_key_irq &lid_irq>;
 
-               power {
+               power-key {
                        label = "Power";
                        gpios = <&gpx1 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 546ba27..14cf9c4 100644 (file)
@@ -9,7 +9,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_0 {
        gpy7: gpy7-gpio-bank {
index d91f7fa..3de7019 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include "exynos5422-odroid-core.dtsi"
 
 / {
@@ -19,7 +20,8 @@
                compatible = "pwm-leds";
 
                led-1 {
-                       label = "blue:heartbeat";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_BLUE>;
                        pwms = <&pwm 2 2000000 0>;
                        pwm-names = "pwm2";
                        max-brightness = <255>;
index 1c24f9b..f5fb617 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/sound/samsung-i2s.h>
 #include "exynos5422-odroidxu3-common.dtsi"
 
@@ -21,7 +22,8 @@
                compatible = "pwm-leds";
 
                led-1 {
-                       label = "blue:heartbeat";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_BLUE>;
                        pwms = <&pwm 2 2000000 0>;
                        pwm-names = "pwm2";
                        max-brightness = <255>;
index 982752e..8c0e171 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        led-controller-1 {
@@ -16,6 +17,8 @@
 
                led-1 {
                        label = "green:mmc0";
+                       function = LED_FUNCTION_DISK_ACTIVITY;
+                       color = <LED_COLOR_ID_GREEN>;
                        pwms = <&pwm 1 2000000 0>;
                        pwm-names = "pwm1";
                        /*
@@ -27,7 +30,8 @@
                };
 
                led-2 {
-                       label = "blue:heartbeat";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_BLUE>;
                        pwms = <&pwm 2 2000000 0>;
                        pwm-names = "pwm2";
                        max-brightness = <255>;
@@ -40,6 +44,8 @@
 
                led-3 {
                        label = "red:microSD";
+                       function = LED_FUNCTION_DISK_ACTIVITY;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&gpx2 3 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                        linux,default-trigger = "mmc1";
index 4ee7628..0ebcb66 100644 (file)
@@ -59,7 +59,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&power_key_irq &lid_irq>;
 
-               power {
+               power-key {
                        label = "Power";
                        gpios = <&gpx1 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index fa8044c..bc4de0c 100644 (file)
@@ -68,7 +68,7 @@
                };
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
index b660c7d..e140307 100644 (file)
                };
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                interrupt-parent = <&aitc>;
                ranges;
 
-               aipi@10000000 { /* AIPI1 */
+               aipi1: aipi@10000000 { /* AIPI1 */
                        compatible = "fsl,aipi-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        };
                };
 
-               aipi@10020000 { /* AIPI2 */
+               aipi2: aipi@10020000 { /* AIPI2 */
                        compatible = "fsl,aipi-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index 2adb923..5c4938b 100644 (file)
@@ -48,7 +48,7 @@
                reg = <0x68000000 0x100000>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
@@ -63,7 +63,7 @@
                        ranges = <0 0x1fffc000 0x4000>;
                };
 
-               bus@43f00000 { /* AIPS1 */
+               aips1: bus@43f00000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index be0de0f..c0c7575 100644 (file)
                status = "okay";
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                interrupt-parent = <&tzic>;
                ranges;
 
-               bus@50000000 { /* AIPS1 */
+               aips1: bus@50000000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        };
                };
 
-               bus@60000000 {  /* AIPS2 */
+               aips2: bus@60000000 {   /* AIPS2 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index 85654d6..f740872 100644 (file)
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_interrupt_fpga>;
                        interrupt-parent = <&gpio2>;
-                       interrupts= <9 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-controller;
                        #interrupt-cells = <1>;
                };
index 1e20a66..592d9c2 100644 (file)
                ports = <&ipu_di0>, <&ipu_di1>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                        };
                };
 
-               bus@70000000 { /* AIPS1 */
+               aips1: bus@70000000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        };
                };
 
-               bus@80000000 {  /* AIPS2 */
+               aips2: bus@80000000 {   /* AIPS2 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index 67487f3..b7a6469 100644 (file)
                status = "okay";
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                        clock-names = "core_clk", "mem_iface_clk";
                };
 
-               bus@50000000 { /* AIPS1 */
+               aips1: bus@50000000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
                        };
                };
 
-               bus@60000000 {  /* AIPS2 */
+               aips2: bus@60000000 {   /* AIPS2 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index c4ce23d..522660c 100644 (file)
                compatible = "ti,tsc2046e-adc";
                reg = <0>;
                pinctrl-0 = <&pinctrl_tsc2046>;
-               pinctrl-names ="default";
+               pinctrl-names = "default";
                spi-max-frequency = <1000000>;
                interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>;
                #io-channel-cells = <1>;
index b86deeb..0a0b7ac 100644 (file)
                compatible = "ti,tsc2046e-adc";
                reg = <0>;
                pinctrl-0 = <&pinctrl_tsc>;
-               pinctrl-names ="default";
+               pinctrl-names = "default";
                spi-max-frequency = <1000000>;
                interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>;
                #io-channel-cells = <1>;
index 516ec91..779b528 100644 (file)
                compatible = "ti,tsc2046e-adc";
                reg = <0>;
                pinctrl-0 = <&pinctrl_touchscreen>;
-               pinctrl-names ="default";
+               pinctrl-names = "default";
                spi-max-frequency = <1000000>;
                interrupts-extended = <&gpio5 8 IRQ_TYPE_LEVEL_LOW>;
                #io-channel-cells = <1>;
index fdd81fd..8e0ed20 100644 (file)
@@ -80,7 +80,7 @@
                };
        };
 
-       soc {
+       soc: soc {
                ocram: sram@900000 {
                        compatible = "mmio-sram";
                        reg = <0x00900000 0x20000>;
index a0683b4..fa160a3 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2014-2020 Toradex
+ * Copyright 2014-2022 Toradex
  * Copyright 2012 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  */
                stdout-path = "serial0:115200n8";
        };
 
-       gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpio_keys>;
-
-               wakeup {
-                       label = "Wake-Up";
-                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_WAKEUP>;
-                       debounce-interval = <10>;
-                       wakeup-source;
-               };
-       };
-
-       lcd_display: disp0 {
-               compatible = "fsl,imx-parallel-display";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               interface-pix-fmt = "rgb24";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_ipu1_lcdif>;
-               status = "okay";
-
-               port@0 {
-                       reg = <0>;
-
-                       lcd_display_in: endpoint {
-                               remote-endpoint = <&ipu1_di1_disp1>;
-                       };
-               };
-
-               port@1 {
-                       reg = <1>;
-
-                       lcd_display_out: endpoint {
-                               remote-endpoint = <&lcd_panel_in>;
-                       };
-               };
-       };
-
-       panel: panel {
-               /*
-                * edt,et057090dhu: EDT 5.7" LCD TFT
-                * edt,et070080dh6: EDT 7.0" LCD TFT
-                */
-               compatible = "edt,et057090dhu";
-               backlight = <&backlight>;
-               power-supply = <&reg_3v3_sw>;
-
-               port {
-                       lcd_panel_in: endpoint {
-                               remote-endpoint = <&lcd_display_out>;
-                       };
-               };
-       };
-
        reg_pcie_switch: regulator-pcie-switch {
                compatible = "regulator-fixed";
-               regulator-name = "pcie_switch";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
+               enable-active-high;
                gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>;
+               regulator-max-microvolt = <1800000>;
+               regulator-min-microvolt = <1800000>;
+               regulator-name = "pcie_switch";
                startup-delay-us = <100000>;
-               enable-active-high;
                status = "okay";
        };
 
        reg_3v3_sw: regulator-3v3-sw {
                compatible = "regulator-fixed";
-               regulator-name = "3.3V_SW";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
                regulator-always-on;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "3.3V_SW";
        };
 };
 
-&backlight {
-       brightness-levels = <0 127 191 223 239 247 251 255>;
-       default-brightness-level = <1>;
-       power-supply = <&reg_3v3_sw>;
-       status = "okay";
-};
-
 &can1 {
        xceiver-supply = <&reg_3v3_sw>;
        status = "okay";
        status = "okay";
 };
 
-&hdmi {
-       status = "okay";
-};
-
 /* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
 &i2c1 {
        status = "okay";
 
-       /*
-        * Touchscreen is using SODIMM 28/30, also used for PWM<B>, PWM<C>,
-        * aka pwm2, pwm3. so if you enable touchscreen, disable the pwms
-        */
-       touchscreen@4a {
-               compatible = "atmel,maxtouch";
-               reg = <0x4a>;
-               interrupt-parent = <&gpio6>;
-               interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
-               reset-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>; /* SODIMM 13 */
-               status = "disabled";
-       };
-
        pcie-switch@58 {
                compatible = "plx,pex8605";
                reg = <0x58>;
        status = "okay";
 };
 
-&ipu1_di1_disp1 {
-       remote-endpoint = <&lcd_display_in>;
-};
-
-&ldb {
-       status = "okay";
-};
-
 &pcie {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_reset_moci>;
        status = "okay";
 };
 
-&reg_usb_otg_vbus {
+&reg_usb_host_vbus {
        status = "okay";
 };
 
-&reg_usb_host_vbus {
+&reg_usb_otg_vbus {
        status = "okay";
 };
 
 
 /* MMC1 */
 &usdhc1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_usdhc1_8bit &pinctrl_mmc_cd>;
-       cd-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
 /* SD1 */
 &usdhc2 {
+       cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_sd_cd>;
-       cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
-
-&iomuxc {
-       /*
-        * Mux the Apalis GPIOs
-        */
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2
-                    &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4
-                    &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6
-                    &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8
-                   >;
-};
index 86e8478..44637d6 100644 (file)
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2014-2020 Toradex
+ * Copyright 2014-2022 Toradex
  * Copyright 2012 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  */
 
-/dts-v1/;
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/interrupt-controller/irq.h>
-#include "imx6q.dtsi"
-#include "imx6qdl-apalis.dtsi"
+#include "imx6q-apalis-ixora-v1.2.dts"
 
 / {
        model = "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.1";
-       compatible = "toradex,apalis_imx6q-ixora-v1.1",
-                    "toradex,apalis_imx6q-ixora", "toradex,apalis_imx6q",
+       compatible = "toradex,apalis_imx6q-ixora-v1.1", "toradex,apalis_imx6q",
                     "fsl,imx6q";
 
-       aliases {
-               i2c0 = &i2c1;
-               i2c1 = &i2c3;
-               i2c2 = &i2c2;
-               rtc0 = &rtc_i2c;
-               rtc1 = &snvs_rtc;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpio_keys>;
-
-               wakeup {
-                       label = "Wake-Up";
-                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_WAKEUP>;
-                       debounce-interval = <10>;
-                       wakeup-source;
-               };
-       };
-
-       lcd_display: disp0 {
-               compatible = "fsl,imx-parallel-display";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               interface-pix-fmt = "rgb24";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_ipu1_lcdif>;
-               status = "okay";
-
-               port@0 {
-                       reg = <0>;
-
-                       lcd_display_in: endpoint {
-                               remote-endpoint = <&ipu1_di1_disp1>;
-                       };
-               };
-
-               port@1 {
-                       reg = <1>;
-
-                       lcd_display_out: endpoint {
-                               remote-endpoint = <&lcd_panel_in>;
-                       };
-               };
-       };
 
-       panel: panel {
-               /*
-                * edt,et057090dhu: EDT 5.7" LCD TFT
-                * edt,et070080dh6: EDT 7.0" LCD TFT
-                */
-               compatible = "edt,et057090dhu";
-               backlight = <&backlight>;
-
-               port {
-                       lcd_panel_in: endpoint {
-                               remote-endpoint = <&lcd_display_out>;
-                       };
-               };
-       };
-
-       leds {
-               compatible = "gpio-leds";
-
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_leds_ixora>;
-
-               led4-green {
-                       label = "LED_4_GREEN";
-                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
-               };
-
-               led4-red {
-                       label = "LED_4_RED";
-                       gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
-               };
-
-               led5-green {
-                       label = "LED_5_GREEN";
-                       gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
-               };
-
-               led5-red {
-                       label = "LED_5_RED";
-                       gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
-               };
-       };
 };
 
-&backlight {
-       brightness-levels = <0 127 191 223 239 247 251 255>;
-       default-brightness-level = <1>;
-       status = "okay";
-};
+/delete-node/ &eeprom;
+/delete-node/ &reg_3v3_vmmc;
+/delete-node/ &reg_can1_supply;
+/delete-node/ &reg_can2_supply;
 
 &can1 {
-       status = "okay";
+       /delete-property/ xceiver-supply;
 };
 
 &can2 {
-       status = "okay";
-};
-
-&hdmi {
-       status = "okay";
-};
-
-/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
-&i2c1 {
-       status = "okay";
-
-       /*
-        * Touchscreen is using SODIMM 28/30, also used for PWM<B>, PWM<C>,
-        * aka pwm2, pwm3. so if you enable touchscreen, disable the pwms
-        */
-       touchscreen@4a {
-               compatible = "atmel,maxtouch";
-               reg = <0x4a>;
-               interrupt-parent = <&gpio6>;
-               interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
-               reset-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>; /* SODIMM 13 */
-               status = "disabled";
-       };
-
-       /* M41T0M6 real time clock on carrier board */
-       rtc_i2c: rtc@68 {
-               compatible = "st,m41t0";
-               reg = <0x68>;
-       };
-};
-
-/*
- * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier
- * board)
- */
-&i2c3 {
-       status = "okay";
-};
-
-&ipu1_di1_disp1 {
-       remote-endpoint = <&lcd_display_in>;
-};
-
-&ldb {
-       status = "okay";
-};
-
-&pcie {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_reset_moci>;
-       /* active-high meaning opposite of regular PERST# active-low polarity */
-       reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
-       reset-gpio-active-high;
-       status = "okay";
-};
-
-&pwm1 {
-       status = "okay";
-};
-
-&pwm2 {
-       status = "okay";
-};
-
-&pwm3 {
-       status = "okay";
-};
-
-&pwm4 {
-       status = "okay";
-};
-
-&reg_usb_otg_vbus {
-       status = "okay";
-};
-
-&reg_usb_host_vbus {
-       status = "okay";
-};
-
-&sata {
-       status = "okay";
-};
-
-&sound_spdif {
-       status = "okay";
-};
-
-&spdif {
-       status = "okay";
-};
-
-&uart1 {
-       status = "okay";
-};
-
-&uart2 {
-       status = "okay";
-};
-
-&uart4 {
-       status = "okay";
-};
-
-&uart5 {
-       status = "okay";
-};
-
-&usbh1 {
-       vbus-supply = <&reg_usb_host_vbus>;
-       status = "okay";
-};
-
-&usbotg {
-       vbus-supply = <&reg_usb_otg_vbus>;
-       status = "okay";
+       /delete-property/ xceiver-supply;
 };
 
 /* MMC1 */
 &usdhc1 {
+       /delete-property/ cap-power-off-card;
+       /delete-property/ pinctrl-1;
+       /delete-property/ vmmc-supply;
        pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_mmc_cd>;
-       cd-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>;
-       bus-width = <4>;
-       status = "okay";
-};
-
-&iomuxc {
-       /*
-        * Mux the Apalis GPIOs
-        */
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2
-                    &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4
-                    &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6
-                    &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8
-                   >;
-
-       pinctrl_leds_ixora: ledsixoragrp {
-               fsl,pins = <
-                       MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 0x1b0b0
-                       MX6QDL_PAD_SD2_DAT3__GPIO1_IO12 0x1b0b0
-                       MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
-                       MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0
-               >;
-       };
 };
diff --git a/arch/arm/boot/dts/imx6q-apalis-ixora-v1.2.dts b/arch/arm/boot/dts/imx6q-apalis-ixora-v1.2.dts
new file mode 100644 (file)
index 0000000..f9f7d99
--- /dev/null
@@ -0,0 +1,276 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2014-2022 Toradex
+ * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2011 Linaro Ltd.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "imx6q.dtsi"
+#include "imx6qdl-apalis.dtsi"
+
+/ {
+       model = "Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.2";
+       compatible = "toradex,apalis_imx6q-ixora-v1.2", "toradex,apalis_imx6q",
+                    "fsl,imx6q";
+
+       aliases {
+               i2c0 = &i2c1;
+               i2c1 = &i2c3;
+               i2c2 = &i2c2;
+               rtc0 = &rtc_i2c;
+               rtc1 = &snvs_rtc;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_leds_ixora>;
+
+               led4-green {
+                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+                       label = "LED_4_GREEN";
+               };
+
+               led4-red {
+                       gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+                       label = "LED_4_RED";
+               };
+
+               led5-green {
+                       gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+                       label = "LED_5_GREEN";
+               };
+
+               led5-red {
+                       gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
+                       label = "LED_5_RED";
+               };
+       };
+
+       reg_3v3_vmmc: regulator-3v3-vmmc {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 0 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_enable_3v3_vmmc>;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "3v3_vmmc";
+               startup-delay-us = <100>;
+       };
+
+       reg_can1_supply: regulator-can1-supply {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 3 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_enable_can1_power>;
+               regulator-name = "can1_supply";
+       };
+
+       reg_can2_supply: regulator-can2-supply {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio3 15 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_enable_can2_power>;
+               regulator-name = "can2_supply";
+       };
+};
+
+&can1 {
+       xceiver-supply = <&reg_can1_supply>;
+       status = "okay";
+};
+
+&can2 {
+       xceiver-supply = <&reg_can2_supply>;
+       status = "okay";
+};
+
+&gpio1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart24_forceoff>;
+
+       /*
+        * uart-2-4-on-x21-enable-hog enables the UART transceiver for Apalis
+        * UART2 and UART3. If one wants to disable the transceiver force
+        * the GPIO to output-low, if one wants to control the transceiver
+        * from user space delete the hog node.
+        */
+       uart-2-4-on-x21-enable-hog {
+               gpio-hog;
+               gpios = <11 GPIO_ACTIVE_HIGH>; /* MXM3 180 */
+               output-high;
+       };
+};
+
+/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
+&i2c1 {
+       status = "okay";
+
+       /* M41T0M6 real time clock on carrier board */
+       rtc_i2c: rtc@68 {
+               compatible = "st,m41t0";
+               reg = <0x68>;
+       };
+
+       eeprom: eeprom@50 {
+               compatible = "atmel,24c02";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+};
+
+/*
+ * I2C3_SDA/SCL (CAM) on MXM3 pin 201/203 (e.g. camera sensor on carrier
+ * board)
+ */
+&i2c3 {
+       status = "okay";
+};
+
+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_reset_moci>;
+       /* active-high meaning opposite of regular PERST# active-low polarity */
+       reset-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
+       reset-gpio-active-high;
+       status = "okay";
+};
+
+&pwm1 {
+       status = "okay";
+};
+
+&pwm2 {
+       status = "okay";
+};
+
+&pwm3 {
+       status = "okay";
+};
+
+&pwm4 {
+       status = "okay";
+};
+
+&reg_usb_host_vbus {
+       status = "okay";
+};
+
+&reg_usb_otg_vbus {
+       status = "okay";
+};
+
+&sata {
+       status = "okay";
+};
+
+&sound_spdif {
+       status = "okay";
+};
+
+&spdif {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&uart2 {
+       status = "okay";
+};
+
+&uart4 {
+       status = "okay";
+};
+
+&uart5 {
+       status = "okay";
+};
+
+&usbh1 {
+       vbus-supply = <&reg_usb_host_vbus>;
+       status = "okay";
+};
+
+&usbotg {
+       vbus-supply = <&reg_usb_otg_vbus>;
+       status = "okay";
+};
+
+/* MMC1 */
+&usdhc1 {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_mmc_cd>;
+       pinctrl-1 = <&pinctrl_usdhc1_4bit_sleep &pinctrl_mmc_cd_sleep>;
+       bus-width = <4>;
+       cap-power-off-card;
+       vmmc-supply = <&reg_3v3_vmmc>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl_enable_3v3_vmmc: enable3v3vmmcgrp {
+               fsl,pins = <
+                       MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x1b0b0
+               >;
+       };
+
+       pinctrl_enable_can1_power: enablecan1powergrp {
+               fsl,pins = <
+                       MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x1b0b0
+               >;
+       };
+
+       pinctrl_enable_can2_power: enablecan2powergrp {
+               fsl,pins = <
+                       MX6QDL_PAD_EIM_DA15__GPIO3_IO15 0x1b0b0
+               >;
+       };
+
+       pinctrl_uart24_forceoff: uart24forceoffgrp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD2_CMD__GPIO1_IO11 0x1b0b0
+               >;
+       };
+
+       pinctrl_leds_ixora: ledsixoragrp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD2_DAT1__GPIO1_IO14 0x1b0b0
+                       MX6QDL_PAD_SD2_DAT3__GPIO1_IO12 0x1b0b0
+                       MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x1b0b0
+                       MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x1b0b0
+               >;
+       };
+
+       pinctrl_mmc_cd_sleep: mmccdslpgrp {
+               fsl,pins = <
+                        /* MMC1 CD */
+                       MX6QDL_PAD_DI0_PIN4__GPIO4_IO20 0x0
+               >;
+       };
+
+       pinctrl_usdhc1_4bit_sleep: usdhc1-4bitslpgrp {
+               fsl,pins = <
+                       MX6QDL_PAD_SD1_CMD__SD1_CMD     0x3000
+                       MX6QDL_PAD_SD1_CLK__SD1_CLK     0x3000
+                       MX6QDL_PAD_SD1_DAT0__SD1_DATA0  0x3000
+                       MX6QDL_PAD_SD1_DAT1__SD1_DATA1  0x3000
+                       MX6QDL_PAD_SD1_DAT2__SD1_DATA2  0x3000
+                       MX6QDL_PAD_SD1_DAT3__SD1_DATA3  0x3000
+               >;
+       };
+};
index 62e7277..ce39c6a 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2014-2020 Toradex
+ * Copyright 2014-2022 Toradex
  * Copyright 2012 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  */
                stdout-path = "serial0:115200n8";
        };
 
-       gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpio_keys>;
-
-               wakeup {
-                       label = "Wake-Up";
-                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
-                       linux,code = <KEY_WAKEUP>;
-                       debounce-interval = <10>;
-                       wakeup-source;
-               };
-       };
-
-       lcd_display: disp0 {
-               compatible = "fsl,imx-parallel-display";
-               #address-cells = <1>;
-               #size-cells = <0>;
-               interface-pix-fmt = "rgb24";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_ipu1_lcdif>;
-               status = "okay";
-
-               port@0 {
-                       reg = <0>;
-
-                       lcd_display_in: endpoint {
-                               remote-endpoint = <&ipu1_di1_disp1>;
-                       };
-               };
-
-               port@1 {
-                       reg = <1>;
-
-                       lcd_display_out: endpoint {
-                               remote-endpoint = <&lcd_panel_in>;
-                       };
-               };
-       };
-
-       panel: panel {
-               /*
-                * edt,et057090dhu: EDT 5.7" LCD TFT
-                * edt,et070080dh6: EDT 7.0" LCD TFT
-                */
-               compatible = "edt,et057090dhu";
-               backlight = <&backlight>;
-
-               port {
-                       lcd_panel_in: endpoint {
-                               remote-endpoint = <&lcd_display_out>;
-                       };
-               };
-       };
-
        leds {
                compatible = "gpio-leds";
-
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_leds_ixora>;
 
                led4-green {
-                       label = "LED_4_GREEN";
                        gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
+                       label = "LED_4_GREEN";
                };
 
                led4-red {
-                       label = "LED_4_RED";
                        gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
+                       label = "LED_4_RED";
                };
 
                led5-green {
-                       label = "LED_5_GREEN";
                        gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
+                       label = "LED_5_GREEN";
                };
 
                led5-red {
-                       label = "LED_5_RED";
                        gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
+                       label = "LED_5_RED";
                };
        };
 };
 
-&backlight {
-       brightness-levels = <0 127 191 223 239 247 251 255>;
-       default-brightness-level = <1>;
-       status = "okay";
-};
-
 &can1 {
        status = "okay";
 };
        status = "okay";
 };
 
-&hdmi {
-       status = "okay";
-};
-
 /* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
 &i2c1 {
        status = "okay";
 
-       /*
-        * Touchscreen is using SODIMM 28/30, also used for PWM<B>, PWM<C>,
-        * aka pwm2, pwm3. so if you enable touchscreen, disable the pwms
-        */
-       touchscreen@4a {
-               compatible = "atmel,maxtouch";
-               reg = <0x4a>;
-               interrupt-parent = <&gpio6>;
-               interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
-               reset-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>; /* SODIMM 13 */
-               status = "disabled";
-       };
-
        eeprom@50 {
                compatible = "atmel,24c02";
                reg = <0x50>;
        status = "okay";
 };
 
-&ipu1_di1_disp1 {
-       remote-endpoint = <&lcd_display_in>;
-};
-
-&ldb {
-       status = "okay";
-};
-
 &pcie {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_reset_moci>;
        status = "okay";
 };
 
-&reg_usb_otg_vbus {
+&reg_usb_host_vbus {
        status = "okay";
 };
 
-&reg_usb_host_vbus {
+&reg_usb_otg_vbus {
        status = "okay";
 };
 
 
 /* SD1 */
 &usdhc2 {
+       cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usdhc2 &pinctrl_sd_cd>;
-       cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
 &iomuxc {
-       /* Mux the Apalis GPIOs */
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2
-                    &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4
-                    &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6
-                    &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8
-                   >;
-
        pinctrl_leds_ixora: ledsixoragrp {
                fsl,pins = <
                        MX6QDL_PAD_SD1_DAT1__GPIO1_IO17 0x1b0b0
index 8768222..8263bfe 100644 (file)
        cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
        no-1-8-v;
        keep-power-in-suspend;
-       enable-sdio-wakeup;
+       wakeup-source;
        voltage-ranges = <3300 3300>;
        vmmc-supply = <&reg_sw4>;
        fsl,wp-controller;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_wdog1>;
        fsl,ext-reset-output;
-       timeout-sec=<10>;
+       timeout-sec = <10>;
        status = "okay";
 };
 
index 7f1f19b..a3f247c 100644 (file)
                >;
        };
 };
+
+&reg_tft_vcom {
+       regulator-min-microvolt = <3160000>;
+       regulator-max-microvolt = <3160000>;
+       voltage-table = <3160000 73>;
+};
index 9caba45..3b77eae 100644 (file)
                };
        };
 
-       soc {
+       soc: soc {
                ocram: sram@900000 {
                        compatible = "mmio-sram";
                        reg = <0x00900000 0x40000>;
                        clocks = <&clks IMX6QDL_CLK_OCRAM>;
                };
 
-               bus@2000000 { /* AIPS1 */
+               aips1: bus@2000000 { /* AIPS1 */
                        spba-bus@2000000 {
                                ecspi5: spi@2018000 {
                                        #address-cells = <1>;
index bd763ba..7c17b91 100644 (file)
@@ -1,11 +1,12 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2014-2020 Toradex
+ * Copyright 2014-2022 Toradex
  * Copyright 2012 Freescale Semiconductor, Inc.
  * Copyright 2011 Linaro Ltd.
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
        model = "Toradex Apalis iMX6Q/D Module";
 
        backlight: backlight {
                compatible = "pwm-backlight";
+               brightness-levels = <0 45 63 88 119 158 203 255>;
+               default-brightness-level = <4>;
+               enable-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_bl_on>;
-               pwms = <&pwm4 0 5000000>;
-               enable-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
+               power-supply = <&reg_module_3v3>;
+               pwms = <&pwm4 0 5000000 PWM_POLARITY_INVERTED>;
+               status = "disabled";
+       };
+
+       clk_ov5640_osc: clk-ov5640-osc {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <24000000>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpio_keys>;
+
+               wakeup {
+                       debounce-interval = <10>;
+                       gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
+                       label = "Wake-Up";
+                       linux,code = <KEY_WAKEUP>;
+                       wakeup-source;
+               };
+       };
+
+       lcd_display: disp0 {
+               compatible = "fsl,imx-parallel-display";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interface-pix-fmt = "rgb24";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ipu1_lcdif>;
                status = "disabled";
+
+               port@0 {
+                       reg = <0>;
+
+                       lcd_display_in: endpoint {
+                               remote-endpoint = <&ipu1_di1_disp1>;
+                       };
+               };
+
+               port@1 {
+                       reg = <1>;
+
+                       lcd_display_out: endpoint {
+                               remote-endpoint = <&lcd_panel_in>;
+                       };
+               };
+       };
+
+       panel_dpi: panel-dpi {
+               compatible = "edt,et057090dhu";
+               backlight = <&backlight>;
+
+               status = "disabled";
+
+               port {
+                       lcd_panel_in: endpoint {
+                               remote-endpoint = <&lcd_display_out>;
+                       };
+               };
+       };
+
+       panel_lvds: panel-lvds {
+               compatible = "panel-lvds";
+               backlight = <&backlight>;
+               status = "disabled";
+
+               port {
+                       lvds_panel_in: endpoint {
+                               remote-endpoint = <&lvds0_out>;
+                       };
+               };
        };
 
        reg_module_3v3: regulator-module-3v3 {
                compatible = "regulator-fixed";
-               regulator-name = "+V3.3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
                regulator-always-on;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "+V3.3";
        };
 
        reg_module_3v3_audio: regulator-module-3v3-audio {
                compatible = "regulator-fixed";
-               regulator-name = "+V3.3_AUDIO";
-               regulator-min-microvolt = <3300000>;
+               regulator-always-on;
                regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "+V3.3_AUDIO";
+       };
+
+       reg_ov5640_1v8_d_o_vdd: regulator-ov5640-1v8-d-o-vdd {
+               compatible = "regulator-fixed";
+               regulator-always-on;
+               regulator-max-microvolt = <1800000>;
+               regulator-min-microvolt = <1800000>;
+               regulator-name = "DOVDD/DVDD_1.8V";
+               /* Note: The CSI module uses on-board 3.3V_SW supply */
+               vin-supply = <&reg_module_3v3>;
+       };
+
+       reg_ov5640_2v8_a_vdd: regulator-ov5640-2v8-a-vdd {
+               compatible = "regulator-fixed";
                regulator-always-on;
+               regulator-max-microvolt = <2800000>;
+               regulator-min-microvolt = <2800000>;
+               regulator-name = "AVDD/AFVDD_2.8V";
+               /* Note: The CSI module uses on-board 3.3V_SW supply */
+               vin-supply = <&reg_module_3v3>;
        };
 
        reg_usb_otg_vbus: regulator-usb-otg-vbus {
                compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_regulator_usbotg_pwr>;
-               regulator-name = "usb_otg_vbus";
-               regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpio3 22 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "usb_otg_vbus";
                status = "disabled";
        };
 
        /* on module USB hub */
        reg_usb_host_vbus_hub: regulator-usb-host-vbus-hub {
                compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio3 28 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_regulator_usbhub_pwr>;
-               regulator-name = "usb_host_vbus_hub";
-               regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio = <&gpio3 28 GPIO_ACTIVE_HIGH>;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "usb_host_vbus_hub";
                startup-delay-us = <2000>;
-               enable-active-high;
                status = "okay";
        };
 
        reg_usb_host_vbus: regulator-usb-host-vbus {
                compatible = "regulator-fixed";
+               enable-active-high;
+               gpio =  <&gpio1 0 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_regulator_usbh_pwr>;
-               regulator-name = "usb_host_vbus";
-               regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
-               gpio =  <&gpio1 0 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "usb_host_vbus";
                vin-supply = <&reg_usb_host_vbus_hub>;
                status = "disabled";
        };
 
        sound {
                compatible = "fsl,imx-audio-sgtl5000";
-               model = "imx6q-apalis-sgtl5000";
-               ssi-controller = <&ssi1>;
                audio-codec = <&codec>;
                audio-routing =
                        "LINE_IN", "Line In Jack",
                        "MIC_IN", "Mic Jack",
                        "Mic Jack", "Mic Bias",
                        "Headphone Jack", "HP_OUT";
-               mux-int-port = <1>;
+               model = "imx6q-apalis-sgtl5000";
                mux-ext-port = <4>;
+               mux-int-port = <1>;
+               ssi-controller = <&ssi1>;
        };
 
        sound_spdif: sound-spdif {
                compatible = "fsl,imx-audio-spdif";
-               model = "imx-spdif";
                spdif-controller = <&spdif>;
                spdif-in;
                spdif-out;
+               model = "imx-spdif";
                status = "disabled";
        };
 };
        status = "disabled";
 };
 
+&clks {
+       fsl,pmic-stby-poweroff;
+};
+
 /* Apalis SPI1 */
 &ecspi1 {
        cs-gpios = <&gpio5 25 GPIO_ACTIVE_LOW>;
        status = "disabled";
 };
 
+&gpio1 {
+       gpio-line-names = "MXM3_84",
+                         "MXM3_4",
+                         "MXM3_15/GPIO7",
+                         "MXM3_96",
+                         "MXM3_37",
+                         "",
+                         "MXM3_17/GPIO8",
+                         "MXM3_14",
+                         "MXM3_12",
+                         "MXM3_2",
+                         "MXM3_184",
+                         "MXM3_180",
+                         "MXM3_178",
+                         "MXM3_176",
+                         "MXM3_188",
+                         "MXM3_186",
+                         "MXM3_160",
+                         "MXM3_162",
+                         "MXM3_150",
+                         "MXM3_144",
+                         "MXM3_154",
+                         "MXM3_146",
+                         "",
+                         "",
+                         "MXM3_72";
+};
+
+&gpio2 {
+       gpio-line-names = "MXM3_148",
+                         "MXM3_152",
+                         "MXM3_156",
+                         "MXM3_158",
+                         "MXM3_1/GPIO1",
+                         "MXM3_3/GPIO2",
+                         "MXM3_5/GPIO3",
+                         "MXM3_7/GPIO4",
+                         "MXM3_95",
+                         "MXM3_6",
+                         "MXM3_8",
+                         "MXM3_123",
+                         "MXM3_126",
+                         "MXM3_128",
+                         "MXM3_130",
+                         "MXM3_132",
+                         "MXM3_253",
+                         "MXM3_251",
+                         "MXM3_283",
+                         "MXM3_281",
+                         "MXM3_279",
+                         "MXM3_277",
+                         "MXM3_243",
+                         "MXM3_235",
+                         "MXM3_231",
+                         "MXM3_229",
+                         "MXM3_233",
+                         "MXM3_198",
+                         "MXM3_275",
+                         "MXM3_273",
+                         "MXM3_207",
+                         "MXM3_122";
+};
+
+&gpio3 {
+       gpio-line-names = "MXM3_271",
+                         "MXM3_269",
+                         "MXM3_301",
+                         "MXM3_299",
+                         "MXM3_297",
+                         "MXM3_295",
+                         "MXM3_293",
+                         "MXM3_291",
+                         "MXM3_289",
+                         "MXM3_287",
+                         "MXM3_249",
+                         "MXM3_247",
+                         "MXM3_245",
+                         "MXM3_286",
+                         "MXM3_239",
+                         "MXM3_35",
+                         "MXM3_205",
+                         "MXM3_203",
+                         "MXM3_201",
+                         "MXM3_116",
+                         "MXM3_114",
+                         "MXM3_262",
+                         "MXM3_274",
+                         "MXM3_124",
+                         "MXM3_110",
+                         "MXM3_120",
+                         "MXM3_263",
+                         "MXM3_265",
+                         "",
+                         "MXM3_135",
+                         "MXM3_261",
+                         "MXM3_259";
+};
+
+&gpio4 {
+       gpio-line-names = "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "MXM3_194",
+                         "MXM3_136",
+                         "MXM3_134",
+                         "MXM3_140",
+                         "MXM3_138",
+                         "",
+                         "MXM3_220",
+                         "",
+                         "",
+                         "MXM3_18",
+                         "MXM3_16",
+                         "",
+                         "",
+                         "MXM3_214",
+                         "MXM3_216",
+                         "MXM3_164";
+};
+
+&gpio5 {
+       gpio-line-names = "MXM3_159",
+                         "",
+                         "",
+                         "",
+                         "MXM3_257",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "MXM3_200",
+                         "MXM3_196",
+                         "MXM3_204",
+                         "MXM3_202",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "MXM3_191",
+                         "MXM3_197",
+                         "MXM3_77",
+                         "MXM3_195",
+                         "MXM3_221",
+                         "MXM3_225",
+                         "MXM3_223",
+                         "MXM3_227",
+                         "MXM3_209",
+                         "MXM3_211",
+                         "MXM3_118",
+                         "MXM3_112",
+                         "MXM3_187",
+                         "MXM3_185";
+};
+
+&gpio6 {
+       gpio-line-names = "MXM3_183",
+                         "MXM3_181",
+                         "MXM3_179",
+                         "MXM3_177",
+                         "MXM3_175",
+                         "MXM3_173",
+                         "MXM3_255",
+                         "MXM3_83",
+                         "MXM3_91",
+                         "MXM3_13/GPIO6",
+                         "MXM3_11/GPIO5",
+                         "MXM3_79",
+                         "",
+                         "",
+                         "MXM3_190",
+                         "MXM3_193",
+                         "MXM3_89";
+};
+
+&gpio7 {
+       gpio-line-names = "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "MXM3_99",
+                         "MXM3_85",
+                         "MXM3_217",
+                         "MXM3_215";
+};
+
+&gpr {
+       ipu1_csi0_mux {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               status = "disabled";
+
+               port@1 {
+                       reg = <1>;
+                       ipu1_csi0_mux_from_parallel_sensor: endpoint {
+                               remote-endpoint = <&adv7280_to_ipu1_csi0_mux>;
+                       };
+               };
+       };
+};
+
 &fec {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_enet>;
        scl-gpios = <&gpio5 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        sda-gpios = <&gpio5 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        status = "disabled";
+
+       atmel_mxt_ts: touchscreen@4a {
+               compatible = "atmel,maxtouch";
+               /* These GPIOs are muxed with the iomuxc node */
+               interrupt-parent = <&gpio6>;
+               interrupts = <10 IRQ_TYPE_EDGE_FALLING>;        /* MXM3_11 */
+               reg = <0x4a>;
+               reset-gpios = <&gpio6 9 GPIO_ACTIVE_LOW>;       /* MXM3_13 */
+               status = "disabled";
+       };
 };
 
 /*
        sda-gpios = <&gpio4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        status = "okay";
 
-       pmic: pfuze100@8 {
+       pmic: pmic@8 {
                compatible = "fsl,pfuze100";
+               fsl,pmic-stby-poweroff;
                reg = <0x08>;
 
                regulators {
                        sw1a_reg: sw1ab {
-                               regulator-min-microvolt = <300000>;
-                               regulator-max-microvolt = <1875000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1875000>;
+                               regulator-min-microvolt = <300000>;
                                regulator-ramp-delay = <6250>;
                        };
 
                        sw1c_reg: sw1c {
-                               regulator-min-microvolt = <300000>;
-                               regulator-max-microvolt = <1875000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1875000>;
+                               regulator-min-microvolt = <300000>;
                                regulator-ramp-delay = <6250>;
                        };
 
                        sw3a_reg: sw3a {
-                               regulator-min-microvolt = <400000>;
-                               regulator-max-microvolt = <1975000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1975000>;
+                               regulator-min-microvolt = <400000>;
                        };
 
                        swbst_reg: swbst {
-                               regulator-min-microvolt = <5000000>;
-                               regulator-max-microvolt = <5150000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <5150000>;
+                               regulator-min-microvolt = <5000000>;
                        };
 
                        snvs_reg: vsnvs {
-                               regulator-min-microvolt = <1000000>;
-                               regulator-max-microvolt = <3000000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3000000>;
+                               regulator-min-microvolt = <1000000>;
                        };
 
                        vref_reg: vrefddr {
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
                        };
 
                        vgen1_reg: vgen1 {
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <1550000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1550000>;
+                               regulator-min-microvolt = <800000>;
                        };
 
                        vgen2_reg: vgen2 {
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <1550000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1550000>;
+                               regulator-min-microvolt = <800000>;
                        };
 
                        vgen3_reg: vgen3 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <1800000>;
                        };
 
                        vgen4_reg: vgen4 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
                        };
 
                        vgen5_reg: vgen5 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <1800000>;
                        };
 
                        vgen6_reg: vgen6 {
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <1800000>;
                        };
                };
        };
 
        codec: sgtl5000@a {
                compatible = "fsl,sgtl5000";
-               reg = <0x0a>;
+               #sound-dai-cells = <0>;
+               clocks = <&clks IMX6QDL_CLK_CKO>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_sgtl5000>;
-               clocks = <&clks IMX6QDL_CLK_CKO>;
+               reg = <0x0a>;
                VDDA-supply = <&reg_module_3v3_audio>;
                VDDIO-supply = <&reg_module_3v3>;
                VDDD-supply = <&vgen4_reg>;
        /* STMPE811 touch screen controller */
        stmpe811@41 {
                compatible = "st,stmpe811";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_touch_int>;
-               reg = <0x41>;
+               blocks = <0x5>;
+               id = <0>;
                interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
-               interrupt-parent = <&gpio4>;
                interrupt-controller;
-               id = <0>;
-               blocks = <0x5>;
+               interrupt-parent = <&gpio4>;
                irq-trigger = <0x1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_touch_int>;
+               reg = <0x41>;
                /* 3.25 MHz ADC clock speed */
                st,adc-freq = <1>;
                /* 12-bit ADC */
                /* ADC conversion time: 80 clocks */
                st,sample-time = <4>;
 
-               stmpe_touchscreen: stmpe-touchscreen {
+               stmpe_ts: stmpe_touchscreen {
                        compatible = "st,stmpe-ts";
                        /* 8 sample average control */
                        st,ave-ctrl = <3>;
                        st,settling = <3>;
                        /* 5 ms touch detect interrupt delay */
                        st,touch-det-delay = <5>;
+                       status = "disabled";
                };
 
-               stmpe_adc: stmpe-adc {
+               stmpe_adc: stmpe_adc {
                        compatible = "st,stmpe-adc";
+                       #io-channel-cells = <1>;
                        /* forbid to use ADC channels 3-0 (touch) */
                        st,norequest-mask = <0x0F>;
-                       #io-channel-cells = <1>;
                };
        };
 };
        scl-gpios = <&gpio3 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        sda-gpios = <&gpio3 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        status = "disabled";
+
+       adv_7280: adv7280@21 {
+               compatible = "adi,adv7280";
+               adv,force-bt656-4;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_ipu1_csi0>;
+               reg = <0x21>;
+               status = "disabled";
+
+               port {
+                       adv7280_to_ipu1_csi0_mux: endpoint {
+                               bus-width = <8>;
+                               remote-endpoint = <&ipu1_csi0_mux_from_parallel_sensor>;
+                       };
+               };
+       };
+
+       ov5640_csi_cam: ov5640_mipi@3c {
+               compatible = "ovti,ov5640";
+               AVDD-supply = <&reg_ov5640_2v8_a_vdd>;
+               DOVDD-supply = <&reg_ov5640_1v8_d_o_vdd>;
+               DVDD-supply = <&reg_ov5640_1v8_d_o_vdd>;
+               clock-names = "xclk";
+               clocks = <&clks IMX6QDL_CLK_CKO2>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_cam_mclk>;
+               /* These GPIOs are muxed with the iomuxc node */
+               powerdown-gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
+               reg = <0x3c>;
+               reset-gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
+               status = "disabled";
+
+               port {
+                       ov5640_to_mipi_csi2: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2>;
+                               remote-endpoint = <&mipi_csi_from_ov5640>;
+                       };
+               };
+       };
+};
+
+&ipu1_di1_disp1 {
+       remote-endpoint = <&lcd_display_in>;
+};
+
+&ldb {
+       lvds-channel@0 {
+               port@4 {
+                       reg = <4>;
+
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&lvds_panel_in>;
+                       };
+               };
+       };
+
+       lvds-channel@1 {
+               fsl,data-mapping = "spwg";
+               fsl,data-width = <18>;
+
+               port@4 {
+                       reg = <4>;
+
+                       lvds1_out: endpoint {
+                       };
+               };
+       };
+};
+
+&mipi_csi {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       status = "disabled";
+
+       port@0 {
+               reg = <0>;
+
+               mipi_csi_from_ov5640: endpoint {
+                       clock-lanes = <0>;
+                       data-lanes = <1 2>;
+                       remote-endpoint = <&ov5640_to_mipi_csi2>;
+               };
+       };
 };
 
 &pwm1 {
 };
 
 &pwm4 {
-       #pwm-cells = <2>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm4>;
        status = "disabled";
 };
 
 &uart1 {
+       fsl,dte-mode;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1_dte &pinctrl_uart1_ctrl>;
-       fsl,dte-mode;
        uart-has-rtscts;
        status = "disabled";
 };
 
 &uart2 {
+       fsl,dte-mode;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart2_dte>;
-       fsl,dte-mode;
        uart-has-rtscts;
        status = "disabled";
 };
 
 &uart4 {
+       fsl,dte-mode;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart4_dte>;
-       fsl,dte-mode;
        status = "disabled";
 };
 
 &uart5 {
+       fsl,dte-mode;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart5_dte>;
-       fsl,dte-mode;
        status = "disabled";
 };
 
 &usbotg {
+       disable-over-current;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_usbotg>;
-       disable-over-current;
        status = "disabled";
 };
 
 /* MMC1 */
 &usdhc1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_usdhc1_8bit>;
-       vqmmc-supply = <&reg_module_3v3>;
        bus-width = <8>;
+       cd-gpios = <&gpio4 20 GPIO_ACTIVE_LOW>;
        disable-wp;
        no-1-8-v;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc1_4bit &pinctrl_usdhc1_8bit &pinctrl_mmc_cd>;
+       vqmmc-supply = <&reg_module_3v3>;
        status = "disabled";
 };
 
 /* SD1 */
 &usdhc2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc2>;
-       vqmmc-supply = <&reg_module_3v3>;
        bus-width = <4>;
        disable-wp;
        no-1-8-v;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc2>;
+       vqmmc-supply = <&reg_module_3v3>;
        status = "disabled";
 };
 
 /* eMMC */
 &usdhc3 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc3>;
-       vqmmc-supply = <&reg_module_3v3>;
        bus-width = <8>;
        no-1-8-v;
        non-removable;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       vqmmc-supply = <&reg_module_3v3>;
        status = "okay";
 };
 
 };
 
 &iomuxc {
-       pinctrl_apalis_gpio1: gpio2io04grp {
+       /* Mux the Apalis GPIOs */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_apalis_gpio1 &pinctrl_apalis_gpio2
+                    &pinctrl_apalis_gpio3 &pinctrl_apalis_gpio4
+                    &pinctrl_apalis_gpio5 &pinctrl_apalis_gpio6
+                    &pinctrl_apalis_gpio7 &pinctrl_apalis_gpio8
+                   >;
+
+       pinctrl_apalis_gpio1: apalisgpio1grp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_D4__GPIO2_IO04 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio2: gpio2io05grp {
+       pinctrl_apalis_gpio2: apalisgpio2grp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_D5__GPIO2_IO05 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio3: gpio2io06grp {
+       pinctrl_apalis_gpio3: apalisgpio3grp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_D6__GPIO2_IO06 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio4: gpio2io07grp {
+       pinctrl_apalis_gpio4: apalisgpio4grp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_D7__GPIO2_IO07 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio5: gpio6io10grp {
+       pinctrl_apalis_gpio5: apalisgpio5grp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_RB0__GPIO6_IO10 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio6: gpio6io09grp {
+       pinctrl_apalis_gpio6: apalisgpio6grp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_WP_B__GPIO6_IO09 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio7: gpio1io02grp {
+       pinctrl_apalis_gpio7: apalisgpio7grp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_2__GPIO1_IO02 0x130b0
                >;
        };
 
-       pinctrl_apalis_gpio8: gpio1io06grp {
+       pinctrl_apalis_gpio8: apalisgpio8grp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_6__GPIO1_IO06 0x130b0
                >;
                >;
        };
 
-       pinctrl_gpio_bl_on: gpioblon {
+       pinctrl_gpio_bl_on: gpioblongrp {
                fsl,pins = <
                        MX6QDL_PAD_EIM_DA13__GPIO3_IO13 0x1b0b0
                >;
                >;
        };
 
-       pinctrl_mmc_cd: gpiommccdgrp {
+       pinctrl_mmc_cd: mmccdgrp {
                fsl,pins = <
                         /* MMC1 CD */
                        MX6QDL_PAD_DI0_PIN4__GPIO4_IO20 0x000b0
                >;
        };
 
-       pinctrl_regulator_usbh_pwr: gpioregusbhpwrgrp {
+       pinctrl_regulator_usbh_pwr: regusbhpwrgrp {
                fsl,pins = <
                        /* USBH_EN */
                        MX6QDL_PAD_GPIO_0__GPIO1_IO00 0x0f058
                >;
        };
 
-       pinctrl_regulator_usbhub_pwr: gpioregusbhubpwrgrp {
+       pinctrl_regulator_usbhub_pwr: regusbhubpwrgrp {
                fsl,pins = <
                        /* USBH_HUB_EN */
                        MX6QDL_PAD_EIM_D28__GPIO3_IO28 0x0f058
                >;
        };
 
-       pinctrl_regulator_usbotg_pwr: gpioregusbotgpwrgrp {
+       pinctrl_regulator_usbotg_pwr: regusbotgpwrgrp {
                fsl,pins = <
                        /* USBO1 power en */
                        MX6QDL_PAD_EIM_D22__GPIO3_IO22 0x0f058
                >;
        };
 
-       pinctrl_reset_moci: gpioresetmocigrp {
+       pinctrl_reset_moci: resetmocigrp {
                fsl,pins = <
                        /* RESET_MOCI control */
                        MX6QDL_PAD_ENET_TX_EN__GPIO1_IO28 0x0f058
                >;
        };
 
-       pinctrl_sd_cd: gpiosdcdgrp {
+       pinctrl_sd_cd: sdcdgrp {
                fsl,pins = <
                        /* SD1 CD */
                        MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x000b0
                >;
        };
 
-       pinctrl_touch_int: gpiotouchintgrp {
+       pinctrl_touch_int: touchintgrp {
                fsl,pins = <
                        /* STMPE811 interrupt */
                        MX6QDL_PAD_KEY_COL2__GPIO4_IO10 0x1b0b0
                >;
        };
 
+       /* Additional DTR, DSR, DCD */
+       pinctrl_uart1_ctrl: uart1ctrlgrp {
+               fsl,pins = <
+                       MX6QDL_PAD_EIM_D23__UART1_DCD_B 0x1b0b0
+                       MX6QDL_PAD_EIM_D24__UART1_DTR_B 0x1b0b0
+                       MX6QDL_PAD_EIM_D25__UART1_DSR_B 0x1b0b0
+               >;
+       };
+
        pinctrl_uart1_dce: uart1dcegrp {
                fsl,pins = <
                        MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
                >;
        };
 
-       /* Additional DTR, DSR, DCD */
-       pinctrl_uart1_ctrl: uart1ctrlgrp {
-               fsl,pins = <
-                       MX6QDL_PAD_EIM_D23__UART1_DCD_B 0x1b0b0
-                       MX6QDL_PAD_EIM_D24__UART1_DTR_B 0x1b0b0
-                       MX6QDL_PAD_EIM_D25__UART1_DSR_B 0x1b0b0
-               >;
-       };
-
        pinctrl_uart2_dce: uart2dcegrp {
                fsl,pins = <
                        MX6QDL_PAD_SD4_DAT4__UART2_RX_DATA      0x1b0b1
                >;
        };
 
-       pinctrl_usdhc1_4bit: usdhc1grp_4bit {
+       pinctrl_usdhc1_4bit: usdhc1-4bitgrp {
                fsl,pins = <
                        MX6QDL_PAD_SD1_CMD__SD1_CMD    0x17071
                        MX6QDL_PAD_SD1_CLK__SD1_CLK    0x10071
                >;
        };
 
-       pinctrl_usdhc1_8bit: usdhc1grp_8bit {
+       pinctrl_usdhc1_8bit: usdhc1-8bitgrp {
                fsl,pins = <
                        MX6QDL_PAD_NANDF_D0__SD1_DATA4 0x17071
                        MX6QDL_PAD_NANDF_D1__SD1_DATA5 0x17071
index c383e0e..023e762 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pwm/pwm.h>
 
 / {
        model = "Toradex Colibri iMX6DL/S Module";
 
        backlight: backlight {
                compatible = "pwm-backlight";
-               brightness-levels = <0 127 191 223 239 247 251 255>;
-               default-brightness-level = <1>;
+               brightness-levels = <0 45 63 88 119 158 203 255>;
+               default-brightness-level = <4>;
                enable-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>; /* Colibri BL_ON */
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_bl_on>;
                power-supply = <&reg_module_3v3>;
-               pwms = <&pwm3 0 5000000>;
+               pwms = <&pwm3 0 5000000 PWM_POLARITY_INVERTED>;
                status = "disabled";
        };
 
                compatible = "fsl,sgtl5000";
                clocks = <&clks IMX6QDL_CLK_CKO>;
                lrclk-strength = <3>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_sgtl5000>;
                reg = <0x0a>;
                #sound-dai-cells = <0>;
                VDDA-supply = <&reg_module_3v3_audio>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_atmel_conn>;
                reg = <0x4a>;
-               reset-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;     /* SODIMM 106 */
+               reset-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;      /* SODIMM 106 */
                status = "disabled";
        };
 };
 
 /* Colibri PWM<A> */
 &pwm3 {
-       #pwm-cells = <2>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm3>;
        status = "disabled";
 
        pinctrl_audmux: audmuxgrp {
                fsl,pins = <
-                       /* SGTL5000 sys_mclk */
-                       MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x000b0
                        MX6QDL_PAD_KEY_COL0__AUD5_TXC   0x130b0
                        MX6QDL_PAD_KEY_ROW0__AUD5_TXD   0x130b0
                        MX6QDL_PAD_KEY_COL1__AUD5_TXFS  0x130b0
                >;
        };
 
+       pinctrl_sgtl5000: sgtl5000grp {
+               fsl,pins = <
+                       /* SGTL5000 sys_mclk */
+                       MX6QDL_PAD_GPIO_0__CCM_CLKO1    0x000b0
+               >;
+       };
+
        pinctrl_spdif: spdifgrp {
                fsl,pins = <
                        MX6QDL_PAD_GPIO_17__SPDIF_OUT 0x1b0b0
index 19578f6..f0db0d4 100644 (file)
@@ -94,6 +94,9 @@
        pinctrl-0 = <&pinctrl_usdhc3>;
        bus-width = <8>;
        non-removable;
+       no-1-8-v;
+       no-sd;
+       no-sdio;
        status = "okay";
 };
 
index 69ae430..8254bce 100644 (file)
                reg = <0>;
                spi-max-frequency = <1000000>;
                interrupts-extended = <&gpio3 19 IRQ_TYPE_LEVEL_LOW>;
-               vcc-supply  = <&reg_3v3>;
+               vcc-supply = <&reg_3v3>;
                pendown-gpio = <&gpio3 19 GPIO_ACTIVE_LOW>;
                ti,x-plate-ohms = /bits/ 16 <850>;
                ti,y-plate-ohms = /bits/ 16 <295>;
                ti,pressure-min = /bits/ 16 <2>;
                ti,pressure-max = /bits/ 16 <1500>;
-               ti,vref-mv      = /bits/ 16 <3300>;
+               ti,vref-mv = /bits/ 16 <3300>;
                ti,settle-delay-usec = /bits/ 16 <15>;
                ti,vref-delay-usecs = /bits/ 16 <0>;
                ti,penirq-recheck-delay-usecs = /bits/ 16 <100>;
index 77a91a9..3def1b6 100644 (file)
                gpio = <&gpio4 11 GPIO_ACTIVE_LOW>;
        };
 
+       reg_tft_vcom: regulator-tft-vcom {
+               compatible = "pwm-regulator";
+               pwms = <&pwm3 0 20000 0>;
+               regulator-name = "tft_vcom";
+               regulator-min-microvolt = <3600000>;
+               regulator-max-microvolt = <3600000>;
+               regulator-always-on;
+               voltage-table = <3600000 26>;
+       };
+
        reg_vcc_mmc: regulator-vcc-mmc {
                compatible = "regulator-fixed";
                pinctrl-names = "default";
index d27beb4..4f7fefc 100644 (file)
                #phy-cells = <0>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                        status = "disabled";
                };
 
-               bus@2000000 { /* AIPS1 */
+               aips1: bus@2000000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
                                        regulator-name = "vddpu";
                                        regulator-min-microvolt = <725000>;
                                        regulator-max-microvolt = <1450000>;
-                                       regulator-enable-ramp-delay = <150>;
+                                       regulator-enable-ramp-delay = <380>;
                                        anatop-reg-offset = <0x140>;
                                        anatop-vol-bit-shift = <9>;
                                        anatop-vol-bit-width = <5>;
                        };
                };
 
-               bus@2100000 { /* AIPS2 */
+               aips2: bus@2100000 { /* AIPS2 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index a17b8bb..663ee9d 100644 (file)
@@ -27,7 +27,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_keys>;
 
-               cover {
+               key-cover {
                        label = "Cover";
                        gpios = <&gpio5 12 GPIO_ACTIVE_LOW>;
                        linux,code = <SW_LID>;
                        wakeup-source;
                };
 
-               fl {
+               key-fl {
                        label = "Frontlight";
                        gpios = <&gpio3 26 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BRIGHTNESS_CYCLE>;
                };
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&gpio3 25 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
@@ -60,7 +60,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_led>;
 
-               on {
+               led-0 {
                        label = "tolinoshine2hd:white:on";
                        gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "timer";
index fc63343..4d075e2 100644 (file)
                #phy-cells = <0>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
index a6cf0f2..4386831 100644 (file)
@@ -72,7 +72,6 @@
 &adc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_adc1>;
-       num-channels = <3>;
        vref-supply = <&reg_vref_adc>;
        status = "okay";
 };
index 0d4ba94..38ea4dc 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_adc1>;
        vref-supply = <&reg_adc1_vref_3v3>;
-       /*
-        * driver can not separate a specific channel so we request 4 channels
-        * here - we need only the fourth channel
-        */
-       num-channels = <4>;
        status = "disabled";
 };
 
index caf2c5d..4b87e2d 100644 (file)
@@ -14,7 +14,7 @@
 };
 
 &usdhc2 {
-       fsl,tuning-step= <6>;
+       fsl,tuning-step = <6>;
 };
 
 &iomuxc {
index afeec01..c95efd1 100644 (file)
                        clock-frequency = <696000000>;
                        clock-latency = <61036>; /* two CLK32 periods */
                        #cooling-cells = <2>;
-                       operating-points = <
+                       operating-points =
                                /* kHz  uV */
-                               696000  1275000
-                               528000  1175000
-                               396000  1025000
-                               198000  950000
-                       >;
-                       fsl,soc-operating-points = <
+                               <696000 1275000>,
+                               <528000 1175000>,
+                               <396000 1025000>,
+                               <198000 950000>;
+                       fsl,soc-operating-points =
                                /* KHz  uV */
-                               696000  1275000
-                               528000  1175000
-                               396000  1175000
-                               198000  1175000
-                       >;
+                               <696000 1275000>,
+                               <528000 1175000>,
+                               <396000 1175000>,
+                               <198000 1175000>;
                        clocks = <&clks IMX6UL_CLK_ARM>,
                                 <&clks IMX6UL_CLK_PLL2_BUS>,
                                 <&clks IMX6UL_CLK_PLL2_PFD2>,
                interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                ocram: sram@900000 {
                        compatible = "mmio-sram";
                        reg = <0x00900000 0x20000>;
+                       ranges = <0 0x00900000 0x20000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
                };
 
                intc: interrupt-controller@a01000 {
                        };
 
                        kpp: keypad@20b8000 {
-                               compatible = "fsl,imx6ul-kpp", "fsl,imx6q-kpp", "fsl,imx21-kpp";
+                               compatible = "fsl,imx6ul-kpp", "fsl,imx21-kpp";
                                reg = <0x020b8000 0x4000>;
                                interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX6UL_CLK_KPP>;
                                reg = <0x02198000 0x4000>;
                                interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX6UL_CLK_ADC1>;
-                               num-channels = <2>;
                                clock-names = "adc";
                                fsl,adck-max-frequency = <30000000>, <40000000>,
                                                         <20000000>;
                        };
 
                        csi: csi@21c4000 {
-                               compatible = "fsl,imx6ul-csi", "fsl,imx7-csi";
+                               compatible = "fsl,imx6ul-csi";
                                reg = <0x021c4000 0x4000>;
                                interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX6UL_CLK_CSI>;
                        };
 
                        lcdif: lcdif@21c8000 {
-                               compatible = "fsl,imx6ul-lcdif", "fsl,imx28-lcdif";
+                               compatible = "fsl,imx6ul-lcdif", "fsl,imx6sx-lcdif";
                                reg = <0x021c8000 0x4000>;
                                interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&clks IMX6UL_CLK_LCDIF_PIX>,
                        qspi: spi@21e0000 {
                                #address-cells = <1>;
                                #size-cells = <0>;
-                               compatible = "fsl,imx6ul-qspi", "fsl,imx6sx-qspi";
+                               compatible = "fsl,imx6ul-qspi";
                                reg = <0x021e0000 0x4000>, <0x60000000 0x10000000>;
                                reg-names = "QuadSPI", "QuadSPI-memory";
                                interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
index 15621e0..623bb75 100644 (file)
@@ -94,7 +94,6 @@
 };
 
 &adc1 {
-       num-channels = <10>;
        vref-supply = <&reg_module_3v3_avdd>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_adc1>;
index 326e6da..8541cb3 100644 (file)
@@ -14,7 +14,7 @@
 };
 
 &usdhc2 {
-       fsl,tuning-step= <6>;
+       fsl,tuning-step = <6>;
        /* Errata ERR010450 Workaround */
        max-frequency = <99000000>;
        assigned-clocks = <&clks IMX6UL_CLK_USDHC2_SEL>, <&clks IMX6UL_CLK_USDHC2>;
index 8e4d5cd..be593d4 100644 (file)
@@ -14,7 +14,7 @@
 };
 
 &usdhc2 {
-       fsl,tuning-step= <6>;
+       fsl,tuning-step = <6>;
        /* Errata ERR010450 Workaround */
        max-frequency = <99000000>;
        assigned-clocks = <&clks IMX6UL_CLK_USDHC2_SEL>, <&clks IMX6UL_CLK_USDHC2>;
index 9bf6749..2bccd45 100644 (file)
@@ -50,7 +50,7 @@
 };
 
 / {
-       soc {
+       soc: soc {
                aips3: bus@2200000 {
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
index 59bcfc9..c92e4e2 100644 (file)
        status = "okay";
 };
 
+&snvs_poweroff {
+       status = "okay";
+};
+
 &uart3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart3>;
index b770fc9..fa488a6 100644 (file)
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017-2020 Toradex AG
- *
+ * Copyright 2017-2022 Toradex
  */
 
-
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/pwm/pwm.h>
-
-/ {
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpiokeys>;
-
-               power {
-                       label = "Wake-Up";
-                       gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_WAKEUP>;
-                       debounce-interval = <10>;
-                       wakeup-source;
-               };
-       };
-
-       panel: panel {
-               compatible = "edt,et057090dhu";
-               backlight = <&bl>;
-               power-supply = <&reg_3v3>;
-
-               port {
-                       panel_in: endpoint {
-                               remote-endpoint = <&lcdif_out>;
-                       };
-               };
-       };
-
-       reg_3v3: regulator-3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "3.3V";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-       };
-
-       reg_5v0: regulator-5v0 {
-               compatible = "regulator-fixed";
-               regulator-name = "5V";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-       };
-
-       reg_usbh_vbus: regulator-usbh-vbus {
-               compatible = "regulator-fixed";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_usbh_reg>;
-               regulator-name = "VCC_USB[1-4]";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               gpio = <&gpio4 7 GPIO_ACTIVE_LOW>;
-               vin-supply = <&reg_5v0>;
-       };
-};
-
+/* Colibri AD0 to AD3 */
 &adc1 {
        status = "okay";
 };
 
-/*
- * ADC2 is not available on the Aster board and
- * conflicts with AD7879 resistive touchscreen.
- */
-&adc2 {
-       status = "disabled";
-};
-
-&bl {
-       brightness-levels = <0 4 8 16 32 64 128 255>;
-       default-brightness-level = <6>;
-       power-supply = <&reg_3v3>;
+/* Colibri SSP */
+&ecspi3 {
+       cs-gpios = <
+               &gpio4 11 GPIO_ACTIVE_LOW /* SODIMM 86 / regular SSPFRM as UNO_SPI_CS or  */
+               &gpio4 23 GPIO_ACTIVE_LOW /* SODIMM 65 / already muxed pinctrl_gpio2 as SPI_CE0_N */
+               &gpio4 22 GPIO_ACTIVE_LOW /* SODIMM 85 / already muxed pinctrl_gpio2 as SPI_CE1_N */
+       >;
        status = "okay";
 };
 
+/* Colibri Fast Ethernet */
 &fec1 {
        status = "okay";
 };
 
+/* Colibri I2C: I2C3_SDA/SCL on SODIMM 194/196 */
 &i2c4 {
        status = "okay";
-
-       /* Microchip/Atmel maxtouch controller */
-       touchscreen@4a {
-               compatible = "atmel,maxtouch";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpiotouch>;
-               reg = <0x4a>;
-               interrupt-parent = <&gpio2>;
-               interrupts = <15 IRQ_TYPE_EDGE_FALLING>;        /* SODIMM 107 */
-               reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;      /* SODIMM 106 */
-       };
-
-       /* M41T0M6 real time clock on carrier board */
-       rtc: rtc@68 {
-               compatible = "st,m41t0";
-               reg = <0x68>;
-       };
-};
-
-&iomuxc {
-       pinctrl_gpiotouch: touchgpios {
-               fsl,pins = <
-                       MX7D_PAD_EPDC_DATA15__GPIO2_IO15        0x74
-                       MX7D_PAD_EPDC_BDR0__GPIO2_IO28          0x14
-               >;
-       };
-};
-
-&lcdif {
-       status = "okay";
-
-       port {
-               lcdif_out: endpoint {
-                       remote-endpoint = <&panel_in>;
-               };
-       };
 };
 
+/* Colibri PWM<A> */
 &pwm1 {
        status = "okay";
 };
 
+/* Colibri PWM<B> */
 &pwm2 {
        status = "okay";
 };
 
+/* Colibri PWM<C> */
 &pwm3 {
        status = "okay";
 };
 
+/* Colibri PWM<D> */
 &pwm4 {
        status = "okay";
 };
 
+/* M41T0M6 real time clock */
+&rtc {
+       status = "okay";
+};
+
+/* Colibri UART_A */
 &uart1 {
        status = "okay";
 };
 
+/* Colibri UART_B */
 &uart2 {
        status = "okay";
 };
 
+/* Colibri UART_C */
 &uart3 {
        status = "okay";
 };
 
+/* Colibri USBC */
 &usbotg1 {
        status = "okay";
 };
 
+/* Colibri MMC/SD */
 &usdhc1 {
-       keep-power-in-suspend;
-       no-1-8-v;
-       wakeup-source;
-       vmmc-supply = <&reg_3v3>;
        status = "okay";
 };
index 3b9df8c..826f13d 100644 (file)
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2016-2020 Toradex
+ * Copyright 2016-2022 Toradex
  */
 
 / {
-       aliases {
-               rtc0 = &rtc;
-               rtc1 = &snvs_rtc;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       /* fixed crystal dedicated to mpc258x */
+       /* Fixed crystal dedicated to MCP2515. */
        clk16m: clk16m {
                compatible = "fixed-clock";
                #clock-cells = <0>;
                clock-frequency = <16000000>;
        };
-
-       gpio-keys {
-               compatible = "gpio-keys";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpiokeys>;
-
-               power {
-                       label = "Wake-Up";
-                       gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
-                       linux,code = <KEY_WAKEUP>;
-                       debounce-interval = <10>;
-                       wakeup-source;
-               };
-       };
-
-       panel: panel {
-               compatible = "edt,et057090dhu";
-               backlight = <&bl>;
-               power-supply = <&reg_3v3>;
-
-               port {
-                       panel_in: endpoint {
-                               remote-endpoint = <&lcdif_out>;
-                       };
-               };
-       };
-
-       reg_3v3: regulator-3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "3.3V";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-       };
-
-       reg_5v0: regulator-5v0 {
-               compatible = "regulator-fixed";
-               regulator-name = "5V";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-       };
-
-       reg_usbh_vbus: regulator-usbh-vbus {
-               compatible = "regulator-fixed";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_usbh_reg>;
-               regulator-name = "VCC_USB[1-4]";
-               regulator-min-microvolt = <5000000>;
-               regulator-max-microvolt = <5000000>;
-               gpio = <&gpio4 7 GPIO_ACTIVE_LOW>;
-               vin-supply = <&reg_5v0>;
-       };
-};
-
-&bl {
-       brightness-levels = <0 4 8 16 32 64 128 255>;
-       default-brightness-level = <6>;
-       power-supply = <&reg_3v3>;
-
-       status = "okay";
 };
 
+/* Colibri AD0 to AD3 */
 &adc1 {
        status = "okay";
 };
 
-&adc2 {
-       status = "okay";
+/*
+ * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
+ * So if you enable following capacitive touch controller, disable pwm2/pwm3 first.
+ */
+&atmel_mxt_ts {
+       interrupt-parent = <&gpio1>;
+       interrupts = <9 IRQ_TYPE_EDGE_FALLING>;         /* SODIMM 28 / INT */
+       pinctrl-0 = <&pinctrl_atmel_adapter>;
+       reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;      /* SODIMM 30 / RST */
+       status = "disabled";
 };
 
+/* Colibri SSP */
 &ecspi3 {
        status = "okay";
 
        mcp2515: can@0 {
+               clocks = <&clk16m>;
                compatible = "microchip,mcp2515";
+               interrupt-parent = <&gpio5>;
+               interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_can_int>;
                reg = <0>;
-               clocks = <&clk16m>;
-               interrupt-parent = <&gpio5>;
-               interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
                spi-max-frequency = <10000000>;
                vdd-supply = <&reg_3v3>;
                xceiver-supply = <&reg_5v0>;
-               status = "okay";
        };
 };
 
+/* Colibri Fast Ethernet */
 &fec1 {
        status = "okay";
 };
 
+/* Colibri I2C: I2C3_SDA/SCL on SODIMM 194/196 */
 &i2c4 {
        status = "okay";
-
-       /*
-        * Touchscreen is using SODIMM 28/30, also used for PWM<B>, PWM<C>,
-        * aka pwm2, pwm3. so if you enable touchscreen, disable the pwms
-        */
-       touchscreen@4a {
-               compatible = "atmel,maxtouch";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpiotouch>;
-               reg = <0x4a>;
-               interrupt-parent = <&gpio1>;
-               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;         /* SODIMM 28 */
-               reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;      /* SODIMM 30 */
-               status = "disabled";
-       };
-
-       /* M41T0M6 real time clock on carrier board */
-       rtc: rtc@68 {
-               compatible = "st,m41t0";
-               reg = <0x68>;
-       };
-};
-
-&lcdif {
-       status = "okay";
-
-       port {
-               lcdif_out: endpoint {
-                       remote-endpoint = <&panel_in>;
-               };
-       };
 };
 
+/* Colibri PWM<A> */
 &pwm1 {
        status = "okay";
 };
 
+/* Colibri PWM<B> */
 &pwm2 {
+       /* The pwm2 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
        status = "okay";
 };
 
+/* Colibri PWM<C> */
 &pwm3 {
+       /* The pwm3 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
        status = "okay";
 };
 
+/* Colibri PWM<D> */
 &pwm4 {
        status = "okay";
 };
 
+/* M41T0M6 real time clock */
+&rtc {
+       status = "okay";
+};
+
+/* Colibri UART_A */
 &uart1 {
        status = "okay";
 };
 
+/* Colibri UART_B */
 &uart2 {
        status = "okay";
 };
 
+/* Colibri UART_C */
 &uart3 {
        status = "okay";
 };
 
+/* Colibri USBC */
 &usbotg1 {
        status = "okay";
 };
 
+/* Colibri MMC/SD */
 &usdhc1 {
-       keep-power-in-suspend;
-       wakeup-source;
-       vmmc-supply = <&reg_3v3>;
        status = "okay";
 };
-
-&iomuxc {
-       pinctrl_gpiotouch: touchgpios {
-               fsl,pins = <
-                       MX7D_PAD_GPIO1_IO09__GPIO1_IO9          0x74
-                       MX7D_PAD_GPIO1_IO10__GPIO1_IO10         0x14
-               >;
-       };
-};
diff --git a/arch/arm/boot/dts/imx7-colibri-iris-v2.dtsi b/arch/arm/boot/dts/imx7-colibri-iris-v2.dtsi
new file mode 100644 (file)
index 0000000..6e19961
--- /dev/null
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/ {
+       reg_3v3_vmmc: regulator-3v3-vmmc {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio5 16 GPIO_ACTIVE_HIGH>; /* SODIMM 100 */
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "3v3_vmmc";
+               startup-delay-us = <100>;
+       };
+};
+
+/* Colibri AD0 to AD3 */
+&adc1 {
+       status = "okay";
+};
+
+/* Colibri SSP */
+&ecspi3 {
+       status = "okay";
+};
+
+/* Colibri Fast Ethernet */
+&fec1 {
+       status = "okay";
+};
+
+&gpio2 {
+       /*
+        * uart_b_c_on_x14_enable turns the UART transceiver for UART2 and 5 on. If one wants to
+        * turn the transceiver off, that property has to be deleted and the gpio handled in
+        * userspace.
+        * The same applies to uart_a_on_x13_enable where the UART_A transceiver is turned on.
+        */
+       uart-b-c-on-x14-enable-hog {
+               gpio-hog;
+               gpios = <27 GPIO_ACTIVE_HIGH>; /* SODIMM 104 */
+               output-high;
+       };
+};
+
+&gpio5 {
+       uart-a-on-x13-enable-hog {
+               gpio-hog;
+               gpios = <17 GPIO_ACTIVE_HIGH>; /* SODIMM 102 */
+               output-high;
+       };
+};
+
+/* Colibri I2C: I2C3_SDA/SCL on SODIMM 194/196 */
+&i2c4 {
+       status = "okay";
+};
+
+/* Colibri PWM<A> */
+&pwm1 {
+       status = "okay";
+};
+
+/* Colibri PWM<B> */
+&pwm2 {
+       status = "okay";
+};
+
+/* Colibri PWM<C> */
+&pwm3 {
+       status = "okay";
+};
+
+/* Colibri PWM<D> */
+&pwm4 {
+       status = "okay";
+};
+
+/* M41T0M6 real time clock */
+&rtc {
+       status = "okay";
+};
+
+/* Colibri UART_A */
+&uart1 {
+       status = "okay";
+};
+
+/* Colibri UART_B */
+&uart2 {
+       status = "okay";
+};
+
+/* Colibri UART_C */
+&uart3 {
+       status = "okay";
+};
+
+/* Colibri USBC */
+&usbotg1 {
+       status = "okay";
+};
+
+/* Colibri MMC/SD, UHS-I capable uSD slot */
+&usdhc1 {
+       cap-power-off-card;
+       /delete-property/ keep-power-in-suspend;
+       /delete-property/ no-1-8-v;
+       vmmc-supply = <&reg_3v3_vmmc>;
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx7-colibri-iris.dtsi b/arch/arm/boot/dts/imx7-colibri-iris.dtsi
new file mode 100644 (file)
index 0000000..175c5d4
--- /dev/null
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/* Colibri AD0 to AD3 */
+&adc1 {
+       status = "okay";
+};
+
+/*
+ * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
+ * So if you enable following capacitive touch controller, disable pwm2/pwm3 first.
+ */
+&atmel_mxt_ts {
+       interrupt-parent = <&gpio1>;
+       interrupts = <9 IRQ_TYPE_EDGE_FALLING>;         /* SODIMM 28 / INT */
+       pinctrl-0 = <&pinctrl_atmel_adapter>;
+       reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;      /* SODIMM 30 / RST */
+};
+
+/* Colibri SSP */
+&ecspi3 {
+       status = "okay";
+};
+
+/* Colibri Fast Ethernet */
+&fec1 {
+       status = "okay";
+};
+
+&gpio2 {
+       /*
+        * uart25 turns the UART transceiver for UART2 and 5 on. If one wants to turn the
+        * transceiver off, that property has to be deleted and the gpio handled in userspace.
+        * The same applies to uart1_tx_on where the UART1 transceiver is turned on.
+        */
+       uart25-tx-on-hog {
+               gpio-hog;
+               gpios = <27 GPIO_ACTIVE_HIGH>; /* SODIMM 104 */
+               output-high;
+       };
+};
+
+&gpio5 {
+       uart1-tx-on-hog {
+               gpio-hog;
+               gpios = <17 GPIO_ACTIVE_HIGH>; /* SODIMM 102 */
+               output-high;
+       };
+};
+
+/* Colibri I2C: I2C3_SDA/SCL on SODIMM 194/196 */
+&i2c4 {
+       status = "okay";
+};
+
+/* Colibri PWM<A> */
+&pwm1 {
+       status = "okay";
+};
+
+/* Colibri PWM<B> */
+&pwm2 {
+       /* The pwm2 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri PWM<C> */
+&pwm3 {
+       /* The pwm3 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri PWM<D> */
+&pwm4 {
+       status = "okay";
+};
+
+/* M41T0M6 real time clock */
+&rtc {
+       status = "okay";
+};
+
+/* Colibri UART_A */
+&uart1 {
+       status = "okay";
+};
+
+/* Colibri UART_B */
+&uart2 {
+       status = "okay";
+};
+
+/* Colibri UART_C */
+&uart3 {
+       status = "okay";
+};
+
+/* Colibri USBC */
+&usbotg1 {
+       status = "okay";
+};
+
+/* Colibri MMC/SD */
+&usdhc1 {
+       status = "okay";
+};
index f1c60b0..a8c31ee 100644 (file)
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2016-2020 Toradex
+ * Copyright 2016-2022 Toradex
  */
 
+#include <dt-bindings/pwm/pwm.h>
+
 / {
-       bl: backlight {
+       aliases {
+               rtc0 = &rtc;
+               rtc1 = &snvs_rtc;
+       };
+
+       backlight: backlight {
+               brightness-levels = <0 45 63 88 119 158 203 255>;
                compatible = "pwm-backlight";
+               default-brightness-level = <4>;
+               enable-gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_bl_on>;
-               pwms = <&pwm1 0 5000000 0>;
-               enable-gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>;
+               power-supply = <&reg_module_3v3>;
+               pwms = <&pwm1 0 6666667 PWM_POLARITY_INVERTED>;
+               status = "disabled";
        };
 
-       reg_module_3v3: regulator-module-3v3 {
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       extcon_usbc_det: usbc-det {
+               compatible = "linux,extcon-usb-gpio";
+               debounce = <25>;
+               id-gpio = <&gpio7 14 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_usbc_det>;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpiokeys>;
+
+               wakeup {
+                       debounce-interval = <10>;
+                       gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* SODIMM 45 */
+                       label = "Wake-Up";
+                       linux,code = <KEY_WAKEUP>;
+                       wakeup-source;
+               };
+       };
+
+       panel_dpi: panel-dpi {
+               backlight = <&backlight>;
+               compatible = "edt,et057090dhu";
+               power-supply = <&reg_3v3>;
+               status = "disabled";
+
+               port {
+                       lcd_panel_in: endpoint {
+                               remote-endpoint = <&lcdif_out>;
+                       };
+               };
+       };
+
+       reg_3v3: regulator-3v3 {
                compatible = "regulator-fixed";
-               regulator-name = "+V3.3";
-               regulator-min-microvolt = <3300000>;
+               regulator-always-on;
                regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "3.3V";
+       };
+
+       reg_5v0: regulator-5v0 {
+               compatible = "regulator-fixed";
                regulator-always-on;
+               regulator-max-microvolt = <5000000>;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "5V";
+       };
+
+       reg_module_3v3: regulator-module-3v3 {
+               compatible = "regulator-fixed";
+               regulator-always-on;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "+V3.3";
        };
 
        reg_module_3v3_avdd: regulator-module-3v3-avdd {
                compatible = "regulator-fixed";
+               regulator-always-on;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
                regulator-name = "+V3.3_AVDD_AUDIO";
+       };
+
+       reg_module_3v3_eth: regulator-module-3v3-eth {
+               compatible = "regulator-fixed";
+               off-on-delay-us = <200000>;
+               regulator-name = "+V3.3_ETH";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
-               regulator-always-on;
+               regulator-boot-on;
+               startup-delay-us = <200000>;
+               vin-supply = <&reg_LDO1>;
+       };
+
+       reg_usbh_vbus: regulator-usbh-vbus {
+               compatible = "regulator-fixed";
+               gpio = <&gpio4 7 GPIO_ACTIVE_LOW>; /* SODIMM 129 / USBH_PEN */
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_usbh_reg>;
+               regulator-max-microvolt = <5000000>;
+               regulator-min-microvolt = <5000000>;
+               regulator-name = "VCC_USB[1-4]";
+               vin-supply = <&reg_5v0>;
        };
 
        sound {
                compatible = "simple-audio-card";
-               simple-audio-card,name = "imx7-sgtl5000";
-               simple-audio-card,format = "i2s";
                simple-audio-card,bitclock-master = <&dailink_master>;
+               simple-audio-card,format = "i2s";
                simple-audio-card,frame-master = <&dailink_master>;
+               simple-audio-card,name = "imx7-sgtl5000";
+
                simple-audio-card,cpu {
                        sound-dai = <&sai1>;
                };
 
                dailink_master: simple-audio-card,codec {
-                       sound-dai = <&codec>;
                        clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
+                       sound-dai = <&codec>;
                };
        };
 };
 
+/* Colibri AD0 to AD3 */
 &adc1 {
        vref-supply = <&reg_DCDC3>;
 };
 
-&adc2 {
-       vref-supply = <&reg_DCDC3>;
-};
+/* ADC2 is not available as it conflicts with AD7879 resistive touchscreen. */
 
 &cpu0 {
        cpu-supply = <&reg_DCDC2>;
 };
 
+/* Colibri SSP */
 &ecspi3 {
+       cs-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>; /* SODIMM 86 / SSPFRM */
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_ecspi3 &pinctrl_ecspi3_cs>;
-       cs-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
 };
 
+/* Colibri Fast Ethernet */
 &fec1 {
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&pinctrl_enet1>;
-       pinctrl-1 = <&pinctrl_enet1_sleep>;
-       clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
-               <&clks IMX7D_ENET_AXI_ROOT_CLK>,
-               <&clks IMX7D_ENET1_TIME_ROOT_CLK>,
-               <&clks IMX7D_PLL_ENET_MAIN_50M_CLK>;
-       clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
-       assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>,
-                         <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
        assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>;
        assigned-clock-rates = <0>, <100000000>;
-       phy-mode = "rmii";
-       phy-supply = <&reg_LDO1>;
+       assigned-clocks = <&clks IMX7D_ENET1_TIME_ROOT_SRC>,
+                         <&clks IMX7D_ENET1_TIME_ROOT_CLK>;
+       clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
+       clocks = <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+                <&clks IMX7D_ENET_AXI_ROOT_CLK>,
+                <&clks IMX7D_ENET1_TIME_ROOT_CLK>,
+                <&clks IMX7D_PLL_ENET_MAIN_50M_CLK>;
        fsl,magic-packet;
+       phy-handle = <&ethphy0>;
+       phy-mode = "rmii";
+       phy-supply = <&reg_module_3v3_eth>;
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&pinctrl_enet1>;
+       pinctrl-1 = <&pinctrl_enet1_sleep>;
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               /* Micrel KSZ8041RNL */
+               ethphy0: ethernet-phy@0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       max-speed = <100>;
+                       micrel,led-mode = <0>;
+                       reg = <0>;
+               };
+       };
 };
 
 &flexcan1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_flexcan1>;
-       status = "disabled";
 };
 
 &flexcan2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_flexcan2>;
-       status = "disabled";
 };
 
 &gpio1 {
                          "SODIMM_137";
 };
 
+/* NAND on such SKUs */
 &gpmi {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_gpmi_nand>;
        fsl,use-minimum-ecc;
-       nand-on-flash-bbt;
        nand-ecc-mode = "hw";
+       nand-on-flash-bbt;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpmi_nand>;
 };
 
+/* On-module Power I2C */
 &i2c1 {
        clock-frequency = <100000>;
        pinctrl-names = "default", "gpio";
        pinctrl-1 = <&pinctrl_i2c1_recovery &pinctrl_i2c1_int>;
        scl-gpios = <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        sda-gpios = <&gpio1 5 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
-
        status = "okay";
 
        codec: sgtl5000@a {
-               compatible = "fsl,sgtl5000";
                #sound-dai-cells = <0>;
-               reg = <0x0a>;
                clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_DIV>;
+               compatible = "fsl,sgtl5000";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_sai1_mclk>;
+               reg = <0xa>;
                VDDA-supply = <&reg_module_3v3_avdd>;
-               VDDIO-supply = <&reg_module_3v3>;
                VDDD-supply = <&reg_DCDC3>;
+               VDDIO-supply = <&reg_module_3v3>;
        };
 
-       ad7879@2c {
+       ad7879_ts: touchscreen@2c {
+               adi,acquisition-time = /bits/ 8 <1>;
+               adi,averaging = /bits/ 8 <1>;
+               adi,conversion-interval = /bits/ 8 <255>;
+               adi,first-conversion-delay = /bits/ 8 <3>;
+               adi,median-filter-size = /bits/ 8 <2>;
+               adi,resistance-plate-x = <120>;
                compatible = "adi,ad7879-1";
-               reg = <0x2c>;
                interrupt-parent = <&gpio1>;
                interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+               reg = <0x2c>;
                touchscreen-max-pressure = <4096>;
-               adi,resistance-plate-x = <120>;
-               adi,first-conversion-delay = /bits/ 8 <3>;
-               adi,acquisition-time = /bits/ 8 <1>;
-               adi,median-filter-size = /bits/ 8 <2>;
-               adi,averaging = /bits/ 8 <1>;
-               adi,conversion-interval = /bits/ 8 <255>;
+               status = "disabled";
        };
 
        pmic@33 {
                reg = <0x33>;
 
                regulators {
-                       reg_DCDC1: DCDC1 {  /* V1.0_SOC */
-                               regulator-min-microvolt = <1000000>;
-                               regulator-max-microvolt = <1100000>;
-                               regulator-boot-on;
+                       reg_DCDC1: DCDC1 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-min-microvolt = <1000000>;
+                               regulator-name = "+V1.0_SOC";
                        };
 
-                       reg_DCDC2: DCDC2 { /* V1.1_ARM */
-                               regulator-min-microvolt = <975000>;
-                               regulator-max-microvolt = <1100000>;
-                               regulator-boot-on;
+                       reg_DCDC2: DCDC2 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-min-microvolt = <975000>;
+                               regulator-name = "+V1.1_ARM";
                        };
 
-                       reg_DCDC3: DCDC3 { /* V1.8 */
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-boot-on;
+                       reg_DCDC3: DCDC3 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "+V1.8";
                        };
 
-                       reg_DCDC4: DCDC4 { /* V1.35_DRAM */
-                               regulator-min-microvolt = <1350000>;
-                               regulator-max-microvolt = <1350000>;
-                               regulator-boot-on;
+                       reg_DCDC4: DCDC4 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1350000>;
+                               regulator-min-microvolt = <1350000>;
+                               regulator-name = "+V1.35_DRAM";
                        };
 
-                       reg_LDO1: LDO1 { /* PWR_EN_+V3.3_ETH */
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
+                       reg_LDO1: LDO1 {
                                regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-name = "PWR_EN_+V3.3_ETH";
                        };
 
-                       reg_LDO2: LDO2 { /* +V1.8_SD */
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
+                       reg_LDO2: LDO2 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "+V1.8_SD";
                        };
 
-                       reg_LDO3: LDO3 { /* PWR_EN_+V3.3_LPSR */
-                               regulator-min-microvolt = <3300000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
+                       reg_LDO3: LDO3 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-name = "PWR_EN_+V3.3_LPSR";
                        };
 
-                       reg_LDO4: LDO4 { /* V1.8_LPSR */
-                               regulator-min-microvolt = <1800000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-boot-on;
+                       reg_LDO4: LDO4 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "+V1.8_LPSR";
                        };
 
-                       reg_LDO5: LDO5 { /* PWR_EN_+V3.3 */
-                               regulator-min-microvolt = <3300000>;
-                               regulator-max-microvolt = <3300000>;
-                               regulator-boot-on;
+                       reg_LDO5: LDO5 {
                                regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-name = "PWR_EN_+V3.3";
                        };
                };
        };
 };
 
+/* Colibri I2C: I2C3_SDA/SCL on SODIMM 194/196 */
 &i2c4 {
        clock-frequency = <100000>;
        pinctrl-names = "default", "gpio";
        pinctrl-1 = <&pinctrl_i2c4_recovery>;
        scl-gpios = <&gpio7 8 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        sda-gpios = <&gpio7 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       status = "disabled";
+
+       /* Atmel maxtouch controller */
+       atmel_mxt_ts: touchscreen@4a {
+               compatible = "atmel,maxtouch";
+               interrupt-parent = <&gpio2>;
+               interrupts = <15 IRQ_TYPE_EDGE_FALLING>;        /* SODIMM 107 / INT */
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_atmel_connector>;
+               reg = <0x4a>;
+               reset-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;      /* SODIMM 106 / RST */
+               status = "disabled";
+       };
+
+       /* M41T0M6 real time clock on carrier board */
+       rtc: rtc@68 {
+               compatible = "st,m41t0";
+               reg = <0x68>;
+               status = "disabled";
+       };
 };
 
 &lcdif {
+       assigned-clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_SRC>;
+       assigned-clock-parents = <&clks IMX7D_PLL_VIDEO_POST_DIV>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_lcdif_dat
                     &pinctrl_lcdif_ctrl>;
+       status = "disabled";
+
+       port {
+               lcdif_out: endpoint {
+                       remote-endpoint = <&lcd_panel_in>;
+               };
+       };
 };
 
+/* Colibri PWM<A> */
 &pwm1 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm1>;
 };
 
+/* Colibri PWM<B> */
 &pwm2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm2>;
 };
 
+/* Colibri PWM<C> */
 &pwm3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm3>;
 };
 
+/* Colibri PWM<D> */
 &pwm4 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pwm4>;
 };
 
 &reg_1p0d {
-       vin-supply = <&reg_DCDC3>;
+       vin-supply = <&reg_DCDC3>; /* VDDA_1P8_IN */
 };
 
 &sai1 {
        status = "okay";
 };
 
+/* Colibri UART_A */
 &uart1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_uart1 &pinctrl_uart1_ctrl1 &pinctrl_uart1_ctrl2>;
        assigned-clocks = <&clks IMX7D_UART1_ROOT_SRC>;
        assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
-       uart-has-rtscts;
        fsl,dte-mode;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1 &pinctrl_uart1_ctrl1 &pinctrl_uart1_ctrl2>;
+       uart-has-rtscts;
 };
 
+/* Colibri UART_B */
 &uart2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_uart2>;
        assigned-clocks = <&clks IMX7D_UART2_ROOT_SRC>;
        assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
-       uart-has-rtscts;
        fsl,dte-mode;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       uart-has-rtscts;
 };
 
+/* Colibri UART_C */
 &uart3 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_uart3>;
        assigned-clocks = <&clks IMX7D_UART3_ROOT_SRC>;
        assigned-clock-parents = <&clks IMX7D_OSC_24M_CLK>;
        fsl,dte-mode;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
 };
 
+/* Colibri USBC */
 &usbotg1 {
-       dr_mode = "host";
+       dr_mode = "otg";
+       extcon = <0>, <&extcon_usbc_det>;
 };
 
+/* Colibri MMC/SD */
 &usdhc1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_usdhc1 &pinctrl_cd_usdhc1>;
        cd-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
        disable-wp;
+       no-1-8-v;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz", "sleep";
+       pinctrl-0 = <&pinctrl_usdhc1 &pinctrl_cd_usdhc1>;
+       pinctrl-1 = <&pinctrl_usdhc1_100mhz &pinctrl_cd_usdhc1>;
+       pinctrl-2 = <&pinctrl_usdhc1_200mhz &pinctrl_cd_usdhc1>;
+       pinctrl-3 = <&pinctrl_usdhc1_sleep &pinctrl_cd_usdhc1_sleep>;
+       vmmc-supply = <&reg_3v3>;
        vqmmc-supply = <&reg_LDO2>;
+       wakeup-source;
 };
 
+/* eMMC on 1GB (eMMC) SKUs */
 &usdhc3 {
-       pinctrl-names = "default", "state_100mhz", "state_200mhz";
-       pinctrl-0 = <&pinctrl_usdhc3>;
-       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
-       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
        assigned-clocks = <&clks IMX7D_USDHC3_ROOT_CLK>;
        assigned-clock-rates = <400000000>;
        bus-width = <8>;
        fsl,tuning-step = <2>;
-       vmmc-supply = <&reg_module_3v3>;
-       vqmmc-supply = <&reg_DCDC3>;
        non-removable;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
        sdhci-caps-mask = <0x80000000 0x0>;
+       vmmc-supply = <&reg_module_3v3>;
+       vqmmc-supply = <&reg_DCDC3>;
 };
 
 &iomuxc {
        pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4
-                    &pinctrl_gpio7 &pinctrl_usbc_det>;
-
-       pinctrl_gpio1: gpio1-grp {
-               fsl,pins = <
-                       MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16       0x14 /* SODIMM 77 */
-                       MX7D_PAD_EPDC_DATA09__GPIO2_IO9         0x14 /* SODIMM 89 */
-                       MX7D_PAD_EPDC_DATA08__GPIO2_IO8         0x74 /* SODIMM 91 */
-                       MX7D_PAD_LCD_RESET__GPIO3_IO4           0x14 /* SODIMM 93 */
-                       MX7D_PAD_EPDC_DATA13__GPIO2_IO13        0x14 /* SODIMM 95 */
-                       MX7D_PAD_ENET1_RGMII_TXC__GPIO7_IO11    0x14 /* SODIMM 99 */
-                       MX7D_PAD_EPDC_DATA10__GPIO2_IO10        0x74 /* SODIMM 105 */
-                       MX7D_PAD_EPDC_DATA00__GPIO2_IO0         0x14 /* SODIMM 111 */
-                       MX7D_PAD_EPDC_DATA01__GPIO2_IO1         0x14 /* SODIMM 113 */
-                       MX7D_PAD_EPDC_DATA02__GPIO2_IO2         0x14 /* SODIMM 115 */
-                       MX7D_PAD_EPDC_DATA03__GPIO2_IO3         0x14 /* SODIMM 117 */
-                       MX7D_PAD_EPDC_DATA04__GPIO2_IO4         0x14 /* SODIMM 119 */
-                       MX7D_PAD_EPDC_DATA05__GPIO2_IO5         0x14 /* SODIMM 121 */
-                       MX7D_PAD_EPDC_DATA06__GPIO2_IO6         0x14 /* SODIMM 123 */
-                       MX7D_PAD_EPDC_DATA07__GPIO2_IO7         0x14 /* SODIMM 125 */
-                       MX7D_PAD_EPDC_SDCE2__GPIO2_IO22         0x14 /* SODIMM 127 */
-                       MX7D_PAD_UART3_RTS_B__GPIO4_IO6         0x14 /* SODIMM 131 */
-                       MX7D_PAD_EPDC_GDRL__GPIO2_IO26          0x14 /* SODIMM 133 */
-                       MX7D_PAD_SAI1_RX_DATA__GPIO6_IO12       0x14 /* SODIMM 169 */
-                       MX7D_PAD_SAI1_RX_BCLK__GPIO6_IO17       0x14 /* SODIMM 24 */
-                       MX7D_PAD_SD2_DATA2__GPIO5_IO16          0x14 /* SODIMM 100 */
-                       MX7D_PAD_SD2_DATA3__GPIO5_IO17          0x14 /* SODIMM 102 */
-                       MX7D_PAD_EPDC_GDSP__GPIO2_IO27          0x14 /* SODIMM 104 */
-                       MX7D_PAD_EPDC_BDR1__GPIO2_IO29          0x14 /* SODIMM 110 */
-                       MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30       0x14 /* SODIMM 112 */
-                       MX7D_PAD_EPDC_SDCLK__GPIO2_IO16         0x14 /* SODIMM 114 */
-                       MX7D_PAD_EPDC_SDLE__GPIO2_IO17          0x14 /* SODIMM 116 */
-                       MX7D_PAD_EPDC_SDOE__GPIO2_IO18          0x14 /* SODIMM 118 */
-                       MX7D_PAD_EPDC_SDSHR__GPIO2_IO19         0x14 /* SODIMM 120 */
-                       MX7D_PAD_EPDC_SDCE0__GPIO2_IO20         0x14 /* SODIMM 122 */
-                       MX7D_PAD_EPDC_SDCE1__GPIO2_IO21         0x14 /* SODIMM 124 */
-                       MX7D_PAD_EPDC_DATA14__GPIO2_IO14        0x14 /* SODIMM 126 */
-                       MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31      0x14 /* SODIMM 128 */
-                       MX7D_PAD_EPDC_SDCE3__GPIO2_IO23         0x14 /* SODIMM 130 */
-                       MX7D_PAD_EPDC_GDCLK__GPIO2_IO24         0x14 /* SODIMM 132 */
-                       MX7D_PAD_EPDC_GDOE__GPIO2_IO25          0x14 /* SODIMM 134 */
-                       MX7D_PAD_EPDC_DATA12__GPIO2_IO12        0x14 /* SODIMM 150 */
-                       MX7D_PAD_EPDC_DATA11__GPIO2_IO11        0x14 /* SODIMM 152 */
-                       MX7D_PAD_SD2_CLK__GPIO5_IO12            0x14 /* SODIMM 184 */
-                       MX7D_PAD_SD2_CMD__GPIO5_IO13            0x14 /* SODIMM 186 */
-               >;
-       };
-
-       pinctrl_gpio2: gpio2-grp { /* On X22 Camera interface */
+       pinctrl-0 = <&pinctrl_gpio1 &pinctrl_gpio2 &pinctrl_gpio3 &pinctrl_gpio4>;
+
+       /*
+        * Atmel MXT touchsceen + Capacitive Touch Adapter
+        * NOTE: This pin group conflicts with pin groups pinctrl_pwm2/pinctrl_pwm3.
+        * Don't use them simultaneously.
+        */
+       pinctrl_atmel_adapter: atmelconnectorgrp {
                fsl,pins = <
-                       MX7D_PAD_ECSPI2_SS0__GPIO4_IO23         0x14 /* SODIMM 65 */
-                       MX7D_PAD_SD1_CD_B__GPIO5_IO0            0x74 /* SODIMM 69 */
-                       MX7D_PAD_I2C4_SDA__GPIO4_IO15           0x14 /* SODIMM 75 */
-                       MX7D_PAD_ECSPI1_MISO__GPIO4_IO18        0x14 /* SODIMM 79 */
-                       MX7D_PAD_I2C3_SCL__GPIO4_IO12           0x14 /* SODIMM 81 */
-                       MX7D_PAD_ECSPI2_MISO__GPIO4_IO22        0x14 /* SODIMM 85 */
-                       MX7D_PAD_ECSPI1_SS0__GPIO4_IO19         0x14 /* SODIMM 97 */
-                       MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16        0x14 /* SODIMM 101 */
-                       MX7D_PAD_ECSPI1_MOSI__GPIO4_IO17        0x14 /* SODIMM 103 */
-                       MX7D_PAD_I2C3_SDA__GPIO4_IO13           0x14 /* SODIMM 94 */
-                       MX7D_PAD_I2C4_SCL__GPIO4_IO14           0x14 /* SODIMM 96 */
-                       MX7D_PAD_SD2_RESET_B__GPIO5_IO11        0x14 /* SODIMM 98 */
+                       MX7D_PAD_GPIO1_IO09__GPIO1_IO9          0x74 /* SODIMM 28 / INT */
+                       MX7D_PAD_GPIO1_IO10__GPIO1_IO10         0x14 /* SODIMM 30 / RST */
                >;
        };
 
-       pinctrl_gpio3: gpio3-grp { /* LCD 18-23 */
+       /* Atmel MXT touchsceen + boards with built-in Capacitive Touch Connector */
+       pinctrl_atmel_connector: atmeladaptergrp {
                fsl,pins = <
-                       MX7D_PAD_LCD_DATA18__GPIO3_IO23         0x14 /* SODIMM 136 */
-                       MX7D_PAD_LCD_DATA19__GPIO3_IO24         0x14 /* SODIMM 138 */
-                       MX7D_PAD_LCD_DATA20__GPIO3_IO25         0x14 /* SODIMM 140 */
-                       MX7D_PAD_LCD_DATA21__GPIO3_IO26         0x14 /* SODIMM 142 */
-                       MX7D_PAD_LCD_DATA22__GPIO3_IO27         0x74 /* SODIMM 144 */
-                       MX7D_PAD_LCD_DATA23__GPIO3_IO28         0x74 /* SODIMM 146 */
+                       MX7D_PAD_EPDC_BDR0__GPIO2_IO28          0x14 /* SODIMM 106 / RST */
+                       MX7D_PAD_EPDC_DATA15__GPIO2_IO15        0x74 /* SODIMM 107 / INT */
                >;
        };
 
-       pinctrl_gpio4: gpio4-grp { /* Alternatively CAN2 */
+       pinctrl_can_int: canintgrp {
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO15__GPIO1_IO15         0x14 /* SODIMM 178 */
-                       MX7D_PAD_GPIO1_IO14__GPIO1_IO14         0x14 /* SODIMM 188 */
+                       MX7D_PAD_SD1_RESET_B__GPIO5_IO2         0X14 /* SODIMM 73 */
                >;
        };
 
-       pinctrl_gpio7: gpio7-grp { /* Alternatively CAN1 */
+       pinctrl_ecspi3: ecspi3grp {
                fsl,pins = <
-                       MX7D_PAD_ENET1_RGMII_RD3__GPIO7_IO3     0x14 /* SODIMM 55 */
-                       MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2     0x14 /* SODIMM 63 */
+                       MX7D_PAD_I2C1_SCL__ECSPI3_MISO          0x2 /* SODIMM 90 */
+                       MX7D_PAD_I2C1_SDA__ECSPI3_MOSI          0x2 /* SODIMM 92 */
+                       MX7D_PAD_I2C2_SCL__ECSPI3_SCLK          0x2 /* SODIMM 88 */
                >;
        };
 
-       pinctrl_i2c1_int: i2c1-int-grp { /* PMIC / TOUCH */
+       pinctrl_ecspi3_cs: ecspi3csgrp {
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO13__GPIO1_IO13 0x79
-               >;
-       };
-
-       pinctrl_can_int: can-int-grp {
-               fsl,pins = <
-                       MX7D_PAD_SD1_RESET_B__GPIO5_IO2         0X14 /* SODIMM 73 */
+                       MX7D_PAD_I2C2_SDA__GPIO4_IO11           0x14 /* SODIMM 86 */
                >;
        };
 
        pinctrl_enet1: enet1grp {
                fsl,pins = <
-                       MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x73
                        MX7D_PAD_ENET1_RGMII_RD0__ENET1_RGMII_RD0       0x73
                        MX7D_PAD_ENET1_RGMII_RD1__ENET1_RGMII_RD1       0x73
                        MX7D_PAD_ENET1_RGMII_RXC__ENET1_RX_ER           0x73
-
-                       MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x73
+                       MX7D_PAD_ENET1_RGMII_RX_CTL__ENET1_RGMII_RX_CTL 0x73
                        MX7D_PAD_ENET1_RGMII_TD0__ENET1_RGMII_TD0       0x73
                        MX7D_PAD_ENET1_RGMII_TD1__ENET1_RGMII_TD1       0x73
+                       MX7D_PAD_ENET1_RGMII_TX_CTL__ENET1_RGMII_TX_CTL 0x73
                        MX7D_PAD_GPIO1_IO12__CCM_ENET_REF_CLK1          0x73
                        MX7D_PAD_SD2_CD_B__ENET1_MDIO                   0x3
                        MX7D_PAD_SD2_WP__ENET1_MDC                      0x3
                >;
        };
 
-       pinctrl_enet1_sleep: enet1sleepgrp {
+       pinctrl_enet1_sleep: enet1-sleepgrp {
                fsl,pins = <
-                       MX7D_PAD_ENET1_RGMII_RX_CTL__GPIO7_IO4          0x0
                        MX7D_PAD_ENET1_RGMII_RD0__GPIO7_IO0             0x0
                        MX7D_PAD_ENET1_RGMII_RD1__GPIO7_IO1             0x0
                        MX7D_PAD_ENET1_RGMII_RXC__GPIO7_IO5             0x0
-
-                       MX7D_PAD_ENET1_RGMII_TX_CTL__GPIO7_IO10         0x0
+                       MX7D_PAD_ENET1_RGMII_RX_CTL__GPIO7_IO4          0x0
                        MX7D_PAD_ENET1_RGMII_TD0__GPIO7_IO6             0x0
                        MX7D_PAD_ENET1_RGMII_TD1__GPIO7_IO7             0x0
+                       MX7D_PAD_ENET1_RGMII_TX_CTL__GPIO7_IO10         0x0
                        MX7D_PAD_GPIO1_IO12__GPIO1_IO12                 0x0
                        MX7D_PAD_SD2_CD_B__GPIO5_IO9                    0x0
                        MX7D_PAD_SD2_WP__GPIO5_IO10                     0x0
                >;
        };
 
-       pinctrl_ecspi3_cs: ecspi3-cs-grp {
+       pinctrl_flexcan1: flexcan1grp {
                fsl,pins = <
-                       MX7D_PAD_I2C2_SDA__GPIO4_IO11           0x14
+                       MX7D_PAD_ENET1_RGMII_RD2__FLEXCAN1_RX   0x79 /* SODIMM 63 */
+                       MX7D_PAD_ENET1_RGMII_RD3__FLEXCAN1_TX   0x79 /* SODIMM 55 */
                >;
        };
 
-       pinctrl_ecspi3: ecspi3-grp {
+       pinctrl_flexcan2: flexcan2grp {
                fsl,pins = <
-                       MX7D_PAD_I2C1_SCL__ECSPI3_MISO          0x2
-                       MX7D_PAD_I2C1_SDA__ECSPI3_MOSI          0x2
-                       MX7D_PAD_I2C2_SCL__ECSPI3_SCLK          0x2
+                       MX7D_PAD_GPIO1_IO14__FLEXCAN2_RX        0x79 /* SODIMM 188 */
+                       MX7D_PAD_GPIO1_IO15__FLEXCAN2_TX        0x79 /* SODIMM 178 */
                >;
        };
 
-       pinctrl_flexcan1: flexcan1-grp {
+       pinctrl_gpio1: gpio1grp {
                fsl,pins = <
-                       MX7D_PAD_ENET1_RGMII_RD3__FLEXCAN1_TX   0x79 /* SODIMM 55 */
-                       MX7D_PAD_ENET1_RGMII_RD2__FLEXCAN1_RX   0x79 /* SODIMM 63 */
+                       MX7D_PAD_EPDC_BDR1__GPIO2_IO29          0x14 /* SODIMM 110 */
+                       MX7D_PAD_EPDC_DATA00__GPIO2_IO0         0x14 /* SODIMM 111 */
+                       MX7D_PAD_EPDC_DATA01__GPIO2_IO1         0x14 /* SODIMM 113 */
+                       MX7D_PAD_EPDC_DATA02__GPIO2_IO2         0x14 /* SODIMM 115 */
+                       MX7D_PAD_EPDC_DATA03__GPIO2_IO3         0x14 /* SODIMM 117 */
+                       MX7D_PAD_EPDC_DATA04__GPIO2_IO4         0x14 /* SODIMM 119 */
+                       MX7D_PAD_EPDC_DATA05__GPIO2_IO5         0x14 /* SODIMM 121 */
+                       MX7D_PAD_EPDC_DATA06__GPIO2_IO6         0x14 /* SODIMM 123 */
+                       MX7D_PAD_EPDC_DATA07__GPIO2_IO7         0x14 /* SODIMM 125 */
+                       MX7D_PAD_EPDC_DATA08__GPIO2_IO8         0x74 /* SODIMM 91 */
+                       MX7D_PAD_EPDC_DATA09__GPIO2_IO9         0x14 /* SODIMM 89 */
+                       MX7D_PAD_EPDC_DATA10__GPIO2_IO10        0x74 /* SODIMM 105 */
+                       MX7D_PAD_EPDC_DATA11__GPIO2_IO11        0x14 /* SODIMM 152 */
+                       MX7D_PAD_EPDC_DATA12__GPIO2_IO12        0x14 /* SODIMM 150 */
+                       MX7D_PAD_EPDC_DATA14__GPIO2_IO14        0x14 /* SODIMM 126 */
+                       MX7D_PAD_EPDC_GDCLK__GPIO2_IO24         0x14 /* SODIMM 132 */
+                       MX7D_PAD_EPDC_GDOE__GPIO2_IO25          0x14 /* SODIMM 134 */
+                       MX7D_PAD_EPDC_GDRL__GPIO2_IO26          0x14 /* SODIMM 133 */
+                       MX7D_PAD_EPDC_GDSP__GPIO2_IO27          0x14 /* SODIMM 104 */
+                       MX7D_PAD_EPDC_PWR_COM__GPIO2_IO30       0x14 /* SODIMM 112 */
+                       MX7D_PAD_EPDC_PWR_STAT__GPIO2_IO31      0x14 /* SODIMM 128 */
+                       MX7D_PAD_EPDC_SDCE0__GPIO2_IO20         0x14 /* SODIMM 122 */
+                       MX7D_PAD_EPDC_SDCE1__GPIO2_IO21         0x14 /* SODIMM 124 */
+                       MX7D_PAD_EPDC_SDCE2__GPIO2_IO22         0x14 /* SODIMM 127 */
+                       MX7D_PAD_EPDC_SDCE3__GPIO2_IO23         0x14 /* SODIMM 130 */
+                       MX7D_PAD_EPDC_SDCLK__GPIO2_IO16         0x14 /* SODIMM 114 */
+                       MX7D_PAD_EPDC_SDLE__GPIO2_IO17          0x14 /* SODIMM 116 */
+                       MX7D_PAD_EPDC_SDOE__GPIO2_IO18          0x14 /* SODIMM 118 */
+                       MX7D_PAD_EPDC_SDSHR__GPIO2_IO19         0x14 /* SODIMM 120 */
+                       MX7D_PAD_LCD_RESET__GPIO3_IO4           0x14 /* SODIMM 93 */
+                       MX7D_PAD_SAI1_RX_BCLK__GPIO6_IO17       0x14 /* SODIMM 24 */
+                       MX7D_PAD_SAI1_RX_DATA__GPIO6_IO12       0x14 /* SODIMM 169 */
+                       MX7D_PAD_SAI1_RX_SYNC__GPIO6_IO16       0x14 /* SODIMM 77 */
+                       MX7D_PAD_SD2_CLK__GPIO5_IO12            0x14 /* SODIMM 184 */
+                       MX7D_PAD_SD2_CMD__GPIO5_IO13            0x14 /* SODIMM 186 */
+                       MX7D_PAD_SD2_DATA2__GPIO5_IO16          0x14 /* SODIMM 100 */
+                       MX7D_PAD_SD2_DATA3__GPIO5_IO17          0x14 /* SODIMM 102 */
+                       MX7D_PAD_UART3_RTS_B__GPIO4_IO6         0x14 /* SODIMM 131 */
                >;
        };
 
-       pinctrl_flexcan2: flexcan2-grp {
+       pinctrl_gpio2: gpio2grp { /* On X22 Camera interface */
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO14__FLEXCAN2_RX        0x79 /* SODIMM 188 */
-                       MX7D_PAD_GPIO1_IO15__FLEXCAN2_TX        0x79 /* SODIMM 178 */
+                       MX7D_PAD_ECSPI1_MISO__GPIO4_IO18        0x14 /* SODIMM 79 */
+                       MX7D_PAD_ECSPI1_MOSI__GPIO4_IO17        0x14 /* SODIMM 103 */
+                       MX7D_PAD_ECSPI1_SCLK__GPIO4_IO16        0x14 /* SODIMM 101 */
+                       MX7D_PAD_ECSPI1_SS0__GPIO4_IO19         0x14 /* SODIMM 97 */
+                       MX7D_PAD_ECSPI2_MISO__GPIO4_IO22        0x14 /* SODIMM 85 */
+                       MX7D_PAD_ECSPI2_SS0__GPIO4_IO23         0x14 /* SODIMM 65 */
+                       MX7D_PAD_I2C3_SCL__GPIO4_IO12           0x14 /* SODIMM 81 */
+                       MX7D_PAD_I2C3_SDA__GPIO4_IO13           0x14 /* SODIMM 94 */
+                       MX7D_PAD_I2C4_SCL__GPIO4_IO14           0x14 /* SODIMM 96 */
+                       MX7D_PAD_I2C4_SDA__GPIO4_IO15           0x14 /* SODIMM 75 */
+                       MX7D_PAD_SD1_CD_B__GPIO5_IO0            0x74 /* SODIMM 69 */
+                       MX7D_PAD_SD2_RESET_B__GPIO5_IO11        0x14 /* SODIMM 98 */
+               >;
+       };
+
+       pinctrl_gpio3: gpio3grp { /* LCD 18-23 */
+               fsl,pins = <
+                       MX7D_PAD_LCD_DATA18__GPIO3_IO23         0x14 /* SODIMM 136 */
+                       MX7D_PAD_LCD_DATA19__GPIO3_IO24         0x14 /* SODIMM 138 */
+                       MX7D_PAD_LCD_DATA20__GPIO3_IO25         0x14 /* SODIMM 140 */
+                       MX7D_PAD_LCD_DATA21__GPIO3_IO26         0x14 /* SODIMM 142 */
+                       MX7D_PAD_LCD_DATA22__GPIO3_IO27         0x74 /* SODIMM 144 */
+                       MX7D_PAD_LCD_DATA23__GPIO3_IO28         0x74 /* SODIMM 146 */
+               >;
+       };
+
+       pinctrl_gpio4: gpio4grp { /* Alternatively CAN2 */
+               fsl,pins = <
+                       MX7D_PAD_GPIO1_IO14__GPIO1_IO14         0x14 /* SODIMM 188 */
+                       MX7D_PAD_GPIO1_IO15__GPIO1_IO15         0x14 /* SODIMM 178 */
+               >;
+       };
+
+       pinctrl_gpio7: gpio7grp { /* Alternatively CAN1 */
+               fsl,pins = <
+                       MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2     0x14 /* SODIMM 63 */
+                       MX7D_PAD_ENET1_RGMII_RD3__GPIO7_IO3     0x14 /* SODIMM 55 */
                >;
        };
 
-       pinctrl_gpio_bl_on: gpio-bl-on {
+       pinctrl_gpio_bl_on: gpioblongrp {
                fsl,pins = <
                        MX7D_PAD_SD1_WP__GPIO5_IO1              0x14 /* SODIMM 71 */
                >;
        };
 
-       pinctrl_gpmi_nand: gpmi-nand-grp {
+       pinctrl_gpmi_nand: gpminandgrp {
                fsl,pins = <
-                       MX7D_PAD_SD3_CLK__NAND_CLE              0x71
-                       MX7D_PAD_SD3_CMD__NAND_ALE              0x71
                        MX7D_PAD_SAI1_TX_BCLK__NAND_CE0_B       0x71
                        MX7D_PAD_SAI1_TX_DATA__NAND_READY_B     0x74
-                       MX7D_PAD_SD3_STROBE__NAND_RE_B          0x71
-                       MX7D_PAD_SD3_RESET_B__NAND_WE_B         0x71
+                       MX7D_PAD_SD3_CLK__NAND_CLE              0x71
+                       MX7D_PAD_SD3_CMD__NAND_ALE              0x71
                        MX7D_PAD_SD3_DATA0__NAND_DATA00         0x71
                        MX7D_PAD_SD3_DATA1__NAND_DATA01         0x71
                        MX7D_PAD_SD3_DATA2__NAND_DATA02         0x71
                        MX7D_PAD_SD3_DATA5__NAND_DATA05         0x71
                        MX7D_PAD_SD3_DATA6__NAND_DATA06         0x71
                        MX7D_PAD_SD3_DATA7__NAND_DATA07         0x71
+                       MX7D_PAD_SD3_RESET_B__NAND_WE_B         0x71
+                       MX7D_PAD_SD3_STROBE__NAND_RE_B          0x71
                >;
        };
 
-       pinctrl_i2c4: i2c4-grp {
+       pinctrl_i2c1_int: i2c1intgrp { /* PMIC / TOUCH */
                fsl,pins = <
-                       MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA      0x4000007f
-                       MX7D_PAD_ENET1_RGMII_TD2__I2C4_SCL      0x4000007f
+                       MX7D_PAD_GPIO1_IO13__GPIO1_IO13 0x79
+               >;
+       };
+
+       pinctrl_i2c4: i2c4grp {
+               fsl,pins = <
+                       MX7D_PAD_ENET1_RGMII_TD2__I2C4_SCL      0x4000007f /* SODIMM 196 */
+                       MX7D_PAD_ENET1_RGMII_TD3__I2C4_SDA      0x4000007f /* SODIMM 194 */
                >;
        };
 
                >;
        };
 
-       pinctrl_lcdif_dat: lcdif-dat-grp {
+       pinctrl_lcdif_dat: lcdifdatgrp {
+               fsl,pins = <
+                       MX7D_PAD_LCD_DATA00__LCD_DATA0          0x79 /* SODIMM 76 */
+                       MX7D_PAD_LCD_DATA01__LCD_DATA1          0x79 /* SODIMM 70 */
+                       MX7D_PAD_LCD_DATA02__LCD_DATA2          0x79 /* SODIMM 60 */
+                       MX7D_PAD_LCD_DATA03__LCD_DATA3          0x79 /* SODIMM 58 */
+                       MX7D_PAD_LCD_DATA04__LCD_DATA4          0x79 /* SODIMM 78 */
+                       MX7D_PAD_LCD_DATA05__LCD_DATA5          0x79 /* SODIMM 72 */
+                       MX7D_PAD_LCD_DATA06__LCD_DATA6          0x79 /* SODIMM 80 */
+                       MX7D_PAD_LCD_DATA07__LCD_DATA7          0x79 /* SODIMM 46 */
+                       MX7D_PAD_LCD_DATA08__LCD_DATA8          0x79 /* SODIMM 62 */
+                       MX7D_PAD_LCD_DATA09__LCD_DATA9          0x79 /* SODIMM 48 */
+                       MX7D_PAD_LCD_DATA10__LCD_DATA10         0x79 /* SODIMM 74 */
+                       MX7D_PAD_LCD_DATA11__LCD_DATA11         0x79 /* SODIMM 50 */
+                       MX7D_PAD_LCD_DATA12__LCD_DATA12         0x79 /* SODIMM 52 */
+                       MX7D_PAD_LCD_DATA13__LCD_DATA13         0x79 /* SODIMM 54 */
+                       MX7D_PAD_LCD_DATA14__LCD_DATA14         0x79 /* SODIMM 66 */
+                       MX7D_PAD_LCD_DATA15__LCD_DATA15         0x79 /* SODIMM 64 */
+                       MX7D_PAD_LCD_DATA16__LCD_DATA16         0x79 /* SODIMM 57 */
+                       MX7D_PAD_LCD_DATA17__LCD_DATA17         0x79 /* SODIMM 61 */
+               >;
+       };
+
+       pinctrl_lcdif_dat_24: lcdifdat24grp {
                fsl,pins = <
-                       MX7D_PAD_LCD_DATA00__LCD_DATA0          0x79
-                       MX7D_PAD_LCD_DATA01__LCD_DATA1          0x79
-                       MX7D_PAD_LCD_DATA02__LCD_DATA2          0x79
-                       MX7D_PAD_LCD_DATA03__LCD_DATA3          0x79
-                       MX7D_PAD_LCD_DATA04__LCD_DATA4          0x79
-                       MX7D_PAD_LCD_DATA05__LCD_DATA5          0x79
-                       MX7D_PAD_LCD_DATA06__LCD_DATA6          0x79
-                       MX7D_PAD_LCD_DATA07__LCD_DATA7          0x79
-                       MX7D_PAD_LCD_DATA08__LCD_DATA8          0x79
-                       MX7D_PAD_LCD_DATA09__LCD_DATA9          0x79
-                       MX7D_PAD_LCD_DATA10__LCD_DATA10         0x79
-                       MX7D_PAD_LCD_DATA11__LCD_DATA11         0x79
-                       MX7D_PAD_LCD_DATA12__LCD_DATA12         0x79
-                       MX7D_PAD_LCD_DATA13__LCD_DATA13         0x79
-                       MX7D_PAD_LCD_DATA14__LCD_DATA14         0x79
-                       MX7D_PAD_LCD_DATA15__LCD_DATA15         0x79
-                       MX7D_PAD_LCD_DATA16__LCD_DATA16         0x79
-                       MX7D_PAD_LCD_DATA17__LCD_DATA17         0x79
+                       MX7D_PAD_LCD_DATA18__LCD_DATA18         0x79 /* SODIMM 136 */
+                       MX7D_PAD_LCD_DATA19__LCD_DATA19         0x79 /* SODIMM 138 */
+                       MX7D_PAD_LCD_DATA20__LCD_DATA20         0x79 /* SODIMM 140 */
+                       MX7D_PAD_LCD_DATA21__LCD_DATA21         0x79 /* SODIMM 142 */
+                       MX7D_PAD_LCD_DATA22__LCD_DATA22         0x79 /* SODIMM 144 */
+                       MX7D_PAD_LCD_DATA23__LCD_DATA23         0x79 /* SODIMM 146 */
                >;
        };
 
-       pinctrl_lcdif_dat_24: lcdif-dat-24-grp {
+       pinctrl_lcdif_ctrl: lcdifctrlgrp {
                fsl,pins = <
-                       MX7D_PAD_LCD_DATA18__LCD_DATA18         0x79
-                       MX7D_PAD_LCD_DATA19__LCD_DATA19         0x79
-                       MX7D_PAD_LCD_DATA20__LCD_DATA20         0x79
-                       MX7D_PAD_LCD_DATA21__LCD_DATA21         0x79
-                       MX7D_PAD_LCD_DATA22__LCD_DATA22         0x79
-                       MX7D_PAD_LCD_DATA23__LCD_DATA23         0x79
+                       MX7D_PAD_LCD_CLK__LCD_CLK               0x79 /* SODIMM 56 */
+                       MX7D_PAD_LCD_ENABLE__LCD_ENABLE         0x79 /* SODIMM 44 */
+                       MX7D_PAD_LCD_HSYNC__LCD_HSYNC           0x79 /* SODIMM 68 */
+                       MX7D_PAD_LCD_VSYNC__LCD_VSYNC           0x79 /* SODIMM 82 */
                >;
        };
 
-       pinctrl_lcdif_ctrl: lcdif-ctrl-grp {
+       pinctrl_lvds_transceiver: lvdstx {
                fsl,pins = <
-                       MX7D_PAD_LCD_CLK__LCD_CLK               0x79
-                       MX7D_PAD_LCD_ENABLE__LCD_ENABLE         0x79
-                       MX7D_PAD_LCD_VSYNC__LCD_VSYNC           0x79
-                       MX7D_PAD_LCD_HSYNC__LCD_HSYNC           0x79
+                       MX7D_PAD_ENET1_RGMII_RD2__GPIO7_IO2     0x14 /* SODIMM 63 */
+                       MX7D_PAD_ENET1_RGMII_RD3__GPIO7_IO3     0x74 /* SODIMM 55 */
+                       MX7D_PAD_ENET1_RGMII_TXC__GPIO7_IO11    0x14 /* SODIMM 99 */
+                       MX7D_PAD_EPDC_DATA13__GPIO2_IO13        0x14 /* SODIMM 95 */
                >;
        };
 
-       pinctrl_pwm1: pwm1-grp {
+       pinctrl_pwm1: pwm1grp {
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO08__PWM1_OUT           0x79
-                       MX7D_PAD_ECSPI2_MOSI__GPIO4_IO21        0x4
+                       MX7D_PAD_ECSPI2_MOSI__GPIO4_IO21        0x4  /* SODIMM 59 */
+                       MX7D_PAD_GPIO1_IO08__PWM1_OUT           0x79 /* SODIMM 59 */
                >;
        };
 
-       pinctrl_pwm2: pwm2-grp {
+       pinctrl_pwm2: pwm2grp {
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO09__PWM2_OUT           0x79
+                       MX7D_PAD_GPIO1_IO09__PWM2_OUT           0x79 /* SODIMM 28 */
                >;
        };
 
-       pinctrl_pwm3: pwm3-grp {
+       pinctrl_pwm3: pwm3grp {
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO10__PWM3_OUT           0x79
+                       MX7D_PAD_GPIO1_IO10__PWM3_OUT           0x79 /* SODIMM 30 */
                >;
        };
 
-       pinctrl_pwm4: pwm4-grp {
+       pinctrl_pwm4: pwm4grp {
                fsl,pins = <
-                       MX7D_PAD_GPIO1_IO11__PWM4_OUT           0x79
-                       MX7D_PAD_ECSPI2_SCLK__GPIO4_IO20        0x4
+                       MX7D_PAD_ECSPI2_SCLK__GPIO4_IO20        0x4  /* SODIMM 67 */
+                       MX7D_PAD_GPIO1_IO11__PWM4_OUT           0x79 /* SODIMM 67 */
                >;
        };
 
-       pinctrl_uart1: uart1-grp {
+       pinctrl_uart1: uart1grp {
                fsl,pins = <
-                       MX7D_PAD_UART1_TX_DATA__UART1_DTE_RX    0x79
-                       MX7D_PAD_UART1_RX_DATA__UART1_DTE_TX    0x79
-                       MX7D_PAD_SAI2_TX_BCLK__UART1_DTE_CTS    0x79
-                       MX7D_PAD_SAI2_TX_SYNC__UART1_DTE_RTS    0x79
+                       MX7D_PAD_SAI2_TX_BCLK__UART1_DTE_CTS    0x79 /* SODIMM 25 */
+                       MX7D_PAD_SAI2_TX_SYNC__UART1_DTE_RTS    0x79 /* SODIMM 27 */
+                       MX7D_PAD_UART1_RX_DATA__UART1_DTE_TX    0x79 /* SODIMM 35 */
+                       MX7D_PAD_UART1_TX_DATA__UART1_DTE_RX    0x79 /* SODIMM 33 */
                >;
        };
 
-       pinctrl_uart1_ctrl1: uart1-ctrl1-grp {
+       pinctrl_uart1_ctrl1: uart1ctrl1grp {
                fsl,pins = <
-                       MX7D_PAD_SD2_DATA1__GPIO5_IO15          0x14 /* DCD */
-                       MX7D_PAD_SD2_DATA0__GPIO5_IO14          0x14 /* DTR */
+                       MX7D_PAD_SD2_DATA0__GPIO5_IO14          0x14 /* SODIMM 23 / DTR */
+                       MX7D_PAD_SD2_DATA1__GPIO5_IO15          0x14 /* SODIMM 31 / DCD */
                >;
        };
 
-       pinctrl_uart2: uart2-grp {
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <
+                       MX7D_PAD_SAI2_RX_DATA__UART2_DTE_RTS    0x79 /* SODIMM 32 / CTS */
+                       MX7D_PAD_SAI2_TX_DATA__UART2_DTE_CTS    0x79 /* SODIMM 34 / RTS */
+                       MX7D_PAD_UART2_RX_DATA__UART2_DTE_TX    0x79 /* SODIMM 38 */
+                       MX7D_PAD_UART2_TX_DATA__UART2_DTE_RX    0x79 /* SODIMM 36 */
+               >;
+       };
+       pinctrl_uart3: uart3grp {
                fsl,pins = <
-                       MX7D_PAD_UART2_TX_DATA__UART2_DTE_RX 0x79
-                       MX7D_PAD_UART2_RX_DATA__UART2_DTE_TX 0x79
-                       MX7D_PAD_SAI2_RX_DATA__UART2_DTE_RTS 0x79
-                       MX7D_PAD_SAI2_TX_DATA__UART2_DTE_CTS 0x79
+                       MX7D_PAD_UART3_RX_DATA__UART3_DTE_TX    0x79 /* SODIMM 21 */
+                       MX7D_PAD_UART3_TX_DATA__UART3_DTE_RX    0x79 /* SODIMM 19 */
                >;
        };
-       pinctrl_uart3: uart3-grp {
+
+       pinctrl_usbc_det: usbcdetgrp {
                fsl,pins = <
-                       MX7D_PAD_UART3_TX_DATA__UART3_DTE_RX 0x79
-                       MX7D_PAD_UART3_RX_DATA__UART3_DTE_TX 0x79
+                       MX7D_PAD_ENET1_CRS__GPIO7_IO14          0x14 /* SODIMM 137 / USBC_DET */
                >;
        };
 
-       pinctrl_usbc_det: gpio-usbc-det {
+       pinctrl_usbh_reg: usbhreggrp {
                fsl,pins = <
-                       MX7D_PAD_ENET1_CRS__GPIO7_IO14  0x14
+                       MX7D_PAD_UART3_CTS_B__GPIO4_IO7         0x14 /* SODIMM 129 / USBH_PEN */
                >;
        };
 
-       pinctrl_usbh_reg: gpio-usbh-vbus {
+       pinctrl_usdhc1: usdhc1grp {
                fsl,pins = <
-                       MX7D_PAD_UART3_CTS_B__GPIO4_IO7 0x14 /* SODIMM 129 USBH PEN */
+                       MX7D_PAD_SD1_CLK__SD1_CLK               0x19 /* SODIMM 47 */
+                       MX7D_PAD_SD1_CMD__SD1_CMD               0x59 /* SODIMM 190 */
+                       MX7D_PAD_SD1_DATA0__SD1_DATA0           0x59 /* SODIMM 192 */
+                       MX7D_PAD_SD1_DATA1__SD1_DATA1           0x59 /* SODIMM 49 */
+                       MX7D_PAD_SD1_DATA2__SD1_DATA2           0x59 /* SODIMM 51 */
+                       MX7D_PAD_SD1_DATA3__SD1_DATA3           0x59 /* SODIMM 53 */
                >;
        };
 
-       pinctrl_usdhc1: usdhc1-grp {
+       pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp {
                fsl,pins = <
-                       MX7D_PAD_SD1_CMD__SD1_CMD       0x59
-                       MX7D_PAD_SD1_CLK__SD1_CLK       0x19
-                       MX7D_PAD_SD1_DATA0__SD1_DATA0   0x59
-                       MX7D_PAD_SD1_DATA1__SD1_DATA1   0x59
-                       MX7D_PAD_SD1_DATA2__SD1_DATA2   0x59
-                       MX7D_PAD_SD1_DATA3__SD1_DATA3   0x59
+                       MX7D_PAD_SD1_CLK__SD1_CLK               0x1a
+                       MX7D_PAD_SD1_CMD__SD1_CMD               0x5a
+                       MX7D_PAD_SD1_DATA0__SD1_DATA0           0x5a
+                       MX7D_PAD_SD1_DATA1__SD1_DATA1           0x5a
+                       MX7D_PAD_SD1_DATA2__SD1_DATA2           0x5a
+                       MX7D_PAD_SD1_DATA3__SD1_DATA3           0x5a
                >;
        };
 
-       pinctrl_usdhc1_100mhz: usdhc1grp_100mhz {
+       pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp {
                fsl,pins = <
-                       MX7D_PAD_SD1_CMD__SD1_CMD       0x5a
-                       MX7D_PAD_SD1_CLK__SD1_CLK       0x1a
-                       MX7D_PAD_SD1_DATA0__SD1_DATA0   0x5a
-                       MX7D_PAD_SD1_DATA1__SD1_DATA1   0x5a
-                       MX7D_PAD_SD1_DATA2__SD1_DATA2   0x5a
-                       MX7D_PAD_SD1_DATA3__SD1_DATA3   0x5a
+                       MX7D_PAD_SD1_CLK__SD1_CLK               0x1b
+                       MX7D_PAD_SD1_CMD__SD1_CMD               0x5b
+                       MX7D_PAD_SD1_DATA0__SD1_DATA0           0x5b
+                       MX7D_PAD_SD1_DATA1__SD1_DATA1           0x5b
+                       MX7D_PAD_SD1_DATA2__SD1_DATA2           0x5b
+                       MX7D_PAD_SD1_DATA3__SD1_DATA3           0x5b
                >;
        };
 
-       pinctrl_usdhc1_200mhz: usdhc1grp_200mhz {
+       /* Avoid backfeeding with removed card power. */
+       pinctrl_usdhc1_sleep: usdhc1-slpgrp {
                fsl,pins = <
-                       MX7D_PAD_SD1_CMD__SD1_CMD       0x5b
-                       MX7D_PAD_SD1_CLK__SD1_CLK       0x1b
-                       MX7D_PAD_SD1_DATA0__SD1_DATA0   0x5b
-                       MX7D_PAD_SD1_DATA1__SD1_DATA1   0x5b
-                       MX7D_PAD_SD1_DATA2__SD1_DATA2   0x5b
-                       MX7D_PAD_SD1_DATA3__SD1_DATA3   0x5b
+                       MX7D_PAD_SD1_CMD__SD1_CMD               0x10
+                       MX7D_PAD_SD1_CLK__SD1_CLK               0x10
+                       MX7D_PAD_SD1_DATA0__SD1_DATA0           0x10
+                       MX7D_PAD_SD1_DATA1__SD1_DATA1           0x10
+                       MX7D_PAD_SD1_DATA2__SD1_DATA2           0x10
+                       MX7D_PAD_SD1_DATA3__SD1_DATA3           0x10
                >;
        };
 
        pinctrl_usdhc3: usdhc3grp {
                fsl,pins = <
-                       MX7D_PAD_SD3_CMD__SD3_CMD               0x59
                        MX7D_PAD_SD3_CLK__SD3_CLK               0x19
+                       MX7D_PAD_SD3_CMD__SD3_CMD               0x59
                        MX7D_PAD_SD3_DATA0__SD3_DATA0           0x59
                        MX7D_PAD_SD3_DATA1__SD3_DATA1           0x59
                        MX7D_PAD_SD3_DATA2__SD3_DATA2           0x59
                >;
        };
 
-       pinctrl_usdhc3_100mhz: usdhc3grp_100mhz {
+       pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
                fsl,pins = <
-                       MX7D_PAD_SD3_CMD__SD3_CMD               0x5a
                        MX7D_PAD_SD3_CLK__SD3_CLK               0x1a
+                       MX7D_PAD_SD3_CMD__SD3_CMD               0x5a
                        MX7D_PAD_SD3_DATA0__SD3_DATA0           0x5a
                        MX7D_PAD_SD3_DATA1__SD3_DATA1           0x5a
                        MX7D_PAD_SD3_DATA2__SD3_DATA2           0x5a
                >;
        };
 
-       pinctrl_usdhc3_200mhz: usdhc3grp_200mhz {
+       pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
                fsl,pins = <
-                       MX7D_PAD_SD3_CMD__SD3_CMD               0x5b
                        MX7D_PAD_SD3_CLK__SD3_CLK               0x1b
+                       MX7D_PAD_SD3_CMD__SD3_CMD               0x5b
                        MX7D_PAD_SD3_DATA0__SD3_DATA0           0x5b
                        MX7D_PAD_SD3_DATA1__SD3_DATA1           0x5b
                        MX7D_PAD_SD3_DATA2__SD3_DATA2           0x5b
                >;
        };
 
-       pinctrl_sai1: sai1-grp {
+       pinctrl_sai1: sai1grp {
                fsl,pins = <
-                       MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK     0x1f
-                       MX7D_PAD_SAI1_TX_SYNC__SAI1_TX_SYNC     0x1f
                        MX7D_PAD_ENET1_COL__SAI1_TX_DATA0       0x30
+                       MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK     0x1f
                        MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0    0x1f
+                       MX7D_PAD_SAI1_TX_SYNC__SAI1_TX_SYNC     0x1f
                >;
        };
 
-       pinctrl_sai1_mclk: sai1grp_mclk {
+       pinctrl_sai1_mclk: sai1mclkgrp {
                fsl,pins = <
                        MX7D_PAD_SAI1_MCLK__SAI1_MCLK           0x1f
                >;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_gpio_lpsr>;
 
-       pinctrl_gpio_lpsr: gpio1-grp {
+       pinctrl_cd_usdhc1: cdusdhc1grp {
                fsl,pins = <
-                       MX7D_PAD_LPSR_GPIO1_IO02__GPIO1_IO2     0x59
-                       MX7D_PAD_LPSR_GPIO1_IO03__GPIO1_IO3     0x59
+                       MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0     0x59 /* SODIMM 43 / MMC_CD */
+               >;
+       };
+
+       pinctrl_cd_usdhc1_sleep: cdusdhc1-slpgrp {
+               fsl,pins = <
+                       MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0     0x0
+               >;
+       };
+
+       pinctrl_gpio_lpsr: gpiolpsrgrp {
+               fsl,pins = <
+                       MX7D_PAD_LPSR_GPIO1_IO02__GPIO1_IO2     0x59 /* SODIMM 135 */
+                       MX7D_PAD_LPSR_GPIO1_IO03__GPIO1_IO3     0x59 /* SODIMM 22 */
                >;
        };
 
        pinctrl_gpiokeys: gpiokeysgrp {
                fsl,pins = <
-                       MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1     0x19
+                       MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1     0x19 /* SODIMM 45 / WAKE_UP */
                >;
        };
 
-       pinctrl_i2c1: i2c1-grp {
+       pinctrl_i2c1: i2c1grp {
                fsl,pins = <
-                       MX7D_PAD_LPSR_GPIO1_IO05__I2C1_SDA      0x4000007f
                        MX7D_PAD_LPSR_GPIO1_IO04__I2C1_SCL      0x4000007f
+                       MX7D_PAD_LPSR_GPIO1_IO05__I2C1_SDA      0x4000007f
                >;
        };
 
                >;
        };
 
-       pinctrl_cd_usdhc1: usdhc1-cd-grp {
-               fsl,pins = <
-                       MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0     0x59 /* CD */
-               >;
-       };
-
-       pinctrl_uart1_ctrl2: uart1-ctrl2-grp {
+       pinctrl_uart1_ctrl2: uart1ctrl2grp {
                fsl,pins = <
-                       MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7     0x14 /* DSR */
-                       MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6     0x14 /* RI */
+                       MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6     0x14 /* SODIMM 37 / RI */
+                       MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7     0x14 /* SODIMM 29 / DSR */
                >;
        };
 };
index f3f0537..90aaedd 100644 (file)
@@ -1,7 +1,6 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017-2020 Toradex AG
- *
+ * Copyright 2017-2022 Toradex
  */
 
 /dts-v1/;
 
 / {
        model = "Toradex Colibri iMX7D on Aster Carrier Board";
-       compatible = "toradex,colibri-imx7d-aster", "toradex,colibri-imx7d",
+       compatible = "toradex,colibri-imx7d-aster",
+                    "toradex,colibri-imx7d",
                     "fsl,imx7d";
 };
 
+&ad7879_ts {
+       status = "okay";
+};
+
+&atmel_mxt_ts {
+       status = "okay";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
+
+/* Colibri USBH */
 &usbotg2 {
-       vbus-supply = <&reg_usbh_vbus>;
        status = "okay";
 };
index 2048027..3ec9ef6 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017-2020 Toradex AG
+ * Copyright 2017-2022 Toradex
  *
  */
 
 / {
        model = "Toradex Colibri iMX7D 1GB (eMMC) on Aster Carrier Board";
        compatible = "toradex,colibri-imx7d-emmc-aster",
-                    "toradex,colibri-imx7d-emmc", "fsl,imx7d";
+                    "toradex,colibri-imx7d-emmc",
+                    "toradex,colibri-imx7d",
+                    "fsl,imx7d";
 };
 
+/* Colibri USBH */
 &usbotg2 {
-       vbus-supply = <&reg_usbh_vbus>;
        status = "okay";
 };
index 8ee73c8..6d505cb 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017 Toradex AG
+ * Copyright 2017-2022 Toradex
  */
 
 /dts-v1/;
 / {
        model = "Toradex Colibri iMX7D 1GB (eMMC) on Colibri Evaluation Board V3";
        compatible = "toradex,colibri-imx7d-emmc-eval-v3",
-                    "toradex,colibri-imx7d-emmc", "fsl,imx7d";
+                    "toradex,colibri-imx7d-emmc",
+                    "toradex,colibri-imx7d",
+                    "fsl,imx7d";
 };
 
+/* Colibri USBH */
 &usbotg2 {
-       vbus-supply = <&reg_usbh_vbus>;
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/imx7d-colibri-emmc-iris-v2.dts b/arch/arm/boot/dts/imx7d-colibri-emmc-iris-v2.dts
new file mode 100644 (file)
index 0000000..7347659
--- /dev/null
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+#include "imx7d-colibri-emmc.dtsi"
+#include "imx7-colibri-iris-v2.dtsi"
+
+/ {
+       model = "Toradex Colibri iMX7D 1GB on Iris V2 Carrier Board";
+       compatible = "toradex,colibri-imx7d-emmc-iris-v2",
+                    "toradex,colibri-imx7d-emmc",
+                    "toradex,colibri-imx7d",
+                    "fsl,imx7d";
+};
+
+/* Colibri USBH */
+&usbotg2 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx7d-colibri-emmc-iris.dts b/arch/arm/boot/dts/imx7d-colibri-emmc-iris.dts
new file mode 100644 (file)
index 0000000..5324c92
--- /dev/null
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+#include "imx7d-colibri-emmc.dtsi"
+#include "imx7-colibri-iris.dtsi"
+
+/ {
+       model = "Toradex Colibri iMX7D 1GB on Iris Carrier Board";
+       compatible = "toradex,colibri-imx7d-emmc-iris",
+                    "toradex,colibri-imx7d-emmc",
+                    "toradex,colibri-imx7d",
+                    "fsl,imx7d";
+};
+
+/* Colibri USBH */
+&usbotg2 {
+       status = "okay";
+};
index af39e53..2fb4d21 100644 (file)
@@ -1,18 +1,28 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017 Toradex AG
+ * Copyright 2017-2022 Toradex
  */
 
 #include "imx7d.dtsi"
 #include "imx7-colibri.dtsi"
 
 / {
+       aliases {
+               /* Required to properly pass MAC addresses from bootloader. */
+               ethernet0 = &fec1;
+               ethernet1 = &fec2;
+       };
+
        memory@80000000 {
                device_type = "memory";
                reg = <0x80000000 0x40000000>;
        };
 };
 
+&cpu1 {
+       cpu-supply = <&reg_DCDC2>;
+};
+
 &gpio6 {
        gpio-line-names = "",
                          "",
                          "SODIMM_34";
 };
 
+/* Colibri USBH */
 &usbotg2 {
        dr_mode = "host";
+       vbus-supply = <&reg_usbh_vbus>;
 };
 
+/* eMMC */
 &usdhc3 {
        status = "okay";
 };
index 87b132b..c7a8b5a 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2016-2020 Toradex
+ * Copyright 2016-2022 Toradex
  */
 
 /dts-v1/;
@@ -9,11 +9,48 @@
 
 / {
        model = "Toradex Colibri iMX7D on Colibri Evaluation Board V3";
-       compatible = "toradex,colibri-imx7d-eval-v3", "toradex,colibri-imx7d",
+       compatible = "toradex,colibri-imx7d-eval-v3",
+                    "toradex,colibri-imx7d",
                     "fsl,imx7d";
 };
 
+&ad7879_ts {
+       status = "okay";
+};
+
+/*
+ * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
+ * So if you enable following capacitive touch controller, disable pwm2/pwm3 first.
+ */
+&atmel_mxt_ts {
+       status = "disabled";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
+
+/* Colibri PWM<B> */
+&pwm2 {
+       /* The pwm2 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri PWM<C> */
+&pwm3 {
+       /* The pwm3 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri USBH */
 &usbotg2 {
-       vbus-supply = <&reg_usbh_vbus>;
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/imx7d-colibri-iris-v2.dts b/arch/arm/boot/dts/imx7d-colibri-iris-v2.dts
new file mode 100644 (file)
index 0000000..5762f51
--- /dev/null
@@ -0,0 +1,83 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+#include "imx7d-colibri.dtsi"
+#include "imx7-colibri-iris-v2.dtsi"
+
+/ {
+       model = "Toradex Colibri iMX7D on Iris V2 Carrier Board";
+       compatible = "toradex,colibri-imx7d-iris-v2",
+                    "toradex,colibri-imx7d",
+                    "fsl,imx7d";
+};
+
+&ad7879_ts {
+       status = "okay";
+};
+
+&atmel_mxt_ts {
+       status = "okay";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&gpio2 {
+       /*
+        * This switches the LVDS transceiver to VESA color mapping mode.
+        */
+       lvds-color-map-hog {
+               gpio-hog;
+               gpios = <13 GPIO_ACTIVE_HIGH>; /* SODIMM 95 */
+               line-name = "LVDS_COLOR_MAP";
+               output-low;
+       };
+};
+
+&gpio7 {
+       /*
+        * This switches the LVDS transceiver to the 24-bit RGB mode.
+        */
+       lvds-rgb-mode-hog {
+               gpio-hog;
+               gpios = <2 GPIO_ACTIVE_HIGH>; /* SODIMM 63 */
+               line-name = "LVDS_RGB_MODE";
+               output-low;
+       };
+
+       /*
+        * This switches the LVDS transceiver to the single-channel
+        * output mode.
+        */
+       lvds-ch-mode-hog {
+               gpio-hog;
+               gpios = <3 GPIO_ACTIVE_HIGH>; /* SODIMM 55 */
+               line-name = "LVDS_CH_MODE";
+               output-high;
+       };
+
+       /* This turns the LVDS transceiver on */
+       lvds-power-on-hog {
+               gpio-hog;
+               gpios = <11 GPIO_ACTIVE_HIGH>; /* SODIMM 99 */
+               line-name = "LVDS_POWER_ON";
+               output-high;
+       };
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
+
+/* Colibri USBH */
+&usbotg2 {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx7d-colibri-iris.dts b/arch/arm/boot/dts/imx7d-colibri-iris.dts
new file mode 100644 (file)
index 0000000..9c63cb9
--- /dev/null
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+#include "imx7d-colibri.dtsi"
+#include "imx7-colibri-iris.dtsi"
+
+/ {
+       model = "Toradex Colibri iMX7D on Iris Carrier Board";
+       compatible = "toradex,colibri-imx7d-iris",
+                    "toradex,colibri-imx7d",
+                    "fsl,imx7d";
+};
+
+&ad7879_ts {
+       status = "okay";
+};
+
+/*
+ * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
+ * So if you enable following capacitive touch controller, disable pwm2/pwm3 first.
+ */
+&atmel_mxt_ts {
+       status = "disabled";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
+
+/* Colibri PWM<B> */
+&pwm2 {
+       /* The pwm2 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri PWM<C> */
+&pwm3 {
+       /* The pwm3 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri USBH */
+&usbotg2 {
+       status = "okay";
+};
index 219a040..531a45b 100644 (file)
@@ -1,12 +1,18 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2016-2020 Toradex
+ * Copyright 2016-2022 Toradex
  */
 
 #include "imx7d.dtsi"
 #include "imx7-colibri.dtsi"
 
 / {
+       aliases {
+               /* Required to properly pass MAC addresses from bootloader. */
+               ethernet0 = &fec1;
+               ethernet1 = &fec2;
+       };
+
        memory@80000000 {
                device_type = "memory";
                reg = <0x80000000 0x20000000>;
        cpu-supply = <&reg_DCDC2>;
 };
 
+/* NAND */
 &gpmi {
        status = "okay";
 };
 
+/* Colibri USBH */
 &usbotg2 {
        dr_mode = "host";
+       vbus-supply = <&reg_usbh_vbus>;
 };
index f053f51..78f4224 100644 (file)
                compatible = "ti,tsc2046";
                reg = <0>;
                spi-max-frequency = <1000000>;
-               pinctrl-names ="default";
+               pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_tsc2046_pendown>;
                interrupt-parent = <&gpio2>;
                interrupts = <29 0>;
index c6b3206..b196f40 100644 (file)
        pinctrl-0 = <&pinctrl_usdhc1>;
        cd-gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
        no-1-8-v;
-       enable-sdio-wakeup;
+       wakeup-source;
        keep-power-in-suspend;
        status = "okay";
 };
        sd-uhs-ddr50;
        mmc-ddr-1_8v;
        vmmc-supply = <&reg_wifi>;
-       enable-sdio-wakeup;
+       wakeup-source;
        status = "okay";
 };
 
index f8cba47..7ceb7c0 100644 (file)
@@ -78,7 +78,7 @@
                #phy-cells = <0>;
        };
 
-       soc {
+       soc: soc {
                etm@3007d000 {
                        compatible = "arm,coresight-etm3x", "arm,primecell";
                        reg = <0x3007d000 0x1000>;
index fca4e0a..58ebb02 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017-2020 Toradex AG
+ * Copyright 2017-2022 Toradex
  *
  */
 
 
 / {
        model = "Toradex Colibri iMX7S on Aster Carrier Board";
-       compatible = "toradex,colibri-imx7s-aster", "toradex,colibri-imx7s",
+       compatible = "toradex,colibri-imx7s-aster",
+                    "toradex,colibri-imx7s",
                     "fsl,imx7s";
 };
+
+&ad7879_ts {
+       status = "okay";
+};
+
+&atmel_mxt_ts {
+       status = "okay";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
index aa70d3f..38de766 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2016-2020 Toradex
+ * Copyright 2016-2022 Toradex
  */
 
 /dts-v1/;
@@ -9,6 +9,43 @@
 
 / {
        model = "Toradex Colibri iMX7S on Colibri Evaluation Board V3";
-       compatible = "toradex,colibri-imx7s-eval-v3", "toradex,colibri-imx7s",
+       compatible = "toradex,colibri-imx7s-eval-v3",
+                    "toradex,colibri-imx7s",
                     "fsl,imx7s";
 };
+
+&ad7879_ts {
+       status = "okay";
+};
+
+/*
+ * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
+ * So if you enable following capacitive touch controller, disable pwm2/pwm3 first.
+ */
+&atmel_mxt_ts {
+       status = "disabled";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
+
+/* Colibri PWM<B> */
+&pwm2 {
+       /* The pwm2 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri PWM<C> */
+&pwm3 {
+       /* The pwm3 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx7s-colibri-iris-v2.dts b/arch/arm/boot/dts/imx7s-colibri-iris-v2.dts
new file mode 100644 (file)
index 0000000..72b5c17
--- /dev/null
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+#include "imx7s-colibri.dtsi"
+#include "imx7-colibri-iris-v2.dtsi"
+
+/ {
+       model = "Toradex Colibri iMX7S on Iris V2 Carrier Board";
+       compatible = "toradex,colibri-imx7s-iris-v2",
+                    "toradex,colibri-imx7s",
+                    "fsl,imx7s";
+};
+
+&ad7879_ts {
+       status = "okay";
+};
+
+&atmel_mxt_ts {
+       status = "okay";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&gpio2 {
+       /*
+        * This switches the LVDS transceiver to VESA color mapping mode.
+        */
+       lvds-color-map-hog {
+               gpio-hog;
+               gpios = <13 GPIO_ACTIVE_HIGH>; /* SODIMM 95 */
+               line-name = "LVDS_COLOR_MAP";
+               output-low;
+       };
+};
+
+&gpio7 {
+       /*
+        * This switches the LVDS transceiver to the 24-bit RGB mode.
+        */
+       lvds-rgb-mode-hog {
+               gpio-hog;
+               gpios = <2 GPIO_ACTIVE_HIGH>; /* SODIMM 63 */
+               line-name = "LVDS_RGB_MODE";
+               output-low;
+       };
+
+       /*
+        * This switches the LVDS transceiver to the single-channel
+        * output mode.
+        */
+       lvds-ch-mode-hog {
+               gpio-hog;
+               gpios = <3 GPIO_ACTIVE_HIGH>; /* SODIMM 55 */
+               line-name = "LVDS_CH_MODE";
+               output-high;
+       };
+
+       /* This turns the LVDS transceiver on */
+       lvds-power-on-hog {
+               gpio-hog;
+               gpios = <11 GPIO_ACTIVE_HIGH>; /* SODIMM 99 */
+               line-name = "LVDS_POWER_ON";
+               output-high;
+       };
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx7s-colibri-iris.dts b/arch/arm/boot/dts/imx7s-colibri-iris.dts
new file mode 100644 (file)
index 0000000..26ba72c
--- /dev/null
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2022 Toradex
+ */
+
+/dts-v1/;
+#include "imx7s-colibri.dtsi"
+#include "imx7-colibri-iris.dtsi"
+
+/ {
+       model = "Toradex Colibri iMX7S on Iris Carrier Board";
+       compatible = "toradex,colibri-imx7s-iris",
+                    "toradex,colibri-imx7s",
+                    "fsl,imx7s";
+};
+
+&ad7879_ts {
+       status = "okay";
+};
+
+/*
+ * The Atmel maxtouch controller uses SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
+ * So if you enable following capacitive touch controller, disable pwm2/pwm3 first.
+ */
+&atmel_mxt_ts {
+       status = "disabled";
+};
+
+&backlight {
+       status = "okay";
+};
+
+&lcdif {
+       status = "okay";
+};
+
+&panel_dpi {
+       status = "okay";
+};
+
+/* Colibri PWM<B> */
+&pwm2 {
+       /* The pwm2 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
+
+/* Colibri PWM<C> */
+&pwm3 {
+       /* The pwm3 should be disabled to enable atmel_mxt_ts touchscreen for adapter. */
+       status = "okay";
+};
index 94de220..ef51395 100644 (file)
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+ OR MIT
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2016-2020 Toradex
+ * Copyright 2016-2022 Toradex
  */
 
 #include "imx7s.dtsi"
@@ -13,6 +13,7 @@
        };
 };
 
+/* NAND */
 &gpmi {
        status = "okay";
 };
index 008e3da..2914828 100644 (file)
                compatible = "usb-nop-xceiv";
                clocks = <&clks IMX7D_USB_HSIC_ROOT_CLK>;
                clock-names = "main_clk";
+               power-domains = <&pgc_hsic_phy>;
                #phy-cells = <0>;
        };
 
                             <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
                                compatible = "fsl,imx7d-usb", "fsl,imx27-usb";
                                reg = <0x30b30000 0x200>;
                                interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
-                               power-domains = <&pgc_hsic_phy>;
                                clocks = <&clks IMX7D_USB_CTRL_CLK>;
                                fsl,usbphy = <&usbphynop3>;
                                fsl,usbmisc = <&usbmisc3 0>;
index 77b911b..03e6a85 100644 (file)
@@ -83,7 +83,7 @@
                };
 
                usdhc1: mmc@402c0000 {
-                       compatible ="fsl,imxrt1050-usdhc", "fsl,imx6sl-usdhc";
+                       compatible = "fsl,imxrt1050-usdhc", "fsl,imx6sl-usdhc";
                        reg = <0x402c0000 0x4000>;
                        interrupts = <110>;
                        clocks = <&clks IMXRT1050_CLK_IPG_PDOF>,
@@ -95,7 +95,7 @@
                        no-1-8-v;
                        max-frequency = <4000000>;
                        fsl,tuning-start-tap = <20>;
-                       fsl,tuning-step= <2>;
+                       fsl,tuning-step = <2>;
                        status = "disabled";
                };
 
index 7106448..42cf74d 100644 (file)
@@ -12,9 +12,9 @@ qmss: qmss@2a40000 {
        #size-cells = <1>;
        clocks = <&chipclk13>;
        ranges;
-       queue-range     = <0 0x2000>;
-       linkram0        = <0x100000 0x4000>;
-       linkram1        = <0 0x10000>;
+       queue-range = <0 0x2000>;
+       linkram0 = <0x100000 0x4000>;
+       linkram1 = <0 0x10000>;
 
        qmgrs {
                #address-cells = <1>;
@@ -176,40 +176,40 @@ netcp: netcp@24000000 {
                        interfaces {
                                gbe0: interface-0 {
                                        slave-port = <0>;
-                                       link-interface  = <1>;
-                                       phy-handle      = <&ethphy0>;
+                                       link-interface = <1>;
+                                       phy-handle = <&ethphy0>;
                                };
                                gbe1: interface-1 {
                                        slave-port = <1>;
-                                       link-interface  = <1>;
-                                       phy-handle      = <&ethphy1>;
+                                       link-interface = <1>;
+                                       phy-handle = <&ethphy1>;
                                };
                        };
 
                        secondary-slave-ports {
                                port-2 {
                                        slave-port = <2>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-3 {
                                        slave-port = <3>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-4 {
                                        slave-port = <4>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-5 {
                                        slave-port = <5>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-6 {
                                        slave-port = <6>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-7 {
                                        slave-port = <7>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                        };
                };
index b8f152e..65c3294 100644 (file)
                        clock-names = "pcie";
                        #address-cells = <3>;
                        #size-cells = <2>;
-                       reg =  <0x21021000 0x2000>, <0x21020000 0x1000>, <0x02620128 4>;
+                       reg = <0x21021000 0x2000>, <0x21020000 0x1000>, <0x02620128 4>;
                        ranges = <0x82000000 0 0x60000000 0x60000000
                                  0 0x10000000>;
 
                };
 
                mdio: mdio@24200f00 {
-                       compatible      = "ti,keystone_mdio", "ti,davinci_mdio";
+                       compatible = "ti,keystone_mdio", "ti,davinci_mdio";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x24200f00 0x100>;
                        status = "disabled";
                        clocks = <&clkcpgmac>;
                        clock-names = "fck";
-                       bus_freq        = <2500000>;
+                       bus_freq = <2500000>;
                };
                /include/ "keystone-k2e-netcp.dtsi"
 };
index d0e6a9a..f630693 100644 (file)
@@ -125,7 +125,7 @@ netcp: netcp@4000000 {
                        interfaces {
                                gbe0: interface-0 {
                                        slave-port = <0>;
-                                       link-interface  = <5>;
+                                       link-interface = <5>;
                                };
                        };
                };
index 3719829..380dd9d 100644 (file)
                         */
                        ti,system-reboot-controller;
                        mbox-names = "rx", "tx";
-                       mboxes= <&msgmgr 5 2>,
+                       mboxes = <&msgmgr 5 2>,
                                <&msgmgr 0 0>;
                        reg-names = "debug_messages";
                        reg = <0x02921c00 0x400>;
 
                dss: dss@02540000 {
                        compatible = "ti,k2g-dss";
-                       reg =   <0x02540000 0x400>,
+                       reg = <0x02540000 0x400>,
                                <0x02550000 0x1000>,
                                <0x02557000 0x1000>,
                                <0x0255a800 0x100>,
                                <0x0255ac00 0x100>;
                        reg-names = "cfg", "common", "vid1", "ovr1", "vp1";
-                       clocks =        <&k2g_clks 0x2 0>,
+                       clocks = <&k2g_clks 0x2 0>,
                                        <&k2g_clks 0x2 1>;
                        clock-names = "fck", "vp1";
                        interrupts = <GIC_SPI 247 IRQ_TYPE_EDGE_RISING>;
 
                edma0: edma@2700000 {
                        compatible = "ti,k2g-edma3-tpcc", "ti,edma3-tpcc";
-                       reg =   <0x02700000 0x8000>;
+                       reg = <0x02700000 0x8000>;
                        reg-names = "edma3_cc";
                        interrupts = <GIC_SPI 200 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>,
 
                edma0_tptc0: tptc@2760000 {
                        compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc";
-                       reg =   <0x02760000 0x400>;
+                       reg = <0x02760000 0x400>;
                        power-domains = <&k2g_pds 0x3f>;
                };
 
                edma0_tptc1: tptc@2768000 {
                        compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc";
-                       reg =   <0x02768000 0x400>;
+                       reg = <0x02768000 0x400>;
                        power-domains = <&k2g_pds 0x3f>;
                };
 
                edma1: edma@2728000 {
                        compatible = "ti,k2g-edma3-tpcc", "ti,edma3-tpcc";
-                       reg =   <0x02728000 0x8000>;
+                       reg = <0x02728000 0x8000>;
                        reg-names = "edma3_cc";
                        interrupts = <GIC_SPI 208 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 219 IRQ_TYPE_EDGE_RISING>,
 
                edma1_tptc0: tptc@27b0000 {
                        compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc";
-                       reg =   <0x027b0000 0x400>;
+                       reg = <0x027b0000 0x400>;
                        power-domains = <&k2g_pds 0x4f>;
                };
 
                edma1_tptc1: tptc@27b8000 {
                        compatible = "ti,k2g-edma3-tptc", "ti,edma3-tptc";
-                       reg =   <0x027b8000 0x400>;
+                       reg = <0x027b8000 0x400>;
                        power-domains = <&k2g_pds 0x4f>;
                };
 
index 022d93c..8a421c6 100644 (file)
@@ -12,9 +12,9 @@ qmss: qmss@2a40000 {
        #size-cells = <1>;
        clocks = <&chipclk13>;
        ranges;
-       queue-range     = <0 0x4000>;
-       linkram0        = <0x100000 0x8000>;
-       linkram1        = <0x0 0x10000>;
+       queue-range = <0 0x4000>;
+       linkram0 = <0x100000 0x8000>;
+       linkram1 = <0x0 0x10000>;
 
        qmgrs {
                #address-cells = <1>;
@@ -150,7 +150,7 @@ netcp: netcp@2000000 {
        #size-cells = <1>;
 
        /* NetCP address range */
-       ranges  = <0 0x2000000 0x100000>;
+       ranges = <0 0x2000000 0x100000>;
 
        clocks = <&clkpa>, <&clkcpgmac>;
        clock-names = "pa_clk", "ethss_clk";
@@ -207,11 +207,11 @@ netcp: netcp@2000000 {
                        secondary-slave-ports {
                                port-2 {
                                        slave-port = <2>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-3 {
                                        slave-port = <3>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                        };
                };
index 8a94477..da6d393 100644 (file)
                };
 
                mdio: mdio@2090300 {
-                       compatible      = "ti,keystone_mdio", "ti,davinci_mdio";
+                       compatible = "ti,keystone_mdio", "ti,davinci_mdio";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x02090300 0x100>;
                        status = "disabled";
                        clocks = <&clkcpgmac>;
                        clock-names = "fck";
-                       bus_freq        = <2500000>;
+                       bus_freq = <2500000>;
                };
                /include/ "keystone-k2hk-netcp.dtsi"
 };
index e96ca66..5ec6680 100644 (file)
@@ -12,9 +12,9 @@ qmss: qmss@2a40000 {
        #size-cells = <1>;
        clocks = <&chipclk13>;
        ranges;
-       queue-range     = <0 0x2000>;
-       linkram0        = <0x100000 0x4000>;
-       linkram1        = <0x70000000 0x10000>; /* 1MB OSR mem */
+       queue-range = <0 0x2000>;
+       linkram0 = <0x100000 0x4000>;
+       linkram1 = <0x70000000 0x10000>; /* 1MB OSR mem */
 
        qmgrs {
                #address-cells = <1>;
@@ -174,24 +174,24 @@ netcp: netcp@26000000 {
                        interfaces {
                                gbe0: interface-0 {
                                        slave-port = <0>;
-                                       link-interface  = <1>;
-                                       phy-handle      = <&ethphy0>;
+                                       link-interface = <1>;
+                                       phy-handle = <&ethphy0>;
                                };
                                gbe1: interface-1 {
                                        slave-port = <1>;
-                                       link-interface  = <1>;
-                                       phy-handle      = <&ethphy1>;
+                                       link-interface = <1>;
+                                       phy-handle = <&ethphy1>;
                                };
                        };
 
                        secondary-slave-ports {
                                port-2 {
                                        slave-port = <2>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                                port-3 {
                                        slave-port = <3>;
-                                       link-interface  = <2>;
+                                       link-interface = <2>;
                                };
                        };
                };
index dff5fea..421a02b 100644 (file)
@@ -47,7 +47,7 @@
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        reg = <0x02348400 0x100>;
-                       clocks  = <&clkuart2>;
+                       clocks = <&clkuart2>;
                        interrupts = <GIC_SPI 432 IRQ_TYPE_EDGE_RISING>;
                };
 
@@ -57,7 +57,7 @@
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        reg = <0x02348800 0x100>;
-                       clocks  = <&clkuart3>;
+                       clocks = <&clkuart3>;
                        interrupts = <GIC_SPI 435 IRQ_TYPE_EDGE_RISING>;
                };
 
                };
 
                mdio: mdio@26200f00 {
-                       compatible      = "ti,keystone_mdio", "ti,davinci_mdio";
+                       compatible = "ti,keystone_mdio", "ti,davinci_mdio";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0x26200f00 0x100>;
                        status = "disabled";
                        clocks = <&clkcpgmac>;
                        clock-names = "fck";
-                       bus_freq        = <2500000>;
+                       bus_freq = <2500000>;
                };
                /include/ "keystone-k2l-netcp.dtsi"
 };
index fc9fdc8..50789f9 100644 (file)
@@ -14,7 +14,7 @@
        interrupt-parent = <&gic>;
 
        aliases {
-               serial0 = &uart0;
+               serial0 = &uart0;
                spi0 = &spi0;
                spi1 = &spi1;
                spi2 = &spi2;
        };
 
        psci {
-               compatible      = "arm,psci";
-               method          = "smc";
-               cpu_suspend     = <0x84000001>;
-               cpu_off         = <0x84000002>;
-               cpu_on          = <0x84000003>;
+               compatible = "arm,psci";
+               method = "smc";
+               cpu_suspend = <0x84000001>;
+               cpu_off = <0x84000002>;
+               cpu_on = <0x84000003>;
        };
 
        soc0: soc@0 {
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        reg = <0x02530c00 0x100>;
-                       clocks  = <&clkuart0>;
+                       clocks = <&clkuart0>;
                        interrupts = <GIC_SPI 277 IRQ_TYPE_EDGE_RISING>;
                };
 
                        reg-shift = <2>;
                        reg-io-width = <4>;
                        reg = <0x02531000 0x100>;
-                       clocks  = <&clkuart1>;
+                       clocks = <&clkuart1>;
                        interrupts = <GIC_SPI 280 IRQ_TYPE_EDGE_RISING>;
                };
 
                        clock-names = "pcie";
                        #address-cells = <3>;
                        #size-cells = <2>;
-                       reg =  <0x21801000 0x2000>, <0x21800000 0x1000>, <0x02620128 4>;
+                       reg = <0x21801000 0x2000>, <0x21800000 0x1000>, <0x02620128 4>;
                        ranges = <0x82000000 0 0x50000000 0x50000000
                                  0 0x10000000>;
 
index 4cab1b3..84bffa3 100644 (file)
                pins = "GPIO_25", "GPIO_26";
                function = "fc0_b";
        };
+
+       usbs_a_pins: usbs-a-pins {
+               /* VBUS_DET */
+               pins = "GPIO_66";
+               function = "gpio";
+       };
 };
 
 &mdio0 {
        status = "okay";
 };
 
+&udc {
+       pinctrl-0 = <&usbs_a_pins>;
+       pinctrl-names = "default";
+       atmel,vbus-gpio = <&gpio 66 GPIO_ACTIVE_HIGH>;
+       status = "okay";
+};
+
 &watchdog {
        status = "okay";
 };
index 3c7e3a7..d56d205 100644 (file)
 };
 
 &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";
+       fc3_b_pins: fc3-b-pins {
+               /* RX, TX */
+               pins = "GPIO_52", "GPIO_53";
                function = "fc3_b";
        };
 
@@ -53,7 +43,7 @@
        status = "okay";
 
        usart3: serial@200 {
-               pinctrl-0 = <&fc3_b_pins>, <&fc_shrd7_pins>, <&fc_shrd8_pins>;
+               pinctrl-0 = <&fc3_b_pins>;
                pinctrl-names = "default";
                status = "okay";
        };
index 3cb02ff..7962d22 100644 (file)
                #size-cells = <1>;
                ranges;
 
+               udc: usb@200000 {
+                       compatible = "microchip,lan9662-udc",
+                                    "atmel,sama5d3-udc";
+                       reg = <0x00200000 0x80000>,
+                             <0xe0808000 0x400>;
+                       interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clks GCK_GATE_UDPHS>, <&nic_clk>;
+                       clock-names = "pclk", "hclk";
+                       status = "disabled";
+               };
+
                switch: switch@e0000000 {
                        compatible = "microchip,lan966x-switch";
                        reg = <0xe0000000 0x0100000>,
                        status = "disabled";
                };
 
+               can1: can@e0820000 {
+                       compatible = "bosch,m_can";
+                       reg = <0xe0820000 0xfc>, <0x00100000 0x8000>;
+                       reg-names = "m_can", "message_ram";
+                       interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "int0", "int1";
+                       clocks = <&clks GCK_ID_MCAN1>, <&clks GCK_ID_MCAN1>;
+                       clock-names = "hclk", "cclk";
+                       assigned-clocks = <&clks GCK_ID_MCAN1>;
+                       assigned-clock-rates = <40000000>;
+                       bosch,mram-cfg = <0x4000 0 0 64 0 0 32 32>;
+                       status = "disabled";
+               };
+
                reset: reset-controller@e200400c {
                        compatible = "microchip,lan966x-switch-reset";
                        reg = <0xe200400c 0x4>;
index 10b8249..1bb686a 100644 (file)
                        status = "disabled";
                };
 
-               usb0: ehci@40006100 {
+               usb0: usb@40006100 {
                        compatible = "nxp,lpc1850-ehci", "generic-ehci";
                        reg = <0x40006100 0x100>;
                        interrupts = <8>;
                        status = "disabled";
                };
 
-               usb1: ehci@40007100 {
+               usb1: usb@40007100 {
                        compatible = "nxp,lpc1850-ehci", "generic-ehci";
                        reg = <0x40007100 0x100>;
                        interrupts = <9>;
                        compatible = "nxp,lpc1850-dwmac", "snps,dwmac-3.611", "snps,dwmac";
                        reg = <0x40010000 0x2000>;
                        interrupts = <5>;
-                       interrupt-names = "macirq";
+                       interrupt-names = "macirq";
                        clocks = <&ccu1 CLK_CPU_ETHERNET>;
                        clock-names = "stmmaceth";
                        resets = <&rgu 22>;
index 66bcdaf..ce8e26d 100644 (file)
        };
 
        sgtl5000: audio-codec@2a {
-               #sound-dai-cells=<0x0>;
+               #sound-dai-cells = <0x0>;
                compatible = "fsl,sgtl5000";
                reg = <0x2a>;
                VDDA-supply = <&reg_3p3v>;
index 6c88be2..fa76162 100644 (file)
                        status = "disabled";
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1021a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen 4 3>;
+                       clock-names = "sfp";
+               };
+
                dcfg: dcfg@1ee0000 {
                        compatible = "fsl,ls1021a-dcfg", "syscon";
                        reg = <0x0 0x1ee0000 0x0 0x1000>;
index 26eaba3..8e3860d 100644 (file)
                        ranges = <0x0 0xc8100000 0x100000>;
 
                        ao_arc_rproc: remoteproc@1c {
-                               compatible= "amlogic,meson-mx-ao-arc";
+                               compatible = "amlogic,meson-mx-ao-arc";
                                reg = <0x1c 0x8>, <0x38 0x8>;
                                reg-names = "remap", "cpu";
                                status = "disabled";
                        };
 
                        ir_receiver: ir-receiver@480 {
-                               compatible= "amlogic,meson6-ir";
+                               compatible = "amlogic,meson6-ir";
                                reg = <0x480 0x20>;
                                interrupts = <GIC_SPI 15 IRQ_TYPE_EDGE_RISING>;
                                status = "disabled";
index 9997a5d..0f8bac8 100644 (file)
 };
 
 &ao_arc_rproc {
-       compatible= "amlogic,meson8-ao-arc", "amlogic,meson-mx-ao-arc";
+       compatible = "amlogic,meson8-ao-arc", "amlogic,meson-mx-ao-arc";
        amlogic,secbus2 = <&secbus2>;
        sram = <&ao_arc_sram>;
        resets = <&reset RESET_MEDIA_CPU>;
index 94f1c03..cf9c04a 100644 (file)
 };
 
 &ao_arc_rproc {
-       compatible= "amlogic,meson8b-ao-arc", "amlogic,meson-mx-ao-arc";
+       compatible = "amlogic,meson8b-ao-arc", "amlogic,meson-mx-ao-arc";
        amlogic,secbus2 = <&secbus2>;
        sram = <&ao_arc_sram>;
        resets = <&reset RESET_MEDIA_CPU>;
index ef583cf..b8eba3b 100644 (file)
 
                afe: audio-controller {
                        compatible = "mediatek,mt2701-audio";
-                       interrupts =  <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
+                       interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
                                      <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>;
-                       interrupt-names = "afe", "asys";
+                       interrupt-names = "afe", "asys";
                        power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
 
                        clocks = <&infracfg CLK_INFRA_AUDIO>,
                compatible = "mediatek,mt2701-jpgdec";
                reg = <0 0x15004000 0 0x1000>;
                interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_LOW>;
-               clocks =  <&imgsys CLK_IMG_JPGDEC_SMI>,
+               clocks = <&imgsys CLK_IMG_JPGDEC_SMI>,
                          <&imgsys CLK_IMG_JPGDEC>;
                clock-names = "jpgdec-smi",
                              "jpgdec";
                             "mediatek,mtk-jpgenc";
                reg = <0 0x1500a000 0 0x1000>;
                interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_LOW>;
-               clocks =  <&imgsys CLK_IMG_VENC>;
+               clocks = <&imgsys CLK_IMG_VENC>;
                clock-names = "jpgenc";
                power-domains = <&scpsys MT2701_POWER_DOMAIN_ISP>;
                iommus = <&iommu MT2701_M4U_PORT_JPGENC_RDMA>,
index f484836..25d31e4 100644 (file)
        };
 
        pericfg: syscon@10003000 {
-               compatible =  "mediatek,mt7623-pericfg",
+               compatible = "mediatek,mt7623-pericfg",
                              "mediatek,mt2701-pericfg",
                              "syscon";
                reg = <0 0x10003000 0 0x1000>;
                afe: audio-controller {
                        compatible = "mediatek,mt7623-audio",
                                     "mediatek,mt2701-audio";
-                       interrupts =  <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
+                       interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_LOW>,
                                      <GIC_SPI 132 IRQ_TYPE_LEVEL_LOW>;
-                       interrupt-names = "afe", "asys";
+                       interrupt-names = "afe", "asys";
                        power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
 
                        clocks = <&infracfg CLK_INFRA_AUDIO>,
index 13c8693..e8b4b6d 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&key_pins_a>;
 
-               factory {
+               button-factory {
                        label = "factory";
                        linux,code = <BTN_0>;
                        gpios = <&pio 256 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&pio 257 GPIO_ACTIVE_HIGH>;
index 88d8f0b..61f5da6 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&key_pins_a>;
 
-               factory {
+               button-factory {
                        label = "factory";
                        linux,code = <BTN_0>;
                        gpios = <&pio 256 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&pio 257 GPIO_ACTIVE_HIGH>;
index 027c1b0..5008115 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&key_pins_a>;
 
-               factory {
+               button-factory {
                        label = "factory";
                        linux,code = <BTN_0>;
                        gpios = <&pio 256 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&pio 257 GPIO_ACTIVE_HIGH>;
index 1b9b9a8..bf67a8e 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&key_pins_a>;
 
-               factory {
+               button-factory {
                        label = "factory";
                        linux,code = <BTN_0>;
                        gpios = <&pio 256 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&pio 257 GPIO_ACTIVE_HIGH>;
index eb536cb..84e14be 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               reset {
+               button-reset {
                        label = "factory";
                        linux,code = <KEY_RESTART>;
                        gpios = <&pio 60 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               button-wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&pio 58 GPIO_ACTIVE_LOW>;
index 3696980..9633b50 100644 (file)
                        interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
                        ethernet = <0>;
-                       clocks  = <&clk_rg1refck>, <&clk NPCM7XX_CLK_AHB>;
+                       clocks = <&clk_rg1refck>, <&clk NPCM7XX_CLK_AHB>;
                        clock-names = "stmmaceth", "clk_gmac";
                        pinctrl-names = "default";
                        pinctrl-0 = <&rg1_pins
index 13eee0f..30eed40 100644 (file)
@@ -51,7 +51,7 @@
                        interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
                        ethernet = <1>;
-                       clocks  = <&clk_rg2refck>, <&clk NPCM7XX_CLK_AHB>;
+                       clocks = <&clk_rg2refck>, <&clk NPCM7XX_CLK_AHB>;
                        clock-names = "stmmaceth", "clk_gmac";
                        pinctrl-names = "default";
                        pinctrl-0 = <&rg2_pins
index af964f1..5acf5dd 100644 (file)
@@ -21,7 +21,7 @@
 
        nor@0,0 {
                compatible = "cfi-flash";
-               linux,mtd-name= "intel,ge28f256l18b85";
+               linux,mtd-name = "intel,ge28f256l18b85";
                #address-cells = <1>;
                #size-cells = <1>;
                reg = <0 0 0x04000000>;
index c933219..abd403c 100644 (file)
@@ -60,7 +60,7 @@
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "hynix,h8kds0un0mer-4em";
+               linux,mtd-name = "hynix,h8kds0un0mer-4em";
                nand-bus-width = <16>;
                gpmc,device-width = <2>;
                ti,nand-ecc-opt = "bch8";
index 5cc0cf7..f95eea6 100644 (file)
@@ -60,7 +60,7 @@
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "micron,mt29f2g16abdhc";
+               linux,mtd-name = "micron,mt29f2g16abdhc";
                nand-bus-width = <16>;
                gpmc,device-width = <2>;
                ti,nand-ecc-opt = "bch8";
index 0365f06..28a6a93 100644 (file)
                        spi-cpol;
                        spi-cpha;
 
-                       backlight= <&backlight>;
+                       backlight = <&backlight>;
                        label = "lcd";
                        port {
                                lcd_in: endpoint {
index 99f5585..2192026 100644 (file)
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "micron,mt29c4g96maz";
+               linux,mtd-name = "micron,mt29c4g96maz";
                nand-bus-width = <16>;
                gpmc,device-width = <2>;
                ti,nand-ecc-opt = "bch8";
index 9c6a927..36fc880 100644 (file)
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "micron,nand";
+               linux,mtd-name = "micron,nand";
                nand-bus-width = <16>;
                gpmc,device-width = <2>;
                ti,nand-ecc-opt = "bch8";
 };
 
 &mmc2 {
-       status="disabled";
+       status = "disabled";
 };
 
 &mmc3 {
-       status="disabled";
+       status = "disabled";
 };
 
 &omap3_pmx_core {
index 73d4778..c595afe 100644 (file)
                gpmc,device-width = <2>;
                gpmc,wait-pin = <0>;
                gpmc,wait-monitoring-ns = <0>;
-               gpmc,burst-length= <4>;
+               gpmc,burst-length = <4>;
                gpmc,cs-on-ns = <0>;
                gpmc,cs-rd-off-ns = <100>;
                gpmc,cs-wr-off-ns = <100>;
index d40c3d2..dd79715 100644 (file)
 };
 
 &twl_gpio {
-       ti,pullups      = <0x0>;
-       ti,pulldowns    = <0x03ff3f>; /* BIT(0..5) | BIT(8..17) */
+       ti,pullups = <0x0>;
+       ti,pulldowns = <0x03ff3f>; /* BIT(0..5) | BIT(8..17) */
 };
 
 &i2c2 {
index 7dde9fb..f68da82 100644 (file)
 };
 
 &twl_gpio {
-       ti,pullups      = <0x000001>; /* BIT(0) */
-       ti,pulldowns    = <0x008106>; /* BIT(1) | BIT(2) | BIT(8) | BIT(15) */
+       ti,pullups = <0x000001>; /* BIT(0) */
+       ti,pulldowns = <0x008106>; /* BIT(1) | BIT(2) | BIT(8) | BIT(15) */
 };
 
 &vdac {
index 006a6d9..adc714c 100644 (file)
 
        nand@0,0 {
                compatible = "ti,omap2-nand";
-               linux,mtd-name= "micron,mt29c4g96maz";
+               linux,mtd-name = "micron,mt29c4g96maz";
                reg = <0 0 4>;  /* CS0, offset 0, IO size 4 */
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
index 37608af..5598537 100644 (file)
 
        lcd: lcd@1 {
                reg = <1>;      /* CS1 */
-               compatible =    "tpo,td043mtea1";
+               compatible = "tpo,td043mtea1";
                spi-max-frequency = <100000>;
                spi-cpol;
                spi-cpha;
index 7d530ae..258ecd9 100644 (file)
@@ -53,7 +53,7 @@
 
        nor@0,0 {
                compatible = "cfi-flash";
-               linux,mtd-name= "intel,pf48f6000m0y1be";
+               linux,mtd-name = "intel,pf48f6000m0y1be";
                #address-cells = <1>;
                #size-cells = <1>;
                reg = <0 0 0x08000000>;
                interrupt-parent = <&gpmc>;
                interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
                             <1 IRQ_TYPE_NONE>; /* termcount */
-               linux,mtd-name= "micron,mt29f1g08abb";
+               linux,mtd-name = "micron,mt29f1g08abb";
                #address-cells = <1>;
                #size-cells = <1>;
                ti,nand-ecc-opt = "sw";
        };
 
        onenand@2,0 {
-               linux,mtd-name= "samsung,kfm2g16q2m-deb8";
+               linux,mtd-name = "samsung,kfm2g16q2m-deb8";
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "ti,omap2-onenand";
index 06cc3a1..3b505fe 100644 (file)
                                clocks = <&usb_phy_cm_clk32k>,
                                <&sys_clkin>,
                                <&l3init_clkctrl OMAP5_USB_OTG_SS_CLKCTRL 8>;
-                               clock-names =   "wkupclk",
+                               clock-names = "wkupclk",
                                "sysclk",
                                "refclk";
                                #phy-cells = <0>;
index 8a6721d..147c991 100644 (file)
 
                regulators {
                        regulator-v3 {
-                               regulator-compatible= "V3(DCDC)";
+                               regulator-compatible = "V3(DCDC)";
                                regulator-min-microvolt = <725000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
                        regulator-v4 {
-                               regulator-compatible= "V4(DCDC)";
+                               regulator-compatible = "V4(DCDC)";
                                regulator-min-microvolt = <725000>;
                                regulator-max-microvolt = <1800000>;
                        };
 
                        regulator-v5 {
-                               regulator-compatible= "V5(LDO)";
+                               regulator-compatible = "V5(LDO)";
                                regulator-min-microvolt = <1700000>;
                                regulator-max-microvolt = <2000000>;
                        };
 
                        reg_vcc_sdio: regulator-v6 {
-                               regulator-compatible= "V6(LDO)";
+                               regulator-compatible = "V6(LDO)";
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
                        };
 
                        regulator-v7 {
-                               regulator-compatible= "V7(LDO)";
+                               regulator-compatible = "V7(LDO)";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <3300000>;
                        };
index 9c0d968..69a5a44 100644 (file)
        leds {
                compatible = "gpio-leds";
 
-               red {
+               led-red {
                        gpios = <&pinctrl RZA2_PIN(PORT6, 0) GPIO_ACTIVE_HIGH>;
                };
-               green {
+               led-green {
                        gpios = <&pinctrl RZA2_PIN(PORTC, 1) GPIO_ACTIVE_HIGH>;
                };
        };
index 57cd2fa..5ad5349 100644 (file)
                                compatible = "dlg,da9063-rtc";
                        };
 
-                       wdt {
+                       watchdog {
                                compatible = "dlg,da9063-watchdog";
                        };
                };
index c802f9f..fe14727 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 6e691b6..26a4078 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 38e2ab9..ec0a20d 100644 (file)
                interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
                interrupt-controller;
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 62aa9f6..c66de9d 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index c8978f4..79b537b 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 99d554f..4d93319 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 92a7616..b7af1be 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
diff --git a/arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi b/arch/arm/boot/dts/r8a77xx-aa104xd12-panel.dtsi
deleted file mode 100644 (file)
index 79fce67..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Common file for the AA104XD12 panel connected to Renesas R-Car boards
- *
- * Copyright (C) 2014 Renesas Electronics Corp.
- */
-
-/ {
-       panel {
-               compatible = "mitsubishi,aa104xd12", "panel-lvds";
-
-               width-mm = <210>;
-               height-mm = <158>;
-               data-mapping = "jeida-18";
-
-               panel-timing {
-                       /* 1024x768 @65Hz */
-                       clock-frequency = <65000000>;
-                       hactive = <1024>;
-                       vactive = <768>;
-                       hsync-len = <136>;
-                       hfront-porch = <20>;
-                       hback-porch = <160>;
-                       vfront-porch = <3>;
-                       vback-porch = <29>;
-                       vsync-len = <6>;
-               };
-
-               port {
-                       panel_in: endpoint {
-                               remote-endpoint = <&lvds_connector>;
-                       };
-               };
-       };
-};
-
-&lvds_connector {
-       remote-endpoint = <&panel_in>;
-};
index 3f8f3ce..4bf8133 100644 (file)
@@ -8,6 +8,9 @@
 
 /dts-v1/;
 
+#include <dt-bindings/pinctrl/rzn1-pinctrl.h>
+#include <dt-bindings/net/pcs-rzn1-miic.h>
+
 #include "r9a06g032.dtsi"
 
 / {
        };
 };
 
+&eth_miic {
+       status = "okay";
+       renesas,miic-switch-portin = <MIIC_GMAC2_PORT>;
+};
+
+&gmac2 {
+       status = "okay";
+       phy-mode = "gmii";
+
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+};
+
+&mii_conv4 {
+       renesas,miic-input = <MIIC_SWITCH_PORTB>;
+       status = "okay";
+};
+
+&mii_conv5 {
+       renesas,miic-input = <MIIC_SWITCH_PORTA>;
+       status = "okay";
+};
+
+&pinctrl{
+       pins_eth3: pins_eth3 {
+               pinmux = <RZN1_PINMUX(36, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(37, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(38, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(39, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(40, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(41, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(42, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(43, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(44, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(45, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(46, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(47, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>;
+               drive-strength = <6>;
+               bias-disable;
+       };
+
+       pins_eth4: pins_eth4 {
+               pinmux = <RZN1_PINMUX(48, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(49, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(50, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(51, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(52, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(53, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(54, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(55, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(56, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(57, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(58, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>,
+                        <RZN1_PINMUX(59, RZN1_FUNC_CLK_ETH_MII_RGMII_RMII)>;
+               drive-strength = <6>;
+               bias-disable;
+       };
+
+       pins_mdio1: pins_mdio1 {
+               pinmux = <RZN1_PINMUX(152, RZN1_FUNC_MDIO1_SWITCH)>,
+                        <RZN1_PINMUX(153, RZN1_FUNC_MDIO1_SWITCH)>;
+       };
+};
+
+&rtc0 {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pins_eth3>, <&pins_eth4>, <&pins_mdio1>;
+
+       dsa,member = <0 0>;
+
+       mdio {
+               clock-frequency = <2500000>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               switch0phy4: ethernet-phy@4 {
+                       reg = <4>;
+                       micrel,led-mode = <1>;
+               };
+
+               switch0phy5: ethernet-phy@5 {
+                       reg = <5>;
+                       micrel,led-mode = <1>;
+               };
+       };
+};
+
+&switch_port0 {
+       label = "lan0";
+       phy-mode = "mii";
+       phy-handle = <&switch0phy5>;
+       status = "okay";
+};
+
+&switch_port1 {
+       label = "lan1";
+       phy-mode = "mii";
+       phy-handle = <&switch0phy4>;
+       status = "okay";
+};
+
+&switch_port4 {
+       status = "okay";
+};
+
 &uart0 {
        status = "okay";
 };
index d366591..5b97fa8 100644 (file)
                        data-width = <8>;
                };
 
+               gmac2: ethernet@44002000 {
+                       compatible = "renesas,r9a06g032-gmac", "renesas,rzn1-gmac", "snps,dwmac";
+                       reg = <0x44002000 0x2000>;
+                       interrupt-parent = <&gic>;
+                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+                       clocks = <&sysctrl R9A06G032_HCLK_GMAC1>;
+                       clock-names = "stmmaceth";
+                       power-domains = <&sysctrl>;
+                       snps,multicast-filter-bins = <256>;
+                       snps,perfect-filter-entries = <128>;
+                       tx-fifo-depth = <2048>;
+                       rx-fifo-depth = <4096>;
+                       status = "disabled";
+               };
+
+               eth_miic: eth-miic@44030000 {
+                       compatible = "renesas,r9a06g032-miic", "renesas,rzn1-miic";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x44030000 0x10000>;
+                       clocks = <&sysctrl R9A06G032_CLK_MII_REF>,
+                                <&sysctrl R9A06G032_CLK_RGMII_REF>,
+                                <&sysctrl R9A06G032_CLK_RMII_REF>,
+                                <&sysctrl R9A06G032_HCLK_SWITCH_RG>;
+                       clock-names = "mii_ref", "rgmii_ref", "rmii_ref", "hclk";
+                       power-domains = <&sysctrl>;
+                       status = "disabled";
+
+                       mii_conv1: mii-conv@1 {
+                               reg = <1>;
+                               status = "disabled";
+                       };
+
+                       mii_conv2: mii-conv@2 {
+                               reg = <2>;
+                               status = "disabled";
+                       };
+
+                       mii_conv3: mii-conv@3 {
+                               reg = <3>;
+                               status = "disabled";
+                       };
+
+                       mii_conv4: mii-conv@4 {
+                               reg = <4>;
+                               status = "disabled";
+                       };
+
+                       mii_conv5: mii-conv@5 {
+                               reg = <5>;
+                               status = "disabled";
+                       };
+               };
+
+               switch: switch@44050000 {
+                       compatible = "renesas,r9a06g032-a5psw", "renesas,rzn1-a5psw";
+                       reg = <0x44050000 0x10000>;
+                       clocks = <&sysctrl R9A06G032_HCLK_SWITCH>,
+                                <&sysctrl R9A06G032_CLK_SWITCH>;
+                       clock-names = "hclk", "clk";
+                       power-domains = <&sysctrl>;
+                       status = "disabled";
+
+                       ethernet-ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               switch_port0: port@0 {
+                                       reg = <0>;
+                                       pcs-handle = <&mii_conv5>;
+                                       status = "disabled";
+                               };
+
+                               switch_port1: port@1 {
+                                       reg = <1>;
+                                       pcs-handle = <&mii_conv4>;
+                                       status = "disabled";
+                               };
+
+                               switch_port2: port@2 {
+                                       reg = <2>;
+                                       pcs-handle = <&mii_conv3>;
+                                       status = "disabled";
+                               };
+
+                               switch_port3: port@3 {
+                                       reg = <3>;
+                                       pcs-handle = <&mii_conv2>;
+                                       status = "disabled";
+                               };
+
+                               switch_port4: port@4 {
+                                       reg = <4>;
+                                       ethernet = <&gmac2>;
+                                       label = "cpu";
+                                       phy-mode = "internal";
+                                       status = "disabled";
+                                       fixed-link {
+                                               speed = <1000>;
+                                               full-duplex;
+                                       };
+                               };
+                       };
+               };
+
                gic: interrupt-controller@44101000 {
                        compatible = "arm,gic-400", "arm,cortex-a7-gic";
                        interrupt-controller;
index 390aa33..962b4d1 100644 (file)
@@ -48,7 +48,7 @@
                compatible = "gpio-keys";
                autorepeat;
 
-               power {
+               key-power {
                        gpios = <&gpio6 RK_PA2 GPIO_ACTIVE_LOW>; /* GPIO6_A2 */
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
@@ -56,7 +56,7 @@
                        wakeup-source;
                        debounce-interval = <100>;
                };
-               volume-down {
+               key-volume-down {
                        gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_LOW>; /* GPIO4_C5 */
                        linux,code = <KEY_VOLUMEDOWN>;
                        label = "GPIO Key Vol-";
index 667d57a..cfa318a 100644 (file)
        status = "okay";
 };
 
+&nfc {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       status = "okay";
+
+       nand@0 {
+               reg = <0>;
+               label = "rk-nand";
+               nand-bus-width = <8>;
+               nand-ecc-mode = "hw";
+               nand-ecc-step-size = <1024>;
+               nand-ecc-strength = <40>;
+               nand-is-boot-medium;
+               rockchip,boot-blks = <8>;
+               rockchip,boot-ecc-strength = <24>;
+       };
+};
+
 &pinctrl {
        usb-host {
                host_drv: host-drv {
index 12b2e59..dbbc517 100644 (file)
@@ -32,7 +32,7 @@
        keys: gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio6 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 35b7a57..9312be3 100644 (file)
@@ -37,7 +37,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key &usb_int>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
@@ -46,7 +46,7 @@
                        wakeup-source;
                };
 
-               wake_on_usb: wake-on-usb {
+               wake_on_usb: key-wake-on-usb {
                        label = "Wake-on-USB";
                        gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index fc478ac..0a1ae68 100644 (file)
@@ -29,7 +29,7 @@
                compatible = "gpio-keys";
                autorepeat;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
index 36c0945..a9ed3cd 100644 (file)
@@ -24,7 +24,7 @@
                compatible = "gpio-keys";
                autorepeat;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
index 797476e..5c3d08e 100644 (file)
                regulator-boot-on;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
                pinctrl-names = "default";
index c4ca73b..399d6b9 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
index 9a4a974..a5a0826 100644 (file)
@@ -27,7 +27,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 7fb5823..052afe5 100644 (file)
@@ -49,7 +49,7 @@
        keys: gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 1e33859..1a51569 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&user_button_pins>;
 
-               button@0 {
+               button-0 {
                        label = "home";
                        linux,code = <KEY_HOME>;
                        gpios = <&gpio8 0 GPIO_ACTIVE_HIGH>;
                        wakeup-source;
                };
 
-               button@1 {
+               button-1 {
                        label = "menu";
                        linux,code = <KEY_MENU>;
                        gpios = <&gpio8 3 GPIO_ACTIVE_HIGH>;
index 8c7376d..fd90f3b 100644 (file)
@@ -30,7 +30,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
index 55467bc..633e5a0 100644 (file)
@@ -31,7 +31,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
index c4d1d14..80e0f07 100644 (file)
@@ -28,7 +28,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
                        linux,code = <KEY_POWER>;
index 9c1e38c..09618bb 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               button@0 {
+               button {
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
index a10d25a..f9dde0e 100644 (file)
                            <&bt_dev_wake>;
 
                compatible = "brcm,bcm43540-bt";
-               host-wakeup-gpios       = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;
-               shutdown-gpios          = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
-               device-wakeup-gpios     = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
-               max-speed               = <3000000>;
-               brcm,bt-pcm-int-params  = [01 02 00 01 01];
+               host-wakeup-gpios = <&gpio4 RK_PD7 GPIO_ACTIVE_HIGH>;
+               shutdown-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
+               device-wakeup-gpios = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+               max-speed = <3000000>;
+               brcm,bt-pcm-int-params = [01 02 00 01 01];
        };
 };
index 05112c2..700bb54 100644 (file)
@@ -32,7 +32,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&ap_lid_int_l>;
 
-               lid {
+               switch-lid {
                        label = "Lid";
                        gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
                        wakeup-source;
index 82fc6fb..dcdcc55 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&volum_down_l &volum_up_l>;
 
-               volum_down {
+               key-volum-down {
                        label = "Volum_down";
                        gpios = <&gpio5 RK_PB3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                        debounce-interval = <100>;
                };
 
-               volum_up {
+               key-volum-up {
                        label = "Volum_up";
                        gpios = <&gpio5 RK_PB2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 4e9fdb0..e2a4e62 100644 (file)
@@ -45,7 +45,7 @@
 &lid_switch {
        pinctrl-0 = <&pwr_key_h &ap_lid_int_l>;
 
-       power {
+       key-power {
                gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
        };
 };
index 54a6838..e406c8c 100644 (file)
@@ -29,7 +29,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key_l>;
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 0c99a59..2d99943 100644 (file)
@@ -83,7 +83,7 @@
 
                regulators {
                        vdd_core: DCDC_REG1 {
-                               regulator-name= "vdd_core";
+                               regulator-name = "vdd_core";
                                regulator-min-microvolt = <700000>;
                                regulator-max-microvolt = <1500000>;
                                regulator-always-on;
@@ -95,7 +95,7 @@
                        };
 
                        vdd_buck2: DCDC_REG2 {
-                               regulator-name= "vdd_buck2";
+                               regulator-name = "vdd_buck2";
                                regulator-min-microvolt = <2200000>;
                                regulator-max-microvolt = <2200000>;
                                regulator-always-on;
                        };
 
                        vcc_ddr: DCDC_REG3 {
-                               regulator-name= "vcc_ddr";
+                               regulator-name = "vcc_ddr";
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-state-mem {
                        };
 
                        vcc_io: DCDC_REG4 {
-                               regulator-name= "vcc_io";
+                               regulator-name = "vcc_io";
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
                                regulator-always-on;
                        };
 
                        vdd_10: LDO_REG1 {
-                               regulator-name= "vdd_10";
+                               regulator-name = "vdd_10";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
                        };
 
                        vcc_18: LDO_REG2 {
-                               regulator-name= "vcc_18";
+                               regulator-name = "vcc_18";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                        };
 
                        vdd10_pmu: LDO_REG3 {
-                               regulator-name= "vdd10_pmu";
+                               regulator-name = "vdd10_pmu";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
index 46cad7c..ef150f4 100644 (file)
@@ -96,7 +96,7 @@
 
                regulators {
                        vdd_core: DCDC_REG1 {
-                               regulator-name= "vdd_core";
+                               regulator-name = "vdd_core";
                                regulator-min-microvolt = <700000>;
                                regulator-max-microvolt = <1500000>;
                                regulator-always-on;
                        };
 
                        vdd_cam: DCDC_REG2 {
-                               regulator-name= "vdd_cam";
+                               regulator-name = "vdd_cam";
                                regulator-min-microvolt = <700000>;
                                regulator-max-microvolt = <2000000>;
                                regulator-state-mem {
                        };
 
                        vcc_ddr: DCDC_REG3 {
-                               regulator-name= "vcc_ddr";
+                               regulator-name = "vcc_ddr";
                                regulator-always-on;
                                regulator-boot-on;
                                regulator-state-mem {
                        };
 
                        vcc_io: DCDC_REG4 {
-                               regulator-name= "vcc_io";
+                               regulator-name = "vcc_io";
                                regulator-min-microvolt = <3300000>;
                                regulator-max-microvolt = <3300000>;
                                regulator-always-on;
                        };
 
                        vdd_10: LDO_REG1 {
-                               regulator-name= "vdd_10";
+                               regulator-name = "vdd_10";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
                        };
 
                        vcc_18: LDO_REG2 {
-                               regulator-name= "vcc_18";
+                               regulator-name = "vcc_18";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                        };
 
                        vdd10_pmu: LDO_REG3 {
-                               regulator-name= "vdd10_pmu";
+                               regulator-name = "vdd10_pmu";
                                regulator-min-microvolt = <1000000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
index c158a7e..abf3006 100644 (file)
 
                gmac {
                        rmii_pins: rmii-pins {
-                               rockchip,pins = <1 RK_PC5 2 &pcfg_pull_none>,
+                               rockchip,pins = <1 RK_PC5 2 &pcfg_pull_none>,
                                                <1 RK_PC3 2 &pcfg_pull_none>,
                                                <1 RK_PC4 2 &pcfg_pull_none>,
                                                <1 RK_PB2 3 &pcfg_pull_none_drv_12ma>,
diff --git a/arch/arm/boot/dts/s3c2410-pinctrl.h b/arch/arm/boot/dts/s3c2410-pinctrl.h
new file mode 100644 (file)
index 0000000..76b6171
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Samsung S3C2410 DTS pinctrl constants
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ */
+
+#ifndef __DTS_ARM_SAMSUNG_S3C2410_PINCTRL_H__
+#define __DTS_ARM_SAMSUNG_S3C2410_PINCTRL_H__
+
+#define S3C2410_PIN_FUNC_INPUT         0
+#define S3C2410_PIN_FUNC_OUTPUT                1
+#define S3C2410_PIN_FUNC_2             2
+#define S3C2410_PIN_FUNC_3             3
+
+#endif /* __DTS_ARM_SAMSUNG_S3C2410_PINCTRL_H__ */
index 20a7d72..3268366 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (c) 2013 Heiko Stuebner <heiko@sntech.de>
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "s3c2410-pinctrl.h"
 
 &pinctrl_0 {
        /*
 
        uart0_data: uart0-data-pins {
                samsung,pins = "gph-0", "gph-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gph-8", "gph-9";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        uart1_data: uart1-data-pins {
                samsung,pins = "gph-2", "gph-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gph-10", "gph-11";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        uart2_data: uart2-data-pins {
                samsung,pins = "gph-4", "gph-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        uart2_fctl: uart2-fctl-pins {
                samsung,pins = "gph-6", "gph-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        uart3_data: uart3-data-pins {
                samsung,pins = "gph-6", "gph-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        extuart_clk: extuart-clk-pins {
                samsung,pins = "gph-12";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpe-14", "gpe-15";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        spi0_bus: spi0-bus-pins {
                samsung,pins = "gpe-11", "gpe-12", "gpe-13";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd0_clk: sd0-clk-pins {
                samsung,pins = "gpe-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpe-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd0_bus1: sd0-bus1-pins {
                samsung,pins = "gpe-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd0_bus4: sd0-bus4-pins {
                samsung,pins = "gpe-8", "gpe-9", "gpe-10";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gpl-8";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd1_clk: sd1-clk-pins {
                samsung,pins = "gpl-9";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd1_bus1: sd1-bus1-pins {
                samsung,pins = "gpl-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 
        sd1_bus4: sd1-bus4-pins {
                samsung,pins = "gpl-1", "gpl-2", "gpl-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C2410_PIN_FUNC_2>;
        };
 };
index 4f084f4..4660751 100644 (file)
@@ -45,7 +45,7 @@
                status = "disabled";
        };
 
-       sdhci_1: sdhci@4ac00000 {
+       sdhci_1: mmc@4ac00000 {
                compatible = "samsung,s3c6410-sdhci";
                reg = <0x4AC00000 0x100>;
                interrupts = <0 0 21 3>;
@@ -56,7 +56,7 @@
                status = "disabled";
        };
 
-       sdhci_0: sdhci@4a800000 {
+       sdhci_0: mmc@4a800000 {
                compatible = "samsung,s3c6410-sdhci";
                reg = <0x4A800000 0x100>;
                interrupts = <0 0 20 3>;
index 0a3186d..f53959b 100644 (file)
@@ -9,7 +9,7 @@
  * listed as device tree nodes in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "s3c64xx-pinctrl.h"
 
 &pinctrl0 {
        /*
 
        uart0_data: uart0-data-pins {
                samsung,pins = "gpa-0", "gpa-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        uart0_fctl: uart0-fctl-pins {
                samsung,pins = "gpa-2", "gpa-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        uart1_data: uart1-data-pins {
                samsung,pins = "gpa-4", "gpa-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        uart1_fctl: uart1-fctl-pins {
                samsung,pins = "gpa-6", "gpa-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        uart2_data: uart2-data-pins {
                samsung,pins = "gpb-0", "gpb-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        uart3_data: uart3-data-pins {
                samsung,pins = "gpb-2", "gpb-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        ext_dma_0: ext-dma-0-pins {
                samsung,pins = "gpb-0", "gpb-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        ext_dma_1: ext-dma-1-pins {
                samsung,pins = "gpb-2", "gpb-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        irda_data_0: irda-data-0-pins {
                samsung,pins = "gpb-0", "gpb-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        irda_data_1: irda-data-1-pins {
                samsung,pins = "gpb-2", "gpb-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        irda_sdbw: irda-sdbw-pins {
                samsung,pins = "gpb-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        i2c0_bus: i2c0-bus-pins {
                samsung,pins = "gpb-5", "gpb-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
        i2c1_bus: i2c1-bus-pins {
                /* S3C6410-only */
                samsung,pins = "gpb-2", "gpb-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_6>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_6>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
        spi0_bus: spi0-bus-pins {
                samsung,pins = "gpc-0", "gpc-1", "gpc-2";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
        spi0_cs: spi0-cs-pins {
                samsung,pins = "gpc-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        spi1_bus: spi1-bus-pins {
                samsung,pins = "gpc-4", "gpc-5", "gpc-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
        spi1_cs: spi1-cs-pins {
                samsung,pins = "gpc-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd0_cmd: sd0-cmd-pins {
                samsung,pins = "gpg-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd0_clk: sd0-clk-pins {
                samsung,pins = "gpg-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd0_bus1: sd0-bus1-pins {
                samsung,pins = "gpg-2";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd0_bus4: sd0-bus4-pins {
                samsung,pins = "gpg-2", "gpg-3", "gpg-4", "gpg-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd0_cd: sd0-cd-pins {
                samsung,pins = "gpg-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
        sd1_cmd: sd1-cmd-pins {
                samsung,pins = "gph-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd1_clk: sd1-clk-pins {
                samsung,pins = "gph-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd1_bus1: sd1-bus1-pins {
                samsung,pins = "gph-2";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd1_bus4: sd1-bus4-pins {
                samsung,pins = "gph-2", "gph-3", "gph-4", "gph-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        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-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd1_cd: sd1-cd-pins {
                samsung,pins = "gpg-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_UP>;
        };
 
        sd2_cmd: sd2-cmd-pins {
                samsung,pins = "gpc-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd2_clk: sd2-clk-pins {
                samsung,pins = "gpc-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd2_bus1: sd2-bus1-pins {
                samsung,pins = "gph-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        sd2_bus4: sd2-bus4-pins {
                samsung,pins = "gph-6", "gph-7", "gph-8", "gph-9";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        i2s0_bus: i2s0-bus-pins {
                samsung,pins = "gpd-0", "gpd-2", "gpd-3", "gpd-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        i2s0_cdclk: i2s0-cdclk-pins {
                samsung,pins = "gpd-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        i2s1_bus: i2s1-bus-pins {
                samsung,pins = "gpe-0", "gpe-2", "gpe-3", "gpe-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        i2s1_cdclk: i2s1-cdclk-pins {
                samsung,pins = "gpe-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
                /* S3C6410-only */
                samsung,pins = "gpc-4", "gpc-5", "gpc-6", "gph-6",
                                "gph-8", "gph-9";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_5>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        i2s2_cdclk: i2s2-cdclk-pins {
                /* S3C6410-only */
                samsung,pins = "gph-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_5>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_5>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pcm0_bus: pcm0-bus-pins {
                samsung,pins = "gpd-0", "gpd-2", "gpd-3", "gpd-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pcm0_extclk: pcm0-extclk-pins {
                samsung,pins = "gpd-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pcm1_bus: pcm1-bus-pins {
                samsung,pins = "gpe-0", "gpe-2", "gpe-3", "gpe-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pcm1_extclk: pcm1-extclk-pins {
                samsung,pins = "gpe-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        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-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        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-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
                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-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        cam_rst: cam-rst-pins {
                samsung,pins = "gpf-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        cam_field: cam-field-pins {
                /* S3C6410-only */
                samsung,pins = "gpb-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pwm_extclk: pwm-extclk-pins {
                samsung,pins = "gpf-13";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pwm0_out: pwm0-out-pins {
                samsung,pins = "gpf-14";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        pwm1_out: pwm1-out-pins {
                samsung,pins = "gpf-15";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        clkout0: clkout-0-pins {
                samsung,pins = "gpf-14";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col0_0: keypad-col0-0-pins {
                samsung,pins = "gph-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col1_0: keypad-col1-0-pins {
                samsung,pins = "gph-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col2_0: keypad-col2-0-pins {
                samsung,pins = "gph-2";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col3_0: keypad-col3-0-pins {
                samsung,pins = "gph-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col4_0: keypad-col4-0-pins {
                samsung,pins = "gph-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col5_0: keypad-col5-0-pins {
                samsung,pins = "gph-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col6_0: keypad-col6-0-pins {
                samsung,pins = "gph-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col7_0: keypad-col7-0-pins {
                samsung,pins = "gph-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_4>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_4>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col0_1: keypad-col0-1-pins {
                samsung,pins = "gpl-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col1_1: keypad-col1-1-pins {
                samsung,pins = "gpl-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col2_1: keypad-col2-1-pins {
                samsung,pins = "gpl-2";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col3_1: keypad-col3-1-pins {
                samsung,pins = "gpl-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col4_1: keypad-col4-1-pins {
                samsung,pins = "gpl-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col5_1: keypad-col5-1-pins {
                samsung,pins = "gpl-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col6_1: keypad-col6-1-pins {
                samsung,pins = "gpl-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_col7_1: keypad-col7-1-pins {
                samsung,pins = "gpl-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row0_0: keypad-row0-0-pins {
                samsung,pins = "gpk-8";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row1_0: keypad-row1-0-pins {
                samsung,pins = "gpk-9";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row2_0: keypad-row2-0-pins {
                samsung,pins = "gpk-10";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row3_0: keypad-row3-0-pins {
                samsung,pins = "gpk-11";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row4_0: keypad-row4-0-pins {
                samsung,pins = "gpk-12";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row5_0: keypad-row5-0-pins {
                samsung,pins = "gpk-13";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row6_0: keypad-row6-0-pins {
                samsung,pins = "gpk-14";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row7_0: keypad-row7-0-pins {
                samsung,pins = "gpk-15";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row0_1: keypad-row0-1-pins {
                samsung,pins = "gpn-0";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row1_1: keypad-row1-1-pins {
                samsung,pins = "gpn-1";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row2_1: keypad-row2-1-pins {
                samsung,pins = "gpn-2";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row3_1: keypad-row3-1-pins {
                samsung,pins = "gpn-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row4_1: keypad-row4-1-pins {
                samsung,pins = "gpn-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row5_1: keypad-row5-1-pins {
                samsung,pins = "gpn-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row6_1: keypad-row6-1-pins {
                samsung,pins = "gpn-6";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        keypad_row7_1: keypad-row7-1-pins {
                samsung,pins = "gpn-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_3>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        lcd_ctrl: lcd-ctrl-pins {
                samsung,pins = "gpj-8", "gpj-9", "gpj-10", "gpj-11";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
                                "gpi-7", "gpi-10", "gpi-11", "gpi-12",
                                "gpi-13", "gpi-14", "gpi-15", "gpj-3",
                                "gpj-4", "gpj-5", "gpj-6", "gpj-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
                                "gpi-12", "gpi-13", "gpi-14", "gpi-15",
                                "gpj-2", "gpj-3", "gpj-4", "gpj-5",
                                "gpj-6", "gpj-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
                                "gpi-12", "gpi-13", "gpi-14", "gpi-15",
                                "gpj-0", "gpj-1", "gpj-2", "gpj-3",
                                "gpj-4", "gpj-5", "gpj-6", "gpj-7";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_2>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 
        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>;
+               samsung,pin-function = <S3C64XX_PIN_FUNC_3>;
                samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
        };
 };
diff --git a/arch/arm/boot/dts/s3c64xx-pinctrl.h b/arch/arm/boot/dts/s3c64xx-pinctrl.h
new file mode 100644 (file)
index 0000000..645c591
--- /dev/null
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Samsung S3C64xx DTS pinctrl constants
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ */
+
+#ifndef __DTS_ARM_SAMSUNG_S3C64XX_PINCTRL_H__
+#define __DTS_ARM_SAMSUNG_S3C64XX_PINCTRL_H__
+
+#define S3C64XX_PIN_PULL_NONE          0
+#define S3C64XX_PIN_PULL_DOWN          1
+#define S3C64XX_PIN_PULL_UP            2
+
+#define S3C64XX_PIN_FUNC_INPUT         0
+#define S3C64XX_PIN_FUNC_OUTPUT                1
+#define S3C64XX_PIN_FUNC_2             2
+#define S3C64XX_PIN_FUNC_3             3
+#define S3C64XX_PIN_FUNC_4             4
+#define S3C64XX_PIN_FUNC_5             5
+#define S3C64XX_PIN_FUNC_6             6
+#define S3C64XX_PIN_FUNC_EINT          7
+
+#endif /* __DTS_ARM_SAMSUNG_S3C64XX_PINCTRL_H__ */
index 67a7a66..c03df63 100644 (file)
@@ -59,7 +59,7 @@
                        #interrupt-cells = <1>;
                };
 
-               sdhci0: sdhci@7c200000 {
+               sdhci0: mmc@7c200000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0x7c200000 0x100>;
                        interrupt-parent = <&vic1>;
@@ -70,7 +70,7 @@
                        status = "disabled";
                };
 
-               sdhci1: sdhci@7c300000 {
+               sdhci1: mmc@7c300000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0x7c300000 0x100>;
                        interrupt-parent = <&vic1>;
@@ -81,7 +81,7 @@
                        status = "disabled";
                };
 
-               sdhci2: sdhci@7c400000 {
+               sdhci2: mmc@7c400000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0x7c400000 0x100>;
                        interrupt-parent = <&vic1>;
index bc0b735..0f5c6cd 100644 (file)
 &pinctrl0 {
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 };
index daa1067..5541df4 100644 (file)
 &pinctrl0 {
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
                samsung,pin-val = <1>;
        };
 
        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-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 
        prox_i2c_pins: gp2a-i2c-pins {
                samsung,pins = "gpg0-2", "gpg2-2";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 
        bt_wake: bt-wake-pins {
                samsung,pins = "gpg3-4";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 
        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-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_DOWN>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        pmic_dvs_pins: pmic-dvs-pins {
                samsung,pins = "gph0-3", "gph0-4", "gph0-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
                samsung,pin-val = <0>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_DOWN>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_DOWN>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_DOWN>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        wifi_wake: wifi-wake-pins {
                samsung,pins = "gph3-5";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 
        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>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        vibrator_ena: vibrator-ena-pins {
                samsung,pins = "gpj1-1";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        touchkey_i2c_pins: touchkey-i2c-pins {
                samsung,pins = "gpj3-0", "gpj3-1";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        musb_i2c_pins: musb-i2c-pins {
                samsung,pins = "gpj3-4", "gpj3-5";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        accel_i2c_pins: accel-i2c-pins {
                samsung,pins = "gpj3-6", "gpj3-7";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        lcd_spi_pins: spi-lcd-pins {
                samsung,pins = "mp01-1", "mp04-1", "mp04-3";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        fg_i2c_pins: fg-i2c-pins {
                samsung,pins = "mp05-0", "mp05-1";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        sound_i2c_pins: sound-i2c-pins {
                samsung,pins = "mp05-2", "mp05-3";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        panel_rst: panel-rst-pins {
                samsung,pins = "mp05-5";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 };
 
index dfb2ee6..eaa7c4f 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "power";
                        gpios = <&gph2 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               vol-down {
+               key-vol-down {
                        label = "volume_down";
                        gpios = <&gph3 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               vol-up {
+               key-vol-up {
                        label = "volume_up";
                        gpios = <&gph3 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        earpath_sel: earpath-sel-pins {
                samsung,pins = "gpj2-6";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        /* Based on vendor kernel v2.6.35.7 */
index a78caaa..cdd3653 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "power";
                        gpios = <&gph2 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               vol-down {
+               key-vol-down {
                        label = "volume_down";
                        gpios = <&gph3 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               vol-up {
+               key-vol-up {
                        label = "volume_up";
                        gpios = <&gph3 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                };
 
-               home {
+               key-home {
                        label = "home";
                        gpios = <&gph3 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
 
        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>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        earpath_sel: earpath-sel-pins {
                samsung,pins = "gpj2-6";
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_OUTPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        /* Based on CyanogenMod 3.0.101 kernel */
index ae34e7e..6d6daef 100644 (file)
  * nodes can be added to this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "s5pv210-pinctrl.h"
 
 #define PIN_SLP(_pin, _mode, _pull)                                    \
        _pin {                                                          \
                samsung,pins = #_pin;                                   \
-               samsung,pin-con-pdn = <EXYNOS_PIN_PDN_ ##_mode>;        \
-               samsung,pin-pud-pdn = <S3C64XX_PIN_PULL_ ##_pull>;      \
+               samsung,pin-con-pdn = <S5PV210_PIN_PDN_ ##_mode>;       \
+               samsung,pin-pud-pdn = <S5PV210_PIN_PULL_ ##_pull>;      \
        }
 
 &pinctrl0 {
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_4>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_4>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_4>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_4>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_5>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_UP>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_F>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-function = <EXYNOS_PIN_FUNC_2>;
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_DOWN>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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-function = <EXYNOS_PIN_FUNC_3>;
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_INPUT>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_DOWN>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_3>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 
        lcd_data24: lcd-data-width24-pins {
                                "gpf2-0", "gpf2-1", "gpf2-2", "gpf2-3",
                                "gpf2-4", "gpf2-5", "gpf2-6", "gpf2-7",
                                "gpf3-0", "gpf3-1", "gpf3-2", "gpf3-3";
-               samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
-               samsung,pin-pud = <S3C64XX_PIN_PULL_NONE>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-function = <S5PV210_PIN_FUNC_2>;
+               samsung,pin-pud = <S5PV210_PIN_PULL_NONE>;
+               samsung,pin-drv = <S5PV210_PIN_DRV_LV1>;
        };
 };
diff --git a/arch/arm/boot/dts/s5pv210-pinctrl.h b/arch/arm/boot/dts/s5pv210-pinctrl.h
new file mode 100644 (file)
index 0000000..29bdf37
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Samsung S5PV210 DTS pinctrl constants
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ */
+
+#ifndef __DTS_ARM_SAMSUNG_S5PV210_PINCTRL_H__
+#define __DTS_ARM_SAMSUNG_S5PV210_PINCTRL_H__
+
+#define S5PV210_PIN_PULL_NONE          0
+#define S5PV210_PIN_PULL_DOWN          1
+#define S5PV210_PIN_PULL_UP            2
+
+/* Pin function in power down mode */
+#define S5PV210_PIN_PDN_OUT0           0
+#define S5PV210_PIN_PDN_OUT1           1
+#define S5PV210_PIN_PDN_INPUT          2
+#define S5PV210_PIN_PDN_PREV           3
+
+#define S5PV210_PIN_DRV_LV1            0
+#define S5PV210_PIN_DRV_LV2            2
+#define S5PV210_PIN_DRV_LV3            1
+#define S5PV210_PIN_DRV_LV4            3
+
+#define S5PV210_PIN_FUNC_INPUT         0
+#define S5PV210_PIN_FUNC_OUTPUT                1
+#define S5PV210_PIN_FUNC_2             2
+#define S5PV210_PIN_FUNC_3             3
+#define S5PV210_PIN_FUNC_4             4
+#define S5PV210_PIN_FUNC_5             5
+#define S5PV210_PIN_FUNC_6             6
+#define S5PV210_PIN_FUNC_EINT          0xf
+#define S5PV210_PIN_FUNC_F             S5PV210_PIN_FUNC_EINT
+
+#endif /* __DTS_ARM_SAMSUNG_S5PV210_PINCTRL_H__ */
index f1b85aa..12e90a1 100644 (file)
                        status = "disabled";
                };
 
-               sdhci0: sdhci@eb000000 {
+               sdhci0: mmc@eb000000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0xeb000000 0x100000>;
                        interrupt-parent = <&vic1>;
                        status = "disabled";
                };
 
-               sdhci1: sdhci@eb100000 {
+               sdhci1: mmc@eb100000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0xeb100000 0x100000>;
                        interrupt-parent = <&vic1>;
                        status = "disabled";
                };
 
-               sdhci2: sdhci@eb200000 {
+               sdhci2: mmc@eb200000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0xeb200000 0x100000>;
                        interrupt-parent = <&vic1>;
                        status = "disabled";
                };
 
-               sdhci3: sdhci@eb300000 {
+               sdhci3: mmc@eb300000 {
                        compatible = "samsung,s3c6410-sdhci";
                        reg = <0xeb300000 0x100000>;
                        interrupt-parent = <&vic3>;
index c328b67..d3f60f6 100644 (file)
                                interrupts = <18 IRQ_TYPE_LEVEL_HIGH 4>;
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 18>;
                                #pwm-cells = <3>;
-                               status="disabled";
+                               status = "disabled";
                        };
 
                        hlcdc: hlcdc@f8038000 {
                                clock-names = "td_slck", "md_slck", "main_xtal";
                        };
 
-                       reset_controller: rstc@fffffe00 {
+                       reset_controller: reset-controller@fffffe00 {
                                compatible = "microchip,sam9x60-rstc";
                                reg = <0xfffffe00 0x10>;
                                clocks = <&clk32k 0>;
index 89c71d4..0baa186 100644 (file)
                ranges = <0 0x00200000 0x20000>;
        };
 
+       resistive_touch: resistive-touch {
+               compatible = "resistive-adc-touch";
+               io-channels = <&adc AT91_SAMA5D2_ADC_X_CHANNEL>,
+                             <&adc AT91_SAMA5D2_ADC_Y_CHANNEL>,
+                             <&adc AT91_SAMA5D2_ADC_P_CHANNEL>;
+               io-channel-names = "x", "y", "pressure";
+               touchscreen-min-pressure = <50000>;
+               status = "disabled";
+       };
+
        ahb {
                compatible = "simple-bus";
                #address-cells = <1>;
                                interrupts = <5  IRQ_TYPE_LEVEL_HIGH 3          /* Queue 0 */
                                              66 IRQ_TYPE_LEVEL_HIGH 3          /* Queue 1 */
                                              67 IRQ_TYPE_LEVEL_HIGH 3>;        /* Queue 2 */
-                               #address-cells = <1>;
-                               #size-cells = <0>;
                                clocks = <&pmc PMC_TYPE_PERIPHERAL 5>, <&pmc PMC_TYPE_PERIPHERAL 5>;
                                clock-names = "hclk", "pclk";
                                status = "disabled";
                                ranges = <0 0xf8044000 0x1420>;
                        };
 
-                       reset_controller: rstc@f8048000 {
+                       reset_controller: reset-controller@f8048000 {
                                compatible = "atmel,sama5d3-rstc";
                                reg = <0xf8048000 0x10>;
                                clocks = <&clk32k>;
                                status = "disabled";
                        };
 
-                       resistive_touch: resistive-touch {
-                               compatible = "resistive-adc-touch";
-                               io-channels = <&adc AT91_SAMA5D2_ADC_X_CHANNEL>,
-                                             <&adc AT91_SAMA5D2_ADC_Y_CHANNEL>,
-                                             <&adc AT91_SAMA5D2_ADC_P_CHANNEL>;
-                               io-channel-names = "x", "y", "pressure";
-                               touchscreen-min-pressure = <50000>;
-                               status = "disabled";
-                       };
-
                        pioA: pinctrl@fc038000 {
                                compatible = "atmel,sama5d2-pinctrl";
                                reg = <0xfc038000 0x600>;
index 8fa423c..2d0935a 100644 (file)
                                clock-names = "slow_clk", "main_xtal";
                        };
 
-                       reset_controller: rstc@fffffe00 {
+                       reset_controller: reset-controller@fffffe00 {
                                compatible = "atmel,sama5d3-rstc", "atmel,at91sam9g45-rstc";
                                reg = <0xfffffe00 0x10>;
                                clocks = <&clk32k>;
index 7b92426..1e5c018 100644 (file)
                                };
                        };
 
-                       reset_controller: rstc@fc068600 {
+                       reset_controller: reset-controller@fc068600 {
                                compatible = "atmel,sama5d3-rstc", "atmel,at91sam9g45-rstc";
                                reg = <0xfc068600 0x10>;
                                clocks = <&clk32k>;
index a37e3a8..bb6d71e 100644 (file)
                        clock-names = "td_slck", "md_slck", "main_xtal";
                };
 
+               reset_controller: reset-controller@e001d000 {
+                       compatible = "microchip,sama7g5-rstc";
+                       reg = <0xe001d000 0xc>, <0xe001d0e4 0x4>;
+                       #reset-cells = <1>;
+                       clocks = <&clk32k 0>;
+               };
+
                shdwc: shdwc@e001d010 {
                        compatible = "microchip,sama7g5-shdwc", "syscon";
                        reg = <0xe001d010 0x10>;
index a61a078..6938181 100644 (file)
@@ -15,7 +15,7 @@
        #size-cells = <1>;
 
        chosen {
-               bootargs="console=ttyS0,9600 earlycon=uart8250,mmio32,0x1600d000";
+               bootargs = "console=ttyS0,9600 earlycon=uart8250,mmio32,0x1600d000";
        };
 
        aliases {
index 26bda25..4370e3c 100644 (file)
                                             <37 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
+                       sdmmca-ecc@ff8c2c00 {
+                               compatible = "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c2c00 0x400>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <15 IRQ_TYPE_LEVEL_HIGH>,
+                                            <47 IRQ_TYPE_LEVEL_HIGH>,
+                                            <16 IRQ_TYPE_LEVEL_HIGH>,
+                                            <48 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
                        dma-ecc@ff8c8000 {
                                compatible = "altr,socfpga-dma-ecc";
                                reg = <0xff8c8000 0x400>;
diff --git a/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts b/arch/arm/boot/dts/socfpga_arria10_chameleonv3.dts
new file mode 100644 (file)
index 0000000..422d00c
--- /dev/null
@@ -0,0 +1,90 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2022 Google LLC
+ */
+/dts-v1/;
+#include "socfpga_arria10_mercury_aa1.dtsi"
+
+/ {
+       model = "Google Chameleon V3";
+       compatible = "google,chameleon-v3", "enclustra,mercury-aa1",
+                    "altr,socfpga-arria10", "altr,socfpga";
+
+       aliases {
+               serial0 = &uart0;
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+       };
+};
+
+&gmac0 {
+       status = "okay";
+};
+
+&gpio0 {
+       status = "okay";
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gpio2 {
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       ssm2603: audio-codec@1a {
+               compatible = "adi,ssm2603";
+               reg = <0x1a>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+
+       u80: gpio@21 {
+               compatible = "nxp,pca9535";
+               reg = <0x21>;
+               gpio-controller;
+               #gpio-cells = <2>;
+
+               gpio-line-names =
+                       "SOM_AUD_MUTE",
+                       "DP1_OUT_CEC_EN",
+                       "DP2_OUT_CEC_EN",
+                       "DP1_SOM_PS8469_CAD",
+                       "DPD_SOM_PS8469_CAD",
+                       "DP_OUT_PWR_EN",
+                       "STM32_RST_L",
+                       "STM32_BOOT0",
+
+                       "FPGA_PROT",
+                       "STM32_FPGA_COMM0",
+                       "TP119",
+                       "TP120",
+                       "TP121",
+                       "TP122",
+                       "TP123",
+                       "TP124";
+       };
+};
+
+&mmc {
+       status = "okay";
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       dr_mode = "host";
+};
diff --git a/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts b/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dts
deleted file mode 100644 (file)
index a75c059..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/dts-v1/;
-
-#include "socfpga_arria10.dtsi"
-
-/ {
-
-       model = "Enclustra Mercury AA1";
-       compatible = "enclustra,mercury-aa1", "altr,socfpga-arria10", "altr,socfpga";
-
-       aliases {
-               ethernet0 = &gmac0;
-               serial1 = &uart1;
-               i2c0 = &i2c0;
-               i2c1 = &i2c1;
-       };
-
-       memory@0 {
-               name = "memory";
-               device_type = "memory";
-               reg = <0x0 0x80000000>; /* 2GB */
-       };
-
-       chosen {
-               stdout-path = "serial1:115200n8";
-       };
-};
-
-&eccmgr {
-       sdmmca-ecc@ff8c2c00 {
-               compatible = "altr,socfpga-sdmmc-ecc";
-               reg = <0xff8c2c00 0x400>;
-               altr,ecc-parent = <&mmc>;
-               interrupts = <15 IRQ_TYPE_LEVEL_HIGH>,
-                            <47 IRQ_TYPE_LEVEL_HIGH>,
-                            <16 IRQ_TYPE_LEVEL_HIGH>,
-                            <48 IRQ_TYPE_LEVEL_HIGH>;
-       };
-};
-
-&gmac0 {
-       phy-mode = "rgmii";
-       phy-addr = <0xffffffff>; /* probe for phy addr */
-
-       max-frame-size = <3800>;
-       status = "okay";
-
-       phy-handle = <&phy3>;
-
-       mdio {
-               #address-cells = <1>;
-               #size-cells = <0>;
-               compatible = "snps,dwmac-mdio";
-               phy3: ethernet-phy@3 {
-                       txd0-skew-ps = <0>; /* -420ps */
-                       txd1-skew-ps = <0>; /* -420ps */
-                       txd2-skew-ps = <0>; /* -420ps */
-                       txd3-skew-ps = <0>; /* -420ps */
-                       rxd0-skew-ps = <420>; /* 0ps */
-                       rxd1-skew-ps = <420>; /* 0ps */
-                       rxd2-skew-ps = <420>; /* 0ps */
-                       rxd3-skew-ps = <420>; /* 0ps */
-                       txen-skew-ps = <0>; /* -420ps */
-                       txc-skew-ps = <1860>; /* 960ps */
-                       rxdv-skew-ps = <420>; /* 0ps */
-                       rxc-skew-ps = <1680>; /* 780ps */
-                       reg = <3>;
-               };
-       };
-};
-
-&gpio0 {
-       status = "okay";
-};
-
-&gpio1 {
-       status = "okay";
-};
-
-&gpio2 {
-       status = "okay";
-};
-
-&i2c1 {
-       status = "okay";
-       isl12022: isl12022@6f {
-               status = "okay";
-               compatible = "isil,isl12022";
-               reg = <0x6f>;
-       };
-};
-
-/* Following mappings are taken from arria10 socdk dts */
-&mmc {
-       status = "okay";
-       cap-sd-highspeed;
-       broken-cd;
-       bus-width = <4>;
-};
-
-&osc1 {
-       clock-frequency = <33330000>;
-};
-
-&uart1 {
-       status = "okay";
-};
-
-&usb0 {
-       status = "okay";
-       dr_mode = "host";
-};
diff --git a/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dtsi b/arch/arm/boot/dts/socfpga_arria10_mercury_aa1.dtsi
new file mode 100644 (file)
index 0000000..ad7cd14
--- /dev/null
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2022 Google LLC
+ */
+
+#include "socfpga_arria10.dtsi"
+
+/ {
+
+       model = "Enclustra Mercury AA1";
+       compatible = "enclustra,mercury-aa1", "altr,socfpga-arria10", "altr,socfpga";
+
+       aliases {
+               ethernet0 = &gmac0;
+               serial1 = &uart1;
+       };
+
+       memory@0 {
+               name = "memory";
+               device_type = "memory";
+               reg = <0x0 0x80000000>; /* 2GB */
+       };
+
+       chosen {
+               stdout-path = "serial1:115200n8";
+       };
+};
+
+&gmac0 {
+       phy-mode = "rgmii";
+       phy-addr = <0xffffffff>; /* probe for phy addr */
+
+       max-frame-size = <3800>;
+
+       phy-handle = <&phy3>;
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy3: ethernet-phy@3 {
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <1860>; /* 960ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+                       reg = <3>;
+               };
+       };
+};
+
+&i2c1 {
+       atsha204a: crypto@64 {
+               compatible = "atmel,atsha204a";
+               reg = <0x64>;
+       };
+
+       isl12022: isl12022@6f {
+               compatible = "isil,isl12022";
+               reg = <0x6f>;
+       };
+};
+
+/* Following mappings are taken from arria10 socdk dts */
+&mmc {
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&osc1 {
+       clock-frequency = <33330000>;
+};
index ddd1cf4..05408df 100644 (file)
 
                smi: flash@ea000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@e6000000 {
                                #address-cells = <1>;
index 3a51a41..7700f2a 100644 (file)
 
                smi: flash@ea000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@e6000000 {
                                #address-cells = <1>;
index 13e1bdb..818886e 100644 (file)
@@ -88,7 +88,7 @@
                };
 
                pwm: pwm@e0180000 {
-                       compatible ="st,spear13xx-pwm";
+                       compatible = "st,spear13xx-pwm";
                        reg = <0xe0180000 0x1000>;
                        #pwm-cells = <2>;
                        status = "disabled";
index 2beb30c..303ef29 100644 (file)
@@ -80,7 +80,7 @@
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index 1c41e4a..ea0b530 100644 (file)
@@ -94,7 +94,7 @@
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index c322407..3c026d0 100644 (file)
@@ -95,7 +95,7 @@
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index b587e4e..34503ac 100644 (file)
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index 47ac447..b124744 100644 (file)
@@ -78,7 +78,7 @@
                };
 
                pwm: pwm@a8000000 {
-                       compatible ="st,spear-pwm";
+                       compatible = "st,spear-pwm";
                        reg = <0xa8000000 0x1000>;
                        #pwm-cells = <2>;
                        status = "disabled";
index 35137c6..dd30d08 100644 (file)
                                                          "CH_WD_EXP",
                                                          "VBUS_CH_DROP_END";
                                        monitored-battery = <&battery>;
-                                       vddadc-supply   = <&ab8500_ldo_tvout_reg>;
+                                       vddadc-supply = <&ab8500_ldo_tvout_reg>;
                                        io-channels = <&gpadc 0x03>,
                                                      <&gpadc 0x0a>,
                                                      <&gpadc 0x09>,
                                };
 
                                ab8500_chargalg {
-                                       compatible      = "stericsson,ab8500-chargalg";
-                                       monitored-battery       = <&battery>;
+                                       compatible = "stericsson,ab8500-chargalg";
+                                       monitored-battery = <&battery>;
                                };
 
                                ab8500_usb: phy {
index c28b326..9afe830 100644 (file)
 
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       v-i2c-supply = <&db8500_vape_reg>;
 
                        clock-frequency = <400000>;
                        clocks = <&prcc_kclk 3 3>, <&prcc_pclk 3 3>;
 
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       v-i2c-supply = <&db8500_vape_reg>;
 
                        clock-frequency = <400000>;
 
 
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       v-i2c-supply = <&db8500_vape_reg>;
 
                        clock-frequency = <400000>;
 
 
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       v-i2c-supply = <&db8500_vape_reg>;
 
                        clock-frequency = <400000>;
 
 
                        #address-cells = <1>;
                        #size-cells = <0>;
-                       v-i2c-supply = <&db8500_vape_reg>;
 
                        clock-frequency = <400000>;
 
index 8f504ed..e66fa59 100644 (file)
                                         * Drive DISP1 reset high (not reset), driver DISP2 reset low (reset)
                                         */
                                        hrefv60_cfg1 {
-                                               pins ="GPIO65_F1";
+                                               pins = "GPIO65_F1";
                                                ste,config = <&gpio_out_hi>;
                                        };
                                        hrefv60_cfg2 {
-                                               pins ="GPIO66_G3";
+                                               pins = "GPIO66_G3";
                                                ste,config = <&gpio_out_lo>;
                                        };
                                };
index b6746ac..5f41256 100644 (file)
                                reg = <0x19>;
                                vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
                                vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
-                               mount-matrix = "0", "-1", "0",
-                                              "1", "0", "0",
+                               mount-matrix = "0", "1", "0",
+                                              "-1", "0", "0",
                                               "0", "0", "1";
                        };
                };
index 53062d5..806da3f 100644 (file)
                                        accelerometer@18 {
                                                compatible = "bosch,bma222e";
                                                reg = <0x18>;
-                                               mount-matrix = "0", "1", "0",
-                                                              "-1", "0", "0",
+                                               mount-matrix = "0", "-1", "0",
+                                                              "1", "0", "0",
                                                               "0", "0", "1";
                                                vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
                                                vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
index e6d4fd0..ed5c79c 100644 (file)
                                        accelerometer@8 {
                                                compatible = "bosch,bma222";
                                                reg = <0x08>;
-                                               mount-matrix = "0", "1", "0",
-                                                              "-1", "0", "0",
+                                               mount-matrix = "0", "-1", "0",
+                                                              "1", "0", "0",
                                                               "0", "0", "1";
                                                vddio-supply = <&ab8500_ldo_aux2_reg>; // 1.8V
                                                vdd-supply = <&ab8500_ldo_aux1_reg>; // 3V
index 1713f78..5ebb779 100644 (file)
        };
 
        irq-syscfg {
-               compatible    = "st,stih407-irq-syscfg";
-               st,syscfg     = <&syscfg_core>;
+               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>,
        miphy28lp_phy: miphy28lp {
                compatible = "st,miphy28lp-phy";
                st,syscfg = <&syscfg_core>;
-               #address-cells  = <1>;
-               #size-cells     = <1>;
+               #address-cells = <1>;
+               #size-cells = <1>;
                ranges;
 
                phy_port0: port@9b22000 {
        };
 
        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>;
+               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>;
+               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>;
 
 
                st_dwc3: dwc3@8f94000 {
-                       compatible      = "st,stih407-dwc3";
-                       reg             = <0x08f94000 0x1000>, <0x110 0x4>;
-                       reg-names       = "reg-glue", "syscfg-reg";
-                       st,syscfg       = <&syscfg_core>;
-                       resets          = <&powerdown STIH407_USB3_POWERDOWN>,
-                                         <&softreset STIH407_MIPHY2_SOFTRESET>;
-                       reset-names     = "powerdown", "softreset";
-                       #address-cells  = <1>;
-                       #size-cells     = <1>;
-                       pinctrl-names   = "default";
-                       pinctrl-0       = <&pinctrl_usb3>;
+                       compatible = "st,stih407-dwc3";
+                       reg = <0x08f94000 0x1000>, <0x110 0x4>;
+                       reg-names = "reg-glue", "syscfg-reg";
+                       st,syscfg = <&syscfg_core>;
+                       resets = <&powerdown STIH407_USB3_POWERDOWN>,
+                                <&softreset STIH407_MIPHY2_SOFTRESET>;
+                       reset-names = "powerdown", "softreset";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_usb3>;
                        ranges;
 
                        status = "disabled";
 
-                       dwc3: dwc3@9900000 {
-                               compatible      = "snps,dwc3";
-                               reg             = <0x09900000 0x100000>;
-                               interrupts      = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
-                               dr_mode         = "host";
-                               phy-names       = "usb2-phy", "usb3-phy";
-                               phys            = <&usb2_picophy0>,
-                                                 <&phy_port2 PHY_TYPE_USB3>;
+                       dwc3: usb@9900000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x09900000 0x100000>;
+                               interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
+                               dr_mode = "host";
+                               phy-names = "usb2-phy", "usb3-phy";
+                               phys = <&usb2_picophy0>,
+                                      <&phy_port2 PHY_TYPE_USB3>;
                                snps,dis_u3_susphy_quirk;
                        };
                };
 
                /* COMMS PWM Module */
                pwm0: pwm@9810000 {
-                       compatible      = "st,sti-pwm";
-                       #pwm-cells      = <2>;
-                       reg             = <0x9810000 0x68>;
-                       interrupts      = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
-                       pinctrl-names   = "default";
-                       pinctrl-0       = <&pinctrl_pwm0_chan0_default>;
-                       clock-names     = "pwm";
-                       clocks          = <&clk_sysin>;
+                       compatible = "st,sti-pwm";
+                       #pwm-cells = <2>;
+                       reg = <0x9810000 0x68>;
+                       interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_pwm0_chan0_default>;
+                       clock-names = "pwm";
+                       clocks = <&clk_sysin>;
                        st,pwm-num-chan = <1>;
 
-                       status          = "disabled";
+                       status = "disabled";
                };
 
                /* SBC PWM Module */
                pwm1: pwm@9510000 {
-                       compatible      = "st,sti-pwm";
-                       #pwm-cells      = <2>;
-                       reg             = <0x9510000 0x68>;
-                       interrupts      = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
-                       pinctrl-names   = "default";
-                       pinctrl-0       = <&pinctrl_pwm1_chan0_default
-                                       &pinctrl_pwm1_chan1_default
-                                       &pinctrl_pwm1_chan2_default
-                                       &pinctrl_pwm1_chan3_default>;
-                       clock-names     = "pwm";
-                       clocks          = <&clk_sysin>;
+                       compatible = "st,sti-pwm";
+                       #pwm-cells = <2>;
+                       reg = <0x9510000 0x68>;
+                       interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&pinctrl_pwm1_chan0_default
+                                    &pinctrl_pwm1_chan1_default
+                                    &pinctrl_pwm1_chan2_default
+                                    &pinctrl_pwm1_chan3_default>;
+                       clock-names = "pwm";
+                       clocks = <&clk_sysin>;
                        st,pwm-num-chan = <4>;
 
-                       status          = "disabled";
+                       status = "disabled";
                };
 
                rng10: rng@8a89000 {
-                       compatible      = "st,rng";
-                       reg             = <0x08a89000 0x1000>;
-                       clocks          = <&clk_sysin>;
-                       status          = "okay";
+                       compatible = "st,rng";
+                       reg = <0x08a89000 0x1000>;
+                       clocks = <&clk_sysin>;
+                       status = "okay";
                };
 
                rng11: rng@8a8a000 {
-                       compatible      = "st,rng";
-                       reg             = <0x08a8a000 0x1000>;
-                       clocks          = <&clk_sysin>;
-                       status          = "okay";
+                       compatible = "st,rng";
+                       reg = <0x08a8a000 0x1000>;
+                       clocks = <&clk_sysin>;
+                       status = "okay";
                };
 
                ethernet0: dwmac@9630000 {
                };
 
                mailbox0: mailbox@8f00000  {
-                       compatible      = "st,stih407-mailbox";
-                       reg             = <0x8f00000 0x1000>;
-                       interrupts      = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
-                       #mbox-cells     = <2>;
-                       mbox-name       = "a9";
-                       status          = "okay";
+                       compatible = "st,stih407-mailbox";
+                       reg = <0x8f00000 0x1000>;
+                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                       #mbox-cells = <2>;
+                       mbox-name = "a9";
+                       status = "okay";
                };
 
                mailbox1: mailbox@8f01000 {
-                       compatible      = "st,stih407-mailbox";
-                       reg             = <0x8f01000 0x1000>;
-                       #mbox-cells     = <2>;
-                       mbox-name       = "st231_gp_1";
-                       status          = "okay";
+                       compatible = "st,stih407-mailbox";
+                       reg = <0x8f01000 0x1000>;
+                       #mbox-cells = <2>;
+                       mbox-name = "st231_gp_1";
+                       status = "okay";
                };
 
                mailbox2: mailbox@8f02000 {
-                       compatible      = "st,stih407-mailbox";
-                       reg             = <0x8f02000 0x1000>;
-                       #mbox-cells     = <2>;
-                       mbox-name       = "st231_gp_0";
-                       status          = "okay";
+                       compatible = "st,stih407-mailbox";
+                       reg = <0x8f02000 0x1000>;
+                       #mbox-cells = <2>;
+                       mbox-name = "st231_gp_0";
+                       status = "okay";
                };
 
                mailbox3: mailbox@8f03000 {
-                       compatible      = "st,stih407-mailbox";
-                       reg             = <0x8f03000 0x1000>;
-                       #mbox-cells     = <2>;
-                       mbox-name       = "st231_audio_video";
-                       status          = "okay";
+                       compatible = "st,stih407-mailbox";
+                       reg = <0x8f03000 0x1000>;
+                       #mbox-cells = <2>;
+                       mbox-name = "st231_audio_video";
+                       status = "okay";
                };
 
                /* fdma audio */
                        dmas = <&fdma0 2 0 1>;
                        dma-names = "tx";
 
-                       status          = "disabled";
+                       status = "disabled";
                };
 
                sti_uni_player1: sti-uni-player@8d81000 {
index 9e212b0..aca43d2 100644 (file)
@@ -13,7 +13,7 @@
                        #address-cells = <1>;
                        #size-cells = <1>;
                        reg = <0 0>;
-                       assigned-clocks = <&clk_s_d2_quadfs 0>,
+                       assigned-clocks = <&clk_s_d2_quadfs 0>,
                                          <&clk_s_d2_quadfs 1>,
                                          <&clk_s_c0_pll1 0>,
                                          <&clk_s_c0_flexgen CLK_COMPO_DVP>,
                                reg-names = "hdmi-reg";
                                #sound-dai-cells = <0>;
                                interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "irq";
+                               interrupt-names = "irq";
                                clock-names = "pix",
                                              "tmds",
                                              "phy",
index ce2f62c..a39dd5f 100644 (file)
                        #size-cells = <1>;
 
                        reg = <0 0>;
-                       assigned-clocks = <&clk_s_d2_quadfs 0>,
+                       assigned-clocks = <&clk_s_d2_quadfs 0>,
                                          <&clk_s_d2_quadfs 1>,
                                          <&clk_s_c0_pll1 0>,
                                          <&clk_s_c0_flexgen CLK_COMPO_DVP>,
                                reg-names = "hdmi-reg";
                                #sound-dai-cells = <0>;
                                interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "irq";
+                               interrupt-names = "irq";
                                clock-names = "pix",
                                              "tmds",
                                              "phy",
index 4c72ded..2aa9460 100644 (file)
 
                        /* tsin0 is TSA on NIMA */
                        tsin0: port {
-                               tsin-num        = <0>;
+                               tsin-num = <0>;
                                serial-not-parallel;
-                               i2c-bus         = <&ssc2>;
-                               reset-gpios     = <&pio15 4 GPIO_ACTIVE_HIGH>;
-                               dvb-card        = <STV0367_TDA18212_NIMA_1>;
+                               i2c-bus = <&ssc2>;
+                               reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>;
+                               dvb-card = <STV0367_TDA18212_NIMA_1>;
                        };
                };
 
index 0d98aca..3de0e9d 100644 (file)
 
 &mac {
        status = "okay";
-       pinctrl-0       = <&ethernet_mii>;
-       pinctrl-names   = "default";
-       phy-mode        = "mii";
-       phy-handle      = <&phy1>;
+       pinctrl-0 = <&ethernet_mii>;
+       pinctrl-names = "default";
+       phy-mode = "mii";
+       phy-handle = <&phy1>;
        mdio0 {
                #address-cells = <1>;
                #size-cells = <0>;
index 91dde07..2059593 100644 (file)
                        arm,primecell-periphid = <0x10153180>;
                        reg = <0x52007000 0x1000>;
                        interrupts = <49>;
-                       interrupt-names = "cmd_irq";
+                       interrupt-names = "cmd_irq";
                        clocks = <&rcc SDMMC1_CK>;
                        clock-names = "apb_pclk";
                        resets = <&rcc STM32H7_AHB3_RESET(SDMMC1)>;
                        arm,primecell-periphid = <0x10153180>;
                        reg = <0x48022400 0x400>;
                        interrupts = <124>;
-                       interrupt-names = "cmd_irq";
+                       interrupt-names = "cmd_irq";
                        clocks = <&rcc SDMMC2_CK>;
                        clock-names = "apb_pclk";
                        resets = <&rcc STM32H7_AHB2_RESET(SDMMC2)>;
index 59e01ce..2b45288 100644 (file)
 
 &mac {
        status = "disabled";
-       pinctrl-0       = <&ethernet_rmii>;
-       pinctrl-names   = "default";
-       phy-mode        = "rmii";
-       phy-handle      = <&phy0>;
+       pinctrl-0 = <&ethernet_rmii>;
+       pinctrl-names = "default";
+       phy-mode = "rmii";
+       phy-handle = <&phy0>;
 
        mdio0 {
                #address-cells = <1>;
index 38cc7fa..5c5d805 100644 (file)
 
 &mac {
        status = "disabled";
-       pinctrl-0       = <&ethernet_rmii>;
-       pinctrl-names   = "default";
-       phy-mode        = "rmii";
-       phy-handle      = <&phy0>;
+       pinctrl-0 = <&ethernet_rmii>;
+       pinctrl-names = "default";
+       phy-mode = "rmii";
+       phy-handle = <&phy0>;
 
        mdio0 {
                #address-cells = <1>;
index 9bb73bb..f3e70d3 100644 (file)
 
 &mac {
        status = "disabled";
-       pinctrl-0       = <&ethernet_rmii>;
-       pinctrl-names   = "default";
-       phy-mode        = "rmii";
-       phy-handle      = <&phy0>;
+       pinctrl-0 = <&ethernet_rmii>;
+       pinctrl-names = "default";
+       phy-mode = "rmii";
+       phy-handle = <&phy0>;
 
        mdio0 {
                #address-cells = <1>;
index f9ebc47..3a921db 100644 (file)
@@ -4,6 +4,8 @@
  * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
  */
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/stm32mp13-clks.h>
+#include <dt-bindings/reset/stm32mp13-resets.h>
 
 / {
        #address-cells = <1>;
                interrupt-parent = <&intc>;
        };
 
-       clocks {
-               clk_axi: clk-axi {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <266500000>;
+       firmware {
+               optee {
+                       method = "smc";
+                       compatible = "linaro,optee-tz";
                };
 
-               clk_hse: clk-hse {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <24000000>;
-               };
-
-               clk_hsi: clk-hsi {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <64000000>;
-               };
-
-               clk_lsi: clk-lsi {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <32000>;
-               };
-
-               clk_pclk3: clk-pclk3 {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <104438965>;
-               };
-
-               clk_pclk4: clk-pclk4 {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <133250000>;
-               };
-
-               clk_pll4_p: clk-pll4_p {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <50000000>;
-               };
+               scmi: scmi {
+                       compatible = "linaro,scmi-optee";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       linaro,optee-channel-id = <0>;
+                       shmem = <&scmi_shm>;
 
-               clk_pll4_r: clk-pll4_r {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <99000000>;
-               };
+                       scmi_clk: protocol@14 {
+                               reg = <0x14>;
+                               #clock-cells = <1>;
+                       };
 
-               clk_rtc_k: clk-rtc-k {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <32768>;
+                       scmi_reset: protocol@16 {
+                               reg = <0x16>;
+                               #reset-cells = <1>;
+                       };
                };
        };
 
                interrupt-parent = <&intc>;
                ranges;
 
+               scmi_sram: sram@2ffff000 {
+                       compatible = "mmio-sram";
+                       reg = <0x2ffff000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0x2ffff000 0x1000>;
+
+                       scmi_shm: scmi-sram@0 {
+                               compatible = "arm,scmi-shmem";
+                               reg = <0 0x80>;
+                       };
+               };
+
                uart4: serial@40010000 {
                        compatible = "st,stm32h7-uart";
                        reg = <0x40010000 0x400>;
                        interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_hsi>;
+                       clocks = <&rcc UART4_K>;
+                       resets = <&rcc UART4_R>;
                        status = "disabled";
                };
 
                                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_pclk4>;
+                       clocks = <&rcc DMA1>;
+                       resets = <&rcc DMA1_R>;
                        #dma-cells = <4>;
                        st,mem2mem;
                        dma-requests = <8>;
                                     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_pclk4>;
+                       clocks = <&rcc DMA2>;
+                       resets = <&rcc DMA2_R>;
                        #dma-cells = <4>;
                        st,mem2mem;
                        dma-requests = <8>;
                dmamux1: dma-router@48002000 {
                        compatible = "st,stm32h7-dmamux";
                        reg = <0x48002000 0x40>;
-                       clocks = <&clk_pclk4>;
+                       clocks = <&rcc DMAMUX1>;
+                       resets = <&rcc DMAMUX1_R>;
                        #dma-cells = <3>;
                        dma-masters = <&dma1 &dma2>;
                        dma-requests = <128>;
                        dma-channels = <16>;
                };
 
+               rcc: rcc@50000000 {
+                       compatible = "st,stm32mp13-rcc", "syscon";
+                       reg = <0x50000000 0x1000>;
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       clock-names = "hse", "hsi", "csi", "lse", "lsi";
+                       clocks = <&scmi_clk CK_SCMI_HSE>,
+                                <&scmi_clk CK_SCMI_HSI>,
+                                <&scmi_clk CK_SCMI_CSI>,
+                                <&scmi_clk CK_SCMI_LSE>,
+                                <&scmi_clk CK_SCMI_LSI>;
+               };
+
                exti: interrupt-controller@5000d000 {
                        compatible = "st,stm32mp13-exti", "syscon";
                        interrupt-controller;
                syscfg: syscon@50020000 {
                        compatible = "st,stm32mp157-syscfg", "syscon";
                        reg = <0x50020000 0x400>;
-                       clocks = <&clk_pclk3>;
+                       clocks = <&rcc SYSCFG>;
                };
 
                mdma: dma-controller@58000000 {
                        compatible = "st,stm32h7-mdma";
                        reg = <0x58000000 0x1000>;
                        interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_pclk4>;
+                       clocks = <&rcc MDMA>;
                        #dma-cells = <5>;
                        dma-channels = <32>;
                        dma-requests = <48>;
                        reg = <0x58005000 0x1000>, <0x58006000 0x1000>;
                        interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "cmd_irq";
-                       clocks = <&clk_pll4_p>;
+                       clocks = <&rcc SDMMC1_K>;
                        clock-names = "apb_pclk";
+                       resets = <&rcc SDMMC1_R>;
                        cap-sd-highspeed;
                        cap-mmc-highspeed;
                        max-frequency = <130000000>;
                        reg = <0x58007000 0x1000>, <0x58008000 0x1000>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "cmd_irq";
-                       clocks = <&clk_pll4_p>;
+                       clocks = <&rcc SDMMC2_K>;
                        clock-names = "apb_pclk";
+                       resets = <&rcc SDMMC2_R>;
                        cap-sd-highspeed;
                        cap-mmc-highspeed;
                        max-frequency = <130000000>;
                iwdg2: watchdog@5a002000 {
                        compatible = "st,stm32mp1-iwdg";
                        reg = <0x5a002000 0x400>;
-                       clocks = <&clk_pclk4>, <&clk_lsi>;
+                       clocks = <&rcc IWDG2>, <&scmi_clk CK_SCMI_LSI>;
                        clock-names = "pclk", "lsi";
                        status = "disabled";
                };
                        compatible = "st,stm32mp1-rtc";
                        reg = <0x5c004000 0x400>;
                        interrupts-extended = <&exti 19 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_pclk4>, <&clk_rtc_k>;
+                       clocks = <&scmi_clk CK_SCMI_RTCAPB>,
+                                <&scmi_clk CK_SCMI_RTC>;
                        clock-names = "pclk", "rtc_ck";
                        status = "disabled";
                };
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x0 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOA>;
                                st,bank-name = "GPIOA";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 0 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x1000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOB>;
                                st,bank-name = "GPIOB";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 16 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x2000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOC>;
                                st,bank-name = "GPIOC";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 32 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x3000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOD>;
                                st,bank-name = "GPIOD";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 48 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x4000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOE>;
                                st,bank-name = "GPIOE";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 64 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x5000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOF>;
                                st,bank-name = "GPIOF";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 80 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x6000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOG>;
                                st,bank-name = "GPIOG";
                                ngpios = <16>;
                                gpio-ranges = <&pinctrl 0 96 16>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x7000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOH>;
                                st,bank-name = "GPIOH";
                                ngpios = <15>;
                                gpio-ranges = <&pinctrl 0 112 15>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                reg = <0x8000 0x400>;
-                               clocks = <&clk_pclk4>;
+                               clocks = <&rcc GPIOI>;
                                st,bank-name = "GPIOI";
                                ngpios = <8>;
                                gpio-ranges = <&pinctrl 0 128 8>;
index 0fb1386..531c263 100644 (file)
@@ -15,7 +15,7 @@
                        interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "int0", "int1";
-                       clocks = <&clk_hse>, <&clk_pll4_r>;
+                       clocks = <&scmi_clk CK_SCMI_HSE>, <&rcc FDCAN_K>;
                        clock-names = "hclk", "cclk";
                        bosch,mram-cfg = <0x0 0 0 32 0 0 2 2>;
                        status = "disabled";
@@ -28,7 +28,7 @@
                        interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "int0", "int1";
-                       clocks = <&clk_hse>, <&clk_pll4_r>;
+                       clocks = <&scmi_clk CK_SCMI_HSE>, <&rcc FDCAN_K>;
                        clock-names = "hclk", "cclk";
                        bosch,mram-cfg = <0x1400 0 0 32 0 0 2 2>;
                        status = "disabled";
index 09d6226..e6b8ffd 100644 (file)
                reg = <0xc0000000 0x20000000>;
        };
 
+       reserved-memory {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               optee@dd000000 {
+                       reg = <0xdd000000 0x3000000>;
+                       no-map;
+               };
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
 
index fa6889e..4d00e75 100644 (file)
@@ -10,7 +10,8 @@
                        compatible = "st,stm32mp1-cryp";
                        reg = <0x54002000 0x400>;
                        interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_axi>;
+                       clocks = <&rcc CRYP1>;
+                       resets = <&rcc CRYP1_R>;
                        status = "disabled";
                };
        };
index fa6889e..4d00e75 100644 (file)
@@ -10,7 +10,8 @@
                        compatible = "st,stm32mp1-cryp";
                        reg = <0x54002000 0x400>;
                        interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&clk_axi>;
+                       clocks = <&rcc CRYP1>;
+                       resets = <&rcc CRYP1_R>;
                        status = "disabled";
                };
        };
index 6052243..2cc9341 100644 (file)
                };
        };
 
+       dcmi_pins_c: dcmi-2 {
+               pins {
+                       pinmux = <STM32_PINMUX('A', 4,  AF13)>,/* DCMI_HSYNC */
+                                <STM32_PINMUX('B', 7,  AF13)>,/* DCMI_VSYNC */
+                                <STM32_PINMUX('A', 6,  AF13)>,/* DCMI_PIXCLK */
+                                <STM32_PINMUX('A', 9,  AF13)>,/* DCMI_D0 */
+                                <STM32_PINMUX('H', 10, AF13)>,/* DCMI_D1 */
+                                <STM32_PINMUX('E', 0, AF13)>,/* DCMI_D2 */
+                                <STM32_PINMUX('E', 1, AF13)>,/* DCMI_D3 */
+                                <STM32_PINMUX('H', 14, AF13)>,/* DCMI_D4 */
+                                <STM32_PINMUX('I', 4,  AF13)>,/* DCMI_D5 */
+                                <STM32_PINMUX('I', 6,  AF13)>,/* DCMI_D6 */
+                                <STM32_PINMUX('E', 6,  AF13)>,/* DCMI_D7 */
+                                <STM32_PINMUX('I', 1,  AF13)>,/* DCMI_D8 */
+                                <STM32_PINMUX('H', 7,  AF13)>;/* DCMI_D9 */
+                       bias-pull-up;
+               };
+       };
+
+       dcmi_sleep_pins_c: dcmi-sleep-2 {
+               pins {
+                       pinmux = <STM32_PINMUX('A', 4,  ANALOG)>,/* DCMI_HSYNC */
+                                <STM32_PINMUX('B', 7,  ANALOG)>,/* DCMI_VSYNC */
+                                <STM32_PINMUX('A', 6,  ANALOG)>,/* DCMI_PIXCLK */
+                                <STM32_PINMUX('A', 9,  ANALOG)>,/* DCMI_D0 */
+                                <STM32_PINMUX('H', 10, ANALOG)>,/* DCMI_D1 */
+                                <STM32_PINMUX('E', 0, ANALOG)>,/* DCMI_D2 */
+                                <STM32_PINMUX('E', 1, ANALOG)>,/* DCMI_D3 */
+                                <STM32_PINMUX('H', 14, ANALOG)>,/* DCMI_D4 */
+                                <STM32_PINMUX('I', 4,  ANALOG)>,/* DCMI_D5 */
+                                <STM32_PINMUX('I', 6,  ANALOG)>,/* DCMI_D6 */
+                                <STM32_PINMUX('E', 6,  ANALOG)>,/* DCMI_D7 */
+                                <STM32_PINMUX('I', 1,  ANALOG)>,/* DCMI_D8 */
+                                <STM32_PINMUX('H', 7,  ANALOG)>;/* DCMI_D9 */
+               };
+       };
+
        ethernet0_rgmii_pins_a: rgmii-0 {
                pins1 {
                        pinmux = <STM32_PINMUX('G', 5, AF11)>, /* ETH_RGMII_CLK125 */
                };
        };
 
+       mco1_pins_a: mco1-0 {
+               pins {
+                       pinmux = <STM32_PINMUX('A', 13, AF2)>; /* MCO1 */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <1>;
+               };
+       };
+
+       mco1_sleep_pins_a: mco1-sleep-0 {
+               pins {
+                       pinmux = <STM32_PINMUX('A', 13, ANALOG)>; /* MCO1 */
+               };
+       };
+
        mco2_pins_a: mco2-0 {
                pins {
                        pinmux = <STM32_PINMUX('G', 2, AF1)>; /* MCO2 */
                };
        };
 
+       m_can1_pins_c: m-can1-2 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('H', 13, AF9)>; /* CAN1_TX */
+                       slew-rate = <1>;
+                       drive-push-pull;
+                       bias-disable;
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('H', 14, AF9)>; /* CAN1_RX */
+                       bias-disable;
+               };
+       };
+
+       m_can1_sleep_pins_c: m_can1-sleep-2 {
+               pins {
+                       pinmux = <STM32_PINMUX('H', 13, ANALOG)>, /* CAN1_TX */
+                                <STM32_PINMUX('H', 14, ANALOG)>; /* CAN1_RX */
+               };
+       };
+
        m_can2_pins_a: m-can2-0 {
                pins1 {
                        pinmux = <STM32_PINMUX('B', 13, AF9)>; /* CAN2_TX */
 
        spi2_pins_a: spi2-0 {
                pins1 {
-                       pinmux = <STM32_PINMUX('B', 10, AF5)>, /* SPI1_SCK */
-                                <STM32_PINMUX('I', 3, AF5)>; /* SPI1_MOSI */
+                       pinmux = <STM32_PINMUX('B', 10, AF5)>, /* SPI2_SCK */
+                                <STM32_PINMUX('I', 3, AF5)>; /* SPI2_MOSI */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <1>;
+               };
+
+               pins2 {
+                       pinmux = <STM32_PINMUX('I', 2, AF5)>; /* SPI2_MISO */
+                       bias-disable;
+               };
+       };
+
+       spi2_pins_b: spi2-1 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('I', 1, AF5)>, /* SPI2_SCK */
+                                <STM32_PINMUX('I', 3, AF5)>; /* SPI2_MOSI */
                        bias-disable;
                        drive-push-pull;
                        slew-rate = <1>;
                };
 
                pins2 {
-                       pinmux = <STM32_PINMUX('I', 2, AF5)>; /* SPI1_MISO */
+                       pinmux = <STM32_PINMUX('I', 2, AF5)>; /* SPI2_MISO */
                        bias-disable;
                };
        };
                };
        };
 
+       uart4_pins_d: uart4-3 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('A', 13, AF8)>; /* UART4_TX */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <0>;
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
+                       bias-disable;
+               };
+       };
+
+       uart4_idle_pins_d: uart4-idle-3 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('A', 13, ANALOG)>; /* UART4_TX */
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
+                       bias-disable;
+               };
+       };
+
+       uart4_sleep_pins_d: uart4-sleep-3 {
+               pins {
+                       pinmux = <STM32_PINMUX('A', 13, ANALOG)>, /* UART4_TX */
+                                <STM32_PINMUX('B', 2, ANALOG)>; /* UART4_RX */
+               };
+       };
+
+       uart5_pins_a: uart5-0 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('B', 13, AF14)>; /* UART5_TX */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <0>;
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('B', 5, AF12)>; /* UART5_RX */
+                       bias-disable;
+               };
+       };
+
        uart7_pins_a: uart7-0 {
                pins1 {
                        pinmux = <STM32_PINMUX('E', 8, AF7)>; /* UART7_TX */
                };
        };
 
+       usart3_pins_e: usart3-4 {
+               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('B', 11, AF7)>, /* USART3_RX */
+                                <STM32_PINMUX('D', 11, AF7)>; /* USART3_CTS_NSS */
+                       bias-pull-up;
+               };
+       };
+
+       usart3_idle_pins_e: usart3-idle-4 {
+               pins1 {
+                       pinmux = <STM32_PINMUX('B', 10, ANALOG)>, /* USART3_TX */
+                                <STM32_PINMUX('D', 11, ANALOG)>; /* USART3_CTS_NSS */
+               };
+               pins2 {
+                       pinmux = <STM32_PINMUX('G', 8, AF8)>; /* USART3_RTS */
+                       bias-disable;
+                       drive-push-pull;
+                       slew-rate = <0>;
+               };
+               pins3 {
+                       pinmux = <STM32_PINMUX('B', 11, AF7)>; /* USART3_RX */
+                       bias-pull-up;
+               };
+       };
+
+       usart3_sleep_pins_e: usart3-sleep-4 {
+               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('B', 11, ANALOG)>; /* USART3_RX */
+               };
+       };
+
        usbotg_hs_pins_a: usbotg-hs-0 {
                pins {
                        pinmux = <STM32_PINMUX('A', 10, ANALOG)>; /* OTG_ID */
diff --git a/arch/arm/boot/dts/stm32mp15-scmi.dtsi b/arch/arm/boot/dts/stm32mp15-scmi.dtsi
new file mode 100644 (file)
index 0000000..543f24c
--- /dev/null
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
+/*
+ * Copyright (C) STMicroelectronics 2022 - All Rights Reserved
+ * Author: Alexandre Torgue <alexandre.torgue@foss.st.com> for STMicroelectronics.
+ */
+
+/ {
+       firmware {
+               optee: optee {
+                       compatible = "linaro,optee-tz";
+                       method = "smc";
+               };
+
+               scmi: scmi {
+                       compatible = "linaro,scmi-optee";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       linaro,optee-channel-id = <0>;
+                       shmem = <&scmi_shm>;
+
+                       scmi_clk: protocol@14 {
+                               reg = <0x14>;
+                               #clock-cells = <1>;
+                       };
+
+                       scmi_reset: protocol@16 {
+                               reg = <0x16>;
+                               #reset-cells = <1>;
+                       };
+
+                       scmi_voltd: protocol@17 {
+                               reg = <0x17>;
+
+                               scmi_reguls: regulators {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       scmi_reg11: reg11@0 {
+                                               reg = <0>;
+                                               regulator-name = "reg11";
+                                               regulator-min-microvolt = <1100000>;
+                                               regulator-max-microvolt = <1100000>;
+                                       };
+
+                                       scmi_reg18: reg18@1 {
+                                               voltd-name = "reg18";
+                                               reg = <1>;
+                                               regulator-name = "reg18";
+                                               regulator-min-microvolt = <1800000>;
+                                               regulator-max-microvolt = <1800000>;
+                                       };
+
+                                       scmi_usb33: usb33@2 {
+                                               reg = <2>;
+                                               regulator-name = "usb33";
+                                               regulator-min-microvolt = <3300000>;
+                                               regulator-max-microvolt = <3300000>;
+                                       };
+                               };
+                       };
+               };
+       };
+
+       soc {
+               scmi_sram: sram@2ffff000 {
+                       compatible = "mmio-sram";
+                       reg = <0x2ffff000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0x2ffff000 0x1000>;
+
+                       scmi_shm: scmi-sram@0 {
+                               compatible = "arm,scmi-shmem";
+                               reg = <0 0x80>;
+                       };
+               };
+       };
+};
+
+&reg11 {
+       status = "disabled";
+};
+
+&reg18 {
+       status = "disabled";
+};
+
+&usb33 {
+       status = "disabled";
+};
+
+&usbotg_hs {
+       usb33d-supply = <&scmi_usb33>;
+};
+
+&usbphyc {
+       vdda1v1-supply = <&scmi_reg11>;
+       vdda1v8-supply = <&scmi_reg18>;
+};
+
+/delete-node/ &clk_hse;
+/delete-node/ &clk_hsi;
+/delete-node/ &clk_lse;
+/delete-node/ &clk_lsi;
+/delete-node/ &clk_csi;
index 1b2fd34..742fdee 100644 (file)
                status = "disabled";
        };
 
-       firmware {
-               optee: optee {
-                       compatible = "linaro,optee-tz";
-                       method = "smc";
-                       status = "disabled";
-               };
-
-               scmi: scmi {
-                       compatible = "linaro,scmi-optee";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-                       linaro,optee-channel-id = <0>;
-                       shmem = <&scmi_shm>;
-                       status = "disabled";
-
-                       scmi_clk: protocol@14 {
-                               reg = <0x14>;
-                               #clock-cells = <1>;
-                       };
-
-                       scmi_reset: protocol@16 {
-                               reg = <0x16>;
-                               #reset-cells = <1>;
-                       };
-               };
-       };
-
        soc {
                compatible = "simple-bus";
                #address-cells = <1>;
                interrupt-parent = <&intc>;
                ranges;
 
-               scmi_sram: sram@2ffff000 {
-                       compatible = "mmio-sram";
-                       reg = <0x2ffff000 0x1000>;
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-                       ranges = <0 0x2ffff000 0x1000>;
-
-                       scmi_shm: scmi-sram@0 {
-                               compatible = "arm,scmi-shmem";
-                               reg = <0 0x80>;
-                               status = "disabled";
-                       };
-               };
-
                timers2: timer@40000000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "st,stm32-cec";
                        reg = <0x40016000 0x400>;
                        interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&rcc CEC_K>, <&clk_lse>;
+                       clocks = <&rcc CEC_K>, <&rcc CEC>;
                        clock-names = "cec", "hdmi-cec";
                        status = "disabled";
                };
                        reg = <0x4c001000 0x400>;
                        st,proc-id = <0>;
                        interrupts-extended =
-                               <&intc GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
-                               <&intc GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
-                               <&exti 61 1>;
-                       interrupt-names = "rx", "tx", "wakeup";
+                               <&exti 61 1>,
+                               <&intc GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "rx", "tx";
                        clocks = <&rcc IPCC>;
                        wakeup-source;
                        status = "disabled";
                usbh_ohci: usb@5800c000 {
                        compatible = "generic-ohci";
                        reg = <0x5800c000 0x1000>;
-                       clocks = <&rcc USBH>, <&usbphyc>;
+                       clocks = <&usbphyc>, <&rcc USBH>;
                        resets = <&rcc USBH_R>;
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                usbh_ehci: usb@5800d000 {
                        compatible = "generic-ehci";
                        reg = <0x5800d000 0x1000>;
-                       clocks = <&rcc USBH>;
+                       clocks = <&usbphyc>, <&rcc USBH>;
                        resets = <&rcc USBH_R>;
                        interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
                        companion = <&usbh_ohci>;
diff --git a/arch/arm/boot/dts/stm32mp153c-dhcor-drc-compact.dts b/arch/arm/boot/dts/stm32mp153c-dhcor-drc-compact.dts
new file mode 100644 (file)
index 0000000..c8b9818
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+/*
+ * Copyright (C) 2022 Marek Vasut <marex@denx.de>
+ *
+ * DHCOR STM32MP1 variant:
+ * DHCR-STM32MP153C-C065-R051-V33-SPI-I-01LG
+ * DHCOR PCB number: 586-100 or newer
+ * DRC Compact PCB number: 627-100 or newer
+ */
+
+/dts-v1/;
+
+#include "stm32mp153.dtsi"
+#include "stm32mp15xc.dtsi"
+#include "stm32mp15xx-dhcor-som.dtsi"
+#include "stm32mp15xx-dhcor-drc-compact.dtsi"
+
+/ {
+       model = "DH electronics STM32MP153C DHCOR DRC Compact";
+       compatible = "dh,stm32mp153c-dhcor-drc-compact",
+                    "dh,stm32mp153c-dhcor-som",
+                    "st,stm32mp153";
+};
+
+&m_can1 {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&m_can1_pins_c>;
+       pinctrl-1 = <&m_can1_sleep_pins_c>;
+       status = "okay";
+};
index e3d3f3f..e539cc8 100644 (file)
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "stm32mp157a-dk1.dts"
+#include "stm32mp15-scmi.dtsi"
 
 / {
        model = "STMicroelectronics STM32MP157A-DK1 SCMI Discovery Board";
        clocks = <&scmi_clk CK_SCMI_MPU>;
 };
 
+&dsi {
+       clocks = <&rcc DSI_K>, <&scmi_clk CK_SCMI_HSE>, <&rcc DSI_PX>;
+};
+
 &gpioz {
        clocks = <&scmi_clk CK_SCMI_GPIOZ>;
 };
        resets = <&scmi_reset RST_SCMI_MCU>;
 };
 
-&optee {
-       status = "okay";
-};
-
 &rcc {
        compatible = "st,stm32mp1-rcc-secure", "syscon";
        clock-names = "hse", "hsi", "csi", "lse", "lsi";
 &rtc {
        clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
 };
-
-&scmi {
-       status = "okay";
-};
-
-&scmi_shm {
-       status = "okay";
-};
index 45dcd29..97e4f94 100644 (file)
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "stm32mp157c-dk2.dts"
+#include "stm32mp15-scmi.dtsi"
 
 / {
        model = "STMicroelectronics STM32MP157C-DK2 SCMI Discovery Board";
@@ -34,6 +35,7 @@
 };
 
 &dsi {
+       phy-dsi-supply = <&scmi_reg18>;
        clocks = <&rcc DSI_K>, <&scmi_clk CK_SCMI_HSE>, <&rcc DSI_PX>;
 };
 
        resets = <&scmi_reset RST_SCMI_MCU>;
 };
 
-&optee {
-       status = "okay";
-};
-
 &rcc {
        compatible = "st,stm32mp1-rcc-secure", "syscon";
        clock-names = "hse", "hsi", "csi", "lse", "lsi";
 &rtc {
        clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
 };
-
-&scmi {
-       status = "okay";
-};
-
-&scmi_shm {
-       status = "okay";
-};
index 458e0ca..9cf0a44 100644 (file)
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "stm32mp157c-ed1.dts"
+#include "stm32mp15-scmi.dtsi"
 
 / {
        model = "STMicroelectronics STM32MP157C-ED1 SCMI eval daughter";
        resets = <&scmi_reset RST_SCMI_CRYP1>;
 };
 
+&dsi {
+       clocks = <&rcc DSI_K>, <&scmi_clk CK_SCMI_HSE>, <&rcc DSI_PX>;
+};
+
 &gpioz {
        clocks = <&scmi_clk CK_SCMI_GPIOZ>;
 };
        resets = <&scmi_reset RST_SCMI_MCU>;
 };
 
-&optee {
-       status = "okay";
-};
-
 &rcc {
        compatible = "st,stm32mp1-rcc-secure", "syscon";
        clock-names = "hse", "hsi", "csi", "lse", "lsi";
 &rtc {
        clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
 };
-
-&scmi {
-       status = "okay";
-};
-
-&scmi_shm {
-       status = "okay";
-};
index df9c113..3b9dd6f 100644 (file)
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "stm32mp157c-ev1.dts"
+#include "stm32mp15-scmi.dtsi"
 
 / {
        model = "STMicroelectronics STM32MP157C-EV1 SCMI eval daughter on eval mother";
@@ -35,6 +36,7 @@
 };
 
 &dsi {
+       phy-dsi-supply = <&scmi_reg18>;
        clocks = <&rcc DSI_K>, <&scmi_clk CK_SCMI_HSE>, <&rcc DSI_PX>;
 };
 
        resets = <&scmi_reset RST_SCMI_MCU>;
 };
 
-&optee {
-       status = "okay";
-};
-
 &rcc {
        compatible = "st,stm32mp1-rcc-secure", "syscon";
        clock-names = "hse", "hsi", "csi", "lse", "lsi";
 &rtc {
        clocks = <&scmi_clk CK_SCMI_RTCAPB>, <&scmi_clk CK_SCMI_RTC>;
 };
-
-&scmi {
-       status = "okay";
-};
-
-&scmi_shm {
-       status = "okay";
-};
index 76c54b0..9093307 100644 (file)
        };
 };
 
+&dcmi {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&dcmi_pins_c>;
+       pinctrl-1 = <&dcmi_sleep_pins_c>;
+       status = "disabled";
+
+       port {
+               dcmi_0: endpoint {
+                       remote-endpoint = <&stmipi_2>;
+                       bus-type = <5>;
+                       bus-width = <8>;
+                       pclk-sample = <0>;
+               };
+       };
+};
+
 &ethernet0 {
        status = "okay";
        pinctrl-0 = <&ethernet0_rgmii_pins_c>;
 };
 
 &i2c4 {
+       stmipi: stmipi@14 {
+               compatible = "st,st-mipid02";
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&mco1_pins_a>;
+               pinctrl-1 = <&mco1_sleep_pins_a>;
+               reg = <0x14>;
+               clocks = <&rcc CK_MCO1>;
+               clock-names = "xclk";
+               assigned-clocks = <&rcc CK_MCO1>;
+               assigned-clock-parents = <&rcc CK_HSE>;
+               assigned-clock-rates = <24000000>;
+               VDDE-supply = <&v1v8>;
+               VDDIN-supply = <&v1v8>;
+               reset-gpios = <&gpioz 0 GPIO_ACTIVE_LOW>;
+               status = "disabled";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               stmipi_0: endpoint {
+                               };
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               stmipi_2: endpoint {
+                                       bus-width = <8>;
+                                       hsync-active = <0>;
+                                       vsync-active = <0>;
+                                       pclk-sample = <0>;
+                                       remote-endpoint = <&dcmi_0>;
+                               };
+                       };
+               };
+       };
+
        hdmi-transmitter@3d {
                compatible = "adi,adv7513";
                reg = <0x3d>, <0x4d>, <0x2d>, <0x5d>;
diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi
new file mode 100644 (file)
index 0000000..27477bb
--- /dev/null
@@ -0,0 +1,322 @@
+// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
+/*
+ * Copyright (C) 2022 Marek Vasut <marex@denx.de>
+ */
+
+/ {
+       aliases {
+               ethernet0 = &ethernet0;
+               ethernet1 = &ksz8851;
+               mmc0 = &sdmmc1;
+               rtc0 = &hwrtc;
+               rtc1 = &rtc;
+               serial0 = &uart4;
+               serial1 = &uart8;
+               serial2 = &usart3;
+               serial3 = &uart5;
+               spi0 = &qspi;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       led {
+               compatible = "gpio-leds";
+               led1 {
+                       label = "yellow:user0";
+                       gpios = <&gpioz 6 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+
+               led2 {
+                       label = "red:user1";
+                       gpios = <&gpioz 3 GPIO_ACTIVE_LOW>;
+                       default-state = "off";
+               };
+       };
+
+       ethernet_vio: vioregulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vio";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpioh 2 GPIO_ACTIVE_LOW>;
+               regulator-always-on;
+               regulator-boot-on;
+               vin-supply = <&vdd>;
+       };
+};
+
+&adc { /* X11 ADC inputs */
+       pinctrl-names = "default";
+       pinctrl-0 = <&adc12_ain_pins_b>;
+       vdd-supply = <&vdd>;
+       vdda-supply = <&vdda>;
+       vref-supply = <&vdda>;
+       status = "okay";
+
+       adc1: adc@0 {
+               st,adc-channels = <0 1 6>;
+               st,min-sample-time-nsecs = <5000>;
+               status = "okay";
+       };
+
+       adc2: adc@100 {
+               st,adc-channels = <0 1 2>;
+               st,min-sample-time-nsecs = <5000>;
+               status = "okay";
+       };
+};
+
+&ethernet0 {
+       status = "okay";
+       pinctrl-0 = <&ethernet0_rgmii_pins_c>;
+       pinctrl-1 = <&ethernet0_rgmii_sleep_pins_c>;
+       pinctrl-names = "default", "sleep";
+       phy-mode = "rgmii";
+       max-speed = <1000>;
+       phy-handle = <&phy0>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
+               reset-delay-us = <1000>;
+               reset-post-delay-us = <1000>;
+
+               phy0: ethernet-phy@7 {
+                       reg = <7>;
+
+                       rxc-skew-ps = <1500>;
+                       rxdv-skew-ps = <540>;
+                       rxd0-skew-ps = <420>;
+                       rxd1-skew-ps = <420>;
+                       rxd2-skew-ps = <420>;
+                       rxd3-skew-ps = <420>;
+
+                       txc-skew-ps = <1440>;
+                       txen-skew-ps = <540>;
+                       txd0-skew-ps = <420>;
+                       txd1-skew-ps = <420>;
+                       txd2-skew-ps = <420>;
+                       txd3-skew-ps = <420>;
+               };
+       };
+};
+
+&fmc {
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&fmc_pins_b>;
+       pinctrl-1 = <&fmc_sleep_pins_b>;
+       status = "okay";
+
+       ksz8851: ethernet@1,0 {
+               compatible = "micrel,ks8851-mll";
+               reg = <1 0x0 0x2>, <1 0x2 0x20000>;
+               interrupt-parent = <&gpioc>;
+               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+               bank-width = <2>;
+
+               /* Timing values are in nS */
+               st,fmc2-ebi-cs-mux-enable;
+               st,fmc2-ebi-cs-transaction-type = <4>;
+               st,fmc2-ebi-cs-buswidth = <16>;
+               st,fmc2-ebi-cs-address-setup-ns = <5>;
+               st,fmc2-ebi-cs-address-hold-ns = <5>;
+               st,fmc2-ebi-cs-bus-turnaround-ns = <5>;
+               st,fmc2-ebi-cs-data-setup-ns = <45>;
+               st,fmc2-ebi-cs-data-hold-ns = <1>;
+               st,fmc2-ebi-cs-write-address-setup-ns = <5>;
+               st,fmc2-ebi-cs-write-address-hold-ns = <5>;
+               st,fmc2-ebi-cs-write-bus-turnaround-ns = <5>;
+               st,fmc2-ebi-cs-write-data-setup-ns = <45>;
+               st,fmc2-ebi-cs-write-data-hold-ns = <1>;
+       };
+};
+
+&gpioa {
+       gpio-line-names = "", "", "", "",
+                         "DRCC-VAR2", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "";
+};
+
+&gpioe {
+       gpio-line-names = "", "", "", "",
+                         "", "DRCC-GPIO0", "", "",
+                         "", "", "", "",
+                         "", "", "", "";
+};
+
+&gpiog {
+       gpio-line-names = "", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "DRCC-GPIO5", "", "", "";
+};
+
+&gpioh {
+       gpio-line-names = "", "", "", "DRCC-HW2",
+                         "DRCC-GPIO4", "", "", "",
+                         "DRCC-HW1", "DRCC-HW0", "", "DRCC-VAR1",
+                         "DRCC-VAR0", "", "", "DRCC-GPIO6";
+};
+
+&gpioi {
+       gpio-line-names = "", "", "", "",
+                         "", "", "", "DRCC-GPIO2",
+                         "", "DRCC-GPIO1", "", "",
+                         "", "", "", "";
+};
+
+&i2c1 {        /* X11 I2C1 */
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_b>;
+       i2c-scl-rising-time-ns = <185>;
+       i2c-scl-falling-time-ns = <20>;
+       status = "okay";
+       /delete-property/dmas;
+       /delete-property/dma-names;
+};
+
+&i2c4 {
+       hwrtc: rtc@32 {
+               compatible = "microcrystal,rv8803";
+               reg = <0x32>;
+       };
+
+       eeprom@50 {
+               compatible = "atmel,24c04";
+               reg = <0x50>;
+               pagesize = <16>;
+       };
+};
+
+&sdmmc1 {      /* MicroSD */
+       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 = <&gpioi 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+       disable-wp;
+       st,neg-edge;
+       bus-width = <4>;
+       vmmc-supply = <&vdd>;
+       vqmmc-supply = <&vdd>;
+       status = "okay";
+};
+
+&sdmmc2 {      /* eMMC */
+       pinctrl-names = "default", "opendrain", "sleep";
+       pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_c>;
+       pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_c>;
+       pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_c>;
+       bus-width = <8>;
+       no-sd;
+       no-sdio;
+       non-removable;
+       st,neg-edge;
+       vmmc-supply = <&v3v3>;
+       vqmmc-supply = <&vdd>;
+       status = "okay";
+};
+
+&sdmmc3 {      /* SDIO Wi-Fi */
+       pinctrl-names = "default", "opendrain", "sleep";
+       pinctrl-0 = <&sdmmc3_b4_pins_a>;
+       pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
+       pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
+       broken-cd;
+       bus-width = <4>;
+       mmc-ddr-3_3v;
+       st,neg-edge;
+       vmmc-supply = <&v3v3>;
+       vqmmc-supply = <&v3v3>;
+       status = "okay";
+};
+
+&spi2 {        /* X11 SPI */
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi2_pins_b>;
+       cs-gpios = <&gpioi 0 0>;
+       status = "disabled";
+       /delete-property/dmas;
+       /delete-property/dma-names;
+};
+
+&uart4 {
+       label = "UART0";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart4_pins_d>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       status = "okay";
+};
+
+&uart5 {       /* X11 UART */
+       label = "X11-UART5";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart5_pins_a>;
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       status = "okay";
+};
+
+&uart8 {
+       label = "RS485-1";
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>;
+       uart-has-rtscts;
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       status = "okay";
+};
+
+&usart3 {      /* RS485 or RS232 */
+       label = "RS485-2";
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&usart3_pins_e>;
+       pinctrl-1 = <&usart3_sleep_pins_e>;
+       uart-has-rtscts;
+       /delete-property/dmas;
+       /delete-property/dma-names;
+       status = "okay";
+};
+
+&usbh_ehci {
+       phys = <&usbphyc_port0>;
+       status = "okay";
+};
+
+&usbh_ohci {
+       phys = <&usbphyc_port0>;
+       status = "okay";
+};
+
+&usbotg_hs {
+       dr_mode = "otg";
+       pinctrl-0 = <&usbotg_hs_pins_a>;
+       pinctrl-names = "default";
+       phy-names = "usb2-phy";
+       phys = <&usbphyc_port1 0>;
+       vbus-supply = <&vbus_otg>;
+       status = "okay";
+};
+
+&usbphyc {
+       status = "okay";
+};
+
+&usbphyc_port0 {
+       phy-supply = <&vdd_usb>;
+       connector {
+               compatible = "usb-a-connector";
+               vbus-supply = <&vbus_sw>;
+       };
+};
+
+&usbphyc_port1 {
+       phy-supply = <&vdd_usb>;
+};
index 7517231..9937b28 100644 (file)
        };
 };
 
+&vdd {
+       regulator-min-microvolt = <2900000>;
+       regulator-max-microvolt = <2900000>;
+};
+
 &pwr_regulators {
        vdd-supply = <&vdd_io>;
 };
index 6336c3c..134a798 100644 (file)
 
                        vdd: buck3 {
                                regulator-name = "vdd";
-                               regulator-min-microvolt = <2900000>;
-                               regulator-max-microvolt = <2900000>;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
                                regulator-always-on;
                                regulator-initial-mode = <0>;
                                regulator-over-current-protection;
index 6706d83..935b708 100644 (file)
                        no-map;
                };
        };
-
-       reg_sip_eeprom: regulator_eeprom {
-               compatible = "regulator-fixed";
-               regulator-name = "sip_eeprom";
-               regulator-always-on;
-       };
 };
 
 &i2c4 {
@@ -78,6 +72,7 @@
                        compatible = "st,stpmic1-regulators";
 
                        ldo1-supply = <&v3v3>;
+                       ldo3-supply = <&vdd_ddr>;
                        ldo6-supply = <&v3v3>;
                        pwr_sw1-supply = <&bst_out>;
 
 
        sip_eeprom: eeprom@50 {
                compatible = "atmel,24c32";
-               vcc-supply = <&reg_sip_eeprom>;
+               vcc-supply = <&vdd>;
                reg = <0x50>;
        };
 };
index 0a562b2..62e7aa5 100644 (file)
@@ -63,7 +63,7 @@
                compatible = "gpio-keys-polled";
                poll-interval = <20>;
 
-               left-joystick-left {
+               event-left-joystick-left {
                        label = "Left Joystick Left";
                        linux,code = <ABS_X>;
                        linux,input-type = <EV_ABS>;
@@ -71,7 +71,7 @@
                        gpios = <&pio 0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA6 */
                };
 
-               left-joystick-right {
+               event-left-joystick-right {
                        label = "Left Joystick Right";
                        linux,code = <ABS_X>;
                        linux,input-type = <EV_ABS>;
@@ -79,7 +79,7 @@
                        gpios = <&pio 0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA5 */
                };
 
-               left-joystick-up {
+               event-left-joystick-up {
                        label = "Left Joystick Up";
                        linux,code = <ABS_Y>;
                        linux,input-type = <EV_ABS>;
@@ -87,7 +87,7 @@
                        gpios = <&pio 0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA8 */
                };
 
-               left-joystick-down {
+               event-left-joystick-down {
                        label = "Left Joystick Down";
                        linux,code = <ABS_Y>;
                        linux,input-type = <EV_ABS>;
@@ -95,7 +95,7 @@
                        gpios = <&pio 0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA9 */
                };
 
-               right-joystick-left {
+               event-right-joystick-left {
                        label = "Right Joystick Left";
                        linux,code = <ABS_Z>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA1 */
                };
 
-               right-joystick-right {
+               event-right-joystick-right {
                        label = "Right Joystick Right";
                        linux,code = <ABS_Z>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA0 */
                };
 
-               right-joystick-up {
+               event-right-joystick-up {
                        label = "Right Joystick Up";
                        linux,code = <ABS_RZ>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA3 */
                };
 
-               right-joystick-down {
+               event-right-joystick-down {
                        label = "Right Joystick Down";
                        linux,code = <ABS_RZ>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA4 */
                };
 
-               dpad-left {
+               event-dpad-left {
                        label = "DPad Left";
                        linux,code = <ABS_HAT0X>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 7 23 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH23 */
                };
 
-               dpad-right {
+               event-dpad-right {
                        label = "DPad Right";
                        linux,code = <ABS_HAT0X>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 7 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH24 */
                };
 
-               dpad-up {
+               event-dpad-up {
                        label = "DPad Up";
                        linux,code = <ABS_HAT0Y>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 7 25 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH25 */
                };
 
-               dpad-down {
+               event-dpad-down {
                        label = "DPad Down";
                        linux,code = <ABS_HAT0Y>;
                        linux,input-type = <EV_ABS>;
                        gpios = <&pio 7 26 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH26 */
                };
 
-               x {
+               event-x {
                        label = "Button X";
                        linux,code = <BTN_X>;
                        gpios = <&pio 0 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA16 */
                };
 
-               y {
+               event-y {
                        label = "Button Y";
                        linux,code = <BTN_Y>;
                        gpios = <&pio 0 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA14 */
                };
 
-               a {
+               event-a {
                        label = "Button A";
                        linux,code = <BTN_A>;
                        gpios = <&pio 0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA17 */
                };
 
-               b {
+               event-b {
                        label = "Button B";
                        linux,code = <BTN_B>;
                        gpios = <&pio 0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA15 */
                };
 
-               select {
+               event-select {
                        label = "Select Button";
                        linux,code = <BTN_SELECT>;
                        gpios = <&pio 0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA11 */
                };
 
-               start {
+               event-start {
                        label = "Start Button";
                        linux,code = <BTN_START>;
                        gpios = <&pio 0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA12 */
                };
 
-               top-left {
+               event-top-left {
                        label = "Top Left Button";
                        linux,code = <BTN_TL>;
                        gpios = <&pio 7 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH22 */
                };
 
-               top-right {
+               event-top-right {
                        label = "Top Right Button";
                        linux,code = <BTN_TR>;
                        gpios = <&pio 0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA13 */
index 1ac8237..a332d61 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               back {
+               key-back {
                        label = "Key Back";
                        linux,code = <KEY_BACK>;
                        gpios = <&pio 7 17 GPIO_ACTIVE_LOW>;
                };
 
-               home {
+               key-home {
                        label = "Key Home";
                        linux,code = <KEY_HOME>;
                        gpios = <&pio 7 18 GPIO_ACTIVE_LOW>;
                };
 
-               menu {
+               key-menu {
                        label = "Key Menu";
                        linux,code = <KEY_MENU>;
                        gpios = <&pio 7 19 GPIO_ACTIVE_LOW>;
index 2ce361f..3a6c4bd 100644 (file)
                compatible = "gpio-leds";
 
                led-0 {
-                       label ="licheepi:red:usr";
+                       label = "licheepi:red:usr";
                        gpios = <&pio 2 5 GPIO_ACTIVE_LOW>;
                };
 
                led-1 {
-                       label ="licheepi:green:usr";
+                       label = "licheepi:green:usr";
                        gpios = <&pio 2 19 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                };
 
                led-2 {
-                       label ="licheepi:blue:usr";
+                       label = "licheepi:blue:usr";
                        gpios = <&pio 2 4 GPIO_ACTIVE_LOW>;
                };
 
index 715d748..70e634b 100644 (file)
@@ -46,6 +46,7 @@
 #include <dt-bindings/thermal/thermal.h>
 
 #include <dt-bindings/clock/sun6i-a31-ccu.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/reset/sun6i-a31-ccu.h>
 
 / {
                ccu: clock@1c20000 {
                        compatible = "allwinner,sun6i-a31-ccu";
                        reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                                     <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_APB1_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_APB1_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        interrupt-controller;
                        ar100: ar100_clk {
                                compatible = "allwinner,sun6i-a31-ar100-clk";
                                #clock-cells = <0>;
-                               clocks = <&rtc 0>, <&osc24M>,
+                               clocks = <&rtc CLK_OSC32K>, <&osc24M>,
                                         <&ccu CLK_PLL_PERIPH>,
                                         <&ccu CLK_PLL_PERIPH>;
                                clock-output-names = "ar100";
                        ir_clk: ir_clk {
                                #clock-cells = <0>;
                                compatible = "allwinner,sun4i-a10-mod0-clk";
-                               clocks = <&rtc 0>, <&osc24M>;
+                               clocks = <&rtc CLK_OSC32K>, <&osc24M>;
                                clock-output-names = "ir";
                        };
 
                        interrupt-parent = <&r_intc>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb0_gates 0>, <&osc24M>, <&rtc 0>;
+                       clocks = <&apb0_gates 0>, <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        resets = <&apb0_rst 0>;
                        gpio-controller;
index 4f8d55d..928b86a 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               back {
+               key-back {
                        label = "Key Back";
                        linux,code = <KEY_BACK>;
                        gpios = <&pio 7 17 GPIO_ACTIVE_LOW>;
                };
 
-               home {
+               key-home {
                        label = "Key Home";
                        linux,code = <KEY_HOME>;
                        gpios = <&pio 7 18 GPIO_ACTIVE_LOW>;
                };
 
-               menu {
+               key-menu {
                        label = "Key Menu";
                        linux,code = <KEY_MENU>;
                        gpios = <&pio 7 19 GPIO_ACTIVE_LOW>;
index 4461d50..1a262a0 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/clock/sun8i-a23-a33-ccu.h>
 #include <dt-bindings/reset/sun8i-a23-a33-ccu.h>
 
 
                ccu: clock@1c20000 {
                        reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x01c20800 0x400>;
                        interrupt-parent = <&r_intc>;
                        /* interrupts get set in SoC specific dtsi file */
-                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        interrupt-controller;
                        reg = <0x01f02c00 0x400>;
                        interrupt-parent = <&r_intc>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb0_gates 0>, <&osc24M>, <&rtc 0>;
+                       clocks = <&apb0_gates 0>, <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        resets = <&apb0_rst 0>;
                        gpio-controller;
index d5c7b79..d729b7c 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               switch-4 {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
        bluetooth {
                compatible = "brcm,bcm43438-bt";
                max-speed = <1500000>;
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_vcc3v3>;
                vddio-supply = <&reg_vcc3v3>;
index cd9f655..27a0d51 100644 (file)
                };
        };
 
-       r-gpio-keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
index ff0a7a9..f5c8ccc 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; /* PL3 */
                };
 
-               user {
+               key-user {
                        label = "user";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>;
index 8e7dfcf..43641cb 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               k1 {
+               key-0 {
                        label = "k1";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; /* PL3 */
@@ -90,7 +90,7 @@
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_vcc3v3>;
                vddio-supply = <&reg_vcc3v3>;
index cd3df12..9e1a33f 100644 (file)
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_vcc3v3>;
                vddio-supply = <&reg_vcc3v3>;
index 26e2e61..42cd113 100644 (file)
@@ -46,7 +46,7 @@
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_vcc3v3>;
                vddio-supply = <&reg_vcc3v3>;
index a9f749f..cf8413f 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               k1 {
+               key-0 {
                        label = "k1";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index 9daffd9..f1f9dbe 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw2 {
+               switch-2 {
                        label = "sw2";
                        linux,code = <BTN_1>;
                        gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>;
                };
 
-               sw4 {
+               switch-4 {
                        label = "sw4";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index 6f9c97a..305b34a 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               switch-4 {
                        label = "sw4";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index 4759ba3..59f6f6d 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               switch-4 {
                        label = "sw4";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index 90f75fa..b96e015 100644 (file)
                };
        };
 
-       r_gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               switch-4 {
                        label = "sw4";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index bf5b5e2..bc39468 100644 (file)
@@ -91,7 +91,7 @@
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_dldo1>;
                vddio-supply = <&reg_aldo3>;
index a6a1087..28197bb 100644 (file)
@@ -43,6 +43,7 @@
 
 /dts-v1/;
 #include "sun8i-r40.dtsi"
+#include "sun8i-r40-cpu-opp.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi b/arch/arm/boot/dts/sun8i-r40-cpu-opp.dtsi
new file mode 100644 (file)
index 0000000..649928b
--- /dev/null
@@ -0,0 +1,52 @@
+/{
+       cpu0_opp_table: opp-table-cpu {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-720000000 {
+                       opp-hz = /bits/ 64 <720000000>;
+                       opp-microvolt = <1000000 1000000 1300000>;
+                       clock-latency-ns = <2000000>;
+               };
+
+               opp-912000000 {
+                       opp-hz = /bits/ 64 <912000000>;
+                       opp-microvolt = <1100000 1100000 1300000>;
+                       clock-latency-ns = <2000000>;
+               };
+
+               opp-1008000000 {
+                       opp-hz = /bits/ 64 <1008000000>;
+                       opp-microvolt = <1160000 1160000 1300000>;
+                       clock-latency-ns = <2000000>;
+               };
+
+               opp-1104000000 {
+                       opp-hz = /bits/ 64 <1104000000>;
+                       opp-microvolt = <1240000 1240000 1300000>;
+                       clock-latency-ns = <2000000>;
+               };
+
+               opp-1200000000 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <1300000 1300000 1300000>;
+                       clock-latency-ns = <2000000>;
+               };
+       };
+};
+
+&cpu0 {
+       operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu1 {
+       operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu2 {
+       operating-points-v2 = <&cpu0_opp_table>;
+};
+
+&cpu3 {
+       operating-points-v2 = <&cpu0_opp_table>;
+};
index 265e0fa..9f39b5a 100644 (file)
@@ -5,6 +5,11 @@
 //  Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
 
 #include "sun8i-r40.dtsi"
+#include "sun8i-r40-cpu-opp.dtsi"
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
 
 &i2c0 {
        status = "okay";
index 03d3e5f..4ef26d8 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r40-ccu.h>
 #include <dt-bindings/clock/sun8i-tcon-top.h>
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <0>;
+                       clocks = <&ccu CLK_CPU>;
+                       clock-names = "cpu";
+                       #cooling-cells = <2>;
                };
 
                cpu1: cpu@1 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <1>;
+                       clocks = <&ccu CLK_CPU>;
+                       clock-names = "cpu";
+                       #cooling-cells = <2>;
                };
 
                cpu2: cpu@2 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <2>;
+                       clocks = <&ccu CLK_CPU>;
+                       clock-names = "cpu";
+                       #cooling-cells = <2>;
                };
 
                cpu3: cpu@3 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <3>;
+                       clocks = <&ccu CLK_CPU>;
+                       clock-names = "cpu";
+                       #cooling-cells = <2>;
                };
        };
 
                        polling-delay-passive = <0>;
                        polling-delay = <0>;
                        thermal-sensors = <&ths 0>;
+
+                       trips {
+                               cpu_hot_trip: cpu-hot {
+                                       temperature = <80000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+
+                               cpu_very_hot_trip: cpu-very-hot {
+                                       temperature = <115000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               cpu-hot-limit {
+                                       trip = <&cpu_hot_trip>;
+                                       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>;
+                               };
+                       };
                };
 
                gpu_thermal: gpu-thermal {
                ccu: clock@1c20000 {
                        compatible = "allwinner,sun8i-r40-ccu";
                        reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        compatible = "allwinner,sun8i-r40-pinctrl";
                        reg = <0x01c20800 0x400>;
                        interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        interrupt-controller;
                        reg-io-width = <1>;
                        interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ccu CLK_BUS_HDMI0>, <&ccu CLK_HDMI_SLOW>,
-                                <&ccu CLK_HDMI>, <&rtc 0>;
+                                <&ccu CLK_HDMI>, <&rtc CLK_OSC32K>;
                        clock-names = "iahb", "isfr", "tmds", "cec";
                        resets = <&ccu RST_BUS_HDMI1>;
                        reset-names = "ctrl";
index 6931aaa..9f47252 100644 (file)
@@ -45,6 +45,7 @@
 
 /dts-v1/;
 #include "sun8i-r40.dtsi"
+#include "sun8i-r40-cpu-opp.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
        status = "okay";
 };
index 084323d..db194c6 100644 (file)
@@ -42,6 +42,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/clock/sun8i-v3s-ccu.h>
 #include <dt-bindings/reset/sun8i-v3s-ccu.h>
 #include <dt-bindings/clock/sun8i-de2.h>
                ccu: clock@1c20000 {
                        compatible = "allwinner,sun8i-v3s-ccu";
                        reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        reg = <0x01c20800 0x400>;
                        interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
index 4795455..4348710 100644 (file)
@@ -42,6 +42,7 @@
 
 /dts-v1/;
 #include "sun8i-r40.dtsi"
+#include "sun8i-r40-cpu-opp.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 
        status = "okay";
 };
 
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
 &de {
        status = "okay";
 };
index d03f585..e899d14 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               switch-4 {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
        bluetooth {
                compatible = "brcm,bcm43438-bt";
                max-speed = <1500000>;
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_vcc3v3>;
                vddio-supply = <&reg_vcc3v3>;
index fc67e30..60804b0 100644 (file)
@@ -22,7 +22,7 @@
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */
                post-power-on-delay-ms = <200>;
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_vcc3v3>;
                vddio-supply = <&reg_vcc3v3>;
index d7e9f97..09aefb4 100644 (file)
@@ -40,6 +40,7 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-h3-ccu.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
                ccu: clock@1c20000 {
                        /* compatible is in per SoC .dtsi file */
                        reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        interrupt-parent = <&r_intc>;
                        interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
                        reg-io-width = <1>;
                        interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
-                                <&ccu CLK_HDMI>, <&rtc 0>;
+                                <&ccu CLK_HDMI>, <&rtc CLK_OSC32K>;
                        clock-names = "iahb", "isfr", "tmds", "cec";
                        resets = <&ccu RST_BUS_HDMI1>;
                        reset-names = "ctrl";
                r_ccu: clock@1f01400 {
                        compatible = "allwinner,sun8i-h3-r-ccu";
                        reg = <0x01f01400 0x100>;
-                       clocks = <&osc24M>, <&rtc 0>, <&rtc 2>,
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>,
                                 <&ccu CLK_PLL_PERIPH0>;
                        clock-names = "hosc", "losc", "iosc", "pll-periph";
                        #clock-cells = <1>;
                        reg = <0x01f02c00 0x400>;
                        interrupt-parent = <&r_intc>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&r_ccu CLK_APB0_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&r_ccu CLK_APB0_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
index 9e14fe5..89731bb 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
index b791ce9..284209b 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_default>;
 
-               power {
+               button-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        debounce-interval = <10>;
                };
 
-               volume-down {
+               button-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_hall_sensor_default>;
 
-               hall-sensor {
+               switch-hall-sensor {
                        label = "Hall Effect Sensor";
                        gpios = <&gpio TEGRA_GPIO(O, 5) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
index 658edfb..fffd62b 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume_down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               volume_up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 2498cf1..b9d0000 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               back {
+               key-back {
                        label = "Back";
                        gpios = <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BACK>;
                };
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index ef8f722..f02d8c7 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume_down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               volume_up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 3209554..bce12b3 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "WAKE1_MICO";
                        gpios = <&gpio TEGRA_GPIO(DD, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index 814257c..800283a 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "WAKE1_MICO";
                        gpios = <&gpio TEGRA_GPIO(DD, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index 28b889e..f41dd40 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index a93cfb4..13061ab 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               lid {
+               switch-lid {
                        label = "Lid";
                        gpios = <&gpio TEGRA_GPIO(R, 4) GPIO_ACTIVE_LOW>;
                        linux,input-type = <5>;
                        wakeup-source;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 6a9592c..8f40fcf 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index a170a4b..dac6d02 100644 (file)
                        vddio-supply = <&vdd_1v8_sys>;
 
                        device-wakeup-gpios = <&gpio TEGRA_GPIO(U, 1) GPIO_ACTIVE_HIGH>;
-                       shutdown-gpios =      <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
+                       shutdown-gpios = <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
                };
        };
 
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(I, 3) GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               rotation-lock {
+               key-rotation-lock {
                        label = "Rotate-lock";
                        gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_HIGH>;
                        linux,code = <SW_ROTATE_LOCK>;
                        debounce-interval = <10>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        wakeup-source;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index a054d39..bf797a1 100644 (file)
                        vddio-supply = <&vdd_1v8_sys>;
 
                        device-wakeup-gpios = <&gpio TEGRA_GPIO(U, 1) GPIO_ACTIVE_HIGH>;
-                       shutdown-gpios =      <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
+                       shutdown-gpios = <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
                };
        };
 
        gpio-keys {
                compatible = "gpio-keys";
 
-               dock-hall-sensor {
+               switch-dock-hall-sensor {
                        label = "Lid";
                        gpios = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                        wakeup-source;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        wakeup-source;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Q, 4) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index d2a3bf9..cb1190b 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "SODIMM pin 45 wakeup";
                        gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_WAKEUP>;
index 00ecbbd..53487cc 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "SODIMM pin 45 wakeup";
                        gpios = <&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_WAKEUP>;
index 79b6b79..11f21ae 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 0fb4b1f..48fe628 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "Wakeup";
                        gpios = <&gpio TEGRA_GPIO(J, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index c4a6a6a..5b4c5ef 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               lid {
+               switch-lid {
                        label = "Lid";
                        gpios = <&gpio TEGRA_GPIO(C, 7) GPIO_ACTIVE_HIGH>;
                        linux,input-type = <5>; /* EV_SW */
index 9d0c867..dc51835 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(X, 6) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index b0a0097..caa17e8 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 93b83b3..ad968ff 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "WAKE1_MICO";
                        gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index fbfa75e..c172fdb 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "WAKE1_MICO";
                        gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index 2c2ad2a..ee683c5 100644 (file)
@@ -63,7 +63,7 @@
        gpio@6000d000 {
                init-mode-hog {
                        gpio-hog;
-                       gpios = <TEGRA_GPIO(DD, 7) GPIO_ACTIVE_HIGH>,
+                       gpios = <TEGRA_GPIO(DD, 7) GPIO_ACTIVE_HIGH>,
                                <TEGRA_GPIO(CC, 6) GPIO_ACTIVE_HIGH>,
                                <TEGRA_GPIO(R, 0) GPIO_ACTIVE_HIGH>;
                        output-low;
                        vddio-supply = <&vdd_1v8>;
 
                        device-wakeup-gpios = <&gpio TEGRA_GPIO(U, 1) GPIO_ACTIVE_HIGH>;
-                       shutdown-gpios =      <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
+                       shutdown-gpios = <&gpio TEGRA_GPIO(U, 0) GPIO_ACTIVE_HIGH>;
                };
        };
 
                status = "okay";
 
                touchscreen@10 {
-                       compatible ="elan,ektf3624";
+                       compatible = "elan,ektf3624";
                        reg = <0x10>;
 
                        interrupt-parent = <&gpio>;
        gpio-keys {
                compatible = "gpio-keys";
 
-               hall-sensor {
+               switch-hall-sensor {
                        label = "Lid";
                        gpios = <&gpio TEGRA_GPIO(S, 6) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                        wakeup-source;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        wakeup-source;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Q, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index cd63e0e..1b241f0 100644 (file)
@@ -25,7 +25,7 @@
        gpio@6000d000 {
                init-mode-3g-hog {
                        gpio-hog;
-                       gpios = <TEGRA_GPIO(D, 2) GPIO_ACTIVE_HIGH>,
+                       gpios = <TEGRA_GPIO(D, 2) GPIO_ACTIVE_HIGH>,
                                <TEGRA_GPIO(C, 6) GPIO_ACTIVE_HIGH>,
                                <TEGRA_GPIO(W, 3) GPIO_ACTIVE_HIGH>,
                                <TEGRA_GPIO(P, 1) GPIO_ACTIVE_HIGH>,
index c662ab2..c27e70d 100644 (file)
                compatible = "gpio-keys";
                interrupt-parent = <&gpio>;
 
-               dock-hall-sensor {
+               switch-dock-hall-sensor {
                        label = "Lid sensor";
                        gpios = <&gpio TEGRA_GPIO(S, 6) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                        wakeup-source;
                };
 
-               lineout-detect {
+               switch-lineout-detect {
                        label = "Audio dock line-out detect";
                        gpios = <&gpio TEGRA_GPIO(X, 3) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                compatible = "gpio-keys";
                interrupt-parent = <&gpio>;
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(Q, 2) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        wakeup-source;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Q, 3) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index ba257ed..540530c 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        interrupt-parent = <&pmic>;
                        interrupts = <2 0>;
                        wakeup-source;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(R, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                        debounce-interval = <10>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 7d4a6ca..8dbc15f 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "SODIMM pin 45 wakeup";
                        gpios = <&gpio TEGRA_GPIO(V, 1) GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_WAKEUP>;
index 22231d4..310dff0 100644 (file)
                                nvidia,enable-input = <TEGRA_PIN_ENABLE>;
                        };
                        spdif-in-pk6 {
-                               nvidia,pins =   "spdif_in_pk6";
+                               nvidia,pins = "spdif_in_pk6";
                                nvidia,function = "hda";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
                        };
                        /* Multiplexed and therefore disabled */
                        cam-mclk-pcc0 {
-                               nvidia,pins =   "cam_mclk_pcc0";
+                               nvidia,pins = "cam_mclk_pcc0";
                                nvidia,function = "vi_alt3";
                                nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
                                nvidia,tristate = <TEGRA_PIN_ENABLE>;
 
                        /* Colibri USBC_DET */
                        spdif-out-pk5 {
-                               nvidia,pins =   "spdif_out_pk5";
+                               nvidia,pins = "spdif_out_pk5";
                                nvidia,function = "rsvd2";
                                nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                                nvidia,tristate = <TEGRA_PIN_DISABLE>;
index e58dda4..b7acea3 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        gpios = <&gpio TEGRA_GPIO(V, 0) GPIO_ACTIVE_LOW>;
                        debounce-interval = <10>;
                        linux,code = <KEY_POWER>;
index 8ce6103..7c81f02 100644 (file)
                compatible = "gpio-keys";
                interrupt-parent = <&gpio>;
 
-               dock-insert {
+               switch-dock-insert {
                        label = "Chagall Dock";
                        gpios = <&gpio TEGRA_GPIO(S, 4) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                        wakeup-source;
                };
 
-               lineout-detect {
+               switch-lineout-detect {
                        label = "Audio dock line-out detect";
                        gpios = <&gpio TEGRA_GPIO(S, 3) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                compatible = "gpio-keys";
                interrupt-parent = <&gpio>;
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(V, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        wakeup-source;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Q, 1) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index cf70aff..d23201b 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               sw14 {
+               switch-14 {
                        label = "sw14";
                        gpios = <&gpio0 12 0>;
                        linux,code = <108>; /* down */
                        wakeup-source;
                        autorepeat;
                };
-               sw13 {
+               switch-13 {
                        label = "sw13";
                        gpios = <&gpio0 14 0>;
                        linux,code = <103>; /* up */
index bf5d1c4..dfb1fba 100644 (file)
@@ -49,7 +49,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               K1 {
+               key {
                        label = "K1";
                        gpios = <&gpio0 0x32 0x1>;
                        linux,code = <0x66>;
diff --git a/arch/arm/include/asm/xen/xen-ops.h b/arch/arm/include/asm/xen/xen-ops.h
new file mode 100644 (file)
index 0000000..7ebb7eb
--- /dev/null
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <xen/arm/xen-ops.h>
index 512943e..2e20362 100644 (file)
@@ -39,6 +39,7 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle)
                return -ENOENT;
 
        syscon = of_iomap(syscon_np, 0);
+       of_node_put(syscon_np);
        if (!syscon)
                return -ENOMEM;
 
index e4f4b20..3fc4ec8 100644 (file)
@@ -372,6 +372,7 @@ static void __init cns3xxx_init(void)
                /* De-Asscer SATA Reset */
                cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
        }
+       of_node_put(dn);
 
        dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
        if (of_device_is_available(dn)) {
@@ -385,6 +386,7 @@ static void __init cns3xxx_init(void)
                cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
                cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
        }
+       of_node_put(dn);
 
        pm_power_off = cns3xxx_power_off;
 
index 8b48326..51a247c 100644 (file)
@@ -149,6 +149,7 @@ static void exynos_map_pmu(void)
        np = of_find_matching_node(NULL, exynos_dt_pmu_match);
        if (np)
                pmu_base_addr = of_iomap(np, 0);
+       of_node_put(np);
 }
 
 static void __init exynos_init_irq(void)
index d1fdb60..c7c17c0 100644 (file)
@@ -218,13 +218,13 @@ void __init spear_setup_of_timer(void)
        irq = irq_of_parse_and_map(np, 0);
        if (!irq) {
                pr_err("%s: No irq passed for timer via DT\n", __func__);
-               return;
+               goto err_put_np;
        }
 
        gpt_base = of_iomap(np, 0);
        if (!gpt_base) {
                pr_err("%s: of iomap failed\n", __func__);
-               return;
+               goto err_put_np;
        }
 
        gpt_clk = clk_get_sys("gpt0", NULL);
@@ -239,6 +239,8 @@ void __init spear_setup_of_timer(void)
                goto err_prepare_enable_clk;
        }
 
+       of_node_put(np);
+
        spear_clockevent_init(irq);
        spear_clocksource_init();
 
@@ -248,4 +250,6 @@ err_prepare_enable_clk:
        clk_put(gpt_clk);
 err_iomap:
        iounmap(gpt_base);
+err_put_np:
+       of_node_put(np);
 }
index 82ffac6..059cce0 100644 (file)
@@ -33,7 +33,7 @@
 #include <asm/dma-iommu.h>
 #include <asm/mach/map.h>
 #include <asm/system_info.h>
-#include <xen/swiotlb-xen.h>
+#include <asm/xen/xen-ops.h>
 
 #include "dma.h"
 #include "mm.h"
@@ -2287,10 +2287,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
 
        set_dma_ops(dev, dma_ops);
 
-#ifdef CONFIG_XEN
-       if (xen_initial_domain())
-               dev->dma_ops = &xen_swiotlb_dma_ops;
-#endif
+       xen_setup_dma_ops(dev);
        dev->archdata.dma_ops_setup = true;
 }
 
index 07eb69f..1f9c3ba 100644 (file)
@@ -443,6 +443,8 @@ static int __init xen_guest_init(void)
        if (!xen_domain())
                return 0;
 
+       xen_set_restricted_virtio_memory_access();
+
        if (!acpi_disabled)
                xen_acpi_guest_init();
        else
index 4e6d635..1a8510a 100644 (file)
@@ -49,6 +49,7 @@ config ARCH_BCM2835
 
 config ARCH_BCM4908
        bool "Broadcom BCM4908 family"
+       select ARCH_BCMBCA
        select GPIOLIB
        help
          This enables support for the Broadcom BCM4906, BCM4908 and
@@ -63,6 +64,15 @@ config ARCH_BCM_IPROC
        help
          This enables support for Broadcom iProc based SoCs
 
+config ARCH_BCMBCA
+       bool "Broadcom Broadband Carrier Access (BCA) origin SoC"
+       help
+         Say Y if you intend to run the kernel on a Broadcom Broadband ARM-based
+         BCA chipset.
+
+         This enables support for Broadcom BCA ARM-based broadband chipsets,
+         including the DSL, PON and Wireless family of chips.
+
 config ARCH_BERLIN
        bool "Marvell Berlin SoC Family"
        select DW_APB_ICTL
@@ -182,11 +192,13 @@ config ARCH_MVEBU
        select PINCTRL_ARMADA_37XX
        select PINCTRL_ARMADA_AP806
        select PINCTRL_ARMADA_CP110
+       select PINCTRL_AC5
        help
          This enables support for Marvell EBU familly, including:
           - Armada 3700 SoC Family
           - Armada 7K SoC Family
           - Armada 8K SoC Family
+          - 98DX2530 SoC Family
 
 config ARCH_MXC
        bool "ARMv8 based NXP i.MX SoC family"
@@ -248,7 +260,8 @@ config ARCH_INTEL_SOCFPGA
        bool "Intel's SoCFPGA ARMv8 Families"
        help
          This enables support for Intel's SoCFPGA ARMv8 families:
-         Stratix 10 (ex. Altera), Agilex and eASIC N5X.
+         Stratix 10 (ex. Altera), Stratix10 Software Virtual Platform,
+         Agilex and eASIC N5X.
 
 config ARCH_SYNQUACER
        bool "Socionext SynQuacer SoC Family"
index 8fa5c06..6a96494 100644 (file)
@@ -38,3 +38,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6-mini.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb
index f6d7d7f..548539c 100644 (file)
 
                i2c0: i2c@5002000 {
                        compatible = "allwinner,sun50i-a100-i2c",
+                                    "allwinner,sun8i-v536-i2c",
                                     "allwinner,sun6i-a31-i2c";
                        reg = <0x05002000 0x400>;
                        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
 
                i2c1: i2c@5002400 {
                        compatible = "allwinner,sun50i-a100-i2c",
+                                    "allwinner,sun8i-v536-i2c",
                                     "allwinner,sun6i-a31-i2c";
                        reg = <0x05002400 0x400>;
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
 
                i2c2: i2c@5002800 {
                        compatible = "allwinner,sun50i-a100-i2c",
+                                    "allwinner,sun8i-v536-i2c",
                                     "allwinner,sun6i-a31-i2c";
                        reg = <0x05002800 0x400>;
                        interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
 
                i2c3: i2c@5002c00 {
                        compatible = "allwinner,sun50i-a100-i2c",
+                                    "allwinner,sun8i-v536-i2c",
                                     "allwinner,sun6i-a31-i2c";
                        reg = <0x05002c00 0x400>;
                        interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
 
                r_i2c0: i2c@7081400 {
                        compatible = "allwinner,sun50i-a100-i2c",
+                                    "allwinner,sun8i-v536-i2c",
                                     "allwinner,sun6i-a31-i2c";
                        reg = <0x07081400 0x400>;
                        interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
 
                r_i2c1: i2c@7081800 {
                        compatible = "allwinner,sun50i-a100-i2c",
+                                    "allwinner,sun8i-v536-i2c",
                                     "allwinner,sun6i-a31-i2c";
                        reg = <0x07081800 0x400>;
                        interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
index f17cc89..8233582 100644 (file)
@@ -58,7 +58,7 @@
 
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* WL-PMU-EN: PL2 */
        };
index 997a193..e6d5bc0 100644 (file)
@@ -56,7 +56,7 @@
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
 
        bluetooth {
                compatible = "brcm,bcm43438-bt";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_dldo2>;
                vddio-supply = <&reg_dldo4>;
index e47ff06..0af6dcd 100644 (file)
@@ -43,7 +43,7 @@
 
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
        };
index c519d9f..4f8529d 100644 (file)
@@ -40,7 +40,7 @@
        leds {
                compatible = "gpio-leds";
 
-               status {
+               led-0 {
                        label = "orangepi:green:status";
                        gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
                };
@@ -71,7 +71,7 @@
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
                reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
        };
 };
        bluetooth {
                compatible = "brcm,bcm43438-bt";
                max-speed = <1500000>;
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                vbat-supply = <&reg_dldo2>;
                vddio-supply = <&reg_dldo4>;
index 63571df..620cb3e 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               lid_switch {
+               lid-switch {
                        label = "Lid Switch";
                        gpios = <&r_pio 0 12 GPIO_ACTIVE_LOW>; /* PL12 */
                        linux,input-type = <EV_SW>;
index fb65319..219f720 100644 (file)
        compatible = "pine64,pinephone-1.0", "pine64,pinephone", "allwinner,sun50i-a64";
 };
 
+&codec_analog {
+       allwinner,internal-bias-resistor;
+};
+
 &sgm3140 {
        enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
        flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
index 5e59d37..723af64 100644 (file)
        default-brightness-level = <400>;
 };
 
+&codec_analog {
+       allwinner,internal-bias-resistor;
+};
+
 &sgm3140 {
        enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
        flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */
index de77c87..77b5349 100644 (file)
@@ -4,6 +4,7 @@
 //    Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com>
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
                ccu: clock@1c20000 {
                        compatible = "allwinner,sun50i-a64-ccu";
                        reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "hosc", "losc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
                        reg-io-width = <1>;
                        interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
-                                <&ccu CLK_HDMI>, <&rtc 0>;
+                                <&ccu CLK_HDMI>, <&rtc CLK_OSC32K>;
                        clock-names = "iahb", "isfr", "tmds", "cec";
                        resets = <&ccu RST_BUS_HDMI1>;
                        reset-names = "ctrl";
                r_ccu: clock@1f01400 {
                        compatible = "allwinner,sun50i-a64-r-ccu";
                        reg = <0x01f01400 0x100>;
-                       clocks = <&osc24M>, <&rtc 0>, <&rtc 2>,
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>,
                                 <&ccu CLK_PLL_PERIPH0>;
                        clock-names = "hosc", "losc", "iosc", "pll-periph";
                        #clock-cells = <1>;
index 55b3695..a3e040d 100644 (file)
                };
        };
 
-       r-gpio-keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               reset {
+               key-reset {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index 1010c1b..b5c1ff1 100644 (file)
                };
        };
 
-       r-gpio-keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               key-sw4 {
                        label = "sw4";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index 74e0444..d7f8bad 100644 (file)
                };
        };
 
-       r-gpio-keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               sw4 {
+               key-sw4 {
                        label = "sw4";
                        linux,code = <BTN_0>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
index c45d7b7..6fc65e8 100644 (file)
@@ -86,7 +86,7 @@
 
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */
                post-power-on-delay-ms = <200>;
 
        bluetooth {
                compatible = "brcm,bcm4345c5";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                device-wakeup-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */
                host-wakeup-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */
index e877085..fb31dcb 100644 (file)
@@ -13,7 +13,7 @@
 
        wifi_pwrseq: wifi_pwrseq {
                compatible = "mmc-pwrseq-simple";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */
                post-power-on-delay-ms = <200>;
@@ -64,7 +64,7 @@
 
        bluetooth {
                compatible = "brcm,bcm4345c5";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "lpo";
                device-wakeup-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */
                host-wakeup-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */
index edb71e4..4903d63 100644 (file)
@@ -78,7 +78,7 @@
 
        wifi_pwrseq: wifi-pwrseq {
                compatible = "mmc-pwrseq-simple";
-               clocks = <&rtc 1>;
+               clocks = <&rtc CLK_OSC32K_FANOUT>;
                clock-names = "ext_clock";
                reset-gpios = <&r_pio 1 3 GPIO_ACTIVE_LOW>; /* PM3 */
        };
index fbe94ab..5a28303 100644 (file)
@@ -4,6 +4,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/sun50i-h6-ccu.h>
 #include <dt-bindings/clock/sun50i-h6-r-ccu.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
 #include <dt-bindings/clock/sun8i-de2.h>
 #include <dt-bindings/clock/sun8i-tcon-top.h>
 #include <dt-bindings/reset/sun50i-h6-ccu.h>
                ccu: clock@3001000 {
                        compatible = "allwinner,sun50i-h6-ccu";
                        reg = <0x03001000 0x1000>;
-                       clocks = <&osc24M>, <&rtc 0>, <&rtc 2>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>;
                        clock-names = "hosc", "losc", "iosc";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                                     <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_APB1>, <&osc24M>, <&rtc 0>;
+                       clocks = <&ccu CLK_APB1>, <&osc24M>, <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
                        interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ccu CLK_BUS_XHCI>,
                                 <&ccu CLK_BUS_XHCI>,
-                                <&rtc 0>;
+                                <&rtc CLK_OSC32K>;
                        clock-names = "ref", "bus_early", "suspend";
                        resets = <&ccu RST_BUS_XHCI>;
                        /*
                r_ccu: clock@7010000 {
                        compatible = "allwinner,sun50i-h6-r-ccu";
                        reg = <0x07010000 0x400>;
-                       clocks = <&osc24M>, <&rtc 0>, <&rtc 2>,
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>,
                                 <&ccu CLK_PLL_PERIPH0>;
                        clock-names = "hosc", "losc", "iosc", "pll-periph";
                        #clock-cells = <1>;
                        interrupt-parent = <&r_intc>;
                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 111 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&r_ccu CLK_R_APB1>, <&osc24M>, <&rtc 0>;
+                       clocks = <&r_ccu CLK_R_APB1>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
new file mode 100644 (file)
index 0000000..02893f3
--- /dev/null
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2020 Arm Ltd.
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+       model = "OrangePi Zero2";
+       compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
+
+       aliases {
+               ethernet0 = &emac0;
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led-0 {
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_RED>;
+                       gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
+                       default-state = "on";
+               };
+
+               led-1 {
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
+               };
+       };
+
+       reg_vcc5v: vcc5v {
+               /* board wide 5V supply directly from the USB-C socket */
+               compatible = "regulator-fixed";
+               regulator-name = "vcc-5v";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+       };
+};
+
+&emac0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ext_rgmii_pins>;
+       phy-mode = "rgmii";
+       phy-handle = <&ext_rgmii_phy>;
+       phy-supply = <&reg_dcdce>;
+       allwinner,rx-delay-ps = <3100>;
+       allwinner,tx-delay-ps = <700>;
+       status = "okay";
+};
+
+&mdio0 {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
+&mmc0 {
+       vmmc-supply = <&reg_dcdce>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;  /* PF6 */
+       bus-width = <4>;
+       status = "okay";
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp305: pmic@745 {
+               compatible = "x-powers,axp305", "x-powers,axp805",
+                            "x-powers,axp806";
+               interrupt-controller;
+               #interrupt-cells = <1>;
+               reg = <0x745>;
+
+               x-powers,self-working-mode;
+               vina-supply = <&reg_vcc5v>;
+               vinb-supply = <&reg_vcc5v>;
+               vinc-supply = <&reg_vcc5v>;
+               vind-supply = <&reg_vcc5v>;
+               vine-supply = <&reg_vcc5v>;
+               aldoin-supply = <&reg_vcc5v>;
+               bldoin-supply = <&reg_vcc5v>;
+               cldoin-supply = <&reg_vcc5v>;
+
+               regulators {
+                       reg_aldo1: aldo1 {
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc-sys";
+                       };
+
+                       reg_aldo2: aldo2 {      /* 3.3V on headers */
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc3v3-ext";
+                       };
+
+                       reg_aldo3: aldo3 {      /* 3.3V on headers */
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc3v3-ext2";
+                       };
+
+                       reg_bldo1: bldo1 {
+                               regulator-always-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-name = "vcc1v8";
+                       };
+
+                       bldo2 {
+                               /* unused */
+                       };
+
+                       bldo3 {
+                               /* unused */
+                       };
+
+                       bldo4 {
+                               /* unused */
+                       };
+
+                       cldo1 {
+                               /* reserved */
+                       };
+
+                       cldo2 {
+                               /* unused */
+                       };
+
+                       cldo3 {
+                               /* unused */
+                       };
+
+                       reg_dcdca: dcdca {
+                               regulator-always-on;
+                               regulator-min-microvolt = <810000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-name = "vdd-cpu";
+                       };
+
+                       reg_dcdcc: dcdcc {
+                               regulator-always-on;
+                               regulator-min-microvolt = <810000>;
+                               regulator-max-microvolt = <990000>;
+                               regulator-name = "vdd-gpu-sys";
+                       };
+
+                       reg_dcdcd: dcdcd {
+                               regulator-always-on;
+                               regulator-min-microvolt = <1500000>;
+                               regulator-max-microvolt = <1500000>;
+                               regulator-name = "vdd-dram";
+                       };
+
+                       reg_dcdce: dcdce {
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc-eth-mmc";
+                       };
+
+                       sw {
+                               /* unused */
+                       };
+               };
+       };
+};
+
+&pio {
+       vcc-pc-supply = <&reg_aldo1>;
+       vcc-pf-supply = <&reg_aldo1>;
+       vcc-pg-supply = <&reg_bldo1>;
+       vcc-ph-supply = <&reg_aldo1>;
+       vcc-pi-supply = <&reg_aldo1>;
+};
+
+&spi0  {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>;
+
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <40000000>;
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_ph_pins>;
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts
new file mode 100644 (file)
index 0000000..6619db3
--- /dev/null
@@ -0,0 +1,177 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+/*
+ * Copyright (C) 2021 Arm Ltd.
+ */
+
+/dts-v1/;
+
+#include "sun50i-h616.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       model = "X96 Mate";
+       compatible = "hechuang,x96-mate", "allwinner,sun50i-h616";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       reg_vcc5v: vcc5v {
+               /* board wide 5V supply directly from the DC input */
+               compatible = "regulator-fixed";
+               regulator-name = "vcc-5v";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-always-on;
+       };
+};
+
+&ir {
+       status = "okay";
+};
+
+&mmc0 {
+       vmmc-supply = <&reg_dcdce>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;  /* PF6 */
+       bus-width = <4>;
+       status = "okay";
+};
+
+&mmc2 {
+       vmmc-supply = <&reg_dcdce>;
+       vqmmc-supply = <&reg_bldo1>;
+       bus-width = <8>;
+       non-removable;
+       cap-mmc-hw-reset;
+       mmc-ddr-1_8v;
+       mmc-hs200-1_8v;
+       status = "okay";
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp305: pmic@745 {
+               compatible = "x-powers,axp305", "x-powers,axp805",
+                            "x-powers,axp806";
+               interrupt-controller;
+               #interrupt-cells = <1>;
+               reg = <0x745>;
+
+               x-powers,self-working-mode;
+               vina-supply = <&reg_vcc5v>;
+               vinb-supply = <&reg_vcc5v>;
+               vinc-supply = <&reg_vcc5v>;
+               vind-supply = <&reg_vcc5v>;
+               vine-supply = <&reg_vcc5v>;
+               aldoin-supply = <&reg_vcc5v>;
+               bldoin-supply = <&reg_vcc5v>;
+               cldoin-supply = <&reg_vcc5v>;
+
+               regulators {
+                       reg_aldo1: aldo1 {
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc-sys";
+                       };
+
+                       /* Enabled by the Android BSP */
+                       reg_aldo2: aldo2 {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc3v3-ext";
+                               status = "disabled";
+                       };
+
+                       /* Enabled by the Android BSP */
+                       reg_aldo3: aldo3 {
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc3v3-ext2";
+                               status = "disabled";
+                       };
+
+                       reg_bldo1: bldo1 {
+                               regulator-always-on;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-name = "vcc1v8";
+                       };
+
+                       /* Enabled by the Android BSP */
+                       reg_bldo2: bldo2 {
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-name = "vcc1v8-2";
+                               status = "disabled";
+                       };
+
+                       bldo3 {
+                               /* unused */
+                       };
+
+                       bldo4 {
+                               /* unused */
+                       };
+
+                       cldo1 {
+                               regulator-min-microvolt = <2500000>;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-name = "vcc2v5";
+                       };
+
+                       cldo2 {
+                               /* unused */
+                       };
+
+                       cldo3 {
+                               /* unused */
+                       };
+
+                       reg_dcdca: dcdca {
+                               regulator-always-on;
+                               regulator-min-microvolt = <810000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-name = "vdd-cpu";
+                       };
+
+                       reg_dcdcc: dcdcc {
+                               regulator-always-on;
+                               regulator-min-microvolt = <810000>;
+                               regulator-max-microvolt = <990000>;
+                               regulator-name = "vdd-gpu-sys";
+                       };
+
+                       reg_dcdcd: dcdcd {
+                               regulator-always-on;
+                               regulator-min-microvolt = <1360000>;
+                               regulator-max-microvolt = <1360000>;
+                               regulator-name = "vdd-dram";
+                       };
+
+                       reg_dcdce: dcdce {
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc-eth-mmc";
+                       };
+
+                       sw {
+                               /* unused */
+                       };
+               };
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_ph_pins>;
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
new file mode 100644 (file)
index 0000000..622a1f7
--- /dev/null
@@ -0,0 +1,591 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Arm Ltd.
+// based on the H6 dtsi, which is:
+//   Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
+
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/sun50i-h616-ccu.h>
+#include <dt-bindings/clock/sun50i-h6-r-ccu.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
+#include <dt-bindings/reset/sun50i-h616-ccu.h>
+#include <dt-bindings/reset/sun50i-h6-r-ccu.h>
+
+/ {
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       reg = <0>;
+                       enable-method = "psci";
+                       clocks = <&ccu CLK_CPUX>;
+               };
+
+               cpu1: cpu@1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       reg = <1>;
+                       enable-method = "psci";
+                       clocks = <&ccu CLK_CPUX>;
+               };
+
+               cpu2: cpu@2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       reg = <2>;
+                       enable-method = "psci";
+                       clocks = <&ccu CLK_CPUX>;
+               };
+
+               cpu3: cpu@3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       reg = <3>;
+                       enable-method = "psci";
+                       clocks = <&ccu CLK_CPUX>;
+               };
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               /*
+                * 256 KiB reserved for Trusted Firmware-A (BL31).
+                * This is added by BL31 itself, but some bootloaders fail
+                * to propagate this into the DTB handed to kernels.
+                */
+               secmon@40000000 {
+                       reg = <0x0 0x40000000 0x0 0x40000>;
+                       no-map;
+               };
+       };
+
+       osc24M: osc24M-clk {
+               #clock-cells = <0>;
+               compatible = "fixed-clock";
+               clock-frequency = <24000000>;
+               clock-output-names = "osc24M";
+       };
+
+       pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               arm,no-tick-in-suspend;
+               interrupts = <GIC_PPI 13
+                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
+                            <GIC_PPI 14
+                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
+                            <GIC_PPI 11
+                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
+                            <GIC_PPI 10
+                       (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x0 0x40000000>;
+
+               syscon: syscon@3000000 {
+                       compatible = "allwinner,sun50i-h616-system-control";
+                       reg = <0x03000000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       sram_c: sram@28000 {
+                               compatible = "mmio-sram";
+                               reg = <0x00028000 0x30000>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges = <0 0x00028000 0x30000>;
+                       };
+               };
+
+               ccu: clock@3001000 {
+                       compatible = "allwinner,sun50i-h616-ccu";
+                       reg = <0x03001000 0x1000>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>;
+                       clock-names = "hosc", "losc", "iosc";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+               };
+
+               watchdog: watchdog@30090a0 {
+                       compatible = "allwinner,sun50i-h616-wdt",
+                                    "allwinner,sun6i-a31-wdt";
+                       reg = <0x030090a0 0x20>;
+                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&osc24M>;
+               };
+
+               pio: pinctrl@300b000 {
+                       compatible = "allwinner,sun50i-h616-pinctrl";
+                       reg = <0x0300b000 0x400>;
+                       interrupts = <GIC_SPI 51 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_APB1>, <&osc24M>, <&rtc CLK_OSC32K>;
+                       clock-names = "apb", "hosc", "losc";
+                       gpio-controller;
+                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+
+                       ext_rgmii_pins: rgmii-pins {
+                               pins = "PI0", "PI1", "PI2", "PI3", "PI4",
+                                      "PI5", "PI7", "PI8", "PI9", "PI10",
+                                      "PI11", "PI12", "PI13", "PI14", "PI15",
+                                      "PI16";
+                               function = "emac0";
+                               drive-strength = <40>;
+                       };
+
+                       i2c0_pins: i2c0-pins {
+                               pins = "PI6", "PI7";
+                               function = "i2c0";
+                       };
+
+                       i2c3_ph_pins: i2c3-ph-pins {
+                               pins = "PH4", "PH5";
+                               function = "i2c3";
+                       };
+
+                       ir_rx_pin: ir-rx-pin {
+                               pins = "PH10";
+                               function = "ir_rx";
+                       };
+
+                       mmc0_pins: mmc0-pins {
+                               pins = "PF0", "PF1", "PF2", "PF3",
+                                      "PF4", "PF5";
+                               function = "mmc0";
+                               drive-strength = <30>;
+                               bias-pull-up;
+                       };
+
+                       /omit-if-no-ref/
+                       mmc1_pins: mmc1-pins {
+                               pins = "PG0", "PG1", "PG2", "PG3",
+                                      "PG4", "PG5";
+                               function = "mmc1";
+                               drive-strength = <30>;
+                               bias-pull-up;
+                       };
+
+                       mmc2_pins: mmc2-pins {
+                               pins = "PC0", "PC1", "PC5", "PC6",
+                                      "PC8", "PC9", "PC10", "PC11",
+                                      "PC13", "PC14", "PC15", "PC16";
+                               function = "mmc2";
+                               drive-strength = <30>;
+                               bias-pull-up;
+                       };
+
+                       /omit-if-no-ref/
+                       spi0_pins: spi0-pins {
+                               pins = "PC0", "PC2", "PC4";
+                               function = "spi0";
+                       };
+
+                       /omit-if-no-ref/
+                       spi0_cs0_pin: spi0-cs0-pin {
+                               pins = "PC3";
+                               function = "spi0";
+                       };
+
+                       /omit-if-no-ref/
+                       spi1_pins: spi1-pins {
+                               pins = "PH6", "PH7", "PH8";
+                               function = "spi1";
+                       };
+
+                       /omit-if-no-ref/
+                       spi1_cs0_pin: spi1-cs0-pin {
+                               pins = "PH5";
+                               function = "spi1";
+                       };
+
+                       uart0_ph_pins: uart0-ph-pins {
+                               pins = "PH0", "PH1";
+                               function = "uart0";
+                       };
+
+                       /omit-if-no-ref/
+                       uart1_pins: uart1-pins {
+                               pins = "PG6", "PG7";
+                               function = "uart1";
+                       };
+
+                       /omit-if-no-ref/
+                       uart1_rts_cts_pins: uart1-rts-cts-pins {
+                               pins = "PG8", "PG9";
+                               function = "uart1";
+                       };
+               };
+
+               gic: interrupt-controller@3021000 {
+                       compatible = "arm,gic-400";
+                       reg = <0x03021000 0x1000>,
+                             <0x03022000 0x2000>,
+                             <0x03024000 0x2000>,
+                             <0x03026000 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+               };
+
+               mmc0: mmc@4020000 {
+                       compatible = "allwinner,sun50i-h616-mmc",
+                                    "allwinner,sun50i-a100-mmc";
+                       reg = <0x04020000 0x1000>;
+                       clocks = <&ccu CLK_BUS_MMC0>, <&ccu CLK_MMC0>;
+                       clock-names = "ahb", "mmc";
+                       resets = <&ccu RST_BUS_MMC0>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc0_pins>;
+                       status = "disabled";
+                       max-frequency = <150000000>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       mmc-ddr-3_3v;
+                       cap-sdio-irq;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc1: mmc@4021000 {
+                       compatible = "allwinner,sun50i-h616-mmc",
+                                    "allwinner,sun50i-a100-mmc";
+                       reg = <0x04021000 0x1000>;
+                       clocks = <&ccu CLK_BUS_MMC1>, <&ccu CLK_MMC1>;
+                       clock-names = "ahb", "mmc";
+                       resets = <&ccu RST_BUS_MMC1>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc1_pins>;
+                       status = "disabled";
+                       max-frequency = <150000000>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       mmc-ddr-3_3v;
+                       cap-sdio-irq;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc2: mmc@4022000 {
+                       compatible = "allwinner,sun50i-h616-emmc",
+                                    "allwinner,sun50i-a100-emmc";
+                       reg = <0x04022000 0x1000>;
+                       clocks = <&ccu CLK_BUS_MMC2>, <&ccu CLK_MMC2>;
+                       clock-names = "ahb", "mmc";
+                       resets = <&ccu RST_BUS_MMC2>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc2_pins>;
+                       status = "disabled";
+                       max-frequency = <150000000>;
+                       cap-sd-highspeed;
+                       cap-mmc-highspeed;
+                       mmc-ddr-3_3v;
+                       cap-sdio-irq;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               uart0: serial@5000000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x05000000 0x400>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART0>;
+                       resets = <&ccu RST_BUS_UART0>;
+                       status = "disabled";
+               };
+
+               uart1: serial@5000400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x05000400 0x400>;
+                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART1>;
+                       resets = <&ccu RST_BUS_UART1>;
+                       status = "disabled";
+               };
+
+               uart2: serial@5000800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x05000800 0x400>;
+                       interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART2>;
+                       resets = <&ccu RST_BUS_UART2>;
+                       status = "disabled";
+               };
+
+               uart3: serial@5000c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x05000c00 0x400>;
+                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART3>;
+                       resets = <&ccu RST_BUS_UART3>;
+                       status = "disabled";
+               };
+
+               uart4: serial@5001000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x05001000 0x400>;
+                       interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART4>;
+                       resets = <&ccu RST_BUS_UART4>;
+                       status = "disabled";
+               };
+
+               uart5: serial@5001400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x05001400 0x400>;
+                       interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART5>;
+                       resets = <&ccu RST_BUS_UART5>;
+                       status = "disabled";
+               };
+
+               i2c0: i2c@5002000 {
+                       compatible = "allwinner,sun50i-h616-i2c",
+                                    "allwinner,sun8i-v536-i2c",
+                                    "allwinner,sun6i-a31-i2c";
+                       reg = <0x05002000 0x400>;
+                       interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C0>;
+                       resets = <&ccu RST_BUS_I2C0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c0_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c1: i2c@5002400 {
+                       compatible = "allwinner,sun50i-h616-i2c",
+                                    "allwinner,sun8i-v536-i2c",
+                                    "allwinner,sun6i-a31-i2c";
+                       reg = <0x05002400 0x400>;
+                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C1>;
+                       resets = <&ccu RST_BUS_I2C1>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c2: i2c@5002800 {
+                       compatible = "allwinner,sun50i-h616-i2c",
+                                    "allwinner,sun8i-v536-i2c",
+                                    "allwinner,sun6i-a31-i2c";
+                       reg = <0x05002800 0x400>;
+                       interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C2>;
+                       resets = <&ccu RST_BUS_I2C2>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c3: i2c@5002c00 {
+                       compatible = "allwinner,sun50i-h616-i2c",
+                                    "allwinner,sun8i-v536-i2c",
+                                    "allwinner,sun6i-a31-i2c";
+                       reg = <0x05002c00 0x400>;
+                       interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C3>;
+                       resets = <&ccu RST_BUS_I2C3>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c4: i2c@5003000 {
+                       compatible = "allwinner,sun50i-h616-i2c",
+                                    "allwinner,sun8i-v536-i2c",
+                                    "allwinner,sun6i-a31-i2c";
+                       reg = <0x05003000 0x400>;
+                       interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C4>;
+                       resets = <&ccu RST_BUS_I2C4>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               spi0: spi@5010000 {
+                       compatible = "allwinner,sun50i-h616-spi",
+                                    "allwinner,sun8i-h3-spi";
+                       reg = <0x05010000 0x1000>;
+                       interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
+                       clock-names = "ahb", "mod";
+                       resets = <&ccu RST_BUS_SPI0>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               spi1: spi@5011000 {
+                       compatible = "allwinner,sun50i-h616-spi",
+                                    "allwinner,sun8i-h3-spi";
+                       reg = <0x05011000 0x1000>;
+                       interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
+                       clock-names = "ahb", "mod";
+                       resets = <&ccu RST_BUS_SPI1>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               emac0: ethernet@5020000 {
+                       compatible = "allwinner,sun50i-h616-emac0",
+                                    "allwinner,sun50i-a64-emac";
+                       reg = <0x05020000 0x10000>;
+                       interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "macirq";
+                       clocks = <&ccu CLK_BUS_EMAC0>;
+                       clock-names = "stmmaceth";
+                       resets = <&ccu RST_BUS_EMAC0>;
+                       reset-names = "stmmaceth";
+                       syscon = <&syscon>;
+                       status = "disabled";
+
+                       mdio0: mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
+               rtc: rtc@7000000 {
+                       compatible = "allwinner,sun50i-h616-rtc";
+                       reg = <0x07000000 0x400>;
+                       interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu CLK_R_APB1_RTC>, <&osc24M>,
+                                <&ccu CLK_PLL_SYSTEM_32K>;
+                       clock-names = "bus", "hosc",
+                                     "pll-32k";
+                       #clock-cells = <1>;
+               };
+
+               r_ccu: clock@7010000 {
+                       compatible = "allwinner,sun50i-h616-r-ccu";
+                       reg = <0x07010000 0x210>;
+                       clocks = <&osc24M>, <&rtc CLK_OSC32K>, <&rtc CLK_IOSC>,
+                                <&ccu CLK_PLL_PERIPH0>;
+                       clock-names = "hosc", "losc", "iosc", "pll-periph";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+               };
+
+               r_pio: pinctrl@7022000 {
+                       compatible = "allwinner,sun50i-h616-r-pinctrl";
+                       reg = <0x07022000 0x400>;
+                       clocks = <&r_ccu CLK_R_APB1>, <&osc24M>,
+                                <&rtc CLK_OSC32K>;
+                       clock-names = "apb", "hosc", "losc";
+                       gpio-controller;
+                       #gpio-cells = <3>;
+
+                       /omit-if-no-ref/
+                       r_i2c_pins: r-i2c-pins {
+                               pins = "PL0", "PL1";
+                               function = "s_i2c";
+                       };
+
+                       r_rsb_pins: r-rsb-pins {
+                               pins = "PL0", "PL1";
+                               function = "s_rsb";
+                       };
+               };
+
+               ir: ir@7040000 {
+                       compatible = "allwinner,sun50i-h616-ir",
+                                    "allwinner,sun6i-a31-ir";
+                       reg = <0x07040000 0x400>;
+                       interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu CLK_R_APB1_IR>,
+                                <&r_ccu CLK_IR>;
+                       clock-names = "apb", "ir";
+                       resets = <&r_ccu RST_R_APB1_IR>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&ir_rx_pin>;
+                       status = "disabled";
+               };
+
+               r_i2c: i2c@7081400 {
+                       compatible = "allwinner,sun50i-h616-i2c",
+                                    "allwinner,sun8i-v536-i2c",
+                                    "allwinner,sun6i-a31-i2c";
+                       reg = <0x07081400 0x400>;
+                       interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu CLK_R_APB2_I2C>;
+                       resets = <&r_ccu RST_R_APB2_I2C>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               r_rsb: rsb@7083000 {
+                       compatible = "allwinner,sun50i-h616-rsb",
+                                    "allwinner,sun8i-a23-rsb";
+                       reg = <0x07083000 0x400>;
+                       interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu CLK_R_APB2_RSB>;
+                       clock-frequency = <3000000>;
+                       resets = <&r_ccu RST_R_APB2_RSB>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&r_rsb_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+       };
+};
index 4db83fb..1bf0c47 100644 (file)
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 dtb-$(CONFIG_ARCH_INTEL_SOCFPGA) += socfpga_stratix10_socdk.dtb \
-                               socfpga_stratix10_socdk_nand.dtb
+                               socfpga_stratix10_socdk_nand.dtb \
+                               socfpga_stratix10_swvp.dtb
index aa2bba7..14c220d 100644 (file)
                      <0x0 0xfffc6000 0x0 0x2000>;
        };
 
+       clocks {
+               cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+               };
+
+               cb_intosc_ls_clk: cb-intosc-ls-clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+               };
+
+               f2s_free_clk: f2s-free-clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+               };
+
+               osc1: osc1 {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+               };
+
+               qspi_clk: qspi-clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <200000000>;
+               };
+       };
+
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
                        #clock-cells = <1>;
                };
 
-               clocks {
-                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
-                               #clock-cells = <0>;
-                               compatible = "fixed-clock";
-                       };
-
-                       cb_intosc_ls_clk: cb-intosc-ls-clk {
-                               #clock-cells = <0>;
-                               compatible = "fixed-clock";
-                       };
-
-                       f2s_free_clk: f2s-free-clk {
-                               #clock-cells = <0>;
-                               compatible = "fixed-clock";
-                       };
-
-                       osc1: osc1 {
-                               #clock-cells = <0>;
-                               compatible = "fixed-clock";
-                       };
-
-                       qspi_clk: qspi-clk {
-                               #clock-cells = <0>;
-                               compatible = "fixed-clock";
-                               clock-frequency = <200000000>;
-                       };
-               };
-
                gmac0: ethernet@ff800000 {
                        compatible = "altr,socfpga-stmmac-a10-s10", "snps,dwmac-3.74a", "snps,dwmac";
                        reg = <0xff800000 0x2000>;
                };
 
                qspi: spi@ff8d2000 {
-                       compatible =  "intel,socfpga-qspi", "cdns,qspi-nor";
+                       compatible = "intel,socfpga-qspi", "cdns,qspi-nor";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        reg = <0xff8d2000 0x100>,
index 5159cd5..48424e4 100644 (file)
        };
 
        soc {
-               clocks {
-                       osc1 {
-                               clock-frequency = <25000000>;
-                       };
-               };
-
                eccmgr {
                        sdmmca-ecc@ff8c8c00 {
                                compatible = "altr,socfpga-s10-sdmmc-ecc",
        bus-width = <4>;
 };
 
+&osc1 {
+       clock-frequency = <25000000>;
+};
+
 &uart0 {
        status = "okay";
 };
index 0ab676c..847a7c0 100644 (file)
        };
 
        soc {
-               clocks {
-                       osc1 {
-                               clock-frequency = <25000000>;
-                       };
-               };
-
                eccmgr {
                        sdmmca-ecc@ff8c8c00 {
                                compatible = "altr,socfpga-s10-sdmmc-ecc",
        };
 };
 
+&osc1 {
+       clock-frequency = <25000000>;
+};
+
 &uart0 {
        status = "okay";
 };
diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10_swvp.dts b/arch/arm64/boot/dts/altera/socfpga_stratix10_swvp.dts
new file mode 100644 (file)
index 0000000..a8db585
--- /dev/null
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2022, Intel Corporation
+ */
+
+#include "socfpga_stratix10.dtsi"
+
+/ {
+       model = "SOCFPGA Stratix 10 SWVP";
+       compatible = "altr,socfpga-stratix10-swvp", "altr,socfpga-stratix10";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+
+               timer0 = &timer0;
+               timer1 = &timer1;
+               timer2 = &timer2;
+               timer3 = &timer3;
+
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial1:115200n8";
+               linux,initrd-start = <0x10000000>;
+               linux,initrd-end = <0x125c8324>;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x80000000>;
+       };
+};
+
+&cpu0 {
+       enable-method = "spin-table";
+       cpu-release-addr = <0x0 0x0000fff8>;
+};
+
+&cpu1 {
+       enable-method = "spin-table";
+       cpu-release-addr = <0x0 0x0000fff8>;
+};
+
+&cpu2 {
+       enable-method = "spin-table";
+       cpu-release-addr = <0x0 0x0000fff8>;
+};
+
+&cpu3 {
+       enable-method = "spin-table";
+       cpu-release-addr = <0x0 0x0000fff8>;
+};
+
+&osc1 {
+       clock-frequency = <25000000>;
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-addr = <0xffffffff>;
+       snps,max-mtu = <0x0>;
+};
+
+&gmac1 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-addr = <0xffffffff>;
+};
+
+&gmac2 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-addr = <0xffffffff>;
+};
+
+&mmc {
+       status = "okay";
+       altr,dw-mshc-ciu-div = <0x3>;
+       altr,dw-mshc-sdr-timing = <0x0 0x3>;
+       cap-sd-highspeed;
+       cap-mmc-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&usb0 {
+       clocks = <&clkmgr STRATIX10_L4_MP_CLK>;
+       status = "okay";
+};
+
+&usb1 {
+       clocks = <&clkmgr STRATIX10_L4_MP_CLK>;
+       status = "okay";
+};
+
+&rst {
+       altr,modrst-offset = <0x20>;
+};
+
+&sysmgr {
+       reg = <0xffd12000 0x1000>;
+       interrupts = <0x0 0x10 0x4>;
+       cpu1-start-addr = <0xffd06230>;
+};
index c290d1c..02bff65 100644 (file)
@@ -20,8 +20,8 @@
        };
 
        psci {
-               compatible   = "arm,psci-0.2";
-               method       = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 };
 
index e0926f6..07dab1f 100644 (file)
@@ -20,8 +20,8 @@
        };
 
        psci {
-               compatible   = "arm,psci-0.2";
-               method       = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 };
 
index 3f5254e..04f797b 100644 (file)
 
                        sysctrl_AO: sys-ctrl@0 {
                                compatible = "amlogic,meson-axg-ao-sysctrl", "simple-mfd", "syscon";
-                               reg =  <0x0 0x0 0x0 0x100>;
+                               reg = <0x0 0x0 0x0 0x100>;
 
                                clkc_AO: clock-controller {
                                        compatible = "amlogic,meson-axg-aoclkc";
index 6c7bfac..1fa6e75 100644 (file)
                rtc1 = &vrtc;
        };
 
+       gpio_fan: gpio-fan {
+               compatible = "gpio-fan";
+               gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+               /* Using Dummy Speed */
+               gpio-fan,speed-map = <0 0>, <1 1>;
+               #cooling-cells = <2>;
+       };
+
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
                power-button {
        status = "okay";
 };
 
+&cpu_thermal {
+       trips {
+               cpu_active: cpu-active {
+                       temperature = <70000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "active";
+               };
+       };
+
+       cooling-maps {
+               map {
+                       trip = <&cpu_active>;
+                       cooling-device = <&gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
+
 &frddr_a {
        status = "okay";
 };
index 707daf9..afe375f 100644 (file)
@@ -21,8 +21,6 @@
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
                power-button {
index aa14ea0..023a520 100644 (file)
 
                        sysctrl_AO: sys-ctrl@0 {
                                compatible = "amlogic,meson-gx-ao-sysctrl", "simple-mfd", "syscon";
-                               reg =  <0x0 0x0 0x0 0x100>;
+                               reg = <0x0 0x0 0x0 0x100>;
 
                                clkc_AO: clock-controller {
                                        compatible = "amlogic,meson-gx-aoclkc";
index e8394a8..6d8cc00 100644 (file)
@@ -26,8 +26,6 @@
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <20>;
 
                button-reset {
index f887bfb..63137ce 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
index 6eae692..505ffcd 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
index c529b6c..a4fa186 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
index b2ab05c..c147041 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
index 4b0ff70..595b490 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <20>;
 
-               button@0 {
+               button {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
index fcb304c..6831137 100644 (file)
 
        bluetooth {
                compatible = "realtek,rtl8822cs-bt";
-               enable-gpios  = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
+               enable-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
                host-wake-gpios = <&gpio GPIOX_18 GPIO_ACTIVE_HIGH>;
        };
 };
index ebebf34..f5b3424 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
index ea9f234..b8ef3bd 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
index 8edbfe0..d4858af 100644 (file)
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
-               button@0 {
+               button {
                        label = "power";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
index 1e7f77f..f8c4034 100644 (file)
@@ -45,8 +45,6 @@
 
        gpio-keys-polled {
                compatible = "gpio-keys-polled";
-               #address-cells = <1>;
-               #size-cells = <0>;
                poll-interval = <100>;
 
                button-power {
index ff21361..ad50cba 100644 (file)
                                clocks = <&xtal>, <&xtal>, <&xtal>;
                                clock-names = "xtal", "pclk", "baud";
                        };
+
+                       reset: reset-controller@2000 {
+                               compatible = "amlogic,meson-s4-reset";
+                               reg = <0x0 0x2000 0x0 0x98>;
+                               #reset-cells = <1>;
+                       };
                };
        };
 };
index a5d79f2..603337c 100644 (file)
@@ -48,7 +48,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               key1 {
+               key-1 {
                        label = "A";
                        linux,code = <BTN_0>;
                        gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
@@ -56,7 +56,7 @@
                        interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
                };
 
-               key2 {
+               key-2 {
                        label = "B";
                        linux,code = <BTN_1>;
                        gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
@@ -64,7 +64,7 @@
                        interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
                };
 
-               key3 {
+               key-3 {
                        label = "C";
                        linux,code = <BTN_2>;
                        gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
@@ -72,7 +72,7 @@
                        interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
                };
 
-               mic_mute {
+               key-mic-mute {
                        label = "MicMute";
                        linux,code = <SW_MUTE_DEVICE>;
                        linux,input-type = <EV_SW>;
@@ -81,7 +81,7 @@
                        interrupts = <99 IRQ_TYPE_EDGE_BOTH>;
                };
 
-               power_key {
+               key-power {
                        label = "PowerKey";
                        linux,code = <KEY_POWER>;
                        gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
index 217d772..049e7a5 100644 (file)
@@ -22,7 +22,7 @@
 
        gpio-keys {
                compatible = "gpio-keys";
-               button@1 {
+               button {
                        label = "POWER";
                        linux,code = <116>;
                        linux,input-type = <0x1>;
index e927811..efac50a 100644 (file)
@@ -22,7 +22,7 @@
 
        gpio-keys {
                compatible = "gpio-keys";
-               button@1 {
+               button {
                        label = "POWER";
                        linux,code = <116>;
                        linux,input-type = <0x1>;
index a83c82c..a8526f8 100644 (file)
                        interrupts = <0x0 0x4c 0x4>;
                };
 
-               /* Do not change dwusb name, coded for backward compatibility */
-               usb0: dwusb@19000000 {
+               /* Node-name might need to be coded as dwusb for backward compatibility */
+               usb0: usb@19000000 {
                        status = "disabled";
                        compatible = "snps,dwc3";
-                       reg =  <0x0 0x19000000 0x0 0x100000>;
+                       reg = <0x0 0x19000000 0x0 0x100000>;
                        interrupts = <0x0 0x5d 0x4>;
                        dma-coherent;
                        dr_mode = "host";
index 0f37e77..f56d687 100644 (file)
                        phy-names = "sata-phy";
                };
 
-               /* Do not change dwusb name, coded for backward compatibility */
-               usb0: dwusb@19000000 {
+               /* Node-name might need to be coded as dwusb for backward compatibility */
+               usb0: usb@19000000 {
                        status = "disabled";
                        compatible = "snps,dwc3";
-                       reg =  <0x0 0x19000000 0x0 0x100000>;
+                       reg = <0x0 0x19000000 0x0 0x100000>;
                        interrupts = <0x0 0x89 0x4>;
                        dma-coherent;
                        dr_mode = "host";
                };
 
-               usb1: dwusb@19800000 {
+               usb1: usb@19800000 {
                        status = "disabled";
                        compatible = "snps,dwc3";
-                       reg =  <0x0 0x19800000 0x0 0x100000>;
+                       reg = <0x0 0x19800000 0x0 0x100000>;
                        interrupts = <0x0 0x8a 0x4>;
                        dma-coherent;
                        dr_mode = "host";
index a496e39..5f6f30c 100644 (file)
        };
 
        panel {
-               compatible = "arm,rtsm-display", "panel-dpi";
+               compatible = "arm,rtsm-display";
                port {
                        panel_in: endpoint {
                                remote-endpoint = <&clcd_pads>;
index 065381c..8d0d45d 100644 (file)
 
                trig-conns@0 {
                        reg = <0>;
-                       arm,trig-in-sigs=<2 3>;
-                       arm,trig-in-types=<SNK_FULL SNK_ACQCOMP>;
-                       arm,trig-out-sigs=<0 1>;
-                       arm,trig-out-types=<SNK_FLUSHIN SNK_TRIGIN>;
+                       arm,trig-in-sigs = <2 3>;
+                       arm,trig-in-types = <SNK_FULL SNK_ACQCOMP>;
+                       arm,trig-out-sigs = <0 1>;
+                       arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>;
                        arm,cs-dev-assoc = <&etr_sys>;
                };
 
                trig-conns@1 {
                        reg = <1>;
-                       arm,trig-in-sigs=<0 1>;
-                       arm,trig-in-types=<SNK_FULL SNK_ACQCOMP>;
-                       arm,trig-out-sigs=<7 6>;
-                       arm,trig-out-types=<SNK_FLUSHIN SNK_TRIGIN>;
+                       arm,trig-in-sigs = <0 1>;
+                       arm,trig-in-types = <SNK_FULL SNK_ACQCOMP>;
+                       arm,trig-out-sigs = <7 6>;
+                       arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>;
                        arm,cs-dev-assoc = <&etf_sys0>;
                };
 
                trig-conns@2 {
                        reg = <2>;
-                       arm,trig-in-sigs=<4 5 6 7>;
-                       arm,trig-in-types=<STM_TOUT_SPTE STM_TOUT_SW
+                       arm,trig-in-sigs = <4 5 6 7>;
+                       arm,trig-in-types = <STM_TOUT_SPTE STM_TOUT_SW
                                           STM_TOUT_HETE STM_ASYNCOUT>;
-                       arm,trig-out-sigs=<4 5>;
-                       arm,trig-out-types=<STM_HWEVENT STM_HWEVENT>;
+                       arm,trig-out-sigs = <4 5>;
+                       arm,trig-out-types = <STM_HWEVENT STM_HWEVENT>;
                        arm,cs-dev-assoc = <&stm_sys>;
                };
 
                trig-conns@3 {
                        reg = <3>;
-                       arm,trig-out-sigs=<2 3>;
-                       arm,trig-out-types=<SNK_FLUSHIN SNK_TRIGIN>;
+                       arm,trig-out-sigs = <2 3>;
+                       arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>;
                        arm,cs-dev-assoc = <&tpiu_sys>;
                };
        };
 
                trig-conns@0 {
                        reg = <0>;
-                       arm,trig-in-sigs=<0>;
-                       arm,trig-in-types=<GEN_INTREQ>;
-                       arm,trig-out-sigs=<0>;
-                       arm,trig-out-types=<GEN_HALTREQ>;
+                       arm,trig-in-sigs = <0>;
+                       arm,trig-in-types = <GEN_INTREQ>;
+                       arm,trig-out-sigs = <0>;
+                       arm,trig-out-types = <GEN_HALTREQ>;
                        arm,trig-conn-name = "sys_profiler";
                };
 
                trig-conns@1 {
                        reg = <1>;
-                       arm,trig-out-sigs=<2 3>;
-                       arm,trig-out-types=<GEN_HALTREQ GEN_RESTARTREQ>;
+                       arm,trig-out-sigs = <2 3>;
+                       arm,trig-out-types = <GEN_HALTREQ GEN_RESTARTREQ>;
                        arm,trig-conn-name = "watchdog";
                };
 
                trig-conns@2 {
                        reg = <2>;
-                       arm,trig-out-sigs=<1 6>;
-                       arm,trig-out-types=<GEN_HALTREQ GEN_RESTARTREQ>;
+                       arm,trig-out-sigs = <1 6>;
+                       arm,trig-out-types = <GEN_HALTREQ GEN_RESTARTREQ>;
                        arm,trig-conn-name = "g_counter";
                };
        };
index 2e43f45..ba88d15 100644 (file)
 
                trig-conns@0 {
                        reg = <0>;
-                       arm,trig-in-sigs=<0 1>;
-                       arm,trig-in-types=<SNK_FULL SNK_ACQCOMP>;
-                       arm,trig-out-sigs=<0 1>;
-                       arm,trig-out-types=<SNK_FLUSHIN SNK_TRIGIN>;
+                       arm,trig-in-sigs = <0 1>;
+                       arm,trig-in-types = <SNK_FULL SNK_ACQCOMP>;
+                       arm,trig-out-sigs = <0 1>;
+                       arm,trig-out-types = <SNK_FLUSHIN SNK_TRIGIN>;
                        arm,cs-dev-assoc = <&etf_sys1>;
                };
 
                trig-conns@1 {
                        reg = <1>;
-                       arm,trig-in-sigs=<2 3 4>;
-                       arm,trig-in-types=<ELA_DBGREQ ELA_TSTART ELA_TSTOP>;
+                       arm,trig-in-sigs = <2 3 4>;
+                       arm,trig-in-types = <ELA_DBGREQ ELA_TSTART ELA_TSTOP>;
                        arm,trig-conn-name = "ela_clus_0";
                };
 
                trig-conns@2 {
                        reg = <2>;
-                       arm,trig-in-sigs=<5 6 7>;
-                       arm,trig-in-types=<ELA_DBGREQ ELA_TSTART ELA_TSTOP>;
+                       arm,trig-in-sigs = <5 6 7>;
+                       arm,trig-in-types = <ELA_DBGREQ ELA_TSTART ELA_TSTOP>;
                        arm,trig-conn-name = "ela_clus_1";
                };
        };
index f099fb6..6451c62 100644 (file)
                        cache-size = <0x200000>;
                        cache-line-size = <64>;
                        cache-sets = <2048>;
+                       cache-level = <2>;
                };
 
                A53_L2: l2-cache1 {
                        cache-size = <0x100000>;
                        cache-line-size = <64>;
                        cache-sets = <1024>;
+                       cache-level = <2>;
                };
        };
 
index 7093895..438cd1f 100644 (file)
                        cache-size = <0x200000>;
                        cache-line-size = <64>;
                        cache-sets = <2048>;
+                       cache-level = <2>;
                };
 
                A53_L2: l2-cache1 {
                        cache-size = <0x100000>;
                        cache-line-size = <64>;
                        cache-sets = <1024>;
+                       cache-level = <2>;
                };
        };
 
index 4135d62..ec85cd2 100644 (file)
 &mailbox {
        compatible = "arm,mhu-doorbell", "arm,primecell";
        #mbox-cells = <2>;
-       mbox-name = "ARM-MHU";
 };
 
 &smmu_etr {
index dbc22e7..cf4a582 100644 (file)
                        cache-size = <0x200000>;
                        cache-line-size = <64>;
                        cache-sets = <2048>;
+                       cache-level = <2>;
                };
 
                A53_L2: l2-cache1 {
                        cache-size = <0x100000>;
                        cache-line-size = <64>;
                        cache-sets = <1024>;
+                       cache-level = <2>;
                };
        };
 
index 5082fcd..e8584d3 100644 (file)
@@ -9,5 +9,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
                              bcm2837-rpi-zero-2-w.dtb
 
 subdir-y       += bcm4908
+subdir-y       += bcmbca
 subdir-y       += northstar2
 subdir-y       += stingray
index b63eefa..064f7f5 100644 (file)
                compatible = "gpio-keys-polled";
                poll-interval = <100>;
 
-               brightness {
+               key-brightness {
                        label = "LEDs";
                        linux,code = <KEY_BRIGHTNESS_ZERO>;
                        gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               key-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
                };
 
-               wifi {
+               key-wifi {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               key-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
index 169fbb7..04f8524 100644 (file)
                compatible = "gpio-keys-polled";
                poll-interval = <100>;
 
-               wifi {
+               key-wifi {
                        label = "WiFi";
                        linux,code = <KEY_RFKILL>;
                        gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
                };
 
-               wps {
+               key-wps {
                        label = "WPS";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
                };
 
-               restart {
+               key-restart {
                        label = "Reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
                };
 
-               brightness {
+               key-brightness {
                        label = "LEDs";
                        linux,code = <KEY_BRIGHTNESS_ZERO>;
                        gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/Makefile b/arch/arm64/boot/dts/broadcom/bcmbca/Makefile
new file mode 100644 (file)
index 0000000..38f1430
--- /dev/null
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0
+dtb-$(CONFIG_ARCH_BCMBCA) += \
+                               bcm4912-asus-gt-ax6000.dtb \
+                               bcm94912.dtb \
+                               bcm963158.dtb \
+                               bcm96858.dtb \
+                               bcm963146.dtb \
+                               bcm96856.dtb \
+                               bcm96813.dtb
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912-asus-gt-ax6000.dts
new file mode 100644 (file)
index 0000000..ed55466
--- /dev/null
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "bcm4912.dtsi"
+
+/ {
+       compatible = "asus,gt-ax6000", "brcm,bcm4912", "brcm,bcmbca";
+       model = "Asus GT-AX6000";
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x00 0x00 0x00 0x40000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm4912.dtsi
new file mode 100644 (file)
index 0000000..3d016c2
--- /dev/null
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "brcm,bcm4912", "brcm,bcmbca";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               B53_0: cpu@0 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_1: cpu@1 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_2: cpu@2 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_3: cpu@3 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x3>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <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>;
+               interrupt-affinity = <&B53_0>, <&B53_1>,
+                       <&B53_2>, <&B53_3>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63146.dtsi
new file mode 100644 (file)
index 0000000..04de96b
--- /dev/null
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "brcm,bcm63146", "brcm,bcmbca";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               B53_0: cpu@0 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_1: cpu@1 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&B53_0>, <&B53_1>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
+                                       IRQ_TYPE_LEVEL_HIGH)>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm63158.dtsi
new file mode 100644 (file)
index 0000000..1362970
--- /dev/null
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "brcm,bcm63158", "brcm,bcmbca";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               B53_0: cpu@0 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_1: cpu@1 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_2: cpu@2 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_3: cpu@3 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x3>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               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>;
+               interrupt-affinity = <&B53_0>, <&B53_1>,
+                       <&B53_2>, <&B53_3>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6813.dtsi
new file mode 100644 (file)
index 0000000..c3e6197
--- /dev/null
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "brcm,bcm6813", "brcm,bcmbca";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               B53_0: cpu@0 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_1: cpu@1 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_2: cpu@2 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_3: cpu@3 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x3>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <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>;
+               interrupt-affinity = <&B53_0>, <&B53_1>,
+                       <&B53_2>, <&B53_3>;
+       };
+
+       clocks: clocks {
+               periph_clk: periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+               uart_clk: uart-clk {
+                       compatible = "fixed-factor-clock";
+                       #clock-cells = <0>;
+                       clocks = <&periph_clk>;
+                       clock-div = <4>;
+                       clock-mult = <1>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+                       reg = <0x1000 0x1000>,
+                               <0x2000 0x2000>,
+                               <0x4000 0x2000>,
+                               <0x6000 0x2000>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0xff800000 0x800000>;
+
+               uart0: serial@12000 {
+                       compatible = "arm,pl011", "arm,primecell";
+                       reg = <0x12000 0x1000>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&uart_clk>, <&uart_clk>;
+                       clock-names = "uartclk", "apb_pclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6856.dtsi
new file mode 100644 (file)
index 0000000..0bce649
--- /dev/null
@@ -0,0 +1,103 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "brcm,bcm6856", "brcm,bcmbca";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               B53_0: cpu@0 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_1: cpu@1 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                       <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&B53_0>, <&B53_1>;
+       };
+
+       clocks: clocks {
+               periph_clk:periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>, /* GICD */
+                               <0x2000 0x2000>, /* GICC */
+                               <0x4000 0x2000>, /* GICH */
+                               <0x6000 0x2000>; /* GICV */
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(2) |
+                                       IRQ_TYPE_LEVEL_HIGH)>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0xff800000 0x800000>;
+
+               uart0: serial@640 {
+                       compatible = "brcm,bcm6345-uart";
+                       reg = <0x640 0x18>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&periph_clk>;
+                       clock-names = "refclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi b/arch/arm64/boot/dts/broadcom/bcmbca/bcm6858.dtsi
new file mode 100644 (file)
index 0000000..29a880c
--- /dev/null
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "brcm,bcm6858", "brcm,bcmbca";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               B53_0: cpu@0 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_1: cpu@1 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_2: cpu@2 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x2>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+
+               B53_3: cpu@3 {
+                       compatible = "brcm,brahma-b53";
+                       device_type = "cpu";
+                       reg = <0x0 0x3>;
+                       next-level-cache = <&L2_0>;
+                       enable-method = "psci";
+               };
+               L2_0: l2-cache0 {
+                       compatible = "cache";
+               };
+       };
+
+       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)>;
+       };
+
+       pmu: pmu {
+               compatible = "arm,armv8-pmuv3";
+               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>;
+               interrupt-affinity = <&B53_0>, <&B53_1>,
+                       <&B53_2>, <&B53_3>;
+       };
+
+       clocks: clocks {
+               periph_clk:periph-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       axi@81000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x81000000 0x8000>;
+
+               gic: interrupt-controller@1000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x1000 0x1000>, /* GICD */
+                               <0x2000 0x2000>, /* GICC */
+                               <0x4000 0x2000>, /* GICH */
+                               <0x6000 0x2000>; /* GICV */
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) |
+                                       IRQ_TYPE_LEVEL_HIGH)>;
+               };
+       };
+
+       bus@ff800000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0xff800000 0x62000>;
+
+               uart0: serial@640 {
+                       compatible = "brcm,bcm6345-uart";
+                       reg = <0x640 0x18>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&periph_clk>;
+                       clock-names = "refclk";
+                       status = "disabled";
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm94912.dts
new file mode 100644 (file)
index 0000000..a3623e6
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm4912.dtsi"
+
+/ {
+       model = "Broadcom BCM94912 Reference Board";
+       compatible = "brcm,bcm94912", "brcm,bcm4912", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963146.dts
new file mode 100644 (file)
index 0000000..e39f1e6
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm63146.dtsi"
+
+/ {
+       model = "Broadcom BCM963146 Reference Board";
+       compatible = "brcm,bcm963146", "brcm,bcm63146", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm963158.dts
new file mode 100644 (file)
index 0000000..eba07e0
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm63158.dtsi"
+
+/ {
+       model = "Broadcom BCM963158 Reference Board";
+       compatible = "brcm,bcm963158", "brcm,bcm63158", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96813.dts
new file mode 100644 (file)
index 0000000..af17091
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6813.dtsi"
+
+/ {
+       model = "Broadcom BCM96813 Reference Board";
+       compatible = "brcm,bcm96813", "brcm,bcm6813", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96856.dts
new file mode 100644 (file)
index 0000000..032aeb7
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6856.dtsi"
+
+/ {
+       model = "Broadcom BCM96856 Reference Board";
+       compatible = "brcm,bcm96856", "brcm,bcm6856", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts b/arch/arm64/boot/dts/broadcom/bcmbca/bcm96858.dts
new file mode 100644 (file)
index 0000000..0cbf582
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 Broadcom Ltd.
+ */
+
+/dts-v1/;
+
+#include "bcm6858.dtsi"
+
+/ {
+       model = "Broadcom BCM96858 Reference Board";
+       compatible = "brcm,bcm96858", "brcm,bcm6858", "brcm,bcmbca";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x0 0x0 0x0 0x08000000>;
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
index 09d4aa8..8f8c25e 100644 (file)
                        reg-names = "amac_base";
                        dma-coherent;
                        interrupts = <GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH>;
-                       status= "disabled";
+                       status = "disabled";
                };
 
                nand: nand@360000 {
diff --git a/arch/arm64/boot/dts/exynos/exynos-pinctrl.h b/arch/arm64/boot/dts/exynos/exynos-pinctrl.h
new file mode 100644 (file)
index 0000000..7dd94a9
--- /dev/null
@@ -0,0 +1,79 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Samsung Exynos DTS pinctrl constants
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ */
+
+#ifndef __DTS_ARM64_SAMSUNG_EXYNOS_PINCTRL_H__
+#define __DTS_ARM64_SAMSUNG_EXYNOS_PINCTRL_H__
+
+#define EXYNOS_PIN_PULL_NONE           0
+#define EXYNOS_PIN_PULL_DOWN           1
+#define EXYNOS_PIN_PULL_UP             3
+
+/* Pin function in power down mode */
+#define EXYNOS_PIN_PDN_OUT0            0
+#define EXYNOS_PIN_PDN_OUT1            1
+#define EXYNOS_PIN_PDN_INPUT           2
+#define EXYNOS_PIN_PDN_PREV            3
+
+/*
+ * Drive strengths for Exynos5410, Exynos542x, Exynos5800, Exynos7885, Exynos850
+ * (except GPIO_HSI block), ExynosAutov9 (FSI0, PERIC1)
+ */
+#define EXYNOS5420_PIN_DRV_LV1         0
+#define EXYNOS5420_PIN_DRV_LV2         1
+#define EXYNOS5420_PIN_DRV_LV3         2
+#define EXYNOS5420_PIN_DRV_LV4         3
+
+/* Drive strengths for Exynos5433 */
+#define EXYNOS5433_PIN_DRV_FAST_SR1    0
+#define EXYNOS5433_PIN_DRV_FAST_SR2    1
+#define EXYNOS5433_PIN_DRV_FAST_SR3    2
+#define EXYNOS5433_PIN_DRV_FAST_SR4    3
+#define EXYNOS5433_PIN_DRV_FAST_SR5    4
+#define EXYNOS5433_PIN_DRV_FAST_SR6    5
+#define EXYNOS5433_PIN_DRV_SLOW_SR1    8
+#define EXYNOS5433_PIN_DRV_SLOW_SR2    9
+#define EXYNOS5433_PIN_DRV_SLOW_SR3    0xa
+#define EXYNOS5433_PIN_DRV_SLOW_SR4    0xb
+#define EXYNOS5433_PIN_DRV_SLOW_SR5    0xc
+#define EXYNOS5433_PIN_DRV_SLOW_SR6    0xf
+
+/* Drive strengths for Exynos7 (except FSYS1) */
+#define EXYNOS7_PIN_DRV_LV1            0
+#define EXYNOS7_PIN_DRV_LV2            2
+#define EXYNOS7_PIN_DRV_LV3            1
+#define EXYNOS7_PIN_DRV_LV4            3
+
+/* Drive strengths for Exynos7 FSYS1 block */
+#define EXYNOS7_FSYS1_PIN_DRV_LV1      0
+#define EXYNOS7_FSYS1_PIN_DRV_LV2      4
+#define EXYNOS7_FSYS1_PIN_DRV_LV3      2
+#define EXYNOS7_FSYS1_PIN_DRV_LV4      6
+#define EXYNOS7_FSYS1_PIN_DRV_LV5      1
+#define EXYNOS7_FSYS1_PIN_DRV_LV6      5
+
+/* Drive strengths for Exynos850 GPIO_HSI block */
+#define EXYNOS850_HSI_PIN_DRV_LV1      0       /* 1x   */
+#define EXYNOS850_HSI_PIN_DRV_LV1_5    1       /* 1.5x */
+#define EXYNOS850_HSI_PIN_DRV_LV2      2       /* 2x   */
+#define EXYNOS850_HSI_PIN_DRV_LV2_5    3       /* 2.5x */
+#define EXYNOS850_HSI_PIN_DRV_LV3      4       /* 3x   */
+#define EXYNOS850_HSI_PIN_DRV_LV4      5       /* 4x   */
+
+#define EXYNOS_PIN_FUNC_INPUT          0
+#define EXYNOS_PIN_FUNC_OUTPUT         1
+#define EXYNOS_PIN_FUNC_2              2
+#define EXYNOS_PIN_FUNC_3              3
+#define EXYNOS_PIN_FUNC_4              4
+#define EXYNOS_PIN_FUNC_5              5
+#define EXYNOS_PIN_FUNC_6              6
+#define EXYNOS_PIN_FUNC_EINT           0xf
+#define EXYNOS_PIN_FUNC_F              EXYNOS_PIN_FUNC_EINT
+
+#endif /* __DTS_ARM64_SAMSUNG_EXYNOS_PINCTRL_H__ */
index 4b46af3..6815535 100644 (file)
@@ -9,7 +9,7 @@
  * tree nodes are listed in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 #define PIN(_pin, _func, _pull, _drv)                                  \
        pin- ## _pin {                                                  \
index 75b548e..bd6a354 100644 (file)
                        };
                };
 
-               mshc_0: mshc@15540000 {
+               mshc_0: mmc@15540000 {
                        compatible = "samsung,exynos7-dw-mshc-smu";
                        interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
                        #address-cells = <1>;
                        status = "disabled";
                };
 
-               mshc_1: mshc@15550000 {
+               mshc_1: mmc@15550000 {
                        compatible = "samsung,exynos7-dw-mshc-smu";
                        interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
                        #address-cells = <1>;
                        status = "disabled";
                };
 
-               mshc_2: mshc@15560000 {
+               mshc_2: mmc@15560000 {
                        compatible = "samsung,exynos7-dw-mshc-smu";
                        interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
                        #address-cells = <1>;
index 0895e81..e38c59c 100644 (file)
        pmic_irq: pmic-irq-pins {
                samsung,pins = "gpa0-2";
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV4>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV4>;
        };
 };
 
                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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
 
index be9b971..ee9c24a 100644 (file)
@@ -9,7 +9,7 @@
  * device tree nodes in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_alive {
        gpa0: gpa0-gpio-bank {
                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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
 
                samsung,pins = "gpj0-1", "gpj0-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
 
                samsung,pins = "gpj1-1", "gpj1-0";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
 
                samsung,pins = "gpg4-0", "gpg4-1", "gpg4-2", "gpg4-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
 
                samsung,pins = "gpv7-0", "gpv7-1", "gpv7-2", "gpv7-3";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
 
                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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV4>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV4>;
        };
 
        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 = <EXYNOS4_PIN_DRV_LV4>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV4>;
        };
 };
 
                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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 
        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>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV2>;
        };
 
        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>;
-               samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;
+               samsung,pin-drv = <EXYNOS7_PIN_DRV_LV1>;
        };
 };
index 4cf9aa2..5db9a81 100644 (file)
        };
 };
 
+&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_fast_slew_rate_3x &sd0_cmd &sd0_rdqs
+                    &sd0_bus1 &sd0_bus4 &sd0_bus8>;
+};
+
 &oscclk {
        clock-frequency = <26000000>;
 };
index a50c1db..34bb121 100644 (file)
@@ -9,8 +9,8 @@
  * device tree nodes in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_alive {
        etc0: etc0-gpio-bank {
index 3170661..23c2e0b 100644 (file)
                        clock-names = "oscclk";
                };
 
+               cmu_fsys: clock-controller@13400000 {
+                       compatible = "samsung,exynos7885-cmu-fsys";
+                       reg = <0x13400000 0x8000>;
+                       #clock-cells = <1>;
+
+                       clocks = <&oscclk>,
+                                <&cmu_top CLK_DOUT_FSYS_BUS>,
+                                <&cmu_top CLK_DOUT_FSYS_MMC_CARD>,
+                                <&cmu_top CLK_DOUT_FSYS_MMC_EMBD>,
+                                <&cmu_top CLK_DOUT_FSYS_MMC_SDIO>,
+                                <&cmu_top CLK_DOUT_FSYS_USB30DRD>;
+                       clock-names = "oscclk",
+                                     "dout_fsys_bus",
+                                     "dout_fsys_mmc_card",
+                                     "dout_fsys_mmc_embd",
+                                     "dout_fsys_mmc_sdio",
+                                     "dout_fsys_usb30drd";
+               };
+
                pinctrl_alive: pinctrl@11cb0000 {
                        compatible = "samsung,exynos7885-pinctrl";
                        reg = <0x11cb0000 0x1000>;
                        reg = <0x11c80000 0x10000>;
                };
 
+               mmc_0: mmc@13500000 {
+                       compatible = "samsung,exynos7-dw-mshc-smu";
+                       reg = <0x13500000 0x2000>;
+                       interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       clocks = <&cmu_fsys CLK_GOUT_MMC_EMBD_ACLK>,
+                                <&cmu_fsys CLK_GOUT_MMC_EMBD_SDCLKIN>;
+                       clock-names = "biu", "ciu";
+                       fifo-depth = <0x40>;
+                       status = "disabled";
+               };
+
                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>;
+                       clocks = <&cmu_peri CLK_GOUT_UART0_PCLK>,
+                                <&cmu_peri CLK_GOUT_UART0_EXT_UCLK>;
                        clock-names = "uart", "clk_uart_baud0";
                        samsung,uart-fifosize = <64>;
                        status = "disabled";
                        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>;
+                       clocks = <&cmu_peri CLK_GOUT_UART1_PCLK>,
+                                <&cmu_peri CLK_GOUT_UART1_EXT_UCLK>;
                        clock-names = "uart", "clk_uart_baud0";
                        samsung,uart-fifosize = <256>;
                        status = "disabled";
                        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>;
+                       clocks = <&cmu_peri CLK_GOUT_UART2_PCLK>,
+                                <&cmu_peri CLK_GOUT_UART2_EXT_UCLK>;
                        clock-names = "uart", "clk_uart_baud0";
                        samsung,uart-fifosize = <256>;
                        status = "disabled";
index f43e4a2..424bc80 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_alive {
        gpa0: gpa0-gpio-bank {
index ef0349d..e413a51 100644 (file)
@@ -8,7 +8,7 @@
  * device tree nodes in this file.
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "exynos-pinctrl.h"
 
 &pinctrl_alive {
        gpa0: gpa0-gpio-bank {
 
        /* PERIC1 USI11_SPI */
        spi11_bus: spi11-pins {
-               samsung,pins = "gpp3-6", "gpp3-5", "gpp3-4";
+               samsung,pins = "gpp5-6", "gpp5-5", "gpp5-4";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
        spi11_cs: spi11-cs-pins {
-               samsung,pins = "gpp3-7";
+               samsung,pins = "gpp5-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_OUTPUT>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
        };
 
        spi11_cs_func: spi11-cs-func-pins {
-               samsung,pins = "gpp3-7";
+               samsung,pins = "gpp5-7";
                samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
                samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
                samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
index 17e5688..eec3192 100644 (file)
                regulator-boot-on;
                enable-active-high;
        };
+
+       ufs_1_fixed_vcc_reg: regulator-1 {
+               compatible = "regulator-fixed";
+               regulator-name = "ufs-vcc";
+               gpio = <&gpg2 2 GPIO_ACTIVE_HIGH>;
+               regulator-boot-on;
+               enable-active-high;
+       };
 };
 
 &serial_0 {
+       pinctrl-0 = <&uart0_bus_dual>;
        status = "okay";
 };
 
        status = "okay";
 };
 
+&ufs_1_phy {
+       status = "okay";
+};
+
 &ufs_0 {
        status = "okay";
        vcc-supply = <&ufs_0_fixed_vcc_reg>;
        vcc-fixed-regulator;
 };
 
+&ufs_1 {
+       status = "okay";
+       vcc-supply = <&ufs_1_fixed_vcc_reg>;
+       vcc-fixed-regulator;
+};
+
 &usi_0 {
+       samsung,clkreq-on; /* needed for UART mode */
        status = "okay";
 };
 
index 0ce46ec..2013718 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <dt-bindings/clock/samsung,exynosautov9.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/soc/samsung,boot-mode.h>
 #include <dt-bindings/soc/samsung,exynos-usi.h>
 
 / {
                                                 IRQ_TYPE_LEVEL_HIGH)>;
                };
 
+               pdma0: dma-controller@1b2e0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0x1b2e0000 0x1000>;
+                       interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_busmc CLK_GOUT_BUSMC_PDMA0_PCLK>;
+                       clock-names = "apb_pclk";
+                       arm,pl330-broken-no-flushp;
+                       #dma-cells = <1>;
+               };
+
                pinctrl_alive: pinctrl@10450000 {
                        compatible = "samsung,exynosautov9-pinctrl";
                        reg = <0x10450000 0x1000>;
                pmu_system_controller: system-controller@10460000 {
                        compatible = "samsung,exynos7-pmu", "syscon";
                        reg = <0x10460000 0x10000>;
+
+                       reboot: syscon-reboot {
+                               compatible = "syscon-reboot";
+                               regmap = <&pmu_system_controller>;
+                               offset = <0x3a00>; /* SYSTEM_CONFIGURATION */
+                               value = <0x2>;
+                               mask = <0x2>;
+                       };
+
+                       reboot-mode {
+                               compatible = "syscon-reboot-mode";
+                               offset = <0x810>; /* SYSIP_DAT0 */
+                               mode-bootloader = <EXYNOSAUTOV9_BOOT_BOOTLOADER>;
+                               mode-fastboot = <EXYNOSAUTOV9_BOOT_FASTBOOT>;
+                               mode-recovery = <EXYNOSAUTOV9_BOOT_RECOVERY>;
+                       };
                };
 
                syscon_fsys2: syscon@17c20000 {
                        reg = <0x10220000 0x2000>;
                };
 
+               syscon_peric1: syscon@10820000 {
+                       compatible = "samsung,exynosautov9-sysreg", "syscon";
+                       reg = <0x10820000 0x2000>;
+               };
+
                usi_0: usi@103000c0 {
-                       compatible = "samsung,exynos850-usi";
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
                        reg = <0x103000c0 0x20>;
                        samsung,sysreg = <&syscon_peric0 0x1000>;
                        samsung,mode = <USI_V2_UART>;
-                       samsung,clkreq-on; /* needed for UART mode */
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges;
                        clock-names = "pclk", "ipclk";
                        status = "disabled";
 
-                       /* USI: UART */
                        serial_0: serial@10300000 {
-                               compatible = "samsung,exynos850-uart";
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
                                reg = <0x10300000 0xc0>;
                                interrupts = <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
                                pinctrl-names = "default";
-                               pinctrl-0 = <&uart0_bus_dual>;
+                               pinctrl-0 = <&uart0_bus>;
                                clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>,
                                         <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>;
                                clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <256>;
+                               status = "disabled";
+                       };
+
+                       spi_0: spi@10300000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10300000 0x30>;
+                               interrupts = <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi0_bus &spi0_cs_func>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>,
+                                        <&cmu_peric0 CLK_DOUT_PERIC0_USI00_USI>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 1>, <&pdma0 0>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_0: i2c@10300000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10300000 0xc0>;
+                               interrupts = <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c0_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_0>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_0>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_0: usi@103100c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103100c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1004>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_1>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_1>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_1: i2c@10310000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10310000 0xc0>;
+                               interrupts = <GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c1_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_1>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_1>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_1: usi@103200c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103200c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1008>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_2>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_2>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_1: serial@10320000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10320000 0xc0>;
+                               interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart1_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_2>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_2>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <256>;
+                               status = "disabled";
+                       };
+
+                       spi_1: spi@10320000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10320000 0x30>;
+                               interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi1_bus &spi1_cs_func>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_2>,
+                                        <&cmu_peric0 CLK_DOUT_PERIC0_USI01_USI>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_2>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 3>, <&pdma0 2>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_2: i2c@10320000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10320000 0xc0>;
+                               interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c2_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_2>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_2>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_1: usi@103300c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103300c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x100c>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_3>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_3>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_3: i2c@10330000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10330000 0xc0>;
+                               interrupts = <GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c3_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_3>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_3>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_2: usi@103400c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103400c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1010>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_4>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_4>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_2: serial@10340000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10340000 0xc0>;
+                               interrupts = <GIC_SPI 349 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart2_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_4>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_4>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_2: spi@10340000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10340000 0x30>;
+                               interrupts = <GIC_SPI 349 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi2_bus &spi2_cs_func>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_4>,
+                                        <&cmu_peric0 CLK_DOUT_PERIC0_USI02_USI>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_4>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 5>, <&pdma0 4>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_4: i2c@10340000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10340000 0xc0>;
+                               interrupts = <GIC_SPI 349 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c4_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_4>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_4>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_2: usi@103500c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103500c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1014>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_5>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_5>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_5: i2c@10350000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10350000 0xc0>;
+                               interrupts = <GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c5_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_5>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_5>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_3: usi@103600c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103600c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1018>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_6>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_6>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_3: serial@10360000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10360000 0xc0>;
+                               interrupts = <GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart3_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_6>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_6>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_3: spi@10360000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10360000 0x30>;
+                               interrupts = <GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi3_bus &spi3_cs_func>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_6>,
+                                        <&cmu_peric0 CLK_DOUT_PERIC0_USI03_USI>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_6>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 7>, <&pdma0 6>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_6: i2c@10360000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10360000 0xc0>;
+                               interrupts = <GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c6_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_6>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_6>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_3: usi@103700c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103700c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x101c>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_7>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_7>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_7: i2c@10370000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10370000 0xc0>;
+                               interrupts = <GIC_SPI 350 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c7_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_7>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_7>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_4: usi@103800c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103800c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1020>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_8>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_8>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_4: serial@10380000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10380000 0xc0>;
+                               interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart4_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_8>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_8>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_4: spi@10380000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10380000 0x30>;
+                               interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi4_bus &spi4_cs_func>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_8>,
+                                        <&cmu_peric0 CLK_DOUT_PERIC0_USI04_USI>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_8>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 9>, <&pdma0 8>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_8: i2c@10380000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10380000 0xc0>;
+                               interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c8_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_8>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_8>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_4: usi@103900c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103900c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1024>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_9>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_9>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_9: i2c@10390000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10390000 0xc0>;
+                               interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c9_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_9>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_9>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_5: usi@103a00c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103a00c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x1028>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_10>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_10>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_5: serial@103a0000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x103a0000 0xc0>;
+                               interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart5_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_10>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_10>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_5: spi@103a0000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x103a0000 0x30>;
+                               interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi5_bus &spi5_cs_func>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_10>,
+                                        <&cmu_peric0 CLK_DOUT_PERIC0_USI05_USI>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_10>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 11>, <&pdma0 10>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_10: i2c@103a0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x103a0000 0xc0>;
+                               interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c10_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_10>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_10>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_5: usi@103b00c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x103b00c0 0x20>;
+                       samsung,sysreg = <&syscon_peric0 0x102c>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_11>,
+                                <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_11>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_11: i2c@103b0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x103b0000 0xc0>;
+                               interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c11_bus>;
+                               clocks = <&cmu_peric0 CLK_GOUT_PERIC0_IPCLK_11>,
+                                        <&cmu_peric0 CLK_GOUT_PERIC0_PCLK_11>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_6: usi@109000c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109000c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1000>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_0>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_0>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_6: serial@10900000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10900000 0xc0>;
+                               interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart6_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_0>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_0>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <256>;
+                               status = "disabled";
+                       };
+
+                       spi_6: spi@10900000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10900000 0x30>;
+                               interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi6_bus &spi6_cs_func>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_0>,
+                                        <&cmu_peric1 CLK_DOUT_PERIC1_USI06_USI>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_0>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 13>, <&pdma0 12>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_12: i2c@10900000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10900000 0xc0>;
+                               interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c12_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_0>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_0>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_6: usi@109100c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109100c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1004>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_1>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_1>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_13: i2c@10910000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10910000 0xc0>;
+                               interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c13_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_1>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_1>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_7: usi@109200c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109200c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1008>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_2>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_2>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_7: serial@10920000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10920000 0xc0>;
+                               interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart7_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_2>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_2>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_7: spi@10920000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10920000 0x30>;
+                               interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi7_bus &spi7_cs_func>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_2>,
+                                        <&cmu_peric1 CLK_DOUT_PERIC1_USI07_USI>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_2>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 15>, <&pdma0 14>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_14: i2c@10920000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10920000 0xc0>;
+                               interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c14_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_2>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_2>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_7: usi@109300c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109300c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x100c>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_3>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_3>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_15: i2c@10930000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10930000 0xc0>;
+                               interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c15_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_3>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_3>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_8: usi@109400c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109400c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1010>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_4>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_4>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_8: serial@10940000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10940000 0xc0>;
+                               interrupts = <GIC_SPI 362 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart8_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_4>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_4>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_8: spi@10940000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10940000 0x30>;
+                               interrupts = <GIC_SPI 362 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi8_bus &spi8_cs_func>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_4>,
+                                        <&cmu_peric1 CLK_DOUT_PERIC1_USI08_USI>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_4>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 17>, <&pdma0 16>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_16: i2c@10940000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10940000 0xc0>;
+                               interrupts = <GIC_SPI 362 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c16_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_4>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_4>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_8: usi@109500c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109500c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1014>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_5>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_5>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_17: i2c@10950000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10950000 0xc0>;
+                               interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c17_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_5>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_5>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_9: usi@109600c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109600c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1018>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_6>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_6>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_9: serial@10960000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10960000 0xc0>;
+                               interrupts = <GIC_SPI 364 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart9_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_6>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_6>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_9: spi@10960000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10960000 0x30>;
+                               interrupts = <GIC_SPI 364 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi9_bus &spi9_cs_func>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_6>,
+                                        <&cmu_peric1 CLK_DOUT_PERIC1_USI09_USI>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_6>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 19>, <&pdma0 18>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_18: i2c@10960000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10960000 0xc0>;
+                               interrupts = <GIC_SPI 364 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c18_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_6>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_6>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_9: usi@109700c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109700c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x101c>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_7>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_7>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_19: i2c@10970000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10970000 0xc0>;
+                               interrupts = <GIC_SPI 363 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c19_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_7>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_7>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_10: usi@109800c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109800c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1020>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_8>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_8>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_10: serial@10980000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x10980000 0xc0>;
+                               interrupts = <GIC_SPI 366 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart10_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_8>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_8>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_10: spi@10980000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x10980000 0x30>;
+                               interrupts = <GIC_SPI 366 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi10_bus &spi10_cs_func>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_8>,
+                                        <&cmu_peric1 CLK_DOUT_PERIC1_USI10_USI>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_8>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               dmas = <&pdma0 21>, <&pdma0 20>;
+                               dma-names = "tx", "rx";
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_20: i2c@10980000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10980000 0xc0>;
+                               interrupts = <GIC_SPI 366 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c20_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_8>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_8>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
                                status = "disabled";
                        };
                };
 
-               ufs_0_phy: ufs0-phy@17e04000 {
+               usi_i2c_10: usi@109900c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109900c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1024>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_9>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_9>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_21: i2c@10990000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x10990000 0xc0>;
+                               interrupts = <GIC_SPI 365 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c21_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_9>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_9>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_11: usi@109a00c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109a00c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x1028>;
+                       samsung,mode = <USI_V2_UART>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_10>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_10>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       serial_11: serial@109a0000 {
+                               compatible = "samsung,exynosautov9-uart",
+                                            "samsung,exynos850-uart";
+                               reg = <0x109a0000 0xc0>;
+                               interrupts = <GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&uart11_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_10>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_10>;
+                               clock-names = "uart", "clk_uart_baud0";
+                               samsung,uart-fifosize = <64>;
+                               status = "disabled";
+                       };
+
+                       spi_11: spi@109a0000 {
+                               compatible = "samsung,exynosautov9-spi";
+                               reg = <0x109a0000 0x30>;
+                               interrupts = <GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&spi11_bus &spi11_cs_func>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_10>,
+                                        <&cmu_peric1 CLK_DOUT_PERIC1_USI11_USI>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_10>;
+                               clock-names = "spi", "spi_busclk0", "spi_ioclk";
+                               samsung,spi-src-clk = <0>;
+                               num-cs = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
+                       hsi2c_22: i2c@109a0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x109a0000 0xc0>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c22_bus>;
+                               interrupts = <GIC_SPI 368 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_10>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_10>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               usi_i2c_11: usi@109b00c0 {
+                       compatible = "samsung,exynosautov9-usi",
+                                    "samsung,exynos850-usi";
+                       reg = <0x109b00c0 0x20>;
+                       samsung,sysreg = <&syscon_peric1 0x102c>;
+                       samsung,mode = <USI_V2_I2C>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+                       clocks = <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_11>,
+                                <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_11>;
+                       clock-names = "pclk", "ipclk";
+                       status = "disabled";
+
+                       hsi2c_23: i2c@109b0000 {
+                               compatible = "samsung,exynosautov9-hsi2c";
+                               reg = <0x109b0000 0xc0>;
+                               interrupts = <GIC_SPI 367 IRQ_TYPE_LEVEL_HIGH>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&hsi2c23_bus>;
+                               clocks = <&cmu_peric1 CLK_GOUT_PERIC1_IPCLK_11>,
+                                        <&cmu_peric1 CLK_GOUT_PERIC1_PCLK_11>;
+                               clock-names = "hsi2c", "hsi2c_pclk";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+               };
+
+               ufs_0_phy: phy@17e04000 {
                        compatible = "samsung,exynosautov9-ufs-phy";
                        reg = <0x17e04000 0xc00>;
                        reg-names = "phy-pma";
                        status = "disabled";
                };
 
-               ufs_0: ufs0@17e00000 {
-                       compatible ="samsung,exynosautov9-ufs";
+               ufs_0: ufs@17e00000 {
+                       compatible = "samsung,exynosautov9-ufs";
 
-                       reg = <0x17e00000 0x100>,  /* 0: HCI standard */
-                               <0x17e01100 0x410>,  /* 1: Vendor-specific */
-                               <0x17e80000 0x8000>,  /* 2: UNIPRO */
-                               <0x17dc0000 0x2200>;  /* 3: UFS protector */
+                       reg = <0x17e00000 0x100>,
+                             <0x17e01100 0x410>,
+                             <0x17e80000 0x8000>,
+                             <0x17dc0000 0x2200>;
                        reg-names = "hci", "vs_hci", "unipro", "ufsp";
                        interrupts = <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cmu_fsys2 CLK_GOUT_FSYS2_UFS_EMBD0_ACLK>,
                        samsung,sysreg = <&syscon_fsys2 0x710>;
                        status = "disabled";
                };
+
+               ufs_1_phy: phy@17f04000 {
+                       compatible = "samsung,exynosautov9-ufs-phy";
+                       reg = <0x17f04000 0xc00>;
+                       reg-names = "phy-pma";
+                       samsung,pmu-syscon = <&pmu_system_controller 0x72c>;
+                       #phy-cells = <0>;
+                       clocks = <&xtcxo>;
+                       clock-names = "ref_clk";
+                       status = "disabled";
+               };
+
+               ufs_1: ufs@17f00000 {
+                       compatible = "samsung,exynosautov9-ufs";
+
+                       reg = <0x17f00000 0x100>,
+                             <0x17f01100 0x410>,
+                             <0x17f80000 0x8000>,
+                             <0x17de0000 0x2200>;
+                       reg-names = "hci", "vs_hci", "unipro", "ufsp";
+                       interrupts = <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_fsys2 CLK_GOUT_FSYS2_UFS_EMBD1_ACLK>,
+                                <&cmu_fsys2 CLK_GOUT_FSYS2_UFS_EMBD1_UNIPRO>;
+                       clock-names = "core_clk", "sclk_unipro_main";
+                       freq-table-hz = <0 0>, <0 0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&ufs_rst_n_1 &ufs_refclk_out_1>;
+                       phys = <&ufs_1_phy>;
+                       phy-names = "ufs-phy";
+                       samsung,sysreg = <&syscon_fsys2 0x714>;
+                       status = "disabled";
+               };
+
+               watchdog_cl0: watchdog@10050000 {
+                       compatible = "samsung,exynosautov9-wdt";
+                       reg = <0x10050000 0x100>;
+                       interrupts = <GIC_SPI 476 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_peris CLK_GOUT_WDT_CLUSTER0>, <&xtcxo>;
+                       clock-names = "watchdog", "watchdog_src";
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       samsung,cluster-index = <0>;
+               };
+
+               watchdog_cl1: watchdog@10060000 {
+                       compatible = "samsung,exynosautov9-wdt";
+                       reg = <0x10060000 0x100>;
+                       interrupts = <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cmu_peris CLK_GOUT_WDT_CLUSTER1>, <&xtcxo>;
+                       clock-names = "watchdog", "watchdog_src";
+                       samsung,syscon-phandle = <&pmu_system_controller>;
+                       samsung,cluster-index = <1>;
+               };
        };
 };
 
index 238a83e..8bf7f7e 100644 (file)
@@ -58,6 +58,7 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-edimm2.2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-kontron-n801x-s.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-mx8menlo.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-nitrogen-r2.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-phyboard-polis-rdk.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-tqma8mqml-mba8mx.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-var-som-symphony.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw71xx-0x.dtb
@@ -79,9 +80,11 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mn-ddr4-evk.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-tqma8mqnl-mba8mx.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-var-som-symphony.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mn-venice-gw7902.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mp-dhcom-pdk2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-evk.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-icore-mx8mp-edimm2.2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-phyboard-pollux-rdk.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mp-tqma8mpql-mba8mpxl.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-venice-gw74xx.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-verdin-nonwifi-dahlia.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mp-verdin-nonwifi-dev.dtb
@@ -107,6 +110,7 @@ dtb-$(CONFIG_ARCH_MXC) += imx8qxp-ai_ml.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8qxp-colibri-eval-v3.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8ulp-evk.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx93-11x11-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
index e22c5e7..5a8d85a 100644 (file)
@@ -69,7 +69,7 @@
        flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "n25q128a11", "jedec,spi-nor";
+               compatible = "micron,n25q128a11", "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <10000000>;
        };
index 50a72cd..a863022 100644 (file)
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        };
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1021a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
+                                           QORIQ_CLK_PLL_DIV(4)>;
+                       clock-names = "sfp";
+               };
+
                sec_mon: sec_mon@1e90000 {
                        compatible = "fsl,sec-v5.4-mon", "fsl,sec-v5.0-mon",
                                     "fsl,sec-v4.0-mon";
                        status = "disabled";
                };
 
-               edma0: edma@2c00000 {
+               edma0: dma-controller@2c00000 {
                        #dma-cells = <2>;
                        compatible = "fsl,vf610-edma";
                        reg = <0x0 0x2c00000 0x0 0x10000>,
index 5baf060..0bb2f28 100644 (file)
@@ -93,7 +93,7 @@
                compatible = "mdio-mux-multiplexer";
                mux-controls = <&mux 0>;
                mdio-parent-bus = <&enetc_mdio_pf3>;
-               #address-cells=<1>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                /* on-board RGMII PHY */
index 92465f7..3376eea 100644 (file)
@@ -96,7 +96,7 @@
        };
 
        reboot {
-               compatible ="syscon-reboot";
+               compatible = "syscon-reboot";
                regmap = <&rst>;
                offset = <0>;
                mask = <0x02>;
        };
 
        gic: interrupt-controller@6000000 {
-               compatible= "arm,gic-v3";
+               compatible = "arm,gic-v3";
                #address-cells = <2>;
                #size-cells = <2>;
                ranges;
-               reg= <0x0 0x06000000 0 0x10000>, /* GIC Dist */
+               reg = <0x0 0x06000000 0 0x10000>, /* GIC Dist */
                        <0x0 0x06040000 0 0x40000>; /* GIC Redistributor */
-               #interrupt-cells= <3>;
+               #interrupt-cells = <3>;
                interrupt-controller;
                interrupts = <GIC_PPI 9 (GIC_CPU_MASK_RAW(0xf) |
                                         IRQ_TYPE_LEVEL_LOW)>;
                        sec_jr0: jr@10000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg     = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr1: jr@20000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg     = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr2: jr@30000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg     = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr3: jr@40000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg     = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
index 21200cb..ca3d5a9 100644 (file)
        };
 
        reboot {
-               compatible ="syscon-reboot";
+               compatible = "syscon-reboot";
                regmap = <&dcfg>;
                offset = <0xb0>;
                mask = <0x02>;
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <0 71 0x4>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <0 72 0x4>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <0 73 0x4>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <0 74 0x4>;
                        };
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1021a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
+                                           QORIQ_CLK_PLL_DIV(4)>;
+                       clock-names = "sfp";
+               };
+
                dcfg: dcfg@1ee0000 {
                        compatible = "fsl,ls1043a-dcfg", "syscon";
                        reg = <0x0 0x1ee0000 0x0 0x10000>;
                        big-endian;
                };
 
-               edma0: edma@2c00000 {
+               edma0: dma-controller@2c00000 {
                        #dma-cells = <2>;
                        compatible = "fsl,vf610-edma";
                        reg = <0x0 0x2c00000 0x0 0x10000>,
index 0085e83..feab604 100644 (file)
        };
 
        reboot {
-               compatible ="syscon-reboot";
+               compatible = "syscon-reboot";
                regmap = <&dcfg>;
                offset = <0xb0>;
                mask = <0x02>;
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                                compatible = "fsl,sec-v5.4-job-ring",
                                             "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
                        ranges = <0x0 0x5 0x08000000 0x8000000>;
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1021a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
+                                           QORIQ_CLK_PLL_DIV(4)>;
+                       clock-names = "sfp";
+               };
+
                dcfg: dcfg@1ee0000 {
                        compatible = "fsl,ls1046a-dcfg", "syscon";
                        reg = <0x0 0x1ee0000 0x0 0x1000>;
                        big-endian;
                };
 
-               edma0: edma@2c00000 {
+               edma0: dma-controller@2c00000 {
                        #dma-cells = <2>;
                        compatible = "fsl,vf610-edma";
                        reg = <0x0 0x2c00000 0x0 0x10000>,
index d3f03dc..ef6c896 100644 (file)
                 * external power off (e.g ATX Power Button)
                 * asserted
                 */
-               powerdn {
+               button-powerdn {
                        label = "External Power Down";
                        gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                };
 
                /* Rear Panel 'ADMIN' button (GPIO_H) */
-               admin {
+               button-admin {
                        label = "ADMIN button";
                        gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_WPS_BUTTON>;
        leds {
                compatible = "gpio-leds";
 
-               sfp1down {
+               led-0 {
                        label = "ten64:green:sfp1:down";
                        gpios = <&gpio3 11 GPIO_ACTIVE_HIGH>;
                };
 
-               sfp2up {
+               led-1 {
                        label = "ten64:green:sfp2:up";
                        gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>;
                };
 
-               admin {
+               led-2 {
                        label = "ten64:admin";
                        gpios = <&sfpgpio 12 GPIO_ACTIVE_HIGH>;
                };
index f476b7d..421d879 100644 (file)
                        };
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1028a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
+                                           QORIQ_CLK_PLL_DIV(4)>;
+                       clock-names = "sfp";
+               };
+
                tmu: tmu@1f80000 {
                        compatible = "fsl,qoriq-tmu";
                        reg = <0x0 0x1f80000 0x0 0x10000>;
                        sec_jr0: jr@10000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr1: jr@20000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr2: jr@30000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr3: jr@40000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
index 4ba1e04..d76f1c4 100644 (file)
@@ -73,7 +73,7 @@
        };
 
        reboot {
-               compatible ="syscon-reboot";
+               compatible = "syscon-reboot";
                regmap = <&rstcr>;
                offset = <0x0>;
                mask = <0x2>;
                        little-endian;
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1028a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
+                                           QORIQ_CLK_PLL_DIV(4)>;
+                       clock-names = "sfp";
+               };
+
                isc: syscon@1f70000 {
                        compatible = "fsl,ls2080a-isc", "syscon";
                        reg = <0x0 0x1f70000 0x0 0x10000>;
                        sec_jr0: jr@10000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr1: jr@20000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr2: jr@30000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr3: jr@40000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
index 2ecfa90..4d72119 100644 (file)
@@ -36,7 +36,7 @@
                compatible = "mdio-mux-multiplexer";
                mux-controls = <&mux 0>;
                mdio-parent-bus = <&emdio1>;
-               #address-cells=<1>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                mdio@0 { /* On-board PHY #1 RGMI1*/
                compatible = "mdio-mux-multiplexer";
                mux-controls = <&mux 1>;
                mdio-parent-bus = <&emdio2>;
-               #address-cells=<1>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                mdio@0 { /* Slot #1 (secondary EMI) */
index 47ea854..6680fb2 100644 (file)
                        sec_jr0: jr@10000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x10000 0x10000>;
+                               reg = <0x10000 0x10000>;
                                interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr1: jr@20000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x20000 0x10000>;
+                               reg = <0x20000 0x10000>;
                                interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr2: jr@30000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x30000 0x10000>;
+                               reg = <0x30000 0x10000>;
                                interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sec_jr3: jr@40000 {
                                compatible = "fsl,sec-v5.0-job-ring",
                                             "fsl,sec-v4.0-job-ring";
-                               reg        = <0x40000 0x10000>;
+                               reg = <0x40000 0x10000>;
                                interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
                        little-endian;
                };
 
+               sfp: efuse@1e80000 {
+                       compatible = "fsl,ls1028a-sfp";
+                       reg = <0x0 0x1e80000 0x0 0x10000>;
+                       clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL
+                                           QORIQ_CLK_PLL_DIV(4)>;
+                       clock-names = "sfp";
+               };
+
                isc: syscon@1f70000 {
                        compatible = "fsl,lx2160a-isc", "syscon";
                        reg = <0x0 0x1f70000 0x0 0x10000>;
index a1644ce..9f5ff1f 100644 (file)
@@ -34,7 +34,7 @@
                compatible = "mdio-mux-multiplexer";
                mux-controls = <&mux 0>;
                mdio-parent-bus = <&emdio1>;
-               #address-cells=<1>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                mdio@0 { /* On-board RTL8211F PHY #1 RGMII1 */
                compatible = "mdio-mux-multiplexer";
                mux-controls = <&mux 1>;
                mdio-parent-bus = <&emdio2>;
-               #address-cells=<1>;
+               #address-cells = <1>;
                #size-cells = <0>;
 
                mdio@0 { /* Slot #1 (secondary EMI) */
index a79f42a..82a1c44 100644 (file)
@@ -54,7 +54,7 @@ conn_subsys: bus@5b000000 {
                clock-names = "ipg", "per", "ahb";
                power-domains = <&pd IMX_SC_R_SDHC_1>;
                fsl,tuning-start-tap = <20>;
-               fsl,tuning-step= <2>;
+               fsl,tuning-step = <2>;
                status = "disabled";
        };
 
@@ -83,8 +83,8 @@ conn_subsys: bus@5b000000 {
                assigned-clocks = <&clk IMX_SC_R_ENET_0 IMX_SC_PM_CLK_PER>,
                                  <&clk IMX_SC_R_ENET_0 IMX_SC_C_CLKDIV>;
                assigned-clock-rates = <250000000>, <125000000>;
-               fsl,num-tx-queues=<3>;
-               fsl,num-rx-queues=<3>;
+               fsl,num-tx-queues = <3>;
+               fsl,num-rx-queues = <3>;
                power-domains = <&pd IMX_SC_R_ENET_0>;
                status = "disabled";
        };
@@ -103,8 +103,8 @@ conn_subsys: bus@5b000000 {
                assigned-clocks = <&clk IMX_SC_R_ENET_1 IMX_SC_PM_CLK_PER>,
                                  <&clk IMX_SC_R_ENET_1 IMX_SC_C_CLKDIV>;
                assigned-clock-rates = <250000000>, <125000000>;
-               fsl,num-tx-queues=<3>;
-               fsl,num-rx-queues=<3>;
+               fsl,num-tx-queues = <3>;
+               fsl,num-rx-queues = <3>;
                power-domains = <&pd IMX_SC_R_ENET_1>;
                status = "disabled";
        };
index f338a88..03266bd 100644 (file)
 &usbotg1 {
        vbus-supply = <&reg_usbotg1>;
        disable-over-current;
-       dr_mode="otg";
+       dr_mode = "otg";
        status = "okay";
 };
 
 &usbotg2 {
        pinctrl-names = "default";
        disable-over-current;
-       dr_mode="host";
+       dr_mode = "host";
        status = "okay";
 };
 
index c42b966..7d6317d 100644 (file)
                linux,autosuspend-period = <125>;
        };
 
+       audio_codec_bt_sco: audio-codec-bt-sco {
+               compatible = "linux,bt-sco";
+               #sound-dai-cells = <1>;
+       };
+
        wm8524: audio-codec {
                #sound-dai-cells = <0>;
                compatible = "wlf,wm8524";
                wlf,mute-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;
        };
 
+       sound-bt-sco {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "bt-sco-audio";
+               simple-audio-card,format = "dsp_a";
+               simple-audio-card,bitclock-inversion;
+               simple-audio-card,frame-master = <&btcpu>;
+               simple-audio-card,bitclock-master = <&btcpu>;
+
+               btcpu: simple-audio-card,cpu {
+                       sound-dai = <&sai2>;
+                       dai-tdm-slot-num = <2>;
+                       dai-tdm-slot-width = <16>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&audio_codec_bt_sco 1>;
+               };
+       };
+
        sound-wm8524 {
                compatible = "simple-audio-card";
                simple-audio-card,name = "wm8524-audio";
        status = "okay";
 };
 
+&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 = <24576000>;
+       status = "okay";
+};
+
 &sai3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai3>;
                >;
        };
 
+       pinctrl_sai2: sai2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI2_TXC_SAI2_TX_BCLK      0xd6
+                       MX8MM_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC     0xd6
+                       MX8MM_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0    0xd6
+                       MX8MM_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0    0xd6
+               >;
+       };
+
        pinctrl_sai3: sai3grp {
                fsl,pins = <
                        MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
index b40148d..9e6170d 100644 (file)
                        };
 
                        reg_buck1: buck1 {
-                               regulator-min-microvolt =  <400000>;
+                               regulator-min-microvolt = <400000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                                regulator-boot-on;
                        };
 
                        reg_buck2: buck2 {
-                               regulator-min-microvolt =  <400000>;
+                               regulator-min-microvolt = <400000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                                regulator-boot-on;
                        };
 
                        reg_buck3: buck3 {
-                               regulator-min-microvolt =  <400000>;
+                               regulator-min-microvolt = <400000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                                regulator-boot-on;
                        };
 
                        reg_buck4: buck4 {
-                               regulator-min-microvolt =  <400000>;
+                               regulator-min-microvolt = <400000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                                regulator-boot-on;
                        };
 
                        reg_buck5: buck5 {
-                               regulator-min-microvolt =  <400000>;
+                               regulator-min-microvolt = <400000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                                regulator-boot-on;
                        };
 
                        reg_buck6: buck6 {
-                               regulator-min-microvolt =  <400000>;
+                               regulator-min-microvolt = <400000>;
                                regulator-max-microvolt = <1800000>;
                                regulator-always-on;
                                regulator-boot-on;
index 92eaf4e..c97f4e0 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_led>;
 
-               user1 {
+               led-1 {
                        label = "TestLed601";
                        gpios = <&gpio4 18 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "mmc0";
                };
 
-               user2 {
+               led-2 {
                        label = "TestLed602";
                        gpios = <&gpio4 10 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-phyboard-polis-rdk.dts b/arch/arm64/boot/dts/freescale/imx8mm-phyboard-polis-rdk.dts
new file mode 100644 (file)
index 0000000..4a3df2b
--- /dev/null
@@ -0,0 +1,450 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2022 PHYTEC Messtechnik GmbH
+ * Author: Teresa Remmet <t.remmet@phytec.de>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
+#include "imx8mm-phycore-som.dtsi"
+
+/ {
+       model = "PHYTEC phyBOARD-Polis-i.MX8MM RDK";
+       compatible = "phytec,imx8mm-phyboard-polis-rdk",
+                    "phytec,imx8mm-phycore-som", "fsl,imx8mm";
+
+       chosen {
+               stdout-path = &uart3;
+       };
+
+       bt_osc_32k: bt-lp-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <32768>;
+               clock-output-names = "bt_osc_32k";
+               #clock-cells = <0>;
+       };
+
+       can_osc_40m: can-clock {
+               compatible = "fixed-clock";
+               clock-frequency = <40000000>;
+               clock-output-names = "can_osc_40m";
+               #clock-cells = <0>;
+       };
+
+       fan {
+               compatible = "gpio-fan";
+               gpios = <&gpio4 8 GPIO_ACTIVE_HIGH>;
+               gpio-fan,speed-map = <0     0
+                                     13000 1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_fan>;
+               #cooling-cells = <2>;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_leds>;
+
+               led-0 {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_DISK;
+                       gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mmc2";
+               };
+
+               led-1 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_DISK;
+                       gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mmc1";
+               };
+
+               led-2 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_CPU;
+                       gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       usdhc1_pwrseq: pwr-seq {
+               compatible = "mmc-pwrseq-simple";
+               post-power-on-delay-ms = <100>;
+               power-off-delay-us = <60>;
+               reset-gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
+       };
+
+       reg_can_en: regulator-can-en {
+               compatible = "regulator-fixed";
+               gpio = <&gpio1 9 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_can_en>;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "CAN_EN";
+               startup-delay-us = <20>;
+       };
+
+       reg_usb_otg1_vbus: regulator-usb-otg1 {
+               compatible = "regulator-fixed";
+               gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_usbotg1pwrgrp>;
+               regulator-name = "usb_otg1_vbus";
+               regulator-max-microvolt = <5000000>;
+               regulator-min-microvolt = <5000000>;
+       };
+
+       reg_usdhc2_vmmc: regulator-usdhc2 {
+               compatible = "regulator-fixed";
+               gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               off-on-delay-us = <20000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_usdhc2_vmmc>;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "VSD_3V3";
+       };
+
+       reg_vcc_3v3: regulator-vcc-3v3 {
+               compatible = "regulator-fixed";
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "VCC_3V3";
+       };
+};
+
+/* SPI - CAN MCP251XFD */
+&ecspi1 {
+       cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       status = "okay";
+
+       can0: can@0 {
+               compatible = "microchip,mcp251xfd";
+               clocks = <&can_osc_40m>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_can_int>;
+               reg = <0>;
+               spi-max-frequency = <20000000>;
+               xceiver-supply = <&reg_can_en>;
+       };
+};
+
+&gpio1 {
+       gpio-line-names = "nINT_ETHPHY", "LED_RED", "WDOG_INT", "X_RTC_INT",
+               "", "", "", "RESET_ETHPHY",
+               "CAN_nINT", "CAN_EN", "nENABLE_FLATLINK", "",
+               "USB_OTG_VBUS_EN", "", "LED_GREEN", "LED_BLUE";
+};
+
+&gpio2 {
+       gpio-line-names = "", "", "", "",
+               "", "", "BT_REG_ON", "WL_REG_ON",
+               "BT_DEV_WAKE", "BT_HOST_WAKE", "", "",
+               "X_SD2_CD_B", "", "", "",
+               "", "", "", "SD2_RESET_B";
+};
+
+&gpio4 {
+       gpio-line-names = "", "", "", "",
+               "", "", "", "",
+               "FAN", "miniPCIe_nPERST", "", "",
+               "COEX1", "COEX2";
+};
+
+&gpio5 {
+       gpio-line-names = "", "", "", "",
+               "", "", "", "",
+               "", "ECSPI1_SS0";
+};
+
+/* PCIe */
+&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_pcie>;
+       reset-gpio = <&gpio4 9 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&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>;
+       status = "okay";
+};
+
+&rv3028 {
+       trickle-resistor-ohms = <3000>;
+};
+
+&snvs_pwrkey {
+       status = "okay";
+};
+
+/* UART - RS232/RS485 */
+&uart1 {
+       assigned-clocks = <&clk IMX8MM_CLK_UART1>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       uart-has-rtscts;
+       status = "okay";
+};
+
+/* UART - Sterling-LWB Bluetooth */
+&uart2 {
+       assigned-clocks = <&clk IMX8MM_CLK_UART2>;
+       assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+       fsl,dte-mode;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2_bt>;
+       uart-has-rtscts;
+       status = "okay";
+
+       bluetooth {
+               compatible = "brcm,bcm43438-bt";
+               clocks = <&bt_osc_32k>;
+               clock-names = "lpo";
+               device-wakeup-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
+               interrupt-names = "host-wakeup";
+               interrupt-parent = <&gpio2>;
+               interrupts = <9 IRQ_TYPE_EDGE_BOTH>;
+               max-speed = <2000000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_bt>;
+               shutdown-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
+               vddio-supply = <&reg_vcc_3v3>;
+       };
+};
+
+/* UART - console */
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       status = "okay";
+};
+
+/* USB */
+&usbotg1 {
+       adp-disable;
+       dr_mode = "otg";
+       over-current-active-low;
+       samsung,picophy-pre-emp-curr-control = <3>;
+       samsung,picophy-dc-vol-level-adjust = <7>;
+       srp-disable;
+       vbus-supply = <&reg_usb_otg1_vbus>;
+       status = "okay";
+};
+
+&usbotg2 {
+       disable-over-current;
+       dr_mode = "host";
+       samsung,picophy-pre-emp-curr-control = <3>;
+       samsung,picophy-dc-vol-level-adjust = <7>;
+       status = "okay";
+};
+
+/* SDIO - Sterling-LWB Wifi */
+&usdhc1 {
+       assigned-clocks = <&clk IMX8MM_CLK_USDHC1>;
+       assigned-clock-rates = <200000000>;
+       bus-width = <4>;
+       mmc-pwrseq = <&usdhc1_pwrseq>;
+       non-removable;
+       no-1-8-v;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>;
+       #address-cells = <1>;
+       #size-cells = <0>;
+       status = "okay";
+
+       brcmf: wifi@1 {
+               compatible = "brcm,bcm4329-fmac";
+               reg = <1>;
+       };
+};
+
+/* SD-Card */
+&usdhc2 {
+       assigned-clocks = <&clk IMX8MM_CLK_USDHC2>;
+       assigned-clock-rates = <200000000>;
+       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_gpio>;
+       pinctrl-1 = <&pinctrl_usdhc2_100mhz>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_gpio>;
+       vmmc-supply = <&reg_usdhc2_vmmc>;
+       vqmmc-supply = <&reg_nvcc_sd2>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl_bt: btgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_DATA4_GPIO2_IO6        0x00
+                       MX8MM_IOMUXC_SD1_DATA6_GPIO2_IO8        0x00
+                       MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9        0x00
+               >;
+       };
+
+       pinctrl_can_en: can-engrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO09_GPIO1_IO9       0x00
+               >;
+       };
+
+       pinctrl_can_int: can-intgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO08_GPIO1_IO8       0x00
+               >;
+       };
+
+       pinctrl_ecspi1: ecspi1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ECSPI1_MISO_ECSPI1_MISO    0x80
+                       MX8MM_IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI    0x80
+                       MX8MM_IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK    0x80
+                       MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9       0x00
+               >;
+       };
+
+       pinctrl_fan: fan0grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI1_RXD6_GPIO4_IO8        0x16
+               >;
+       };
+
+       pinctrl_leds: leds1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO01_GPIO1_IO1       0x16
+                       MX8MM_IOMUXC_GPIO1_IO14_GPIO1_IO14      0x16
+                       MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15      0x16
+               >;
+       };
+
+       pinctrl_pcie: pciegrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI1_RXD7_GPIO4_IO9        0x00
+                       MX8MM_IOMUXC_SAI1_TXD0_GPIO4_IO12       0x12
+                       MX8MM_IOMUXC_SAI1_TXD7_GPIO4_IO19       0x12
+               >;
+       };
+
+       pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_RESET_B_GPIO2_IO19     0x40
+               >;
+       };
+
+       pinctrl_uart1: uart1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI2_RXC_UART1_DCE_RX      0x00
+                       MX8MM_IOMUXC_SAI2_RXD0_UART1_DCE_RTS_B  0x00
+                       MX8MM_IOMUXC_SAI2_RXFS_UART1_DCE_TX     0x00
+                       MX8MM_IOMUXC_SAI2_TXFS_UART1_DCE_CTS_B  0x00
+               >;
+       };
+
+       pinctrl_uart2_bt: uart2btgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SAI3_RXC_UART2_DTE_RTS_B   0x00
+                       MX8MM_IOMUXC_SAI3_RXD_UART2_DTE_CTS_B   0x00
+                       MX8MM_IOMUXC_SAI3_TXC_UART2_DTE_RX      0x00
+                       MX8MM_IOMUXC_SAI3_TXFS_UART2_DTE_TX     0x00
+               >;
+       };
+
+       pinctrl_uart3: uart3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_UART3_RXD_UART3_DCE_RX     0x40
+                       MX8MM_IOMUXC_UART3_TXD_UART3_DCE_TX     0x40
+               >;
+       };
+
+       pinctrl_usbotg1pwrgrp: usbotg1pwrgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12      0x00
+               >;
+       };
+
+       pinctrl_usdhc1: usdhc1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK         0x182
+                       MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD         0xc6
+                       MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0     0xc6
+                       MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1     0xc6
+                       MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2     0xc6
+                       MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3     0xc6
+               >;
+       };
+
+       pinctrl_usdhc2_gpio: usdhc2gpiogrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12        0x40
+               >;
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+                       MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK         0x192
+                       MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD         0x1d2
+                       MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0     0x1d2
+                       MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1     0x1d2
+                       MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2     0x1d2
+                       MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3     0x1d2
+               >;
+       };
+
+       pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+                       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_GPIO1_IO04_USDHC2_VSELECT  0x1d0
+                       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_wlan: wlangrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_SD1_DATA5_GPIO2_IO7        0x00
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-phycore-som.dtsi
new file mode 100644 (file)
index 0000000..995b44e
--- /dev/null
@@ -0,0 +1,440 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2022 PHYTEC Messtechnik GmbH
+ * Author: Teresa Remmet <t.remmet@phytec.de>
+ */
+
+#include "imx8mm.dtsi"
+#include <dt-bindings/net/ti-dp83867.h>
+
+/ {
+       model = "PHYTEC phyCORE-i.MX8MM";
+       compatible = "phytec,imx8mm-phycore-som", "fsl,imx8mm";
+
+       aliases {
+               rtc0 = &rv3028;
+               rtc1 = &snvs_rtc;
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0x0 0x40000000 0 0x80000000>;
+       };
+
+       reg_vdd_3v3_s: regulator-vdd-3v3-s {
+               compatible = "regulator-fixed";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "VDD_3V3_S";
+       };
+};
+
+&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>;
+               };
+       };
+};
+
+/* Ethernet */
+&fec1 {
+       fsl,magic-packet;
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethphy0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_fec1>;
+       status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethphy0: ethernet-phy@0 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       enet-phy-lane-no-swap;
+                       ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
+                       ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
+                       ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
+                       ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
+                       reg = <0>;
+                       reset-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
+                       reset-assert-us = <1000>;
+                       reset-deassert-us = <1000>;
+               };
+       };
+};
+
+/* SPI Flash */
+&flexspi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexspi0>;
+       status = "okay";
+
+       som_flash: flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <80000000>;
+               spi-rx-bus-width = <4>;
+               spi-tx-bus-width = <1>;
+       };
+};
+
+&gpio1 {
+       gpio-line-names = "nINT_ETHPHY", "", "WDOG_INT", "X_RTC_INT",
+               "", "", "", "RESET_ETHPHY",
+               "", "", "nENABLE_FLATLINK";
+};
+
+/* I2C1 */
+&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";
+
+       pmic@8 {
+               compatible = "nxp,pf8121a";
+               reg = <0x08>;
+
+               regulators {
+                       reg_nvcc_sd1: ldo1 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-name = "NVCC_SD1 (LDO1)";
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       reg_nvcc_sd2: ldo2 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "NVCC_SD2 (LDO2)";
+                               vselect-en;
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       reg_vcc_enet: ldo3 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <2500000>;
+                               regulator-min-microvolt = <1500000>;
+                               regulator-name = "VCC_ENET_2V5 (LDO3)";
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       reg_vdda_1v8: ldo4 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1500000>;
+                               regulator-name = "VDDA_1V8 (LDO4)";
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-min-microvolt = <1500000>;
+                                       regulator-suspend-max-microvolt = <1500000>;
+                               };
+                       };
+
+                       reg_soc_vdda_phy: buck1 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <900000>;
+                               regulator-min-microvolt = <400000>;
+                               regulator-name = "VDD_SOC_VDDA_PHY_0P8 (BUCK1)";
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-min-microvolt = <400000>;
+                                       regulator-suspend-max-microvolt = <400000>;
+                               };
+                       };
+
+                       reg_vdd_gpu_dram: buck2 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-min-microvolt = <1000000>;
+                               regulator-name = "VDD_GPU_DRAM (BUCK2)";
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-max-microvolt = <1000000>;
+                                       regulator-suspend-min-microvolt = <1000000>;
+                               };
+                       };
+
+                       reg_vdd_gpu: buck3 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-min-microvolt = <400000>;
+                               regulator-name = "VDD_VPU (BUCK3)";
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       reg_vdd_mipi: buck4 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1050000>;
+                               regulator-min-microvolt = <900000>;
+                               regulator-name = "VDD_MIPI_0P9 (BUCK4)";
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       reg_vdd_arm: buck5 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1050000>;
+                               regulator-min-microvolt = <400000>;
+                               regulator-name = "VDD_ARM (BUCK5)";
+
+                               regulator-state-mem {
+                                       regulator-off-in-suspend;
+                               };
+                       };
+
+                       reg_vdd_1v8: buck6 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "VDD_1V8 (BUCK6)";
+
+                               regulator-state-mem {
+                                       regulator-on-in-suspend;
+                                       regulator-suspend-max-microvolt = <1800000>;
+                                       regulator-suspend-min-microvolt = <1800000>;
+                               };
+                       };
+
+                       reg_nvcc_dram: buck7 {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-min-microvolt = <1100000>;
+                               regulator-name = "NVCC_DRAM_1P1V (BUCK7)";
+                       };
+
+                       reg_vsnvs: vsnvs {
+                               regulator-always-on;
+                               regulator-boot-on;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-min-microvolt = <1800000>;
+                               regulator-name = "NVCC_SNVS_1P8 (VSNVS)";
+                       };
+               };
+       };
+
+       sn65dsi83: bridge@2d {
+               compatible = "ti,sn65dsi83";
+               enable-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_sn65dsi83>;
+               reg = <0x2d>;
+               status = "disabled";
+       };
+
+       eeprom@51 {
+               compatible = "atmel,24c32";
+               pagesize = <32>;
+               reg = <0x51>;
+               vcc-supply = <&reg_vdd_3v3_s>;
+       };
+
+       rv3028: rtc@52 {
+               compatible = "microcrystal,rv3028";
+               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+               interrupt-parent = <&gpio1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_rtc>;
+               reg = <0x52>;
+       };
+};
+
+/* EMMC */
+&usdhc3 {
+       assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>;
+       assigned-clock-rates = <400000000>;
+       bus-width = <8>;
+       keep-power-in-suspend;
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc3>;
+       pinctrl-1 = <&pinctrl_usdhc3_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc3_200mhz>;
+       non-removable;
+       status = "okay";
+};
+
+/* Watchdog */
+&wdog1 {
+       fsl,ext-reset-output;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl_fec1: fec1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_ENET_MDC_ENET1_MDC                 0x2
+                       MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO               0x2
+                       MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0           0x90
+                       MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1           0x90
+                       MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2           0x90
+                       MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3           0x90
+                       MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC           0x90
+                       MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL     0x90
+                       MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0           0x16
+                       MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1           0x16
+                       MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2           0x16
+                       MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3           0x16
+                       MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC           0x16
+                       MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL     0x16
+                       MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7               0x10
+               >;
+       };
+
+       pinctrl_flexspi0: flexspi0grp {
+               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
+               >;
+       };
+
+       pinctrl_i2c1: i2c1grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA                  0x400001c0
+                       MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL                  0x400001c0
+               >;
+       };
+
+       pinctrl_i2c1_gpio: i2c1gpiogrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_I2C1_SDA_GPIO5_IO15                0x1e0
+                       MX8MM_IOMUXC_I2C1_SCL_GPIO5_IO14                0x1e0
+               >;
+       };
+
+       pinctrl_rtc: rtcgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3               0x1c0
+               >;
+       };
+
+       pinctrl_sn65dsi83: sn65dsi83grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10              0x0
+               >;
+       };
+
+       pinctrl_usdhc3: usdhc3grp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d0
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x190
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d0
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            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_WE_B_USDHC3_CLK               0x190
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d0
+               >;
+       };
+
+       pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d4
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x194
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d4
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            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_WE_B_USDHC3_CLK               0x194
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d4
+               >;
+       };
+
+       pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7              0x1d6
+                       MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE           0x196
+                       MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5            0x1d6
+                       MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6            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_WE_B_USDHC3_CLK               0x196
+                       MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD               0x1d6
+               >;
+       };
+
+       pinctrl_wdog: wdoggrp {
+               fsl,pins = <
+                       MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B            0x26
+               >;
+       };
+};
index ac1fe15..d643381 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               back {
+               key-back {
                        label = "Back";
                        gpios = <&pca9534 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BACK>;
                };
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&pca9534 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                };
 
-               menu {
+               key-menu {
                        label = "Menu";
                        gpios = <&pca9534 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_MENU>;
index 00f86ca..66a0d10 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               user-pb {
+               key-user-pb {
                        label = "user_pb";
                        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                };
 
-               user-pb1x {
+               key-user-pb1x {
                        label = "user_pb1x";
                        linux,code = <BTN_1>;
                        interrupt-parent = <&gsc>;
                        interrupts = <1>;
                };
 
-               eeprom-wp {
+               key-eeprom-wp {
                        label = "eeprom_wp";
                        linux,code = <BTN_3>;
                        interrupt-parent = <&gsc>;
                        interrupts = <2>;
                };
 
-               tamper {
+               key-tamper {
                        label = "tamper";
                        linux,code = <BTN_4>;
                        interrupt-parent = <&gsc>;
                                regulator-name = "buck1";
                                regulator-min-microvolt = <800000>;
                                regulator-max-microvolt = <1000000>;
-                               regulator-min-microamp  = <3800000>;
-                               regulator-max-microamp  = <6800000>;
+                               regulator-min-microamp = <3800000>;
+                               regulator-max-microamp = <6800000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
                                regulator-name = "buck2";
                                regulator-min-microvolt = <800000>;
                                regulator-max-microvolt = <900000>;
-                               regulator-min-microamp  = <2200000>;
-                               regulator-max-microamp  = <5200000>;
+                               regulator-min-microamp = <2200000>;
+                               regulator-max-microamp = <5200000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
                                regulator-name = "buck3";
                                regulator-min-microvolt = <800000>;
                                regulator-max-microvolt = <1000000>;
-                               regulator-min-microamp  = <3800000>;
-                               regulator-max-microamp  = <6800000>;
+                               regulator-min-microamp = <3800000>;
+                               regulator-max-microamp = <6800000>;
                                regulator-always-on;
                        };
 
                                regulator-name = "buck4";
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-min-microamp  = <2200000>;
-                               regulator-max-microamp  = <5200000>;
+                               regulator-min-microamp = <2200000>;
+                               regulator-max-microamp = <5200000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
index 24737e8..35fb929 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               user-pb {
+               key-user-pb {
                        label = "user_pb";
                        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                };
 
-               user-pb1x {
+               key-user-pb1x {
                        label = "user_pb1x";
                        linux,code = <BTN_1>;
                        interrupt-parent = <&gsc>;
                        interrupts = <1>;
                };
 
-               eeprom-wp {
+               key-eeprom-wp {
                        label = "eeprom_wp";
                        linux,code = <BTN_3>;
                        interrupt-parent = <&gsc>;
                        interrupts = <2>;
                };
 
-               tamper {
+               key-tamper {
                        label = "tamper";
                        linux,code = <BTN_4>;
                        interrupt-parent = <&gsc>;
index 407ab45..6dc5eda 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               user-pb {
+               key-user-pb {
                        label = "user_pb";
                        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                };
 
-               user-pb1x {
+               key-user-pb1x {
                        label = "user_pb1x";
                        linux,code = <BTN_1>;
                        interrupt-parent = <&gsc>;
                        interrupts = <1>;
                };
 
-               eeprom-wp {
+               key-eeprom-wp {
                        label = "eeprom_wp";
                        linux,code = <BTN_3>;
                        interrupt-parent = <&gsc>;
                        interrupts = <2>;
                };
 
-               tamper {
+               key-tamper {
                        label = "tamper";
                        linux,code = <BTN_4>;
                        interrupt-parent = <&gsc>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1>, <&pinctrl_uart1_gpio>;
        rts-gpios = <&gpio4 10 GPIO_ACTIVE_LOW>;
-       cts-gpios = <&gpio4 11 GPIO_ACTIVE_LOW>;
+       cts-gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
        uart-has-rtscts;
        status = "okay";
 };
index a7dae9b..a65761a 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               user-pb {
+               key-user-pb {
                        label = "user_pb";
                        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                };
 
-               user-pb1x {
+               key-user-pb1x {
                        label = "user_pb1x";
                        linux,code = <BTN_1>;
                        interrupt-parent = <&gsc>;
@@ -53,7 +53,7 @@
                        interrupts = <1>;
                };
 
-               eeprom-wp {
+               key-eeprom-wp {
                        label = "eeprom_wp";
                        linux,code = <BTN_3>;
                        interrupt-parent = <&gsc>;
index eafa88d..d1b4582 100644 (file)
@@ -43,7 +43,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_keys>;
 
-               wakeup {
+               key-wakeup {
                        debounce-interval = <10>;
                        /* Verdin CTRL_WAKE1_MICO# (SODIMM 252) */
                        gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
        cpu-supply = <&reg_vdd_arm>;
 };
 
+&cpu_alert0 {
+       temperature = <95000>;
+};
+
+&cpu_crit0 {
+       temperature = <105000>;
+};
+
 &ddrc {
        operating-points-v2 = <&ddrc_opp_table>;
 
index 1bf0704..afb90f5 100644 (file)
        clk_ext4: clock-ext4 {
                compatible = "fixed-clock";
                #clock-cells = <0>;
-               clock-frequency= <133000000>;
+               clock-frequency = <133000000>;
                clock-output-names = "clk_ext4";
        };
 
                clock-names = "main_clk";
        };
 
-       soc@0 {
+       soc: soc@0 {
                compatible = "fsl,imx8mm-soc", "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                                        wakeup-source;
                                        status = "disabled";
                                };
+
+                               snvs_lpgpr: snvs-lpgpr {
+                                       compatible = "fsl,imx8mm-snvs-lpgpr",
+                                                    "fsl,imx7d-snvs-lpgpr";
+                               };
                        };
 
                        clk: clock-controller@30380000 {
                                        compatible = "fsl,sec-v4.0-job-ring";
                                        reg = <0x1000 0x1000>;
                                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                                       status = "disabled";
                                };
 
                                sec_jr1: jr@2000 {
                                         <&clk IMX8MM_CLK_USDHC1_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                         <&clk IMX8MM_CLK_USDHC2_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                         <&clk IMX8MM_CLK_USDHC3_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
index 02f37dc..9e82069 100644 (file)
 };
 
 &easrc {
-       fsl,asrc-rate  = <48000>;
+       fsl,asrc-rate = <48000>;
        status = "okay";
 };
 
 &usbotg1 {
        vbus-supply = <&reg_usb_otg_vbus>;
        disable-over-current;
-       dr_mode="otg";
+       dr_mode = "otg";
        status = "okay";
 };
 
index d1f6ccc..261c365 100644 (file)
                linux,autosuspend-period = <125>;
        };
 
+       audio_codec_bt_sco: audio-codec-bt-sco {
+               compatible = "linux,bt-sco";
+               #sound-dai-cells = <1>;
+       };
+
        wm8524: audio-codec {
                #sound-dai-cells = <0>;
                compatible = "wlf,wm8524";
                clock-names = "mclk";
        };
 
+       sound-bt-sco {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "bt-sco-audio";
+               simple-audio-card,format = "dsp_a";
+               simple-audio-card,bitclock-inversion;
+               simple-audio-card,frame-master = <&btcpu>;
+               simple-audio-card,bitclock-master = <&btcpu>;
+
+               btcpu: simple-audio-card,cpu {
+                       sound-dai = <&sai2>;
+                       dai-tdm-slot-num = <2>;
+                       dai-tdm-slot-width = <16>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&audio_codec_bt_sco 1>;
+               };
+       };
+
        sound-wm8524 {
                compatible = "fsl,imx-audio-wm8524";
                model = "wm8524-audio";
 };
 
 &easrc {
-       fsl,asrc-rate  = <48000>;
+       fsl,asrc-rate = <48000>;
        status = "okay";
 };
 
        };
 };
 
+&sai2 {
+       #sound-dai-cells = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai2>;
+       assigned-clocks = <&clk IMX8MN_CLK_SAI2>;
+       assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <24576000>;
+       status = "okay";
+};
+
 &sai3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai3>;
                >;
        };
 
+       pinctrl_sai2: sai2grp {
+               fsl,pins = <
+                       MX8MN_IOMUXC_SAI2_TXC_SAI2_TX_BCLK      0xd6
+                       MX8MN_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC     0xd6
+                       MX8MN_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0    0xd6
+                       MX8MN_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0    0xd6
+               >;
+       };
+
        pinctrl_sai3: sai3grp {
                fsl,pins = <
                        MX8MN_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
index f61c487..3ed7021 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               back {
+               key-back {
                        label = "Back";
                        gpios = <&pca9534 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_BACK>;
                };
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&pca9534 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
                };
 
-               menu {
+               key-menu {
                        label = "Menu";
                        gpios = <&pca9534 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_MENU>;
index 367a232..636f860 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               user-pb {
+               key-user-pb {
                        label = "user_pb";
                        gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                };
 
-               user-pb1x {
+               key-user-pb1x {
                        label = "user_pb1x";
                        linux,code = <BTN_1>;
                        interrupt-parent = <&gsc>;
                        interrupts = <1>;
                };
 
-               eeprom-wp {
+               key-eeprom-wp {
                        label = "eeprom_wp";
                        linux,code = <BTN_3>;
                        interrupt-parent = <&gsc>;
                        interrupts = <2>;
                };
 
-               tamper {
+               key-tamper {
                        label = "tamper";
                        linux,code = <BTN_4>;
                        interrupt-parent = <&gsc>;
index e41e1d5..0c71b74 100644 (file)
        clk_ext4: clock-ext4 {
                compatible = "fixed-clock";
                #clock-cells = <0>;
-               clock-frequency= <133000000>;
+               clock-frequency = <133000000>;
                clock-output-names = "clk_ext4";
        };
 
                arm,no-tick-in-suspend;
        };
 
-       soc@0 {
+       soc: soc@0 {
                compatible = "fsl,imx8mn-soc", "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                                                    "ctx2_rx", "ctx2_tx",
                                                    "ctx3_rx", "ctx3_tx";
                                        firmware-name = "imx/easrc/easrc-imx8mn.bin";
-                                       fsl,asrc-rate  = <8000>;
+                                       fsl,asrc-rate = <8000>;
                                        fsl,asrc-format = <2>;
                                        status = "disabled";
                                };
                                         compatible = "fsl,sec-v4.0-job-ring";
                                         reg = <0x1000 0x1000>;
                                         interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                                        status = "disabled";
                                };
 
                                sec_jr1: jr@2000 {
                                         <&clk IMX8MN_CLK_USDHC1_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                         <&clk IMX8MN_CLK_USDHC2_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                         <&clk IMX8MN_CLK_USDHC3_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-dhcom-pdk2.dts b/arch/arm64/boot/dts/freescale/imx8mp-dhcom-pdk2.dts
new file mode 100644 (file)
index 0000000..2ca2ede
--- /dev/null
@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2022 Marek Vasut <marex@denx.de>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/net/qca-ar803x.h>
+#include <dt-bindings/phy/phy-imx8-pcie.h>
+#include "imx8mp-dhcom-som.dtsi"
+
+/ {
+       model = "DH electronics i.MX8M Plus DHCOM Premium Developer Kit (2)";
+       compatible = "dh,imx8mp-dhcom-pdk2", "fsl,imx8mp";
+
+       chosen {
+               stdout-path = &uart1;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               button-0 {
+                       gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; /* GPIO A */
+                       label = "TA1-GPIO-A";
+                       linux,code = <KEY_A>;
+                       pinctrl-0 = <&pinctrl_dhcom_a>;
+                       pinctrl-names = "default";
+                       wakeup-source;
+               };
+
+               button-1 {
+                       gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; /* GPIO B */
+                       label = "TA2-GPIO-B";
+                       linux,code = <KEY_B>;
+                       pinctrl-0 = <&pinctrl_dhcom_b>;
+                       pinctrl-names = "default";
+                       wakeup-source;
+               };
+
+               button-2 {
+                       gpios = <&gpio5 2 GPIO_ACTIVE_LOW>; /* GPIO C */
+                       label = "TA3-GPIO-C";
+                       linux,code = <KEY_C>;
+                       pinctrl-0 = <&pinctrl_dhcom_c>;
+                       pinctrl-names = "default";
+                       wakeup-source;
+               };
+
+               button-3 {
+                       gpios = <&gpio4 27 GPIO_ACTIVE_LOW>; /* GPIO D */
+                       label = "TA4-GPIO-D";
+                       linux,code = <KEY_D>;
+                       pinctrl-0 = <&pinctrl_dhcom_d>;
+                       pinctrl-names = "default";
+                       wakeup-source;
+               };
+       };
+
+       led {
+               compatible = "gpio-leds";
+
+               led-0 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       default-state = "off";
+                       function = LED_FUNCTION_INDICATOR;
+                       gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>; /* GPIO E */
+                       pinctrl-0 = <&pinctrl_dhcom_e>;
+                       pinctrl-names = "default";
+               };
+
+               led-1 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       default-state = "off";
+                       function = LED_FUNCTION_INDICATOR;
+                       gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* GPIO F */
+                       pinctrl-0 = <&pinctrl_dhcom_f>;
+                       pinctrl-names = "default";
+               };
+
+               led-2 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       default-state = "off";
+                       function = LED_FUNCTION_INDICATOR;
+                       gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; /* GPIO H */
+                       pinctrl-0 = <&pinctrl_dhcom_h>;
+                       pinctrl-names = "default";
+               };
+
+               led-3 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       default-state = "off";
+                       function = LED_FUNCTION_INDICATOR;
+                       gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; /* GPIO I */
+                       pinctrl-0 = <&pinctrl_dhcom_i>;
+                       pinctrl-names = "default";
+               };
+       };
+};
+
+/*
+ * PDK2 carrier board uses SoM with KSZ9131 populated and connected to
+ * SoM EQoS ethernet RGMII interface. Remove the other SoM PHY DT node.
+ */
+/delete-node/ &ethphy0f;
+
+/*
+ * PDK2 carrier board has KSZ9021 PHY populated and connected to SoM FEC
+ * ethernet RGMII interface. The SoM is not populated with second FEC PHY.
+ */
+/delete-node/ &ethphy1f;
+
+&fec { /* Second ethernet */
+       phy-handle = <&ethphypdk>;
+
+       mdio {
+               ethphypdk: ethernet-phy@7 { /* KSZ 9021 */
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       pinctrl-0 = <&pinctrl_ethphy1>;
+                       pinctrl-names = "default";
+                       interrupt-parent = <&gpio4>;
+                       interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+                       max-speed = <100>;
+                       reg = <7>;
+                       reset-assert-us = <1000>;
+                       reset-deassert-us = <1000>;
+                       reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
+                       rxc-skew-ps = <3000>;
+                       rxd0-skew-ps = <0>;
+                       rxd1-skew-ps = <0>;
+                       rxd2-skew-ps = <0>;
+                       rxd3-skew-ps = <0>;
+                       rxdv-skew-ps = <0>;
+                       txc-skew-ps = <3000>;
+                       txd0-skew-ps = <0>;
+                       txd1-skew-ps = <0>;
+                       txd2-skew-ps = <0>;
+                       txd3-skew-ps = <0>;
+                       txen-skew-ps = <0>;
+               };
+       };
+};
+
+&flexcan1 {
+       status = "okay";
+};
+
+&usb3_1 {
+       fsl,over-current-active-low;
+};
+
+&iomuxc {
+       /*
+        * GPIO_A,B,C,D are connected to buttons.
+        * GPIO_E,F,H,I are connected to LEDs.
+        * GPIO_M is connected to CLKOUT2.
+        */
+       pinctrl-0 = <&pinctrl_hog_base
+                    &pinctrl_dhcom_g &pinctrl_dhcom_j
+                    &pinctrl_dhcom_k &pinctrl_dhcom_l
+                    &pinctrl_dhcom_int>;
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-dhcom-som.dtsi
new file mode 100644 (file)
index 0000000..a616eb3
--- /dev/null
@@ -0,0 +1,1030 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2021-2022 Marek Vasut <marex@denx.de>
+ */
+
+#include "imx8mp.dtsi"
+
+/ {
+       model = "DH electronics i.MX8M Plus DHCOM SoM";
+       compatible = "dh,imx8mp-dhcom-som", "fsl,imx8mp";
+
+       aliases {
+               ethernet0 = &eqos;
+               ethernet1 = &fec;
+               rtc0 = &rv3032;
+               rtc1 = &snvs_rtc;
+               spi0 = &flexspi;
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               /* Memory size 512 MiB..8 GiB will be filled by U-Boot */
+               reg = <0x0 0x40000000 0 0x08000000>;
+       };
+
+       reg_eth_vio: regulator-eth-vio {
+               compatible = "regulator-fixed";
+               gpio = <&gpio2 10 GPIO_ACTIVE_LOW>;
+               pinctrl-0 = <&pinctrl_enet_vio>;
+               pinctrl-names = "default";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-name = "eth_vio";
+               vin-supply = <&buck4>;
+       };
+
+       reg_usdhc2_vmmc: regulator-usdhc2-vmmc {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio2 19 0>; /* SD2_RESET */
+               off-on-delay-us = <12000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_usdhc2_vmmc>;
+               regulator-max-microvolt = <3300000>;
+               regulator-min-microvolt = <3300000>;
+               regulator-name = "VDD_3V3_SD";
+               startup-delay-us = <100>;
+               vin-supply = <&buck4>;
+       };
+};
+
+&A53_0 {
+       cpu-supply = <&buck2>;
+};
+
+&A53_1 {
+       cpu-supply = <&buck2>;
+};
+
+&A53_2 {
+       cpu-supply = <&buck2>;
+};
+
+&A53_3 {
+       cpu-supply = <&buck2>;
+};
+
+&ecspi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+       status = "disabled";
+};
+
+&ecspi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi2>;
+       cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
+       status = "disabled";
+};
+
+&eqos {        /* First ethernet */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_eqos>;
+       phy-handle = <&ethphy0g>;
+       phy-mode = "rgmii-id";
+       status = "okay";
+
+       mdio {
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               /* Up to one of these two PHYs may be populated. */
+               ethphy0f: ethernet-phy@1 { /* SMSC LAN8740Ai */
+                       compatible = "ethernet-phy-id0007.c110",
+                                    "ethernet-phy-ieee802.3-c22";
+                       interrupt-parent = <&gpio3>;
+                       interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
+                       pinctrl-0 = <&pinctrl_ethphy0>;
+                       pinctrl-names = "default";
+                       reg = <1>;
+                       reset-assert-us = <1000>;
+                       reset-deassert-us = <1000>;
+                       reset-gpios = <&gpio3 20 GPIO_ACTIVE_LOW>;
+                       /* Non-default PHY population option. */
+                       status = "disabled";
+               };
+
+               ethphy0g: ethernet-phy@5 { /* Micrel KSZ9131RNXI */
+                       compatible = "ethernet-phy-id0022.1642",
+                                    "ethernet-phy-ieee802.3-c22";
+                       interrupt-parent = <&gpio3>;
+                       interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
+                       micrel,led-mode = <0>;
+                       pinctrl-0 = <&pinctrl_ethphy0>;
+                       pinctrl-names = "default";
+                       reg = <5>;
+                       reset-assert-us = <1000>;
+                       reset-deassert-us = <1000>;
+                       reset-gpios = <&gpio3 20 GPIO_ACTIVE_LOW>;
+                       /* Default PHY population option. */
+                       status = "okay";
+               };
+       };
+};
+
+&fec { /* Second ethernet */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_fec>;
+       phy-handle = <&ethphy1f>;
+       phy-mode = "rgmii";
+       fsl,magic-packet;
+       status = "okay";
+
+       mdio {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               /* Up to one PHY may be populated. */
+               ethphy1f: ethernet-phy@1 { /* SMSC LAN8740Ai */
+                       compatible = "ethernet-phy-id0007.c110",
+                                    "ethernet-phy-ieee802.3-c22";
+                       interrupt-parent = <&gpio4>;
+                       interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+                       pinctrl-0 = <&pinctrl_ethphy1>;
+                       pinctrl-names = "default";
+                       reg = <1>;
+                       reset-assert-us = <1000>;
+                       reset-deassert-us = <1000>;
+                       reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
+                       /* Non-default PHY population option. */
+                       status = "disabled";
+               };
+       };
+};
+
+&flexcan1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan1>;
+       status = "disabled";
+};
+
+&flexcan2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan2>;
+       status = "disabled";
+};
+
+&flexspi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexspi>;
+       status = "okay";
+
+       flash@0 {       /* W25Q128JWPIM */
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <80000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+       };
+};
+
+&gpio1 {
+       gpio-line-names =
+               "DHCOM-G", "", "", "", "", "DHCOM-I", "DHCOM-J", "DHCOM-L",
+               "DHCOM-B", "DHCOM-A", "", "DHCOM-H", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio2 {
+       gpio-line-names =
+               "", "", "", "", "", "", "", "",
+               "", "", "", "DHCOM-K", "", "", "", "",
+               "", "", "", "", "DHCOM-INT", "", "", "",
+               "", "", "", "", "", "", "", "";
+};
+
+&gpio3 {
+       gpio-line-names =
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "SOM-HW0", "",
+               "", "", "", "", "", "", "SOM-MEM0", "SOM-MEM1",
+               "SOM-MEM2", "SOM-HW2", "", "", "", "", "", "";
+};
+
+&gpio4 {
+       gpio-line-names =
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "SOM-HW1", "", "", "", "",
+               "", "", "", "DHCOM-D", "", "", "", "";
+};
+
+&gpio5 {
+       gpio-line-names =
+               "", "", "DHCOM-C", "", "", "", "", "",
+               "", "", "", "", "", "", "", "",
+               "", "", "", "", "", "", "DHCOM-E", "DHCOM-F",
+               "", "", "", "", "", "", "", "";
+};
+
+&i2c3 {
+       clock-frequency = <100000>;
+       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)>;
+       status = "okay";
+
+       pmic: pmic@25 {
+               compatible = "nxp,pca9450c";
+               reg = <0x25>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_pmic>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+               sd-vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+
+               /*
+                * i.MX 8M Plus Data Sheet for Consumer Products
+                * 3.1.4 Operating ranges
+                * MIMX8ML8CVNKZAB
+                */
+               regulators {
+                       buck1: BUCK1 {  /* VDD_SOC (dual-phase with BUCK3) */
+                               regulator-compatible = "BUCK1";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-ramp-delay = <3125>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck2: BUCK2 {  /* VDD_ARM */
+                               regulator-compatible = "BUCK2";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-ramp-delay = <3125>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck4: BUCK4 {  /* VDD_3V3 */
+                               regulator-compatible = "BUCK4";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck5: BUCK5 {  /* VDD_1V8 */
+                               regulator-compatible = "BUCK5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       buck6: BUCK6 {  /* NVCC_DRAM_1V1 */
+                               regulator-compatible = "BUCK6";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       ldo1: LDO1 {    /* NVCC_SNVS_1V8 */
+                               regulator-compatible = "LDO1";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       ldo3: LDO3 {    /* VDDA_1V8 */
+                               regulator-compatible = "LDO3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-always-on;
+                               regulator-boot-on;
+                       };
+
+                       ldo4: LDO4 {    /* PMIC_LDO4 */
+                               regulator-compatible = "LDO4";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       ldo5: LDO5 {    /* NVCC_SD2 */
+                               regulator-compatible = "LDO5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+               };
+       };
+
+       adc@48 {
+               compatible = "ti,tla2024";
+               reg = <0x48>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               channel@0 {     /* Voltage over AIN0 and AIN1. */
+                       reg = <0>;
+               };
+
+               channel@1 {     /* Voltage over AIN0 and AIN3. */
+                       reg = <1>;
+               };
+
+               channel@2 {     /* Voltage over AIN1 and AIN3. */
+                       reg = <2>;
+               };
+
+               channel@3 {     /* Voltage over AIN2 and AIN3. */
+                       reg = <3>;
+               };
+
+               channel@4 {     /* Voltage over AIN0 and GND. */
+                       reg = <4>;
+               };
+
+               channel@5 {     /* Voltage over AIN1 and GND. */
+                       reg = <5>;
+               };
+
+               channel@6 {     /* Voltage over AIN2 and GND. */
+                       reg = <6>;
+               };
+
+               channel@7 {     /* Voltage over AIN3 and GND. */
+                       reg = <7>;
+               };
+       };
+
+       touchscreen@49 {
+               compatible = "ti,tsc2004";
+               reg = <0x49>;
+               interrupts-extended = <&gpio4 0 IRQ_TYPE_EDGE_FALLING>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_touch>;
+               vio-supply = <&buck4>;
+       };
+
+       eeprom0: eeprom@50 {    /* EEPROM with EQoS MAC address */
+               compatible = "atmel,24c02";
+               pagesize = <16>;
+               reg = <0x50>;
+       };
+
+       rv3032: rtc@51 {
+               compatible = "microcrystal,rv3032";
+               reg = <0x51>;
+               interrupts-extended = <&gpio5 5 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_rtc>;
+       };
+
+       eeprom1: eeprom@53 {    /* EEPROM with FEC MAC address */
+               compatible = "atmel,24c02";
+               pagesize = <16>;
+               reg = <0x53>;
+       };
+};
+
+&i2c4 {
+       clock-frequency = <100000>;
+       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)>;
+       status = "okay";
+};
+
+&i2c5 {        /* HDMI EDID bus */
+       clock-frequency = <100000>;
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c5>;
+       pinctrl-1 = <&pinctrl_i2c5_gpio>;
+       scl-gpios = <&gpio5 26 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio5 27 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       status = "okay";
+};
+
+&pwm1 {
+       pinctrl-0 = <&pinctrl_pwm1>;
+       pinctrl-names = "default";
+       status = "disabled";
+};
+
+&uart1 {
+       /* CA53 console */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       status = "okay";
+};
+
+&uart2 {
+       /* Bluetooth */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       uart-has-rtscts;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       uart-has-rtscts;
+       status = "okay";
+};
+
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+       status = "okay";
+};
+
+&usb3_phy0 {
+       status = "okay";
+};
+
+&usb3_0 {
+       status = "okay";
+};
+
+&usb_dwc3_0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usb0_vbus>;
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb3_phy1 {
+       status = "okay";
+};
+
+&usb3_1 {
+       status = "okay";
+};
+
+&usb_dwc3_1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_usb1_vbus>;
+       dr_mode = "host";
+       status = "okay";
+};
+
+/* SDIO WiFi */
+&usdhc1 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc1>;
+       pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
+       pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
+       vmmc-supply = <&buck4>;
+       bus-width = <4>;
+       non-removable;
+       cap-power-off-card;
+       keep-power-in-suspend;
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       brcmf: bcrmf@1 {        /* muRata 2AE */
+               reg = <1>;
+               compatible = "cypress,cyw4373-fmac", "brcm,bcm4329-fmac";
+               /*
+                * The "host-wake" interrupt output is by default not
+                * connected to the SoC, but can be connected on to
+                * SoC pin on the carrier board.
+                */
+               reset-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
+       };
+};
+
+/* SD slot */
+&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>;
+       vmmc-supply = <&reg_usdhc2_vmmc>;
+       bus-width = <4>;
+       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>;
+       vmmc-supply = <&buck4>;
+       vqmmc-supply = <&buck5>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
+&wdog1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       fsl,ext-reset-output;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl-0 = <&pinctrl_hog_base
+                    &pinctrl_dhcom_a &pinctrl_dhcom_b &pinctrl_dhcom_c
+                    &pinctrl_dhcom_d &pinctrl_dhcom_e &pinctrl_dhcom_f
+                    &pinctrl_dhcom_g &pinctrl_dhcom_h &pinctrl_dhcom_i
+                    &pinctrl_dhcom_j &pinctrl_dhcom_k &pinctrl_dhcom_l
+                    /* GPIO_M is connected to CLKOUT2 */
+                    &pinctrl_dhcom_int>;
+       pinctrl-names = "default";
+
+       pinctrl_dhcom_a: dhcom-a-grp {
+               fsl,pins = <
+                       /* ENET_QOS_EVENT0-OUT */
+                       MX8MP_IOMUXC_GPIO1_IO09__GPIO1_IO09             0x2
+               >;
+       };
+
+       pinctrl_dhcom_b: dhcom-b-grp {
+               fsl,pins = <
+                       /* ENET_QOS_EVENT0-IN */
+                       MX8MP_IOMUXC_GPIO1_IO08__GPIO1_IO08             0x2
+               >;
+       };
+
+       pinctrl_dhcom_c: dhcom-c-grp {
+               fsl,pins = <
+                       /* GPIO_C */
+                       MX8MP_IOMUXC_SAI3_MCLK__GPIO5_IO02              0x2
+               >;
+       };
+
+       pinctrl_dhcom_d: dhcom-d-grp {
+               fsl,pins = <
+                       /* GPIO_D */
+                       MX8MP_IOMUXC_SAI2_MCLK__GPIO4_IO27              0x2
+               >;
+       };
+
+       pinctrl_dhcom_e: dhcom-e-grp {
+               fsl,pins = <
+                       /* GPIO_E */
+                       MX8MP_IOMUXC_UART1_RXD__GPIO5_IO22              0x2
+               >;
+       };
+
+       pinctrl_dhcom_f: dhcom-f-grp {
+               fsl,pins = <
+                       /* GPIO_F */
+                       MX8MP_IOMUXC_UART1_TXD__GPIO5_IO23              0x2
+               >;
+       };
+
+       pinctrl_dhcom_g: dhcom-g-grp {
+               fsl,pins = <
+                       /* GPIO_G */
+                       MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00             0x2
+               >;
+       };
+
+       pinctrl_dhcom_h: dhcom-h-grp {
+               fsl,pins = <
+                       /* GPIO_H */
+                       MX8MP_IOMUXC_GPIO1_IO11__GPIO1_IO11             0x2
+               >;
+       };
+
+       pinctrl_dhcom_i: dhcom-i-grp {
+               fsl,pins = <
+                       /* CSI1_SYNC */
+                       MX8MP_IOMUXC_GPIO1_IO05__GPIO1_IO05             0x2
+               >;
+       };
+
+       pinctrl_dhcom_j: dhcom-j-grp {
+               fsl,pins = <
+                       /* CSIx_#RST */
+                       MX8MP_IOMUXC_GPIO1_IO06__GPIO1_IO06             0x2
+               >;
+       };
+
+       pinctrl_dhcom_k: dhcom-k-grp {
+               fsl,pins = <
+                       /* CSIx_PWDN */
+                       MX8MP_IOMUXC_SD1_STROBE__GPIO2_IO11             0x2
+               >;
+       };
+
+       pinctrl_dhcom_l: dhcom-l-grp {
+               fsl,pins = <
+                       /* CSI2_SYNC */
+                       MX8MP_IOMUXC_GPIO1_IO07__GPIO1_IO07             0x2
+               >;
+       };
+
+       pinctrl_dhcom_int: dhcom-int-grp {
+               fsl,pins = <
+                       /* INT_HIGHEST_PRIO */
+                       MX8MP_IOMUXC_SD2_WP__GPIO2_IO20                 0x2
+               >;
+       };
+
+       pinctrl_hog_base: dhcom-hog-base-grp {
+               fsl,pins = <
+                       /* GPIOs for memory coding */
+                       MX8MP_IOMUXC_SAI5_RXD1__GPIO3_IO22              0x40000080
+                       MX8MP_IOMUXC_SAI5_RXD2__GPIO3_IO23              0x40000080
+                       MX8MP_IOMUXC_SAI5_RXD3__GPIO3_IO24              0x40000080
+                       /* GPIOs for hardware coding */
+                       MX8MP_IOMUXC_NAND_DQS__GPIO3_IO14               0x40000080
+                       MX8MP_IOMUXC_SAI1_TXD7__GPIO4_IO19              0x40000080
+                       MX8MP_IOMUXC_SAI5_MCLK__GPIO3_IO25              0x40000080
+               >;
+       };
+
+       pinctrl_ecspi1: dhcom-ecspi1-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_ECSPI1_SCLK__ECSPI1_SCLK           0x44
+                       MX8MP_IOMUXC_ECSPI1_MOSI__ECSPI1_MOSI           0x44
+                       MX8MP_IOMUXC_ECSPI1_MISO__ECSPI1_MISO           0x44
+                       MX8MP_IOMUXC_ECSPI1_SS0__GPIO5_IO09             0x40
+               >;
+       };
+
+       pinctrl_ecspi2: dhcom-ecspi2-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_ECSPI2_SCLK__ECSPI2_SCLK           0x44
+                       MX8MP_IOMUXC_ECSPI2_MOSI__ECSPI2_MOSI           0x44
+                       MX8MP_IOMUXC_ECSPI2_MISO__ECSPI2_MISO           0x44
+                       MX8MP_IOMUXC_ECSPI2_SS0__GPIO5_IO13             0x40
+               >;
+       };
+
+       pinctrl_eqos: dhcom-eqos-grp {  /* RGMII */
+               fsl,pins = <
+                       MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC             0x3
+                       MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO           0x3
+                       MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL 0x1f
+                       MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK       0x1f
+                       MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0       0x1f
+                       MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1       0x1f
+                       MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2       0x1f
+                       MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3       0x1f
+                       MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK       0x91
+                       MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL 0x91
+                       MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0       0x91
+                       MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1       0x91
+                       MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2       0x91
+                       MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3       0x91
+               >;
+       };
+
+       pinctrl_enet_vio: dhcom-enet-vio-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD1_RESET_B__GPIO2_IO10            0x22
+               >;
+       };
+
+       pinctrl_ethphy0: dhcom-ethphy0-grp {
+               fsl,pins = <
+                       /* ENET1_#RST Reset */
+                       MX8MP_IOMUXC_SAI5_RXC__GPIO3_IO20               0x22
+                       /* ENET1_#INT Interrupt */
+                       MX8MP_IOMUXC_SAI5_RXFS__GPIO3_IO19              0x22
+               >;
+       };
+
+       pinctrl_ethphy1: dhcom-ethphy1-grp {
+               fsl,pins = <
+                       /* ENET1_#RST Reset */
+                       MX8MP_IOMUXC_SAI1_RXD0__GPIO4_IO02              0x11
+                       /* ENET1_#INT Interrupt */
+                       MX8MP_IOMUXC_SAI1_RXD1__GPIO4_IO03              0x11
+               >;
+       };
+
+       pinctrl_fec: dhcom-fec-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SAI1_MCLK__ENET1_TX_CLK            0x1f
+                       MX8MP_IOMUXC_SAI1_RXD2__ENET1_MDC               0x3
+                       MX8MP_IOMUXC_SAI1_RXD3__ENET1_MDIO              0x3
+                       MX8MP_IOMUXC_SAI1_RXD4__ENET1_RGMII_RD0         0x91
+                       MX8MP_IOMUXC_SAI1_RXD5__ENET1_RGMII_RD1         0x91
+                       MX8MP_IOMUXC_SAI1_RXD6__ENET1_RGMII_RD2         0x91
+                       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_TXD6__ENET1_RX_ER             0x1f
+               >;
+       };
+
+       pinctrl_flexcan1: dhcom-flexcan1-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SPDIF_RX__CAN1_RX                  0x154
+                       MX8MP_IOMUXC_SPDIF_TX__CAN1_TX                  0x154
+               >;
+       };
+
+       pinctrl_flexcan2: dhcom-flexcan2-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_UART3_RXD__CAN2_TX                 0x154
+                       MX8MP_IOMUXC_UART3_TXD__CAN2_RX                 0x154
+               >;
+       };
+
+       pinctrl_flexspi: dhcom-flexspi-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_NAND_ALE__FLEXSPI_A_SCLK           0x1c2
+                       MX8MP_IOMUXC_NAND_CE0_B__FLEXSPI_A_SS0_B        0x82
+                       MX8MP_IOMUXC_NAND_DATA00__FLEXSPI_A_DATA00      0x82
+                       MX8MP_IOMUXC_NAND_DATA01__FLEXSPI_A_DATA01      0x82
+                       MX8MP_IOMUXC_NAND_DATA02__FLEXSPI_A_DATA02      0x82
+                       MX8MP_IOMUXC_NAND_DATA03__FLEXSPI_A_DATA03      0x82
+               >;
+       };
+
+       pinctrl_hdmi: dhcom-hdmi-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_HDMI_CEC__HDMIMIX_HDMI_CEC         0x154
+                       MX8MP_IOMUXC_HDMI_HPD__HDMIMIX_HDMI_HPD         0x154
+               >;
+       };
+
+       pinctrl_i2c3: dhcom-i2c3-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_I2C3_SCL__I2C3_SCL                 0x40000084
+                       MX8MP_IOMUXC_I2C3_SDA__I2C3_SDA                 0x40000084
+               >;
+       };
+
+       pinctrl_i2c3_gpio: dhcom-i2c3-gpio-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_I2C3_SCL__GPIO5_IO18               0x84
+                       MX8MP_IOMUXC_I2C3_SDA__GPIO5_IO19               0x84
+               >;
+       };
+
+       pinctrl_i2c4: dhcom-i2c4-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_I2C4_SCL__I2C4_SCL                 0x40000084
+                       MX8MP_IOMUXC_I2C4_SDA__I2C4_SDA                 0x40000084
+               >;
+       };
+
+       pinctrl_i2c4_gpio: dhcom-i2c4-gpio-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_I2C4_SCL__GPIO5_IO20               0x84
+                       MX8MP_IOMUXC_I2C4_SDA__GPIO5_IO21               0x84
+               >;
+       };
+
+       pinctrl_i2c5: dhcom-i2c5-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_HDMI_DDC_SCL__I2C5_SCL             0x40000084
+                       MX8MP_IOMUXC_HDMI_DDC_SDA__I2C5_SDA             0x40000084
+               >;
+       };
+
+       pinctrl_i2c5_gpio: dhcom-i2c5-gpio-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_HDMI_DDC_SCL__GPIO3_IO26           0x84
+                       MX8MP_IOMUXC_HDMI_DDC_SDA__GPIO3_IO27           0x84
+               >;
+       };
+
+       pinctrl_pmic: dhcom-pmic-grp {
+               fsl,pins = <
+                       /* PMIC_nINT */
+                       MX8MP_IOMUXC_GPIO1_IO03__GPIO1_IO03             0x40000090
+               >;
+       };
+
+       pinctrl_pwm1: dhcom-pwm1-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_GPIO1_IO01__PWM1_OUT               0x6
+               >;
+       };
+
+       pinctrl_rtc: dhcom-rtc-grp {
+               fsl,pins = <
+                       /* RTC_#INT Interrupt */
+                       MX8MP_IOMUXC_SPDIF_EXT_CLK__GPIO5_IO05          0x40000080
+               >;
+       };
+
+       pinctrl_touch: dhcom-touch-grp {
+               fsl,pins = <
+                       /* #TOUCH_INT */
+                       MX8MP_IOMUXC_SAI1_RXFS__GPIO4_IO00              0x40000080
+               >;
+       };
+
+       pinctrl_uart1: dhcom-uart1-grp {
+               fsl,pins = <
+                       /* Console UART */
+                       MX8MP_IOMUXC_SAI2_RXC__UART1_DCE_RX             0x49
+                       MX8MP_IOMUXC_SAI2_RXFS__UART1_DCE_TX            0x49
+                       MX8MP_IOMUXC_SAI2_RXD0__UART1_DCE_RTS           0x49
+                       MX8MP_IOMUXC_SAI2_TXFS__UART1_DCE_CTS           0x49
+               >;
+       };
+
+       pinctrl_uart2: dhcom-uart2-grp {
+               fsl,pins = <
+                       /* Bluetooth UART */
+                       MX8MP_IOMUXC_UART2_RXD__UART2_DCE_RX            0x49
+                       MX8MP_IOMUXC_UART2_TXD__UART2_DCE_TX            0x49
+                       MX8MP_IOMUXC_SD1_DATA4__UART2_DCE_RTS           0x49
+                       MX8MP_IOMUXC_SD1_DATA5__UART2_DCE_CTS           0x49
+               >;
+       };
+
+       pinctrl_uart3: dhcom-uart3-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_ECSPI1_SCLK__UART3_DCE_RX          0x49
+                       MX8MP_IOMUXC_ECSPI1_MOSI__UART3_DCE_TX          0x49
+                       MX8MP_IOMUXC_ECSPI1_SS0__UART3_DCE_RTS          0x49
+                       MX8MP_IOMUXC_ECSPI1_MISO__UART3_DCE_CTS         0x49
+               >;
+       };
+
+       pinctrl_uart4: dhcom-uart4-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_UART4_RXD__UART4_DCE_RX            0x49
+                       MX8MP_IOMUXC_UART4_TXD__UART4_DCE_TX            0x49
+               >;
+       };
+
+       pinctrl_usb0_vbus: dhcom-usb0-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_GPIO1_IO10__USB1_OTG_ID            0x0
+               >;
+       };
+
+       pinctrl_usb1_vbus: dhcom-usb1-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_GPIO1_IO14__USB2_OTG_PWR           0x6
+                       MX8MP_IOMUXC_GPIO1_IO15__USB2_OTG_OC            0x80
+               >;
+       };
+
+       pinctrl_usdhc1: dhcom-usdhc1-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK                0x190
+                       MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD                0x1d0
+                       MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0            0x1d0
+                       MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1            0x1d0
+                       MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2            0x1d0
+                       MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3            0x1d0
+                       /* BT_REG_EN */
+                       MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12             0x144
+                       /* WL_REG_EN */
+                       MX8MP_IOMUXC_GPIO1_IO13__GPIO1_IO13             0x144
+               >;
+       };
+
+       pinctrl_usdhc1_100mhz: dhcom-usdhc1-100mhz-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK                0x194
+                       MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD                0x1d4
+                       MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0            0x1d4
+                       MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1            0x1d4
+                       MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2            0x1d4
+                       MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3            0x1d4
+                       /* BT_REG_EN */
+                       MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12             0x144
+                       /* WL_REG_EN */
+                       MX8MP_IOMUXC_GPIO1_IO13__GPIO1_IO13             0x144
+               >;
+       };
+
+       pinctrl_usdhc1_200mhz: dhcom-usdhc1-200mhz-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK                0x196
+                       MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD                0x1d6
+                       MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0            0x1d6
+                       MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1            0x1d6
+                       MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2            0x1d6
+                       MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3            0x1d6
+                       /* BT_REG_EN */
+                       MX8MP_IOMUXC_GPIO1_IO12__GPIO1_IO12             0x144
+                       /* WL_REG_EN */
+                       MX8MP_IOMUXC_GPIO1_IO13__GPIO1_IO13             0x144
+               >;
+       };
+
+       pinctrl_usdhc2: dhcom-usdhc2-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK                0x190
+                       MX8MP_IOMUXC_SD2_CMD__USDHC2_CMD                0x1d0
+                       MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0            0x1d0
+                       MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1            0x1d0
+                       MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2            0x1d0
+                       MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3            0x1d0
+                       MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT         0xc1
+               >;
+       };
+
+       pinctrl_usdhc2_100mhz: dhcom-usdhc2-100mhz-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK                0x194
+                       MX8MP_IOMUXC_SD2_CMD__USDHC2_CMD                0x1d4
+                       MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0            0x1d4
+                       MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1            0x1d4
+                       MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2            0x1d4
+                       MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3            0x1d4
+                       MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT         0xc1
+               >;
+       };
+
+       pinctrl_usdhc2_200mhz: dhcom-usdhc2-200mhz-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK                0x196
+                       MX8MP_IOMUXC_SD2_CMD__USDHC2_CMD                0x1d6
+                       MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0            0x1d6
+                       MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1            0x1d6
+                       MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2            0x1d6
+                       MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3            0x1d6
+                       MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT         0xc1
+               >;
+       };
+
+       pinctrl_usdhc2_vmmc: dhcom-usdhc2-vmmc-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19            0x20
+               >;
+       };
+
+       pinctrl_usdhc2_gpio: dhcom-usdhc2-gpio-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_SD2_CD_B__GPIO2_IO12               0x40000080
+               >;
+       };
+
+       pinctrl_usdhc3: dhcom-usdhc3-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK              0x190
+                       MX8MP_IOMUXC_NAND_WP_B__USDHC3_CMD              0x1d0
+                       MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0          0x1d0
+                       MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1          0x1d0
+                       MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2          0x1d0
+                       MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3          0x1d0
+                       MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4            0x1d0
+                       MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5           0x1d0
+                       MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6           0x1d0
+                       MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7             0x1d0
+                       MX8MP_IOMUXC_NAND_CE1_B__USDHC3_STROBE          0x190
+                       MX8MP_IOMUXC_NAND_READY_B__USDHC3_RESET_B       0x141
+               >;
+       };
+
+       pinctrl_usdhc3_100mhz: dhcom-usdhc3-100mhz-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK              0x194
+                       MX8MP_IOMUXC_NAND_WP_B__USDHC3_CMD              0x1d4
+                       MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0          0x1d4
+                       MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1          0x1d4
+                       MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2          0x1d4
+                       MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3          0x1d4
+                       MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4            0x1d4
+                       MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5           0x1d4
+                       MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6           0x1d4
+                       MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7             0x1d4
+                       MX8MP_IOMUXC_NAND_CE1_B__USDHC3_STROBE          0x194
+                       MX8MP_IOMUXC_NAND_READY_B__USDHC3_RESET_B       0x141
+               >;
+       };
+
+       pinctrl_usdhc3_200mhz: dhcom-usdhc3-200mhz-grp {
+               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_CE1_B__USDHC3_STROBE          0x196
+                       MX8MP_IOMUXC_NAND_READY_B__USDHC3_RESET_B       0x141
+               >;
+       };
+
+       pinctrl_wdog: dhcom-wdog-grp {
+               fsl,pins = <
+                       MX8MP_IOMUXC_GPIO1_IO02__WDOG1_WDOG_B           0xc6
+               >;
+       };
+};
index 4c3ac42..a449a51 100644 (file)
        };
 };
 
-&flexcan1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_flexcan1>;
-       xceiver-supply = <&reg_can1_stby>;
-       status = "okay";
+&A53_0 {
+       cpu-supply = <&reg_arm>;
 };
 
-&flexcan2 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_flexcan2>;
-       xceiver-supply = <&reg_can2_stby>;
-       status = "disabled";/* can2 pin conflict with pdm */
+&A53_1 {
+       cpu-supply = <&reg_arm>;
+};
+
+&A53_2 {
+       cpu-supply = <&reg_arm>;
+};
+
+&A53_3 {
+       cpu-supply = <&reg_arm>;
 };
 
 &eqos {
        };
 };
 
+&flexcan1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan1>;
+       xceiver-supply = <&reg_can1_stby>;
+       status = "okay";
+};
+
+&flexcan2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan2>;
+       xceiver-supply = <&reg_can2_stby>;
+       status = "disabled";/* can2 pin conflict with pdm */
+};
+
 &i2c1 {
        clock-frequency = <400000>;
        pinctrl-names = "default";
                                regulator-ramp-delay = <3125>;
                        };
 
-                       BUCK2 {
+                       reg_arm: BUCK2 {
                                regulator-name = "BUCK2";
                                regulator-min-microvolt = <720000>;
                                regulator-max-microvolt = <1025000>;
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts
new file mode 100644 (file)
index 0000000..d8ca529
--- /dev/null
@@ -0,0 +1,702 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2021-2022 TQ-Systems GmbH
+ * Author: Alexander Stein <alexander.stein@tq-group.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/net/ti-dp83867.h>
+#include <dt-bindings/pwm/pwm.h>
+#include "imx8mp-tqma8mpql.dtsi"
+
+/ {
+       model = "TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MPxL";
+       compatible = "tq,imx8mp-tqma8mpql-mba8mpxl", "tq,imx8mp-tqma8mpql", "fsl,imx8mp";
+
+       chosen {
+               stdout-path = &uart4;
+       };
+
+       iio-hwmon {
+               compatible = "iio-hwmon";
+               io-channels = <&adc 0>, <&adc 1>;
+       };
+
+       aliases {
+               mmc0 = &usdhc3;
+               mmc1 = &usdhc2;
+               mmc2 = &usdhc1;
+               rtc0 = &pcf85063;
+               rtc1 = &snvs_rtc;
+               spi0 = &flexspi;
+               spi1 = &ecspi1;
+               spi2 = &ecspi2;
+               spi3 = &ecspi3;
+       };
+
+       backlight_lvds: backlight {
+               compatible = "pwm-backlight";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_backlight>;
+               pwms = <&pwm2 0 5000000 0>;
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <7>;
+               power-supply = <&reg_vcc_12v0>;
+               enable-gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;
+               status = "disabled";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpiobutton>;
+               autorepeat;
+
+               switch-1 {
+                       label = "S12";
+                       linux,code = <BTN_0>;
+                       gpios = <&gpio5 26 GPIO_ACTIVE_LOW>;
+               };
+
+               switch-2 {
+                       label = "S13";
+                       linux,code = <BTN_1>;
+                       gpios = <&gpio5 27 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_gpioled>;
+
+               led-0 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
+                       function-enumerator = <0>;
+                       gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "default-on";
+               };
+
+               led-1 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_HEARTBEAT;
+                       gpios = <&gpio5 4 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+               };
+
+               led-2 {
+                       color = <LED_COLOR_ID_YELLOW>;
+                       function = LED_FUNCTION_STATUS;
+                       function-enumerator = <1>;
+                       gpios = <&gpio5 3 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       display: display {
+               /*
+                * Display is not fixed, so compatible has to be added from
+                * DT overlay
+                */
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_lvdsdisplay>;
+               power-supply = <&reg_vcc_3v3>;
+               enable-gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
+               backlight = <&backlight_lvds>;
+               status = "disabled";
+       };
+
+       reg_usdhc2_vmmc: regulator-usdhc2 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_usdhc2_vmmc>;
+               regulator-name = "VSD_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               startup-delay-us = <100>;
+               off-on-delay-us = <12000>;
+       };
+
+       reg_vcc_12v0: regulator-12v0 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg12v0>;
+               regulator-name = "VCC_12V0";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               gpio = <&gpio2 6 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       reg_vcc_3v3: regulator-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCC_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               ocram: ocram@900000 {
+                       no-map;
+                       reg = <0 0x900000 0 0x70000>;
+               };
+
+               /* global autoconfigured region for contiguous allocations */
+               linux,cma {
+                       compatible = "shared-dma-pool";
+                       reusable;
+                       size = <0 0x38000000>;
+                       alloc-ranges = <0 0x40000000 0 0xB0000000>;
+                       linux,cma-default;
+               };
+       };
+};
+
+&ecspi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi1>;
+       cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&ecspi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi2>;
+       cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>;
+       status = "okay";
+};
+
+&ecspi3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_ecspi3>;
+       cs-gpios = <&gpio5 25 GPIO_ACTIVE_LOW>;
+       status = "okay";
+
+       adc: adc@0 {
+               reg = <0>;
+               compatible = "microchip,mcp3202";
+               /* 100 ksps * 18 */
+               spi-max-frequency = <1800000>;
+               vref-supply = <&reg_vcc_3v3>;
+               #io-channel-cells = <1>;
+       };
+};
+
+&eqos {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_eqos>, <&pinctrl_eqos_phy>;
+       phy-mode = "rgmii-id";
+       phy-handle = <&ethphy3>;
+       status = "okay";
+
+       mdio {
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               ethphy3: ethernet-phy@3 {
+                       compatible = "ethernet-phy-ieee802.3-c22";
+                       reg = <3>;
+                       ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
+                       ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
+                       ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
+                       ti,dp83867-rxctrl-strap-quirk;
+                       ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
+                       reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
+                       reset-assert-us = <500000>;
+                       reset-deassert-us = <50000>;
+                       enet-phy-lane-no-swap;
+                       interrupt-parent = <&gpio4>;
+                       interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
+               };
+       };
+};
+
+&fec {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_fec>, <&pinctrl_fec_phy>;
+       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>;
+                       ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
+                       ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
+                       ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
+                       ti,dp83867-rxctrl-strap-quirk;
+                       ti,clk-output-sel = <DP83867_CLK_O_SEL_OFF>;
+                       reset-gpios = <&gpio4 0 GPIO_ACTIVE_LOW>;
+                       reset-assert-us = <500000>;
+                       reset-deassert-us = <50000>;
+                       enet-phy-lane-no-swap;
+                       interrupt-parent = <&gpio4>;
+                       interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
+               };
+       };
+};
+
+&flexcan1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan1>;
+       xceiver-supply = <&reg_vcc_3v3>;
+       status = "okay";
+};
+
+&flexcan2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexcan2>;
+       xceiver-supply = <&reg_vcc_3v3>;
+       status = "okay";
+};
+
+&gpio1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpio1>;
+
+       gpio-line-names = "GPO1", "GPO0", "", "GPO3",
+                         "", "", "GPO2", "GPI0",
+                         "PMIC_IRQ", "GPI1", "OTG_ID", "USB_HUB_RST#",
+                         "OTG_PWR", "", "GPI2", "GPI3",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "";
+};
+
+&gpio2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_hoggpio2>;
+
+       gpio-line-names = "", "", "", "",
+                         "", "", "VCC12V_EN", "PERST#",
+                         "", "", "CLKREQ#", "PEWAKE#",
+                         "USDHC2_CD", "", "", "",
+                         "", "", "", "V_SD3V3_EN",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "";
+
+       perst-hog {
+               gpio-hog;
+               gpios = <7 0>;
+               output-high;
+               line-name = "PERST#";
+       };
+
+       clkreq-hog {
+               gpio-hog;
+               gpios = <10 0>;
+               input;
+               line-name = "CLKREQ#";
+       };
+
+       pewake-hog {
+               gpio-hog;
+               gpios = <11 0>;
+               input;
+               line-name = "PEWAKE#";
+       };
+};
+
+&gpio3 {
+       gpio-line-names = "", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "", "LVDS0_RESET#", "",
+                         "", "", "", "LVDS0_BLT_EN",
+                         "LVDS0_PWR_EN", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "";
+};
+
+&gpio4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_gpio4>;
+
+       gpio-line-names = "ENET0_RST#", "ENET0_INT#", "ENET1_RST#", "ENET1_INT#",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "", "DP_IRQ", "DSI_EN",
+                         "HDMI_OC#", "TEMP_EVENT#", "PCIE_CLK_OE#", "",
+                         "", "", "", "FAN_PWR",
+                         "RTC_EVENT#", "CODEC_RST#", "", "";
+};
+
+&gpio5 {
+       gpio-line-names = "", "", "", "LED2",
+                         "LED1", "LED0", "CSI0_RESET#", "CSI0_SYNC",
+                         "CSI0_TRIGGER", "CSI0_ENABLE", "", "",
+                         "", "ECSPI2_SS0", "", "",
+                         "", "", "", "",
+                         "", "", "", "",
+                         "", "ECSPI3_SS0", "SWITCH_A", "SWITCH_B",
+                         "", "", "", "";
+};
+
+&i2c2 {
+       clock-frequency = <384000>;
+       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 = "okay";
+
+       /* NXP SE97BTP with temperature sensor + eeprom */
+       se97_1c: temperature-sensor-eeprom@1c {
+               compatible = "nxp,se97", "jedec,jc-42.4-temp";
+               reg = <0x1c>;
+       };
+
+       at24c02_54: eeprom@54 {
+               compatible = "nxp,se97b", "atmel,24c02";
+               reg = <0x54>;
+               pagesize = <16>;
+               vcc-supply = <&reg_vcc_3v3>;
+       };
+};
+
+&i2c4 {
+       clock-frequency = <384000>;
+       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)>;
+       status = "okay";
+};
+
+&i2c6 {
+       clock-frequency = <384000>;
+       pinctrl-names = "default", "gpio";
+       pinctrl-0 = <&pinctrl_i2c6>;
+       pinctrl-1 = <&pinctrl_i2c6_gpio>;
+       scl-gpios = <&gpio2 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       sda-gpios = <&gpio2 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+       status = "okay";
+};
+
+&pcf85063 {
+       /* RTC_EVENT# is connected on MBa8MPxL */
+       interrupt-parent = <&gpio4>;
+       interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
+};
+
+&pwm2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm2>;
+       status = "disabled";
+};
+
+&pwm3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm3>;
+       status = "okay";
+};
+
+&snvs_pwrkey {
+       status = "okay";
+};
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       assigned-clocks = <&clk IMX8MP_CLK_UART1>;
+       assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart2>;
+       assigned-clocks = <&clk IMX8MP_CLK_UART2>;
+       assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart3>;
+       assigned-clocks = <&clk IMX8MP_CLK_UART3>;
+       assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
+       status = "okay";
+};
+
+&uart4 {
+       /* console */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart4>;
+       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>;
+       vmmc-supply = <&reg_usdhc2_vmmc>;
+       no-mmc;
+       no-sdio;
+       disable-wp;
+       bus-width = <4>;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl_backlight: backlightgrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI5_RXFS__GPIO3_IO19          0x14>;
+       };
+
+       pinctrl_flexcan1: flexcan1grp {
+               fsl,pins = <MX8MP_IOMUXC_SAI5_RXD1__CAN1_TX             0x150>,
+                          <MX8MP_IOMUXC_SAI5_RXD2__CAN1_RX             0x150>;
+       };
+
+       pinctrl_flexcan2: flexcan2grp {
+               fsl,pins = <MX8MP_IOMUXC_SAI5_RXD3__CAN2_TX             0x150>,
+                          <MX8MP_IOMUXC_SAI5_MCLK__CAN2_RX             0x150>;
+       };
+
+       /* only on X57, primary used as CSI0 control signals */
+       pinctrl_ecspi1: ecspi1grp {
+               fsl,pins = <MX8MP_IOMUXC_ECSPI1_MISO__ECSPI1_MISO       0x1c0>,
+                          <MX8MP_IOMUXC_ECSPI1_MOSI__ECSPI1_MOSI       0x1c0>,
+                          <MX8MP_IOMUXC_ECSPI1_SCLK__ECSPI1_SCLK       0x1c0>,
+                          <MX8MP_IOMUXC_ECSPI1_SS0__GPIO5_IO09         0x1c0>;
+       };
+
+       /* on X63 and optionally on X57, can also be used as CSI1 control signals */
+       pinctrl_ecspi2: ecspi2grp {
+               fsl,pins = <MX8MP_IOMUXC_ECSPI2_MISO__ECSPI2_MISO       0x1c0>,
+                          <MX8MP_IOMUXC_ECSPI2_MOSI__ECSPI2_MOSI       0x1c0>,
+                          <MX8MP_IOMUXC_ECSPI2_SCLK__ECSPI2_SCLK       0x1c0>,
+                          <MX8MP_IOMUXC_ECSPI2_SS0__GPIO5_IO13         0x1c0>;
+       };
+
+       pinctrl_ecspi3: ecspi3grp {
+               fsl,pins = <MX8MP_IOMUXC_UART1_TXD__ECSPI3_MOSI         0x1c0>,
+                          <MX8MP_IOMUXC_UART1_RXD__ECSPI3_SCLK         0x1c0>,
+                          <MX8MP_IOMUXC_UART2_RXD__ECSPI3_MISO         0x1c0>,
+                          <MX8MP_IOMUXC_UART2_TXD__GPIO5_IO25          0x1c0>;
+       };
+
+       pinctrl_eqos: eqosgrp {
+               fsl,pins = <MX8MP_IOMUXC_ENET_MDC__ENET_QOS_MDC                         0x40000044>,
+                          <MX8MP_IOMUXC_ENET_MDIO__ENET_QOS_MDIO                       0x40000044>,
+                          <MX8MP_IOMUXC_ENET_RD0__ENET_QOS_RGMII_RD0                   0x90>,
+                          <MX8MP_IOMUXC_ENET_RD1__ENET_QOS_RGMII_RD1                   0x90>,
+                          <MX8MP_IOMUXC_ENET_RD2__ENET_QOS_RGMII_RD2                   0x90>,
+                          <MX8MP_IOMUXC_ENET_RD3__ENET_QOS_RGMII_RD3                   0x90>,
+                          <MX8MP_IOMUXC_ENET_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK   0x90>,
+                          <MX8MP_IOMUXC_ENET_RX_CTL__ENET_QOS_RGMII_RX_CTL             0x90>,
+                          <MX8MP_IOMUXC_ENET_TD0__ENET_QOS_RGMII_TD0                   0x12>,
+                          <MX8MP_IOMUXC_ENET_TD1__ENET_QOS_RGMII_TD1                   0x12>,
+                          <MX8MP_IOMUXC_ENET_TD2__ENET_QOS_RGMII_TD2                   0x12>,
+                          <MX8MP_IOMUXC_ENET_TD3__ENET_QOS_RGMII_TD3                   0x12>,
+                          <MX8MP_IOMUXC_ENET_TX_CTL__ENET_QOS_RGMII_TX_CTL             0x12>,
+                          <MX8MP_IOMUXC_ENET_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK   0x14>;
+       };
+
+       pinctrl_eqos_event: eqosevtgrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI2_RXD0__ENET_QOS_1588_EVENT2_OUT            0x100>,
+                          <MX8MP_IOMUXC_SAI2_TXD0__ENET_QOS_1588_EVENT2_IN             0x1c0>;
+       };
+
+       pinctrl_eqos_phy: eqosphygrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI1_RXD0__GPIO4_IO02                          0x100>,
+                          <MX8MP_IOMUXC_SAI1_RXD1__GPIO4_IO03                          0x1c0>;
+       };
+
+       pinctrl_fec: fecgrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI1_RXD2__ENET1_MDC           0x40000044>,
+                          <MX8MP_IOMUXC_SAI1_RXD3__ENET1_MDIO          0x40000044>,
+                          <MX8MP_IOMUXC_SAI1_RXD4__ENET1_RGMII_RD0     0x90>,
+                          <MX8MP_IOMUXC_SAI1_RXD5__ENET1_RGMII_RD1     0x90>,
+                          <MX8MP_IOMUXC_SAI1_RXD6__ENET1_RGMII_RD2     0x90>,
+                          <MX8MP_IOMUXC_SAI1_RXD7__ENET1_RGMII_RD3     0x90>,
+                          <MX8MP_IOMUXC_SAI1_TXC__ENET1_RGMII_RXC      0x90>,
+                          <MX8MP_IOMUXC_SAI1_TXFS__ENET1_RGMII_RX_CTL  0x90>,
+                          <MX8MP_IOMUXC_SAI1_TXD0__ENET1_RGMII_TD0     0x12>,
+                          <MX8MP_IOMUXC_SAI1_TXD1__ENET1_RGMII_TD1     0x12>,
+                          <MX8MP_IOMUXC_SAI1_TXD2__ENET1_RGMII_TD2     0x12>,
+                          <MX8MP_IOMUXC_SAI1_TXD3__ENET1_RGMII_TD3     0x12>,
+                          <MX8MP_IOMUXC_SAI1_TXD4__ENET1_RGMII_TX_CTL  0x12>,
+                          <MX8MP_IOMUXC_SAI1_TXD5__ENET1_RGMII_TXC     0x14>;
+       };
+
+       pinctrl_fec_event: fecevtgrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI1_RXFS__ENET1_1588_EVENT0_IN        0x100>,
+                          <MX8MP_IOMUXC_SAI1_RXC__ENET1_1588_EVENT0_OUT        0x1c0>;
+       };
+
+       pinctrl_fec_phy: fecphygrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI1_RXFS__GPIO4_IO00          0x100>,
+                          <MX8MP_IOMUXC_SAI1_RXC__GPIO4_IO01           0x1c0>;
+       };
+
+       pinctrl_fec_phyalt: fecphyaltgrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI2_TXFS__GPIO4_IO24          0x180>,
+                          <MX8MP_IOMUXC_SAI2_TXC__GPIO4_IO25           0x180>;
+       };
+
+       pinctrl_gpiobutton: gpiobuttongrp {
+               fsl,pins = <MX8MP_IOMUXC_UART3_RXD__GPIO5_IO26          0x10>,
+                          <MX8MP_IOMUXC_UART3_TXD__GPIO5_IO27          0x10>;
+       };
+
+       pinctrl_gpioled: gpioledgrp {
+               fsl,pins = <MX8MP_IOMUXC_SPDIF_EXT_CLK__GPIO5_IO05      0x14>,
+                          <MX8MP_IOMUXC_SPDIF_RX__GPIO5_IO04           0x14>,
+                          <MX8MP_IOMUXC_SPDIF_TX__GPIO5_IO03           0x14>;
+       };
+
+       pinctrl_gpio1: gpio1grp {
+               fsl,pins = <MX8MP_IOMUXC_GPIO1_IO00__GPIO1_IO00         0x10>,
+                          <MX8MP_IOMUXC_GPIO1_IO01__GPIO1_IO01         0x10>,
+                          <MX8MP_IOMUXC_GPIO1_IO03__GPIO1_IO03         0x10>,
+                          <MX8MP_IOMUXC_GPIO1_IO06__GPIO1_IO06         0x10>,
+                          <MX8MP_IOMUXC_GPIO1_IO07__GPIO1_IO07         0x80>,
+                          <MX8MP_IOMUXC_GPIO1_IO09__GPIO1_IO09         0x80>,
+                          <MX8MP_IOMUXC_GPIO1_IO14__GPIO1_IO14         0x80>,
+                          <MX8MP_IOMUXC_GPIO1_IO15__GPIO1_IO15         0x80>;
+       };
+
+       pinctrl_gpio4: gpio4grp {
+               fsl,pins = <MX8MP_IOMUXC_SAI1_MCLK__GPIO4_IO20          0x180>,
+                          <MX8MP_IOMUXC_SAI2_RXC__GPIO4_IO22           0x180>;
+       };
+
+       pinctrl_hdmi: hdmigrp {
+               fsl,pins = <MX8MP_IOMUXC_HDMI_DDC_SCL__HDMIMIX_HDMI_SCL 0x400001c2>,
+                          <MX8MP_IOMUXC_HDMI_DDC_SDA__HDMIMIX_HDMI_SDA 0x400001c2>,
+                          <MX8MP_IOMUXC_HDMI_HPD__HDMIMIX_HDMI_HPD     0x40000010>,
+                          <MX8MP_IOMUXC_HDMI_CEC__HDMIMIX_HDMI_CEC     0x40000010>;
+       };
+
+       pinctrl_hoggpio2: hoggpio2grp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_DATA5__GPIO2_IO07          0x140>,
+                          <MX8MP_IOMUXC_SD1_RESET_B__GPIO2_IO10        0x140>,
+                          <MX8MP_IOMUXC_SD1_STROBE__GPIO2_IO11         0x140>;
+       };
+
+       pinctrl_i2c2: i2c2grp {
+               fsl,pins = <MX8MP_IOMUXC_I2C2_SCL__I2C2_SCL             0x400001e2>,
+                          <MX8MP_IOMUXC_I2C2_SDA__I2C2_SDA             0x400001e2>;
+       };
+
+       pinctrl_i2c2_gpio: i2c2-gpiogrp {
+               fsl,pins = <MX8MP_IOMUXC_I2C2_SCL__GPIO5_IO16           0x400001e2>,
+                          <MX8MP_IOMUXC_I2C2_SDA__GPIO5_IO17           0x400001e2>;
+       };
+
+       pinctrl_i2c4: i2c4grp {
+               fsl,pins = <MX8MP_IOMUXC_I2C4_SCL__I2C4_SCL             0x400001e2>,
+                          <MX8MP_IOMUXC_I2C4_SDA__I2C4_SDA             0x400001e2>;
+       };
+
+       pinctrl_i2c4_gpio: i2c4-gpiogrp {
+               fsl,pins = <MX8MP_IOMUXC_I2C4_SCL__GPIO5_IO20           0x400001e2>,
+                          <MX8MP_IOMUXC_I2C4_SDA__GPIO5_IO21           0x400001e2>;
+       };
+
+       pinctrl_i2c6: i2c6grp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_DATA0__I2C6_SCL            0x400001e2>,
+                          <MX8MP_IOMUXC_SD1_DATA1__I2C6_SDA            0x400001e2>;
+       };
+
+       pinctrl_i2c6_gpio: i2c6-gpiogrp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_DATA0__GPIO2_IO02          0x400001e2>,
+                          <MX8MP_IOMUXC_SD1_DATA1__GPIO2_IO03          0x400001e2>;
+       };
+
+       pinctrl_lvdsdisplay: lvdsdisplaygrp {
+               fsl,pins = <MX8MP_IOMUXC_SAI5_RXC__GPIO3_IO20           0x10>; /* Power enable */
+       };
+
+       /* LVDS Backlight */
+       pinctrl_pwm2: pwm2grp {
+               fsl,pins = <MX8MP_IOMUXC_SAI5_RXD0__PWM2_OUT            0x14>;
+       };
+
+       /* FAN */
+       pinctrl_pwm3: pwm3grp {
+               fsl,pins = <MX8MP_IOMUXC_I2C3_SDA__PWM3_OUT             0x14>;
+       };
+
+       pinctrl_reg12v0: reg12v0grp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06          0x140>; /* VCC12V enable */
+       };
+
+       /* X61 */
+       pinctrl_uart1: uart1grp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_CLK__UART1_DCE_TX          0x140>,
+                          <MX8MP_IOMUXC_SD1_CMD__UART1_DCE_RX          0x140>;
+       };
+
+       /* X61 */
+       pinctrl_uart2: uart2grp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_DATA2__UART2_DCE_TX        0x140>,
+                          <MX8MP_IOMUXC_SD1_DATA3__UART2_DCE_RX        0x140>;
+       };
+
+       pinctrl_uart3: uart3grp {
+               fsl,pins = <MX8MP_IOMUXC_SD1_DATA6__UART3_DCE_TX        0x140>,
+                          <MX8MP_IOMUXC_SD1_DATA7__UART3_DCE_RX        0x140>;
+       };
+
+       pinctrl_uart4: uart4grp {
+               fsl,pins = <MX8MP_IOMUXC_UART4_RXD__UART4_DCE_RX        0x140>,
+                          <MX8MP_IOMUXC_UART4_TXD__UART4_DCE_TX        0x140>;
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins = <MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK            0x192>,
+                          <MX8MP_IOMUXC_SD2_CMD__USDHC2_CMD            0x1d2>,
+                          <MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0        0x1d2>,
+                          <MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1        0x1d2>,
+                          <MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2        0x1d2>,
+                          <MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3        0x1d2>,
+                          <MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT     0xc0>;
+       };
+
+       pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp {
+               fsl,pins = <MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK            0x194>,
+                          <MX8MP_IOMUXC_SD2_CMD__USDHC2_CMD            0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0        0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1        0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2        0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3        0x1d4>,
+                          <MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT     0xc0>;
+       };
+
+       pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp {
+               fsl,pins = <MX8MP_IOMUXC_SD2_CLK__USDHC2_CLK            0x194>,
+                          <MX8MP_IOMUXC_SD2_CMD__USDHC2_CMD            0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA0__USDHC2_DATA0        0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA1__USDHC2_DATA1        0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA2__USDHC2_DATA2        0x1d4>,
+                          <MX8MP_IOMUXC_SD2_DATA3__USDHC2_DATA3        0x1d4>,
+                          <MX8MP_IOMUXC_GPIO1_IO04__USDHC2_VSELECT     0xc0>;
+       };
+
+       pinctrl_usdhc2_gpio: usdhc2-gpiogrp {
+               fsl,pins = <MX8MP_IOMUXC_SD2_CD_B__GPIO2_IO12           0x1c0>;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi
new file mode 100644 (file)
index 0000000..7bd680a
--- /dev/null
@@ -0,0 +1,284 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright 2021-2022 TQ-Systems GmbH
+ * Author: Alexander Stein <alexander.stein@tq-group.com>
+ */
+
+#include "imx8mp.dtsi"
+
+/ {
+       model = "TQ-Systems i.MX8MPlus TQMa8MPxL";
+       compatible = "tq,imx8mp-tqma8mpql", "fsl,imx8mp";
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0x0 0x40000000 0 0x80000000>;
+       };
+
+       /* identical to buck4_reg, but should never change */
+       reg_vcc3v3: regulator-vcc3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCC3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-always-on;
+       };
+
+       /* e-MMC IO, needed for HS modes */
+       reg_vcc1v8: regulator-vcc1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "VCC1V8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-always-on;
+       };
+};
+
+&A53_0 {
+       cpu-supply = <&buck2_reg>;
+};
+
+&flexspi {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_flexspi0>;
+       status = "okay";
+
+       flash0: flash@0 {
+               reg = <0>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <80000000>;
+               spi-tx-bus-width = <1>;
+               spi-rx-bus-width = <4>;
+       };
+};
+
+&i2c1 {
+       clock-frequency = <384000>;
+       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";
+
+       /* NXP SE97BTP with temperature sensor + eeprom */
+       se97: temperature-sensor-eeprom@1b {
+               compatible = "nxp,se97", "jedec,jc-42.4-temp";
+               reg = <0x1b>;
+       };
+
+       pmic: pmic@25 {
+               reg = <0x25>;
+               compatible = "nxp,pca9450c";
+
+               /* PMIC PCA9450 PMIC_nINT GPIO1_IO08 */
+               pinctrl-0 = <&pinctrl_pmic>;
+               pinctrl-names = "default";
+               interrupt-parent = <&gpio1>;
+               interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
+
+               regulators {
+                       /* V_0V85_SOC: 0.85 .. 0.95 */
+                       buck1_reg: BUCK1 {
+                               regulator-name = "BUCK1";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <950000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-ramp-delay = <3125>;
+                       };
+
+                       /* VDD_ARM */
+                       buck2_reg: BUCK2 {
+                               regulator-name = "BUCK2";
+                               regulator-min-microvolt = <850000>;
+                               regulator-max-microvolt = <1000000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                               nxp,dvs-run-voltage = <950000>;
+                               nxp,dvs-standby-voltage = <850000>;
+                               regulator-ramp-delay = <3125>;
+                       };
+
+                       /* VCC3V3 -> VMMC, ... must not be changed */
+                       buck4_reg: BUCK4 {
+                               regulator-name = "BUCK4";
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* V_1V8 -> VQMMC, SPI-NOR, ... must not be changed */
+                       buck5_reg: BUCK5 {
+                               regulator-name = "BUCK5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* V_1V1 -> RAM, ... must not be changed */
+                       buck6_reg: BUCK6 {
+                               regulator-name = "BUCK6";
+                               regulator-min-microvolt = <1100000>;
+                               regulator-max-microvolt = <1100000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* V_1V8_SNVS */
+                       ldo1_reg: LDO1 {
+                               regulator-name = "LDO1";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* V_1V8_ANA */
+                       ldo3_reg: LDO3 {
+                               regulator-name = "LDO3";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       /* unused */
+                       ldo4_reg: LDO4 {
+                               regulator-name = "LDO4";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+
+                       /* VCC SD IO - switched using SD2 VSELECT */
+                       ldo5_reg: LDO5 {
+                               regulator-name = "LDO5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
+                       };
+               };
+       };
+
+       pcf85063: rtc@51 {
+               compatible = "nxp,pcf85063a";
+               reg = <0x51>;
+       };
+
+       at24c02: eeprom@53 {
+               compatible = "nxp,se97b", "atmel,24c02";
+               read-only;
+               reg = <0x53>;
+               pagesize = <16>;
+               vcc-supply = <&reg_vcc3v3>;
+       };
+
+       m24c64: eeprom@57 {
+               compatible = "atmel,24c64";
+               reg = <0x57>;
+               pagesize = <32>;
+               vcc-supply = <&reg_vcc3v3>;
+       };
+};
+
+&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;
+       no-sd;
+       no-sdio;
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc1v8>;
+       status = "okay";
+};
+
+&wdog1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_wdog>;
+       fsl,ext-reset-output;
+       status = "okay";
+};
+
+&iomuxc {
+       pinctrl_flexspi0: flexspi0grp {
+               fsl,pins = <MX8MP_IOMUXC_NAND_ALE__FLEXSPI_A_SCLK       0x142>,
+                          <MX8MP_IOMUXC_NAND_CE0_B__FLEXSPI_A_SS0_B    0x82>,
+                          <MX8MP_IOMUXC_NAND_DATA00__FLEXSPI_A_DATA00  0x82>,
+                          <MX8MP_IOMUXC_NAND_DATA01__FLEXSPI_A_DATA01  0x82>,
+                          <MX8MP_IOMUXC_NAND_DATA02__FLEXSPI_A_DATA02  0x82>,
+                          <MX8MP_IOMUXC_NAND_DATA03__FLEXSPI_A_DATA03  0x82>;
+       };
+
+       pinctrl_i2c1: i2c1grp {
+               fsl,pins = <MX8MP_IOMUXC_I2C1_SCL__I2C1_SCL             0x400001e2>,
+                          <MX8MP_IOMUXC_I2C1_SDA__I2C1_SDA             0x400001e2>;
+       };
+
+       pinctrl_i2c1_gpio: i2c1-gpiogrp {
+               fsl,pins = <MX8MP_IOMUXC_I2C1_SCL__GPIO5_IO14           0x400001e2>,
+                          <MX8MP_IOMUXC_I2C1_SDA__GPIO5_IO15           0x400001e2>;
+       };
+
+       pinctrl_pmic: pmicirqgrp {
+               fsl,pins = <MX8MP_IOMUXC_GPIO1_IO08__GPIO1_IO08         0x1c0>;
+       };
+
+       pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
+               fsl,pins = <MX8MP_IOMUXC_SD2_RESET_B__GPIO2_IO19        0x10>;
+       };
+
+       pinctrl_usdhc3: usdhc3grp {
+               fsl,pins = <MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK          0x194>,
+                          <MX8MP_IOMUXC_NAND_WP_B__USDHC3_CMD          0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4        0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5       0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6       0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7         0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE1_B__USDHC3_STROBE      0x84>,
+                          <MX8MP_IOMUXC_NAND_READY_B__USDHC3_RESET_B   0x84>;
+       };
+
+       pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp {
+               fsl,pins = <MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK          0x194>,
+                          <MX8MP_IOMUXC_NAND_WP_B__USDHC3_CMD          0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4        0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5       0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6       0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7         0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE1_B__USDHC3_STROBE      0x84>,
+                          <MX8MP_IOMUXC_NAND_READY_B__USDHC3_RESET_B   0x84>;
+       };
+
+       pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp {
+               fsl,pins = <MX8MP_IOMUXC_NAND_WE_B__USDHC3_CLK          0x194>,
+                          <MX8MP_IOMUXC_NAND_WP_B__USDHC3_CMD          0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA04__USDHC3_DATA0      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA05__USDHC3_DATA1      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA06__USDHC3_DATA2      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_DATA07__USDHC3_DATA3      0x1d4>,
+                          <MX8MP_IOMUXC_NAND_RE_B__USDHC3_DATA4        0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE2_B__USDHC3_DATA5       0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE3_B__USDHC3_DATA6       0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CLE__USDHC3_DATA7         0x1d4>,
+                          <MX8MP_IOMUXC_NAND_CE1_B__USDHC3_STROBE      0x84>,
+                          <MX8MP_IOMUXC_NAND_READY_B__USDHC3_RESET_B   0x84>;
+       };
+
+       pinctrl_wdog: wdoggrp {
+               fsl,pins = <MX8MP_IOMUXC_GPIO1_IO02__WDOG1_WDOG_B       0x1c4>;
+       };
+};
index fb17e32..c5987bd 100644 (file)
@@ -49,7 +49,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_keys>;
 
-               wakeup {
+               button-wakeup {
                        debounce-interval = <10>;
                        /* Verdin CTRL_WAKE1_MICO# (SODIMM 252) */
                        gpios = <&gpio4 0 GPIO_ACTIVE_LOW>;
        };
 };
 
+&cpu_alert0 {
+       temperature = <95000>;
+};
+
+&cpu_crit0 {
+       temperature = <105000>;
+};
+
 /* Verdin SPI_1 */
 &ecspi1 {
        #address-cells = <1>;
index d9542df..46f46bc 100644 (file)
        clk_ext4: clock-ext4 {
                compatible = "fixed-clock";
                #clock-cells = <0>;
-               clock-frequency= <133000000>;
+               clock-frequency = <133000000>;
                clock-output-names = "clk_ext4";
        };
 
                arm,no-tick-in-suspend;
        };
 
-       soc@0 {
+       soc: soc@0 {
                compatible = "fsl,imx8mp-soc", "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                                        compatible = "fsl,sec-v4.0-job-ring";
                                        reg = <0x1000 0x1000>;
                                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                                       status = "disabled";
                                };
 
                                sec_jr1: jr@2000 {
                                         <&clk IMX8MP_CLK_USDHC1_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                         <&clk IMX8MP_CLK_USDHC2_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                         <&clk IMX8MP_CLK_USDHC3_ROOT>;
                                clock-names = "ipg", "ahb", "per";
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                        };
                };
 
+               noc: interconnect@32700000 {
+                       compatible = "fsl,imx8mp-noc", "fsl,imx8m-noc";
+                       reg = <0x32700000 0x100000>;
+                       clocks = <&clk IMX8MP_CLK_NOC>;
+                       #interconnect-cells = <1>;
+                       operating-points-v2 = <&noc_opp_table>;
+
+                       noc_opp_table: opp-table {
+                               compatible = "operating-points-v2";
+
+                               opp-200M {
+                                       opp-hz = /bits/ 64 <200000000>;
+                               };
+
+                               opp-1000M {
+                                       opp-hz = /bits/ 64 <1000000000>;
+                               };
+                       };
+               };
+
                aips4: bus@32c00000 {
                        compatible = "fsl,aips-bus", "simple-bus";
                        reg = <0x32c00000 0x400000>;
index 99fed35..82387b9 100644 (file)
                linux,autosuspend-period = <125>;
        };
 
+       audio_codec_bt_sco: audio-codec-bt-sco {
+               compatible = "linux,bt-sco";
+               #sound-dai-cells = <1>;
+       };
+
        wm8524: audio-codec {
                #sound-dai-cells = <0>;
                compatible = "wlf,wm8524";
                wlf,mute-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
        };
 
+       sound-bt-sco {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "bt-sco-audio";
+               simple-audio-card,format = "dsp_a";
+               simple-audio-card,bitclock-inversion;
+               simple-audio-card,frame-master = <&btcpu>;
+               simple-audio-card,bitclock-master = <&btcpu>;
+
+               btcpu: simple-audio-card,cpu {
+                       sound-dai = <&sai3>;
+                       dai-tdm-slot-num = <2>;
+                       dai-tdm-slot-width = <16>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&audio_codec_bt_sco 1>;
+               };
+       };
+
        sound-wm8524 {
                compatible = "simple-audio-card";
                simple-audio-card,name = "wm8524-audio";
        status = "okay";
 };
 
+&sai3 {
+       #sound-dai-cells = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_sai3>;
+       assigned-clocks = <&clk IMX8MQ_CLK_SAI3>;
+       assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
+       assigned-clock-rates = <24576000>;
+       status = "okay";
+};
+
 &snvs_pwrkey {
        status = "okay";
 };
                >;
        };
 
+       pinctrl_sai3: sai3grp {
+               fsl,pins = <
+                       MX8MQ_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
+                       MX8MQ_IOMUXC_SAI3_TXC_SAI3_TX_BCLK      0xd6
+                       MX8MQ_IOMUXC_SAI3_TXD_SAI3_TX_DATA0     0xd6
+                       MX8MQ_IOMUXC_SAI3_RXD_SAI3_RX_DATA0     0xd6
+               >;
+       };
+
        pinctrl_spdif1: spdif1grp {
                fsl,pins = <
                        MX8MQ_IOMUXC_SPDIF_TX_SPDIF1_OUT        0xd6
index b86f188..6445c6b 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_keys>;
 
-               btn1 {
+               button-1 {
                        label = "VOL_UP";
                        gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
                        wakeup-source;
                        linux,code = <KEY_VOLUMEUP>;
                };
 
-               btn2 {
+               button-2 {
                        label = "VOL_DOWN";
                        gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
                        wakeup-source;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               wwan-wake {
+               button-3 {
                        label = "WWAN_WAKE";
                        gpios = <&gpio3 8 GPIO_ACTIVE_LOW>;
                        interrupt-parent = <&gpio3>;
index 587e55a..9eec8a7 100644 (file)
@@ -37,7 +37,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_keys>;
 
-               vol-down {
+               key-vol-down {
                        label = "VOL_DOWN";
                        gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
@@ -45,7 +45,7 @@
                        wakeup-source;
                };
 
-               vol-up {
+               key-vol-up {
                        label = "VOL_UP";
                        gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index f70fb32..9dda2a1 100644 (file)
@@ -26,7 +26,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpio_keys>;
 
-               power {
+               button-power {
                        label = "Power Button";
                        gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_reg_arm_dram>;
                                reg = <0x60>;
-                               regulator-min-microvolt =  <900000>;
+                               regulator-min-microvolt = <900000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
                                vsel-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
                                pinctrl-names = "default";
                                pinctrl-0 = <&pinctrl_reg_soc_gpu_vpu>;
                                reg = <0x60>;
-                               regulator-min-microvolt =  <900000>;
+                               regulator-min-microvolt = <900000>;
                                regulator-max-microvolt = <1000000>;
                                regulator-always-on;
                                vsel-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
index 2222ef7..4e05120 100644 (file)
        status = "okay";
 
        usbhub: usbhub@2c {
-               compatible ="microchip,usb2513b";
+               compatible = "microchip,usb2513b";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_usbhub>;
                reg = <0x2c>;
index 49eadb0..e9f0cdd 100644 (file)
@@ -94,7 +94,7 @@
        clk_ext4: clock-ext4 {
                compatible = "fixed-clock";
                #clock-cells = <0>;
-               clock-frequency= <133000000>;
+               clock-frequency = <133000000>;
                clock-output-names = "clk_ext4";
        };
 
                arm,no-tick-in-suspend;
        };
 
-       soc@0 {
+       soc: soc@0 {
                compatible = "fsl,imx8mq-soc", "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                nvmem-cells = <&imx8mq_uid>;
                nvmem-cell-names = "soc_unique_id";
 
-               bus@30000000 { /* AIPS1 */
+               aips1: bus@30000000 { /* AIPS1 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        reg = <0x30000000 0x400000>;
                        #address-cells = <1>;
                                                      <0x00030005 0x00000053>,
                                                      <0x00030006 0x0000005f>,
                                                      <0x00030007 0x00000071>;
-                               #thermal-sensor-cells =  <1>;
+                               #thermal-sensor-cells = <1>;
                        };
 
                        wdog1: watchdog@30280000 {
                        };
                };
 
-               bus@30400000 { /* AIPS2 */
+               aips2: bus@30400000 { /* AIPS2 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        reg = <0x30400000 0x400000>;
                        #address-cells = <1>;
                        };
                };
 
-               bus@30800000 { /* AIPS3 */
+               aips3: bus@30800000 { /* AIPS3 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        reg = <0x30800000 0x400000>;
                        #address-cells = <1>;
                                        compatible = "fsl,sec-v4.0-job-ring";
                                        reg = <0x1000 0x1000>;
                                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                                       status = "disabled";
                                };
 
                                sec_jr1: jr@2000 {
                        };
                };
 
-               bus@32c00000 { /* AIPS4 */
+               aips4: bus@32c00000 { /* AIPS4 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        reg = <0x32c00000 0x400000>;
                        #address-cells = <1>;
index 4f76701..c9c2b65 100644 (file)
                             <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>; /* Hypervisor */
        };
 
-       scu {
+       system-controller {
                compatible = "fsl,imx-scu";
                mbox-names = "tx0",
                             "rx0",
                          &lsio_mu1 1 0
                          &lsio_mu1 3 3>;
 
-               pd: imx8qx-pd {
+               pd: power-controller {
                        compatible = "fsl,imx8qm-scu-pd", "fsl,scu-pd";
                        #power-domain-cells = <1>;
                };
index 144fc9e..a08e70f 100644 (file)
@@ -16,7 +16,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpiokeys>;
 
-               wakeup {
+               key-wakeup {
                        label = "Wake-Up";
                        gpios = <&lsio_gpio3 10 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_WAKEUP>;
 
 /* Colibri UART_B */
 &lpuart0 {
-       status= "okay";
+       status = "okay";
 };
 
 /* Colibri UART_C */
 &lpuart2 {
-       status= "okay";
+       status = "okay";
 };
 
 /* Colibri UART_A */
 &lpuart3 {
-       status= "okay";
+       status = "okay";
 };
 
 /* Colibri FastEthernet */
index a79ae33..f4ea18b 100644 (file)
                method = "smc";
        };
 
-       scu {
+       system-controller {
                compatible = "fsl,imx-scu";
                mbox-names = "tx0",
                             "rx0",
                          &lsio_mu1 1 0
                          &lsio_mu1 3 3>;
 
-               pd: imx8qx-pd {
+               pd: power-controller {
                        compatible = "fsl,imx8qxp-scu-pd", "fsl,scu-pd";
                        #power-domain-cells = <1>;
                };
 
                clk: clock-controller {
-                       compatible = "fsl,imx8qxp-clk";
+                       compatible = "fsl,imx8qxp-clk", "fsl,scu-clk";
                        #clock-cells = <2>;
-                       clocks = <&xtal32k &xtal24m>;
-                       clock-names = "xtal_32KHz", "xtal_24Mhz";
                };
 
                iomuxc: pinctrl {
                        compatible = "fsl,imx8qxp-iomuxc";
                };
 
-               ocotp: imx8qx-ocotp {
+               ocotp: ocotp {
                        compatible = "fsl,imx8qxp-scu-ocotp";
                        #address-cells = <1>;
                        #size-cells = <1>;
                };
 
-               scu_key: scu-key {
+               scu_key: keys {
                        compatible = "fsl,imx8qxp-sc-key", "fsl,imx-sc-key";
                        linux,keycodes = <KEY_POWER>;
                        status = "disabled";
        };
 
        thermal_zones: thermal-zones {
-               cpu-thermal0 {
+               cpu0-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <2000>;
                        thermal-sensors = <&tsens IMX_SC_R_SYSTEM>;
index 09f7364..60c1b01 100644 (file)
                };
        };
 
-       soc@0 {
+       soc: soc@0 {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
                                clock-names = "ipg", "ahb", "per";
                                power-domains = <&scmi_devpd IMX8ULP_PD_USDHC0>;
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                clock-names = "ipg", "ahb", "per";
                                power-domains = <&scmi_devpd IMX8ULP_PD_USDHC1>;
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                                clock-names = "ipg", "ahb", "per";
                                power-domains = <&scmi_devpd IMX8ULP_PD_USDHC2_USB1>;
                                fsl,tuning-start-tap = <20>;
-                               fsl,tuning-step= <2>;
+                               fsl,tuning-step = <2>;
                                bus-width = <4>;
                                status = "disabled";
                        };
                };
 
-               gpioe: gpio@2d000000 {
+               gpioe: gpio@2d000080 {
                                compatible = "fsl,imx8ulp-gpio", "fsl,imx7ulp-gpio";
                                reg = <0x2d000080 0x1000>, <0x2d000040 0x40>;
                                gpio-controller;
                                gpio-ranges = <&iomuxc1 0 32 24>;
                };
 
-               gpiof: gpio@2d010000 {
+               gpiof: gpio@2d010080 {
                                compatible = "fsl,imx8ulp-gpio", "fsl,imx7ulp-gpio";
                                reg = <0x2d010080 0x1000>, <0x2d010040 0x40>;
                                gpio-controller;
                        };
                };
 
-               gpiod: gpio@2e200000 {
+               gpiod: gpio@2e200080 {
                        compatible = "fsl,imx8ulp-gpio", "fsl,imx7ulp-gpio";
                        reg = <0x2e200080 0x1000>, <0x2e200040 0x40>;
                        gpio-controller;
diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts b/arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
new file mode 100644 (file)
index 0000000..69786c3
--- /dev/null
@@ -0,0 +1,114 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 NXP
+ */
+
+/dts-v1/;
+
+#include "imx93.dtsi"
+
+/ {
+       model = "NXP i.MX93 11X11 EVK board";
+       compatible = "fsl,imx93-11x11-evk", "fsl,imx93";
+
+       chosen {
+               stdout-path = &lpuart1;
+       };
+
+       reg_usdhc2_vmmc: regulator-usdhc2 {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&pinctrl_reg_usdhc2_vmmc>;
+               regulator-name = "VSD_3V3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               gpio = <&gpio3 7 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+};
+
+&mu1 {
+       status = "okay";
+};
+
+&mu2 {
+       status = "okay";
+};
+
+&lpuart1 { /* console */
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_uart1>;
+       status = "okay";
+};
+
+&usdhc1 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc1>;
+       pinctrl-1 = <&pinctrl_usdhc1>;
+       pinctrl-2 = <&pinctrl_usdhc1>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
+&usdhc2 {
+       pinctrl-names = "default", "state_100mhz", "state_200mhz";
+       pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-1 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
+       pinctrl-2 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
+       cd-gpios = <&gpio3 00 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&reg_usdhc2_vmmc>;
+       bus-width = <4>;
+       status = "okay";
+       no-sdio;
+       no-mmc;
+};
+
+&iomuxc {
+       pinctrl_uart1: uart1grp {
+               fsl,pins = <
+                       MX93_PAD_UART1_RXD__LPUART1_RX                  0x31e
+                       MX93_PAD_UART1_TXD__LPUART1_TX                  0x31e
+               >;
+       };
+
+       pinctrl_usdhc1: usdhc1grp {
+               fsl,pins = <
+                       MX93_PAD_SD1_CLK__USDHC1_CLK            0x17fe
+                       MX93_PAD_SD1_CMD__USDHC1_CMD            0x13fe
+                       MX93_PAD_SD1_DATA0__USDHC1_DATA0        0x13fe
+                       MX93_PAD_SD1_DATA1__USDHC1_DATA1        0x13fe
+                       MX93_PAD_SD1_DATA2__USDHC1_DATA2        0x13fe
+                       MX93_PAD_SD1_DATA3__USDHC1_DATA3        0x13fe
+                       MX93_PAD_SD1_DATA4__USDHC1_DATA4        0x13fe
+                       MX93_PAD_SD1_DATA5__USDHC1_DATA5        0x13fe
+                       MX93_PAD_SD1_DATA6__USDHC1_DATA6        0x13fe
+                       MX93_PAD_SD1_DATA7__USDHC1_DATA7        0x13fe
+                       MX93_PAD_SD1_STROBE__USDHC1_STROBE      0x17fe
+               >;
+       };
+
+       pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
+               fsl,pins = <
+                       MX93_PAD_SD2_RESET_B__GPIO3_IO07        0x31e
+               >;
+       };
+
+       pinctrl_usdhc2_gpio: usdhc2gpiogrp {
+               fsl,pins = <
+                       MX93_PAD_SD2_CD_B__GPIO3_IO00           0x31e
+               >;
+       };
+
+       pinctrl_usdhc2: usdhc2grp {
+               fsl,pins = <
+                       MX93_PAD_SD2_CLK__USDHC2_CLK            0x17fe
+                       MX93_PAD_SD2_CMD__USDHC2_CMD            0x13fe
+                       MX93_PAD_SD2_DATA0__USDHC2_DATA0        0x13fe
+                       MX93_PAD_SD2_DATA1__USDHC2_DATA1        0x13fe
+                       MX93_PAD_SD2_DATA2__USDHC2_DATA2        0x13fe
+                       MX93_PAD_SD2_DATA3__USDHC2_DATA3        0x13fe
+                       MX93_PAD_SD2_VSELECT__USDHC2_VSELECT    0x51e
+               >;
+       };
+};
diff --git a/arch/arm64/boot/dts/freescale/imx93-pinfunc.h b/arch/arm64/boot/dts/freescale/imx93-pinfunc.h
new file mode 100755 (executable)
index 0000000..4298a14
--- /dev/null
@@ -0,0 +1,623 @@
+/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
+/*
+ * Copyright 2022 NXP
+ */
+
+#ifndef __DTS_IMX93_PINFUNC_H
+#define __DTS_IMX93_PINFUNC_H
+
+/*
+ * The pin function ID is a tuple of
+ * <mux_reg conf_reg input_reg mux_mode input_val>
+ */
+#define MX93_PAD_DAP_TDI__JTAG_MUX_TDI                            0x0000 0x01B0 0x03D8 0x0 0x0
+#define MX93_PAD_DAP_TDI__MQS2_LEFT                               0x0000 0x01B0 0x0000 0x1 0x0
+#define MX93_PAD_DAP_TDI__CAN2_TX                                 0x0000 0x01B0 0x0000 0x3 0x0
+#define MX93_PAD_DAP_TDI__FLEXIO2_FLEXIO30                        0x0000 0x01B0 0x0000 0x4 0x0
+#define MX93_PAD_DAP_TDI__GPIO3_IO28                              0x0000 0x01B0 0x0000 0x5 0x0
+#define MX93_PAD_DAP_TDI__LPUART5_RX                              0x0000 0x01B0 0x0430 0x6 0x0
+#define MX93_PAD_DAP_TMS_SWDIO__JTAG_MUX_TMS                      0x0004 0x01B4 0x03DC 0x0 0x0
+#define MX93_PAD_DAP_TMS_SWDIO__FLEXIO2_FLEXIO31                  0x0004 0x01B4 0x0000 0x4 0x0
+#define MX93_PAD_DAP_TMS_SWDIO__GPIO3_IO29                        0x0004 0x01B4 0x0000 0x5 0x0
+#define MX93_PAD_DAP_TMS_SWDIO__LPUART5_RTS_B                     0x0004 0x01B4 0x0000 0x6 0x0
+#define MX93_PAD_DAP_TCLK_SWCLK__JTAG_MUX_TCK                     0x0008 0x01B8 0x03D4 0x0 0x0
+#define MX93_PAD_DAP_TCLK_SWCLK__FLEXIO1_FLEXIO30                 0x0008 0x01B8 0x0000 0x4 0x0
+#define MX93_PAD_DAP_TCLK_SWCLK__GPIO3_IO30                       0x0008 0x01B8 0x0000 0x5 0x0
+#define MX93_PAD_DAP_TCLK_SWCLK__LPUART5_CTS_B                    0x0008 0x01B8 0x042C 0x6 0x0
+#define MX93_PAD_DAP_TDO_TRACESWO__JTAG_MUX_TDO                   0x000C 0x01BC 0x0000 0x0 0x0
+#define MX93_PAD_DAP_TDO_TRACESWO__MQS2_RIGHT                     0x000C 0x01BC 0x0000 0x1 0x0
+#define MX93_PAD_DAP_TDO_TRACESWO__CAN2_RX                        0x000C 0x01BC 0x0364 0x3 0x0
+#define MX93_PAD_DAP_TDO_TRACESWO__FLEXIO1_FLEXIO31               0x000C 0x01BC 0x0000 0x4 0x0
+#define MX93_PAD_DAP_TDO_TRACESWO__GPIO3_IO31                     0x000C 0x01BC 0x0000 0x5 0x0
+#define MX93_PAD_DAP_TDO_TRACESWO__LPUART5_TX                     0x000C 0x01BC 0x0434 0x6 0x0
+#define MX93_PAD_GPIO_IO00__GPIO2_IO00                            0x0010 0x01C0 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO00__LPI2C3_SDA                            0x0010 0x01C0 0x03E4 0x11 0x0
+#define MX93_PAD_GPIO_IO00__MEDIAMIX_CAM_CLK                      0x0010 0x01C0 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO00__MEDIAMIX_DISP_CLK                     0x0010 0x01C0 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO00__LPSPI6_PCS0                           0x0010 0x01C0 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO00__LPUART5_TX                            0x0010 0x01C0 0x0434 0x5 0x1
+#define MX93_PAD_GPIO_IO00__LPI2C5_SDA                            0x0010 0x01C0 0x03EC 0x16 0x0
+#define MX93_PAD_GPIO_IO00__FLEXIO1_FLEXIO00                      0x0010 0x01C0 0x036C 0x7 0x0
+#define MX93_PAD_GPIO_IO01__GPIO2_IO01                            0x0014 0x01C4 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO01__LPI2C3_SCL                            0x0014 0x01C4 0x03E0 0x11 0x0
+#define MX93_PAD_GPIO_IO01__MEDIAMIX_CAM_DATA00                   0x0014 0x01C4 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO01__MEDIAMIX_DISP_DE                      0x0014 0x01C4 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO01__LPSPI6_SIN                            0x0014 0x01C4 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO01__LPUART5_RX                            0x0014 0x01C4 0x0430 0x5 0x1
+#define MX93_PAD_GPIO_IO01__LPI2C5_SCL                            0x0014 0x01C4 0x03E8 0x16 0x0
+#define MX93_PAD_GPIO_IO01__FLEXIO1_FLEXIO01                      0x0014 0x01C4 0x0370 0x7 0x0
+#define MX93_PAD_GPIO_IO02__GPIO2_IO02                            0x0018 0x01C8 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO02__LPI2C4_SDA                            0x0018 0x01C8 0x0000 0x11 0x0
+#define MX93_PAD_GPIO_IO02__MEDIAMIX_CAM_VSYNC                    0x0018 0x01C8 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO02__MEDIAMIX_DISP_VSYNC                   0x0018 0x01C8 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO02__LPSPI6_SOUT                           0x0018 0x01C8 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO02__LPUART5_CTS_B                         0x0018 0x01C8 0x042C 0x5 0x1
+#define MX93_PAD_GPIO_IO02__LPI2C6_SDA                            0x0018 0x01C8 0x03F4 0x16 0x0
+#define MX93_PAD_GPIO_IO02__FLEXIO1_FLEXIO02                      0x0018 0x01C8 0x0374 0x7 0x0
+#define MX93_PAD_GPIO_IO03__GPIO2_IO03                            0x001C 0x01CC 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO03__LPI2C4_SCL                            0x001C 0x01CC 0x0000 0x11 0x0
+#define MX93_PAD_GPIO_IO03__MEDIAMIX_CAM_HSYNC                    0x001C 0x01CC 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO03__MEDIAMIX_DISP_HSYNC                   0x001C 0x01CC 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO03__LPSPI6_SCK                            0x001C 0x01CC 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO03__LPUART5_RTS_B                         0x001C 0x01CC 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO03__LPI2C6_SCL                            0x001C 0x01CC 0x03F0 0x16 0x0
+#define MX93_PAD_GPIO_IO03__FLEXIO1_FLEXIO03                      0x001C 0x01CC 0x0378 0x7 0x0
+#define MX93_PAD_GPIO_IO04__GPIO2_IO04                            0x0020 0x01D0 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO04__TPM3_CH0                              0x0020 0x01D0 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO04__PDM_CLK                               0x0020 0x01D0 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO04__MEDIAMIX_DISP_DATA00                  0x0020 0x01D0 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO04__LPSPI7_PCS0                           0x0020 0x01D0 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO04__LPUART6_TX                            0x0020 0x01D0 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO04__LPI2C6_SDA                            0x0020 0x01D0 0x03F4 0x16 0x1
+#define MX93_PAD_GPIO_IO04__FLEXIO1_FLEXIO04                      0x0020 0x01D0 0x037C 0x7 0x0
+#define MX93_PAD_GPIO_IO05__GPIO2_IO05                            0x0024 0x01D4 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO05__TPM4_CH0                              0x0024 0x01D4 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO05__PDM_BIT_STREAM00                      0x0024 0x01D4 0x0438 0x2 0x0
+#define MX93_PAD_GPIO_IO05__MEDIAMIX_DISP_DATA01                  0x0024 0x01D4 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO05__LPSPI7_SIN                            0x0024 0x01D4 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO05__LPUART6_RX                            0x0024 0x01D4 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO05__LPI2C6_SCL                            0x0024 0x01D4 0x03F0 0x16 0x1
+#define MX93_PAD_GPIO_IO05__FLEXIO1_FLEXIO05                      0x0024 0x01D4 0x0380 0x7 0x0
+#define MX93_PAD_GPIO_IO06__GPIO2_IO06                            0x0028 0x01D8 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO06__TPM5_CH0                              0x0028 0x01D8 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO06__PDM_BIT_STREAM01                      0x0028 0x01D8 0x043C 0x2 0x0
+#define MX93_PAD_GPIO_IO06__MEDIAMIX_DISP_DATA02                  0x0028 0x01D8 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO06__LPSPI7_SOUT                           0x0028 0x01D8 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO06__LPUART6_CTS_B                         0x0028 0x01D8 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO06__LPI2C7_SDA                            0x0028 0x01D8 0x03FC 0x16 0x0
+#define MX93_PAD_GPIO_IO06__FLEXIO1_FLEXIO06                      0x0028 0x01D8 0x0384 0x7 0x0
+#define MX93_PAD_GPIO_IO07__GPIO2_IO07                            0x002C 0x01DC 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO07__LPSPI3_PCS1                           0x002C 0x01DC 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO07__MEDIAMIX_CAM_DATA01                   0x002C 0x01DC 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO07__MEDIAMIX_DISP_DATA03                  0x002C 0x01DC 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO07__LPSPI7_SCK                            0x002C 0x01DC 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO07__LPUART6_RTS_B                         0x002C 0x01DC 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO07__LPI2C7_SCL                            0x002C 0x01DC 0x03F8 0x16 0x0
+#define MX93_PAD_GPIO_IO07__FLEXIO1_FLEXIO07                      0x002C 0x01DC 0x0388 0x7 0x0
+#define MX93_PAD_GPIO_IO08__GPIO2_IO08                            0x0030 0x01E0 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO08__LPSPI3_PCS0                           0x0030 0x01E0 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO08__MEDIAMIX_CAM_DATA02                   0x0030 0x01E0 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO08__MEDIAMIX_DISP_DATA04                  0x0030 0x01E0 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO08__TPM6_CH0                              0x0030 0x01E0 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO08__LPUART7_TX                            0x0030 0x01E0 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO08__LPI2C7_SDA                            0x0030 0x01E0 0x03FC 0x16 0x1
+#define MX93_PAD_GPIO_IO08__FLEXIO1_FLEXIO08                      0x0030 0x01E0 0x038C 0x7 0x0
+#define MX93_PAD_GPIO_IO09__GPIO2_IO09                            0x0034 0x01E4 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO09__LPSPI3_SIN                            0x0034 0x01E4 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO09__MEDIAMIX_CAM_DATA03                   0x0034 0x01E4 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO09__MEDIAMIX_DISP_DATA05                  0x0034 0x01E4 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO09__TPM3_EXTCLK                           0x0034 0x01E4 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO09__LPUART7_RX                            0x0034 0x01E4 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO09__LPI2C7_SCL                            0x0034 0x01E4 0x03F8 0x16 0x1
+#define MX93_PAD_GPIO_IO09__FLEXIO1_FLEXIO09                      0x0034 0x01E4 0x0390 0x7 0x0
+#define MX93_PAD_GPIO_IO10__GPIO2_IO10                            0x0038 0x01E8 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO10__LPSPI3_SOUT                           0x0038 0x01E8 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO10__MEDIAMIX_CAM_DATA04                   0x0038 0x01E8 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO10__MEDIAMIX_DISP_DATA06                  0x0038 0x01E8 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO10__TPM4_EXTCLK                           0x0038 0x01E8 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO10__LPUART7_CTS_B                         0x0038 0x01E8 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO10__LPI2C8_SDA                            0x0038 0x01E8 0x0404 0x16 0x0
+#define MX93_PAD_GPIO_IO10__FLEXIO1_FLEXIO10                      0x0038 0x01E8 0x0394 0x7 0x0
+#define MX93_PAD_GPIO_IO11__GPIO2_IO11                            0x003C 0x01EC 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO11__LPSPI3_SCK                            0x003C 0x01EC 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO11__MEDIAMIX_CAM_DATA05                   0x003C 0x01EC 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO11__MEDIAMIX_DISP_DATA07                  0x003C 0x01EC 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO11__TPM5_EXTCLK                           0x003C 0x01EC 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO11__LPUART7_RTS_B                         0x003C 0x01EC 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO11__LPI2C8_SCL                            0x003C 0x01EC 0x0400 0x16 0x0
+#define MX93_PAD_GPIO_IO11__FLEXIO1_FLEXIO11                      0x003C 0x01EC 0x0398 0x7 0x0
+#define MX93_PAD_GPIO_IO12__GPIO2_IO12                            0x0040 0x01F0 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO12__TPM3_CH2                              0x0040 0x01F0 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO12__PDM_BIT_STREAM02                      0x0040 0x01F0 0x0440 0x2 0x0
+#define MX93_PAD_GPIO_IO12__MEDIAMIX_DISP_DATA08                  0x0040 0x01F0 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO12__LPSPI8_PCS0                           0x0040 0x01F0 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO12__LPUART8_TX                            0x0040 0x01F0 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO12__LPI2C8_SDA                            0x0040 0x01F0 0x0404 0x16 0x1
+#define MX93_PAD_GPIO_IO12__SAI3_RX_SYNC                          0x0040 0x01F0 0x0450 0x7 0x0
+#define MX93_PAD_GPIO_IO13__GPIO2_IO13                            0x0044 0x01F4 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO13__TPM4_CH2                              0x0044 0x01F4 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO13__PDM_BIT_STREAM03                      0x0044 0x01F4 0x0444 0x2 0x0
+#define MX93_PAD_GPIO_IO13__MEDIAMIX_DISP_DATA09                  0x0044 0x01F4 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO13__LPSPI8_SIN                            0x0044 0x01F4 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO13__LPUART8_RX                            0x0044 0x01F4 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO13__LPI2C8_SCL                            0x0044 0x01F4 0x0400 0x16 0x1
+#define MX93_PAD_GPIO_IO13__FLEXIO1_FLEXIO13                      0x0044 0x01F4 0x039C 0x7 0x0
+#define MX93_PAD_GPIO_IO14__GPIO2_IO14                            0x0048 0x01F8 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO14__LPUART3_TX                            0x0048 0x01F8 0x041C 0x1 0x0
+#define MX93_PAD_GPIO_IO14__MEDIAMIX_CAM_DATA06                   0x0048 0x01F8 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO14__MEDIAMIX_DISP_DATA10                  0x0048 0x01F8 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO14__LPSPI8_SOUT                           0x0048 0x01F8 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO14__LPUART8_CTS_B                         0x0048 0x01F8 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO14__LPUART4_TX                            0x0048 0x01F8 0x0428 0x6 0x0
+#define MX93_PAD_GPIO_IO14__FLEXIO1_FLEXIO14                      0x0048 0x01F8 0x03A0 0x7 0x0
+#define MX93_PAD_GPIO_IO15__GPIO2_IO15                            0x004C 0x01FC 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO15__LPUART3_RX                            0x004C 0x01FC 0x0418 0x1 0x0
+#define MX93_PAD_GPIO_IO15__MEDIAMIX_CAM_DATA07                   0x004C 0x01FC 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO15__MEDIAMIX_DISP_DATA11                  0x004C 0x01FC 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO15__LPSPI8_SCK                            0x004C 0x01FC 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO15__LPUART8_RTS_B                         0x004C 0x01FC 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO15__LPUART4_RX                            0x004C 0x01FC 0x0424 0x6 0x0
+#define MX93_PAD_GPIO_IO15__FLEXIO1_FLEXIO15                      0x004C 0x01FC 0x03A4 0x7 0x0
+#define MX93_PAD_GPIO_IO16__GPIO2_IO16                            0x0050 0x0200 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO16__SAI3_TX_BCLK                          0x0050 0x0200 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO16__PDM_BIT_STREAM02                      0x0050 0x0200 0x0440 0x2 0x1
+#define MX93_PAD_GPIO_IO16__MEDIAMIX_DISP_DATA12                  0x0050 0x0200 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO16__LPUART3_CTS_B                         0x0050 0x0200 0x0414 0x4 0x0
+#define MX93_PAD_GPIO_IO16__LPSPI4_PCS2                           0x0050 0x0200 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO16__LPUART4_CTS_B                         0x0050 0x0200 0x0420 0x6 0x0
+#define MX93_PAD_GPIO_IO16__FLEXIO1_FLEXIO16                      0x0050 0x0200 0x03A8 0x7 0x0
+#define MX93_PAD_GPIO_IO17__GPIO2_IO17                            0x0054 0x0204 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO17__SAI3_MCLK                             0x0054 0x0204 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO17__MEDIAMIX_CAM_DATA08                   0x0054 0x0204 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO17__MEDIAMIX_DISP_DATA13                  0x0054 0x0204 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO17__LPUART3_RTS_B                         0x0054 0x0204 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO17__LPSPI4_PCS1                           0x0054 0x0204 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO17__LPUART4_RTS_B                         0x0054 0x0204 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO17__FLEXIO1_FLEXIO17                      0x0054 0x0204 0x03AC 0x7 0x0
+#define MX93_PAD_GPIO_IO18__GPIO2_IO18                            0x0058 0x0208 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO18__SAI3_RX_BCLK                          0x0058 0x0208 0x044C 0x1 0x0
+#define MX93_PAD_GPIO_IO18__MEDIAMIX_CAM_DATA09                   0x0058 0x0208 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO18__MEDIAMIX_DISP_DATA14                  0x0058 0x0208 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO18__LPSPI5_PCS0                           0x0058 0x0208 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO18__LPSPI4_PCS0                           0x0058 0x0208 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO18__TPM5_CH2                              0x0058 0x0208 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO18__FLEXIO1_FLEXIO18                      0x0058 0x0208 0x03B0 0x7 0x0
+#define MX93_PAD_GPIO_IO19__GPIO2_IO19                            0x005C 0x020C 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO19__SAI3_RX_SYNC                          0x005C 0x020C 0x0450 0x1 0x1
+#define MX93_PAD_GPIO_IO19__PDM_BIT_STREAM03                      0x005C 0x020C 0x0444 0x2 0x1
+#define MX93_PAD_GPIO_IO19__MEDIAMIX_DISP_DATA15                  0x005C 0x020C 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO19__LPSPI5_SIN                            0x005C 0x020C 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO19__LPSPI4_SIN                            0x005C 0x020C 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO19__TPM6_CH2                              0x005C 0x020C 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO19__SAI3_TX_DATA00                        0x005C 0x020C 0x0000 0x7 0x0
+#define MX93_PAD_GPIO_IO20__GPIO2_IO20                            0x0060 0x0210 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO20__SAI3_RX_DATA00                        0x0060 0x0210 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO20__PDM_BIT_STREAM00                      0x0060 0x0210 0x0438 0x2 0x1
+#define MX93_PAD_GPIO_IO20__MEDIAMIX_DISP_DATA16                  0x0060 0x0210 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO20__LPSPI5_SOUT                           0x0060 0x0210 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO20__LPSPI4_SOUT                           0x0060 0x0210 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO20__TPM3_CH1                              0x0060 0x0210 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO20__FLEXIO1_FLEXIO20                      0x0060 0x0210 0x03B4 0x7 0x0
+#define MX93_PAD_GPIO_IO21__GPIO2_IO21                            0x0064 0x0214 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO21__SAI3_TX_DATA00                        0x0064 0x0214 0x0000 0x1 0x0
+#define MX93_PAD_GPIO_IO21__PDM_CLK                               0x0064 0x0214 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO21__MEDIAMIX_DISP_DATA17                  0x0064 0x0214 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO21__LPSPI5_SCK                            0x0064 0x0214 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO21__LPSPI4_SCK                            0x0064 0x0214 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO21__TPM4_CH1                              0x0064 0x0214 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO21__SAI3_RX_BCLK                          0x0064 0x0214 0x044C 0x7 0x1
+#define MX93_PAD_GPIO_IO22__GPIO2_IO22                            0x0068 0x0218 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO22__USDHC3_CLK                            0x0068 0x0218 0x0458 0x1 0x0
+#define MX93_PAD_GPIO_IO22__SPDIF_IN                              0x0068 0x0218 0x0454 0x2 0x0
+#define MX93_PAD_GPIO_IO22__MEDIAMIX_DISP_DATA18                  0x0068 0x0218 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO22__TPM5_CH1                              0x0068 0x0218 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO22__TPM6_EXTCLK                           0x0068 0x0218 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO22__LPI2C5_SDA                            0x0068 0x0218 0x03EC 0x16 0x1
+#define MX93_PAD_GPIO_IO22__FLEXIO1_FLEXIO22                      0x0068 0x0218 0x03B8 0x7 0x0
+#define MX93_PAD_GPIO_IO23__GPIO2_IO23                            0x006C 0x021C 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO23__USDHC3_CMD                            0x006C 0x021C 0x045C 0x1 0x0
+#define MX93_PAD_GPIO_IO23__SPDIF_OUT                             0x006C 0x021C 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO23__MEDIAMIX_DISP_DATA19                  0x006C 0x021C 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO23__TPM6_CH1                              0x006C 0x021C 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO23__LPI2C5_SCL                            0x006C 0x021C 0x03E8 0x16 0x1
+#define MX93_PAD_GPIO_IO23__FLEXIO1_FLEXIO23                      0x006C 0x021C 0x03BC 0x7 0x0
+#define MX93_PAD_GPIO_IO24__GPIO2_IO24                            0x0070 0x0220 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO24__USDHC3_DATA0                          0x0070 0x0220 0x0460 0x1 0x0
+#define MX93_PAD_GPIO_IO24__MEDIAMIX_DISP_DATA20                  0x0070 0x0220 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO24__TPM3_CH3                              0x0070 0x0220 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO24__JTAG_MUX_TDO                          0x0070 0x0220 0x0000 0x5 0x0
+#define MX93_PAD_GPIO_IO24__LPSPI6_PCS1                           0x0070 0x0220 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO24__FLEXIO1_FLEXIO24                      0x0070 0x0220 0x03C0 0x7 0x0
+#define MX93_PAD_GPIO_IO25__GPIO2_IO25                            0x0074 0x0224 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO25__USDHC3_DATA1                          0x0074 0x0224 0x0464 0x1 0x0
+#define MX93_PAD_GPIO_IO25__CAN2_TX                               0x0074 0x0224 0x0000 0x2 0x0
+#define MX93_PAD_GPIO_IO25__MEDIAMIX_DISP_DATA21                  0x0074 0x0224 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO25__TPM4_CH3                              0x0074 0x0224 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO25__JTAG_MUX_TCK                          0x0074 0x0224 0x03D4 0x5 0x1
+#define MX93_PAD_GPIO_IO25__LPSPI7_PCS1                           0x0074 0x0224 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO25__FLEXIO1_FLEXIO25                      0x0074 0x0224 0x03C4 0x7 0x0
+#define MX93_PAD_GPIO_IO26__GPIO2_IO26                            0x0078 0x0228 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO26__USDHC3_DATA2                          0x0078 0x0228 0x0468 0x1 0x0
+#define MX93_PAD_GPIO_IO26__PDM_BIT_STREAM01                      0x0078 0x0228 0x043C 0x2 0x1
+#define MX93_PAD_GPIO_IO26__MEDIAMIX_DISP_DATA22                  0x0078 0x0228 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO26__TPM5_CH3                              0x0078 0x0228 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO26__JTAG_MUX_TDI                          0x0078 0x0228 0x03D8 0x5 0x1
+#define MX93_PAD_GPIO_IO26__LPSPI8_PCS1                           0x0078 0x0228 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO26__SAI3_TX_SYNC                          0x0078 0x0228 0x0000 0x7 0x0
+#define MX93_PAD_GPIO_IO27__GPIO2_IO27                            0x007C 0x022C 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO27__USDHC3_DATA3                          0x007C 0x022C 0x046C 0x1 0x0
+#define MX93_PAD_GPIO_IO27__CAN2_RX                               0x007C 0x022C 0x0364 0x2 0x1
+#define MX93_PAD_GPIO_IO27__MEDIAMIX_DISP_DATA23                  0x007C 0x022C 0x0000 0x3 0x0
+#define MX93_PAD_GPIO_IO27__TPM6_CH3                              0x007C 0x022C 0x0000 0x4 0x0
+#define MX93_PAD_GPIO_IO27__JTAG_MUX_TMS                          0x007C 0x022C 0x03DC 0x5 0x1
+#define MX93_PAD_GPIO_IO27__LPSPI5_PCS1                           0x007C 0x022C 0x0000 0x6 0x0
+#define MX93_PAD_GPIO_IO27__FLEXIO1_FLEXIO27                      0x007C 0x022C 0x03C8 0x7 0x0
+#define MX93_PAD_GPIO_IO28__GPIO2_IO28                            0x0080 0x0230 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO28__LPI2C3_SDA                            0x0080 0x0230 0x03E4 0x11 0x1
+#define MX93_PAD_GPIO_IO28__FLEXIO1_FLEXIO28                      0x0080 0x0230 0x0000 0x7 0x0
+#define MX93_PAD_GPIO_IO29__GPIO2_IO29                            0x0084 0x0234 0x0000 0x0 0x0
+#define MX93_PAD_GPIO_IO29__LPI2C3_SCL                            0x0084 0x0234 0x03E0 0x11 0x1
+#define MX93_PAD_GPIO_IO29__FLEXIO1_FLEXIO29                      0x0084 0x0234 0x0000 0x7 0x0
+#define MX93_PAD_CCM_CLKO1__CCMSRCGPCMIX_CLKO1                    0x0088 0x0238 0x0000 0x0 0x0
+#define MX93_PAD_CCM_CLKO1__FLEXIO1_FLEXIO26                      0x0088 0x0238 0x0000 0x4 0x0
+#define MX93_PAD_CCM_CLKO1__GPIO3_IO26                            0x0088 0x0238 0x0000 0x5 0x0
+#define MX93_PAD_CCM_CLKO2__GPIO3_IO27                            0x008C 0x023C 0x0000 0x5 0x0
+#define MX93_PAD_CCM_CLKO2__CCMSRCGPCMIX_CLKO2                    0x008C 0x023C 0x0000 0x0 0x0
+#define MX93_PAD_CCM_CLKO2__FLEXIO1_FLEXIO27                      0x008C 0x023C 0x03C8 0x4 0x1
+#define MX93_PAD_CCM_CLKO3__CCMSRCGPCMIX_CLKO3                    0x0090 0x0240 0x0000 0x0 0x0
+#define MX93_PAD_CCM_CLKO3__FLEXIO2_FLEXIO28                      0x0090 0x0240 0x0000 0x4 0x0
+#define MX93_PAD_CCM_CLKO3__GPIO4_IO28                            0x0090 0x0240 0x0000 0x5 0x0
+#define MX93_PAD_CCM_CLKO4__CCMSRCGPCMIX_CLKO4                    0x0094 0x0244 0x0000 0x0 0x0
+#define MX93_PAD_CCM_CLKO4__FLEXIO2_FLEXIO29                      0x0094 0x0244 0x0000 0x4 0x0
+#define MX93_PAD_CCM_CLKO4__GPIO4_IO29                            0x0094 0x0244 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_MDC__ENET_QOS_MDC                          0x0098 0x0248 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_MDC__LPUART3_DCB_B                         0x0098 0x0248 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_MDC__I3C2_SCL                              0x0098 0x0248 0x03CC 0x2 0x0
+#define MX93_PAD_ENET1_MDC__HSIOMIX_OTG_ID1                       0x0098 0x0248 0x0000 0x3 0x0
+#define MX93_PAD_ENET1_MDC__FLEXIO2_FLEXIO00                      0x0098 0x0248 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_MDC__GPIO4_IO00                            0x0098 0x0248 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_MDIO__ENET_QOS_MDIO                        0x009C 0x024C 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_MDIO__LPUART3_RIN_B                        0x009C 0x024C 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_MDIO__I3C2_SDA                             0x009C 0x024C 0x03D0 0x2 0x0
+#define MX93_PAD_ENET1_MDIO__HSIOMIX_OTG_PWR1                     0x009C 0x024C 0x0000 0x3 0x0
+#define MX93_PAD_ENET1_MDIO__FLEXIO2_FLEXIO01                     0x009C 0x024C 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_MDIO__GPIO4_IO01                           0x009C 0x024C 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_TD3__ENET_QOS_RGMII_TD3                    0x00A0 0x0250 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_TD3__CAN2_TX                               0x00A0 0x0250 0x0000 0x2 0x0
+#define MX93_PAD_ENET1_TD3__HSIOMIX_OTG_ID2                       0x00A0 0x0250 0x0000 0x3 0x0
+#define MX93_PAD_ENET1_TD3__FLEXIO2_FLEXIO02                      0x00A0 0x0250 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_TD3__GPIO4_IO02                            0x00A0 0x0250 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_TD2__ENET_QOS_RGMII_TD2                    0x00A4 0x0254 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_TD2__CCM_ENET_QOS_CLOCK_GENERATE_REF_CLK   0x00A4 0x0254 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_TD2__CAN2_RX                               0x00A4 0x0254 0x0364 0x2 0x2
+#define MX93_PAD_ENET1_TD2__HSIOMIX_OTG_OC2                       0x00A4 0x0254 0x0000 0x3 0x0
+#define MX93_PAD_ENET1_TD2__FLEXIO2_FLEXIO03                      0x00A4 0x0254 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_TD2__GPIO4_IO03                            0x00A4 0x0254 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_TD1__ENET_QOS_RGMII_TD1                    0x00A8 0x0258 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_TD1__LPUART3_RTS_B                         0x00A8 0x0258 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_TD1__I3C2_PUR                              0x00A8 0x0258 0x0000 0x2 0x0
+#define MX93_PAD_ENET1_TD1__HSIOMIX_OTG_OC1                       0x00A8 0x0258 0x0000 0x3 0x0
+#define MX93_PAD_ENET1_TD1__FLEXIO2_FLEXIO04                      0x00A8 0x0258 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_TD1__GPIO4_IO04                            0x00A8 0x0258 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_TD1__I3C2_PUR_B                            0x00A8 0x0258 0x0000 0x6 0x0
+#define MX93_PAD_ENET1_TD0__ENET_QOS_RGMII_TD0                    0x00AC 0x025C 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_TD0__LPUART3_TX                            0x00AC 0x025C 0x041C 0x1 0x1
+#define MX93_PAD_ENET1_TD0__FLEXIO2_FLEXIO05                      0x00AC 0x025C 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_TD0__GPIO4_IO05                            0x00AC 0x025C 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_TX_CTL__ENET_QOS_RGMII_TX_CTL              0x00B0 0x0260 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_TX_CTL__LPUART3_DTR_B                      0x00B0 0x0260 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_TX_CTL__FLEXIO2_FLEXIO06                   0x00B0 0x0260 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_TX_CTL__GPIO4_IO06                         0x00B0 0x0260 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_TXC__CCM_ENET_QOS_CLOCK_GENERATE_TX_CLK    0x00B4 0x0264 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_TXC__ENET_QOS_TX_ER                        0x00B4 0x0264 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_TXC__FLEXIO2_FLEXIO07                      0x00B4 0x0264 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_TXC__GPIO4_IO07                            0x00B4 0x0264 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_RX_CTL__ENET_QOS_RGMII_RX_CTL              0x00B8 0x0268 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_RX_CTL__LPUART3_DSR_B                      0x00B8 0x0268 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_RX_CTL__HSIOMIX_OTG_PWR2                   0x00B8 0x0268 0x0000 0x3 0x0
+#define MX93_PAD_ENET1_RX_CTL__FLEXIO2_FLEXIO08                   0x00B8 0x0268 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_RX_CTL__GPIO4_IO08                         0x00B8 0x0268 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_RXC__CCM_ENET_QOS_CLOCK_GENERATE_RX_CLK    0x00BC 0x026C 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_RXC__ENET_QOS_RX_ER                        0x00BC 0x026C 0x0000 0x1 0x0
+#define MX93_PAD_ENET1_RXC__FLEXIO2_FLEXIO09                      0x00BC 0x026C 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_RXC__GPIO4_IO09                            0x00BC 0x026C 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_RD0__ENET_QOS_RGMII_RD0                    0x00C0 0x0270 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_RD0__LPUART3_RX                            0x00C0 0x0270 0x0418 0x1 0x1
+#define MX93_PAD_ENET1_RD0__FLEXIO2_FLEXIO10                      0x00C0 0x0270 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_RD0__GPIO4_IO10                            0x00C0 0x0270 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_RD1__ENET_QOS_RGMII_RD1                    0x00C4 0x0274 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_RD1__LPUART3_CTS_B                         0x00C4 0x0274 0x0414 0x1 0x1
+#define MX93_PAD_ENET1_RD1__LPTMR2_ALT1                           0x00C4 0x0274 0x0408 0x3 0x0
+#define MX93_PAD_ENET1_RD1__FLEXIO2_FLEXIO11                      0x00C4 0x0274 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_RD1__GPIO4_IO11                            0x00C4 0x0274 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_RD2__ENET_QOS_RGMII_RD2                    0x00C8 0x0278 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_RD2__LPTMR2_ALT2                           0x00C8 0x0278 0x040C 0x3 0x0
+#define MX93_PAD_ENET1_RD2__FLEXIO2_FLEXIO12                      0x00C8 0x0278 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_RD2__GPIO4_IO12                            0x00C8 0x0278 0x0000 0x5 0x0
+#define MX93_PAD_ENET1_RD3__ENET_QOS_RGMII_RD3                    0x00CC 0x027C 0x0000 0x0 0x0
+#define MX93_PAD_ENET1_RD3__FLEXSPI1_TESTER_TRIGGER               0x00CC 0x027C 0x0000 0x2 0x0
+#define MX93_PAD_ENET1_RD3__LPTMR2_ALT3                           0x00CC 0x027C 0x0410 0x3 0x0
+#define MX93_PAD_ENET1_RD3__FLEXIO2_FLEXIO13                      0x00CC 0x027C 0x0000 0x4 0x0
+#define MX93_PAD_ENET1_RD3__GPIO4_IO13                            0x00CC 0x027C 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_MDC__ENET1_MDC                             0x00D0 0x0280 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_MDC__LPUART4_DCB_B                         0x00D0 0x0280 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_MDC__SAI2_RX_SYNC                          0x00D0 0x0280 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_MDC__FLEXIO2_FLEXIO14                      0x00D0 0x0280 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_MDC__GPIO4_IO14                            0x00D0 0x0280 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_MDIO__ENET1_MDIO                           0x00D4 0x0284 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_MDIO__LPUART4_RIN_B                        0x00D4 0x0284 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_MDIO__SAI2_RX_BCLK                         0x00D4 0x0284 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_MDIO__FLEXIO2_FLEXIO15                     0x00D4 0x0284 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_MDIO__GPIO4_IO15                           0x00D4 0x0284 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_TD3__SAI2_RX_DATA00                        0x00D8 0x0288 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_TD3__FLEXIO2_FLEXIO16                      0x00D8 0x0288 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_TD3__GPIO4_IO16                            0x00D8 0x0288 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_TD3__ENET1_RGMII_TD3                       0x00D8 0x0288 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_TD2__ENET1_RGMII_TD2                       0x00DC 0x028C 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_TD2__ENET1_TX_CLK                          0x00DC 0x028C 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_TD2__SAI2_RX_DATA01                        0x00DC 0x028C 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_TD2__FLEXIO2_FLEXIO17                      0x00DC 0x028C 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_TD2__GPIO4_IO17                            0x00DC 0x028C 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_TD1__ENET1_RGMII_TD1                       0x00E0 0x0290 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_TD1__LPUART4_RTS_B                         0x00E0 0x0290 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_TD1__SAI2_RX_DATA02                        0x00E0 0x0290 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_TD1__FLEXIO2_FLEXIO18                      0x00E0 0x0290 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_TD1__GPIO4_IO18                            0x00E0 0x0290 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_TD0__ENET1_RGMII_TD0                       0x00E4 0x0294 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_TD0__LPUART4_TX                            0x00E4 0x0294 0x0428 0x1 0x1
+#define MX93_PAD_ENET2_TD0__SAI2_RX_DATA03                        0x00E4 0x0294 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_TD0__FLEXIO2_FLEXIO19                      0x00E4 0x0294 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_TD0__GPIO4_IO19                            0x00E4 0x0294 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_TX_CTL__ENET1_RGMII_TX_CTL                 0x00E8 0x0298 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_TX_CTL__LPUART4_DTR_B                      0x00E8 0x0298 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_TX_CTL__SAI2_TX_SYNC                       0x00E8 0x0298 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_TX_CTL__FLEXIO2_FLEXIO20                   0x00E8 0x0298 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_TX_CTL__GPIO4_IO20                         0x00E8 0x0298 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_TXC__ENET1_RGMII_TXC                       0x00EC 0x029C 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_TXC__ENET1_TX_ER                           0x00EC 0x029C 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_TXC__SAI2_TX_BCLK                          0x00EC 0x029C 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_TXC__FLEXIO2_FLEXIO21                      0x00EC 0x029C 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_TXC__GPIO4_IO21                            0x00EC 0x029C 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_RX_CTL__ENET1_RGMII_RX_CTL                 0x00F0 0x02A0 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_RX_CTL__LPUART4_DSR_B                      0x00F0 0x02A0 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_RX_CTL__SAI2_TX_DATA00                     0x00F0 0x02A0 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_RX_CTL__FLEXIO2_FLEXIO22                   0x00F0 0x02A0 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_RX_CTL__GPIO4_IO22                         0x00F0 0x02A0 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_RXC__ENET1_RGMII_RXC                       0x00F4 0x02A4 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_RXC__ENET1_RX_ER                           0x00F4 0x02A4 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_RXC__SAI2_TX_DATA01                        0x00F4 0x02A4 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_RXC__FLEXIO2_FLEXIO23                      0x00F4 0x02A4 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_RXC__GPIO4_IO23                            0x00F4 0x02A4 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_RD0__ENET1_RGMII_RD0                       0x00F8 0x02A8 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_RD0__LPUART4_RX                            0x00F8 0x02A8 0x0424 0x1 0x1
+#define MX93_PAD_ENET2_RD0__SAI2_TX_DATA02                        0x00F8 0x02A8 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_RD0__FLEXIO2_FLEXIO24                      0x00F8 0x02A8 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_RD0__GPIO4_IO24                            0x00F8 0x02A8 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_RD1__ENET1_RGMII_RD1                       0x00FC 0x02AC 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_RD1__SPDIF_IN                              0x00FC 0x02AC 0x0454 0x1 0x1
+#define MX93_PAD_ENET2_RD1__SAI2_TX_DATA03                        0x00FC 0x02AC 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_RD1__FLEXIO2_FLEXIO25                      0x00FC 0x02AC 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_RD1__GPIO4_IO25                            0x00FC 0x02AC 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_RD2__ENET1_RGMII_RD2                       0x0100 0x02B0 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_RD2__LPUART4_CTS_B                         0x0100 0x02B0 0x0420 0x1 0x1
+#define MX93_PAD_ENET2_RD2__SAI2_MCLK                             0x0100 0x02B0 0x0000 0x2 0x0
+#define MX93_PAD_ENET2_RD2__MQS2_RIGHT                            0x0100 0x02B0 0x0000 0x3 0x0
+#define MX93_PAD_ENET2_RD2__FLEXIO2_FLEXIO26                      0x0100 0x02B0 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_RD2__GPIO4_IO26                            0x0100 0x02B0 0x0000 0x5 0x0
+#define MX93_PAD_ENET2_RD3__ENET1_RGMII_RD3                       0x0104 0x02B4 0x0000 0x0 0x0
+#define MX93_PAD_ENET2_RD3__SPDIF_OUT                             0x0104 0x02B4 0x0000 0x1 0x0
+#define MX93_PAD_ENET2_RD3__SPDIF_IN                              0x0104 0x02B4 0x0454 0x2 0x2
+#define MX93_PAD_ENET2_RD3__MQS2_LEFT                             0x0104 0x02B4 0x0000 0x3 0x0
+#define MX93_PAD_ENET2_RD3__FLEXIO2_FLEXIO27                      0x0104 0x02B4 0x0000 0x4 0x0
+#define MX93_PAD_ENET2_RD3__GPIO4_IO27                            0x0104 0x02B4 0x0000 0x5 0x0
+#define MX93_PAD_SD1_CLK__FLEXIO1_FLEXIO08                        0x0108 0x02B8 0x038C 0x4 0x1
+#define MX93_PAD_SD1_CLK__GPIO3_IO08                              0x0108 0x02B8 0x0000 0x5 0x0
+#define MX93_PAD_SD1_CLK__USDHC1_CLK                              0x0108 0x02B8 0x0000 0x0 0x0
+#define MX93_PAD_SD1_CMD__USDHC1_CMD                              0x010C 0x02BC 0x0000 0x0 0x0
+#define MX93_PAD_SD1_CMD__FLEXIO1_FLEXIO09                        0x010C 0x02BC 0x0390 0x4 0x1
+#define MX93_PAD_SD1_CMD__GPIO3_IO09                              0x010C 0x02BC 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA0__USDHC1_DATA0                          0x0110 0x02C0 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA0__FLEXIO1_FLEXIO10                      0x0110 0x02C0 0x0394 0x4 0x1
+#define MX93_PAD_SD1_DATA0__GPIO3_IO10                            0x0110 0x02C0 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA1__USDHC1_DATA1                          0x0114 0x02C4 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA1__FLEXIO1_FLEXIO11                      0x0114 0x02C4 0x0398 0x4 0x1
+#define MX93_PAD_SD1_DATA1__GPIO3_IO11                            0x0114 0x02C4 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA1__CCMSRCGPCMIX_INT_BOOT                 0x0114 0x02C4 0x0000 0x6 0x0
+#define MX93_PAD_SD1_DATA2__USDHC1_DATA2                          0x0118 0x02C8 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA2__FLEXIO1_FLEXIO12                      0x0118 0x02C8 0x0000 0x4 0x0
+#define MX93_PAD_SD1_DATA2__GPIO3_IO12                            0x0118 0x02C8 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA2__CCMSRCGPCMIX_PMIC_READY               0x0118 0x02C8 0x0000 0x6 0x0
+#define MX93_PAD_SD1_DATA3__USDHC1_DATA3                          0x011C 0x02CC 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA3__FLEXSPI1_A_SS1_B                      0x011C 0x02CC 0x0000 0x1 0x0
+#define MX93_PAD_SD1_DATA3__FLEXIO1_FLEXIO13                      0x011C 0x02CC 0x039C 0x4 0x1
+#define MX93_PAD_SD1_DATA3__GPIO3_IO13                            0x011C 0x02CC 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA4__USDHC1_DATA4                          0x0120 0x02D0 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA4__FLEXSPI1_A_DATA04                     0x0120 0x02D0 0x0000 0x1 0x0
+#define MX93_PAD_SD1_DATA4__FLEXIO1_FLEXIO14                      0x0120 0x02D0 0x03A0 0x4 0x1
+#define MX93_PAD_SD1_DATA4__GPIO3_IO14                            0x0120 0x02D0 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA5__USDHC1_DATA5                          0x0124 0x02D4 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA5__FLEXSPI1_A_DATA05                     0x0124 0x02D4 0x0000 0x1 0x0
+#define MX93_PAD_SD1_DATA5__USDHC1_RESET_B                        0x0124 0x02D4 0x0000 0x2 0x0
+#define MX93_PAD_SD1_DATA5__FLEXIO1_FLEXIO15                      0x0124 0x02D4 0x03A4 0x4 0x1
+#define MX93_PAD_SD1_DATA5__GPIO3_IO15                            0x0124 0x02D4 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA6__USDHC1_DATA6                          0x0128 0x02D8 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA6__FLEXSPI1_A_DATA06                     0x0128 0x02D8 0x0000 0x1 0x0
+#define MX93_PAD_SD1_DATA6__USDHC1_CD_B                           0x0128 0x02D8 0x0000 0x2 0x0
+#define MX93_PAD_SD1_DATA6__FLEXIO1_FLEXIO16                      0x0128 0x02D8 0x03A8 0x4 0x1
+#define MX93_PAD_SD1_DATA6__GPIO3_IO16                            0x0128 0x02D8 0x0000 0x5 0x0
+#define MX93_PAD_SD1_DATA7__USDHC1_DATA7                          0x012C 0x02DC 0x0000 0x0 0x0
+#define MX93_PAD_SD1_DATA7__FLEXSPI1_A_DATA07                     0x012C 0x02DC 0x0000 0x1 0x0
+#define MX93_PAD_SD1_DATA7__USDHC1_WP                             0x012C 0x02DC 0x0000 0x2 0x0
+#define MX93_PAD_SD1_DATA7__FLEXIO1_FLEXIO17                      0x012C 0x02DC 0x03AC 0x4 0x1
+#define MX93_PAD_SD1_DATA7__GPIO3_IO17                            0x012C 0x02DC 0x0000 0x5 0x0
+#define MX93_PAD_SD1_STROBE__USDHC1_STROBE                        0x0130 0x02E0 0x0000 0x0 0x0
+#define MX93_PAD_SD1_STROBE__FLEXSPI1_A_DQS                       0x0130 0x02E0 0x0000 0x1 0x0
+#define MX93_PAD_SD1_STROBE__FLEXIO1_FLEXIO18                     0x0130 0x02E0 0x03B0 0x4 0x1
+#define MX93_PAD_SD1_STROBE__GPIO3_IO18                           0x0130 0x02E0 0x0000 0x5 0x0
+#define MX93_PAD_SD2_VSELECT__USDHC2_VSELECT                      0x0134 0x02E4 0x0000 0x0 0x0
+#define MX93_PAD_SD2_VSELECT__USDHC2_WP                           0x0134 0x02E4 0x0000 0x1 0x0
+#define MX93_PAD_SD2_VSELECT__LPTMR2_ALT3                         0x0134 0x02E4 0x0410 0x2 0x1
+#define MX93_PAD_SD2_VSELECT__FLEXIO1_FLEXIO19                    0x0134 0x02E4 0x0000 0x4 0x0
+#define MX93_PAD_SD2_VSELECT__GPIO3_IO19                          0x0134 0x02E4 0x0000 0x5 0x0
+#define MX93_PAD_SD2_VSELECT__CCMSRCGPCMIX_EXT_CLK1               0x0134 0x02E4 0x0368 0x6 0x0
+#define MX93_PAD_SD3_CLK__USDHC3_CLK                              0x0138 0x02E8 0x0458 0x0 0x1
+#define MX93_PAD_SD3_CLK__FLEXSPI1_A_SCLK                         0x0138 0x02E8 0x0000 0x1 0x0
+#define MX93_PAD_SD3_CLK__FLEXIO1_FLEXIO20                        0x0138 0x02E8 0x03B4 0x4 0x1
+#define MX93_PAD_SD3_CLK__GPIO3_IO20                              0x0138 0x02E8 0x0000 0x5 0x0
+#define MX93_PAD_SD3_CMD__USDHC3_CMD                              0x013C 0x02EC 0x045C 0x0 0x1
+#define MX93_PAD_SD3_CMD__FLEXSPI1_A_SS0_B                        0x013C 0x02EC 0x0000 0x1 0x0
+#define MX93_PAD_SD3_CMD__FLEXIO1_FLEXIO21                        0x013C 0x02EC 0x0000 0x4 0x0
+#define MX93_PAD_SD3_CMD__GPIO3_IO21                              0x013C 0x02EC 0x0000 0x5 0x0
+#define MX93_PAD_SD3_DATA0__USDHC3_DATA0                          0x0140 0x02F0 0x0460 0x0 0x1
+#define MX93_PAD_SD3_DATA0__FLEXSPI1_A_DATA00                     0x0140 0x02F0 0x0000 0x1 0x0
+#define MX93_PAD_SD3_DATA0__FLEXIO1_FLEXIO22                      0x0140 0x02F0 0x03B8 0x4 0x1
+#define MX93_PAD_SD3_DATA0__GPIO3_IO22                            0x0140 0x02F0 0x0000 0x5 0x0
+#define MX93_PAD_SD3_DATA1__USDHC3_DATA1                          0x0144 0x02F4 0x0464 0x0 0x1
+#define MX93_PAD_SD3_DATA1__FLEXSPI1_A_DATA01                     0x0144 0x02F4 0x0000 0x1 0x0
+#define MX93_PAD_SD3_DATA1__FLEXIO1_FLEXIO23                      0x0144 0x02F4 0x03BC 0x4 0x1
+#define MX93_PAD_SD3_DATA1__GPIO3_IO23                            0x0144 0x02F4 0x0000 0x5 0x0
+#define MX93_PAD_SD3_DATA2__USDHC3_DATA2                          0x0148 0x02F8 0x0468 0x0 0x1
+#define MX93_PAD_SD3_DATA2__FLEXSPI1_A_DATA02                     0x0148 0x02F8 0x0000 0x1 0x0
+#define MX93_PAD_SD3_DATA2__FLEXIO1_FLEXIO24                      0x0148 0x02F8 0x03C0 0x4 0x1
+#define MX93_PAD_SD3_DATA2__GPIO3_IO24                            0x0148 0x02F8 0x0000 0x5 0x0
+#define MX93_PAD_SD3_DATA3__USDHC3_DATA3                          0x014C 0x02FC 0x046C 0x0 0x1
+#define MX93_PAD_SD3_DATA3__FLEXSPI1_A_DATA03                     0x014C 0x02FC 0x0000 0x1 0x0
+#define MX93_PAD_SD3_DATA3__FLEXIO1_FLEXIO25                      0x014C 0x02FC 0x03C4 0x4 0x1
+#define MX93_PAD_SD3_DATA3__GPIO3_IO25                            0x014C 0x02FC 0x0000 0x5 0x0
+#define MX93_PAD_SD2_CD_B__USDHC2_CD_B                            0x0150 0x0300 0x0000 0x0 0x0
+#define MX93_PAD_SD2_CD_B__ENET_QOS_1588_EVENT0_IN                0x0150 0x0300 0x0000 0x1 0x0
+#define MX93_PAD_SD2_CD_B__I3C2_SCL                               0x0150 0x0300 0x03CC 0x2 0x1
+#define MX93_PAD_SD2_CD_B__FLEXIO1_FLEXIO00                       0x0150 0x0300 0x036C 0x4 0x1
+#define MX93_PAD_SD2_CD_B__GPIO3_IO00                             0x0150 0x0300 0x0000 0x5 0x0
+#define MX93_PAD_SD2_CLK__USDHC2_CLK                              0x0154 0x0304 0x0000 0x0 0x0
+#define MX93_PAD_SD2_CLK__ENET_QOS_1588_EVENT0_OUT                0x0154 0x0304 0x0000 0x1 0x0
+#define MX93_PAD_SD2_CLK__I3C2_SDA                                0x0154 0x0304 0x03D0 0x2 0x1
+#define MX93_PAD_SD2_CLK__FLEXIO1_FLEXIO01                        0x0154 0x0304 0x0370 0x4 0x1
+#define MX93_PAD_SD2_CLK__GPIO3_IO01                              0x0154 0x0304 0x0000 0x5 0x0
+#define MX93_PAD_SD2_CLK__CCMSRCGPCMIX_OBSERVE0                   0x0154 0x0304 0x0000 0x6 0x0
+#define MX93_PAD_SD2_CMD__USDHC2_CMD                              0x0158 0x0308 0x0000 0x0 0x0
+#define MX93_PAD_SD2_CMD__ENET1_1588_EVENT0_IN                    0x0158 0x0308 0x0000 0x1 0x0
+#define MX93_PAD_SD2_CMD__I3C2_PUR                                0x0158 0x0308 0x0000 0x2 0x0
+#define MX93_PAD_SD2_CMD__I3C2_PUR_B                              0x0158 0x0308 0x0000 0x3 0x0
+#define MX93_PAD_SD2_CMD__FLEXIO1_FLEXIO02                        0x0158 0x0308 0x0374 0x4 0x1
+#define MX93_PAD_SD2_CMD__GPIO3_IO02                              0x0158 0x0308 0x0000 0x5 0x0
+#define MX93_PAD_SD2_CMD__CCMSRCGPCMIX_OBSERVE1                   0x0158 0x0308 0x0000 0x6 0x0
+#define MX93_PAD_SD2_DATA0__USDHC2_DATA0                          0x015C 0x030C 0x0000 0x0 0x0
+#define MX93_PAD_SD2_DATA0__ENET1_1588_EVENT0_OUT                 0x015C 0x030C 0x0000 0x1 0x0
+#define MX93_PAD_SD2_DATA0__CAN2_TX                               0x015C 0x030C 0x0000 0x2 0x0
+#define MX93_PAD_SD2_DATA0__FLEXIO1_FLEXIO03                      0x015C 0x030C 0x0378 0x4 0x1
+#define MX93_PAD_SD2_DATA0__GPIO3_IO03                            0x015C 0x030C 0x0000 0x5 0x0
+#define MX93_PAD_SD2_DATA0__CCMSRCGPCMIX_OBSERVE2                 0x015C 0x030C 0x0000 0x6 0x0
+#define MX93_PAD_SD2_DATA1__USDHC2_DATA1                          0x0160 0x0310 0x0000 0x0 0x0
+#define MX93_PAD_SD2_DATA1__ENET1_1588_EVENT1_IN                  0x0160 0x0310 0x0000 0x1 0x0
+#define MX93_PAD_SD2_DATA1__CAN2_RX                               0x0160 0x0310 0x0364 0x2 0x3
+#define MX93_PAD_SD2_DATA1__FLEXIO1_FLEXIO04                      0x0160 0x0310 0x037C 0x4 0x1
+#define MX93_PAD_SD2_DATA1__GPIO3_IO04                            0x0160 0x0310 0x0000 0x5 0x0
+#define MX93_PAD_SD2_DATA1__CCMSRCGPCMIX_WAIT                     0x0160 0x0310 0x0000 0x6 0x0
+#define MX93_PAD_SD2_DATA2__USDHC2_DATA2                          0x0164 0x0314 0x0000 0x0 0x0
+#define MX93_PAD_SD2_DATA2__ENET1_1588_EVENT1_OUT                 0x0164 0x0314 0x0000 0x1 0x0
+#define MX93_PAD_SD2_DATA2__MQS2_RIGHT                            0x0164 0x0314 0x0000 0x2 0x0
+#define MX93_PAD_SD2_DATA2__FLEXIO1_FLEXIO05                      0x0164 0x0314 0x0380 0x4 0x1
+#define MX93_PAD_SD2_DATA2__GPIO3_IO05                            0x0164 0x0314 0x0000 0x5 0x0
+#define MX93_PAD_SD2_DATA2__CCMSRCGPCMIX_STOP                     0x0164 0x0314 0x0000 0x6 0x0
+#define MX93_PAD_SD2_DATA3__USDHC2_DATA3                          0x0168 0x0318 0x0000 0x0 0x0
+#define MX93_PAD_SD2_DATA3__LPTMR2_ALT1                           0x0168 0x0318 0x0408 0x1 0x1
+#define MX93_PAD_SD2_DATA3__MQS2_LEFT                             0x0168 0x0318 0x0000 0x2 0x0
+#define MX93_PAD_SD2_DATA3__FLEXIO1_FLEXIO06                      0x0168 0x0318 0x0384 0x4 0x1
+#define MX93_PAD_SD2_DATA3__GPIO3_IO06                            0x0168 0x0318 0x0000 0x5 0x0
+#define MX93_PAD_SD2_DATA3__CCMSRCGPCMIX_EARLY_RESET              0x0168 0x0318 0x0000 0x6 0x0
+#define MX93_PAD_SD2_RESET_B__USDHC2_RESET_B                      0x016C 0x031C 0x0000 0x0 0x0
+#define MX93_PAD_SD2_RESET_B__LPTMR2_ALT2                         0x016C 0x031C 0x040C 0x1 0x1
+#define MX93_PAD_SD2_RESET_B__FLEXIO1_FLEXIO07                    0x016C 0x031C 0x0388 0x4 0x1
+#define MX93_PAD_SD2_RESET_B__GPIO3_IO07                          0x016C 0x031C 0x0000 0x5 0x0
+#define MX93_PAD_SD2_RESET_B__CCMSRCGPCMIX_SYSTEM_RESET           0x016C 0x031C 0x0000 0x6 0x0
+#define MX93_PAD_I2C1_SCL__LPI2C1_SCL                             0x0170 0x0320 0x0000 0x10 0x0
+#define MX93_PAD_I2C1_SCL__I3C1_SCL                               0x0170 0x0320 0x0000 0x1 0x0
+#define MX93_PAD_I2C1_SCL__LPUART1_DCB_B                          0x0170 0x0320 0x0000 0x2 0x0
+#define MX93_PAD_I2C1_SCL__TPM2_CH0                               0x0170 0x0320 0x0000 0x3 0x0
+#define MX93_PAD_I2C1_SCL__GPIO1_IO00                             0x0170 0x0320 0x0000 0x5 0x0
+#define MX93_PAD_I2C1_SDA__LPI2C1_SDA                             0x0174 0x0324 0x0000 0x10 0x0
+#define MX93_PAD_I2C1_SDA__I3C1_SDA                               0x0174 0x0324 0x0000 0x1 0x0
+#define MX93_PAD_I2C1_SDA__LPUART1_RIN_B                          0x0174 0x0324 0x0000 0x2 0x0
+#define MX93_PAD_I2C1_SDA__TPM2_CH1                               0x0174 0x0324 0x0000 0x3 0x0
+#define MX93_PAD_I2C1_SDA__GPIO1_IO01                             0x0174 0x0324 0x0000 0x5 0x0
+#define MX93_PAD_I2C2_SCL__LPI2C2_SCL                             0x0178 0x0328 0x0000 0x10 0x0
+#define MX93_PAD_I2C2_SCL__I3C1_PUR                               0x0178 0x0328 0x0000 0x1 0x0
+#define MX93_PAD_I2C2_SCL__LPUART2_DCB_B                          0x0178 0x0328 0x0000 0x2 0x0
+#define MX93_PAD_I2C2_SCL__TPM2_CH2                               0x0178 0x0328 0x0000 0x3 0x0
+#define MX93_PAD_I2C2_SCL__SAI1_RX_SYNC                           0x0178 0x0328 0x0000 0x4 0x0
+#define MX93_PAD_I2C2_SCL__GPIO1_IO02                             0x0178 0x0328 0x0000 0x5 0x0
+#define MX93_PAD_I2C2_SCL__I3C1_PUR_B                             0x0178 0x0328 0x0000 0x6 0x0
+#define MX93_PAD_I2C2_SDA__LPI2C2_SDA                             0x017C 0x032C 0x0000 0x10 0x0
+#define MX93_PAD_I2C2_SDA__LPUART2_RIN_B                          0x017C 0x032C 0x0000 0x2 0x0
+#define MX93_PAD_I2C2_SDA__TPM2_CH3                               0x017C 0x032C 0x0000 0x3 0x0
+#define MX93_PAD_I2C2_SDA__SAI1_RX_BCLK                           0x017C 0x032C 0x0000 0x4 0x0
+#define MX93_PAD_I2C2_SDA__GPIO1_IO03                             0x017C 0x032C 0x0000 0x5 0x0
+#define MX93_PAD_UART1_RXD__LPUART1_RX                            0x0180 0x0330 0x0000 0x0 0x0
+#define MX93_PAD_UART1_RXD__S400_UART_RX                          0x0180 0x0330 0x0000 0x1 0x0
+#define MX93_PAD_UART1_RXD__LPSPI2_SIN                            0x0180 0x0330 0x0000 0x2 0x0
+#define MX93_PAD_UART1_RXD__TPM1_CH0                              0x0180 0x0330 0x0000 0x3 0x0
+#define MX93_PAD_UART1_RXD__GPIO1_IO04                            0x0180 0x0330 0x0000 0x5 0x0
+#define MX93_PAD_UART1_TXD__LPUART1_TX                            0x0184 0x0334 0x0000 0x0 0x0
+#define MX93_PAD_UART1_TXD__S400_UART_TX                          0x0184 0x0334 0x0000 0x1 0x0
+#define MX93_PAD_UART1_TXD__LPSPI2_PCS0                           0x0184 0x0334 0x0000 0x2 0x0
+#define MX93_PAD_UART1_TXD__TPM1_CH1                              0x0184 0x0334 0x0000 0x3 0x0
+#define MX93_PAD_UART1_TXD__GPIO1_IO05                            0x0184 0x0334 0x0000 0x5 0x0
+#define MX93_PAD_UART2_RXD__LPUART2_RX                            0x0188 0x0338 0x0000 0x0 0x0
+#define MX93_PAD_UART2_RXD__LPUART1_CTS_B                         0x0188 0x0338 0x0000 0x1 0x0
+#define MX93_PAD_UART2_RXD__LPSPI2_SOUT                           0x0188 0x0338 0x0000 0x2 0x0
+#define MX93_PAD_UART2_RXD__TPM1_CH2                              0x0188 0x0338 0x0000 0x3 0x0
+#define MX93_PAD_UART2_RXD__SAI1_MCLK                             0x0188 0x0338 0x0448 0x4 0x0
+#define MX93_PAD_UART2_RXD__GPIO1_IO06                            0x0188 0x0338 0x0000 0x5 0x0
+#define MX93_PAD_UART2_TXD__LPUART2_TX                            0x018C 0x033C 0x0000 0x0 0x0
+#define MX93_PAD_UART2_TXD__LPUART1_RTS_B                         0x018C 0x033C 0x0000 0x1 0x0
+#define MX93_PAD_UART2_TXD__LPSPI2_SCK                            0x018C 0x033C 0x0000 0x2 0x0
+#define MX93_PAD_UART2_TXD__TPM1_CH3                              0x018C 0x033C 0x0000 0x3 0x0
+#define MX93_PAD_UART2_TXD__GPIO1_IO07                            0x018C 0x033C 0x0000 0x5 0x0
+#define MX93_PAD_PDM_CLK__PDM_CLK                                 0x0190 0x0340 0x0000 0x0 0x0
+#define MX93_PAD_PDM_CLK__MQS1_LEFT                               0x0190 0x0340 0x0000 0x1 0x0
+#define MX93_PAD_PDM_CLK__LPTMR1_ALT1                             0x0190 0x0340 0x0000 0x4 0x0
+#define MX93_PAD_PDM_CLK__GPIO1_IO08                              0x0190 0x0340 0x0000 0x5 0x0
+#define MX93_PAD_PDM_CLK__CAN1_TX                                 0x0190 0x0340 0x0000 0x6 0x0
+#define MX93_PAD_PDM_BIT_STREAM0__PDM_BIT_STREAM00                0x0194 0x0344 0x0438 0x0 0x2
+#define MX93_PAD_PDM_BIT_STREAM0__MQS1_RIGHT                      0x0194 0x0344 0x0000 0x1 0x0
+#define MX93_PAD_PDM_BIT_STREAM0__LPSPI1_PCS1                     0x0194 0x0344 0x0000 0x2 0x0
+#define MX93_PAD_PDM_BIT_STREAM0__TPM1_EXTCLK                     0x0194 0x0344 0x0000 0x3 0x0
+#define MX93_PAD_PDM_BIT_STREAM0__LPTMR1_ALT2                     0x0194 0x0344 0x0000 0x4 0x0
+#define MX93_PAD_PDM_BIT_STREAM0__GPIO1_IO09                      0x0194 0x0344 0x0000 0x5 0x0
+#define MX93_PAD_PDM_BIT_STREAM0__CAN1_RX                         0x0194 0x0344 0x0360 0x6 0x0
+#define MX93_PAD_PDM_BIT_STREAM1__PDM_BIT_STREAM01                0x0198 0x0348 0x043C 0x0 0x2
+#define MX93_PAD_PDM_BIT_STREAM1__NMI_GLUE_NMI                    0x0198 0x0348 0x0000 0x1 0x0
+#define MX93_PAD_PDM_BIT_STREAM1__LPSPI2_PCS1                     0x0198 0x0348 0x0000 0x2 0x0
+#define MX93_PAD_PDM_BIT_STREAM1__TPM2_EXTCLK                     0x0198 0x0348 0x0000 0x3 0x0
+#define MX93_PAD_PDM_BIT_STREAM1__LPTMR1_ALT3                     0x0198 0x0348 0x0000 0x4 0x0
+#define MX93_PAD_PDM_BIT_STREAM1__GPIO1_IO10                      0x0198 0x0348 0x0000 0x5 0x0
+#define MX93_PAD_PDM_BIT_STREAM1__CCMSRCGPCMIX_EXT_CLK1           0x0198 0x0348 0x0368 0x6 0x1
+#define MX93_PAD_SAI1_TXFS__SAI1_TX_SYNC                          0x019C 0x034C 0x0000 0x0 0x0
+#define MX93_PAD_SAI1_TXFS__SAI1_TX_DATA01                        0x019C 0x034C 0x0000 0x1 0x0
+#define MX93_PAD_SAI1_TXFS__LPSPI1_PCS0                           0x019C 0x034C 0x0000 0x2 0x0
+#define MX93_PAD_SAI1_TXFS__LPUART2_DTR_B                         0x019C 0x034C 0x0000 0x3 0x0
+#define MX93_PAD_SAI1_TXFS__MQS1_LEFT                             0x019C 0x034C 0x0000 0x4 0x0
+#define MX93_PAD_SAI1_TXFS__GPIO1_IO11                            0x019C 0x034C 0x0000 0x5 0x0
+#define MX93_PAD_SAI1_TXC__SAI1_TX_BCLK                           0x01A0 0x0350 0x0000 0x0 0x0
+#define MX93_PAD_SAI1_TXC__LPUART2_CTS_B                          0x01A0 0x0350 0x0000 0x1 0x0
+#define MX93_PAD_SAI1_TXC__LPSPI1_SIN                             0x01A0 0x0350 0x0000 0x2 0x0
+#define MX93_PAD_SAI1_TXC__LPUART1_DSR_B                          0x01A0 0x0350 0x0000 0x3 0x0
+#define MX93_PAD_SAI1_TXC__CAN1_RX                                0x01A0 0x0350 0x0360 0x4 0x1
+#define MX93_PAD_SAI1_TXC__GPIO1_IO12                             0x01A0 0x0350 0x0000 0x5 0x0
+#define MX93_PAD_SAI1_TXD0__SAI1_TX_DATA00                        0x01A4 0x0354 0x0000 0x0 0x0
+#define MX93_PAD_SAI1_TXD0__LPUART2_RTS_B                         0x01A4 0x0354 0x0000 0x1 0x0
+#define MX93_PAD_SAI1_TXD0__LPSPI1_SCK                            0x01A4 0x0354 0x0000 0x2 0x0
+#define MX93_PAD_SAI1_TXD0__LPUART1_DTR_B                         0x01A4 0x0354 0x0000 0x3 0x0
+#define MX93_PAD_SAI1_TXD0__CAN1_TX                               0x01A4 0x0354 0x0000 0x4 0x0
+#define MX93_PAD_SAI1_TXD0__GPIO1_IO13                            0x01A4 0x0354 0x0000 0x5 0x0
+#define MX93_PAD_SAI1_RXD0__SAI1_RX_DATA00                        0x01A8 0x0358 0x0000 0x0 0x0
+#define MX93_PAD_SAI1_RXD0__SAI1_MCLK                             0x01A8 0x0358 0x0448 0x1 0x1
+#define MX93_PAD_SAI1_RXD0__LPSPI1_SOUT                           0x01A8 0x0358 0x0000 0x2 0x0
+#define MX93_PAD_SAI1_RXD0__LPUART2_DSR_B                         0x01A8 0x0358 0x0000 0x3 0x0
+#define MX93_PAD_SAI1_RXD0__MQS1_RIGHT                            0x01A8 0x0358 0x0000 0x4 0x0
+#define MX93_PAD_SAI1_RXD0__GPIO1_IO14                            0x01A8 0x0358 0x0000 0x5 0x0
+#define MX93_PAD_WDOG_ANY__WDOG1_WDOG_ANY                         0x01AC 0x035C 0x0000 0x0 0x0
+#define MX93_PAD_WDOG_ANY__GPIO1_IO15                             0x01AC 0x035C 0x0000 0x5 0x0
+
+#endif /* __DTS_IMX93_PINFUNC_H */
diff --git a/arch/arm64/boot/dts/freescale/imx93.dtsi b/arch/arm64/boot/dts/freescale/imx93.dtsi
new file mode 100644 (file)
index 0000000..f83a07c
--- /dev/null
@@ -0,0 +1,334 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2022 NXP
+ */
+
+#include <dt-bindings/clock/imx93-clock.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+#include "imx93-pinfunc.h"
+
+/ {
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       aliases {
+               mmc0 = &usdhc1;
+               mmc1 = &usdhc2;
+               mmc2 = &usdhc3;
+               serial0 = &lpuart1;
+               serial1 = &lpuart2;
+               serial2 = &lpuart3;
+               serial3 = &lpuart4;
+               serial4 = &lpuart5;
+               serial5 = &lpuart6;
+               serial6 = &lpuart7;
+               serial7 = &lpuart8;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               A55_0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x0>;
+                       enable-method = "psci";
+                       #cooling-cells = <2>;
+               };
+
+               A55_1: cpu@100 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x100>;
+                       enable-method = "psci";
+                       #cooling-cells = <2>;
+               };
+
+       };
+
+       osc_32k: clock-osc-32k {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+               clock-output-names = "osc_32k";
+       };
+
+       osc_24m: clock-osc-24m {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <24000000>;
+               clock-output-names = "osc_24m";
+       };
+
+       clk_ext1: clock-ext1 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <133000000>;
+               clock-output-names = "clk_ext1";
+       };
+
+       psci {
+               compatible = "arm,psci-1.0";
+               method = "smc";
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>;
+               clock-frequency = <24000000>;
+               arm,no-tick-in-suspend;
+               interrupt-parent = <&gic>;
+       };
+
+       gic: interrupt-controller@48000000 {
+               compatible = "arm,gic-v3";
+               reg = <0 0x48000000 0 0x10000>,
+                     <0 0x48040000 0 0xc0000>;
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-parent = <&gic>;
+       };
+
+       soc@0 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0x0 0x0 0x0 0x80000000>,
+                        <0x28000000 0x0 0x28000000 0x10000000>;
+
+               aips1: bus@44000000 {
+                       compatible = "fsl,aips-bus", "simple-bus";
+                       reg = <0x44000000 0x800000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       mu1: mailbox@44230000 {
+                               compatible = "fsl,imx93-mu", "fsl,imx8ulp-mu";
+                               reg = <0x44230000 0x10000>;
+                               interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+                               #mbox-cells = <2>;
+                               status = "disabled";
+                       };
+
+                       system_counter: timer@44290000 {
+                               compatible = "nxp,sysctr-timer";
+                               reg = <0x44290000 0x30000>;
+                               interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&osc_24m>;
+                               clock-names = "per";
+                       };
+
+                       lpuart1: serial@44380000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x44380000 0x1000>;
+                               interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART1_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       lpuart2: serial@44390000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x44390000 0x1000>;
+                               interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART2_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       iomuxc: pinctrl@443c0000 {
+                               compatible = "fsl,imx93-iomuxc";
+                               reg = <0x443c0000 0x10000>;
+                               status = "okay";
+                       };
+
+                       clk: clock-controller@44450000 {
+                               compatible = "fsl,imx93-ccm";
+                               reg = <0x44450000 0x10000>;
+                               #clock-cells = <1>;
+                               clocks = <&osc_32k>, <&osc_24m>, <&clk_ext1>;
+                               clock-names = "osc_32k", "osc_24m", "clk_ext1";
+                               status = "okay";
+                       };
+
+                       anatop: anatop@44480000 {
+                               compatible = "fsl,imx93-anatop", "syscon";
+                               reg = <0x44480000 0x10000>;
+                       };
+               };
+
+               aips2: bus@42000000 {
+                       compatible = "fsl,aips-bus", "simple-bus";
+                       reg = <0x42000000 0x800000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       mu2: mailbox@42440000 {
+                               compatible = "fsl,imx93-mu", "fsl,imx8ulp-mu";
+                               reg = <0x42440000 0x10000>;
+                               interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
+                               #mbox-cells = <2>;
+                               status = "disabled";
+                       };
+
+                       lpuart3: serial@42570000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x42570000 0x1000>;
+                               interrupts = <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART3_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       lpuart4: serial@42580000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x42580000 0x1000>;
+                               interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART4_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       lpuart5: serial@42590000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x42590000 0x1000>;
+                               interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART5_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       lpuart6: serial@425a0000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x425a0000 0x1000>;
+                               interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART6_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       lpuart7: serial@42690000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x42690000 0x1000>;
+                               interrupts = <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART7_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+
+                       lpuart8: serial@426a0000 {
+                               compatible = "fsl,imx93-lpuart", "fsl,imx7ulp-lpuart";
+                               reg = <0x426a0000 0x1000>;
+                               interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_LPUART8_GATE>;
+                               clock-names = "ipg";
+                               status = "disabled";
+                       };
+               };
+
+               aips3: bus@42800000 {
+                       compatible = "fsl,aips-bus", "simple-bus";
+                       reg = <0x42800000 0x800000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       usdhc1: mmc@42850000 {
+                               compatible = "fsl,imx93-usdhc", "fsl,imx8mm-usdhc";
+                               reg = <0x42850000 0x10000>;
+                               interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_DUMMY>,
+                                        <&clk IMX93_CLK_DUMMY>,
+                                        <&clk IMX93_CLK_USDHC1_GATE>;
+                               clock-names = "ipg", "ahb", "per";
+                               bus-width = <8>;
+                               fsl,tuning-start-tap = <20>;
+                               fsl,tuning-step= <2>;
+                               status = "disabled";
+                       };
+
+                       usdhc2: mmc@42860000 {
+                               compatible = "fsl,imx93-usdhc", "fsl,imx8mm-usdhc";
+                               reg = <0x42860000 0x10000>;
+                               interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_DUMMY>,
+                                        <&clk IMX93_CLK_DUMMY>,
+                                        <&clk IMX93_CLK_USDHC2_GATE>;
+                               clock-names = "ipg", "ahb", "per";
+                               bus-width = <4>;
+                               fsl,tuning-start-tap = <20>;
+                               fsl,tuning-step= <2>;
+                               status = "disabled";
+                       };
+
+                       usdhc3: mmc@428b0000 {
+                               compatible = "fsl,imx93-usdhc", "fsl,imx8mm-usdhc";
+                               reg = <0x428b0000 0x10000>;
+                               interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&clk IMX93_CLK_DUMMY>,
+                                        <&clk IMX93_CLK_DUMMY>,
+                                        <&clk IMX93_CLK_USDHC3_GATE>;
+                               clock-names = "ipg", "ahb", "per";
+                               bus-width = <4>;
+                               fsl,tuning-start-tap = <20>;
+                               fsl,tuning-step= <2>;
+                               status = "disabled";
+                       };
+               };
+
+               gpio2: gpio@43810080 {
+                       compatible = "fsl,imx93-gpio", "fsl,imx7ulp-gpio";
+                       reg = <0x43810080 0x1000>, <0x43810040 0x40>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-ranges = <&iomuxc 0 32 32>;
+               };
+
+               gpio3: gpio@43820080 {
+                       compatible = "fsl,imx93-gpio", "fsl,imx7ulp-gpio";
+                       reg = <0x43820080 0x1000>, <0x43820040 0x40>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-ranges = <&iomuxc 0 64 32>;
+               };
+
+               gpio4: gpio@43830080 {
+                       compatible = "fsl,imx93-gpio", "fsl,imx7ulp-gpio";
+                       reg = <0x43830080 0x1000>, <0x43830040 0x40>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-ranges = <&iomuxc 0 96 32>;
+               };
+
+               gpio1: gpio@47400080 {
+                       compatible = "fsl,imx93-gpio", "fsl,imx7ulp-gpio";
+                       reg = <0x47400080 0x1000>, <0x47400040 0x40>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-ranges = <&iomuxc 0 0 32>;
+               };
+       };
+};
index c2f0f1a..104bdd4 100644 (file)
@@ -16,7 +16,6 @@
        };
 
        chosen {
-               // bootargs = "console=ttymxc2,115200 earlycon=ec_imx6q,0x30880000,115200";
                stdout-path = &uart3;
        };
 
                pinctrl-0 = <&pinctrl_gpiobutton>;
                autorepeat;
 
-               switch1 {
+               switch-1 {
                        label = "switch1";
                        linux,code = <BTN_0>;
                        gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
                        wakeup-source;
                };
 
-               btn2: switch2 {
+               btn2: switch-2 {
                        label = "switch2";
                        linux,code = <BTN_1>;
                        gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
                        wakeup-source;
                };
 
-               switch3 {
+               switch-3 {
                        label = "switch3";
                        linux,code = <BTN_2>;
                        gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
-/* UART4 is assigned to Cortex-M4 */
 &usdhc2 {
        pinctrl-names = "default", "state_100mhz", "state_200mhz";
        pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_usdhc2_gpio>;
index 59ea8a2..824d401 100644 (file)
@@ -79,7 +79,7 @@
                };
        };
 
-       soc {
+       soc@0 {
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
index f68580d..0192a01 100644 (file)
@@ -49,9 +49,9 @@
                ramoops@32000000 {
                        compatible = "ramoops";
                        reg = <0x0 0x32000000 0x0 0x00100000>;
-                       record-size     = <0x00020000>;
-                       console-size    = <0x00020000>;
-                       ftrace-size     = <0x00020000>;
+                       record-size = <0x00020000>;
+                       console-size = <0x00020000>;
+                       ftrace-size = <0x00020000>;
                };
        };
 
@@ -63,9 +63,9 @@
                        compatible = "syscon-reboot-mode";
                        offset = <0x0>;
 
-                       mode-normal     = <0x77665501>;
-                       mode-bootloader = <0x77665500>;
-                       mode-recovery   = <0x77665502>;
+                       mode-normal = <0x77665501>;
+                       mode-bootloader = <0x77665500>;
+                       mode-recovery = <0x77665502>;
                };
        };
 
@@ -74,7 +74,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key_pmx_func &pwr_key_cfg_func>;
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 6b3057a..8343d0c 100644 (file)
                        reg = <0x0 0xfdf00000 0x0 0x1000>;
                        interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
                        dma-names = "rx", "tx";
-                       dmas =  <&dma0 2 &dma0 3>;
+                       dmas = <&dma0 2 &dma0 3>;
                        clocks = <&crg_ctrl HI3660_CLK_GATE_UART1>,
                                 <&crg_ctrl HI3660_CLK_GATE_UART1>;
                        clock-names = "uartclk", "apb_pclk";
                        reg = <0x0 0xfdf03000 0x0 0x1000>;
                        interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
                        dma-names = "rx", "tx";
-                       dmas =  <&dma0 4 &dma0 5>;
+                       dmas = <&dma0 4 &dma0 5>;
                        clocks = <&crg_ctrl HI3660_CLK_GATE_UART2>,
                                 <&crg_ctrl HI3660_PCLK>;
                        clock-names = "uartclk", "apb_pclk";
                        reg = <0x0 0xfdf01000 0x0 0x1000>;
                        interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
                        dma-names = "rx", "tx";
-                       dmas =  <&dma0 6 &dma0 7>;
+                       dmas = <&dma0 6 &dma0 7>;
                        clocks = <&crg_ctrl HI3660_CLK_GATE_UART4>,
                                 <&crg_ctrl HI3660_CLK_GATE_UART4>;
                        clock-names = "uartclk", "apb_pclk";
                        reg = <0x0 0xfdf05000 0x0 0x1000>;
                        interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
                        dma-names = "rx", "tx";
-                       dmas =  <&dma0 8 &dma0 9>;
+                       dmas = <&dma0 8 &dma0 9>;
                        clocks = <&crg_ctrl HI3660_CLK_GATE_UART5>,
                                 <&crg_ctrl HI3660_CLK_GATE_UART5>;
                        clock-names = "uartclk", "apb_pclk";
index 3125c38..886b93c 100644 (file)
                        interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
                        gpio-controller;
                        #gpio-cells = <2>;
-                       gpio-ranges =  <&pmx0 0 13 4 &pmx0 7 17 1>;
+                       gpio-ranges = <&pmx0 0 13 4 &pmx0 7 17 1>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
                        clocks = <&crg_ctrl HI3670_PCLK_GPIO3>;
index 3df2afb..629e604 100644 (file)
@@ -54,9 +54,9 @@
                ramoops@21f00000 {
                        compatible = "ramoops";
                        reg = <0x0 0x21f00000 0x0 0x00100000>;
-                       record-size     = <0x00020000>;
-                       console-size    = <0x00020000>;
-                       ftrace-size     = <0x00020000>;
+                       record-size = <0x00020000>;
+                       console-size = <0x00020000>;
+                       ftrace-size = <0x00020000>;
                };
 
                /* global autoconfigured region for contiguous allocations */
@@ -76,9 +76,9 @@
                        compatible = "syscon-reboot-mode";
                        offset = <0x0>;
 
-                       mode-normal     = <0x77665501>;
-                       mode-bootloader = <0x77665500>;
-                       mode-recovery   = <0x77665502>;
+                       mode-normal = <0x77665501>;
+                       mode-bootloader = <0x77665500>;
+                       mode-recovery = <0x77665502>;
                };
        };
 
index 40f3e00..c4eaebb 100644 (file)
                stdout-path = "serial0:115200n8";
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               pwrbutton {
+               pwr-button {
                        label = "Power Button";
                        gpios = <&porta 8 GPIO_ACTIVE_LOW>;
                        linux,code = <116>;
index 70d7732..2f8b03b 100644 (file)
 
                        port@1 {
                                reg = <1>;
-                               serdes-syscon= <&serdes_ctrl>;
+                               serdes-syscon = <&serdes_ctrl>;
                                port-rst-offset = <1>;
                                port-mode-offset = <1>;
                                media-type = "fiber";
                        port@4 {
                                reg = <4>;
                                phy-handle = <&phy0>;
-                               serdes-syscon= <&serdes_ctrl>;
+                               serdes-syscon = <&serdes_ctrl>;
                                port-rst-offset = <4>;
                                port-mode-offset = <2>;
                                media-type = "copper";
                        port@5 {
                                reg = <5>;
                                phy-handle = <&phy1>;
-                               serdes-syscon= <&serdes_ctrl>;
+                               serdes-syscon = <&serdes_ctrl>;
                                port-rst-offset = <5>;
                                port-mode-offset = <3>;
                                media-type = "copper";
index 6baf6a6..1a16662 100644 (file)
 
                        port@1 {
                                reg = <1>;
-                               serdes-syscon= <&serdes_ctrl>;
+                               serdes-syscon = <&serdes_ctrl>;
                                cpld-syscon = <&dsa_cpld 0x4>;
                                port-rst-offset = <1>;
                                port-mode-offset = <1>;
                        port@4 {
                                reg = <4>;
                                phy-handle = <&phy0>;
-                               serdes-syscon= <&serdes_ctrl>;
+                               serdes-syscon = <&serdes_ctrl>;
                                port-rst-offset = <4>;
                                port-mode-offset = <2>;
                                mc-mac-mask = [ff f0 00 00 00 00];
                        port@5 {
                                reg = <5>;
                                phy-handle = <&phy1>;
-                               serdes-syscon= <&serdes_ctrl>;
+                               serdes-syscon = <&serdes_ctrl>;
                                port-rst-offset = <5>;
                                port-mode-offset = <3>;
                                mc-mac-mask = [ff f0 00 00 00 00];
index caccb03..7bbec8a 100644 (file)
                        sdramedac {
                                compatible = "altr,sdram-edac-s10";
                                altr,sdr-syscon = <&sdr>;
-                               interrupts = <16 4>;
+                               interrupts = <16 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        ocram-ecc@ff8cc000 {
                                             "altr,socfpga-a10-ocram-ecc";
                                reg = <0xff8cc000 0x100>;
                                altr,ecc-parent = <&ocram>;
-                               interrupts = <1 4>;
+                               interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        usb0-ecc@ff8c4000 {
                                             "altr,socfpga-usb-ecc";
                                reg = <0xff8c4000 0x100>;
                                altr,ecc-parent = <&usb0>;
-                               interrupts = <2 4>;
+                               interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        emac0-rx-ecc@ff8c0000 {
                                             "altr,socfpga-eth-mac-ecc";
                                reg = <0xff8c0000 0x100>;
                                altr,ecc-parent = <&gmac0>;
-                               interrupts = <4 4>;
+                               interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        emac0-tx-ecc@ff8c0400 {
                                             "altr,socfpga-eth-mac-ecc";
                                reg = <0xff8c0400 0x100>;
                                altr,ecc-parent = <&gmac0>;
-                               interrupts = <5 4>;
+                               interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
                        };
 
                        sdmmca-ecc@ff8c8c00 {
                                             "altr,socfpga-sdmmc-ecc";
                                reg = <0xff8c8c00 0x100>;
                                altr,ecc-parent = <&mmc>;
-                               interrupts = <14 4>,
-                                            <15 4>;
+                               interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
+                                            <15 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
 
index bec9748..78ae73d 100644 (file)
@@ -52,7 +52,7 @@
        };
 
        psci {
-               compatible  = "arm,psci-0.2", "arm,psci";
+               compatible = "arm,psci-0.2", "arm,psci";
                method = "smc";
                cpu_suspend = <0x84000001>;
                cpu_off = <0x84000002>;
                        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                uart1: serial@fe100000 {
                        compatible = "arm,pl011", "arm,primecell";
                        interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                uart2: serial@fe200000 {
                        compatible = "arm,pl011", "arm,primecell";
                        interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                spi0: spi@fe800000 {
                        compatible = "arm,pl022", "arm,primecell";
                        reg = <0x0 0xfd400000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio1: gpio@fd410000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd410000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio2: gpio@fd420000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd420000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio3: gpio@fd430000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd440000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio5: gpio@fd450000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd450000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio6: gpio@fd460000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd460000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio7: gpio@fd470000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd470000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio8: gpio@fd480000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd480000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio9: gpio@fd490000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd490000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio10: gpio@fd4a0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4a0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio11: gpio@fd4b0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4c0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio13: gpio@fd4d0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4d0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio14: gpio@fd4e0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4e0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio15: gpio@fd4f0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4f0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio16: gpio@fd500000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd500000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio17: gpio@fd510000 {
                        #gpio-cells = <2>;
index ada3d4d..2173316 100644 (file)
@@ -52,7 +52,7 @@
        };
 
        psci {
-               compatible  = "arm,psci-0.2", "arm,psci";
+               compatible = "arm,psci-0.2", "arm,psci";
                method = "smc";
                cpu_suspend = <0x84000001>;
                cpu_off = <0x84000002>;
                        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                uart1: serial@fe100000 {
                        compatible = "arm,pl011", "arm,primecell";
                        interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                uart2: serial@fe200000 {
                        compatible = "arm,pl011", "arm,primecell";
                        interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                spi0: spi@fe800000 {
                        compatible = "arm,pl022", "arm,primecell";
                        reg = <0x0 0xfd400000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio1: gpio@fd410000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd410000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio2: gpio@fd420000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd420000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio3: gpio@fd430000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd440000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio5: gpio@fd450000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd450000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio6: gpio@fd460000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd460000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio7: gpio@fd470000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd470000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio8: gpio@fd480000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd480000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio9: gpio@fd490000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd490000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio10: gpio@fd4a0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4a0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio11: gpio@fd4b0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4c0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio13: gpio@fd4d0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4d0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio14: gpio@fd4e0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4e0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio15: gpio@fd4f0000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd4f0000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio16: gpio@fd500000 {
                        #gpio-cells = <2>;
                        reg = <0x0 0xfd500000 0x1000>;
                        clocks = <&clk_bus>;
                        clock-names = "apb_pclk";
-                       status="disabled";
+                       status = "disabled";
                };
                gpio17: gpio@fd510000 {
                        #gpio-cells = <2>;
index 1c794cd..b6d493e 100644 (file)
@@ -24,3 +24,4 @@ dtb-$(CONFIG_ARCH_MVEBU) += cn9132-db.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += cn9132-db-B.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += cn9130-crb-A.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += cn9130-crb-B.dtb
+dtb-$(CONFIG_ARCH_MVEBU) += ac5-98dx35xx-rd.dtb
diff --git a/arch/arm64/boot/dts/marvell/ac5-98dx25xx.dtsi b/arch/arm64/boot/dts/marvell/ac5-98dx25xx.dtsi
new file mode 100644 (file)
index 0000000..80b44c7
--- /dev/null
@@ -0,0 +1,291 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree For AC5.
+ *
+ * Copyright (C) 2021 Marvell
+ * Copyright (C) 2022 Allied Telesis Labs
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       model = "Marvell AC5 SoC";
+       compatible = "marvell,ac5";
+       interrupt-parent = <&gic>;
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&cpu0>;
+                               };
+                               core1 {
+                                       cpu = <&cpu1>;
+                               };
+                       };
+               };
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x0 0x0>;
+                       enable-method = "psci";
+                       next-level-cache = <&l2>;
+               };
+
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a55";
+                       reg = <0x0 0x100>;
+                       enable-method = "psci";
+                       next-level-cache = <&l2>;
+               };
+
+               l2: l2-cache {
+                       compatible = "cache";
+               };
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_PPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_PPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_PPI 7 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <GIC_PPI 12 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+               dma-ranges;
+
+               internal-regs@7f000000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "simple-bus";
+                       /* 16M internal register @ 0x7f00_0000 */
+                       ranges = <0x0 0x0 0x7f000000 0x1000000>;
+                       dma-coherent;
+
+                       uart0: serial@12000 {
+                               compatible = "snps,dw-apb-uart";
+                               reg = <0x12000 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-io-width = <1>;
+                               clocks = <&cnm_clock>;
+                               status = "okay";
+                       };
+
+                       mdio: mdio@22004 {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "marvell,orion-mdio";
+                               reg = <0x22004 0x4>;
+                               clocks = <&cnm_clock>;
+                       };
+
+                       i2c0: i2c@11000{
+                               compatible = "marvell,mv78230-i2c";
+                               reg = <0x11000 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               clocks = <&cnm_clock>;
+                               clock-names = "core";
+                               interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>;
+                               clock-frequency=<100000>;
+
+                               pinctrl-names = "default", "gpio";
+                               pinctrl-0 = <&i2c0_pins>;
+                               pinctrl-1 = <&i2c0_gpio>;
+                               scl_gpio = <&gpio0 26 GPIO_ACTIVE_HIGH>;
+                               sda_gpio = <&gpio0 27 GPIO_ACTIVE_HIGH>;
+                               status = "disabled";
+                       };
+
+                       i2c1: i2c@11100{
+                               compatible = "marvell,mv78230-i2c";
+                               reg = <0x11100 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               clocks = <&cnm_clock>;
+                               clock-names = "core";
+                               interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
+                               clock-frequency=<100000>;
+
+                               pinctrl-names = "default", "gpio";
+                               pinctrl-0 = <&i2c1_pins>;
+                               pinctrl-1 = <&i2c1_gpio>;
+                               scl_gpio = <&gpio0 20 GPIO_ACTIVE_HIGH>;
+                               sda_gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>;
+                               status = "disabled";
+                       };
+
+                       gpio0: gpio@18100 {
+                               compatible = "marvell,orion-gpio";
+                               reg = <0x18100 0x40>;
+                               ngpios = <32>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               gpio-ranges = <&pinctrl0 0 0 32>;
+                               marvell,pwm-offset = <0x1f0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       gpio1: gpio@18140 {
+                               reg = <0x18140 0x40>;
+                               compatible = "marvell,orion-gpio";
+                               ngpios = <14>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               gpio-ranges = <&pinctrl0 0 32 14>;
+                               marvell,pwm-offset = <0x1f0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+               };
+
+               /*
+                * Dedicated section for devices behind 32bit controllers so we
+                * can configure specific DMA mapping for them
+                */
+               behind-32bit-controller@7f000000 {
+                       compatible = "simple-bus";
+                       #address-cells = <0x2>;
+                       #size-cells = <0x2>;
+                       ranges = <0x0 0x0 0x0 0x7f000000 0x0 0x1000000>;
+                       /* Host phy ram starts at 0x200M */
+                       dma-ranges = <0x0 0x0 0x2 0x0 0x1 0x0>;
+                       dma-coherent;
+
+                       eth0: ethernet@20000 {
+                               compatible = "marvell,armada-ac5-neta";
+                               reg = <0x0 0x20000 0x0 0x4000>;
+                               interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&cnm_clock>;
+                               phy-mode = "sgmii";
+                               status = "disabled";
+                       };
+
+                       eth1: ethernet@24000 {
+                               compatible = "marvell,armada-ac5-neta";
+                               reg = <0x0 0x24000 0x0 0x4000>;
+                               interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&cnm_clock>;
+                               phy-mode = "sgmii";
+                               status = "disabled";
+                       };
+
+                       usb0: usb@80000 {
+                               compatible = "marvell,orion-ehci";
+                               reg = <0x0 0x80000 0x0 0x500>;
+                               interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
+                               status = "disabled";
+                       };
+
+                       usb1: usb@a0000 {
+                               compatible = "marvell,orion-ehci";
+                               reg = <0x0 0xa0000 0x0 0x500>;
+                               interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+                               status = "disabled";
+                       };
+               };
+
+               pinctrl0: pinctrl@80020100 {
+                       compatible = "marvell,ac5-pinctrl";
+                       reg = <0 0x80020100 0 0x20>;
+
+                       i2c0_pins: i2c0-pins {
+                               marvell,pins = "mpp26", "mpp27";
+                               marvell,function = "i2c0";
+                       };
+
+                       i2c0_gpio: i2c0-gpio-pins {
+                               marvell,pins = "mpp26", "mpp27";
+                               marvell,function = "gpio";
+                       };
+
+                       i2c1_pins: i2c1-pins {
+                               marvell,pins = "mpp20", "mpp21";
+                               marvell,function = "i2c1";
+                       };
+
+                       i2c1_gpio: i2c1-gpio-pins {
+                               marvell,pins = "mpp20", "mpp21";
+                               marvell,function = "i2c1";
+                       };
+               };
+
+               spi0: spi@805a0000 {
+                       compatible = "marvell,armada-3700-spi";
+                       reg = <0x0 0x805a0000 0x0 0x50>;
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       clocks = <&spi_clock>;
+                       interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+                       num-cs = <1>;
+                       status = "disabled";
+               };
+
+               spi1: spi@805a8000 {
+                       compatible = "marvell,armada-3700-spi";
+                       reg = <0x0 0x805a8000 0x0 0x50>;
+                       #address-cells = <0x1>;
+                       #size-cells = <0x0>;
+                       clocks = <&spi_clock>;
+                       interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+                       num-cs = <1>;
+                       status = "disabled";
+               };
+
+               gic: interrupt-controller@80600000 {
+                       compatible = "arm,gic-v3";
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       reg = <0x0 0x80600000 0x0 0x10000>, /* GICD */
+                             <0x0 0x80660000 0x0 0x40000>; /* GICR */
+                       interrupts = <GIC_PPI 6 IRQ_TYPE_LEVEL_HIGH>;
+               };
+       };
+
+       clocks {
+               cnm_clock: cnm-clock {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <328000000>;
+               };
+
+               spi_clock: spi-clock {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <200000000>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/marvell/ac5-98dx35xx-rd.dts b/arch/arm64/boot/dts/marvell/ac5-98dx35xx-rd.dts
new file mode 100644 (file)
index 0000000..f0ebdb8
--- /dev/null
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree For RD-AC5X.
+ *
+ * Copyright (C) 2021 Marvell
+ * Copyright (C) 2022 Allied Telesis Labs
+ */
+/*
+ * Device Tree file for Marvell Alleycat 5X development board
+ * This board file supports the B configuration of the board
+ */
+
+/dts-v1/;
+
+#include "ac5-98dx35xx.dtsi"
+
+/ {
+       model = "Marvell RD-AC5X Board";
+       compatible = "marvell,rd-ac5x", "marvell,ac5x", "marvell,ac5";
+
+       aliases {
+               serial0 = &uart0;
+               spiflash0 = &spiflash0;
+               gpio0 = &gpio0;
+               gpio1 = &gpio1;
+               ethernet0 = &eth0;
+               ethernet1 = &eth1;
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x2 0x00000000 0x0 0x40000000>;
+       };
+
+       usb1phy: usb-phy {
+               compatible = "usb-nop-xceiv";
+               #phy-cells = <0>;
+       };
+};
+
+&mdio {
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&eth0 {
+       status = "okay";
+       phy-handle = <&phy0>;
+};
+
+/* USB0 is a host USB */
+&usb0 {
+       status = "okay";
+};
+
+/* USB1 is a peripheral USB */
+&usb1 {
+       status = "okay";
+       phys = <&usb1phy>;
+       phy-names = "usb-phy";
+       dr_mode = "peripheral";
+};
+
+&spi0 {
+       status = "okay";
+
+       spiflash0: flash@0 {
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <50000000>;
+               spi-tx-bus-width = <1>; /* 1-single, 2-dual, 4-quad */
+               spi-rx-bus-width = <1>; /* 1-single, 2-dual, 4-quad */
+               reg = <0>;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "spi_flash_part0";
+                       reg = <0x0 0x800000>;
+               };
+
+               parition@1 {
+                       label = "spi_flash_part1";
+                       reg = <0x800000 0x700000>;
+               };
+
+               parition@2 {
+                       label = "spi_flash_part2";
+                       reg = <0xF00000 0x100000>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/marvell/ac5-98dx35xx.dtsi b/arch/arm64/boot/dts/marvell/ac5-98dx35xx.dtsi
new file mode 100644 (file)
index 0000000..2ab72f8
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree For AC5X.
+ *
+ * Copyright (C) 2022 Allied Telesis Labs
+ */
+
+#include "ac5-98dx25xx.dtsi"
+
+/ {
+       model = "Marvell AC5X SoC";
+       compatible = "marvell,ac5x", "marvell,ac5";
+};
+
+&cnm_clock {
+       clock-frequency = <325000000>;
+};
index caf9c85..de8d0cf 100644 (file)
@@ -35,7 +35,7 @@
 
        leds {
                compatible = "gpio-leds";
-               red {
+               led {
                        label = "mox:red:activity";
                        gpios = <&gpiosb 21 GPIO_ACTIVE_LOW>;
                        linux,default-trigger = "default-on";
@@ -45,7 +45,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               reset {
+               key-reset {
                        label = "reset";
                        linux,code = <KEY_RESTART>;
                        gpios = <&gpiosb 20 GPIO_ACTIVE_LOW>;
index 39a8e5e..b9ba7c4 100644 (file)
@@ -37,7 +37,7 @@
                los-gpio = <&sfp_gpio 3 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&sfp_gpio 2 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&sfp_gpio 1 GPIO_ACTIVE_HIGH>;
-               tx-fault-gpio  = <&sfp_gpio 0 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpio = <&sfp_gpio 0 GPIO_ACTIVE_HIGH>;
        };
 
        /* SFP 1G */
@@ -47,7 +47,7 @@
                los-gpio = <&sfp_gpio 7 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&sfp_gpio 6 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&sfp_gpio 5 GPIO_ACTIVE_HIGH>;
-               tx-fault-gpio  = <&sfp_gpio 4 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpio = <&sfp_gpio 4 GPIO_ACTIVE_HIGH>;
        };
 };
 
index 871f84b..15f6ca4 100644 (file)
@@ -94,7 +94,7 @@
                pinctrl-0 = <&cp0_gpio_reset_pins &cp1_wps_button_pins>;
                pinctrl-names = "default";
 
-               button_0 {
+               button-0 {
                        /* The rear button */
                        label = "Rear Button";
                        gpios = <&cp0_gpio2 7 GPIO_ACTIVE_LOW>;
                        linux,code = <BTN_0>;
                };
 
-               button_1 {
+               button-1 {
                        /* The wps button */
                        label = "WPS Button";
                        gpios = <&cp1_gpio1 30 GPIO_ACTIVE_LOW>;
index 779cf16..c0389dd 100644 (file)
@@ -68,7 +68,7 @@
                los-gpio = <&cp1_gpio1 28 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&cp1_gpio1 27 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&cp1_gpio1 29 GPIO_ACTIVE_HIGH>;
-               tx-fault-gpio  = <&cp1_gpio1 26 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpio = <&cp1_gpio1 26 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
                pinctrl-0 = <&cp1_sfpp0_pins>;
                maximum-power-milliwatt = <2000>;
index 74bed79..cf868e0 100644 (file)
@@ -70,7 +70,7 @@
                los-gpio = <&sfpplus_gpio 11 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&sfpplus_gpio 10 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&sfpplus_gpio 9 GPIO_ACTIVE_HIGH>;
-               tx-fault-gpio  = <&sfpplus_gpio 8 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpio = <&sfpplus_gpio 8 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <3000>;
        };
 
@@ -80,7 +80,7 @@
                los-gpio = <&sfpplus_gpio 3 GPIO_ACTIVE_HIGH>;
                mod-def0-gpio = <&sfpplus_gpio 2 GPIO_ACTIVE_LOW>;
                tx-disable-gpio = <&sfpplus_gpio 1 GPIO_ACTIVE_HIGH>;
-               tx-fault-gpio  = <&sfpplus_gpio 0 GPIO_ACTIVE_HIGH>;
+               tx-fault-gpio = <&sfpplus_gpio 0 GPIO_ACTIVE_HIGH>;
                maximum-power-milliwatt = <3000>;
        };
 
index 7e20987..f58402e 100644 (file)
 &cp0_usb3_1 {
        status = "okay";
        usb-phy = <&cp0_usb3_0_phy1>;
-       phys =  <&cp0_utmi1>;
+       phys = <&cp0_utmi1>;
        phy-names = "utmi";
        dr_mode = "host";
 };
index c7d4636..af362a0 100644 (file)
@@ -37,7 +37,12 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-kodama-sku32.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku0.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-kukui-krane-sku176.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8183-pumpkin.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-hayato-r1.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-asurada-spherion-r0.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8192-evb.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r1.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r2.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-cherry-tomato-r3.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-demo.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8195-evb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb
index 11aa135..9b1af9c 100644 (file)
 };
 
 &eth {
-       phy-mode ="rgmii-rxid";
+       phy-mode = "rgmii-rxid";
        phy-handle = <&ethernet_phy0>;
        mediatek,tx-delay-ps = <1530>;
        snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>;
index 623eb3b..4797537 100644 (file)
                interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_LOW>;
                clocks = <&infracfg CLK_INFRA_M4U>;
                clock-names = "bclk";
+               mediatek,infracfg = <&infracfg>;
                mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
                                 <&larb3>, <&larb6>;
                #iommu-cells = <1>;
                interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_LOW>;
                clocks = <&infracfg CLK_INFRA_M4U>;
                clock-names = "bclk";
+               mediatek,infracfg = <&infracfg>;
                mediatek,larbs = <&larb4>, <&larb5>, <&larb7>;
                #iommu-cells = <1>;
        };
index c85659d..d3bce94 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/pinctrl/mt6795-pinfunc.h>
 
 / {
        compatible = "mediatek,mt6795";
@@ -34,6 +35,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x000>;
+                       cci-control-port = <&cci_control2>;
+                       next-level-cache = <&l2_0>;
                };
 
                cpu1: cpu@1 {
@@ -41,6 +44,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x001>;
+                       cci-control-port = <&cci_control2>;
+                       next-level-cache = <&l2_0>;
                };
 
                cpu2: cpu@2 {
@@ -48,6 +53,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x002>;
+                       cci-control-port = <&cci_control2>;
+                       next-level-cache = <&l2_0>;
                };
 
                cpu3: cpu@3 {
@@ -55,6 +62,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x003>;
+                       cci-control-port = <&cci_control2>;
+                       next-level-cache = <&l2_0>;
                };
 
                cpu4: cpu@100 {
@@ -62,6 +71,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x100>;
+                       cci-control-port = <&cci_control1>;
+                       next-level-cache = <&l2_1>;
                };
 
                cpu5: cpu@101 {
@@ -69,6 +80,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x101>;
+                       cci-control-port = <&cci_control1>;
+                       next-level-cache = <&l2_1>;
                };
 
                cpu6: cpu@102 {
@@ -76,6 +89,8 @@
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x102>;
+                       cci-control-port = <&cci_control1>;
+                       next-level-cache = <&l2_1>;
                };
 
                cpu7: cpu@103 {
                        compatible = "arm,cortex-a53";
                        enable-method = "psci";
                        reg = <0x103>;
+                       cci-control-port = <&cci_control1>;
+                       next-level-cache = <&l2_1>;
+               };
+
+               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-cache0 {
+                       compatible = "cache";
+                       cache-level = <2>;
+               };
+
+               l2_1: l2-cache1 {
+                       compatible = "cache";
+                       cache-level = <2>;
                };
        };
 
-       system_clk: dummy13m {
+       clk26m: oscillator-26m {
                compatible = "fixed-clock";
-               clock-frequency = <13000000>;
                #clock-cells = <0>;
+               clock-frequency = <26000000>;
+               clock-output-names = "clk26m";
        };
 
-       rtc_clk: dummy32k {
+       clk32k: oscillator-32k {
                compatible = "fixed-clock";
-               clock-frequency = <32000>;
                #clock-cells = <0>;
+               clock-frequency = <32000>;
+               clock-output-names = "clk32k";
        };
 
-       uart_clk: dummy26m {
+       system_clk: dummy13m {
                compatible = "fixed-clock";
-               clock-frequency = <26000000>;
+               clock-frequency = <13000000>;
                #clock-cells = <0>;
        };
 
+       pmu {
+               compatible = "arm,cortex-a53-pmu";
+               interrupts = <GIC_SPI  8 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_SPI  9 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_SPI 10 IRQ_TYPE_LEVEL_LOW>,
+                            <GIC_SPI 11 IRQ_TYPE_LEVEL_LOW>;
+               interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupt-parent = <&gic>;
                             (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
-       sysirq: intpol-controller@10200620 {
-               compatible = "mediatek,mt6795-sysirq",
-                            "mediatek,mt6577-sysirq";
-               interrupt-controller;
-               #interrupt-cells = <3>;
-               interrupt-parent = <&gic>;
-               reg = <0 0x10200620 0 0x20>;
-       };
+       soc {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               compatible = "simple-bus";
+               ranges;
 
-       gic: interrupt-controller@10221000 {
-               compatible = "arm,gic-400";
-               #interrupt-cells = <3>;
-               interrupt-parent = <&gic>;
-               interrupt-controller;
-               reg = <0 0x10221000 0 0x1000>,
-                     <0 0x10222000 0 0x2000>,
-                     <0 0x10224000 0 0x2000>,
-                     <0 0x10226000 0 0x2000>;
-       };
+               pio: pinctrl@10005000 {
+                       compatible = "mediatek,mt6795-pinctrl";
+                       reg = <0 0x10005000 0 0x1000>, <0 0x1000b000 0 0x1000>;
+                       reg-names = "base", "eint";
+                       interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&pio 0 0 196>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
 
-       uart0: serial@11002000 {
-               compatible = "mediatek,mt6795-uart",
-                            "mediatek,mt6577-uart";
-               reg = <0 0x11002000 0 0x400>;
-               interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
-               clocks = <&uart_clk>;
-               status = "disabled";
-       };
+               watchdog: watchdog@10007000 {
+                       compatible = "mediatek,mt6795-wdt";
+                       reg = <0 0x10007000 0 0x100>;
+                       interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_LOW>;
+                       #reset-cells = <1>;
+                       timeout-sec = <20>;
+               };
 
-       uart1: serial@11003000 {
-               compatible = "mediatek,mt6795-uart",
-                            "mediatek,mt6577-uart";
-               reg = <0 0x11003000 0 0x400>;
-               interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
-               clocks = <&uart_clk>;
-               status = "disabled";
-       };
+               timer: timer@10008000 {
+                       compatible = "mediatek,mt6795-timer",
+                                    "mediatek,mt6577-timer";
+                       reg = <0 0x10008000 0 0x1000>;
+                       interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&system_clk>, <&clk32k>;
+               };
 
-       uart2: serial@11004000 {
-               compatible = "mediatek,mt6795-uart",
-                            "mediatek,mt6577-uart";
-               reg = <0 0x11004000 0 0x400>;
-               interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
-               clocks = <&uart_clk>;
-               status = "disabled";
-       };
+               sysirq: intpol-controller@10200620 {
+                       compatible = "mediatek,mt6795-sysirq",
+                                    "mediatek,mt6577-sysirq";
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       interrupt-parent = <&gic>;
+                       reg = <0 0x10200620 0 0x20>;
+               };
+
+               gic: interrupt-controller@10221000 {
+                       compatible = "arm,gic-400";
+                       #interrupt-cells = <3>;
+                       interrupt-parent = <&gic>;
+                       interrupt-controller;
+                       reg = <0 0x10221000 0 0x1000>,
+                             <0 0x10222000 0 0x2000>,
+                             <0 0x10224000 0 0x2000>,
+                             <0 0x10226000 0 0x2000>;
+                       interrupts = <GIC_PPI 9
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               cci: cci@10390000 {
+                       compatible = "arm,cci-400";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       reg = <0 0x10390000 0 0x1000>;
+                       ranges = <0 0 0x10390000 0x10000>;
 
-       uart3: serial@11005000 {
-               compatible = "mediatek,mt6795-uart",
-                            "mediatek,mt6577-uart";
-               reg = <0 0x11005000 0 0x400>;
-               interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_LOW>;
-               clocks = <&uart_clk>;
-               status = "disabled";
+                       cci_control0: slave-if@1000 {
+                               compatible = "arm,cci-400-ctrl-if";
+                               interface-type = "ace-lite";
+                               reg = <0x1000 0x1000>;
+                       };
+
+                       cci_control1: slave-if@4000 {
+                               compatible = "arm,cci-400-ctrl-if";
+                               interface-type = "ace";
+                               reg = <0x4000 0x1000>;
+                       };
+
+                       cci_control2: slave-if@5000 {
+                               compatible = "arm,cci-400-ctrl-if";
+                               interface-type = "ace";
+                               reg = <0x5000 0x1000>;
+                       };
+
+                       pmu@9000 {
+                               compatible = "arm,cci-400-pmu,r1";
+                               reg = <0x9000 0x5000>;
+                               interrupts = <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 62 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+               };
+
+               uart0: serial@11002000 {
+                       compatible = "mediatek,mt6795-uart",
+                                    "mediatek,mt6577-uart";
+                       reg = <0 0x11002000 0 0x400>;
+                       interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&clk26m>;
+                       status = "disabled";
+               };
+
+               uart1: serial@11003000 {
+                       compatible = "mediatek,mt6795-uart",
+                                    "mediatek,mt6577-uart";
+                       reg = <0 0x11003000 0 0x400>;
+                       interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&clk26m>;
+                       status = "disabled";
+               };
+
+               uart2: serial@11004000 {
+                       compatible = "mediatek,mt6795-uart",
+                                    "mediatek,mt6577-uart";
+                       reg = <0 0x11004000 0 0x400>;
+                       interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&clk26m>;
+                       status = "disabled";
+               };
+
+               uart3: serial@11005000 {
+                       compatible = "mediatek,mt6795-uart",
+                                    "mediatek,mt6577-uart";
+                       reg = <0 0x11005000 0 0x400>;
+                       interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&clk26m>;
+                       status = "disabled";
+               };
        };
 };
index 2b9bf8d..d3f9eab 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 
 #include "mt7622.dtsi"
 #include "mt6380.dtsi"
        gpio-keys {
                compatible = "gpio-keys";
 
-               factory {
+               factory-key {
                        label = "factory";
                        linux,code = <BTN_0>;
                        gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
                };
 
-               wps {
+               wps-key {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
-                       gpios = <&pio 102 GPIO_ACTIVE_HIGH>;
+                       gpios = <&pio 102 GPIO_ACTIVE_LOW>;
                };
        };
 
        leds {
                compatible = "gpio-leds";
 
-               green {
+               led-0 {
                        label = "bpi-r64:pio:green";
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
 
-               red {
+               led-1 {
                        label = "bpi-r64:pio:red";
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
                        default-state = "off";
                };
        i2c1_pins: i2c1-pins {
                mux {
                        function = "i2c";
-                       groups =  "i2c1_0";
+                       groups = "i2c1_0";
                };
        };
 
        i2c2_pins: i2c2-pins {
                mux {
                        function = "i2c";
-                       groups =  "i2c2_0";
+                       groups = "i2c2_0";
                };
        };
 
        irrx_pins: irrx-pins {
                mux {
                        function = "ir";
-                       groups =  "ir_1_rx";
+                       groups = "ir_1_rx";
                };
        };
 
        irtx_pins: irtx-pins {
                mux {
                        function = "ir";
-                       groups =  "ir_1_tx";
+                       groups = "ir_1_tx";
                };
        };
 
index 596c073..36722ca 100644 (file)
 
        gpio-keys {
                compatible = "gpio-keys";
-               poll-interval = <100>;
 
-               factory {
+               key-factory {
                        label = "factory";
                        linux,code = <BTN_0>;
                        gpios = <&pio 0 0>;
                };
 
-               wps {
+               key-wps {
                        label = "wps";
                        linux,code = <KEY_WPS_BUTTON>;
                        gpios = <&pio 102 0>;
        i2c1_pins: i2c1-pins {
                mux {
                        function = "i2c";
-                       groups =  "i2c1_0";
+                       groups = "i2c1_0";
                };
        };
 
        i2c2_pins: i2c2-pins {
                mux {
                        function = "i2c";
-                       groups =  "i2c2_0";
+                       groups = "i2c2_0";
                };
        };
 
        irrx_pins: irrx-pins {
                mux {
                        function = "ir";
-                       groups =  "ir_1_rx";
+                       groups = "ir_1_rx";
                };
        };
 
        irtx_pins: irtx-pins {
                mux {
                        function = "ir";
-                       groups =  "ir_1_tx";
+                       groups = "ir_1_tx";
                };
        };
 
index dbcee8b..146e18b 100644 (file)
        };
 
        psci {
-               compatible  = "arm,psci-0.2";
-               method      = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 
        pmu {
 
                afe: audio-controller {
                        compatible = "mediatek,mt7622-audio";
-                       interrupts =  <GIC_SPI 144 IRQ_TYPE_LEVEL_LOW>,
-                                     <GIC_SPI 145 IRQ_TYPE_LEVEL_LOW>;
-                       interrupt-names = "afe", "asys";
+                       interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_LOW>,
+                                    <GIC_SPI 145 IRQ_TYPE_LEVEL_LOW>;
+                       interrupt-names = "afe", "asys";
 
                        clocks = <&infracfg CLK_INFRA_AUDIO_PD>,
                                 <&topckgen CLK_TOP_AUD1_SEL>,
index d2636a0..e3a407d 100644 (file)
@@ -57,8 +57,8 @@
        };
 
        psci {
-               compatible  = "arm,psci-0.2";
-               method      = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 
        reserved-memory {
index 44f6149..28433b9 100644 (file)
@@ -21,7 +21,7 @@
 };
 
 &gpio_keys {
-       /delete-node/tablet_mode;
-       /delete-node/volume_down;
-       /delete-node/volume_up;
+       /delete-node/switch-tablet-mode;
+       /delete-node/switch-volume-down;
+       /delete-node/switch-volume-up;
 };
index 9c75fbb..e21feb8 100644 (file)
@@ -53,7 +53,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pins>;
 
-               lid {
+               switch-lid {
                        label = "Lid";
                        gpios = <&pio 69 GPIO_ACTIVE_LOW>;
                        linux,code = <SW_LID>;
@@ -61,7 +61,7 @@
                        gpio-key,wakeup;
                };
 
-               power {
+               switch-power {
                        label = "Power";
                        gpios = <&pio 14 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_POWER>;
@@ -69,7 +69,7 @@
                        gpio-key,wakeup;
                };
 
-               tablet_mode {
+               switch-tablet-mode {
                        label = "Tablet_mode";
                        gpios = <&pio 121 GPIO_ACTIVE_HIGH>;
                        linux,code = <SW_TABLET_MODE>;
                        gpio-key,wakeup;
                };
 
-               volume_down {
+               switch-volume-down {
                        label = "Volume_down";
                        gpios = <&pio 123 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               volume_up {
+               switch-volume-up {
                        label = "Volume_up";
                        gpios = <&pio 124 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                                regulator-name = "VBUCKA";
                                regulator-min-microvolt = < 700000>;
                                regulator-max-microvolt = <1310000>;
-                               regulator-min-microamp  = <2000000>;
-                               regulator-max-microamp  = <4400000>;
+                               regulator-min-microamp = <2000000>;
+                               regulator-max-microamp = <4400000>;
                                regulator-ramp-delay = <10000>;
                                regulator-always-on;
                                regulator-allowed-modes = <DA9211_BUCK_MODE_SYNC
                                regulator-name = "VBUCKB";
                                regulator-min-microvolt = < 700000>;
                                regulator-max-microvolt = <1310000>;
-                               regulator-min-microamp  = <2000000>;
-                               regulator-max-microamp  = <3000000>;
+                               regulator-min-microamp = <2000000>;
+                               regulator-max-microamp = <3000000>;
                                regulator-ramp-delay = <10000>;
                        };
                };
        mmc-hs400-1_8v;
        cap-mmc-hw-reset;
        hs400-ds-delay = <0x14015>;
-       mediatek,hs200-cmd-int-delay=<30>;
-       mediatek,hs400-cmd-int-delay=<14>;
+       mediatek,hs200-cmd-int-delay = <30>;
+       mediatek,hs400-cmd-int-delay = <14>;
        mediatek,hs400-cmd-resp-sel-rising;
        vmmc-supply = <&mt6397_vemc_3v3_reg>;
        vqmmc-supply = <&mt6397_vio18_reg>;
        sd-uhs-sdr50;
        sd-uhs-sdr104;
        keep-power-in-suspend;
-       enable-sdio-wakeup;
+       wakeup-source;
        cap-sdio-irq;
        vmmc-supply = <&sdio_fixed_3v3>;
        vqmmc-supply = <&mt6397_vgp3_reg>;
index 4fa1e93..0b5f154 100644 (file)
                                regulator-name = "VBUCKA";
                                regulator-min-microvolt = < 700000>;
                                regulator-max-microvolt = <1310000>;
-                               regulator-min-microamp  = <2000000>;
-                               regulator-max-microamp  = <4400000>;
+                               regulator-min-microamp = <2000000>;
+                               regulator-max-microamp = <4400000>;
                                regulator-ramp-delay = <10000>;
                                regulator-always-on;
                        };
                                regulator-name = "VBUCKB";
                                regulator-min-microvolt = < 700000>;
                                regulator-max-microvolt = <1310000>;
-                               regulator-min-microamp  = <2000000>;
-                               regulator-max-microamp  = <3000000>;
+                               regulator-min-microamp = <2000000>;
+                               regulator-max-microamp = <3000000>;
                                regulator-ramp-delay = <10000>;
                        };
                };
        bus-width = <8>;
        max-frequency = <50000000>;
        cap-mmc-highspeed;
-       mediatek,hs200-cmd-int-delay=<26>;
-       mediatek,hs400-cmd-int-delay=<14>;
+       mediatek,hs200-cmd-int-delay = <26>;
+       mediatek,hs400-cmd-int-delay = <14>;
        mediatek,hs400-cmd-resp-sel-rising;
        vmmc-supply = <&mt6397_vemc_3v3_reg>;
        vqmmc-supply = <&mt6397_vio18_reg>;
index 40d7b47..f351117 100644 (file)
        psci {
                compatible = "arm,psci-1.0", "arm,psci-0.2", "arm,psci";
                method = "smc";
-               cpu_suspend   = <0x84000001>;
-               cpu_off       = <0x84000002>;
-               cpu_on        = <0x84000003>;
+               cpu_suspend = <0x84000001>;
+               cpu_off  = <0x84000002>;
+               cpu_on   = <0x84000003>;
        };
 
        clk26m: oscillator0 {
                        interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_LOW>;
                        clocks = <&infracfg CLK_INFRA_M4U>;
                        clock-names = "bclk";
+                       mediatek,infracfg = <&infracfg>;
                        mediatek,larbs = <&larb0>, <&larb1>, <&larb2>,
                                         <&larb3>, <&larb4>, <&larb5>;
                        #iommu-cells = <1>;
                nor_flash: spi@1100d000 {
                        compatible = "mediatek,mt8173-nor";
                        reg = <0 0x1100d000 0 0xe0>;
+                       assigned-clocks = <&topckgen CLK_TOP_SPI_SEL>;
+                       assigned-clock-parents = <&clk26m>;
                        clocks = <&pericfg CLK_PERI_SPI>,
-                                <&topckgen CLK_TOP_SPINFI_IFR_SEL>;
-                       clock-names = "spi", "sf";
+                                <&topckgen CLK_TOP_SPINFI_IFR_SEL>,
+                                <&pericfg CLK_PERI_NFI>;
+                       clock-names = "spi", "sf", "axi";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
 
                vcodec_enc_vp8: vcodec@19002000 {
                        compatible = "mediatek,mt8173-vcodec-enc-vp8";
-                       reg =  <0 0x19002000 0 0x1000>; /* VENC_LT_SYS */
+                       reg = <0 0x19002000 0 0x1000>; /* VENC_LT_SYS */
                        interrupts = <GIC_SPI 202 IRQ_TYPE_LEVEL_LOW>;
                        iommus = <&iommu M4U_PORT_VENC_RCPU_SET2>,
                                 <&iommu M4U_PORT_VENC_REC_FRM_SET2>,
index f3fd3cc..52dc4a5 100644 (file)
        vmmc-supply = <&mt6358_vmch_reg>;
        vqmmc-supply = <&mt6358_vmc_reg>;
        keep-power-in-suspend;
-       enable-sdio-wakeup;
+       wakeup-source;
        non-removable;
 };
 
 
 };
 
+&cci {
+       proc-supply = <&mt6358_vproc12_reg>;
+};
+
+&cpu0 {
+       proc-supply = <&mt6358_vproc12_reg>;
+};
+
+&cpu1 {
+       proc-supply = <&mt6358_vproc12_reg>;
+};
+
+&cpu2 {
+       proc-supply = <&mt6358_vproc12_reg>;
+};
+
+&cpu3 {
+       proc-supply = <&mt6358_vproc12_reg>;
+};
+
+&cpu4 {
+       proc-supply = <&mt6358_vproc11_reg>;
+};
+
+&cpu5 {
+       proc-supply = <&mt6358_vproc11_reg>;
+};
+
+&cpu6 {
+       proc-supply = <&mt6358_vproc11_reg>;
+};
+
+&cpu7 {
+       proc-supply = <&mt6358_vproc11_reg>;
+};
+
 &uart0 {
        status = "okay";
 };
index 2d7a193..3ac83be 100644 (file)
@@ -73,7 +73,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&volume_button_pins>;
 
-               volume_down {
+               button-volume-down {
                        label = "Volume Down";
                        linux,code = <KEY_VOLUMEDOWN>;
                        debounce-interval = <100>;
@@ -81,7 +81,7 @@
                        gpios = <&pio 6 GPIO_ACTIVE_LOW>;
                };
 
-               volume_up {
+               button-volume-up {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        debounce-interval = <100>;
index 28966a6..50a0dd3 100644 (file)
@@ -45,7 +45,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pen_eject>;
 
-               pen-insert {
+               switch-pen-insert {
                        label = "Pen Insert";
                        /* Insert = low, eject = high */
                        gpios = <&pio 6 GPIO_ACTIVE_LOW>;
index 8d5bf73..b4b86bb 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&wifi_pins_wakeup>;
 
-               wowlan {
+               button-wowlan {
                        label = "Wake on WiFi";
                        gpios = <&pio 113 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_WAKEUP>;
        status = "okay";
 };
 
+&cci {
+       proc-supply = <&mt6358_vproc12_reg>;
+};
+
 &cpu0 {
        proc-supply = <&mt6358_vproc12_reg>;
 };
                avee-supply = <&ppvarp_lcd>;
                pp1800-supply = <&pp1800_lcd>;
                backlight = <&backlight_lcd0>;
+               rotation = <270>;
                port {
                        panel_in: endpoint {
                                remote-endpoint = <&dsi_out>;
        sd-uhs-sdr50;
        sd-uhs-sdr104;
        keep-power-in-suspend;
-       enable-sdio-wakeup;
+       wakeup-source;
        cap-sdio-irq;
        non-removable;
        no-mmc;
        };
 };
 
+&mfg_async {
+       domain-supply = <&mt6358_vsram_gpu_reg>;
+};
+
 &mfg {
        domain-supply = <&mt6358_vgpu_reg>;
 };
index afeb5cd..530e0c9 100644 (file)
        vmmc-supply = <&mt6358_vmch_reg>;
        vqmmc-supply = <&mt6358_vmc_reg>;
        keep-power-in-suspend;
-       enable-sdio-wakeup;
+       wakeup-source;
        non-removable;
 };
 
index 01e6502..9d32871 100644 (file)
                rdma1 = &rdma1;
        };
 
+       cluster0_opp: opp-table-cluster0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+               opp0-793000000 {
+                       opp-hz = /bits/ 64 <793000000>;
+                       opp-microvolt = <650000>;
+                       required-opps = <&opp2_00>;
+               };
+               opp0-910000000 {
+                       opp-hz = /bits/ 64 <910000000>;
+                       opp-microvolt = <687500>;
+                       required-opps = <&opp2_01>;
+               };
+               opp0-1014000000 {
+                       opp-hz = /bits/ 64 <1014000000>;
+                       opp-microvolt = <718750>;
+                       required-opps = <&opp2_02>;
+               };
+               opp0-1131000000 {
+                       opp-hz = /bits/ 64 <1131000000>;
+                       opp-microvolt = <756250>;
+                       required-opps = <&opp2_03>;
+               };
+               opp0-1248000000 {
+                       opp-hz = /bits/ 64 <1248000000>;
+                       opp-microvolt = <800000>;
+                       required-opps = <&opp2_04>;
+               };
+               opp0-1326000000 {
+                       opp-hz = /bits/ 64 <1326000000>;
+                       opp-microvolt = <818750>;
+                       required-opps = <&opp2_05>;
+               };
+               opp0-1417000000 {
+                       opp-hz = /bits/ 64 <1417000000>;
+                       opp-microvolt = <850000>;
+                       required-opps = <&opp2_06>;
+               };
+               opp0-1508000000 {
+                       opp-hz = /bits/ 64 <1508000000>;
+                       opp-microvolt = <868750>;
+                       required-opps = <&opp2_07>;
+               };
+               opp0-1586000000 {
+                       opp-hz = /bits/ 64 <1586000000>;
+                       opp-microvolt = <893750>;
+                       required-opps = <&opp2_08>;
+               };
+               opp0-1625000000 {
+                       opp-hz = /bits/ 64 <1625000000>;
+                       opp-microvolt = <906250>;
+                       required-opps = <&opp2_09>;
+               };
+               opp0-1677000000 {
+                       opp-hz = /bits/ 64 <1677000000>;
+                       opp-microvolt = <931250>;
+                       required-opps = <&opp2_10>;
+               };
+               opp0-1716000000 {
+                       opp-hz = /bits/ 64 <1716000000>;
+                       opp-microvolt = <943750>;
+                       required-opps = <&opp2_11>;
+               };
+               opp0-1781000000 {
+                       opp-hz = /bits/ 64 <1781000000>;
+                       opp-microvolt = <975000>;
+                       required-opps = <&opp2_12>;
+               };
+               opp0-1846000000 {
+                       opp-hz = /bits/ 64 <1846000000>;
+                       opp-microvolt = <1000000>;
+                       required-opps = <&opp2_13>;
+               };
+               opp0-1924000000 {
+                       opp-hz = /bits/ 64 <1924000000>;
+                       opp-microvolt = <1025000>;
+                       required-opps = <&opp2_14>;
+               };
+               opp0-1989000000 {
+                       opp-hz = /bits/ 64 <1989000000>;
+                       opp-microvolt = <1050000>;
+                       required-opps = <&opp2_15>;
+               };      };
+
+       cluster1_opp: opp-table-cluster1 {
+               compatible = "operating-points-v2";
+               opp-shared;
+               opp1-793000000 {
+                       opp-hz = /bits/ 64 <793000000>;
+                       opp-microvolt = <700000>;
+                       required-opps = <&opp2_00>;
+               };
+               opp1-910000000 {
+                       opp-hz = /bits/ 64 <910000000>;
+                       opp-microvolt = <725000>;
+                       required-opps = <&opp2_01>;
+               };
+               opp1-1014000000 {
+                       opp-hz = /bits/ 64 <1014000000>;
+                       opp-microvolt = <750000>;
+                       required-opps = <&opp2_02>;
+               };
+               opp1-1131000000 {
+                       opp-hz = /bits/ 64 <1131000000>;
+                       opp-microvolt = <775000>;
+                       required-opps = <&opp2_03>;
+               };
+               opp1-1248000000 {
+                       opp-hz = /bits/ 64 <1248000000>;
+                       opp-microvolt = <800000>;
+                       required-opps = <&opp2_04>;
+               };
+               opp1-1326000000 {
+                       opp-hz = /bits/ 64 <1326000000>;
+                       opp-microvolt = <825000>;
+                       required-opps = <&opp2_05>;
+               };
+               opp1-1417000000 {
+                       opp-hz = /bits/ 64 <1417000000>;
+                       opp-microvolt = <850000>;
+                       required-opps = <&opp2_06>;
+               };
+               opp1-1508000000 {
+                       opp-hz = /bits/ 64 <1508000000>;
+                       opp-microvolt = <875000>;
+                       required-opps = <&opp2_07>;
+               };
+               opp1-1586000000 {
+                       opp-hz = /bits/ 64 <1586000000>;
+                       opp-microvolt = <900000>;
+                       required-opps = <&opp2_08>;
+               };
+               opp1-1625000000 {
+                       opp-hz = /bits/ 64 <1625000000>;
+                       opp-microvolt = <912500>;
+                       required-opps = <&opp2_09>;
+               };
+               opp1-1677000000 {
+                       opp-hz = /bits/ 64 <1677000000>;
+                       opp-microvolt = <931250>;
+                       required-opps = <&opp2_10>;
+               };
+               opp1-1716000000 {
+                       opp-hz = /bits/ 64 <1716000000>;
+                       opp-microvolt = <950000>;
+                       required-opps = <&opp2_11>;
+               };
+               opp1-1781000000 {
+                       opp-hz = /bits/ 64 <1781000000>;
+                       opp-microvolt = <975000>;
+                       required-opps = <&opp2_12>;
+               };
+               opp1-1846000000 {
+                       opp-hz = /bits/ 64 <1846000000>;
+                       opp-microvolt = <1000000>;
+                       required-opps = <&opp2_13>;
+               };
+               opp1-1924000000 {
+                       opp-hz = /bits/ 64 <1924000000>;
+                       opp-microvolt = <1025000>;
+                       required-opps = <&opp2_14>;
+               };
+               opp1-1989000000 {
+                       opp-hz = /bits/ 64 <1989000000>;
+                       opp-microvolt = <1050000>;
+                       required-opps = <&opp2_15>;
+               };
+       };
+
+       cci_opp: opp-table-cci {
+               compatible = "operating-points-v2";
+               opp-shared;
+               opp2_00: opp-273000000 {
+                       opp-hz = /bits/ 64 <273000000>;
+                       opp-microvolt = <650000>;
+               };
+               opp2_01: opp-338000000 {
+                       opp-hz = /bits/ 64 <338000000>;
+                       opp-microvolt = <687500>;
+               };
+               opp2_02: opp-403000000 {
+                       opp-hz = /bits/ 64 <403000000>;
+                       opp-microvolt = <718750>;
+               };
+               opp2_03: opp-463000000 {
+                       opp-hz = /bits/ 64 <463000000>;
+                       opp-microvolt = <756250>;
+               };
+               opp2_04: opp-546000000 {
+                       opp-hz = /bits/ 64 <546000000>;
+                       opp-microvolt = <800000>;
+               };
+               opp2_05: opp-624000000 {
+                       opp-hz = /bits/ 64 <624000000>;
+                       opp-microvolt = <818750>;
+               };
+               opp2_06: opp-689000000 {
+                       opp-hz = /bits/ 64 <689000000>;
+                       opp-microvolt = <850000>;
+               };
+               opp2_07: opp-767000000 {
+                       opp-hz = /bits/ 64 <767000000>;
+                       opp-microvolt = <868750>;
+               };
+               opp2_08: opp-845000000 {
+                       opp-hz = /bits/ 64 <845000000>;
+                       opp-microvolt = <893750>;
+               };
+               opp2_09: opp-871000000 {
+                       opp-hz = /bits/ 64 <871000000>;
+                       opp-microvolt = <906250>;
+               };
+               opp2_10: opp-923000000 {
+                       opp-hz = /bits/ 64 <923000000>;
+                       opp-microvolt = <931250>;
+               };
+               opp2_11: opp-962000000 {
+                       opp-hz = /bits/ 64 <962000000>;
+                       opp-microvolt = <943750>;
+               };
+               opp2_12: opp-1027000000 {
+                       opp-hz = /bits/ 64 <1027000000>;
+                       opp-microvolt = <975000>;
+               };
+               opp2_13: opp-1092000000 {
+                       opp-hz = /bits/ 64 <1092000000>;
+                       opp-microvolt = <1000000>;
+               };
+               opp2_14: opp-1144000000 {
+                       opp-hz = /bits/ 64 <1144000000>;
+                       opp-microvolt = <1025000>;
+               };
+               opp2_15: opp-1196000000 {
+                       opp-hz = /bits/ 64 <1196000000>;
+                       opp-microvolt = <1050000>;
+               };
+       };
+
+       cci: cci {
+               compatible = "mediatek,mt8183-cci";
+               clocks = <&mcucfg CLK_MCU_BUS_SEL>,
+                        <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+               clock-names = "cci", "intermediate";
+               operating-points-v2 = <&cci_opp>;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                        enable-method = "psci";
                        capacity-dmips-mhz = <741>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP0>;
+                       clocks = <&mcucfg CLK_MCU_MP0_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster0_opp>;
                        dynamic-power-coefficient = <84>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu1: cpu@1 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <741>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP0>;
+                       clocks = <&mcucfg CLK_MCU_MP0_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster0_opp>;
                        dynamic-power-coefficient = <84>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu2: cpu@2 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <741>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP0>;
+                       clocks = <&mcucfg CLK_MCU_MP0_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster0_opp>;
                        dynamic-power-coefficient = <84>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu3: cpu@3 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <741>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP0>;
+                       clocks = <&mcucfg CLK_MCU_MP0_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster0_opp>;
                        dynamic-power-coefficient = <84>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu4: cpu@100 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP1>;
+                       clocks = <&mcucfg CLK_MCU_MP2_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster1_opp>;
                        dynamic-power-coefficient = <211>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu5: cpu@101 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP1>;
+                       clocks = <&mcucfg CLK_MCU_MP2_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster1_opp>;
                        dynamic-power-coefficient = <211>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu6: cpu@102 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP1>;
+                       clocks = <&mcucfg CLK_MCU_MP2_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster1_opp>;
                        dynamic-power-coefficient = <211>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                cpu7: cpu@103 {
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
                        cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP1>;
+                       clocks = <&mcucfg CLK_MCU_MP2_SEL>,
+                                <&topckgen CLK_TOP_ARMPLL_DIV_PLL1>;
+                       clock-names = "cpu", "intermediate";
+                       operating-points-v2 = <&cluster1_opp>;
                        dynamic-power-coefficient = <211>;
                        #cooling-cells = <2>;
+                       mediatek,cci = <&cci>;
                };
 
                idle-states {
        };
 
        psci {
-               compatible      = "arm,psci-1.0";
-               method          = "smc";
+               compatible = "arm,psci-1.0";
+               method = "smc";
        };
 
        clk26m: oscillator {
                compatible = "simple-bus";
                ranges;
 
-               soc_data: soc_data@8000000 {
+               soc_data: efuse@8000000 {
                        compatible = "mediatek,mt8183-efuse",
                                     "mediatek,efuse";
                        reg = <0 0x08000000 0 0x0010>;
                                        #power-domain-cells = <0>;
                                };
 
-                               power-domain@MT8183_POWER_DOMAIN_MFG_ASYNC {
+                               mfg_async: power-domain@MT8183_POWER_DOMAIN_MFG_ASYNC {
                                        reg = <MT8183_POWER_DOMAIN_MFG_ASYNC>;
-                                       clocks =  <&topckgen CLK_TOP_MUX_MFG>;
+                                       clocks = <&topckgen CLK_TOP_MUX_MFG>;
                                        clock-names = "mfg";
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                        status = "disabled";
                };
 
+               svs: svs@1100b000 {
+                       compatible = "mediatek,mt8183-svs";
+                       reg = <0 0x1100b000 0 0x1000>;
+                       interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_LOW>;
+                       clocks = <&infracfg CLK_INFRA_THERM>;
+                       clock-names = "main";
+                       nvmem-cells = <&svs_calibration>,
+                                     <&thermal_calibration>;
+                       nvmem-cell-names = "svs-calibration-data",
+                                          "t-calibration-data";
+               };
+
                thermal: thermal@1100b000 {
                        #thermal-sensor-cells = <1>;
                        compatible = "mediatek,mt8183-thermal";
                };
 
                ssusb: usb@11201000 {
-                       compatible ="mediatek,mt8183-mtu3", "mediatek,mtu3";
+                       compatible = "mediatek,mt8183-mtu3", "mediatek,mtu3";
                        reg = <0 0x11201000 0 0x2e00>,
                              <0 0x11203e00 0 0x0100>;
                        reg-names = "mac", "ippc";
                        mipi_tx_calibration: calib@190 {
                                reg = <0x190 0xc>;
                        };
+
+                       svs_calibration: calib@580 {
+                               reg = <0x580 0x64>;
+                       };
                };
 
                u3phy: t-phy@11f40000 {
                        power-domains = <&spm MT8183_POWER_DOMAIN_DISP>;
                        mediatek,gce-events = <CMDQ_EVENT_MUTEX_STREAM_DONE0>,
                                              <CMDQ_EVENT_MUTEX_STREAM_DONE1>;
+                       mediatek,gce-client-reg = <&gce SUBSYS_1401XXXX 0x6000 0x1000>;
                };
 
                larb0: larb@14017000 {
diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts
new file mode 100644 (file)
index 0000000..1e91491
--- /dev/null
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright 2020 Google LLC
+ */
+/dts-v1/;
+#include "mt8192-asurada.dtsi"
+
+/ {
+       model = "Google Hayato rev1";
+       compatible = "google,hayato-rev1", "google,hayato", "mediatek,mt8192";
+};
+
+&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_FORWARD)
+               MATRIX_KEY(0x02, 0x02, KEY_REFRESH)
+               MATRIX_KEY(0x01, 0x02, KEY_FULL_SCREEN)
+               MATRIX_KEY(0x03, 0x04, KEY_SCALE)
+               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
+       >;
+};
+
+&touchscreen {
+       compatible = "hid-over-i2c";
+       post-power-on-delay-ms = <10>;
+       hid-descr-addr = <0x0001>;
+       vdd-supply = <&pp3300_u>;
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts b/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts
new file mode 100644 (file)
index 0000000..fa3d957
--- /dev/null
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright 2021 Google LLC
+ */
+/dts-v1/;
+#include "mt8192-asurada.dtsi"
+#include <dt-bindings/leds/common.h>
+
+/ {
+       model = "Google Spherion (rev0 - 3)";
+       compatible = "google,spherion-rev3", "google,spherion-rev2",
+                    "google,spherion-rev1", "google,spherion-rev0",
+                    "google,spherion", "mediatek,mt8192";
+
+       pwmleds {
+               compatible = "pwm-leds";
+
+               led {
+                       function = LED_FUNCTION_KBD_BACKLIGHT;
+                       color = <LED_COLOR_ID_WHITE>;
+                       pwms = <&cros_ec_pwm 0>;
+                       max-brightness = <1023>;
+               };
+       };
+};
+
+&cros_ec_pwm {
+       status = "okay";
+};
+
+&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_FULL_SCREEN)
+               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
+       >;
+};
+
+&touchscreen {
+       compatible = "elan,ekth3500";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
new file mode 100644 (file)
index 0000000..4b31443
--- /dev/null
@@ -0,0 +1,959 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2020 MediaTek Inc.
+ * Author: Seiya Wang <seiya.wang@mediatek.com>
+ */
+/dts-v1/;
+#include "mt8192.dtsi"
+#include "mt6359.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/spmi/spmi.h>
+
+/ {
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0 0x40000000 0 0x80000000>;
+       };
+
+       /* system wide LDO 1.8V power rail */
+       pp1800_ldo_g: regulator-1v8-g {
+               compatible = "regulator-fixed";
+               regulator-name = "pp1800_ldo_g";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&pp3300_g>;
+       };
+
+       /* system wide switching 3.3V power rail */
+       pp3300_g: regulator-3v3-g {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_g";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* system wide LDO 3.3V power rail */
+       pp3300_ldo_z: regulator-3v3-z {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_ldo_z";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* separately switched 3.3V power rail */
+       pp3300_u: regulator-3v3-u {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_u";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               /* enable pin wired to GPIO controlled by EC */
+               vin-supply = <&pp3300_g>;
+       };
+
+       pp3300_wlan: regulator-3v3-wlan {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_wlan";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pp3300_wlan_pins>;
+               enable-active-high;
+               gpio = <&pio 143 GPIO_ACTIVE_HIGH>;
+       };
+
+       /* system wide switching 5.0V power rail */
+       pp5000_a: regulator-5v0-a {
+               compatible = "regulator-fixed";
+               regulator-name = "pp5000_a";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* system wide semi-regulated power rail from battery or USB */
+       ppvar_sys: regulator-var-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "ppvar_sys";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       reserved_memory: reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               scp_mem_reserved: scp@50000000 {
+                       compatible = "shared-dma-pool";
+                       reg = <0 0x50000000 0 0x2900000>;
+                       no-map;
+               };
+
+               wifi_restricted_dma_region: wifi@c0000000 {
+                       compatible = "restricted-dma-pool";
+                       reg = <0 0xc0000000 0 0x4000000>;
+               };
+       };
+};
+
+&i2c0 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+
+       touchscreen: touchscreen@10 {
+               reg = <0x10>;
+               interrupts-extended = <&pio 21 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&touchscreen_pins>;
+       };
+};
+
+&i2c1 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+};
+
+&i2c2 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       clock-stretch-ns = <12600>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins>;
+
+       trackpad@15 {
+               compatible = "elan,ekth3000";
+               reg = <0x15>;
+               interrupts-extended = <&pio 15 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&trackpad_pins>;
+               vcc-supply = <&pp3300_u>;
+               wakeup-source;
+       };
+};
+
+&i2c3 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c3_pins>;
+};
+
+&i2c7 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c7_pins>;
+};
+
+&mmc0 {
+       status = "okay";
+
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc0_default_pins>;
+       pinctrl-1 = <&mmc0_uhs_pins>;
+       bus-width = <8>;
+       max-frequency = <200000000>;
+       vmmc-supply = <&mt6359_vemc_1_ldo_reg>;
+       vqmmc-supply = <&mt6359_vufs_ldo_reg>;
+       cap-mmc-highspeed;
+       mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
+       supports-cqe;
+       cap-mmc-hw-reset;
+       mmc-hs400-enhanced-strobe;
+       hs400-ds-delay = <0x12814>;
+       no-sdio;
+       no-sd;
+       non-removable;
+};
+
+&mmc1 {
+       status = "okay";
+
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc1_default_pins>;
+       pinctrl-1 = <&mmc1_uhs_pins>;
+       bus-width = <4>;
+       max-frequency = <200000000>;
+       cd-gpios = <&pio 17 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&mt6360_ldo5_reg>;
+       vqmmc-supply = <&mt6360_ldo3_reg>;
+       cap-sd-highspeed;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       no-sdio;
+       no-mmc;
+};
+
+/* for CORE */
+&mt6359_vgpu11_buck_reg {
+       regulator-always-on;
+};
+
+&mt6359_vgpu11_sshub_buck_reg {
+       regulator-always-on;
+       regulator-min-microvolt = <575000>;
+       regulator-max-microvolt = <575000>;
+};
+
+&mt6359_vrf12_ldo_reg {
+       regulator-always-on;
+};
+
+&mt6359_vufs_ldo_reg {
+       regulator-always-on;
+};
+
+&mt6359codec {
+       mediatek,dmic-mode = <1>; /* one-wire */
+       mediatek,mic-type-0 = <2>; /* DMIC */
+       mediatek,mic-type-2 = <2>; /* DMIC */
+};
+
+&nor_flash {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&nor_flash_pins>;
+       assigned-clocks = <&topckgen CLK_TOP_SFLASH_SEL>;
+       assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D6_D8>;
+
+       flash@0 {
+               compatible = "winbond,w25q64jwm", "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <52000000>;
+               spi-rx-bus-width = <2>;
+               spi-tx-bus-width = <2>;
+       };
+};
+
+&pcie {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_pins>;
+
+       pcie0: pcie@0,0 {
+               device_type = "pci";
+               reg = <0x0000 0 0 0 0>;
+               num-lanes = <1>;
+               bus-range = <0x1 0x1>;
+
+               #address-cells = <3>;
+               #size-cells = <2>;
+               ranges;
+
+               wifi: wifi@0,0 {
+                       reg = <0x10000 0 0 0 0x100000>,
+                             <0x10000 0 0x100000 0 0x100000>;
+                       memory-region = <&wifi_restricted_dma_region>;
+               };
+       };
+};
+
+&pio {
+       /* 220 lines */
+       gpio-line-names = "I2S_DP_LRCK",
+                         "IS_DP_BCLK",
+                         "I2S_DP_MCLK",
+                         "I2S_DP_DATAOUT",
+                         "SAR0_INT_ODL",
+                         "EC_AP_INT_ODL",
+                         "EDPBRDG_INT_ODL",
+                         "DPBRDG_INT_ODL",
+                         "DPBRDG_PWREN",
+                         "DPBRDG_RST_ODL",
+                         "I2S_HP_MCLK",
+                         "I2S_HP_BCK",
+                         "I2S_HP_LRCK",
+                         "I2S_HP_DATAIN",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it AP_FLASH_WP_ODL.
+                          */
+                         "AP_FLASH_WP_L",
+                         "TRACKPAD_INT_ODL",
+                         "EC_AP_HPD_OD",
+                         "SD_CD_ODL",
+                         "HP_INT_ODL_ALC",
+                         "EN_PP1000_DPBRDG",
+                         "AP_GPIO20",
+                         "TOUCH_INT_L_1V8",
+                         "UART_BT_WAKE_ODL",
+                         "AP_GPIO23",
+                         "AP_SPI_FLASH_CS_L",
+                         "AP_SPI_FLASH_CLK",
+                         "EN_PP3300_DPBRDG_DX",
+                         "AP_SPI_FLASH_MOSI",
+                         "AP_SPI_FLASH_MISO",
+                         "I2S_HP_DATAOUT",
+                         "AP_GPIO30",
+                         "I2S_SPKR_MCLK",
+                         "I2S_SPKR_BCLK",
+                         "I2S_SPKR_LRCK",
+                         "I2S_SPKR_DATAIN",
+                         "I2S_SPKR_DATAOUT",
+                         "AP_SPI_H1_TPM_CLK",
+                         "AP_SPI_H1_TPM_CS_L",
+                         "AP_SPI_H1_TPM_MISO",
+                         "AP_SPI_H1_TPM_MOSI",
+                         "BL_PWM",
+                         "EDPBRDG_PWREN",
+                         "EDPBRDG_RST_ODL",
+                         "EN_PP3300_HUB",
+                         "HUB_RST_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SD_CLK",
+                         "SD_CMD",
+                         "SD_DATA3",
+                         "SD_DATA0",
+                         "SD_DATA2",
+                         "SD_DATA1",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "PCIE_WAKE_ODL",
+                         "PCIE_RST_L",
+                         "PCIE_CLKREQ_ODL",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "SPMI_SCL",
+                         "SPMI_SDA",
+                         "AP_GOOD",
+                         "UART_DBG_TX_AP_RX",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_AP_TX_BT_RX",
+                         "UART_BT_TX_AP_RX",
+                         "MIPI_DPI_D0_R",
+                         "MIPI_DPI_D1_R",
+                         "MIPI_DPI_D2_R",
+                         "MIPI_DPI_D3_R",
+                         "MIPI_DPI_D4_R",
+                         "MIPI_DPI_D5_R",
+                         "MIPI_DPI_D6_R",
+                         "MIPI_DPI_D7_R",
+                         "MIPI_DPI_D8_R",
+                         "MIPI_DPI_D9_R",
+                         "MIPI_DPI_D10_R",
+                         "",
+                         "",
+                         "MIPI_DPI_DE_R",
+                         "MIPI_DPI_D11_R",
+                         "MIPI_DPI_VSYNC_R",
+                         "MIPI_DPI_CLK_R",
+                         "MIPI_DPI_HSYNC_R",
+                         "PCM_BT_DATAIN",
+                         "PCM_BT_SYNC",
+                         "PCM_BT_DATAOUT",
+                         "PCM_BT_CLK",
+                         "AP_I2C_AUDIO_SCL",
+                         "AP_I2C_AUDIO_SDA",
+                         "SCP_I2C_SCL",
+                         "SCP_I2C_SDA",
+                         "AP_I2C_WLAN_SCL",
+                         "AP_I2C_WLAN_SDA",
+                         "AP_I2C_DPBRDG_SCL",
+                         "AP_I2C_DPBRDG_SDA",
+                         "EN_PP1800_DPBRDG_DX",
+                         "EN_PP3300_EDP_DX",
+                         "EN_PP1800_EDPBRDG_DX",
+                         "EN_PP1000_EDPBRDG",
+                         "SCP_JTAG0_TDO",
+                         "SCP_JTAG0_TDI",
+                         "SCP_JTAG0_TMS",
+                         "SCP_JTAG0_TCK",
+                         "SCP_JTAG0_TRSTN",
+                         "EN_PP3000_VMC_PMU",
+                         "EN_PP3300_DISPLAY_DX",
+                         "TOUCH_RST_L_1V8",
+                         "TOUCH_REPORT_DISABLE",
+                         "",
+                         "",
+                         "AP_I2C_TRACKPAD_SCL_1V8",
+                         "AP_I2C_TRACKPAD_SDA_1V8",
+                         "EN_PP3300_WLAN",
+                         "BT_KILL_L",
+                         "WIFI_KILL_L",
+                         "SET_VMC_VOLT_AT_1V8",
+                         "EN_SPK",
+                         "AP_WARM_RST_REQ",
+                         "",
+                         "",
+                         "EN_PP3000_SD_S3",
+                         "AP_EDP_BKLTEN",
+                         "",
+                         "",
+                         "",
+                         "AP_SPI_EC_CLK",
+                         "AP_SPI_EC_CS_L",
+                         "AP_SPI_EC_MISO",
+                         "AP_SPI_EC_MOSI",
+                         "AP_I2C_EDPBRDG_SCL",
+                         "AP_I2C_EDPBRDG_SDA",
+                         "MT6315_PROC_INT",
+                         "MT6315_GPU_INT",
+                         "UART_SERVO_TX_SCP_RX",
+                         "UART_SCP_TX_SERVO_RX",
+                         "BT_RTS_AP_CTS",
+                         "AP_RTS_BT_CTS",
+                         "UART_AP_WAKE_BT_ODL",
+                         "WLAN_ALERT_ODL",
+                         "EC_IN_RW_ODL",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "MSDC0_CMD",
+                         "MSDC0_DAT0",
+                         "MSDC0_DAT2",
+                         "MSDC0_DAT4",
+                         "MSDC0_DAT6",
+                         "MSDC0_DAT1",
+                         "MSDC0_DAT5",
+                         "MSDC0_DAT7",
+                         "MSDC0_DSL",
+                         "MSDC0_CLK",
+                         "MSDC0_DAT3",
+                         "MSDC0_RST_L",
+                         "SCP_VREQ_VAO",
+                         "AUD_DAT_MOSI2",
+                         "AUD_NLE_MOSI1",
+                         "AUD_NLE_MOSI0",
+                         "AUD_DAT_MISO2",
+                         "AP_I2C_SAR_SDA",
+                         "AP_I2C_SAR_SCL",
+                         "AP_I2C_PWR_SCL",
+                         "AP_I2C_PWR_SDA",
+                         "AP_I2C_TS_SCL_1V8",
+                         "AP_I2C_TS_SDA_1V8",
+                         "SRCLKENA0",
+                         "SRCLKENA1",
+                         "AP_EC_WATCHDOG_L",
+                         "PWRAP_SPI0_MI",
+                         "PWRAP_SPI0_CSN",
+                         "PWRAP_SPI0_MO",
+                         "PWRAP_SPI0_CK",
+                         "AP_RTC_CLK32K",
+                         "AUD_CLK_MOSI",
+                         "AUD_SYNC_MOSI",
+                         "AUD_DAT_MOSI0",
+                         "AUD_DAT_MOSI1",
+                         "AUD_DAT_MISO0",
+                         "AUD_DAT_MISO1";
+
+       cr50_int: cr50-irq-default-pins {
+               pins-gsc-ap-int-odl {
+                       pinmux = <PINMUX_GPIO171__FUNC_GPIO171>;
+                       input-enable;
+               };
+       };
+
+       cros_ec_int: cros-ec-irq-default-pins {
+               pins-ec-ap-int-odl {
+                       pinmux = <PINMUX_GPIO5__FUNC_GPIO5>;
+                       input-enable;
+                       bias-pull-up;
+               };
+       };
+
+       i2c0_pins: i2c0-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO204__FUNC_SCL0>,
+                                <PINMUX_GPIO205__FUNC_SDA0>;
+                       bias-pull-up = <MTK_PULL_SET_RSEL_011>;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c1_pins: i2c1-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO118__FUNC_SCL1>,
+                                <PINMUX_GPIO119__FUNC_SDA1>;
+                       bias-pull-up = <MTK_PULL_SET_RSEL_011>;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c2_pins: i2c2-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO141__FUNC_SCL2>,
+                                <PINMUX_GPIO142__FUNC_SDA2>;
+                       bias-pull-up = <MTK_PULL_SET_RSEL_011>;
+               };
+       };
+
+       i2c3_pins: i2c3-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO160__FUNC_SCL3>,
+                                <PINMUX_GPIO161__FUNC_SDA3>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c7_pins: i2c7-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO124__FUNC_SCL7>,
+                                <PINMUX_GPIO125__FUNC_SDA7>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       mmc0_default_pins: mmc0-default-pins {
+               pins-cmd-dat {
+                       pinmux = <PINMUX_GPIO184__FUNC_MSDC0_DAT0>,
+                                <PINMUX_GPIO188__FUNC_MSDC0_DAT1>,
+                                <PINMUX_GPIO185__FUNC_MSDC0_DAT2>,
+                                <PINMUX_GPIO193__FUNC_MSDC0_DAT3>,
+                                <PINMUX_GPIO186__FUNC_MSDC0_DAT4>,
+                                <PINMUX_GPIO189__FUNC_MSDC0_DAT5>,
+                                <PINMUX_GPIO187__FUNC_MSDC0_DAT6>,
+                                <PINMUX_GPIO190__FUNC_MSDC0_DAT7>,
+                                <PINMUX_GPIO183__FUNC_MSDC0_CMD>;
+                       input-enable;
+                       drive-strength = <8>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO192__FUNC_MSDC0_CLK>;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+
+               pins-rst {
+                       pinmux = <PINMUX_GPIO194__FUNC_MSDC0_RSTB>;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
+               };
+       };
+
+       mmc0_uhs_pins: mmc0-uhs-pins {
+               pins-cmd-dat {
+                       pinmux = <PINMUX_GPIO184__FUNC_MSDC0_DAT0>,
+                                <PINMUX_GPIO188__FUNC_MSDC0_DAT1>,
+                                <PINMUX_GPIO185__FUNC_MSDC0_DAT2>,
+                                <PINMUX_GPIO193__FUNC_MSDC0_DAT3>,
+                                <PINMUX_GPIO186__FUNC_MSDC0_DAT4>,
+                                <PINMUX_GPIO189__FUNC_MSDC0_DAT5>,
+                                <PINMUX_GPIO187__FUNC_MSDC0_DAT6>,
+                                <PINMUX_GPIO190__FUNC_MSDC0_DAT7>,
+                                <PINMUX_GPIO183__FUNC_MSDC0_CMD>;
+                       input-enable;
+                       drive-strength = <10>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO192__FUNC_MSDC0_CLK>;
+                       drive-strength = <10>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+
+               pins-rst {
+                       pinmux = <PINMUX_GPIO194__FUNC_MSDC0_RSTB>;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-ds {
+                       pinmux = <PINMUX_GPIO191__FUNC_MSDC0_DSL>;
+                       drive-strength = <10>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+       };
+
+       mmc1_default_pins: mmc1-default-pins {
+               pins-cmd-dat {
+                       pinmux = <PINMUX_GPIO54__FUNC_MSDC1_DAT0>,
+                                <PINMUX_GPIO56__FUNC_MSDC1_DAT1>,
+                                <PINMUX_GPIO55__FUNC_MSDC1_DAT2>,
+                                <PINMUX_GPIO53__FUNC_MSDC1_DAT3>,
+                                <PINMUX_GPIO52__FUNC_MSDC1_CMD>;
+                       input-enable;
+                       drive-strength = <8>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO51__FUNC_MSDC1_CLK>;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+
+               pins-insert {
+                       pinmux = <PINMUX_GPIO17__FUNC_GPIO17>;
+                       input-enable;
+                       bias-pull-up;
+               };
+       };
+
+       mmc1_uhs_pins: mmc1-uhs-pins {
+               pins-cmd-dat {
+                       pinmux = <PINMUX_GPIO54__FUNC_MSDC1_DAT0>,
+                                <PINMUX_GPIO56__FUNC_MSDC1_DAT1>,
+                                <PINMUX_GPIO55__FUNC_MSDC1_DAT2>,
+                                <PINMUX_GPIO53__FUNC_MSDC1_DAT3>,
+                                <PINMUX_GPIO52__FUNC_MSDC1_CMD>;
+                       input-enable;
+                       drive-strength = <8>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO51__FUNC_MSDC1_CLK>;
+                       input-enable;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+       };
+
+       nor_flash_pins: nor-flash-default-pins {
+               pins-cs-io1 {
+                       pinmux = <PINMUX_GPIO24__FUNC_SPINOR_CS>,
+                                <PINMUX_GPIO28__FUNC_SPINOR_IO1>;
+                       input-enable;
+                       bias-pull-up;
+                       drive-strength = <10>;
+               };
+
+               pins-io0 {
+                       pinmux = <PINMUX_GPIO27__FUNC_SPINOR_IO0>;
+                       bias-pull-up;
+                       drive-strength = <10>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO25__FUNC_SPINOR_CK>;
+                       input-enable;
+                       bias-pull-up;
+                       drive-strength = <10>;
+               };
+       };
+
+       pcie_pins: pcie-default-pins {
+               pins-pcie-wake {
+                       pinmux = <PINMUX_GPIO63__FUNC_PCIE_WAKE_N>;
+                       bias-pull-up;
+               };
+
+               pins-pcie-pereset {
+                       pinmux = <PINMUX_GPIO64__FUNC_PCIE_PERESET_N>;
+               };
+
+               pins-pcie-clkreq {
+                       pinmux = <PINMUX_GPIO65__FUNC_PCIE_CLKREQ_N>;
+                       bias-pull-up;
+               };
+
+               pins-wifi-kill {
+                       pinmux = <PINMUX_GPIO145__FUNC_GPIO145>; /* WIFI_KILL_L */
+                       output-high;
+               };
+       };
+
+       pp3300_wlan_pins: pp3300-wlan-pins {
+               pins-pcie-en-pp3300-wlan {
+                       pinmux = <PINMUX_GPIO143__FUNC_GPIO143>;
+                       output-high;
+               };
+       };
+
+       scp_pins: scp-pins {
+               pins-vreq-vao {
+                       pinmux = <PINMUX_GPIO195__FUNC_SCP_VREQ_VAO>;
+               };
+       };
+
+       spi1_pins: spi1-default-pins {
+               pins-cs-mosi-clk {
+                       pinmux = <PINMUX_GPIO157__FUNC_SPI1_A_CSB>,
+                                <PINMUX_GPIO159__FUNC_SPI1_A_MO>,
+                                <PINMUX_GPIO156__FUNC_SPI1_A_CLK>;
+                       bias-disable;
+               };
+
+               pins-miso {
+                       pinmux = <PINMUX_GPIO158__FUNC_SPI1_A_MI>;
+                       bias-pull-down;
+               };
+       };
+
+       spi5_pins: spi5-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO38__FUNC_SPI5_A_MI>,
+                                <PINMUX_GPIO37__FUNC_GPIO37>,
+                                <PINMUX_GPIO39__FUNC_SPI5_A_MO>,
+                                <PINMUX_GPIO36__FUNC_SPI5_A_CLK>;
+                       bias-disable;
+               };
+       };
+
+       trackpad_pins: trackpad-default-pins {
+               pins-int-n {
+                       pinmux = <PINMUX_GPIO15__FUNC_GPIO15>;
+                       input-enable;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+               };
+       };
+
+       touchscreen_pins: touchscreen-default-pins {
+               pins-irq {
+                       pinmux = <PINMUX_GPIO21__FUNC_GPIO21>;
+                       input-enable;
+                       bias-pull-up;
+               };
+
+               pins-reset {
+                       pinmux = <PINMUX_GPIO137__FUNC_GPIO137>;
+                       output-high;
+               };
+
+               pins-report-sw {
+                       pinmux = <PINMUX_GPIO138__FUNC_GPIO138>;
+                       output-low;
+               };
+       };
+};
+
+&pmic {
+       interrupts-extended = <&pio 214 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&scp {
+       status = "okay";
+
+       firmware-name = "mediatek/mt8192/scp.img";
+       memory-region = <&scp_mem_reserved>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&scp_pins>;
+
+       cros-ec {
+               compatible = "google,cros-ec-rpmsg";
+               mediatek,rpmsg-name = "cros-ec-rpmsg";
+       };
+};
+
+&spi1 {
+       status = "okay";
+
+       mediatek,pad-select = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi1_pins>;
+
+       cros_ec: ec@0 {
+               compatible = "google,cros-ec-spi";
+               reg = <0>;
+               interrupts-extended = <&pio 5 IRQ_TYPE_LEVEL_LOW>;
+               spi-max-frequency = <3000000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&cros_ec_int>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               base_detection: cbas {
+                       compatible = "google,cros-cbas";
+               };
+
+               cros_ec_pwm: pwm {
+                       compatible = "google,cros-ec-pwm";
+                       #pwm-cells = <1>;
+
+                       status = "disabled";
+               };
+
+               i2c_tunnel: i2c-tunnel {
+                       compatible = "google,cros-ec-i2c-tunnel";
+                       google,remote-bus = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mt6360_ldo3_reg: regulator@0 {
+                       compatible = "google,cros-ec-regulator";
+                       reg = <0>;
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <3300000>;
+               };
+
+               mt6360_ldo5_reg: regulator@1 {
+                       compatible = "google,cros-ec-regulator";
+                       reg = <1>;
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+               };
+
+               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";
+                       };
+               };
+       };
+};
+
+&spi5 {
+       status = "okay";
+
+       cs-gpios = <&pio 37 GPIO_ACTIVE_LOW>;
+       mediatek,pad-select = <0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi5_pins>;
+
+       cr50@0 {
+               compatible = "google,cr50";
+               reg = <0>;
+               interrupts-extended = <&pio 171 IRQ_TYPE_EDGE_RISING>;
+               spi-max-frequency = <1000000>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&cr50_int>;
+       };
+};
+
+&spmi {
+       #address-cells = <2>;
+       #size-cells = <0>;
+
+       mt6315_6: pmic@6 {
+               compatible = "mediatek,mt6315-regulator";
+               reg = <0x6 SPMI_USID>;
+
+               regulators {
+                       mt6315_6_vbuck1: vbuck1 {
+                               regulator-compatible = "vbuck1";
+                               regulator-name = "Vbcpu";
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <1193750>;
+                               regulator-enable-ramp-delay = <256>;
+                               regulator-allowed-modes = <0 1 2>;
+                               regulator-always-on;
+                       };
+
+                       mt6315_6_vbuck3: vbuck3 {
+                               regulator-compatible = "vbuck3";
+                               regulator-name = "Vlcpu";
+                               regulator-min-microvolt = <300000>;
+                               regulator-max-microvolt = <1193750>;
+                               regulator-enable-ramp-delay = <256>;
+                               regulator-allowed-modes = <0 1 2>;
+                               regulator-always-on;
+                       };
+               };
+       };
+
+       mt6315_7: pmic@7 {
+               compatible = "mediatek,mt6315-regulator";
+               reg = <0x7 SPMI_USID>;
+
+               regulators {
+                       mt6315_7_vbuck1: vbuck1 {
+                               regulator-compatible = "vbuck1";
+                               regulator-name = "Vgpu";
+                               regulator-min-microvolt = <606250>;
+                               regulator-max-microvolt = <1193750>;
+                               regulator-enable-ramp-delay = <256>;
+                               regulator-allowed-modes = <0 1 2>;
+                       };
+               };
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&xhci {
+       status = "okay";
+
+       wakeup-source;
+       vusb33-supply = <&pp3300_g>;
+       vbus-supply = <&pp5000_a>;
+};
+
+#include <arm/cros-ec-keyboard.dtsi>
+#include <arm/cros-ec-sbs.dtsi>
index 733aec2..cbae5a5 100644 (file)
@@ -43,7 +43,7 @@
                        reg = <0x000>;
                        enable-method = "psci";
                        clock-frequency = <1701000000>;
-                       cpu-idle-states = <&cpuoff_l &clusteroff_l>;
+                       cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>;
                        next-level-cache = <&l2_0>;
                        capacity-dmips-mhz = <530>;
                };
@@ -54,7 +54,7 @@
                        reg = <0x100>;
                        enable-method = "psci";
                        clock-frequency = <1701000000>;
-                       cpu-idle-states = <&cpuoff_l &clusteroff_l>;
+                       cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>;
                        next-level-cache = <&l2_0>;
                        capacity-dmips-mhz = <530>;
                };
@@ -65,7 +65,7 @@
                        reg = <0x200>;
                        enable-method = "psci";
                        clock-frequency = <1701000000>;
-                       cpu-idle-states = <&cpuoff_l &clusteroff_l>;
+                       cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>;
                        next-level-cache = <&l2_0>;
                        capacity-dmips-mhz = <530>;
                };
@@ -76,7 +76,7 @@
                        reg = <0x300>;
                        enable-method = "psci";
                        clock-frequency = <1701000000>;
-                       cpu-idle-states = <&cpuoff_l &clusteroff_l>;
+                       cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>;
                        next-level-cache = <&l2_0>;
                        capacity-dmips-mhz = <530>;
                };
@@ -87,7 +87,7 @@
                        reg = <0x400>;
                        enable-method = "psci";
                        clock-frequency = <2171000000>;
-                       cpu-idle-states = <&cpuoff_b &clusteroff_b>;
+                       cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>;
                        next-level-cache = <&l2_1>;
                        capacity-dmips-mhz = <1024>;
                };
@@ -98,7 +98,7 @@
                        reg = <0x500>;
                        enable-method = "psci";
                        clock-frequency = <2171000000>;
-                       cpu-idle-states = <&cpuoff_b &clusteroff_b>;
+                       cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>;
                        next-level-cache = <&l2_1>;
                        capacity-dmips-mhz = <1024>;
                };
                        reg = <0x600>;
                        enable-method = "psci";
                        clock-frequency = <2171000000>;
-                       cpu-idle-states = <&cpuoff_b &clusteroff_b>;
+                       cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>;
                        next-level-cache = <&l2_1>;
                        capacity-dmips-mhz = <1024>;
                };
                        reg = <0x700>;
                        enable-method = "psci";
                        clock-frequency = <2171000000>;
-                       cpu-idle-states = <&cpuoff_b &clusteroff_b>;
+                       cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>;
                        next-level-cache = <&l2_1>;
                        capacity-dmips-mhz = <1024>;
                };
                };
 
                idle-states {
-                       entry-method = "arm,psci";
-                       cpuoff_l: cpuoff_l {
+                       entry-method = "psci";
+                       cpu_sleep_l: cpu-sleep-l {
                                compatible = "arm,idle-state";
                                arm,psci-suspend-param = <0x00010001>;
                                local-timer-stop;
                                exit-latency-us = <140>;
                                min-residency-us = <780>;
                        };
-                       cpuoff_b: cpuoff_b {
+                       cpu_sleep_b: cpu-sleep-b {
                                compatible = "arm,idle-state";
                                arm,psci-suspend-param = <0x00010001>;
                                local-timer-stop;
                                exit-latency-us = <145>;
                                min-residency-us = <720>;
                        };
-                       clusteroff_l: clusteroff_l {
+                       cluster_sleep_l: cluster-sleep-l {
                                compatible = "arm,idle-state";
                                arm,psci-suspend-param = <0x01010002>;
                                local-timer-stop;
                                exit-latency-us = <155>;
                                min-residency-us = <860>;
                        };
-                       clusteroff_b: clusteroff_b {
+                       cluster_sleep_b: cluster-sleep-b {
                                compatible = "arm,idle-state";
                                arm,psci-suspend-param = <0x01010002>;
                                local-timer-stop;
                        compatible = "mediatek,mt8192-infracfg", "syscon";
                        reg = <0 0x10001000 0 0x1000>;
                        #clock-cells = <1>;
+                       #reset-cells = <1>;
                };
 
                pericfg: syscon@10003000 {
                };
 
                efuse: efuse@11c10000 {
-                       compatible = "mediatek,efuse";
+                       compatible = "mediatek,mt8192-efuse", "mediatek,efuse";
                        reg = <0 0x11c10000 0 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
new file mode 100644 (file)
index 0000000..3348ba6
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+/dts-v1/;
+#include "mt8195-cherry.dtsi"
+
+/ {
+       model = "Acer Tomato (rev1) board";
+       compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
+};
+
+&ts_10 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
new file mode 100644 (file)
index 0000000..4669e9d
--- /dev/null
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+/dts-v1/;
+#include "mt8195-cherry.dtsi"
+
+/ {
+       model = "Acer Tomato (rev2) board";
+       compatible = "google,tomato-rev2", "google,tomato", "mediatek,mt8195";
+};
+
+&pio_default {
+       pins-low-power-hdmi-disable {
+               pinmux = <PINMUX_GPIO31__FUNC_GPIO31>,
+                        <PINMUX_GPIO32__FUNC_GPIO32>,
+                        <PINMUX_GPIO33__FUNC_GPIO33>,
+                        <PINMUX_GPIO34__FUNC_GPIO34>,
+                        <PINMUX_GPIO35__FUNC_GPIO35>;
+               input-enable;
+               bias-pull-down;
+       };
+
+       pins-low-power-pcie0-disable {
+               pinmux = <PINMUX_GPIO19__FUNC_GPIO19>,
+                        <PINMUX_GPIO20__FUNC_GPIO20>,
+                        <PINMUX_GPIO21__FUNC_GPIO21>;
+               input-enable;
+               bias-pull-down;
+       };
+};
+
+&ts_10 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
new file mode 100644 (file)
index 0000000..5021edd
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+/dts-v1/;
+#include "mt8195-cherry.dtsi"
+
+/ {
+       model = "Acer Tomato (rev3 - 4) board";
+       compatible = "google,tomato-rev4", "google,tomato-rev3",
+                    "google,tomato", "mediatek,mt8195";
+};
+
+&pio_default {
+       pins-low-power-hdmi-disable {
+               pinmux = <PINMUX_GPIO31__FUNC_GPIO31>,
+                        <PINMUX_GPIO32__FUNC_GPIO32>,
+                        <PINMUX_GPIO33__FUNC_GPIO33>,
+                        <PINMUX_GPIO34__FUNC_GPIO34>,
+                        <PINMUX_GPIO35__FUNC_GPIO35>;
+               input-enable;
+               bias-pull-down;
+       };
+
+       pins-low-power-pcie0-disable {
+               pinmux = <PINMUX_GPIO19__FUNC_GPIO19>,
+                        <PINMUX_GPIO20__FUNC_GPIO20>,
+                        <PINMUX_GPIO21__FUNC_GPIO21>;
+               input-enable;
+               bias-pull-down;
+       };
+};
+
+&ts_10 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
new file mode 100644 (file)
index 0000000..fcc6006
--- /dev/null
@@ -0,0 +1,702 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include "mt8195.dtsi"
+#include "mt6359.dtsi"
+
+/ {
+       aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+               i2c3 = &i2c3;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               i2c7 = &i2c7;
+               mmc0 = &mmc0;
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@40000000 {
+               device_type = "memory";
+               reg = <0 0x40000000 0 0x80000000>;
+       };
+
+       /* system wide LDO 3.3V power rail */
+       pp3300_z5: regulator-pp3300-ldo-z5 {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_ldo_z5";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* separately switched 3.3V power rail */
+       pp3300_s3: regulator-pp3300-s3 {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_s3";
+               /* automatically sequenced by PMIC EXT_PMIC_EN2 */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&pp3300_z2>;
+       };
+
+       /* system wide 3.3V power rail */
+       pp3300_z2: regulator-pp3300-z2 {
+               compatible = "regulator-fixed";
+               regulator-name = "pp3300_z2";
+               /* EN pin tied to pp4200_z2, which is controlled by EC */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* system wide 4.2V power rail */
+       pp4200_z2: regulator-pp4200-z2 {
+               compatible = "regulator-fixed";
+               regulator-name = "pp4200_z2";
+               /* controlled by EC */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <4200000>;
+               regulator-max-microvolt = <4200000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* system wide switching 5.0V power rail */
+       pp5000_s5: regulator-pp5000-s5 {
+               compatible = "regulator-fixed";
+               regulator-name = "pp5000_s5";
+               /* controlled by EC */
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&ppvar_sys>;
+       };
+
+       /* system wide semi-regulated power rail from battery or USB */
+       ppvar_sys: regulator-ppvar-sys {
+               compatible = "regulator-fixed";
+               regulator-name = "ppvar_sys";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       usb_vbus: regulator-5v0-usb-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               regulator-always-on;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+};
+
+&i2c1 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       i2c-scl-internal-delay-ns = <12500>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins>;
+};
+
+&i2c2 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins>;
+};
+
+&i2c3 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c3_pins>;
+};
+
+&i2c4 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c4_pins>;
+
+       ts_10: touchscreen@10 {
+               compatible = "hid-over-i2c";
+               reg = <0x10>;
+               hid-descr-addr = <0x0001>;
+               interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&touchscreen_pins>;
+               post-power-on-delay-ms = <10>;
+               vdd-supply = <&pp3300_s3>;
+               status = "disabled";
+       };
+};
+
+&i2c5 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c5_pins>;
+};
+
+&i2c7 {
+       status = "okay";
+
+       clock-frequency = <400000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c7_pins>;
+
+       pmic@34 {
+               #interrupt-cells = <1>;
+               compatible = "mediatek,mt6360";
+               reg = <0x34>;
+               interrupt-controller;
+               interrupts-extended = <&pio 130 IRQ_TYPE_EDGE_FALLING>;
+               interrupt-names = "IRQB";
+               pinctrl-names = "default";
+               pinctrl-0 = <&subpmic_default>;
+               wakeup-source;
+       };
+};
+
+&mmc0 {
+       status = "okay";
+
+       bus-width = <8>;
+       cap-mmc-highspeed;
+       cap-mmc-hw-reset;
+       hs400-ds-delay = <0x14c11>;
+       max-frequency = <200000000>;
+       mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
+       no-sdio;
+       no-sd;
+       non-removable;
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc0_pins_default>;
+       pinctrl-1 = <&mmc0_pins_uhs>;
+       vmmc-supply = <&mt6359_vemc_1_ldo_reg>;
+       vqmmc-supply = <&mt6359_vufs_ldo_reg>;
+};
+
+/* for CPU-L */
+&mt6359_vcore_buck_reg {
+       regulator-always-on;
+};
+
+/* for CORE */
+&mt6359_vgpu11_buck_reg {
+       regulator-always-on;
+};
+
+&mt6359_vgpu11_sshub_buck_reg {
+       regulator-always-on;
+       regulator-min-microvolt = <550000>;
+       regulator-max-microvolt = <550000>;
+};
+
+/* for CORE SRAM */
+&mt6359_vpu_buck_reg {
+       regulator-always-on;
+};
+
+&mt6359_vrf12_ldo_reg {
+       regulator-always-on;
+};
+
+/* for GPU SRAM */
+&mt6359_vsram_others_ldo_reg {
+       regulator-always-on;
+       regulator-min-microvolt = <750000>;
+       regulator-max-microvolt = <750000>;
+};
+
+&mt6359_vufs_ldo_reg {
+       regulator-always-on;
+};
+
+&nor_flash {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&nor_pins_default>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <52000000>;
+               spi-rx-bus-width = <2>;
+               spi-tx-bus-width = <2>;
+       };
+};
+
+&pio {
+       mediatek,rsel-resistance-in-si-unit;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pio_default>;
+
+       /* 144 lines */
+       gpio-line-names =
+               "I2S_SPKR_MCLK",
+               "I2S_SPKR_DATAIN",
+               "I2S_SPKR_LRCK",
+               "I2S_SPKR_BCLK",
+               "EC_AP_INT_ODL",
+               /*
+                * AP_FLASH_WP_L is crossystem ABI. Schematics
+                * call it AP_FLASH_WP_ODL.
+                */
+               "AP_FLASH_WP_L",
+               "TCHPAD_INT_ODL",
+               "EDP_HPD_1V8",
+               "AP_I2C_CAM_SDA",
+               "AP_I2C_CAM_SCL",
+               "AP_I2C_TCHPAD_SDA_1V8",
+               "AP_I2C_TCHPAD_SCL_1V8",
+               "AP_I2C_AUD_SDA",
+               "AP_I2C_AUD_SCL",
+               "AP_I2C_TPM_SDA_1V8",
+               "AP_I2C_TPM_SCL_1V8",
+               "AP_I2C_TCHSCR_SDA_1V8",
+               "AP_I2C_TCHSCR_SCL_1V8",
+               "EC_AP_HPD_OD",
+               "",
+               "PCIE_NVME_RST_L",
+               "PCIE_NVME_CLKREQ_ODL",
+               "PCIE_RST_1V8_L",
+               "PCIE_CLKREQ_1V8_ODL",
+               "PCIE_WAKE_1V8_ODL",
+               "CLK_24M_CAM0",
+               "CAM1_SEN_EN",
+               "AP_I2C_PWR_SCL_1V8",
+               "AP_I2C_PWR_SDA_1V8",
+               "AP_I2C_MISC_SCL",
+               "AP_I2C_MISC_SDA",
+               "EN_PP5000_HDMI_X",
+               "AP_HDMITX_HTPLG",
+               "",
+               "AP_HDMITX_SCL_1V8",
+               "AP_HDMITX_SDA_1V8",
+               "AP_RTC_CLK32K",
+               "AP_EC_WATCHDOG_L",
+               "SRCLKENA0",
+               "SRCLKENA1",
+               "PWRAP_SPI0_CS_L",
+               "PWRAP_SPI0_CK",
+               "PWRAP_SPI0_MOSI",
+               "PWRAP_SPI0_MISO",
+               "SPMI_SCL",
+               "SPMI_SDA",
+               "",
+               "",
+               "",
+               "I2S_HP_DATAIN",
+               "I2S_HP_MCLK",
+               "I2S_HP_BCK",
+               "I2S_HP_LRCK",
+               "I2S_HP_DATAOUT",
+               "SD_CD_ODL",
+               "EN_PP3300_DISP_X",
+               "TCHSCR_RST_1V8_L",
+               "TCHSCR_REPORT_DISABLE",
+               "EN_PP3300_WLAN_X",
+               "BT_KILL_1V8_L",
+               "I2S_SPKR_DATAOUT",
+               "WIFI_KILL_1V8_L",
+               "BEEP_ON",
+               "SCP_I2C_SENSOR_SCL_1V8",
+               "SCP_I2C_SENSOR_SDA_1V8",
+               "",
+               "",
+               "",
+               "",
+               "AUD_CLK_MOSI",
+               "AUD_SYNC_MOSI",
+               "AUD_DAT_MOSI0",
+               "AUD_DAT_MOSI1",
+               "AUD_DAT_MISO0",
+               "AUD_DAT_MISO1",
+               "AUD_DAT_MISO2",
+               "SCP_VREQ_VAO",
+               "AP_SPI_GSC_TPM_CLK",
+               "AP_SPI_GSC_TPM_MOSI",
+               "AP_SPI_GSC_TPM_CS_L",
+               "AP_SPI_GSC_TPM_MISO",
+               "EN_PP1000_CAM_X",
+               "AP_EDP_BKLTEN",
+               "",
+               "USB3_HUB_RST_L",
+               "",
+               "WLAN_ALERT_ODL",
+               "EC_IN_RW_ODL",
+               "GSC_AP_INT_ODL",
+               "HP_INT_ODL",
+               "CAM0_RST_L",
+               "CAM1_RST_L",
+               "TCHSCR_INT_1V8_L",
+               "CAM1_DET_L",
+               "RST_ALC1011_L",
+               "",
+               "",
+               "BL_PWM_1V8",
+               "UART_AP_TX_DBG_RX",
+               "UART_DBG_TX_AP_RX",
+               "EN_SPKR",
+               "AP_EC_WARM_RST_REQ",
+               "UART_SCP_TX_DBGCON_RX",
+               "UART_DBGCON_TX_SCP_RX",
+               "",
+               "",
+               "KPCOL0",
+               "",
+               "MT6315_GPU_INT",
+               "MT6315_PROC_BC_INT",
+               "SD_CMD",
+               "SD_CLK",
+               "SD_DAT0",
+               "SD_DAT1",
+               "SD_DAT2",
+               "SD_DAT3",
+               "EMMC_DAT7",
+               "EMMC_DAT6",
+               "EMMC_DAT5",
+               "EMMC_DAT4",
+               "EMMC_RSTB",
+               "EMMC_CMD",
+               "EMMC_CLK",
+               "EMMC_DAT3",
+               "EMMC_DAT2",
+               "EMMC_DAT1",
+               "EMMC_DAT0",
+               "EMMC_DSL",
+               "",
+               "",
+               "MT6360_INT_ODL",
+               "SCP_JTAG0_TRSTN",
+               "AP_SPI_EC_CS_L",
+               "AP_SPI_EC_CLK",
+               "AP_SPI_EC_MOSI",
+               "AP_SPI_EC_MISO",
+               "SCP_JTAG0_TMS",
+               "SCP_JTAG0_TCK",
+               "SCP_JTAG0_TDO",
+               "SCP_JTAG0_TDI",
+               "AP_SPI_FLASH_CS_L",
+               "AP_SPI_FLASH_CLK",
+               "AP_SPI_FLASH_MOSI",
+               "AP_SPI_FLASH_MISO";
+
+       i2c0_pins: i2c0-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO8__FUNC_SDA0>,
+                                <PINMUX_GPIO9__FUNC_SCL0>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c1_pins: i2c1-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO10__FUNC_SDA1>,
+                                <PINMUX_GPIO11__FUNC_SCL1>;
+                       bias-pull-up = <1000>;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c2_pins: i2c2-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
+                                <PINMUX_GPIO13__FUNC_SCL2>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c3_pins: i2c3-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO14__FUNC_SDA3>,
+                                <PINMUX_GPIO15__FUNC_SCL3>;
+                       bias-pull-up = <1000>;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c4_pins: i2c4-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO16__FUNC_SDA4>,
+                                <PINMUX_GPIO17__FUNC_SCL4>;
+                       bias-pull-up = <1000>;
+                       drive-strength = <4>;
+               };
+       };
+
+       i2c5_pins: i2c5-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO29__FUNC_SCL5>,
+                                <PINMUX_GPIO30__FUNC_SDA5>;
+                       bias-disable;
+                       drive-strength-microamp = <1000>;
+               };
+       };
+
+       i2c7_pins: i2c7-default-pins {
+               pins-bus {
+                       pinmux = <PINMUX_GPIO27__FUNC_SCL7>,
+                                <PINMUX_GPIO28__FUNC_SDA7>;
+                       bias-disable;
+               };
+       };
+
+       mmc0_pins_default: mmc0-default-pins {
+               pins-cmd-dat {
+                       pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
+                                <PINMUX_GPIO125__FUNC_MSDC0_DAT1>,
+                                <PINMUX_GPIO124__FUNC_MSDC0_DAT2>,
+                                <PINMUX_GPIO123__FUNC_MSDC0_DAT3>,
+                                <PINMUX_GPIO119__FUNC_MSDC0_DAT4>,
+                                <PINMUX_GPIO118__FUNC_MSDC0_DAT5>,
+                                <PINMUX_GPIO117__FUNC_MSDC0_DAT6>,
+                                <PINMUX_GPIO116__FUNC_MSDC0_DAT7>,
+                                <PINMUX_GPIO121__FUNC_MSDC0_CMD>;
+                       input-enable;
+                       drive-strength = <6>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO122__FUNC_MSDC0_CLK>;
+                       drive-strength = <6>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+
+               pins-rst {
+                       pinmux = <PINMUX_GPIO120__FUNC_MSDC0_RSTB>;
+                       drive-strength = <6>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+       };
+
+       mmc0_pins_uhs: mmc0-uhs-pins {
+               pins-cmd-dat {
+                       pinmux = <PINMUX_GPIO126__FUNC_MSDC0_DAT0>,
+                                <PINMUX_GPIO125__FUNC_MSDC0_DAT1>,
+                                <PINMUX_GPIO124__FUNC_MSDC0_DAT2>,
+                                <PINMUX_GPIO123__FUNC_MSDC0_DAT3>,
+                                <PINMUX_GPIO119__FUNC_MSDC0_DAT4>,
+                                <PINMUX_GPIO118__FUNC_MSDC0_DAT5>,
+                                <PINMUX_GPIO117__FUNC_MSDC0_DAT6>,
+                                <PINMUX_GPIO116__FUNC_MSDC0_DAT7>,
+                                <PINMUX_GPIO121__FUNC_MSDC0_CMD>;
+                       input-enable;
+                       drive-strength = <8>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+
+               pins-clk {
+                       pinmux = <PINMUX_GPIO122__FUNC_MSDC0_CLK>;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+
+               pins-ds {
+                       pinmux = <PINMUX_GPIO127__FUNC_MSDC0_DSL>;
+                       drive-strength = <8>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
+               };
+
+               pins-rst {
+                       pinmux = <PINMUX_GPIO120__FUNC_MSDC0_RSTB>;
+                       drive-strength = <8>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+       };
+
+       nor_pins_default: nor-default-pins {
+               pins-ck-io {
+                       pinmux = <PINMUX_GPIO142__FUNC_SPINOR_IO0>,
+                                <PINMUX_GPIO141__FUNC_SPINOR_CK>,
+                                <PINMUX_GPIO143__FUNC_SPINOR_IO1>;
+                       drive-strength = <6>;
+                       bias-pull-down;
+               };
+
+               pins-cs {
+                       pinmux = <PINMUX_GPIO140__FUNC_SPINOR_CS>;
+                       drive-strength = <6>;
+                       bias-pull-up;
+               };
+       };
+
+       pio_default: pio-default-pins {
+               pins-wifi-enable {
+                       pinmux = <PINMUX_GPIO58__FUNC_GPIO58>;
+                       output-high;
+                       drive-strength = <14>;
+               };
+
+               pins-low-power-pd {
+                       pinmux = <PINMUX_GPIO25__FUNC_GPIO25>,
+                                <PINMUX_GPIO26__FUNC_GPIO26>,
+                                <PINMUX_GPIO46__FUNC_GPIO46>,
+                                <PINMUX_GPIO47__FUNC_GPIO47>,
+                                <PINMUX_GPIO48__FUNC_GPIO48>,
+                                <PINMUX_GPIO65__FUNC_GPIO65>,
+                                <PINMUX_GPIO66__FUNC_GPIO66>,
+                                <PINMUX_GPIO67__FUNC_GPIO67>,
+                                <PINMUX_GPIO68__FUNC_GPIO68>,
+                                <PINMUX_GPIO128__FUNC_GPIO128>,
+                                <PINMUX_GPIO129__FUNC_GPIO129>;
+                       input-enable;
+                       bias-pull-down;
+               };
+
+               pins-low-power-pupd {
+                       pinmux = <PINMUX_GPIO77__FUNC_GPIO77>,
+                                <PINMUX_GPIO78__FUNC_GPIO78>,
+                                <PINMUX_GPIO79__FUNC_GPIO79>,
+                                <PINMUX_GPIO80__FUNC_GPIO80>,
+                                <PINMUX_GPIO83__FUNC_GPIO83>,
+                                <PINMUX_GPIO85__FUNC_GPIO85>,
+                                <PINMUX_GPIO90__FUNC_GPIO90>,
+                                <PINMUX_GPIO91__FUNC_GPIO91>,
+                                <PINMUX_GPIO93__FUNC_GPIO93>,
+                                <PINMUX_GPIO94__FUNC_GPIO94>,
+                                <PINMUX_GPIO95__FUNC_GPIO95>,
+                                <PINMUX_GPIO96__FUNC_GPIO96>,
+                                <PINMUX_GPIO104__FUNC_GPIO104>,
+                                <PINMUX_GPIO105__FUNC_GPIO105>,
+                                <PINMUX_GPIO107__FUNC_GPIO107>;
+                       input-enable;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
+               };
+       };
+
+       spi0_pins: spi0-default-pins {
+               pins-cs-mosi-clk {
+                       pinmux = <PINMUX_GPIO132__FUNC_SPIM0_CSB>,
+                                <PINMUX_GPIO134__FUNC_SPIM0_MO>,
+                                <PINMUX_GPIO133__FUNC_SPIM0_CLK>;
+                       bias-disable;
+               };
+
+               pins-miso {
+                       pinmux = <PINMUX_GPIO135__FUNC_SPIM0_MI>;
+                       bias-pull-down;
+               };
+       };
+
+       subpmic_default: subpmic-default-pins {
+               subpmic_pin_irq: pins-subpmic-int-n {
+                       pinmux = <PINMUX_GPIO130__FUNC_GPIO130>;
+                       input-enable;
+                       bias-pull-up;
+               };
+       };
+
+       touchscreen_pins: touchscreen-default-pins {
+               pins-int-n {
+                       pinmux = <PINMUX_GPIO92__FUNC_GPIO92>;
+                       input-enable;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+               };
+               pins-rst {
+                       pinmux = <PINMUX_GPIO56__FUNC_GPIO56>;
+                       output-high;
+               };
+               pins-report-sw {
+                       pinmux = <PINMUX_GPIO57__FUNC_GPIO57>;
+                       output-low;
+               };
+       };
+};
+
+&pmic {
+       interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&spi0 {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pins>;
+       mediatek,pad-select = <0>;
+};
+
+&u3phy0 {
+       status = "okay";
+};
+
+&u3phy1 {
+       status = "okay";
+};
+
+&u3phy2 {
+       status = "okay";
+};
+
+&u3phy3 {
+       status = "okay";
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&xhci0 {
+       status = "okay";
+
+       vusb33-supply = <&mt6359_vusb_ldo_reg>;
+       vbus-supply = <&usb_vbus>;
+};
+
+&xhci1 {
+       status = "okay";
+
+       vusb33-supply = <&mt6359_vusb_ldo_reg>;
+       vbus-supply = <&usb_vbus>;
+};
+
+&xhci2 {
+       status = "okay";
+
+       vusb33-supply = <&mt6359_vusb_ldo_reg>;
+       vbus-supply = <&usb_vbus>;
+};
+
+&xhci3 {
+       status = "okay";
+
+       /* MT7921's USB Bluetooth has issues with USB2 LPM */
+       usb2-lpm-disable;
+       vusb33-supply = <&mt6359_vusb_ldo_reg>;
+       vbus-supply = <&usb_vbus>;
+};
index db25a51..690dc77 100644 (file)
 };
 
 &u3phy0 {
-       status="okay";
+       status = "okay";
 };
 
 &u3phy1 {
-       status="okay";
+       status = "okay";
 };
 
 &u3phy2 {
-       status="okay";
+       status = "okay";
 };
 
 &u3phy3 {
-       status="okay";
+       status = "okay";
 };
 
 &uart0 {
index b57e620..066c149 100644 (file)
@@ -10,7 +10,6 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/phy/phy.h>
 #include <dt-bindings/pinctrl/mt8195-pinfunc.h>
-#include <dt-bindings/reset/ti-syscon.h>
 
 / {
        compatible = "mediatek,mt8195";
                        compatible = "mediatek,mt8195-infracfg_ao", "syscon", "simple-mfd";
                        reg = <0 0x10001000 0 0x1000>;
                        #clock-cells = <1>;
-
-                       infracfg_rst: reset-controller {
-                               compatible = "ti,syscon-reset";
-                               #reset-cells = <1>;
-                               ti,reset-bits = <
-                                       0x140 18 0x144 18 0 0 (ASSERT_SET | DEASSERT_SET | STATUS_NONE) /* pcie */
-                                       0x120 0  0x124 0  0 0 (ASSERT_SET | DEASSERT_SET | STATUS_NONE) /* thermal */
-                                       0x730 10 0x734 10 0 0 (ASSERT_SET | DEASSERT_SET | STATUS_NONE) /* thermal */
-                                       0x150 5  0x154 5  0 0 (ASSERT_SET | DEASSERT_SET | STATUS_NONE) /* svs gpu */
-                               >;
-                       };
+                       #reset-cells = <1>;
                };
 
                pericfg: syscon@10003000 {
                                 <&apmixedsys CLK_APMIXED_USB1PLL>,
                                 <&infracfg_ao CLK_INFRA_AO_SSUSB_XHCI>;
                        clock-names = "sys_ck", "ref_ck", "mcu_ck", "xhci_ck";
+                       mediatek,syscon-wakeup = <&pericfg 0x400 103>;
+                       wakeup-source;
                        status = "disabled";
                };
 
                                 <&apmixedsys CLK_APMIXED_USB1PLL>,
                                 <&pericfg_ao CLK_PERI_AO_SSUSB_1P_XHCI>;
                        clock-names = "sys_ck", "ref_ck", "mcu_ck","xhci_ck";
+                       mediatek,syscon-wakeup = <&pericfg 0x400 104>;
+                       wakeup-source;
                        status = "disabled";
                };
 
                                 <&topckgen CLK_TOP_SSUSB_P2_REF>,
                                 <&pericfg_ao CLK_PERI_AO_SSUSB_2P_XHCI>;
                        clock-names = "sys_ck", "ref_ck", "xhci_ck";
+                       mediatek,syscon-wakeup = <&pericfg 0x400 105>;
+                       wakeup-source;
                        status = "disabled";
                };
 
                                 <&topckgen CLK_TOP_SSUSB_P3_REF>,
                                 <&pericfg_ao CLK_PERI_AO_SSUSB_3P_XHCI>;
                        clock-names = "sys_ck", "ref_ck", "xhci_ck";
+                       mediatek,syscon-wakeup = <&pericfg 0x400 106>;
+                       wakeup-source;
                        status = "disabled";
                };
 
                        status = "disabled";
                };
 
+               efuse: efuse@11c10000 {
+                       compatible = "mediatek,mt8195-efuse", "mediatek,efuse";
+                       reg = <0 0x11c10000 0 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       u3_tx_imp_p0: usb3-tx-imp@184,1 {
+                               reg = <0x184 0x1>;
+                               bits = <0 5>;
+                       };
+                       u3_rx_imp_p0: usb3-rx-imp@184,2 {
+                               reg = <0x184 0x2>;
+                               bits = <5 5>;
+                       };
+                       u3_intr_p0: usb3-intr@185 {
+                               reg = <0x185 0x1>;
+                               bits = <2 6>;
+                       };
+                       comb_tx_imp_p1: usb3-tx-imp@186,1 {
+                               reg = <0x186 0x1>;
+                               bits = <0 5>;
+                       };
+                       comb_rx_imp_p1: usb3-rx-imp@186,2 {
+                               reg = <0x186 0x2>;
+                               bits = <5 5>;
+                       };
+                       comb_intr_p1: usb3-intr@187 {
+                               reg = <0x187 0x1>;
+                               bits = <2 6>;
+                       };
+                       u2_intr_p0: usb2-intr-p0@188,1 {
+                               reg = <0x188 0x1>;
+                               bits = <0 5>;
+                       };
+                       u2_intr_p1: usb2-intr-p1@188,2 {
+                               reg = <0x188 0x2>;
+                               bits = <5 5>;
+                       };
+                       u2_intr_p2: usb2-intr-p2@189,1 {
+                               reg = <0x189 0x1>;
+                               bits = <2 5>;
+                       };
+                       u2_intr_p3: usb2-intr-p3@189,2 {
+                               reg = <0x189 0x2>;
+                               bits = <7 5>;
+                       };
+               };
+
                u3phy2: t-phy@11c40000 {
                        compatible = "mediatek,mt8195-tphy", "mediatek,generic-tphy-v3";
                        #address-cells = <1>;
                                clocks = <&apmixedsys CLK_APMIXED_PLL_SSUSB26M>,
                                         <&topckgen CLK_TOP_SSUSB_PHY_P1_REF>;
                                clock-names = "ref", "da_ref";
+                               nvmem-cells = <&comb_intr_p1>,
+                                             <&comb_rx_imp_p1>,
+                                             <&comb_tx_imp_p1>;
+                               nvmem-cell-names = "intr", "rx_imp", "tx_imp";
                                #phy-cells = <1>;
                        };
                };
                                clocks = <&apmixedsys CLK_APMIXED_PLL_SSUSB26M>,
                                         <&topckgen CLK_TOP_SSUSB_PHY_REF>;
                                clock-names = "ref", "da_ref";
+                               nvmem-cells = <&u3_intr_p0>,
+                                             <&u3_rx_imp_p0>,
+                                             <&u3_tx_imp_p0>;
+                               nvmem-cell-names = "intr", "rx_imp", "tx_imp";
                                #phy-cells = <1>;
                        };
                };
index 7a717f9..8ee1529 100644 (file)
@@ -28,7 +28,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_default>;
 
-               volume-up {
+               key-volume-up {
                        gpios = <&pio 42 GPIO_ACTIVE_LOW>;
                        label = "volume_up";
                        linux,code = <115>;
@@ -36,7 +36,7 @@
                        debounce-interval = <15>;
                };
 
-               volume-down {
+               key-volume-down {
                        gpios = <&pio 43 GPIO_ACTIVE_LOW>;
                        label = "volume_down";
                        linux,code = <114>;
index 699256f..bf12be5 100644 (file)
 
 &axi {
        sfp_eth12: sfp-eth12 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp1>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp1>;
                tx-disable-gpios = <&sgpio_out2 11 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 11 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 11 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 12 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 11 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 11 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 12 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth13: sfp-eth13 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp2>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp2>;
                tx-disable-gpios = <&sgpio_out2 12 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 12 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 12 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 13 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 12 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 12 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 13 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth14: sfp-eth14 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp3>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp3>;
                tx-disable-gpios = <&sgpio_out2 13 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 13 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 13 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 14 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 13 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 13 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 14 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth15: sfp-eth15 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp4>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp4>;
                tx-disable-gpios = <&sgpio_out2 14 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 14 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 14 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 15 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 14 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 14 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 15 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth48: sfp-eth48 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp5>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp5>;
                tx-disable-gpios = <&sgpio_out2 15 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 15 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 15 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 16 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 15 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 15 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 16 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth49: sfp-eth49 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp6>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp6>;
                tx-disable-gpios = <&sgpio_out2 16 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 16 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 16 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 17 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 16 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 16 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 17 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth50: sfp-eth50 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp7>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp7>;
                tx-disable-gpios = <&sgpio_out2 17 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 17 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 17 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 18 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 17 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 17 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 18 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth51: sfp-eth51 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp8>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp8>;
                tx-disable-gpios = <&sgpio_out2 18 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 18 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 18 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 19 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 18 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 18 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 19 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth52: sfp-eth52 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp9>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp9>;
                tx-disable-gpios = <&sgpio_out2 19 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 19 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 19 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 20 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 19 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 19 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 20 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth53: sfp-eth53 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp10>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp10>;
                tx-disable-gpios = <&sgpio_out2 20 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 20 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 20 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 21 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 20 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 20 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 21 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth54: sfp-eth54 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp11>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp11>;
                tx-disable-gpios = <&sgpio_out2 21 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 21 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 21 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 22 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 21 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 21 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 22 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth55: sfp-eth55 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp12>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp12>;
                tx-disable-gpios = <&sgpio_out2 22 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 22 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 22 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 23 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 22 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 22 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 23 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth56: sfp-eth56 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp13>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp13>;
                tx-disable-gpios = <&sgpio_out2 23 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 23 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 23 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 24 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 23 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 23 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 24 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth57: sfp-eth57 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp14>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp14>;
                tx-disable-gpios = <&sgpio_out2 24 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 24 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 24 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 25 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 24 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 24 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 25 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth58: sfp-eth58 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp15>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp15>;
                tx-disable-gpios = <&sgpio_out2 25 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 25 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 25 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 26 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 25 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 25 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 26 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth59: sfp-eth59 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp16>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp16>;
                tx-disable-gpios = <&sgpio_out2 26 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 26 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 26 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 27 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 26 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 26 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 27 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth60: sfp-eth60 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp17>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp17>;
                tx-disable-gpios = <&sgpio_out2 27 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 27 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 27 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 28 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 27 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 27 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 28 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth61: sfp-eth61 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp18>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp18>;
                tx-disable-gpios = <&sgpio_out2 28 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 28 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 28 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 29 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 28 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 28 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 29 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth62: sfp-eth62 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp19>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp19>;
                tx-disable-gpios = <&sgpio_out2 29 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 29 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 29 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 30 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 29 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 29 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 30 0 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth63: sfp-eth63 {
-               compatible       = "sff,sfp";
-               i2c-bus          = <&i2c_sfp20>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp20>;
                tx-disable-gpios = <&sgpio_out2 30 1 GPIO_ACTIVE_LOW>;
-               los-gpios        = <&sgpio_in2 30 1 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios   = <&sgpio_in2 30 2 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios   = <&sgpio_in2 31 0 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 30 1 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 30 2 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 31 0 GPIO_ACTIVE_HIGH>;
        };
 };
 
index d10a917..ec90bda 100644 (file)
 
 &axi {
        sfp_eth60: sfp-eth60 {
-               compatible         = "sff,sfp";
-               i2c-bus            = <&i2c_sfp1>;
-               tx-disable-gpios   = <&sgpio_out2 28 0 GPIO_ACTIVE_LOW>;
+               compatible       = "sff,sfp";
+               i2c-bus = <&i2c_sfp1>;
+               tx-disable-gpios = <&sgpio_out2 28 0 GPIO_ACTIVE_LOW>;
                rate-select0-gpios = <&sgpio_out2 28 1 GPIO_ACTIVE_HIGH>;
-               los-gpios          = <&sgpio_in2 28 0 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios     = <&sgpio_in2 28 1 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios     = <&sgpio_in2 28 2 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 28 0 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 28 1 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 28 2 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth61: sfp-eth61 {
-               compatible         = "sff,sfp";
-               i2c-bus            = <&i2c_sfp2>;
-               tx-disable-gpios   = <&sgpio_out2 29 0 GPIO_ACTIVE_LOW>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp2>;
+               tx-disable-gpios = <&sgpio_out2 29 0 GPIO_ACTIVE_LOW>;
                rate-select0-gpios = <&sgpio_out2 29 1 GPIO_ACTIVE_HIGH>;
-               los-gpios          = <&sgpio_in2 29 0 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios     = <&sgpio_in2 29 1 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios     = <&sgpio_in2 29 2 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 29 0 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 29 1 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 29 2 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth62: sfp-eth62 {
-               compatible         = "sff,sfp";
-               i2c-bus            = <&i2c_sfp3>;
-               tx-disable-gpios   = <&sgpio_out2 30 0 GPIO_ACTIVE_LOW>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp3>;
+               tx-disable-gpios = <&sgpio_out2 30 0 GPIO_ACTIVE_LOW>;
                rate-select0-gpios = <&sgpio_out2 30 1 GPIO_ACTIVE_HIGH>;
-               los-gpios          = <&sgpio_in2 30 0 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios     = <&sgpio_in2 30 1 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios     = <&sgpio_in2 30 2 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 30 0 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 30 1 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 30 2 GPIO_ACTIVE_HIGH>;
        };
        sfp_eth63: sfp-eth63 {
-               compatible         = "sff,sfp";
-               i2c-bus            = <&i2c_sfp4>;
-               tx-disable-gpios   = <&sgpio_out2 31 0 GPIO_ACTIVE_LOW>;
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c_sfp4>;
+               tx-disable-gpios = <&sgpio_out2 31 0 GPIO_ACTIVE_LOW>;
                rate-select0-gpios = <&sgpio_out2 31 1 GPIO_ACTIVE_HIGH>;
-               los-gpios          = <&sgpio_in2 31 0 GPIO_ACTIVE_HIGH>;
-               mod-def0-gpios     = <&sgpio_in2 31 1 GPIO_ACTIVE_LOW>;
-               tx-fault-gpios     = <&sgpio_in2 31 2 GPIO_ACTIVE_HIGH>;
+               los-gpios = <&sgpio_in2 31 0 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in2 31 1 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in2 31 2 GPIO_ACTIVE_HIGH>;
        };
 };
 
index f16acb4..d461da0 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               lid {
+               switch-lid {
                        label = "Lid";
                        gpios = <&gpio TEGRA_GPIO(R, 4) GPIO_ACTIVE_LOW>;
                        linux,input-type = <5>;
                        wakeup-source;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 70737a0..47cf201 100644 (file)
                                                remote-endpoint = <&asrc_in7_ep>;
                                        };
                                };
+
+                               xbar_ope1_in_port: port@70 {
+                                       reg = <0x70>;
+
+                                       xbar_ope1_in_ep: endpoint {
+                                               remote-endpoint = <&ope1_cif_in_ep>;
+                                       };
+                               };
+
+                               port@71 {
+                                       reg = <0x71>;
+
+                                       xbar_ope1_out_ep: endpoint {
+                                               remote-endpoint = <&ope1_cif_out_ep>;
+                                       };
+                               };
                        };
 
                        admaif@290f000 {
                                };
                        };
 
+                       processing-engine@2908000 {
+                               status = "okay";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0x0>;
+
+                                               ope1_cif_in_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope1_in_ep>;
+                                               };
+                                       };
+
+                                       ope1_out_port: port@1 {
+                                               reg = <0x1>;
+
+                                               ope1_cif_out_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope1_out_ep>;
+                                               };
+                                       };
+                               };
+                       };
+
                        amixer@290bb00 {
                                status = "okay";
 
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio_aon TEGRA186_AON_GPIO(FF, 0)
                                           GPIO_ACTIVE_LOW>;
                        wakeup-source;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio_aon TEGRA186_AON_GPIO(FF, 1)
                                           GPIO_ACTIVE_LOW>;
                        debounce-interval = <10>;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio_aon TEGRA186_AON_GPIO(FF, 2)
                                           GPIO_ACTIVE_LOW>;
                       <&xbar_asrc_in3_port>, <&xbar_asrc_in4_port>,
                       <&xbar_asrc_in5_port>, <&xbar_asrc_in6_port>,
                       <&xbar_asrc_in7_port>,
+                      <&xbar_ope1_in_port>,
                       /* HW accelerators */
                       <&sfc1_out_port>, <&sfc2_out_port>,
                       <&sfc3_out_port>, <&sfc4_out_port>,
                       <&mixer_out5_port>,
                       <&asrc_out1_port>, <&asrc_out2_port>, <&asrc_out3_port>,
                       <&asrc_out4_port>, <&asrc_out5_port>, <&asrc_out6_port>,
+                      <&ope1_out_port>,
                       /* I/O */
                       <&i2s1_port>, <&i2s2_port>, <&i2s3_port>, <&i2s4_port>,
                       <&i2s5_port>, <&i2s6_port>, <&dmic1_port>, <&dmic2_port>,
index 7e9aad9..3e83a4d 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio_aon TEGRA186_AON_GPIO(FF, 0)
                                           GPIO_ACTIVE_LOW>;
                        wakeup-source;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio_aon TEGRA186_AON_GPIO(FF, 1)
                                           GPIO_ACTIVE_LOW>;
                        debounce-interval = <10>;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio_aon TEGRA186_AON_GPIO(FF, 2)
                                           GPIO_ACTIVE_LOW>;
index 0e9afc3..59a10fb 100644 (file)
                                status = "disabled";
                        };
 
+                       tegra_ope1: processing-engine@2908000 {
+                               compatible = "nvidia,tegra186-ope",
+                                            "nvidia,tegra210-ope";
+                               reg = <0x2908000 0x100>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges;
+                               sound-name-prefix = "OPE1";
+                               status = "disabled";
+
+                               equalizer@2908100 {
+                                       compatible = "nvidia,tegra186-peq",
+                                                    "nvidia,tegra210-peq";
+                                       reg = <0x2908100 0x100>;
+                               };
+
+                               dynamic-range-compressor@2908200 {
+                                       compatible = "nvidia,tegra186-mbdrc",
+                                                    "nvidia,tegra210-mbdrc";
+                                       reg = <0x2908200 0x200>;
+                               };
+                       };
+
                        tegra_amixer: amixer@290bb00 {
                                compatible = "nvidia,tegra186-amixer",
                                             "nvidia,tegra210-amixer";
                             <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-               status = "disabled";
+               status = "okay";
        };
 
        uarta: serial@3100000 {
 
                iommus = <&smmu TEGRA186_SID_HOST1X>;
 
+               /* Context isolation domains */
+               iommu-map = <
+                       0 &smmu TEGRA186_SID_HOST1X_CTX0 1
+                       1 &smmu TEGRA186_SID_HOST1X_CTX1 1
+                       2 &smmu TEGRA186_SID_HOST1X_CTX2 1
+                       3 &smmu TEGRA186_SID_HOST1X_CTX3 1
+                       4 &smmu TEGRA186_SID_HOST1X_CTX4 1
+                       5 &smmu TEGRA186_SID_HOST1X_CTX5 1
+                       6 &smmu TEGRA186_SID_HOST1X_CTX6 1
+                       7 &smmu TEGRA186_SID_HOST1X_CTX7 1>;
+
                dpaux1: dpaux@15040000 {
                        compatible = "nvidia,tegra186-dpaux";
                        reg = <0x15040000 0x10000>;
                #address-cells = <1>;
                #size-cells = <1>;
                ranges = <0x0 0x0 0x30000000 0x50000>;
+               no-memory-wc;
 
                cpu_bpmp_tx: sram@4e000 {
                        reg = <0x4e000 0x1000>;
index a7d7cfd..b0f9393 100644 (file)
@@ -75,7 +75,7 @@
 
                /* SDMMC1 (SD/MMC) */
                mmc@3400000 {
-                       cd-gpios = <&gpio TEGRA194_MAIN_GPIO(A, 0) GPIO_ACTIVE_LOW>;
+                       cd-gpios = <&gpio TEGRA194_MAIN_GPIO(G, 7) GPIO_ACTIVE_LOW>;
                };
 
                /* SDMMC4 (eMMC) */
index bce518a..bc1041d 100644 (file)
                                                        remote-endpoint = <&asrc_in7_ep>;
                                                };
                                        };
+
+                                       xbar_ope1_in_port: port@70 {
+                                               reg = <0x70>;
+
+                                               xbar_ope1_in_ep: endpoint {
+                                                       remote-endpoint = <&ope1_cif_in_ep>;
+                                               };
+                                       };
+
+                                       port@71 {
+                                               reg = <0x71>;
+
+                                               xbar_ope1_out_ep: endpoint {
+                                                       remote-endpoint = <&ope1_cif_out_ep>;
+                                               };
+                                       };
                                };
 
                                admaif@290f000 {
                                        };
                                };
 
+                               processing-engine@2908000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0x0>;
+
+                                                       ope1_cif_in_ep: endpoint {
+                                                               remote-endpoint = <&xbar_ope1_in_ep>;
+                                                       };
+                                               };
+
+                                               ope1_out_port: port@1 {
+                                                       reg = <0x1>;
+
+                                                       ope1_cif_out_ep: endpoint {
+                                                               remote-endpoint = <&xbar_ope1_out_ep>;
+                                                       };
+                                               };
+                                       };
+                               };
+
                                amixer@290bb00 {
                                        status = "okay";
 
        gpio-keys {
                compatible = "gpio-keys";
 
-               force-recovery {
+               key-force-recovery {
                        label = "Force Recovery";
                        gpios = <&gpio TEGRA194_MAIN_GPIO(G, 0)
                                       GPIO_ACTIVE_LOW>;
                        debounce-interval = <10>;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio_aon TEGRA194_AON_GPIO(EE, 4)
                                           GPIO_ACTIVE_LOW>;
                       <&xbar_asrc_in3_port>, <&xbar_asrc_in4_port>,
                       <&xbar_asrc_in5_port>, <&xbar_asrc_in6_port>,
                       <&xbar_asrc_in7_port>,
+                      <&xbar_ope1_in_port>,
                       /* HW accelerators */
                       <&sfc1_out_port>, <&sfc2_out_port>,
                       <&sfc3_out_port>, <&sfc4_out_port>,
                       <&mixer_out4_port>, <&mixer_out5_port>,
                       <&asrc_out1_port>, <&asrc_out2_port>, <&asrc_out3_port>,
                       <&asrc_out4_port>, <&asrc_out5_port>, <&asrc_out6_port>,
+                      <&ope1_out_port>,
                       /* BE I/O Ports */
                       <&i2s1_port>, <&i2s2_port>, <&i2s4_port>, <&i2s6_port>,
                       <&dmic3_port>;
index 7acc32d..273a1ef 100644 (file)
                                                        remote-endpoint = <&asrc_in7_ep>;
                                                };
                                        };
+
+                                       xbar_ope1_in_port: port@70 {
+                                               reg = <0x70>;
+
+                                               xbar_ope1_in_ep: endpoint {
+                                                       remote-endpoint = <&ope1_cif_in_ep>;
+                                               };
+                                       };
+
+                                       port@71 {
+                                               reg = <0x71>;
+
+                                               xbar_ope1_out_ep: endpoint {
+                                                       remote-endpoint = <&ope1_cif_out_ep>;
+                                               };
+                                       };
                                };
 
                                admaif@290f000 {
                                        };
                                };
 
+                               processing-engine@2908000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0x0>;
+
+                                                       ope1_cif_in_ep: endpoint {
+                                                               remote-endpoint = <&xbar_ope1_in_ep>;
+                                                       };
+                                               };
+
+                                               ope1_out_port: port@1 {
+                                                       reg = <0x1>;
+
+                                                       ope1_cif_out_ep: endpoint {
+                                                               remote-endpoint = <&xbar_ope1_out_ep>;
+                                                       };
+                                               };
+                                       };
+                               };
+
                                amixer@290bb00 {
                                        status = "okay";
 
        gpio-keys {
                compatible = "gpio-keys";
 
-               force-recovery {
+               key-force-recovery {
                        label = "Force Recovery";
                        gpios = <&gpio TEGRA194_MAIN_GPIO(G, 0)
                                       GPIO_ACTIVE_LOW>;
                        debounce-interval = <10>;
                };
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio_aon TEGRA194_AON_GPIO(EE, 4)
                                           GPIO_ACTIVE_LOW>;
                       <&xbar_asrc_in3_port>, <&xbar_asrc_in4_port>,
                       <&xbar_asrc_in5_port>, <&xbar_asrc_in6_port>,
                       <&xbar_asrc_in7_port>,
+                      <&xbar_ope1_in_port>,
                       /* HW accelerators */
                       <&sfc1_out_port>, <&sfc2_out_port>,
                       <&sfc3_out_port>, <&sfc4_out_port>,
                       <&mixer_out5_port>,
                       <&asrc_out1_port>, <&asrc_out2_port>, <&asrc_out3_port>,
                       <&asrc_out4_port>, <&asrc_out5_port>, <&asrc_out6_port>,
+                      <&ope1_out_port>,
                       /* BE I/O Ports */
                       <&i2s3_port>, <&i2s5_port>,
                       <&dmic1_port>, <&dmic2_port>, <&dmic4_port>,
index d1f8248..d0ed55e 100644 (file)
@@ -23,7 +23,7 @@
                #size-cells = <1>;
                ranges = <0x0 0x0 0x0 0x40000000>;
 
-               misc@100000 {
+               apbmisc: misc@100000 {
                        compatible = "nvidia,tegra194-misc";
                        reg = <0x00100000 0xf000>,
                              <0x0010f000 0x1000>;
                        gpio-controller;
                };
 
+               cbb-noc@2300000 {
+                       compatible = "nvidia,tegra194-cbb-noc";
+                       reg = <0x02300000 0x1000>;
+                       interrupts = <GIC_SPI 230 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>;
+                       nvidia,axi2apb = <&axi2apb>;
+                       nvidia,apbmisc = <&apbmisc>;
+                       status = "okay";
+               };
+
+               axi2apb: axi2apb@2390000 {
+                       compatible = "nvidia,tegra194-axi2apb";
+                       reg = <0x2390000 0x1000>,
+                             <0x23a0000 0x1000>,
+                             <0x23b0000 0x1000>,
+                             <0x23c0000 0x1000>,
+                             <0x23d0000 0x1000>,
+                             <0x23e0000 0x1000>;
+                       status = "okay";
+               };
+
                ethernet@2490000 {
                        compatible = "nvidia,tegra194-eqos",
                                     "nvidia,tegra186-eqos",
                                        status = "disabled";
                                };
 
+                               tegra_ope1: processing-engine@2908000 {
+                                       compatible = "nvidia,tegra194-ope",
+                                                    "nvidia,tegra210-ope";
+                                       reg = <0x2908000 0x100>;
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+                                       ranges;
+                                       sound-name-prefix = "OPE1";
+                                       status = "disabled";
+
+                                       equalizer@2908100 {
+                                               compatible = "nvidia,tegra194-peq",
+                                                            "nvidia,tegra210-peq";
+                                               reg = <0x2908100 0x100>;
+                                       };
+
+                                       dynamic-range-compressor@2908200 {
+                                               compatible = "nvidia,tegra194-mbdrc",
+                                                            "nvidia,tegra210-mbdrc";
+                                               reg = <0x2908200 0x200>;
+                                       };
+                               };
+
                                tegra_amixer: amixer@290bb00 {
                                        compatible = "nvidia,tegra194-amixer",
                                                     "nvidia,tegra210-amixer";
                        };
                };
 
+               timer@3010000 {
+                       compatible = "nvidia,tegra186-timer";
+                       reg = <0x03010000 0x000e0000>;
+                       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>;
+                       status = "okay";
+               };
+
                uarta: serial@3100000 {
                        compatible = "nvidia,tegra194-uart", "nvidia,tegra20-uart";
                        reg = <0x03100000 0x40>;
                        #phy-cells = <0>;
                };
 
+               sce-noc@b600000 {
+                       compatible = "nvidia,tegra194-sce-noc";
+                       reg = <0xb600000 0x1000>;
+                       interrupts = <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
+                       nvidia,axi2apb = <&axi2apb>;
+                       nvidia,apbmisc = <&apbmisc>;
+                       status = "okay";
+               };
+
+               rce-noc@be00000 {
+                       compatible = "nvidia,tegra194-rce-noc";
+                       reg = <0xbe00000 0x1000>;
+                       interrupts = <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
+                       nvidia,axi2apb = <&axi2apb>;
+                       nvidia,apbmisc = <&apbmisc>;
+                       status = "okay";
+               };
+
                hsp_aon: hsp@c150000 {
                        compatible = "nvidia,tegra194-hsp";
                        reg = <0x0c150000 0x90000>;
 
                };
 
+               aon-noc@c600000 {
+                       compatible = "nvidia,tegra194-aon-noc";
+                       reg = <0xc600000 0x1000>;
+                       interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>;
+                       nvidia,apbmisc = <&apbmisc>;
+                       status = "okay";
+               };
+
+               bpmp-noc@d600000 {
+                       compatible = "nvidia,tegra194-bpmp-noc";
+                       reg = <0xd600000 0x1000>;
+                       interrupts = <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+                       nvidia,axi2apb = <&axi2apb>;
+                       nvidia,apbmisc = <&apbmisc>;
+                       status = "okay";
+               };
+
                iommu@10000000 {
                        compatible = "nvidia,tegra194-smmu", "nvidia,smmu-500";
                        reg = <0x10000000 0x800000>;
                        interconnect-names = "dma-mem";
                        iommus = <&smmu TEGRA194_SID_HOST1X>;
 
+                       /* Context isolation domains */
+                       iommu-map = <
+                               0 &smmu TEGRA194_SID_HOST1X_CTX0 1
+                               1 &smmu TEGRA194_SID_HOST1X_CTX1 1
+                               2 &smmu TEGRA194_SID_HOST1X_CTX2 1
+                               3 &smmu TEGRA194_SID_HOST1X_CTX3 1
+                               4 &smmu TEGRA194_SID_HOST1X_CTX4 1
+                               5 &smmu TEGRA194_SID_HOST1X_CTX5 1
+                               6 &smmu TEGRA194_SID_HOST1X_CTX6 1
+                               7 &smmu TEGRA194_SID_HOST1X_CTX7 1>;
+
                        nvdec@15140000 {
                                compatible = "nvidia,tegra194-nvdec";
                                reg = <0x15140000 0x00040000>;
                #address-cells = <1>;
                #size-cells = <1>;
                ranges = <0x0 0x0 0x40000000 0x50000>;
+               no-memory-wc;
 
                cpu_bpmp_tx: sram@4e000 {
                        reg = <0x4e000 0x1000>;
index 328fbfe..1e26ca9 100644 (file)
                                };
                        };
 
+                       processing-engine@702d8000 {
+                               status = "okay";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0x0>;
+
+                                               ope1_cif_in_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope1_in_ep>;
+                                               };
+                                       };
+
+                                       ope1_out_port: port@1 {
+                                               reg = <0x1>;
+
+                                               ope1_cif_out_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope1_out_ep>;
+                                               };
+                                       };
+                               };
+                       };
+
+                       processing-engine@702d8400 {
+                               status = "okay";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0x0>;
+
+                                               ope2_cif_in_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope2_in_ep>;
+                                               };
+                                       };
+
+                                       ope2_out_port: port@1 {
+                                               reg = <0x1>;
+
+                                               ope2_cif_out_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope2_out_ep>;
+                                               };
+                                       };
+                               };
+                       };
+
                        amixer@702dbb00 {
                                status = "okay";
 
                                                remote-endpoint = <&mixer_out5_ep>;
                                        };
                                };
+
+                               xbar_ope1_in_port: port@41 {
+                                       reg = <0x41>;
+
+                                       xbar_ope1_in_ep: endpoint {
+                                               remote-endpoint = <&ope1_cif_in_ep>;
+                                       };
+                               };
+
+                               port@42 {
+                                       reg = <0x42>;
+
+                                       xbar_ope1_out_ep: endpoint {
+                                               remote-endpoint = <&ope1_cif_out_ep>;
+                                       };
+                               };
+
+                               xbar_ope2_in_port: port@43 {
+                                       reg = <0x43>;
+
+                                       xbar_ope2_in_ep: endpoint {
+                                               remote-endpoint = <&ope2_cif_in_ep>;
+                                       };
+                               };
+
+                               port@44 {
+                                       reg = <0x44>;
+
+                                       xbar_ope2_out_ep: endpoint {
+                                               remote-endpoint = <&ope2_cif_out_ep>;
+                                       };
+                               };
                        };
                };
        };
                       <&xbar_mixer_in5_port>, <&xbar_mixer_in6_port>,
                       <&xbar_mixer_in7_port>, <&xbar_mixer_in8_port>,
                       <&xbar_mixer_in9_port>, <&xbar_mixer_in10_port>,
+                      <&xbar_ope1_in_port>, <&xbar_ope2_in_port>,
                       /* HW accelerators */
                       <&sfc1_out_port>, <&sfc2_out_port>,
                       <&sfc3_out_port>, <&sfc4_out_port>,
                       <&mixer_out1_port>, <&mixer_out2_port>,
                       <&mixer_out3_port>, <&mixer_out4_port>,
                       <&mixer_out5_port>,
+                      <&ope1_out_port>, <&ope2_out_port>,
                       /* I/O DAP Ports */
                       <&i2s1_port>, <&i2s2_port>, <&i2s3_port>, <&i2s4_port>,
                       <&i2s5_port>, <&dmic1_port>, <&dmic2_port>, <&dmic3_port>;
index 4b43b89..a44c56c 100644 (file)
                compatible = "gpio-keys";
                label = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               volume_down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(Y, 0) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               volume_up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(X, 6) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 10347b6..8e657b1 100644 (file)
                compatible = "gpio-keys";
                status = "okay";
 
-               power {
+               key-power {
                        debounce-interval = <30>;
                        gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;
                        label = "Power";
index 746bd52..37678c3 100644 (file)
                                };
                        };
 
+                       processing-engine@702d8000 {
+                               status = "okay";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0x0>;
+
+                                               ope1_cif_in_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope1_in_ep>;
+                                               };
+                                       };
+
+                                       ope1_out_port: port@1 {
+                                               reg = <0x1>;
+
+                                               ope1_cif_out_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope1_out_ep>;
+                                               };
+                                       };
+                               };
+                       };
+
+                       processing-engine@702d8400 {
+                               status = "okay";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0x0>;
+
+                                               ope2_cif_in_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope2_in_ep>;
+                                               };
+                                       };
+
+                                       ope2_out_port: port@1 {
+                                               reg = <0x1>;
+
+                                               ope2_cif_out_ep: endpoint {
+                                                       remote-endpoint = <&xbar_ope2_out_ep>;
+                                               };
+                                       };
+                               };
+                       };
+
                        amixer@702dbb00 {
                                status = "okay";
 
                                                remote-endpoint = <&mixer_out5_ep>;
                                        };
                                };
+
+                               xbar_ope1_in_port: port@41 {
+                                       reg = <0x41>;
+
+                                       xbar_ope1_in_ep: endpoint {
+                                               remote-endpoint = <&ope1_cif_in_ep>;
+                                       };
+                               };
+
+                               port@42 {
+                                       reg = <0x42>;
+
+                                       xbar_ope1_out_ep: endpoint {
+                                               remote-endpoint = <&ope1_cif_out_ep>;
+                                       };
+                               };
+
+                               xbar_ope2_in_port: port@43 {
+                                       reg = <0x43>;
+
+                                       xbar_ope2_in_ep: endpoint {
+                                               remote-endpoint = <&ope2_cif_in_ep>;
+                                       };
+                               };
+
+                               port@44 {
+                                       reg = <0x44>;
+
+                                       xbar_ope2_out_ep: endpoint {
+                                               remote-endpoint = <&ope2_cif_out_ep>;
+                                       };
+                               };
                        };
                };
        };
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                        wakeup-source;
                };
 
-               force-recovery {
+               key-force-recovery {
                        label = "Force Recovery";
                        gpios = <&gpio TEGRA_GPIO(X, 6) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                       <&xbar_mixer_in5_port>, <&xbar_mixer_in6_port>,
                       <&xbar_mixer_in7_port>, <&xbar_mixer_in8_port>,
                       <&xbar_mixer_in9_port>, <&xbar_mixer_in10_port>,
+                      <&xbar_ope1_in_port>, <&xbar_ope2_in_port>,
                       /* HW accelerators */
                       <&sfc1_out_port>, <&sfc2_out_port>,
                       <&sfc3_out_port>, <&sfc4_out_port>,
                       <&mixer_out1_port>, <&mixer_out2_port>,
                       <&mixer_out3_port>, <&mixer_out4_port>,
                       <&mixer_out5_port>,
+                      <&ope1_out_port>, <&ope2_out_port>,
                       /* I/O DAP Ports */
                       <&i2s3_port>, <&i2s4_port>,
                       <&dmic1_port>, <&dmic2_port>;
index a263d51..5f3a1c5 100644 (file)
        gpio-keys {
                compatible = "gpio-keys";
 
-               power {
+               key-power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        wakeup-source;
                };
 
-               lid {
+               switch-lid {
                        label = "Lid";
                        gpios = <&gpio TEGRA_GPIO(B, 4) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                        wakeup-source;
                };
 
-               tablet_mode {
+               switch-tablet-mode {
                        label = "Tablet Mode";
                        gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
                        linux,input-type = <EV_SW>;
                        wakeup-source;
                };
 
-               volume_down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               volume_up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&gpio TEGRA_GPIO(M, 4) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 4f0e51f..724e874 100644 (file)
                interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
                resets = <&tegra_car 142>;
                reset-names = "padctl";
-               nvidia,pmc =  <&tegra_pmc>;
+               nvidia,pmc = <&tegra_pmc>;
 
                status = "disabled";
 
                                status = "disabled";
                        };
 
+                       tegra_ope1: processing-engine@702d8000 {
+                               compatible = "nvidia,tegra210-ope";
+                               reg = <0x702d8000 0x100>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges;
+                               sound-name-prefix = "OPE1";
+                               status = "disabled";
+
+                               equalizer@702d8100 {
+                                       compatible = "nvidia,tegra210-peq";
+                                       reg = <0x702d8100 0x100>;
+                               };
+
+                               dynamic-range-compressor@702d8200 {
+                                       compatible = "nvidia,tegra210-mbdrc";
+                                       reg = <0x702d8200 0x200>;
+                               };
+                       };
+
+                       tegra_ope2: processing-engine@702d8400 {
+                               compatible = "nvidia,tegra210-ope";
+                               reg = <0x702d8400 0x100>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               ranges;
+                               sound-name-prefix = "OPE2";
+                               status = "disabled";
+
+                               equalizer@702d8500 {
+                                       compatible = "nvidia,tegra210-peq";
+                                       reg = <0x702d8500 0x100>;
+                               };
+
+                               dynamic-range-compressor@702d8600 {
+                                       compatible = "nvidia,tegra210-mbdrc";
+                                       reg = <0x702d8600 0x200>;
+                               };
+                       };
+
                        tegra_amixer: amixer@702dbb00 {
                                compatible = "nvidia,tegra210-amixer";
                                reg = <0x702dbb00 0x800>;
index eaf1994..02a10bb 100644 (file)
                                                        remote-endpoint = <&asrc_in7_ep>;
                                                };
                                        };
+
+                                       xbar_ope1_in_port: port@70 {
+                                               reg = <0x70>;
+
+                                               xbar_ope1_in_ep: endpoint {
+                                                       remote-endpoint = <&ope1_cif_in_ep>;
+                                               };
+                                       };
+
+                                       port@71 {
+                                               reg = <0x71>;
+
+                                               xbar_ope1_out_ep: endpoint {
+                                                       remote-endpoint = <&ope1_cif_out_ep>;
+                                               };
+                                       };
                                };
 
                                i2s@2901000 {
                                        };
                                };
 
+                               processing-engine@2908000 {
+                                       status = "okay";
+
+                                       ports {
+                                               #address-cells = <1>;
+                                               #size-cells = <0>;
+
+                                               port@0 {
+                                                       reg = <0x0>;
+
+                                                       ope1_cif_in_ep: endpoint {
+                                                               remote-endpoint = <&xbar_ope1_in_ep>;
+                                                       };
+                                               };
+
+                                               ope1_out_port: port@1 {
+                                                       reg = <0x1>;
+
+                                                       ope1_cif_out_ep: endpoint {
+                                                               remote-endpoint = <&xbar_ope1_out_ep>;
+                                                       };
+                                               };
+                                       };
+                               };
+
                                mvc@290a000 {
                                        status = "okay";
 
                compatible = "gpio-keys";
                status = "okay";
 
-               force-recovery {
+               key-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 {
+               key-power {
                        label = "Power";
                        gpios = <&gpio_aon TEGRA234_AON_GPIO(EE, 4) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                        wakeup-source;
                };
 
-               suspend {
+               key-suspend {
                        label = "Suspend";
                        gpios = <&gpio TEGRA234_MAIN_GPIO(G, 2) GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                       <&xbar_asrc_in3_port>, <&xbar_asrc_in4_port>,
                       <&xbar_asrc_in5_port>, <&xbar_asrc_in6_port>,
                       <&xbar_asrc_in7_port>,
+                      <&xbar_ope1_in_port>,
                       /* HW accelerators */
                       <&sfc1_out_port>, <&sfc2_out_port>,
                       <&sfc3_out_port>, <&sfc4_out_port>,
                       <&mix_out4_port>, <&mix_out5_port>,
                       <&asrc_out1_port>, <&asrc_out2_port>, <&asrc_out3_port>,
                       <&asrc_out4_port>, <&asrc_out5_port>, <&asrc_out6_port>,
+                      <&ope1_out_port>,
                       /* BE I/O Ports */
                       <&i2s1_port>, <&i2s2_port>, <&i2s4_port>, <&i2s6_port>,
                       <&dmic3_port>;
index cb3af53..81a0f59 100644 (file)
 
                ranges = <0x0 0x0 0x0 0x40000000>;
 
+               gpcdma: dma-controller@2600000 {
+                       compatible = "nvidia,tegra234-gpcdma",
+                                    "nvidia,tegra194-gpcdma",
+                                    "nvidia,tegra186-gpcdma";
+                       reg = <0x2600000 0x210000>;
+                       resets = <&bpmp TEGRA234_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_niso0 TEGRA234_SID_GPCDMA>;
+                       dma-coherent;
+               };
+
                aconnect@2900000 {
                        compatible = "nvidia,tegra234-aconnect",
                                     "nvidia,tegra210-aconnect";
                                        status = "disabled";
                                };
 
+                               tegra_ope1: processing-engine@2908000 {
+                                       compatible = "nvidia,tegra234-ope",
+                                                    "nvidia,tegra210-ope";
+                                       reg = <0x2908000 0x100>;
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+                                       ranges;
+                                       sound-name-prefix = "OPE1";
+                                       status = "disabled";
+
+                                       equalizer@2908100 {
+                                               compatible = "nvidia,tegra234-peq",
+                                                            "nvidia,tegra210-peq";
+                                               reg = <0x2908100 0x100>;
+                                       };
+
+                                       dynamic-range-compressor@2908200 {
+                                               compatible = "nvidia,tegra234-mbdrc",
+                                                            "nvidia,tegra210-mbdrc";
+                                               reg = <0x2908200 0x200>;
+                                       };
+                               };
+
                                tegra_mvc1: mvc@290a000 {
                                        compatible = "nvidia,tegra234-mvc",
                                                     "nvidia,tegra210-mvc";
                        status = "okay";
                };
 
+               timer@2080000 {
+                       compatible = "nvidia,tegra234-timer";
+                       reg = <0x02080000 0x00121000>;
+                       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>;
+                       status = "okay";
+               };
+
+               host1x@13e00000 {
+                       compatible = "nvidia,tegra234-host1x";
+                       reg = <0x13e00000 0x10000>,
+                             <0x13e10000 0x10000>,
+                             <0x13e40000 0x10000>;
+                       reg-names = "common", "hypervisor", "vm";
+                       interrupts = <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 449 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 450 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 453 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 454 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 455 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "syncpt0", "syncpt1", "syncpt2", "syncpt3", "syncpt4",
+                                         "syncpt5", "syncpt6", "syncpt7", "host1x";
+                       clocks = <&bpmp TEGRA234_CLK_HOST1X>;
+                       clock-names = "host1x";
+
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       ranges = <0x15000000 0x15000000 0x01000000>;
+                       interconnects = <&mc TEGRA234_MEMORY_CLIENT_HOST1XDMAR &emc>;
+                       interconnect-names = "dma-mem";
+                       iommus = <&smmu_niso1 TEGRA234_SID_HOST1X>;
+
+                       vic@15340000 {
+                               compatible = "nvidia,tegra234-vic";
+                               reg = <0x15340000 0x00040000>;
+                               interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&bpmp TEGRA234_CLK_VIC>;
+                               clock-names = "vic";
+                               resets = <&bpmp TEGRA234_RESET_VIC>;
+                               reset-names = "vic";
+
+                               power-domains = <&bpmp TEGRA234_POWER_DOMAIN_VIC>;
+                               interconnects = <&mc TEGRA234_MEMORY_CLIENT_VICSRD &emc>,
+                                               <&mc TEGRA234_MEMORY_CLIENT_VICSWR &emc>;
+                               interconnect-names = "dma-mem", "write";
+                               iommus = <&smmu_niso1 TEGRA234_SID_VIC>;
+                               dma-coherent;
+                       };
+               };
+
                gpio: gpio@2200000 {
                        compatible = "nvidia,tegra234-gpio";
                        reg-names = "security", "gpio";
                        status = "okay";
                };
 
+               sce-fabric@b600000 {
+                       compatible = "nvidia,tegra234-sce-fabric";
+                       reg = <0xb600000 0x40000>;
+                       interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "okay";
+               };
+
+               rce-fabric@be00000 {
+                       compatible = "nvidia,tegra234-rce-fabric";
+                       reg = <0xbe00000 0x40000>;
+                       interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "okay";
+               };
+
                hsp_aon: hsp@c150000 {
                        compatible = "nvidia,tegra234-hsp", "nvidia,tegra194-hsp";
                        reg = <0x0c150000 0x90000>;
                        interrupt-controller;
                };
 
+               aon-fabric@c600000 {
+                       compatible = "nvidia,tegra234-aon-fabric";
+                       reg = <0xc600000 0x40000>;
+                       interrupts = <GIC_SPI 172 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "okay";
+               };
+
+               bpmp-fabric@d600000 {
+                       compatible = "nvidia,tegra234-bpmp-fabric";
+                       reg = <0xd600000 0x40000>;
+                       interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "okay";
+               };
+
+               dce-fabric@de00000 {
+                       compatible = "nvidia,tegra234-sce-fabric";
+                       reg = <0xde00000 0x40000>;
+                       interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "okay";
+               };
+
                gic: interrupt-controller@f400000 {
                        compatible = "arm,gic-v3";
                        reg = <0x0f400000 0x010000>, /* GICD */
                        nvidia,memory-controller = <&mc>;
                        status = "okay";
                };
+
+               cbb-fabric@13a00000 {
+                       compatible = "nvidia,tegra234-cbb-fabric";
+                       reg = <0x13a00000 0x400000>;
+                       interrupts = <GIC_SPI 231 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "okay";
+               };
        };
 
        ccplex@e000000 {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges = <0x0 0x0 0x40000000 0x80000>;
+               no-memory-wc;
 
                cpu_bpmp_tx: sram@70000 {
                        reg = <0x70000 0x1000>;
index 2f8aec2..9e2a13d 100644 (file)
@@ -30,13 +30,11 @@ dtb-$(CONFIG_ARCH_QCOM)     += msm8994-sony-xperia-kitakami-satsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8994-sony-xperia-kitakami-sumire.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8994-sony-xperia-kitakami-suzuran.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8996-mtp.dtb
-dtb-$(CONFIG_ARCH_QCOM)        += msm8996-pmi8996-sony-xperia-tone-dora.dtb
-dtb-$(CONFIG_ARCH_QCOM)        += msm8996-pmi8996-sony-xperia-tone-kagura.dtb
-dtb-$(CONFIG_ARCH_QCOM)        += msm8996-pmi8996-sony-xperia-tone-keyaki.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8996-sony-xperia-tone-dora.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8996-sony-xperia-tone-kagura.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8996-sony-xperia-tone-keyaki.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8996-xiaomi-gemini.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += msm8996-xiaomi-natrium.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8996-xiaomi-scorpio.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8998-asus-novago-tp370ql.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += msm8998-fxtec-pro1.dtb
@@ -52,6 +50,7 @@ dtb-$(CONFIG_ARCH_QCOM)       += qcs404-evb-1000.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += qcs404-evb-4000.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += qrb5165-rb5.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sa8155p-adp.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sa8295p-adp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-idp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-coachz-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-coachz-r1-lte.dtb
@@ -60,6 +59,8 @@ dtb-$(CONFIG_ARCH_QCOM)       += sc7180-trogdor-coachz-r3-lte.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-homestar-r2.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-homestar-r3.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-homestar-r4.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-kingoftown-r0.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-kingoftown-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-lazor-r0.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-lazor-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-lazor-r1-kb.dtb
@@ -75,12 +76,28 @@ dtb-$(CONFIG_ARCH_QCOM)     += sc7180-trogdor-lazor-limozeen-r9.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-lazor-limozeen-nots-r4.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-lazor-limozeen-nots-r5.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-lazor-limozeen-nots-r9.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-mrbland-rev0-auo.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-mrbland-rev0-boe.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-mrbland-rev1-auo.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-mrbland-rev1-boe.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pazquel-lte-parade.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pazquel-lte-ti.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pazquel-parade.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pazquel-ti.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pompom-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pompom-r1-lte.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pompom-r2.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-pompom-r2-lte.dtb
 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-quackingstick-r0.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-quackingstick-r0-lte.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-wormdingler-rev0-boe.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-wormdingler-rev0-inx.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-wormdingler-rev1-boe.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-wormdingler-rev1-inx.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-wormdingler-rev1-inx-rt5682s.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-wormdingler-rev1-boe-rt5682s.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7180-trogdor-r1-lte.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-herobrine-crd.dtb
@@ -89,6 +106,9 @@ dtb-$(CONFIG_ARCH_QCOM)      += sc7280-herobrine-villager-r0.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-idp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-idp2.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sc7280-crd-r3.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc8280xp-crd.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sc8280xp-lenovo-thinkpad-x13s.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sda660-inforce-ifc6560.dtb
 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
@@ -100,6 +120,8 @@ dtb-$(CONFIG_ARCH_QCOM)     += sdm845-cheza-r1.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-cheza-r2.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-cheza-r3.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-db845c.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sdm845-lg-judyln.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sdm845-lg-judyp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-oneplus-enchilada.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-oneplus-fajita.dtb
index 7c1eab6..1b61309 100644 (file)
@@ -8,6 +8,7 @@
 #include "msm8916-pm8916.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
 #include <dt-bindings/sound/apq8016-lpass.h>
                serial0 = &blsp1_uart2;
                serial1 = &blsp1_uart1;
                usid0 = &pm8916_0;
-               i2c0    = &blsp_i2c2;
-               i2c1    = &blsp_i2c6;
-               i2c3    = &blsp_i2c4;
-               spi0    = &blsp_spi5;
-               spi1    = &blsp_spi3;
+               i2c0 = &blsp_i2c2;
+               i2c1 = &blsp_i2c6;
+               i2c3 = &blsp_i2c4;
+               spi0 = &blsp_spi5;
+               spi1 = &blsp_spi3;
        };
 
        chosen {
 
        gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
                pinctrl-names = "default";
                pinctrl-0 = <&msm_key_volp_n_default>;
 
-               button@0 {
+               button {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
 
                led@1 {
                        label = "apq8016-sbc:green:user1";
+                       function = LED_FUNCTION_HEARTBEAT;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&msmgpio 21 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "heartbeat";
                        default-state = "off";
 
                led@2 {
                        label = "apq8016-sbc:green:user2";
+                       function = LED_FUNCTION_DISK_ACTIVITY;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&msmgpio 120 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "mmc0";
                        default-state = "off";
 
                led@3 {
                        label = "apq8016-sbc:green:user3";
+                       function = LED_FUNCTION_DISK_ACTIVITY;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pm8916_gpios 1 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "mmc1";
                        default-state = "off";
 
                led@4 {
                        label = "apq8016-sbc:green:user4";
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pm8916_gpios 2 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "none";
                        panic-indicator;
 
                led@5 {
                        label = "apq8016-sbc:yellow:wlan";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_YELLOW>;
                        gpios = <&pm8916_mpps 2 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0tx";
                        default-state = "off";
 
                led@6 {
                        label = "apq8016-sbc:blue:bt";
+                       function = LED_FUNCTION_BLUETOOTH;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pm8916_mpps 3 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "bluetooth-power";
                        default-state = "off";
                "USB_HUB_RESET_N_PM",
                "USB_SW_SEL_PM";
 
-       usb_hub_reset_pm: usb-hub-reset-pm {
+       usb_hub_reset_pm: usb-hub-reset-pm-state {
                pins = "gpio3";
                function = PMIC_GPIO_FUNC_NORMAL;
 
                output-high;
        };
 
-       usb_hub_reset_pm_device: usb-hub-reset-pm-device {
+       usb_hub_reset_pm_device: usb-hub-reset-pm-device-state {
                pins = "gpio3";
                function = PMIC_GPIO_FUNC_NORMAL;
 
                output-low;
        };
 
-       usb_sw_sel_pm: usb-sw-sel-pm {
+       usb_sw_sel_pm: usb-sw-sel-pm-state {
                pins = "gpio4";
                function = PMIC_GPIO_FUNC_NORMAL;
 
                output-high;
        };
 
-       usb_sw_sel_pm_device: usb-sw-sel-pm-device {
+       usb_sw_sel_pm_device: usb-sw-sel-pm-device-state {
                pins = "gpio4";
                function = PMIC_GPIO_FUNC_NORMAL;
 
                output-low;
        };
 
-       pm8916_gpios_leds: pm8916-gpios-leds {
+       pm8916_gpios_leds: pm8916-gpios-leds-state {
                pins = "gpio1", "gpio2";
                function = PMIC_GPIO_FUNC_NORMAL;
 
index 49afbb1..c1cb1ba 100644 (file)
@@ -10,6 +10,7 @@
 #include "pmi8994.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
                serial0 = &blsp2_uart2;
                serial1 = &blsp2_uart3;
                serial2 = &blsp1_uart2;
-               i2c0    = &blsp1_i2c3;
-               i2c1    = &blsp2_i2c1;
-               i2c2    = &blsp2_i2c1;
-               spi0    = &blsp1_spi1;
-               spi1    = &blsp2_spi6;
+               i2c0 = &blsp1_i2c3;
+               i2c1 = &blsp2_i2c1;
+               i2c2 = &blsp2_i2c1;
+               spi0 = &blsp1_spi1;
+               spi1 = &blsp2_spi6;
        };
 
        chosen {
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
                pinctrl-names = "default";
                pinctrl-0 = <&volume_up_gpio>;
 
-               button@0 {
+               button {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
        pinctrl-names = "default";
        pinctrl-0 = <&ls_exp_gpio_f &bt_en_gpios>;
 
-       ls_exp_gpio_f: pm8994_gpio5 {
+       ls_exp_gpio_f: pm8994-gpio5-state {
                pinconf {
                        pins = "gpio5";
+                       function = PMIC_GPIO_FUNC_NORMAL;
                        output-low;
                        power-source = <2>; // PM8994_GPIO_S4, 1.8V
                };
        };
 
-       bt_en_gpios: bt_en_gpios {
+       bt_en_gpios: bt-en-pios-state {
                pinconf {
                        pins = "gpio19";
                        function = PMIC_GPIO_FUNC_NORMAL;
                };
        };
 
-       wlan_en_gpios: wlan_en_gpios {
+       wlan_en_gpios: wlan-en-gpios-state {
                pinconf {
                        pins = "gpio8";
                        function = PMIC_GPIO_FUNC_NORMAL;
                };
        };
 
-       audio_mclk: clk_div1 {
+       audio_mclk: clk-div1-state {
                pinconf {
                        pins = "gpio15";
                        function = "func1";
                };
        };
 
-       volume_up_gpio: pm8996_gpio2 {
+       volume_up_gpio: pm8996-gpio2-state {
                pinconf {
                        pins = "gpio2";
                        function = "normal";
                };
        };
 
-       divclk4_pin_a: divclk4 {
+       divclk4_pin_a: divclk4-state {
                pinconf {
                        pins = "gpio18";
                        function = PMIC_GPIO_FUNC_FUNC2;
                };
        };
 
-       usb3_vbus_det_gpio: pm8996_gpio22 {
+       usb3_vbus_det_gpio: pm8996-gpio22-state {
                pinconf {
                        pins = "gpio22";
                        function = PMIC_GPIO_FUNC_NORMAL;
                "NC",
                "NC";
 
-       usb2_vbus_det_gpio: pmi8996_gpio6 {
+       usb2_vbus_det_gpio: pmi8996-gpio6-state {
                pinconf {
                        pins = "gpio6";
                        function = PMIC_GPIO_FUNC_NORMAL;
        };
 };
 
+&pmi8994_lpg {
+       qcom,power-source = <1>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pmi8994_mpp2_userled4>;
+
+       qcom,dtest = <0 0>,
+                    <0 0>,
+                    <0 0>,
+                    <4 1>;
+
+       status = "okay";
+
+       led@1 {
+               reg = <1>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_HEARTBEAT;
+               function-enumerator = <1>;
+
+               linux,default-trigger = "heartbeat";
+               default-state = "on";
+       };
+
+       led@2 {
+               reg = <2>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_HEARTBEAT;
+               function-enumerator = <0>;
+       };
+
+       led@3 {
+               reg = <3>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_HEARTBEAT;
+               function-enumerator = <2>;
+       };
+
+       led@4 {
+               reg = <4>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_HEARTBEAT;
+               function-enumerator = <3>;
+       };
+};
+
+&pmi8994_mpps {
+       pmi8994_mpp2_userled4: mpp2-userled4-state {
+               pins = "mpp2";
+               function = "sink";
+
+               output-low;
+               qcom,dtest = <4>;
+       };
+};
+
 &pmi8994_spmi_regulators {
        vdd_s2-supply = <&vph_pwr>;
 
 &sound {
        compatible = "qcom,apq8096-sndcard";
        model = "DB820c";
-       audio-routing = "RX_BIAS", "MCLK",
+       audio-routing = "RX_BIAS", "MCLK",
                "MM_DL1",  "MultiMedia1 Playback",
                "MM_DL2",  "MultiMedia2 Playback",
                "MultiMedia3 Capture", "MM_UL3";
index 821cb7c..1ba2eca 100644 (file)
        status = "okay";
 };
 
-&i2c_1 {
+&blsp1_i2c3 {
        pinctrl-0 = <&i2c_1_pins>;
        pinctrl-names = "default";
        status = "okay";
 };
 
-&spi_0 {
+&blsp1_spi1 {
        cs-select = <0>;
        status = "okay";
 
@@ -43,7 +43,7 @@
                #address-cells = <1>;
                #size-cells = <1>;
                reg = <0>;
-               compatible = "n25q128a11";
+               compatible = "micron,n25q128a11", "jedec,spi-nor";
                spi-max-frequency = <50000000>;
        };
 };
index c89499e..aaad7d9 100644 (file)
@@ -87,7 +87,7 @@
                };
        };
 
-       cpu_opp_table: cpu_opp_table {
+       cpu_opp_table: opp-table-cpu {
                compatible = "operating-points-v2";
                opp-shared;
 
 
        firmware {
                scm {
-                       compatible = "qcom,scm";
+                       compatible = "qcom,scm-ipq6018", "qcom,scm";
                };
        };
 
                        status = "disabled";
                };
 
-               spi_0: spi@78b5000 {
+               blsp1_spi1: spi@78b5000 {
                        compatible = "qcom,spi-qup-v2.2.1";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                };
 
-               spi_1: spi@78b6000 {
+               blsp1_spi2: spi@78b6000 {
                        compatible = "qcom,spi-qup-v2.2.1";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                };
 
-               i2c_0: i2c@78b6000 {
+               blsp1_i2c2: i2c@78b6000 {
                        compatible = "qcom,i2c-qup-v2.2.1";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        clocks = <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>,
                                 <&gcc GCC_BLSP1_AHB_CLK>;
                        clock-names = "core", "iface";
-                       clock-frequency  = <400000>;
+                       clock-frequency = <400000>;
                        dmas = <&blsp_dma 14>, <&blsp_dma 15>;
                        dma-names = "tx", "rx";
                        status = "disabled";
                };
 
-               i2c_1: i2c@78b7000 { /* BLSP1 QUP2 */
+               blsp1_i2c3: i2c@78b7000 {
                        compatible = "qcom,i2c-qup-v2.2.1";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        clocks = <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>,
                                 <&gcc GCC_BLSP1_AHB_CLK>;
                        clock-names = "core", "iface";
-                       clock-frequency  = <400000>;
+                       clock-frequency = <400000>;
                        dmas = <&blsp_dma 16>, <&blsp_dma 17>;
                        dma-names = "tx", "rx";
                        status = "disabled";
                };
 
                timer@b120000 {
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x10000000>;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0x0 0x0b120000 0x0 0x1000>;
 
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x0b121000 0x0 0x1000>,
-                                     <0x0 0x0b122000 0x0 0x1000>;
+                               reg = <0x0b121000 0x1000>,
+                                     <0x0b122000 0x1000>;
                        };
 
                        frame@b123000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0xb123000 0x0 0x1000>;
+                               reg = <0x0b123000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@b124000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x0b124000 0x0 0x1000>;
+                               reg = <0x0b124000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@b125000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x0b125000 0x0 0x1000>;
+                               reg = <0x0b125000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@b126000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x0b126000 0x0 0x1000>;
+                               reg = <0x0b126000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@b127000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x0b127000 0x0 0x1000>;
+                               reg = <0x0b127000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@b128000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x0b128000 0x0 0x1000>;
+                               reg = <0x0b128000 0x1000>;
                                status = "disabled";
                        };
                };
 
                        glink-edge {
                                interrupts = <GIC_SPI 321 IRQ_TYPE_EDGE_RISING>;
+                               label = "rtr";
                                qcom,remote-pid = <1>;
                                mboxes = <&apcs_glb 8>;
 
                                      <0x0 0x00078800 0x0 0x1F8>, /* PCS */
                                      <0x0 0x00078600 0x0 0x044>; /* PCS misc */
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB0_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "gcc_usb0_pipe_clk_src";
index 4c38b15..edcb6a5 100644 (file)
                                <&xo>;
                        clock-names = "aux", "cfg_ahb", "ref";
 
-                       resets =  <&gcc GCC_USB1_PHY_BCR>,
+                       resets = <&gcc GCC_USB1_PHY_BCR>,
                                <&gcc GCC_USB3PHY_1_PHY_BCR>;
                        reset-names = "phy","common";
                        status = "disabled";
                                      <0x00058800 0x1f8>,     /* PCS  */
                                      <0x00058600 0x044>;     /* PCS misc*/
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB1_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "gcc_usb1_pipe_clk_src";
                                <&xo>;
                        clock-names = "aux", "cfg_ahb", "ref";
 
-                       resets =  <&gcc GCC_USB0_PHY_BCR>,
+                       resets = <&gcc GCC_USB0_PHY_BCR>,
                                <&gcc GCC_USB3PHY_0_PHY_BCR>;
                        reset-names = "phy","common";
                        status = "disabled";
                                      <0x00078800 0x1f8>,     /* PCS  */
                                      <0x00078600 0x044>;     /* PCS misc*/
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB0_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "gcc_usb0_pipe_clk_src";
                        compatible = "qcom,gcc-ipq8074";
                        reg = <0x01800000 0x80000>;
                        #clock-cells = <0x1>;
+                       #power-domain-cells = <1>;
                        #reset-cells = <0x1>;
                };
 
                        cell-index = <0>;
                };
 
-               sdhc_1: sdhci@7824900 {
+               sdhc_1: mmc@7824900 {
                        compatible = "qcom,sdhci-msm-v4";
                        reg = <0x7824900 0x500>, <0x7824000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                                     <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&xo>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
-                                <&gcc GCC_SDCC1_APPS_CLK>;
-                       clock-names = "xo", "iface", "core";
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
+                                <&xo>;
+                       clock-names = "iface", "core", "xo";
+                       resets = <&gcc GCC_SDCC1_BCR>;
                        max-frequency = <384000000>;
                        mmc-ddr-1_8v;
                        mmc-hs200-1_8v;
                        status = "disabled";
                };
 
-               qpic_nand: nand@79b0000 {
+               qpic_nand: nand-controller@79b0000 {
                        compatible = "qcom,ipq8074-nand";
                        reg = <0x079b0000 0x10000>;
                        #address-cells = <1>;
                                                <133330000>,
                                                <19200000>;
 
+                       power-domains = <&gcc USB0_GDSC>;
+
                        resets = <&gcc GCC_USB0_BCR>;
                        status = "disabled";
 
                                                <133330000>,
                                                <19200000>;
 
+                       power-domains = <&gcc USB1_GDSC>;
+
                        resets = <&gcc GCC_USB1_BCR>;
                        status = "disabled";
 
                        };
                };
 
-               timer {
-                       compatible = "arm,armv8-timer";
-                       interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                                    <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                                    <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
-                                    <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
-               };
-
                watchdog: watchdog@b017000 {
                        compatible = "qcom,kpss-wdt";
                        reg = <0xb017000 0x1000>;
                        status = "disabled";
                };
        };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+       };
 };
index 265e539..3dc9619 100644 (file)
@@ -27,7 +27,7 @@
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index d4d33dd..dd92070 100644 (file)
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                        debounce-interval = <15>;
                };
 
-               volume-down {
+               button-volume-down {
                        label = "Volume Down";
                        gpios = <&msmgpio 117 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index 00488af..9e470c6 100644 (file)
@@ -39,7 +39,7 @@
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index b3836dd..d85e7f7 100644 (file)
@@ -39,7 +39,7 @@
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index f9ce123..b4812f0 100644 (file)
@@ -28,7 +28,7 @@
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 9b4b7de..10f6509 100644 (file)
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                };
 
-               home {
+               button-home {
                        label = "Home";
                        gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOMEPAGE>;
@@ -52,7 +52,7 @@
 
                label = "GPIO Hall Effect Sensor";
 
-               hall-sensor {
+               event-hall-sensor {
                        label = "Hall Effect Sensor";
                        gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
                drive-strength = <2>;
                bias-disable;
        };
+
+       ts_int_default: ts-int-default {
+               pins = "gpio13";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
 };
 
 &pm8916_gpios {
-       nfc_clk_req: nfc-clk-req {
+       nfc_clk_req: nfc-clk-req-state {
                pins = "gpio2";
                function = "func1";
 
index 4ba11b0..bc198a2 100644 (file)
                drive-strength = <2>;
                bias-disable;
        };
-
-       ts_int_default: ts-int-default {
-               pins = "gpio13";
-               function = "gpio";
-
-               drive-strength = <2>;
-               bias-disable;
-       };
 };
index d978c9a..7f2ab18 100644 (file)
                drive-strength = <2>;
                bias-disable;
        };
-
-       ts_int_default: ts-int-default {
-               pins = "gpio13";
-               function = "gpio";
-
-               drive-strength = <2>;
-               bias-disable;
-       };
 };
index 6c408d6..eabeed1 100644 (file)
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                };
 
-               home-key {
+               button-home {
                        label = "Home Key";
                        gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOMEPAGE>;
index 58dfbff..439e89c 100644 (file)
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                };
 
-               home {
+               button-home {
                        label = "Home";
                        gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOMEPAGE>;
@@ -70,7 +70,7 @@
 
                label = "GPIO Hall Effect Sensor";
 
-               hall-sensor {
+               event-hall-sensor {
                        label = "Hall Effect Sensor";
                        gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
index 69a44c6..84a352d 100644 (file)
@@ -29,7 +29,7 @@
 
                label = "GPIO Buttons";
 
-               volume-up {
+               button-volume-up {
                        label = "Volume Up";
                        gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 0547251..48bc2e0 100644 (file)
                };
        };
 
-       cpu_opp_table: cpu-opp-table {
+       cpu_opp_table: opp-table-cpu {
                compatible = "operating-points-v2";
                opp-shared;
 
                                rpmcc: clock-controller {
                                        compatible = "qcom,rpmcc-msm8916", "qcom,rpmcc";
                                        #clock-cells = <1>;
+                                       clocks = <&xo_board>;
+                                       clock-names = "xo";
                                };
 
                                rpmpd: power-controller {
                };
 
                qfprom: qfprom@5c000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,msm8916-qfprom", "qcom,qfprom";
                        reg = <0x0005c000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        #sound-dai-cells = <1>;
                };
 
-               sdhc_1: sdhci@7824000 {
+               sdhc_1: mmc@7824000 {
                        compatible = "qcom,msm8916-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0x07824900 0x11c>, <0x07824000 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_APPS_CLK>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
                                 <&xo_board>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
                        mmc-ddr-1_8v;
                        bus-width = <8>;
                        non-removable;
                        status = "disabled";
                };
 
-               sdhc_2: sdhci@7864000 {
+               sdhc_2: mmc@7864000 {
                        compatible = "qcom,msm8916-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0x07864900 0x11c>, <0x07864000 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_APPS_CLK>,
-                                <&gcc GCC_SDCC2_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                                <&gcc GCC_SDCC2_APPS_CLK>,
                                 <&xo_board>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
                        bus-width = <4>;
                        status = "disabled";
                };
                                        <&rpmpd MSM8916_VDDMX>;
                        power-domain-names = "cx", "mx";
 
-                       qcom,state = <&wcnss_smp2p_out 0>;
-                       qcom,state-names = "stop";
+                       qcom,smem-states = <&wcnss_smp2p_out 0>;
+                       qcom,smem-state-names = "stop";
 
                        pinctrl-names = "default";
                        pinctrl-0 = <&wcnss_pin_a>;
                        compatible = "qcom,msm8916-a53pll";
                        reg = <0x0b016000 0x40>;
                        #clock-cells = <0>;
+                       clocks = <&xo_board>;
+                       clock-names = "xo";
                };
 
                timer@b020000 {
index ffc3ec2..8416a45 100644 (file)
 
        firmware {
                scm: scm {
-                       compatible = "qcom,scm-msm8953";
+                       compatible = "qcom,scm-msm8953", "qcom,scm";
                        clocks = <&gcc GCC_CRYPTO_CLK>,
                                 <&gcc GCC_CRYPTO_AXI_CLK>,
                                 <&gcc GCC_CRYPTO_AHB_CLK>;
                        };
                };
 
-               sdhc_1: sdhci@7824900 {
+               sdhc_1: mmc@7824900 {
                        compatible = "qcom,msm8953-sdhci", "qcom,sdhci-msm-v4";
 
                        reg = <0x7824900 0x500>, <0x7824000 0x800>;
                        };
                };
 
-               sdhc_2: sdhci@7864900 {
+               sdhc_2: mmc@7864900 {
                        compatible = "qcom,msm8953-sdhci", "qcom,sdhci-msm-v4";
 
                        reg = <0x7864900 0x500>, <0x7864000 0x800>;
index 3b0cc85..71e373b 100644 (file)
@@ -74,7 +74,7 @@
                vdd_l17_29-supply = <&vph_pwr>;
                vdd_l20_21-supply = <&vph_pwr>;
                vdd_l25-supply = <&pm8994_s5>;
-               vdd_lvs1_2 = <&pm8994_s4>;
+               vdd_lvs1_2-supply = <&pm8994_s4>;
 
                /* S1, S2, S6 and S12 are managed by RPMPD */
 
index 7748b74..cbe11c0 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
-               button@0 {
+               button {
                        label = "Volume Up";
                        gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                vdd_l17_29-supply = <&vph_pwr>;
                vdd_l20_21-supply = <&vph_pwr>;
                vdd_l25-supply = <&pm8994_s5>;
-               vdd_lvs1_2 = <&pm8994_s4>;
+               vdd_lvs1_2-supply = <&pm8994_s4>;
 
                /* S1, S2, S6 and S12 are managed by RPMPD */
 
index cc038f9..61ec905 100644 (file)
@@ -64,7 +64,7 @@
                compatible = "gpio-keys";
                autorepeat;
 
-               volupkey {
+               volup-key {
                        label = "Volume Up";
                        gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -73,7 +73,7 @@
                        debounce-interval = <15>;
                };
 
-               camsnapkey {
+               camsnap-key {
                        label = "Camera Snapshot";
                        gpios = <&pm8994_gpios 4 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -82,7 +82,7 @@
                        debounce-interval = <15>;
                };
 
-               camfocuskey {
+               camfocus-key {
                        label = "Camera Focus";
                        gpios = <&pm8994_gpios 5 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
 
                label = "GPIO Hall Effect Sensor";
 
-               hall-front-sensor {
+               event-hall-front-sensor {
                        label = "Hall Effect Front Sensor";
                        gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
                        linux,input-type = <EV_SW>;
                        linux,can-disable;
                };
 
-               hall-back-sensor {
+               event-hall-back-sensor {
                        label = "Hall Effect Back Sensor";
                        gpios = <&tlmm 75 GPIO_ACTIVE_HIGH>;
                        linux,input-type = <EV_SW>;
 };
 
 &pm8994_gpios {
-       bt_en_gpios: bt_en_gpios {
+       bt_en_gpios: bt-en-gpios-state {
                pinconf {
                        pins = "gpio19";
                        function = PMIC_GPIO_FUNC_NORMAL;
                };
        };
 
-       divclk4_pin_a: divclk4 {
+       divclk4_pin_a: divclk4-state {
                pinconf {
                        pins = "gpio18";
                        function = PMIC_GPIO_FUNC_FUNC2;
         * TODO: remove once a driver is available
         * TODO: add VBUS GPIO 5
         */
-       hd3ss460_pol: pol_low {
+       hd3ss460_pol: pol-low-state {
                pins = "gpio8";
-               drive-strength = <3>;
+               function = PMIC_GPIO_FUNC_NORMAL;
+               qcom,drive-strength = <3>;
                bias-pull-down;
        };
 
-       hd3ss460_amsel: amsel_high {
+       hd3ss460_amsel: amsel-high-state {
                pins = "gpio9";
-               drive-strength = <1>;
+               function = PMIC_GPIO_FUNC_NORMAL;
+               qcom,drive-strength = <1>;
                bias-pull-up;
        };
 
-       hd3ss460_en: en_high {
+       hd3ss460_en: en-high-state {
                pins = "gpio10";
-               drive-strength = <1>;
+               function = PMIC_GPIO_FUNC_NORMAL;
+               qcom,drive-strength = <1>;
                bias-pull-up;
        };
 };
index e5a45af..f430d79 100644 (file)
        /* Kitakami firmware doesn't support PSCI */
        /delete-node/ psci;
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
-               button@0 {
+               button-0 {
                        label = "Volume Down";
                        gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -42,7 +40,7 @@
                        debounce-interval = <15>;
                };
 
-               button@1 {
+               button-1 {
                        label = "Volume Up";
                        gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -51,7 +49,7 @@
                        debounce-interval = <15>;
                };
 
-               button@2 {
+               button-2 {
                        label = "Camera Snapshot";
                        gpios = <&pm8994_gpios 4 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -60,7 +58,7 @@
                        debounce-interval = <15>;
                };
 
-               button@3 {
+               button-3 {
                        label = "Camera Focus";
                        gpios = <&pm8994_gpios 5 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
index 0318d42..8bc6c07 100644 (file)
                CPU6: cpu@102 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x101>;
+                       reg = <0x0 0x102>;
                        enable-method = "psci";
                        next-level-cache = <&L2_1>;
                };
                CPU7: cpu@103 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a57";
-                       reg = <0x0 0x101>;
+                       reg = <0x0 0x103>;
                        enable-method = "psci";
                        next-level-cache = <&L2_1>;
                };
                        };
                };
 
-               sdhc1: sdhci@f9824900 {
+               sdhc1: mmc@f9824900 {
                        compatible = "qcom,msm8994-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9824900 0x1a0>, <0xf9824000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                                     <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC1_APPS_CLK>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
                                 <&xo_board>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
 
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on &sdc1_rclk_on>;
                        status = "disabled";
                };
 
-               sdhc2: sdhci@f98a4900 {
+               sdhc2: mmc@f98a4900 {
                        compatible = "qcom,msm8994-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                                <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC2_APPS_CLK>,
-                               <&gcc GCC_SDCC2_AHB_CLK>,
-                               <&xo_board>;
-                       clock-names = "core", "iface", "xo";
+                       clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                                <&gcc GCC_SDCC2_APPS_CLK>,
+                                <&xo_board>;
+                       clock-names = "iface", "core", "xo";
 
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
                                               <600000000>;
                };
 
-               ocmem: ocmem@fdd00000 {
+               ocmem: sram@fdd00000 {
                        compatible = "qcom,msm8974-ocmem";
                        reg = <0xfdd00000 0x2000>,
                              <0xfec00000 0x200000>;
                        reg-names = "ctrl", "mem";
+                       ranges = <0 0xfec00000 0x200000>;
                        clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
                                 <&mmcc OCMEMCX_OCMEMNOC_CLK>;
                        clock-names = "core", "iface";
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
deleted file mode 100644 (file)
index b018693..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause
-/*
- * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
- */
-
-#include "msm8996-sony-xperia-tone-dora.dts"
-#include "pmi8996.dtsi"
-
-/ {
-       model = "Sony Xperia X Performance (PMI8996)";
-};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
deleted file mode 100644 (file)
index 842ea3c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause
-/*
- * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
- */
-
-#include "msm8996-sony-xperia-tone-kagura.dts"
-#include "pmi8996.dtsi"
-
-/ {
-       model = "Sony Xperia XZ (PMI8996)";
-};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
deleted file mode 100644 (file)
index b3f9062..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// SPDX-License-Identifier: BSD-3-Clause
-/*
- * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
- */
-
-#include "msm8996-sony-xperia-tone-keyaki.dts"
-#include "pmi8996.dtsi"
-
-/ {
-       model = "Sony Xperia XZs (PMI8996)";
-};
index ca3c633..e165b5e 100644 (file)
@@ -8,6 +8,7 @@
 #include "msm8996.dtsi"
 #include "pm8994.dtsi"
 #include "pmi8994.dtsi"
+#include "pmi8996.dtsi"
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
@@ -20,7 +21,6 @@
 
 / {
        qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
-       qcom,pmic-id = <0x20009 0x2000a 0 0>; /* PM8994 + PMI8994 */
        qcom,board-id = <8 0>;
 
        chosen {
                        ecc-size = <16>;
                };
 
-               cont_splash_mem: memory@83401000 {
-                       reg = <0 0x83401000 0 0x23ff000>;
-                       no-map;
-               };
-
                adsp_mem: adsp@8ea00000 {
                        reg = <0x0 0x8ea00000 0x0 0x1a00000>;
                        no-map;
         * probably a reason for it, and just to be on the safe side, we follow suit.
         */
        pm8994_gpios_defaults: pm8994-gpios-default-state {
-               pm8994-gpio1-nc {
+               pm8994-gpio1-nc-pins {
                        pins = "gpio1";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        bias-high-impedance;
                };
 
-               vol-down-n {
+               vol-down-n-pins {
                        pins = "gpio2";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               vol-up-n {
+               vol-up-n-pins {
                        pins = "gpio3";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               camera-snapshot-n {
+               camera-snapshot-n-pins {
                        pins = "gpio4";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               camera-focus-n {
+               camera-focus-n-pins {
                        pins = "gpio5";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pm8994-gpio6-nc {
+               pm8994-gpio6-nc-pins {
                        pins = "gpio6";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               nfc-download {
+               nfc-download-pins {
                        pins = "gpio7";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        output-low;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pm8994-gpio8-nc {
+               pm8994-gpio8-nc-pins {
                        pins = "gpio8";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        output-low;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pm8994-gpio9-nc {
+               pm8994-gpio9-nc-pins {
                        pins = "gpio9";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        output-high;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               nfc-clock {
+               nfc-clock-pins {
                        pins = "gpio10";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        input-enable;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pm8994-gpio11-nc {
+               pm8994-gpio11-nc-pins {
                        pins = "gpio11";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pm8994-gpio12-nc {
+               pm8994-gpio12-nc-pins {
                        pins = "gpio12";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               ear-enable {
+               ear-enable-pins {
                        pins = "gpio13";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        output-high;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pm8994-gpio14-nc {
+               pm8994-gpio14-nc-pins {
                        pins = "gpio14";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pm-divclk1-gpio {
+               pm-divclk1-gpio-pins {
                        pins = "gpio15";
                        function = "func1";
                        output-high;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pmi-clk-gpio {
+               pmi-clk-gpio-pins {
                        pins = "gpio16";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                };
 
-               pm8994-gpio17-nc {
+               pm8994-gpio17-nc-pins {
                        pins = "gpio17";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               rome-sleep {
+               rome-sleep-pins {
                        pins = "gpio18";
                        function = PMIC_GPIO_FUNC_FUNC2;
                        output-low;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pm8994-gpio19-nc {
+               pm8994-gpio19-nc-pins {
                        pins = "gpio19";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        output-low;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pm8994-gpio22-nc {
+               pm8994-gpio22-nc-pins {
                        pins = "gpio22";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                "RF_ID";
 
        pm8994_mpps_defaults: pm8994-mpps-default-state {
-               lcd-id_adc-mpp {
+               lcd-id_adc-mpp-pins {
                        pins = "mpp2";
                        function = "analog";
                        input-enable;
                        qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH6>;
                };
 
-               pm-mpp4-nc {
+               pm-mpp4-nc-pins {
                        pins = "mpp4";
                        function = "digital";
                        bias-high-impedance;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               flash-therm-mpp {
+               flash-therm-mpp-pins {
                        pins = "mpp5";
                        function = "analog";
                        input-enable;
                        qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
                };
 
-               mpp6-nc {
+               mpp6-nc-pins {
                        pins = "mpp6";
                        function = "digital";
                        bias-high-impedance;
                };
 
-               rf-id-mpp {
+               rf-id-mpp-pins {
                        pins = "mpp8";
                        function = "analog";
                        input-enable;
                "NC";
 
        pmi8994_gpios_defaults: pmi8994-gpios-default-state {
-               vib-ldo-en-gpio {
+               vib-ldo-en-gpio-pins {
                        pins = "gpio1";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pmi-gpio2-nc {
+               pmi-gpio2-nc-pins {
                        pins = "gpio2";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pmi-gpio3-nc {
+               pmi-gpio3-nc-pins {
                        pins = "gpio3";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_VPH>;
                };
 
-               pmi-gpio4-nc {
+               pmi-gpio4-nc-pins {
                        pins = "gpio4";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pmi-gpio5-nc {
+               pmi-gpio5-nc-pins {
                        pins = "gpio5";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pmi-gpio6-nc {
+               pmi-gpio6-nc-pins {
                        pins = "gpio6";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pmi-gpio7-nc {
+               pmi-gpio7-nc-pins {
                        pins = "gpio7";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               pmi-gpio8-nc {
+               pmi-gpio8-nc-pins {
                        pins = "gpio8";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                        power-source = <PM8994_GPIO_S4>;
                };
 
-               usb-switch-sel {
+               usb-switch-sel-pins {
                        pins = "gpio9";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        drive-push-pull;
                };
 
-               pmi-gpio10-nc {
+               pmi-gpio10-nc-pins {
                        pins = "gpio10";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        output-low;
index a7090be..6276499 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               vol_up {
+               key-vol-up {
                        label = "Volume Up";
                        gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
@@ -49,7 +49,7 @@
                        debounce-interval = <15>;
                };
 
-               dome {
+               key-dome {
                        label = "Home";
                        gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOME>;
 };
 
 &pm8994_gpios {
-       wlan_en_default: wlan-en-default {
+       wlan_en_default: wlan-en-state {
                pins = "gpio8";
                function = PMIC_GPIO_FUNC_NORMAL;
                output-low;
                bias-disable;
        };
 
-       rome_enable_default: rome-enable-default {
+       rome_enable_default: rome-enable-state {
                pins = "gpio9";
                function = PMIC_GPIO_FUNC_NORMAL;
                output-high;
                power-source = <PM8994_GPIO_VPH>;
        };
 
-       divclk1_default: divclk1_default {
+       divclk1_default: divclk1-state {
                pins = "gpio15";
                function = PMIC_GPIO_FUNC_FUNC1;
                bias-disable;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
        };
 
-       divclk4_pin_a: divclk4 {
+       divclk4_pin_a: divclk4-state {
                pins = "gpio18";
                function = PMIC_GPIO_FUNC_FUNC2;
                bias-disable;
index 22978d0..25f30ec 100644 (file)
 &sound {
        compatible = "qcom,apq8096-sndcard";
        model = "gemini";
-       audio-routing = "RX_BIAS", "MCLK",
+       audio-routing = "RX_BIAS", "MCLK",
                "MM_DL1",  "MultiMedia1 Playback",
                "MM_DL2",  "MultiMedia2 Playback",
                "MultiMedia3 Capture", "MM_UL3";
                "UIM_BATT_ALARM",       /* GPIO_21 */
                "NC";                   /* GPIO_22 */
 
-       divclk2_pin_a: divclk2 {
+       divclk2_pin_a: divclk2-state {
                pins = "gpio16";
                function = PMIC_GPIO_FUNC_FUNC2;
                bias-disable;
diff --git a/arch/arm64/boot/dts/qcom/msm8996-xiaomi-natrium.dts b/arch/arm64/boot/dts/qcom/msm8996-xiaomi-natrium.dts
new file mode 100644 (file)
index 0000000..ff4673e
--- /dev/null
@@ -0,0 +1,414 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2022, Alec Su <ae40515@yahoo.com.tw>
+ */
+
+/dts-v1/;
+
+#include "msm8996-xiaomi-common.dtsi"
+#include "pmi8996.dtsi"
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
+
+/ {
+       model = "Xiaomi Mi 5s Plus";
+       compatible = "xiaomi,natrium", "qcom,msm8996";
+       chassis-type = "handset";
+       qcom,msm-id = <305 0x10000>;
+       qcom,board-id = <47 0>;
+};
+
+&adsp_pil {
+       firmware-name = "qcom/msm8996/natrium/adsp.mbn";
+};
+
+&blsp2_i2c6 {
+       touchscreen@20 {
+               compatible = "syna,rmi4-i2c";
+               reg = <0x20>;
+               interrupt-parent = <&tlmm>;
+               interrupts = <125 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vdd_3v2_tp>;
+               syna,reset-delay-ms = <200>;
+               syna,startup-delay-ms = <5>;
+
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&touchscreen_default>;
+               pinctrl-1 = <&touchscreen_sleep>;
+       };
+};
+
+&dsi0 {
+       status = "okay";
+
+       vdda-supply = <&vreg_l2a_1p25>;
+       vcca-supply = <&vreg_l28a_0p925>;
+
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&mdss_dsi_default &mdss_te_default>;
+       pinctrl-1 = <&mdss_dsi_sleep &mdss_te_sleep>;
+
+       panel: panel@0 {
+               compatible = "jdi,fhd-r63452";
+               reg = <0>;
+               reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
+               backlight = <&pmi8994_wled>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&dsi0_out>;
+                       };
+               };
+       };
+};
+
+&dsi0_out {
+       remote-endpoint = <&panel_in>;
+};
+
+&gpu {
+       zap-shader {
+               firmware-name = "qcom/msm8996/natrium/a530_zap.mbn";
+       };
+};
+
+&mss_pil {
+       firmware-name = "qcom/msm8996/natrium/mba.mbn",
+                       "qcom/msm8996/natrium/modem.mbn";
+};
+
+&pmi8994_wled {
+       status = "okay";
+
+       qcom,enabled-strings = <0 1>;
+       qcom,switching-freq = <600>;
+};
+
+&q6asmdai {
+       dai@0 {
+               reg = <0>;
+       };
+
+       dai@1 {
+               reg = <1>;
+       };
+
+       dai@2 {
+               reg = <2>;
+       };
+};
+
+&slpi_pil {
+       firmware-name = "qcom/msm8996/natrium/slpi.mbn";
+};
+
+&sound {
+       compatible = "qcom,apq8096-sndcard";
+       model = "natrium";
+       audio-routing = "RX_BIAS", "MCLK";
+
+       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_6_RX>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+
+               codec {
+                       sound-dai = <&wcd9335 6>;
+               };
+       };
+
+       slimcap-dai-link {
+               link-name = "SLIM Capture";
+               cpu {
+                       sound-dai = <&q6afedai SLIMBUS_0_TX>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+
+               codec {
+                       sound-dai = <&wcd9335 1>;
+               };
+       };
+};
+
+&venus {
+       firmware-name = "qcom/msm8996/natrium/venus.mbn";
+};
+
+&rpm_requests {
+       pm8994-regulators {
+               vreg_l3a_0p875: l3 {
+                       regulator-name = "vreg_l3a_0p875";
+                       regulator-min-microvolt = <850000>;
+                       regulator-max-microvolt = <1300000>;
+               };
+               vreg_l11a_1p1: l11 {
+                       regulator-name = "vreg_l11a_1p1";
+                       regulator-min-microvolt = <1100000>;
+                       regulator-max-microvolt = <1100000>;
+               };
+               vreg_l17a_2p8: l17 {
+                       regulator-name = "vreg_l17a_2p8";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+               };
+               vreg_l18a_2p8: l18 {
+                       regulator-name = "vreg_l18a_2p8";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+               };
+               vreg_l29a_2p8: l29 {
+                       regulator-name = "vreg_l29a_2p8";
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+               };
+       };
+};
+
+&pm8994_gpios {
+       gpio-line-names =
+               "NC",                   /* GPIO_1  */
+               "VOL_UP_N",             /* GPIO_2  */
+               "SPKR_ID",              /* GPIO_3  */
+               "PWM_HAPTICS",          /* GPIO_4  */
+               "INFARED_DRV",          /* GPIO_5  */
+               "NC",                   /* GPIO_6  */
+               "KEYPAD_LED_EN_A",      /* GPIO_7  */
+               "WL_EN",                /* GPIO_8  */
+               "3P3_ENABLE",           /* GPIO_9  */
+               "NC",                   /* GPIO_10 */
+               "NC",                   /* GPIO_11 */
+               "NC",                   /* GPIO_12 */
+               "NC",                   /* GPIO_13 */
+               "NC",                   /* GPIO_14 */
+               "DIVCLK1_CDC",          /* GPIO_15 */
+               "DIVCLK2_HAPTICS",      /* GPIO_16 */
+               "NC",                   /* GPIO_17 */
+               "32KHz_CLK_IN",         /* GPIO_18 */
+               "BT_EN",                /* GPIO_19 */
+               "PMIC_SLB",             /* GPIO_20 */
+               "UIM_BATT_ALARM",       /* GPIO_21 */
+               "NC";                   /* GPIO_22 */
+};
+
+&pm8994_mpps {
+       gpio-line-names =
+               "NC",                   /* MPP_1 */
+               "CCI_TIMER1",           /* MPP_2 */
+               "PMIC_SLB",             /* MPP_3 */
+               "EXT_FET_WLED_PWR_EN_N",/* MPP_4 */
+               "NC",                   /* MPP_5 */
+               "NC",                   /* MPP_6 */
+               "NC",                   /* MPP_7 */
+               "NC";                   /* MPP_8 */
+};
+
+&pmi8994_gpios {
+       gpio-line-names =
+               "NC",                   /* GPIO_1  */
+               "SPKR_PA_EN",           /* GPIO_2  */
+               "NC",                   /* GPIO_3  */
+               "NC",                   /* GPIO_4  */
+               "NC",                   /* GPIO_5  */
+               "NC",                   /* GPIO_6  */
+               "NC",                   /* GPIO_7  */
+               "NC",                   /* GPIO_8  */
+               "NC",                   /* GPIO_9  */
+               "NC";                   /* GPIO_10 */
+};
+
+&tlmm {
+       gpio-line-names =
+               "ESE_SPI_MOSI",         /* GPIO_0   */
+               "ESE_SPI_MISO",         /* GPIO_1   */
+               "NC",                   /* GPIO_2   */
+               "ESE_SPI_CLK",          /* GPIO_3   */
+               "MSM_UART_TX",          /* GPIO_4   */
+               "MSM_UART_RX",          /* GPIO_5   */
+               "NFC_I2C_SDA",          /* GPIO_6   */
+               "NFC_I2C_SCL",          /* GPIO_7   */
+               "LCD0_RESET_N",         /* GPIO_8   */
+               "NFC_IRQ",              /* GPIO_9   */
+               "LCD_TE",               /* GPIO_10  */
+               "LCD_ID_DET1",          /* GPIO_11  */
+               "NFC_DISABLE",          /* GPIO_12  */
+               "CAM_MCLK0",            /* GPIO_13  */
+               "CAM_MCLK1",            /* GPIO_14  */
+               "CAM_MCLK2",            /* GPIO_15  */
+               "ESE_PWR_REQ",          /* GPIO_16  */
+               "CCI_I2C_SDA0",         /* GPIO_17  */
+               "CCI_I2C_SCL0",         /* GPIO_18  */
+               "CCI_I2C_SDA1",         /* GPIO_19  */
+               "CCI_I2C_SCL1",         /* GPIO_20  */
+               "NFC_DWL_REQ",          /* GPIO_21  */
+               "CCI_TIMER1",           /* GPIO_22  */
+               "WEBCAM1_RESET_N",      /* GPIO_23  */
+               "ESE_IRQ",              /* GPIO_24  */
+               "NC",                   /* GPIO_25  */
+               "WEBCAM1_STANDBY",      /* GPIO_26  */
+               "NC",                   /* GPIO_27  */
+               "NC",                   /* GPIO_28  */
+               "NC",                   /* GPIO_29  */
+               "CAM_VDD_1P2_EN_2",     /* GPIO_30  */
+               "CAM_RESET_0",          /* GPIO_31  */
+               "CAM_RESET_1",          /* GPIO_32  */
+               "NC",                   /* GPIO_33  */
+               "NC",                   /* GPIO_34  */
+               "PCI_E0_RST_N",         /* GPIO_35  */
+               "PCI_E0_CLKREQ_N",      /* GPIO_36  */
+               "PCI_E0_WAKE",          /* GPIO_37  */
+               "CHARGER_INT",          /* GPIO_38  */
+               "CHARGER_RESET",        /* GPIO_39  */
+               "NC",                   /* GPIO_40  */
+               "QCA_UART_TXD",         /* GPIO_41  */
+               "QCA_UART_RXD",         /* GPIO_42  */
+               "QCA_UART_CTS",         /* GPIO_43  */
+               "QCA_UART_RTS",         /* GPIO_44  */
+               "MAWC_UART_TX",         /* GPIO_45  */
+               "MAWC_UART_RX",         /* GPIO_46  */
+               "NC",                   /* GPIO_47  */
+               "NC",                   /* GPIO_48  */
+               "NC",                   /* GPIO_49  */
+               "FP_SPI_RST",           /* GPIO_50  */
+               "TYPEC_I2C_SDA",        /* GPIO_51  */
+               "TYPEC_I2C_SCL",        /* GPIO_52  */
+               "CODEC_INT2_N",         /* GPIO_53  */
+               "CODEC_INT1_N",         /* GPIO_54  */
+               "APPS_I2C7_SDA",        /* GPIO_55  */
+               "APPS_I2C7_SCL",        /* GPIO_56  */
+               "FORCE_USB_BOOT",       /* GPIO_57  */
+               "NC",                   /* GPIO_58  */
+               "NC",                   /* GPIO_59  */
+               "NC",                   /* GPIO_60  */
+               "NC",                   /* GPIO_61  */
+               "ESE_RSTN",             /* GPIO_62  */
+               "TYPEC_INT",            /* GPIO_63  */
+               "CODEC_RESET_N",        /* GPIO_64  */
+               "PCM_CLK",              /* GPIO_65  */
+               "PCM_SYNC",             /* GPIO_66  */
+               "PCM_DIN",              /* GPIO_67  */
+               "PCM_DOUT",             /* GPIO_68  */
+               "CDC_44K1_CLK",         /* GPIO_69  */
+               "SLIMBUS_CLK",          /* GPIO_70  */
+               "SLIMBUS_DATA0",        /* GPIO_71  */
+               "SLIMBUS_DATA1",        /* GPIO_72  */
+               "LDO_5V_IN_EN",         /* GPIO_73  */
+               "TYPEC_EN_N",           /* GPIO_74  */
+               "NC",                   /* GPIO_75  */
+               "NC",                   /* GPIO_76  */
+               "NC",                   /* GPIO_77  */
+               "NC",                   /* GPIO_78  */
+               "NC",                   /* GPIO_79  */
+               "SENSOR_RESET_N",       /* GPIO_80  */
+               "FP_SPI_MOSI",          /* GPIO_81  */
+               "FP_SPI_MISO",          /* GPIO_82  */
+               "FP_SPI_CS_N",          /* GPIO_83  */
+               "FP_SPI_CLK",           /* GPIO_84  */
+               "NC",                   /* GPIO_85  */
+               "CAM_VDD_1P2_EN",       /* GPIO_86  */
+               "MSM_TS_I2C_SDA",       /* GPIO_87  */
+               "MSM_TS_I2C_SCL",       /* GPIO_88  */
+               "TS_RESOUT_N",          /* GPIO_89  */
+               "ESE_SPI_CS_N",         /* GPIO_90  */
+               "NC",                   /* GPIO_91  */
+               "CAM2_AVDD_EN",         /* GPIO_92  */
+               "CAM2_VCM_EN",          /* GPIO_93  */
+               "NC",                   /* GPIO_94  */
+               "NC",                   /* GPIO_95  */
+               "NC",                   /* GPIO_96  */
+               "GRFC_0",               /* GPIO_97  */
+               "GRFC_1",               /* GPIO_98  */
+               "NC",                   /* GPIO_99  */
+               "GRFC_3",               /* GPIO_100 */
+               "GRFC_4",               /* GPIO_101 */
+               "GRFC_5",               /* GPIO_102 */
+               "NC",                   /* GPIO_103 */
+               "GRFC_7",               /* GPIO_104 */
+               "UIM2_DATA",            /* GPIO_105 */
+               "UIM2_CLK",             /* GPIO_106 */
+               "UIM2_RESET",           /* GPIO_107 */
+               "UIM2_PRESENT",         /* GPIO_108 */
+               "UIM1_DATA",            /* GPIO_109 */
+               "UIM1_CLK",             /* GPIO_110 */
+               "UIM1_RESET",           /* GPIO_111 */
+               "UIM1_PRESENT",         /* GPIO_112 */
+               "UIM_BATT_ALARM",       /* GPIO_113 */
+               "GRFC_8",               /* GPIO_114 */
+               "GRFC_9",               /* GPIO_115 */
+               "TX_GTR_THRES",         /* GPIO_116 */
+               "ACCEL_INT",            /* GPIO_117 */
+               "GYRO_INT",             /* GPIO_118 */
+               "COMPASS_INT",          /* GPIO_119 */
+               "PROXIMITY_INT_N",      /* GPIO_120 */
+               "FP_IRQ",               /* GPIO_121 */
+               "P_SENSE",              /* GPIO_122 */
+               "HALL_INTR2",           /* GPIO_123 */
+               "HALL_INTR1",           /* GPIO_124 */
+               "TS_INT_N",             /* GPIO_125 */
+               "NC",                   /* GPIO_126 */
+               "GRFC_11",              /* GPIO_127 */
+               "NC",                   /* GPIO_128 */
+               "EXT_GPS_LNA_EN",       /* GPIO_129 */
+               "NC",                   /* GPIO_130 */
+               "LCD_ID_DET2",          /* GPIO_131 */
+               "LCD_TE2",              /* GPIO_132 */
+               "GRFC_14",              /* GPIO_133 */
+               "GSM_TX2_PHASE_D",      /* GPIO_134 */
+               "NC",                   /* GPIO_135 */
+               "GRFC_15",              /* GPIO_136 */
+               "RFFE3_DATA",           /* GPIO_137 */
+               "RFFE3_CLK",            /* GPIO_138 */
+               "NC",                   /* GPIO_139 */
+               "NC",                   /* GPIO_140 */
+               "RFFE5_DATA",           /* GPIO_141 */
+               "RFFE5_CLK",            /* GPIO_142 */
+               "NC",                   /* GPIO_143 */
+               "COEX_UART_TX",         /* GPIO_144 */
+               "COEX_UART_RX",         /* GPIO_145 */
+               "RFFE2_DATA",           /* GPIO_146 */
+               "RFFE2_CLK",            /* GPIO_147 */
+               "RFFE1_DATA",           /* GPIO_148 */
+               "RFFE1_CLK";            /* GPIO_149 */
+
+       touchscreen_default: touchscreen-default {
+               pins = "gpio89", "gpio125";
+               function = "gpio";
+               drive-strength = <10>;
+               bias-pull-up;
+       };
+
+       touchscreen_sleep: touchscreen-sleep {
+               pins = "gpio89", "gpio125";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-disable;
+       };
+};
index 1e2dd67..30a9e4b 100644 (file)
 &sound {
        compatible = "qcom,apq8096-sndcard";
        model = "scorpio";
-       audio-routing = "RX_BIAS", "MCLK";
+       audio-routing = "RX_BIAS", "MCLK";
 
        mm1-dai-link {
                link-name = "MultiMedia1";
index 9932186..742eac4 100644 (file)
@@ -6,6 +6,7 @@
 #include <dt-bindings/clock/qcom,gcc-msm8996.h>
 #include <dt-bindings/clock/qcom,mmcc-msm8996.h>
 #include <dt-bindings/clock/qcom,rpmcc.h>
+#include <dt-bindings/interconnect/qcom,msm8996.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/soc/qcom,apr.h>
 #include <dt-bindings/thermal/thermal.h>
 
        firmware {
                scm {
-                       compatible = "qcom,scm-msm8996";
+                       compatible = "qcom,scm-msm8996", "qcom,scm";
                        qcom,dload-mode = <&tcsr 0x13000>;
                };
        };
                        rpmcc: qcom,rpmcc {
                                compatible = "qcom,rpmcc-msm8996", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&xo_board>;
+                               clock-names = "xo";
                        };
 
                        rpmpd: power-controller {
                ranges = <0 0 0 0xffffffff>;
                compatible = "simple-bus";
 
-               pcie_phy: phy@34000 {
+               pcie_phy: phy-wrapper@34000 {
                        compatible = "qcom,msm8996-qmp-pcie-phy";
                        reg = <0x00034000 0x488>;
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       ranges;
+                       ranges = <0x0 0x00034000 0x4000>;
 
                        clocks = <&gcc GCC_PCIE_PHY_AUX_CLK>,
                                <&gcc GCC_PCIE_PHY_CFG_AHB_CLK>,
                                <&gcc GCC_PCIE_PHY_COM_BCR>,
                                <&gcc GCC_PCIE_PHY_COM_NOCSR_BCR>;
                        reset-names = "phy", "common", "cfg";
+
                        status = "disabled";
 
-                       pciephy_0: phy@35000 {
-                               reg = <0x00035000 0x130>,
-                                     <0x00035200 0x200>,
-                                     <0x00035400 0x1dc>;
-                               #phy-cells = <0>;
+                       pciephy_0: phy@1000 {
+                               reg = <0x1000 0x130>,
+                                     <0x1200 0x200>,
+                                     <0x1400 0x1dc>;
 
-                               #clock-cells = <1>;
-                               clock-output-names = "pcie_0_pipe_clk_src";
                                clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
                                clock-names = "pipe0";
                                resets = <&gcc GCC_PCIE_0_PHY_BCR>;
                                reset-names = "lane0";
-                       };
 
-                       pciephy_1: phy@36000 {
-                               reg = <0x00036000 0x130>,
-                                     <0x00036200 0x200>,
-                                     <0x00036400 0x1dc>;
+                               #clock-cells = <0>;
+                               clock-output-names = "pcie_0_pipe_clk_src";
+
                                #phy-cells = <0>;
+                       };
+
+                       pciephy_1: phy@2000 {
+                               reg = <0x2000 0x130>,
+                                     <0x2200 0x200>,
+                                     <0x2400 0x1dc>;
 
-                               clock-output-names = "pcie_1_pipe_clk_src";
                                clocks = <&gcc GCC_PCIE_1_PIPE_CLK>;
                                clock-names = "pipe1";
                                resets = <&gcc GCC_PCIE_1_PHY_BCR>;
                                reset-names = "lane1";
-                       };
 
-                       pciephy_2: phy@37000 {
-                               reg = <0x00037000 0x130>,
-                                     <0x00037200 0x200>,
-                                     <0x00037400 0x1dc>;
+                               #clock-cells = <0>;
+                               clock-output-names = "pcie_1_pipe_clk_src";
+
                                #phy-cells = <0>;
+                       };
+
+                       pciephy_2: phy@3000 {
+                               reg = <0x3000 0x130>,
+                                     <0x3200 0x200>,
+                                     <0x3400 0x1dc>;
 
-                               clock-output-names = "pcie_2_pipe_clk_src";
                                clocks = <&gcc GCC_PCIE_2_PIPE_CLK>;
                                clock-names = "pipe2";
                                resets = <&gcc GCC_PCIE_2_PHY_BCR>;
                                reset-names = "lane2";
+
+                               #clock-cells = <0>;
+                               clock-output-names = "pcie_2_pipe_clk_src";
+
+                               #phy-cells = <0>;
                        };
                };
 
                };
 
                qfprom@74000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,msm8996-qfprom", "qcom,qfprom";
                        reg = <0x00074000 0x8ff>;
                        #address-cells = <1>;
                        #size-cells = <1>;
 
                        clocks = <&rpmcc RPM_SMD_BB_CLK1>,
                                 <&rpmcc RPM_SMD_LN_BB_CLK>,
-                                <&sleep_clk>;
-                       clock-names = "cxo", "cxo2", "sleep_clk";
+                                <&sleep_clk>,
+                                <&pciephy_0>,
+                                <&pciephy_1>,
+                                <&pciephy_2>,
+                                <&ssusb_phy_0>,
+                                <0>, <0>, <0>;
+                       clock-names = "cxo",
+                                     "cxo2",
+                                     "sleep_clk",
+                                     "pcie_0_pipe_clk_src",
+                                     "pcie_1_pipe_clk_src",
+                                     "pcie_2_pipe_clk_src",
+                                     "usb3_phy_pipe_clk_src",
+                                     "ufs_rx_symbol_0_clk_src",
+                                     "ufs_rx_symbol_1_clk_src",
+                                     "ufs_tx_symbol_0_clk_src";
+               };
+
+               bimc: interconnect@408000 {
+                       compatible = "qcom,msm8996-bimc";
+                       reg = <0x00408000 0x5a000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a";
+                       clocks = <&rpmcc RPM_SMD_BIMC_CLK>,
+                                <&rpmcc RPM_SMD_BIMC_A_CLK>;
                };
 
                tsens0: thermal-sensor@4a9000 {
                        dma-names = "rx", "tx";
                };
 
+               cnoc: interconnect@500000 {
+                       compatible = "qcom,msm8996-cnoc";
+                       reg = <0x00500000 0x1000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a";
+                       clocks = <&rpmcc RPM_SMD_CNOC_CLK>,
+                                <&rpmcc RPM_SMD_CNOC_A_CLK>;
+               };
+
+               snoc: interconnect@524000 {
+                       compatible = "qcom,msm8996-snoc";
+                       reg = <0x00524000 0x1c000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a";
+                       clocks = <&rpmcc RPM_SMD_SNOC_CLK>,
+                                <&rpmcc RPM_SMD_SNOC_A_CLK>;
+               };
+
+               a0noc: interconnect@543000 {
+                       compatible = "qcom,msm8996-a0noc";
+                       reg = <0x00543000 0x6000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "aggre0_snoc_axi",
+                                     "aggre0_cnoc_ahb",
+                                     "aggre0_noc_mpu_cfg";
+                       clocks = <&gcc GCC_AGGRE0_SNOC_AXI_CLK>,
+                                <&gcc GCC_AGGRE0_CNOC_AHB_CLK>,
+                                <&gcc GCC_AGGRE0_NOC_MPU_CFG_AHB_CLK>;
+                       power-domains = <&gcc AGGRE0_NOC_GDSC>;
+               };
+
+               a1noc: interconnect@562000 {
+                       compatible = "qcom,msm8996-a1noc";
+                       reg = <0x00562000 0x5000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a";
+                       clocks = <&rpmcc RPM_SMD_AGGR1_NOC_CLK>,
+                                <&rpmcc RPM_SMD_AGGR1_NOC_A_CLK>;
+               };
+
+               a2noc: interconnect@583000 {
+                       compatible = "qcom,msm8996-a2noc";
+                       reg = <0x00583000 0x7000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a";
+                       clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>,
+                                <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>;
+               };
+
+               mnoc: interconnect@5a4000 {
+                       compatible = "qcom,msm8996-mnoc";
+                       reg = <0x005a4000 0x1c000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a", "iface";
+                       clocks = <&rpmcc RPM_SMD_MMAXI_CLK>,
+                                <&rpmcc RPM_SMD_MMAXI_A_CLK>,
+                                <&mmcc AHB_CLK_SRC>;
+               };
+
+               pnoc: interconnect@5c0000 {
+                       compatible = "qcom,msm8996-pnoc";
+                       reg = <0x005c0000 0x3000>;
+                       #interconnect-cells = <1>;
+                       clock-names = "bus", "bus_a";
+                       clocks = <&rpmcc RPM_SMD_PCNOC_CLK>,
+                                <&rpmcc RPM_SMD_PCNOC_A_CLK>;
+               };
+
                tcsr_mutex_regs: syscon@740000 {
                        compatible = "syscon";
                        reg = <0x00740000 0x40000>;
                        #reset-cells = <1>;
                        #power-domain-cells = <1>;
                        reg = <0x008c0000 0x40000>;
+                       clocks = <&xo_board>,
+                                <&gcc GCC_MMSS_NOC_CFG_AHB_CLK>,
+                                <&gcc GPLL0>,
+                                <&dsi0_phy 1>,
+                                <&dsi0_phy 0>,
+                                <0>,
+                                <0>,
+                                <0>;
+                       clock-names = "xo",
+                                     "gcc_mmss_noc_cfg_ahb_clk",
+                                     "gpll0",
+                                     "dsi0pll",
+                                     "dsi0pllbyte",
+                                     "dsi1pll",
+                                     "dsi1pllbyte",
+                                     "hdmipll";
                        assigned-clocks = <&mmcc MMPLL9_PLL>,
                                          <&mmcc MMPLL1_PLL>,
                                          <&mmcc MMPLL3_PLL>,
                        interrupt-controller;
                        #interrupt-cells = <1>;
 
-                       clocks = <&mmcc MDSS_AHB_CLK>;
-                       clock-names = "iface";
+                       clocks = <&mmcc MDSS_AHB_CLK>,
+                                <&mmcc MDSS_MDP_CLK>;
+                       clock-names = "iface", "core";
 
                        #address-cells = <1>;
                        #size-cells = <1>;
                                assigned-clock-rates = <300000000>,
                                         <19200000>;
 
+                               interconnects = <&mnoc MASTER_MDP_PORT0 &bimc SLAVE_EBI_CH0>,
+                                               <&mnoc MASTER_MDP_PORT1 &bimc SLAVE_EBI_CH0>,
+                                               <&mnoc MASTER_ROTATOR &bimc SLAVE_EBI_CH0>;
+                               interconnect-names = "mdp0-mem", "mdp1-mem", "rotator-mem";
+
                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                                        remote-endpoint = <&dsi0_in>;
                                                };
                                        };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               mdp5_intf2_out: endpoint {
+                                                       remote-endpoint = <&dsi1_in>;
+                                               };
+                                       };
                                };
                        };
 
                                              "core_mmss",
                                              "pixel",
                                              "core";
+                               assigned-clocks = <&mmcc BYTE0_CLK_SRC>, <&mmcc PCLK0_CLK_SRC>;
+                               assigned-clock-parents = <&dsi0_phy 0>, <&dsi0_phy 1>;
 
                                phys = <&dsi0_phy>;
                                phy-names = "dsi";
                                status = "disabled";
                        };
 
+                       dsi1: dsi@996000 {
+                               compatible = "qcom,mdss-dsi-ctrl";
+                               reg = <0x00996000 0x400>;
+                               reg-names = "dsi_ctrl";
+
+                               interrupt-parent = <&mdss>;
+                               interrupts = <4>;
+
+                               clocks = <&mmcc MDSS_MDP_CLK>,
+                                        <&mmcc MDSS_BYTE1_CLK>,
+                                        <&mmcc MDSS_AHB_CLK>,
+                                        <&mmcc MDSS_AXI_CLK>,
+                                        <&mmcc MMSS_MISC_AHB_CLK>,
+                                        <&mmcc MDSS_PCLK1_CLK>,
+                                        <&mmcc MDSS_ESC1_CLK>;
+                               clock-names = "mdp_core",
+                                             "byte",
+                                             "iface",
+                                             "bus",
+                                             "core_mmss",
+                                             "pixel",
+                                             "core";
+                               assigned-clocks = <&mmcc BYTE1_CLK_SRC>, <&mmcc PCLK1_CLK_SRC>;
+                               assigned-clock-parents = <&dsi1_phy 0>, <&dsi1_phy 1>;
+
+                               phys = <&dsi1_phy>;
+                               phy-names = "dsi";
+                               status = "disabled";
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               dsi1_in: endpoint {
+                                                       remote-endpoint = <&mdp5_intf2_out>;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               dsi1_out: endpoint {
+                                               };
+                                       };
+                               };
+                       };
+
+                       dsi1_phy: dsi-phy@996400 {
+                               compatible = "qcom,dsi-phy-14nm";
+                               reg = <0x00996400 0x100>,
+                                     <0x00996500 0x300>,
+                                     <0x00996800 0x188>;
+                               reg-names = "dsi_phy",
+                                           "dsi_phy_lane",
+                                           "dsi_pll";
+
+                               #clock-cells = <1>;
+                               #phy-cells = <0>;
+
+                               clocks = <&mmcc MDSS_AHB_CLK>, <&rpmcc RPM_SMD_BB_CLK1>;
+                               clock-names = "iface", "ref";
+                               status = "disabled";
+                       };
+
                        hdmi: hdmi-tx@9a0000 {
                                compatible = "qcom,hdmi-tx-8996";
                                reg =   <0x009a0000 0x50c>,
                                        "extp";
 
                                phys = <&hdmi_phy>;
-                               phy-names = "hdmi_phy";
                                #sound-dai-cells = <1>;
 
                                status = "disabled";
                                "mem",
                                "mem_iface";
 
+                       interconnects = <&bimc MASTER_GRAPHICS_3D &bimc SLAVE_EBI_CH0>;
+                       interconnect-names = "gfx-mem";
+
                        power-domains = <&mmcc GPU_GX_GDSC>;
                        iommus = <&adreno_smmu 0>;
 
                        #cooling-cells = <2>;
 
                        gpu_opp_table: opp-table {
-                               compatible  ="operating-points-v2";
+                               compatible "operating-points-v2";
 
                                /*
                                 * 624Mhz and 560Mhz are only available on speed
                                        <&gcc GCC_PCIE_0_MSTR_AXI_CLK>,
                                        <&gcc GCC_PCIE_0_SLV_AXI_CLK>;
 
-                               clock-names =  "pipe",
+                               clock-names = "pipe",
                                                "aux",
                                                "cfg",
                                                "bus_master",
                                bus-range = <0x00 0xff>;
                                num-lanes = <1>;
 
-                               status  = "disabled";
+                               status = "disabled";
 
                                reg = <0x00608000 0x2000>,
                                      <0x0d000000 0xf1d>,
                                        <&gcc GCC_PCIE_1_MSTR_AXI_CLK>,
                                        <&gcc GCC_PCIE_1_SLV_AXI_CLK>;
 
-                               clock-names =  "pipe",
+                               clock-names = "pipe",
                                                "aux",
                                                "cfg",
                                                "bus_master",
                                        <&gcc GCC_PCIE_2_MSTR_AXI_CLK>,
                                        <&gcc GCC_PCIE_2_SLV_AXI_CLK>;
 
-                               clock-names =  "pipe",
+                               clock-names = "pipe",
                                                "aux",
                                                "cfg",
                                                "bus_master",
                                 <&mmcc VIDEO_AXI_CLK>,
                                 <&mmcc VIDEO_MAXI_CLK>;
                        clock-names = "core", "iface", "bus", "mbus";
+                       interconnects = <&mnoc MASTER_VIDEO_P0 &bimc SLAVE_EBI_CH0>,
+                                       <&bimc MASTER_AMPSS_M0 &mnoc SLAVE_VENUS_CFG>;
+                       interconnect-names = "video-mem", "cpu-cfg";
                        iommus = <&venus_smmu 0x00>,
                                 <&venus_smmu 0x01>,
                                 <&venus_smmu 0x0a>,
                                          <&gcc GCC_USB30_MASTER_CLK>;
                        assigned-clock-rates = <19200000>, <120000000>;
 
+                       interconnects = <&a2noc MASTER_USB3 &bimc SLAVE_EBI_CH0>,
+                                       <&bimc MASTER_AMPSS_M0 &snoc SLAVE_USB3>;
+                       interconnect-names = "usb-ddr", "apps-usb";
+
                        power-domains = <&gcc USB30_GDSC>;
                        status = "disabled";
 
                                      <0x07410600 0x1a8>;
                                #phy-cells = <0>;
 
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clock-output-names = "usb3_phy_pipe_clk_src";
                                clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>;
                                clock-names = "pipe0";
                        status = "disabled";
                };
 
-               sdhc1: sdhci@7464900 {
+               sdhc1: mmc@7464900 {
                        compatible = "qcom,msm8996-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0x07464900 0x11c>, <0x07464000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        clocks = <&gcc GCC_SDCC1_AHB_CLK>,
                                <&gcc GCC_SDCC1_APPS_CLK>,
                                <&rpmcc RPM_SMD_BB_CLK1>;
+                       resets = <&gcc GCC_SDCC1_BCR>;
 
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc1_state_on>;
                        status = "disabled";
                };
 
-               sdhc2: sdhci@74a4900 {
+               sdhc2: mmc@74a4900 {
                        compatible = "qcom,msm8996-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0x074a4900 0x314>, <0x074a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        clocks = <&gcc GCC_SDCC2_AHB_CLK>,
                                <&gcc GCC_SDCC2_APPS_CLK>,
                                <&rpmcc RPM_SMD_BB_CLK1>;
+                       resets = <&gcc GCC_SDCC2_BCR>;
 
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc2_state_on>;
                        compatible = "qcom,bam-v1.7.0";
                        qcom,controlled-remotely;
                        reg = <0x09184000 0x32000>;
-                       num-channels  = <31>;
+                       num-channels = <31>;
                        interrupts = <0 164 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-cells = <1>;
                        qcom,ee = <1>;
                        reg = <0x091c0000 0x2C000>;
                        reg-names = "ctrl";
                        interrupts = <0 163 IRQ_TYPE_LEVEL_HIGH>;
-                       dmas =  <&slimbam 3>, <&slimbam 4>,
+                       dmas = <&slimbam 3>, <&slimbam 4>,
                                <&slimbam 5>, <&slimbam 6>;
                        dma-names = "rx", "tx", "tx2", "rx2";
                        #address-cells = <1>;
 
                                tasha_ifd: tas-ifd {
                                        compatible = "slim217,1a0";
-                                       reg  = <0 0>;
+                                       reg = <0 0>;
                                };
 
                                wcd9335: codec@1{
                                        pinctrl-names = "default";
 
                                        compatible = "slim217,1a0";
-                                       reg  = <1 0>;
+                                       reg = <1 0>;
 
                                        interrupt-parent = <&tlmm>;
                                        interrupts = <54 IRQ_TYPE_LEVEL_HIGH>,
                                                     <53 IRQ_TYPE_LEVEL_HIGH>;
-                                       interrupt-names  = "intr1", "intr2";
+                                       interrupt-names = "intr1", "intr2";
                                        interrupt-controller;
                                        #interrupt-cells = <1>;
                                        reset-gpios = <&tlmm 64 0>;
 
-                                       slim-ifc-dev  = <&tasha_ifd>;
+                                       slim-ifc-dev = <&tasha_ifd>;
 
                                        #sound-dai-cells = <1>;
                                };
index e204b70..102f3e9 100644 (file)
 
        touchpad@15 {
                compatible = "hid-over-i2c";
-               interrupt-parent = <&tlmm>;
-               interrupts = <0x7b IRQ_TYPE_LEVEL_LOW>;
                reg = <0x15>;
-               hid-descr-addr = <0x0001>;
-
                pinctrl-names = "default";
                pinctrl-0 = <&touchpad>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <123 IRQ_TYPE_LEVEL_LOW>;
+
+               hid-descr-addr = <0x0001>;
        };
 
        keyboard@3a {
                compatible = "hid-over-i2c";
-               interrupt-parent = <&tlmm>;
-               interrupts = <0x25 IRQ_TYPE_LEVEL_LOW>;
                reg = <0x3a>;
+               interrupt-parent = <&tlmm>;
+               interrupts = <37 IRQ_TYPE_LEVEL_LOW>;
+
                hid-descr-addr = <0x0001>;
        };
 };
 &sdhc2 {
        cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
 };
-
-&tlmm {
-       touchpad: touchpad {
-               config {
-                       pins = "gpio123";
-                       bias-pull-up;
-               };
-       };
-};
index b3b3525..7928b81 100644 (file)
@@ -8,13 +8,10 @@
  */
 
 #include "msm8998.dtsi"
-#include "pm8998.dtsi"
 #include "pm8005.dtsi"
+#include "pm8998.dtsi"
 
 / {
-       chosen {
-       };
-
        vph_pwr: vph-pwr-regulator {
                compatible = "regulator-fixed";
                regulator-name = "vph_pwr";
        };
 };
 
+&blsp1_uart3_on {
+       rx {
+               /delete-property/ bias-disable;
+               /*
+                * Configure a pull-up on 45 (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;
+       };
+
+       cts {
+               /delete-property/ bias-disable;
+               /*
+                * Configure a pull-down on 47 (CTS) to match the pull
+                * of the Bluetooth module.
+                */
+               bias-pull-down;
+       };
+};
+
 /*
  * The laptop FW does not appear to support the retention state as it is
  * not advertised as enabled in ACPI, and enabling it in DT can cause boot
        cpu-idle-states = <&BIG_CPU_SLEEP_1>;
 };
 
+/*
+ * If EFIFB is used, enabling MMCC will cause important MMSS clocks to be cleaned
+ * up, because as far as Linux is concerned - they are unused. Disable it by default
+ * on clamshell devices, as it will break them, unless either simplefb is configured to
+ * hold a vote for these clocks, or panels are brought up properly, using drm/msm.
+ */
+&mmcc {
+       status = "disabled";
+};
+
+&mmss_smmu {
+       status = "disabled";
+};
+
 &pcie0 {
        status = "okay";
 };
        status = "okay";
 };
 
-&pm8005_lsid1 {
-       pm8005-regulators {
-               compatible = "qcom,pm8005-regulators";
+&pm8005_regulators {
+       vdd_s1-supply = <&vph_pwr>;
 
-               vdd_s1-supply = <&vph_pwr>;
+       pm8005_s1: s1 { /* VDD_GFX supply */
+               regulator-min-microvolt = <524000>;
+               regulator-max-microvolt = <1100000>;
+               regulator-enable-ramp-delay = <500>;
 
-               pm8005_s1: s1 { /* VDD_GFX supply */
-                       regulator-min-microvolt = <524000>;
-                       regulator-max-microvolt = <1100000>;
-                       regulator-enable-ramp-delay = <500>;
-
-                       /* hack until we rig up the gpu consumer */
-                       regulator-always-on;
-               };
+               /* hack until we rig up the gpu consumer */
+               regulator-always-on;
        };
 };
 
                        regulator-min-microvolt = <1352000>;
                        regulator-max-microvolt = <1352000>;
                };
+
                vreg_s4a_1p8: s4 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                        regulator-allow-set-load;
                };
+
                vreg_s5a_2p04: s5 {
                        regulator-min-microvolt = <1904000>;
                        regulator-max-microvolt = <2040000>;
                };
+
                vreg_s7a_1p025: s7 {
                        regulator-min-microvolt = <900000>;
                        regulator-max-microvolt = <1028000>;
                };
+
                vreg_l1a_0p875: l1 {
                        regulator-min-microvolt = <880000>;
                        regulator-max-microvolt = <880000>;
                        regulator-allow-set-load;
                };
+
                vreg_l2a_1p2: l2 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                        regulator-allow-set-load;
                };
+
                vreg_l3a_1p0: l3 {
                        regulator-min-microvolt = <1000000>;
                        regulator-max-microvolt = <1000000>;
                };
+
                vreg_l5a_0p8: l5 {
                        regulator-min-microvolt = <800000>;
                        regulator-max-microvolt = <800000>;
                };
+
                vreg_l6a_1p8: l6 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <1808000>;
                };
+
                vreg_l7a_1p8: l7 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                        regulator-allow-set-load;
                };
+
                vreg_l8a_1p2: l8 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                };
+
                vreg_l9a_1p8: l9 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <2960000>;
                };
+
                vreg_l10a_1p8: l10 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <2960000>;
                };
+
                vreg_l11a_1p0: l11 {
                        regulator-min-microvolt = <1000000>;
                        regulator-max-microvolt = <1000000>;
                };
+
                vreg_l12a_1p8: l12 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                };
+
                vreg_l13a_2p95: l13 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <2960000>;
                };
+
                vreg_l14a_1p88: l14 {
                        regulator-min-microvolt = <1880000>;
                        regulator-max-microvolt = <1880000>;
                };
+
                vreg_l15a_1p8: l15 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                };
+
                vreg_l16a_2p7: l16 {
                        regulator-min-microvolt = <2704000>;
                        regulator-max-microvolt = <2704000>;
                };
+
                vreg_l17a_1p3: l17 {
                        regulator-min-microvolt = <1304000>;
                        regulator-max-microvolt = <1304000>;
                        regulator-allow-set-load;
                };
+
                vreg_l18a_2p7: l18 {
                        regulator-min-microvolt = <2704000>;
                        regulator-max-microvolt = <2704000>;
                };
+
                vreg_l19a_3p0: l19 {
                        regulator-min-microvolt = <3008000>;
                        regulator-max-microvolt = <3008000>;
                };
+
                vreg_l20a_2p95: l20 {
                        regulator-min-microvolt = <2960000>;
                        regulator-max-microvolt = <2960000>;
                        regulator-allow-set-load;
                };
+
                vreg_l21a_2p95: l21 {
                        regulator-min-microvolt = <2960000>;
                        regulator-max-microvolt = <2960000>;
                        regulator-allow-set-load;
                        regulator-system-load = <800000>;
                };
+
                vreg_l22a_2p85: l22 {
                        regulator-min-microvolt = <2864000>;
                        regulator-max-microvolt = <2864000>;
                };
+
                vreg_l23a_3p3: l23 {
                        regulator-min-microvolt = <3312000>;
                        regulator-max-microvolt = <3312000>;
                };
+
                vreg_l24a_3p075: l24 {
                        regulator-min-microvolt = <3088000>;
                        regulator-max-microvolt = <3088000>;
                };
+
                vreg_l25a_3p3: l25 {
                        regulator-min-microvolt = <3104000>;
                        regulator-max-microvolt = <3312000>;
                        regulator-allow-set-load;
                };
+
                vreg_l26a_1p2: l26 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                };
+
                vreg_l28_3p0: l28 {
                        regulator-min-microvolt = <3008000>;
                        regulator-max-microvolt = <3008000>;
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                };
-
        };
 };
 
        status = "okay";
 };
 
-&tlmm {
-       gpio-reserved-ranges = <0 4>, <81 4>;
-
-       touchpad: touchpad {
-               config {
-                       pins = "gpio123";
-                       bias-pull-up;           /* pull up */
-               };
-       };
-};
-
 &sdhc2 {
        status = "okay";
 
        vqmmc-supply = <&vreg_l13a_2p95>;
 
        pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc2_clk_on  &sdc2_cmd_on  &sdc2_data_on  &sdc2_cd_on>;
-       pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
+       pinctrl-0 = <&sdc2_on &sdc2_cd>;
+       pinctrl-1 = <&sdc2_off &sdc2_cd>;
+};
+
+&tlmm {
+       gpio-reserved-ranges = <0 4>, <81 4>;
+
+       touchpad: touchpad-pin {
+               pins = "gpio123";
+               bias-pull-up;
+       };
 };
 
 &ufshc {
        vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
        vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
 };
-
-/* PINCTRL - board-specific pinctrl */
-&blsp1_uart3_on {
-       rx {
-               /delete-property/ bias-disable;
-               /*
-                * Configure a pull-up on 45 (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;
-       };
-
-       cts {
-               /delete-property/ bias-disable;
-               /*
-                * Configure a pull-down on 47 (CTS) to match the pull
-                * of the Bluetooth module.
-                */
-               bias-pull-down;
-       };
-};
index dc5b9b2..429ba57 100644 (file)
@@ -6,11 +6,13 @@
 
 /dts-v1/;
 
-#include "msm8998-mtp.dtsi"
-
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include "msm8998.dtsi"
+#include "pm8005.dtsi"
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
 
 / {
        model = "F(x)tec Pro1 (QX1000)";
        chassis-type = "handset";
        qcom,board-id = <0x02000b 0x10>;
 
+       aliases {
+               serial0 = &blsp2_uart1;
+               serial1 = &blsp1_uart3;
+       };
+
        /*
         * Until we hook up type-c detection, we
         * have to stick with this. But it works.
@@ -33,7 +40,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&hall_sensor1_default>;
 
-               hall-sensor1 {
+               event-hall-sensor1 {
                        label = "Keyboard Hall Sensor";
                        gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
                        debounce-interval = <15>;
@@ -49,7 +56,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_kb_pins_extra>;
 
-               home {
+               key-home {
                        label = "Home";
                        gpios = <&tlmm 21 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_HOMEPAGE>;
@@ -57,7 +64,7 @@
                        linux,can-disable;
                };
 
-               super-l {
+               key-super-l {
                        label = "Super Left";
                        gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_FN>;
@@ -65,7 +72,7 @@
                        linux,can-disable;
                };
 
-               super-r {
+               key-super-r {
                        label = "Super Right";
                        gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_FN>;
@@ -73,7 +80,7 @@
                        linux,can-disable;
                };
 
-               shift {
+               key-shift {
                        label = "Shift";
                        gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RIGHTSHIFT>;
@@ -81,7 +88,7 @@
                        linux,can-disable;
                };
 
-               ctrl {
+               key-ctrl {
                        label = "Ctrl";
                        gpios = <&tlmm 128 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_LEFTCTRL>;
@@ -89,7 +96,7 @@
                        linux,can-disable;
                };
 
-               alt {
+               key-alt {
                        label = "Alt";
                        gpios = <&tlmm 129 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_LEFTALT>;
        gpio-keys {
                compatible = "gpio-keys";
                label = "Side buttons";
-               #address-cells = <1>;
-               #size-cells = <0>;
                pinctrl-names = "default";
                pinctrl-0 = <&vol_up_pin_a>, <&cam_focus_pin_a>,
                            <&cam_snapshot_pin_a>;
-               vol-up {
+               button-vol-up {
                        label = "Volume Up";
                        gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                        debounce-interval = <15>;
                };
 
-               camera-snapshot {
+               button-camera-snapshot {
                        label = "Camera Snapshot";
                        gpios = <&pm8998_gpio 7 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                        debounce-interval = <15>;
                };
 
-               camera-focus {
+               button-camera-focus {
                        label = "Camera Focus";
                        gpios = <&pm8998_gpio 8 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
        keyboard-leds {
                compatible = "gpio-leds";
 
-               backlight {
+               led-0 {
                        color = <LED_COLOR_ID_WHITE>;
                        default-state = "off";
                        function = LED_FUNCTION_KBD_BACKLIGHT;
                        retain-state-suspended;
                };
 
-               caps-lock {
+               led-1 {
                        color = <LED_COLOR_ID_YELLOW>;
                        default-state = "off";
                        function = LED_FUNCTION_CAPSLOCK;
                pinctrl-0 = <&ts_vio_default>;
                regulator-always-on;
        };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+};
+
+&blsp1_uart3 {
+       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>;
+       };
+};
+
+&blsp1_uart3_on {
+       rx {
+               /delete-property/ bias-disable;
+               /*
+                * Configure a pull-up on 45 (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;
+       };
+
+       cts {
+               /delete-property/ bias-disable;
+               /*
+                * Configure a pull-down on 47 (CTS) to match the pull
+                * of the Bluetooth module.
+                */
+               bias-pull-down;
+       };
+};
+
+&blsp2_uart1 {
+       status = "okay";
 };
 
 &blsp2_i2c1 {
-       status = "ok";
+       status = "okay";
 
        touchscreen@14 {
                compatible = "goodix,gt9286";
        };
 };
 
-&mmcc {
-       status = "ok";
+&etf {
+       status = "okay";
+};
+
+&etm1 {
+       status = "okay";
+};
+
+&etm2 {
+       status = "okay";
+};
+
+&etm3 {
+       status = "okay";
+};
+
+&etm4 {
+       status = "okay";
+};
+
+&etm5 {
+       status = "okay";
+};
+
+&etm6 {
+       status = "okay";
+};
+
+&etm7 {
+       status = "okay";
+};
+
+&etm8 {
+       status = "okay";
+};
+
+&etr {
+       status = "okay";
 };
 
-&mmss_smmu {
-       status = "ok";
+&funnel1 {
+       status = "okay";
+};
+
+&funnel2 {
+       status = "okay";
+};
+
+&funnel3 {
+       status = "okay";
+};
+
+&funnel4 {
+       // FIXME: Figure out why clock late_initcall crashes the board with
+       // this enabled.
+       // status = "okay";
+};
+
+&funnel5 {
+       // FIXME: Figure out why clock late_initcall crashes the board with
+       // this enabled.
+       // status = "okay";
+};
+
+&pcie0 {
+       status = "okay";
+};
+
+&pcie_phy {
+       status = "okay";
+};
+
+&pm8005_regulators {
+       vdd_s1-supply = <&vph_pwr>;
+
+       pm8005_s1: s1 { /* VDD_GFX supply */
+               regulator-min-microvolt = <524000>;
+               regulator-max-microvolt = <1100000>;
+               regulator-enable-ramp-delay = <500>;
+
+               /* Hack until we rig up the gpu consumer */
+               regulator-always-on;
+       };
 };
 
 &pm8998_gpio {
-       vol_up_pin_a: vol-up-active {
+       vol_up_pin_a: vol-up-active-state {
                pins = "gpio6";
                function = "normal";
                bias-pull-up;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
        };
 
-       cam_focus_pin_a: cam-focus-btn-active {
+       cam_focus_pin_a: cam-focus-btn-active-state {
                pins = "gpio7";
                function = "normal";
                bias-pull-up;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
        };
 
-       cam_snapshot_pin_a: cam-snapshot-btn-active {
+       cam_snapshot_pin_a: cam-snapshot-btn-active-state {
                pins = "gpio8";
                function = "normal";
                bias-pull-up;
        };
 };
 
+&qusb2phy {
+       status = "okay";
+
+       vdda-pll-supply = <&vreg_l12a_1p8>;
+       vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
+};
+
+&replicator1 {
+       status = "okay";
+};
+
+&rpm_requests {
+       pm8998-regulators {
+               compatible = "qcom,rpm-pm8998-regulators";
+
+               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 = <&vreg_s5a_2p04>;
+               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>;
+               vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
+
+               vreg_s3a_1p35: s3 {
+                       regulator-min-microvolt = <1352000>;
+                       regulator-max-microvolt = <1352000>;
+               };
+
+               vreg_s4a_1p8: s4 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_s5a_2p04: s5 {
+                       regulator-min-microvolt = <1904000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+
+               vreg_s7a_1p025: s7 {
+                       regulator-min-microvolt = <900000>;
+                       regulator-max-microvolt = <1028000>;
+               };
+
+               vreg_l1a_0p875: l1 {
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+               };
+
+               vreg_l2a_1p2: l2 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+               };
+
+               vreg_l3a_1p0: l3 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1000000>;
+               };
+
+               vreg_l5a_0p8: l5 {
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+               };
+
+               vreg_l6a_1p8: l6 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <1808000>;
+               };
+
+               vreg_l7a_1p8: l7 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_l8a_1p2: l8 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+               };
+
+               vreg_l9a_1p8: l9 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <2960000>;
+               };
+
+               vreg_l10a_1p8: l10 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <2960000>;
+               };
+
+               vreg_l11a_1p0: l11 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1000000>;
+               };
+
+               vreg_l12a_1p8: l12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_l13a_2p95: l13 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <2960000>;
+               };
+
+               vreg_l14a_1p88: l14 {
+                       regulator-min-microvolt = <1880000>;
+                       regulator-max-microvolt = <1880000>;
+               };
+
+               vreg_l15a_1p8: l15 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_l16a_2p7: l16 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2704000>;
+               };
+
+               vreg_l17a_1p3: l17 {
+                       regulator-min-microvolt = <1304000>;
+                       regulator-max-microvolt = <1304000>;
+               };
+
+               vreg_l18a_2p7: l18 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2704000>;
+               };
+
+               vreg_l19a_3p0: l19 {
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3008000>;
+               };
+
+               vreg_l20a_2p95: l20 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l21a_2p95: l21 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-system-load = <800000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l22a_2p85: l22 {
+                       regulator-min-microvolt = <2864000>;
+                       regulator-max-microvolt = <2864000>;
+               };
+
+               vreg_l23a_3p3: l23 {
+                       regulator-min-microvolt = <3312000>;
+                       regulator-max-microvolt = <3312000>;
+               };
+
+               vreg_l24a_3p075: l24 {
+                       regulator-min-microvolt = <3088000>;
+                       regulator-max-microvolt = <3088000>;
+               };
+
+               vreg_l25a_3p3: l25 {
+                       regulator-min-microvolt = <3104000>;
+                       regulator-max-microvolt = <3312000>;
+               };
+
+               vreg_l26a_1p2: l26 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l28_3p0: l28 {
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3008000>;
+               };
+
+               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-regulators {
+               compatible = "qcom,rpm-pmi8998-regulators";
+
+               vdd_bob-supply = <&vph_pwr>;
+
+               vreg_bob: bob {
+                       regulator-min-microvolt = <3312000>;
+                       regulator-max-microvolt = <3600000>;
+               };
+       };
+};
+
+&remoteproc_adsp {
+       status = "okay";
+};
+
+&remoteproc_mss {
+       status = "okay";
+};
+
+&remoteproc_slpi {
+       status = "okay";
+};
+
 &tlmm {
        gpio-reserved-ranges = <0 4>;
 
        };
 };
 
+&sdhc2 {
+       status = "okay";
+       cd-gpios = <&tlmm 95 GPIO_ACTIVE_LOW>;
+
+       vmmc-supply = <&vreg_l21a_2p95>;
+       vqmmc-supply = <&vreg_l13a_2p95>;
+
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&sdc2_on &sdc2_cd>;
+       pinctrl-1 = <&sdc2_off &sdc2_cd>;
+};
+
+&stm {
+       status = "okay";
+};
+
 &ufshc {
-       status = "ok";
+       status = "okay";
+       vcc-supply = <&vreg_l20a_2p95>;
+       vccq-supply = <&vreg_l26a_1p2>;
+       vccq2-supply = <&vreg_s4a_1p8>;
+       vcc-max-microamp = <750000>;
+       vccq-max-microamp = <560000>;
+       vccq2-max-microamp = <750000>;
 };
 
 &ufsphy {
-       status = "ok";
+       status = "okay";
+       vdda-phy-supply = <&vreg_l1a_0p875>;
+       vdda-pll-supply = <&vreg_l2a_1p2>;
+       vddp-ref-clk-supply = <&vreg_l26a_1p2>;
+};
+
+&usb3 {
+       status = "okay";
 };
 
 &usb3_dwc3 {
        extcon = <&extcon_usb>;
 };
 
+&usb3phy {
+       status = "okay";
+
+       vdda-phy-supply = <&vreg_l1a_0p875>;
+       vdda-pll-supply = <&vreg_l2a_1p2>;
+};
+
 /* GT9286 analog supply */
 &vreg_l28_3p0 {
        regulator-min-microvolt = <2800000>;
        regulator-max-microvolt = <2800000>;
 };
+
+&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>;
+};
index 1eb406b..38389c6 100644 (file)
 
        keyboard@3a {
                compatible = "hid-over-i2c";
-               interrupt-parent = <&tlmm>;
-               interrupts = <0x79 IRQ_TYPE_LEVEL_LOW>;
                reg = <0x3a>;
-               hid-descr-addr = <0x0001>;
-
                pinctrl-names = "default";
                pinctrl-0 = <&touchpad>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <121 IRQ_TYPE_LEVEL_LOW>;
+
+               hid-descr-addr = <0x0001>;
        };
 };
 
index f55f6f3..cf81c33 100644 (file)
 
        keyboard@3a {
                compatible = "hid-over-i2c";
-               interrupt-parent = <&tlmm>;
-               interrupts = <0x79 IRQ_TYPE_LEVEL_LOW>;
                reg = <0x3a>;
-               hid-descr-addr = <0x0001>;
-
                pinctrl-names = "default";
                pinctrl-0 = <&touchpad>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <121 IRQ_TYPE_LEVEL_LOW>;
+
+               hid-descr-addr = <0x0001>;
        };
 };
 
index 66540d2..a3ca581 100644 (file)
 
 /dts-v1/;
 
-#include "msm8998-mtp.dtsi"
+#include "msm8998.dtsi"
+#include "pm8005.dtsi"
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
 
 / {
        model = "Qualcomm Technologies, Inc. MSM8998 v1 MTP";
-       compatible = "qcom,msm8998-mtp";
+       compatible = "qcom,msm8998-mtp", "qcom,msm8998";
 
        qcom,board-id = <8 0>;
+
+       aliases {
+               serial0 = &blsp2_uart1;
+               serial1 = &blsp1_uart3;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-always-on;
+               regulator-boot-on;
+       };
+};
+
+&blsp1_uart3 {
+       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>;
+       };
+};
+
+&blsp1_uart3_on {
+       rx {
+               /delete-property/ bias-disable;
+               /*
+                * Configure a pull-up on 45 (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;
+       };
+
+       cts {
+               /delete-property/ bias-disable;
+               /*
+                * Configure a pull-down on 47 (CTS) to match the pull
+                * of the Bluetooth module.
+                */
+               bias-pull-down;
+       };
+};
+
+&blsp2_uart1 {
+       status = "okay";
+};
+
+&etf {
+       status = "okay";
+};
+
+&etm1 {
+       status = "okay";
+};
+
+&etm2 {
+       status = "okay";
+};
+
+&etm3 {
+       status = "okay";
+};
+
+&etm4 {
+       status = "okay";
+};
+
+&etm5 {
+       status = "okay";
+};
+
+&etm6 {
+       status = "okay";
+};
+
+&etm7 {
+       status = "okay";
+};
+
+&etm8 {
+       status = "okay";
+};
+
+&etr {
+       status = "okay";
+};
+
+&funnel1 {
+       status = "okay";
+};
+
+&funnel2 {
+       status = "okay";
+};
+
+&funnel3 {
+       status = "okay";
+};
+
+&funnel4 {
+       // FIXME: Figure out why clock late_initcall crashes the board with
+       // this enabled.
+       // status = "okay";
+};
+
+&funnel5 {
+       // FIXME: Figure out why clock late_initcall crashes the board with
+       // this enabled.
+       // status = "okay";
+};
+
+&pcie0 {
+       status = "okay";
+};
+
+&pcie_phy {
+       status = "okay";
+};
+
+&pm8005_regulators {
+       vdd_s1-supply = <&vph_pwr>;
+
+       pm8005_s1: s1 { /* VDD_GFX supply */
+               regulator-min-microvolt = <524000>;
+               regulator-max-microvolt = <1100000>;
+               regulator-enable-ramp-delay = <500>;
+
+               /* Hack until we rig up the gpu consumer */
+               regulator-always-on;
+       };
+};
+
+&qusb2phy {
+       status = "okay";
+
+       vdda-pll-supply = <&vreg_l12a_1p8>;
+       vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
+};
+
+&replicator1 {
+       status = "okay";
+};
+
+&rpm_requests {
+       pm8998-regulators {
+               compatible = "qcom,rpm-pm8998-regulators";
+
+               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 = <&vreg_s5a_2p04>;
+               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>;
+               vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
+
+               vreg_s3a_1p35: s3 {
+                       regulator-min-microvolt = <1352000>;
+                       regulator-max-microvolt = <1352000>;
+               };
+
+               vreg_s4a_1p8: s4 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_s5a_2p04: s5 {
+                       regulator-min-microvolt = <1904000>;
+                       regulator-max-microvolt = <2040000>;
+               };
+
+               vreg_s7a_1p025: s7 {
+                       regulator-min-microvolt = <900000>;
+                       regulator-max-microvolt = <1028000>;
+               };
+
+               vreg_l1a_0p875: l1 {
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+               };
+
+               vreg_l2a_1p2: l2 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+               };
+
+               vreg_l3a_1p0: l3 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1000000>;
+               };
+
+               vreg_l5a_0p8: l5 {
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+               };
+
+               vreg_l6a_1p8: l6 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <1808000>;
+               };
+
+               vreg_l7a_1p8: l7 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_l8a_1p2: l8 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+               };
+
+               vreg_l9a_1p8: l9 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <2960000>;
+               };
+
+               vreg_l10a_1p8: l10 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <2960000>;
+               };
+
+               vreg_l11a_1p0: l11 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1000000>;
+               };
+
+               vreg_l12a_1p8: l12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_l13a_2p95: l13 {
+                       regulator-min-microvolt = <1808000>;
+                       regulator-max-microvolt = <2960000>;
+               };
+
+               vreg_l14a_1p88: l14 {
+                       regulator-min-microvolt = <1880000>;
+                       regulator-max-microvolt = <1880000>;
+               };
+
+               vreg_l15a_1p8: l15 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+               };
+
+               vreg_l16a_2p7: l16 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2704000>;
+               };
+
+               vreg_l17a_1p3: l17 {
+                       regulator-min-microvolt = <1304000>;
+                       regulator-max-microvolt = <1304000>;
+               };
+
+               vreg_l18a_2p7: l18 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2704000>;
+               };
+
+               vreg_l19a_3p0: l19 {
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3008000>;
+               };
+
+               vreg_l20a_2p95: l20 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l21a_2p95: l21 {
+                       regulator-min-microvolt = <2960000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-system-load = <800000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l22a_2p85: l22 {
+                       regulator-min-microvolt = <2864000>;
+                       regulator-max-microvolt = <2864000>;
+               };
+
+               vreg_l23a_3p3: l23 {
+                       regulator-min-microvolt = <3312000>;
+                       regulator-max-microvolt = <3312000>;
+               };
+
+               vreg_l24a_3p075: l24 {
+                       regulator-min-microvolt = <3088000>;
+                       regulator-max-microvolt = <3088000>;
+               };
+
+               vreg_l25a_3p3: l25 {
+                       regulator-min-microvolt = <3104000>;
+                       regulator-max-microvolt = <3312000>;
+               };
+
+               vreg_l26a_1p2: l26 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l28_3p0: l28 {
+                       regulator-min-microvolt = <3008000>;
+                       regulator-max-microvolt = <3008000>;
+               };
+
+               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-regulators {
+               compatible = "qcom,rpm-pmi8998-regulators";
+
+               vdd_bob-supply = <&vph_pwr>;
+
+               vreg_bob: bob {
+                       regulator-min-microvolt = <3312000>;
+                       regulator-max-microvolt = <3600000>;
+               };
+       };
+};
+
+&remoteproc_adsp {
+       status = "okay";
+};
+
+&remoteproc_mss {
+       status = "okay";
+};
+
+&remoteproc_slpi {
+       status = "okay";
+};
+
+&tlmm {
+       gpio-reserved-ranges = <0 4>, <81 4>;
+};
+
+&sdhc2 {
+       status = "okay";
+       cd-gpios = <&tlmm 95 GPIO_ACTIVE_LOW>;
+
+       vmmc-supply = <&vreg_l21a_2p95>;
+       vqmmc-supply = <&vreg_l13a_2p95>;
+
+       pinctrl-names = "default", "sleep";
+       pinctrl-0 = <&sdc2_on &sdc2_cd>;
+       pinctrl-1 = <&sdc2_off &sdc2_cd>;
+};
+
+&stm {
+       status = "okay";
+};
+
+&ufshc {
+       status = "okay";
+       vcc-supply = <&vreg_l20a_2p95>;
+       vccq-supply = <&vreg_l26a_1p2>;
+       vccq2-supply = <&vreg_s4a_1p8>;
+       vcc-max-microamp = <750000>;
+       vccq-max-microamp = <560000>;
+       vccq2-max-microamp = <750000>;
+};
+
+&ufsphy {
+       status = "okay";
+       vdda-phy-supply = <&vreg_l1a_0p875>;
+       vdda-pll-supply = <&vreg_l2a_1p2>;
+       vddp-ref-clk-supply = <&vreg_l26a_1p2>;
+};
+
+&usb3 {
+       status = "okay";
+};
+
+&usb3_dwc3 {
+       dr_mode = "host"; /* Force to host until we have Type-C hooked up */
+};
+
+&usb3phy {
+       status = "okay";
+
+       vdda-phy-supply = <&vreg_l1a_0p875>;
+       vdda-pll-supply = <&vreg_l2a_1p2>;
+};
+
+&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>;
 };
diff --git a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
deleted file mode 100644 (file)
index af67c64..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved. */
-
-#include "msm8998.dtsi"
-#include "pm8998.dtsi"
-#include "pmi8998.dtsi"
-#include "pm8005.dtsi"
-
-/ {
-       aliases {
-               serial0 = &blsp2_uart1;
-               serial1 = &blsp1_uart3;
-       };
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       vph_pwr: vph-pwr-regulator {
-               compatible = "regulator-fixed";
-               regulator-name = "vph_pwr";
-               regulator-always-on;
-               regulator-boot-on;
-       };
-};
-
-&blsp1_uart3 {
-       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>;
-       };
-};
-
-&blsp2_uart1 {
-       status = "okay";
-};
-
-&etf {
-       status = "okay";
-};
-
-&etm1 {
-       status = "okay";
-};
-
-&etm2 {
-       status = "okay";
-};
-
-&etm3 {
-       status = "okay";
-};
-
-&etm4 {
-       status = "okay";
-};
-
-&etm5 {
-       status = "okay";
-};
-
-&etm6 {
-       status = "okay";
-};
-
-&etm7 {
-       status = "okay";
-};
-
-&etm8 {
-       status = "okay";
-};
-
-&etr {
-       status = "okay";
-};
-
-&funnel1 {
-       status = "okay";
-};
-
-&funnel2 {
-       status = "okay";
-};
-
-&funnel3 {
-       status = "okay";
-};
-
-&funnel4 {
-       // FIXME: Figure out why clock late_initcall crashes the board with
-       // this enabled.
-       // status = "okay";
-};
-
-&funnel5 {
-       // FIXME: Figure out why clock late_initcall crashes the board with
-       // this enabled.
-       // status = "okay";
-};
-
-&pcie0 {
-       status = "okay";
-};
-
-&pcie_phy {
-       status = "okay";
-};
-
-&pm8005_lsid1 {
-       pm8005-regulators {
-               compatible = "qcom,pm8005-regulators";
-
-               vdd_s1-supply = <&vph_pwr>;
-
-               pm8005_s1: s1 { /* VDD_GFX supply */
-                       regulator-min-microvolt = <524000>;
-                       regulator-max-microvolt = <1100000>;
-                       regulator-enable-ramp-delay = <500>;
-
-                       /* hack until we rig up the gpu consumer */
-                       regulator-always-on;
-               };
-       };
-};
-
-&qusb2phy {
-       status = "okay";
-
-       vdda-pll-supply = <&vreg_l12a_1p8>;
-       vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
-};
-
-&replicator1 {
-       status = "okay";
-};
-
-&rpm_requests {
-       pm8998-regulators {
-               compatible = "qcom,rpm-pm8998-regulators";
-
-               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 = <&vreg_s5a_2p04>;
-               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>;
-               vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
-
-               vreg_s3a_1p35: s3 {
-                       regulator-min-microvolt = <1352000>;
-                       regulator-max-microvolt = <1352000>;
-               };
-               vreg_s4a_1p8: s4 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1800000>;
-                       regulator-allow-set-load;
-               };
-               vreg_s5a_2p04: s5 {
-                       regulator-min-microvolt = <1904000>;
-                       regulator-max-microvolt = <2040000>;
-               };
-               vreg_s7a_1p025: s7 {
-                       regulator-min-microvolt = <900000>;
-                       regulator-max-microvolt = <1028000>;
-               };
-               vreg_l1a_0p875: l1 {
-                       regulator-min-microvolt = <880000>;
-                       regulator-max-microvolt = <880000>;
-               };
-               vreg_l2a_1p2: l2 {
-                       regulator-min-microvolt = <1200000>;
-                       regulator-max-microvolt = <1200000>;
-               };
-               vreg_l3a_1p0: l3 {
-                       regulator-min-microvolt = <1000000>;
-                       regulator-max-microvolt = <1000000>;
-               };
-               vreg_l5a_0p8: l5 {
-                       regulator-min-microvolt = <800000>;
-                       regulator-max-microvolt = <800000>;
-               };
-               vreg_l6a_1p8: l6 {
-                       regulator-min-microvolt = <1808000>;
-                       regulator-max-microvolt = <1808000>;
-               };
-               vreg_l7a_1p8: l7 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1800000>;
-               };
-               vreg_l8a_1p2: l8 {
-                       regulator-min-microvolt = <1200000>;
-                       regulator-max-microvolt = <1200000>;
-               };
-               vreg_l9a_1p8: l9 {
-                       regulator-min-microvolt = <1808000>;
-                       regulator-max-microvolt = <2960000>;
-               };
-               vreg_l10a_1p8: l10 {
-                       regulator-min-microvolt = <1808000>;
-                       regulator-max-microvolt = <2960000>;
-               };
-               vreg_l11a_1p0: l11 {
-                       regulator-min-microvolt = <1000000>;
-                       regulator-max-microvolt = <1000000>;
-               };
-               vreg_l12a_1p8: l12 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1800000>;
-               };
-               vreg_l13a_2p95: l13 {
-                       regulator-min-microvolt = <1808000>;
-                       regulator-max-microvolt = <2960000>;
-               };
-               vreg_l14a_1p88: l14 {
-                       regulator-min-microvolt = <1880000>;
-                       regulator-max-microvolt = <1880000>;
-               };
-               vreg_l15a_1p8: l15 {
-                       regulator-min-microvolt = <1800000>;
-                       regulator-max-microvolt = <1800000>;
-               };
-               vreg_l16a_2p7: l16 {
-                       regulator-min-microvolt = <2704000>;
-                       regulator-max-microvolt = <2704000>;
-               };
-               vreg_l17a_1p3: l17 {
-                       regulator-min-microvolt = <1304000>;
-                       regulator-max-microvolt = <1304000>;
-               };
-               vreg_l18a_2p7: l18 {
-                       regulator-min-microvolt = <2704000>;
-                       regulator-max-microvolt = <2704000>;
-               };
-               vreg_l19a_3p0: l19 {
-                       regulator-min-microvolt = <3008000>;
-                       regulator-max-microvolt = <3008000>;
-               };
-               vreg_l20a_2p95: l20 {
-                       regulator-min-microvolt = <2960000>;
-                       regulator-max-microvolt = <2960000>;
-                       regulator-allow-set-load;
-               };
-               vreg_l21a_2p95: l21 {
-                       regulator-min-microvolt = <2960000>;
-                       regulator-max-microvolt = <2960000>;
-                       regulator-allow-set-load;
-                       regulator-system-load = <800000>;
-               };
-               vreg_l22a_2p85: l22 {
-                       regulator-min-microvolt = <2864000>;
-                       regulator-max-microvolt = <2864000>;
-               };
-               vreg_l23a_3p3: l23 {
-                       regulator-min-microvolt = <3312000>;
-                       regulator-max-microvolt = <3312000>;
-               };
-               vreg_l24a_3p075: l24 {
-                       regulator-min-microvolt = <3088000>;
-                       regulator-max-microvolt = <3088000>;
-               };
-               vreg_l25a_3p3: l25 {
-                       regulator-min-microvolt = <3104000>;
-                       regulator-max-microvolt = <3312000>;
-               };
-               vreg_l26a_1p2: l26 {
-                       regulator-min-microvolt = <1200000>;
-                       regulator-max-microvolt = <1200000>;
-                       regulator-allow-set-load;
-               };
-               vreg_l28_3p0: l28 {
-                       regulator-min-microvolt = <3008000>;
-                       regulator-max-microvolt = <3008000>;
-               };
-
-               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-regulators {
-               compatible = "qcom,rpm-pmi8998-regulators";
-
-               vdd_bob-supply = <&vph_pwr>;
-
-               vreg_bob: bob {
-                       regulator-min-microvolt = <3312000>;
-                       regulator-max-microvolt = <3600000>;
-               };
-       };
-};
-
-&remoteproc_adsp {
-       status = "okay";
-};
-
-&remoteproc_mss {
-       status = "okay";
-};
-
-&remoteproc_slpi {
-       status = "okay";
-};
-
-&tlmm {
-       gpio-reserved-ranges = <0 4>, <81 4>;
-};
-
-&sdhc2 {
-       status = "okay";
-       cd-gpios = <&tlmm 95 GPIO_ACTIVE_LOW>;
-
-       vmmc-supply = <&vreg_l21a_2p95>;
-       vqmmc-supply = <&vreg_l13a_2p95>;
-
-       pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc2_clk_on  &sdc2_cmd_on  &sdc2_data_on  &sdc2_cd_on>;
-       pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
-};
-
-&stm {
-       status = "okay";
-};
-
-&ufshc {
-       status = "okay";
-       vcc-supply = <&vreg_l20a_2p95>;
-       vccq-supply = <&vreg_l26a_1p2>;
-       vccq2-supply = <&vreg_s4a_1p8>;
-       vcc-max-microamp = <750000>;
-       vccq-max-microamp = <560000>;
-       vccq2-max-microamp = <750000>;
-};
-
-&ufsphy {
-       status = "okay";
-       vdda-phy-supply = <&vreg_l1a_0p875>;
-       vdda-pll-supply = <&vreg_l2a_1p2>;
-       vddp-ref-clk-supply = <&vreg_l26a_1p2>;
-};
-
-&usb3 {
-       status = "okay";
-};
-
-&usb3_dwc3 {
-       dr_mode = "host"; /* Force to host until we have Type-C hooked up */
-};
-
-&usb3phy {
-       status = "okay";
-
-       vdda-phy-supply = <&vreg_l1a_0p875>;
-       vdda-pll-supply = <&vreg_l2a_1p2>;
-};
-
-&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>;
-};
-
-/* PINCTRL - board-specific pinctrl */
-&blsp1_uart3_on {
-       rx {
-               /delete-property/ bias-disable;
-               /*
-                * Configure a pull-up on 45 (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;
-       };
-
-       cts {
-               /delete-property/ bias-disable;
-               /*
-                * Configure a pull-down on 47 (CTS) to match the pull
-                * of the Bluetooth module.
-                */
-               bias-pull-down;
-       };
-};
index 9563eb6..ef2a88a 100644 (file)
@@ -32,7 +32,7 @@
 };
 
 &pmi8998_gpio {
-       button_backlight_default: button-backlight-default {
+       button_backlight_default: button-backlight-state {
                pinconf {
                        pins = "gpio5";
                        function = "normal";
index dbaea36..62bda23 100644 (file)
@@ -11,9 +11,9 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include "msm8998.dtsi"
+#include "pm8005.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
-#include "pm8005.dtsi"
 
 / {
        /* Required for bootloader to select correct board */
                        height = <1920>;
                        stride = <(1080 * 4)>;
                        format = "a8r8g8b8";
+                       /*
+                       * That's a lot of clocks, but it's necessary due
+                       * to unused clk cleanup & no panel driver yet..
+                       */
+                       clocks = <&mmcc MDSS_AHB_CLK>,
+                                <&mmcc MDSS_AXI_CLK>,
+                                <&mmcc MDSS_VSYNC_CLK>,
+                                <&mmcc MDSS_MDP_CLK>,
+                                <&mmcc MDSS_BYTE0_CLK>,
+                                <&mmcc MDSS_BYTE0_INTF_CLK>,
+                                <&mmcc MDSS_PCLK0_CLK>,
+                                <&mmcc MDSS_ESC0_CLK>;
+                       power-domains = <&mmcc MDSS_GDSC>;
                };
        };
 
@@ -77,7 +90,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&vol_keys_default>;
 
-               vol-down {
+               button-vol-down {
                        label = "Volume down";
                        gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
@@ -85,7 +98,7 @@
                        wakeup-source;
                };
 
-               vol-up {
+               button-vol-up {
                        label = "Volume up";
                        gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
                pinctrl-names = "default";
                pinctrl-0 = <&hall_sensor_default>;
 
-               hall-sensor {
+               event-hall-sensor {
                        label = "Hall Effect Sensor";
                        gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
        status = "okay";
 };
 
-&pm8005_lsid1 {
-       pm8005-regulators {
-               compatible = "qcom,pm8005-regulators";
-
-               vdd_s1-supply = <&vph_pwr>;
-
-               pm8005_s1: s1 { /* VDD_GFX supply */
-                       regulator-min-microvolt = <524000>;
-                       regulator-max-microvolt = <1100000>;
-                       regulator-enable-ramp-delay = <500>;
-
-                       /* hack until we rig up the gpu consumer */
-                       regulator-always-on;
-               };
+&pm8005_regulators {
+       /* VDD_GFX supply */
+       pm8005_s1: s1 {
+               regulator-min-microvolt = <524000>;
+               regulator-max-microvolt = <1100000>;
+               regulator-enable-ramp-delay = <500>;
+               /* Hack until we rig up the gpu consumer */
+               regulator-always-on;
        };
 };
 
 &pm8998_gpio {
-       vol_keys_default: vol-keys-default {
-               pinconf {
-                       pins = "gpio5", "gpio6";
-                       function = "normal";
-                       bias-pull-up;
-                       input-enable;
-                       qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
-               };
+       vol_keys_default: vol-keys-state {
+               pins = "gpio5", "gpio6";
+               function = "normal";
+               bias-pull-up;
+               input-enable;
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
        };
 };
 
                        regulator-min-microvolt = <1352000>;
                        regulator-max-microvolt = <1352000>;
                };
+
                vreg_s4a_1p8: s4 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                        regulator-allow-set-load;
                };
+
                vreg_s5a_2p04: s5 {
                        regulator-min-microvolt = <1904000>;
                        regulator-max-microvolt = <2040000>;
                };
+
                vreg_s7a_1p025: s7 {
                        regulator-min-microvolt = <900000>;
                        regulator-max-microvolt = <1028000>;
                };
+
                vreg_l1a_0p875: l1 {
                        regulator-min-microvolt = <880000>;
                        regulator-max-microvolt = <880000>;
                };
+
                vreg_l2a_1p2: l2 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                };
+
                vreg_l3a_1p0: l3 {
                        regulator-min-microvolt = <1000000>;
                        regulator-max-microvolt = <1000000>;
                };
+
                vreg_l5a_0p8: l5 {
                        regulator-min-microvolt = <800000>;
                        regulator-max-microvolt = <800000>;
                };
+
                vreg_l6a_1p8: l6 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <1808000>;
                };
+
                vreg_l7a_1p8: l7 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                };
+
                vreg_l8a_1p2: l8 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                };
+
                vreg_l9a_1p8: l9 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <2960000>;
                };
+
                vreg_l10a_1p8: l10 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <2960000>;
                };
+
                vreg_l11a_1p0: l11 {
                        regulator-min-microvolt = <1000000>;
                        regulator-max-microvolt = <1000000>;
                };
+
                vreg_l12a_1p8: l12 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                };
+
                vreg_l13a_2p95: l13 {
                        regulator-min-microvolt = <1808000>;
                        regulator-max-microvolt = <2960000>;
                };
+
                vreg_l14a_1p88: l14 {
                        regulator-min-microvolt = <1880000>;
                        regulator-max-microvolt = <1880000>;
                };
+
                vreg_l15a_1p8: l15 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                };
+
                vreg_l16a_2p7: l16 {
                        regulator-min-microvolt = <2704000>;
                        regulator-max-microvolt = <2704000>;
                };
+
                vreg_l17a_1p3: l17 {
                        regulator-min-microvolt = <1304000>;
                        regulator-max-microvolt = <1304000>;
                };
+
                vreg_l18a_2p7: l18 {
                        regulator-min-microvolt = <2704000>;
                        regulator-max-microvolt = <2704000>;
                };
+
                vreg_l19a_3p0: l19 {
                        regulator-min-microvolt = <3008000>;
                        regulator-max-microvolt = <3008000>;
                };
+
                vreg_l20a_2p95: l20 {
                        regulator-min-microvolt = <2960000>;
                        regulator-max-microvolt = <2960000>;
                vreg_l21a_2p95: l21 {
                        regulator-min-microvolt = <2960000>;
                        regulator-max-microvolt = <2960000>;
-                       regulator-allow-set-load;
                        regulator-system-load = <800000>;
+                       regulator-allow-set-load;
                };
+
                vreg_l22a_2p85: l22 {
                        regulator-min-microvolt = <2864000>;
                        regulator-max-microvolt = <2864000>;
                };
+
                vreg_l23a_3p3: l23 {
                        regulator-min-microvolt = <3312000>;
                        regulator-max-microvolt = <3312000>;
                };
+
                vreg_l24a_3p075: l24 {
                        regulator-min-microvolt = <3088000>;
                        regulator-max-microvolt = <3088000>;
                };
+
                vreg_l25a_3p3: l25 {
                        regulator-min-microvolt = <3104000>;
                        regulator-max-microvolt = <3312000>;
                };
+
                vreg_l26a_1p2: l26 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                        regulator-allow-set-load;
                };
+
                vreg_l28_3p0: l28 {
                        regulator-min-microvolt = <3008000>;
                        regulator-max-microvolt = <3008000>;
                };
+
                vreg_lvs1a_1p8: lvs1 { };
                vreg_lvs2a_1p8: lvs2 { };
        };
index caacb7c..fcaefc1 100644 (file)
@@ -29,3 +29,7 @@
        regulator-min-microvolt = <2800000>;
        regulator-max-microvolt = <2800000>;
 };
+
+&vreg_lvs1a_1p8 {
+       status = "disabled";
+};
index 978495a..20fe039 100644 (file)
@@ -38,7 +38,7 @@
 };
 
 &pmi8998_gpio {
-       disp_dvdd_en: disp-dvdd-en-active {
+       disp_dvdd_en: disp-dvdd-en-active-state {
                pins = "gpio10";
                function = "normal";
                bias-disable;
index 47488a1..d086390 100644 (file)
@@ -5,15 +5,13 @@
  * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
  */
 
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include "msm8998.dtsi"
 #include "pm8005.dtsi"
 #include "pm8998.dtsi"
 #include "pmi8998.dtsi"
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/leds/common.h>
-#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
-#include <dt-bindings/sound/qcom,q6afe.h>
-#include <dt-bindings/sound/qcom,q6asm.h>
 
 / {
        /* required for bootloader to select correct board */
@@ -21,8 +19,6 @@
        qcom,board-id = <8 0>;
 
        clocks {
-               compatible = "simple-bus";
-
                div1_mclk: divclk1 {
                        compatible = "gpio-gate-clock";
                        pinctrl-0 = <&audio_mclk_pin>;
                regulator-boot-on;
        };
 
+       extcon_usb: extcon-usb {
+               compatible = "linux,extcon-usb-gpio";
+               id-gpio = <&tlmm 38 GPIO_ACTIVE_HIGH>;
+               vbus-gpio = <&tlmm 128 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&usb_extcon_active &usb_vbus_active>;
+       };
+
        gpio-keys {
                compatible = "gpio-keys";
                label = "Side buttons";
                pinctrl-names = "default";
                pinctrl-0 = <&vol_down_pin_a>, <&cam_focus_pin_a>,
                            <&cam_snapshot_pin_a>;
-               vol-down {
+               button-vol-down {
                        label = "Volume Down";
                        gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                        debounce-interval = <15>;
                };
 
-               camera-snapshot {
+               button-camera-snapshot {
                        label = "Camera Snapshot";
                        gpios = <&pm8998_gpio 7 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                        debounce-interval = <15>;
                };
 
-               camera-focus {
+               button-camera-focus {
                        label = "Camera Focus";
                        gpios = <&pm8998_gpio 8 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_KEY>;
                pinctrl-names = "default";
                pinctrl-0 = <&hall_sensor0_default>;
 
-               hall-sensor0 {
+               event-hall-sensor0 {
                        label = "Cover Hall Sensor";
                        gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
        status = "okay";
 };
 
+&blsp2_i2c2 {
+       status = "okay";
+
+       proximity@29 {
+               compatible = "st,vl53l0x";
+               reg = <0x29>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <22 IRQ_TYPE_EDGE_FALLING>;
+
+               reset-gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
+               vdd-supply = <&cam_vio_vreg>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&tof_int &tof_reset>;
+       };
+};
+
 &ibb {
        regulator-min-microamp = <800000>;
        regulator-max-microamp = <800000>;
        regulator-soft-start;
 };
 
-&mmcc {
-       status = "ok";
-};
-
-&mmss_smmu {
-       status = "ok";
-};
-
-&pm8005_lsid1 {
-       pm8005-regulators {
-               compatible = "qcom,pm8005-regulators";
-
-               vdd_s1-supply = <&vph_pwr>;
-
-               /* VDD_GFX supply */
-               pm8005_s1: s1 {
-                       regulator-min-microvolt = <524000>;
-                       regulator-max-microvolt = <1088000>;
-                       regulator-enable-ramp-delay = <500>;
-                       regulator-always-on;
-               };
+&pm8005_regulators {
+       /* VDD_GFX supply */
+       pm8005_s1: s1 {
+               regulator-min-microvolt = <524000>;
+               regulator-max-microvolt = <1088000>;
+               regulator-enable-ramp-delay = <500>;
+               /* Hack until we rig up the gpu consumer */
+               regulator-always-on;
        };
 };
 
 &pm8998_gpio {
-       vol_down_pin_a: vol-down-active {
+       vol_down_pin_a: vol-down-active-state {
                pins = "gpio5";
                function = PMIC_GPIO_FUNC_NORMAL;
                bias-pull-up;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
        };
 
-       cam_focus_pin_a: cam-focus-btn-active {
+       cam_focus_pin_a: cam-focus-btn-active-state {
                pins = "gpio7";
                function = PMIC_GPIO_FUNC_NORMAL;
                bias-pull-up;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
        };
 
-       cam_snapshot_pin_a: cam-snapshot-btn-active {
+       cam_snapshot_pin_a: cam-snapshot-btn-active-state {
                pins = "gpio8";
                function = PMIC_GPIO_FUNC_NORMAL;
                bias-pull-up;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
        };
 
-       audio_mclk_pin: audio-mclk-pin-active {
+       audio_mclk_pin: audio-mclk-pin-active-state {
                pins = "gpio13";
                function = "func2";
                power-source = <0>;
 };
 
 &pmi8998_gpio {
-       cam_vio_default: cam-vio-active {
+       cam_vio_default: cam-vio-active-state {
                pins = "gpio1";
                function = PMIC_GPIO_FUNC_NORMAL;
                bias-disable;
                power-source = <1>;
        };
 
-       vib_default: vib-en {
+       vib_default: vib-en-state {
                pins = "gpio5";
                function = PMIC_GPIO_FUNC_NORMAL;
                bias-disable;
        vqmmc-supply = <&vreg_l13a_2p95>;
 
        pinctrl-names = "default", "sleep";
-       pinctrl-0 = <&sdc2_clk_on  &sdc2_cmd_on  &sdc2_data_on  &sdc2_cd_on>;
-       pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
+       pinctrl-0 = <&sdc2_on &sdc2_cd>;
+       pinctrl-1 = <&sdc2_off &sdc2_cd>;
 };
 
 &tlmm {
                drive-strength = <2>;
        };
 
+       tof_int: tof-int {
+               pins = "gpio22";
+               function = "gpio";
+               bias-pull-up;
+               drive-strength = <2>;
+               input-enable;
+       };
+
        cam1_vdig_default: cam1-vdig-default {
                pins = "gpio25";
                function = "gpio";
                drive-strength = <2>;
        };
 
+       usb_extcon_active: usb-extcon-active {
+               pins = "gpio38";
+               function = "gpio";
+               bias-disable;
+               drive-strength = <16>;
+       };
+
+       tof_reset: tof-reset {
+               pins = "gpio27";
+               function = "gpio";
+               bias-disable;
+               drive-strength = <2>;
+       };
+
        hall_sensor0_default: acc-cover-open {
                pins = "gpio124";
                function = "gpio";
                bias-pull-up;
        };
 
+       usb_vbus_active: usb-vbus-active {
+               pins = "gpio128";
+               function = "gpio";
+               bias-disable;
+               drive-strength = <2>;
+               output-low;
+       };
+
        ts_vddio_en: ts-vddio-en-default {
                pins = "gpio133";
                function = "gpio";
 &usb3_dwc3 {
        /* Force to peripheral until we have Type-C hooked up */
        dr_mode = "peripheral";
+       extcon = <&extcon_usb>;
 };
 
 &usb3phy {
index 758c45b..02d21bf 100644 (file)
                };
 
                qfprom: qfprom@784000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,msm8998-qfprom", "qcom,qfprom";
                        reg = <0x00784000 0x621c>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        interrupts = <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "msi";
                        interrupt-map-mask = <0 0 0 0x7>;
-                       interrupt-map = <0 0 0 1 &intc 0 0 135 IRQ_TYPE_LEVEL_HIGH>,
+                       interrupt-map = <0 0 0 1 &intc 0 0 135 IRQ_TYPE_LEVEL_HIGH>,
                                        <0 0 0 2 &intc 0 0 136 IRQ_TYPE_LEVEL_HIGH>,
                                        <0 0 0 3 &intc 0 0 138 IRQ_TYPE_LEVEL_HIGH>,
                                        <0 0 0 4 &intc 0 0 139 IRQ_TYPE_LEVEL_HIGH>;
                        reg = <0x03400000 0xc00000>;
                        interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
                        gpio-controller;
-                       #gpio-cells = <0x2>;
+                       #gpio-cells = <2>;
                        interrupt-controller;
-                       #interrupt-cells = <0x2>;
+                       #interrupt-cells = <2>;
 
-                       sdc2_clk_on: sdc2_clk_on {
-                               config {
+                       sdc2_on: sdc2-on {
+                               clk {
                                        pins = "sdc2_clk";
-                                       bias-disable;
                                        drive-strength = <16>;
-                               };
-                       };
-
-                       sdc2_clk_off: sdc2_clk_off {
-                               config {
-                                       pins = "sdc2_clk";
                                        bias-disable;
-                                       drive-strength = <2>;
                                };
-                       };
 
-                       sdc2_cmd_on: sdc2_cmd_on {
-                               config {
+                               cmd {
                                        pins = "sdc2_cmd";
-                                       bias-pull-up;
                                        drive-strength = <10>;
-                               };
-                       };
-
-                       sdc2_cmd_off: sdc2_cmd_off {
-                               config {
-                                       pins = "sdc2_cmd";
                                        bias-pull-up;
-                                       drive-strength = <2>;
                                };
-                       };
 
-                       sdc2_data_on: sdc2_data_on {
-                               config {
+                               data {
                                        pins = "sdc2_data";
-                                       bias-pull-up;
                                        drive-strength = <10>;
+                                       bias-pull-up;
                                };
                        };
 
-                       sdc2_data_off: sdc2_data_off {
-                               config {
-                                       pins = "sdc2_data";
-                                       bias-pull-up;
+                       sdc2_off: sdc2-off {
+                               clk {
+                                       pins = "sdc2_clk";
                                        drive-strength = <2>;
+                                       bias-disable;
                                };
-                       };
 
-                       sdc2_cd_on: sdc2_cd_on {
-                               mux {
-                                       pins = "gpio95";
-                                       function = "gpio";
+                               cmd {
+                                       pins = "sdc2_cmd";
+                                       drive-strength = <2>;
+                                       bias-pull-up;
                                };
 
-                               config {
-                                       pins = "gpio95";
-                                       bias-pull-up;
+                               data {
+                                       pins = "sdc2_data";
                                        drive-strength = <2>;
+                                       bias-pull-up;
                                };
                        };
 
-                       sdc2_cd_off: sdc2_cd_off {
-                               mux {
-                                       pins = "gpio95";
-                                       function = "gpio";
-                               };
-
-                               config {
-                                       pins = "gpio95";
-                                       bias-pull-up;
-                                       drive-strength = <2>;
-                               };
+                       sdc2_cd: sdc2-cd {
+                               pins = "gpio95";
+                               function = "gpio";
+                               bias-pull-up;
+                               drive-strength = <2>;
                        };
 
-                       blsp1_uart3_on: blsp1_uart3_on {
+                       blsp1_uart3_on: blsp1-uart3-on {
                                tx {
                                        pins = "gpio45";
                                        function = "blsp_uart3_a";
                        status = "disabled";
 
                        gpu_opp_table: opp-table {
-                               compatible  = "operating-points-v2";
+                               compatible = "operating-points-v2";
                                opp-710000097 {
                                        opp-hz = /bits/ 64 <710000097>;
                                        opp-level = <RPM_SMD_LEVEL_TURBO>;
                                      <0xc010600 0x128>,
                                      <0xc010800 0x200>;
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "usb3_phy_pipe_clk_src";
                        nvmem-cells = <&qusb2_hstx_trim>;
                };
 
-               sdhc2: sdhci@c0a4900 {
+               sdhc2: mmc@c0a4900 {
                        compatible = "qcom,sdhci-msm-v4";
                        reg = <0x0c0a4900 0x314>, <0x0c0a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        #reset-cells = <1>;
                        #power-domain-cells = <1>;
                        reg = <0xc8c0000 0x40000>;
-                       status = "disabled";
 
                        clock-names = "xo",
                                      "gpll0",
                                 <&mmcc BIMC_SMMU_AXI_CLK>;
                        clock-names = "iface-mm", "iface-smmu",
                                      "bus-mm", "bus-smmu";
-                       status = "disabled";
 
                        #global-interrupts = <0>;
                        interrupts =
index c5d8506..ecf9b99 100644 (file)
                };
 
                pm6350_gpios: gpios@c000 {
-                       compatible = "qcom,pm6350-gpio";
+                       compatible = "qcom,pm6350-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pm6350_gpios 0 0 9>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index c482663..d0eefbb 100644 (file)
                };
 
                pm660_gpios: gpios@c000 {
-                       compatible = "qcom,pm660-gpio";
+                       compatible = "qcom,pm660-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
                        gpio-ranges = <&pm660_gpios 0 0 13>;
index cfef423..c794547 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
+               pm660l_lpg: lpg@b100 {
+                       compatible = "qcom,pm660l-lpg";
+
+                       status = "disabled";
+               };
+
                pm660l_wled: leds@d800 {
                        compatible = "qcom,pm660l-wled";
-                       reg = <0xd800 0xd900>;
+                       reg = <0xd800>, <0xd900>;
                        interrupts = <0x3 0xd8 0x1 IRQ_TYPE_EDGE_RISING>;
                        interrupt-names = "ovp";
                        label = "backlight";
index 3f97607..50fb6c7 100644 (file)
@@ -28,5 +28,9 @@
                reg = <0x5 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm8005_regulators: regulators {
+                       compatible = "qcom,pm8005-regulators";
+               };
        };
 };
index b126d7e..0c2c424 100644 (file)
                };
 
                pm8009_gpios: gpio@c000 {
-                       compatible = "qcom,pm8005-gpio";
+                       compatible = "qcom,pm8005-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pm8009_gpios 0 0 4>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index 0df76f7..fd84342 100644 (file)
                };
 
                pm8150_gpios: gpio@c000 {
-                       compatible = "qcom,pm8150-gpio";
+                       compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pm8150_gpios 0 0 10>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index 058cc51..5d1ec3a 100644 (file)
                };
 
                pm8150b_gpios: gpio@c000 {
-                       compatible = "qcom,pm8150b-gpio";
+                       compatible = "qcom,pm8150b-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pm8150b_gpios 0 0 12>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
                reg = <0x3 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm8150b_lpg: lpg {
+                       compatible = "qcom,pm8150b-lpg";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
        };
 };
index 52f094a..c62d023 100644 (file)
                };
 
                pm8150l_gpios: gpio@c000 {
-                       compatible = "qcom,pm8150l-gpio";
+                       compatible = "qcom,pm8150l-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pm8150l_gpios 0 0 12>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
                reg = <0x5 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm8150l_lpg: lpg {
+                       compatible = "qcom,pm8150l-lpg";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+
        };
 };
index b10f33a..2dfeb99 100644 (file)
                };
 
                pm8350_gpios: gpio@8800 {
-                       compatible = "qcom,pm8350-gpio";
+                       compatible = "qcom,pm8350-gpio", "qcom,spmi-gpio";
                        reg = <0x8800>;
                        gpio-controller;
+                       gpio-ranges = <&pm8350_gpios 0 0 10>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index f1d1d4c..f1c7bd9 100644 (file)
                };
 
                pm8350b_gpios: gpio@8800 {
-                       compatible = "qcom,pm8350b-gpio";
+                       compatible = "qcom,pm8350b-gpio", "qcom,spmi-gpio";
                        reg = <0x8800>;
                        gpio-controller;
+                       gpio-ranges = <&pm8350b_gpios 0 0 8>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index d589024..606c2a6 100644 (file)
                };
 
                pm8916_gpios: gpios@c000 {
-                       compatible = "qcom,pm8916-gpio";
+                       compatible = "qcom,pm8916-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pm8916_gpios 0 0 4>;
                        #gpio-cells = <2>;
-                       interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
-                                    <0 0xc1 0 IRQ_TYPE_NONE>,
-                                    <0 0xc2 0 IRQ_TYPE_NONE>,
-                                    <0 0xc3 0 IRQ_TYPE_NONE>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
        };
 
                #address-cells = <1>;
                #size-cells = <0>;
 
+               pm8916_pwm: pwm {
+                       compatible = "qcom,pm8916-pwm";
+
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+
                pm8916_vib: vibrator@c000 {
                        compatible = "qcom,pm8916-vib";
                        reg = <0xc000>;
index 5ab4611..ab34239 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
+               pm8994_lpg: lpg {
+                       compatible = "qcom,pm8994-lpg";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+
                pm8994_spmi_regulators: regulators {
                        compatible = "qcom,pm8994-regulators";
                };
index 6e7c252..84c4491 100644 (file)
                        interrupt-controller;
                        #interrupt-cells = <2>;
                };
+
+               pmi8994_mpps: mpps@a000 {
+                       compatible = "qcom,pmi8994-mpp";
+                       reg = <0xa000>;
+                       gpio-controller;
+                       gpio-ranges = <&pmi8994_mpps 0 0 4>;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
        };
 
        pmic@3 {
                #address-cells = <1>;
                #size-cells = <0>;
 
+               pmi8994_lpg: lpg {
+                       compatible = "qcom,pmi8994-lpg";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+
                pmi8994_spmi_regulators: regulators {
                        compatible = "qcom,pmi8994-regulators";
                        #address-cells = <1>;
@@ -35,7 +55,7 @@
 
                pmi8994_wled: wled@d800 {
                        compatible = "qcom,pmi8994-wled";
-                       reg = <0xd800 0xd900>;
+                       reg = <0xd800>, <0xd900>;
                        interrupts = <3 0xd8 0x02 IRQ_TYPE_EDGE_RISING>;
                        interrupt-names = "short";
                        qcom,cabc;
index 0fef5f1..6d3d212 100644 (file)
                        };
                };
 
+               pmi8998_lpg: lpg {
+                       compatible = "qcom,pmi8998-lpg";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+
                pmi8998_wled: leds@d800 {
                        compatible = "qcom,pmi8998-wled";
-                       reg = <0xd800 0xd900>;
+                       reg = <0xd800>, <0xd900>;
                        interrupts = <0x3 0xd8 0x1 IRQ_TYPE_EDGE_RISING>,
                                     <0x3 0xd8 0x2 IRQ_TYPE_EDGE_RISING>;
                        interrupt-names = "ovp", "short";
@@ -52,6 +62,5 @@
 
                        status = "disabled";
                };
-
        };
 };
index 7072e5a..68e9122 100644 (file)
                };
 
                pmm8155au_1_gpios: gpio@c000 {
-                       compatible = "qcom,pmm8155au-gpio";
+                       compatible = "qcom,pmm8155au-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
                        #gpio-cells = <2>;
index 7207596..c307fc6 100644 (file)
@@ -89,7 +89,7 @@
                };
 
                pmm8155au_2_gpios: gpio@c000 {
-                       compatible = "qcom,pmm8155au-gpio";
+                       compatible = "qcom,pmm8155au-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
                        #gpio-cells = <2>;
index 6043241..ec24c44 100644 (file)
                };
 
                pmr735b_gpios: gpio@8800 {
-                       compatible = "qcom,pmr735b-gpio";
+                       compatible = "qcom,pmr735b-gpio", "qcom,spmi-gpio";
                        reg = <0x8800>;
                        gpio-controller;
+                       gpio-ranges = <&pmr735b_gpios 0 0 4>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index 98d173a..634b068 100644 (file)
                #size-cells = <0>;
 
                pms405_gpios: gpio@c000 {
-                       compatible = "qcom,pms405-gpio";
+                       compatible = "qcom,pms405-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pms405_gpios 0 0 12>;
                        #gpio-cells = <2>;
-                       interrupts = <0 0xc0 0 IRQ_TYPE_NONE>,
-                               <0 0xc1 0 IRQ_TYPE_NONE>,
-                               <0 0xc2 0 IRQ_TYPE_NONE>,
-                               <0 0xc3 0 IRQ_TYPE_NONE>,
-                               <0 0xc4 0 IRQ_TYPE_NONE>,
-                               <0 0xc5 0 IRQ_TYPE_NONE>,
-                               <0 0xc6 0 IRQ_TYPE_NONE>,
-                               <0 0xc7 0 IRQ_TYPE_NONE>,
-                               <0 0xc8 0 IRQ_TYPE_NONE>,
-                               <0 0xc9 0 IRQ_TYPE_NONE>,
-                               <0 0xca 0 IRQ_TYPE_NONE>,
-                               <0 0xcb 0 IRQ_TYPE_NONE>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
                };
 
                pon@800 {
index 2f3104a..1721ebe 100644 (file)
 };
 
 &pms405_gpios {
-       usb_vbus_boost_pin: usb-vbus-boost-pin {
+       usb_vbus_boost_pin: usb-vbus-boost-state {
                pinconf {
                        pins = "gpio3";
                        function = PMIC_GPIO_FUNC_NORMAL;
                        power-source = <1>;
                };
        };
-       usb3_vbus_pin: usb3-vbus-pin {
+       usb3_vbus_pin: usb3-vbus-state {
                pinconf {
                        pins = "gpio12";
                        function = PMIC_GPIO_FUNC_NORMAL;
index d912166..19fd8a2 100644 (file)
                };
 
                qfprom: qfprom@a4000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,qcs404-qfprom", "qcom,qfprom";
                        reg = <0x000a4000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        };
 
                        blsp1_spi1_default: blsp1-spi1-default {
-                               pins = "gpio22", "gpio23", "gpio24", "gpio25";
-                               function = "blsp_spi1";
+                               mosi {
+                                       pins = "gpio22";
+                                       function = "blsp_spi_mosi_a1";
+                               };
+
+                               miso {
+                                       pins = "gpio23";
+                                       function = "blsp_spi_miso_a1";
+                               };
+
+                               cs_n {
+                                       pins = "gpio24";
+                                       function = "blsp_spi_cs_n_a1";
+                               };
+
+                               clk {
+                                       pins = "gpio25";
+                                       function = "blsp_spi_clk_a1";
+                               };
                        };
 
                        blsp1_spi2_default: blsp1-spi2-default {
                        status = "disabled";
                };
 
-               sdcc1: sdcc@7804000 {
+               sdcc1: mmc@7804000 {
                        compatible = "qcom,qcs404-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x07804000 0x1000>, <0x7805000 0x1000>;
                        reg-names = "hc", "cqhci";
                                     <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC1_APPS_CLK>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
                                 <&xo_board>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
 
                        status = "disabled";
                };
                        status = "disabled";
                };
 
-               imem@8600000 {
-                       compatible = "simple-mfd";
+               sram@8600000 {
+                       compatible = "qcom,qcs404-imem", "syscon", "simple-mfd";
                        reg = <0x08600000 0x1000>;
 
                        #address-cells = <1>;
index 0e63f70..b374037 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/sound/qcom,q6afe.h>
 #include <dt-bindings/sound/qcom,q6asm.h>
@@ -59,6 +60,8 @@
 
                user4 {
                        label = "green:user4";
+                       function = LED_FUNCTION_INDICATOR;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pm8150_gpios 10 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "panic-indicator";
                        default-state = "off";
@@ -66,6 +69,8 @@
 
                wlan {
                        label = "yellow:wlan";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_YELLOW>;
                        gpios = <&pm8150_gpios 9 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0tx";
                        default-state = "off";
@@ -73,6 +78,8 @@
 
                bt {
                        label = "blue:bt";
+                       function = LED_FUNCTION_BLUETOOTH;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pm8150_gpios 7 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "bluetooth-power";
                        default-state = "off";
                "NC",
                "PM3003A_MODE";
 
-       lt9611_rst_pin: lt9611-rst-pin {
+       lt9611_rst_pin: lt9611-rst-state {
                pins = "gpio5";
                function = "normal";
 
        };
 };
 
+&pm8150l_lpg {
+       status = "okay";
+
+       led@1 {
+               reg = <1>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_HEARTBEAT;
+               function-enumerator = <3>;
+
+               linux,default-trigger = "heartbeat";
+               default-state = "on";
+       };
+
+       led@2 {
+               reg = <2>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_INDICATOR;
+               function-enumerator = <2>;
+               default-state = "on";
+       };
+
+       led@3 {
+               reg = <3>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_INDICATOR;
+               function-enumerator = <1>;
+       };
+};
+
 &pon_pwrkey {
        status = "okay";
 };
 
 &q6afedai {
        qi2s@16 {
-               reg = <16>;
+               reg = <PRIMARY_MI2S_RX>;
                qcom,sd-lines = <0 1 2 3>;
        };
 };
 /* TERT I2S Uses 1 I2S SD Lines for audio on LT9611 HDMI Bridge */
 &q6afedai {
        qi2s@20 {
-               reg = <20>;
+               reg = <TERTIARY_MI2S_RX>;
                qcom,sd-lines = <0>;
        };
 };
                };
 
                codec {
-                       sound-dai =  <&lt9611_codec 0>;
+                       sound-dai = <&lt9611_codec 0>;
                };
        };
 
diff --git a/arch/arm64/boot/dts/qcom/sa8295p-adp.dts b/arch/arm64/boot/dts/qcom/sa8295p-adp.dts
new file mode 100644 (file)
index 0000000..9398f03
--- /dev/null
@@ -0,0 +1,389 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/spmi/spmi.h>
+
+#include "sa8540p.dtsi"
+
+/ {
+       model = "Qualcomm SA8295P ADP";
+       compatible = "qcom,sa8295p-adp", "qcom,sa8540p";
+
+       aliases {
+               serial0 = &qup2_uart17;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&apps_rsc {
+       pmm8540-a-regulators {
+               compatible = "qcom,pm8150-rpmh-regulators";
+               qcom,pmic-id = "a";
+
+               vreg_l3a: ldo3 {
+                       regulator-name = "vreg_l3a";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1208000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l5a: ldo5 {
+                       regulator-name = "vreg_l5a";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7a: ldo7 {
+                       regulator-name = "vreg_l7a";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l13a: ldo13 {
+                       regulator-name = "vreg_l13a";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+
+       pmm8540-c-regulators {
+               compatible = "qcom,pm8150-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vreg_l1c: ldo1 {
+                       regulator-name = "vreg_l1c";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l2c: ldo2 {
+                       regulator-name = "vreg_l2c";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l3c: ldo3 {
+                       regulator-name = "vreg_l3c";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l4c: ldo4 {
+                       regulator-name = "vreg_l4c";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1208000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l6c: ldo6 {
+                       regulator-name = "vreg_l6c";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7c: ldo7 {
+                       regulator-name = "vreg_l7c";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l10c: ldo10 {
+                       regulator-name = "vreg_l10c";
+                       regulator-min-microvolt = <2504000>;
+                       regulator-max-microvolt = <2504000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l17c: ldo17 {
+                       regulator-name = "vreg_l17c";
+                       regulator-min-microvolt = <2504000>;
+                       regulator-max-microvolt = <2504000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+
+       pmm8540-g-regulators {
+               compatible = "qcom,pm8150-rpmh-regulators";
+               qcom,pmic-id = "g";
+
+               vreg_l3g: ldo3 {
+                       regulator-name = "vreg_l3g";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7g: ldo7 {
+                       regulator-name = "vreg_l7g";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l8g: ldo8 {
+                       regulator-name = "vreg_l8g";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+};
+
+&qup2 {
+       status = "okay";
+};
+
+&qup2_uart17 {
+       compatible = "qcom,geni-debug-uart";
+       status = "okay";
+};
+
+&remoteproc_adsp {
+       firmware-name = "qcom/sa8540p/adsp.mbn";
+       status = "okay";
+};
+
+&remoteproc_nsp0 {
+       firmware-name = "qcom/sa8540p/cdsp.mbn";
+       status = "okay";
+};
+
+&remoteproc_nsp1 {
+       firmware-name = "qcom/sa8540p/cdsp1.mbn";
+       status = "okay";
+};
+
+&spmi_bus {
+       pm8450a: pmic@0 {
+               compatible = "qcom,pm8150", "qcom,spmi-pmic";
+               reg = <0x0 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pm8450a_gpios: gpio@c000 {
+                       compatible = "qcom,pm8150-gpio";
+                       reg = <0xc000>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       pm8450c: pmic@4 {
+               compatible = "qcom,pm8150", "qcom,spmi-pmic";
+               reg = <0x4 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pm8450c_gpios: gpio@c000 {
+                       compatible = "qcom,pm8150-gpio";
+                       reg = <0xc000>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       pm8450e: pmic@8 {
+               compatible = "qcom,pm8150", "qcom,spmi-pmic";
+               reg = <0x8 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pm8450e_gpios: gpio@c000 {
+                       compatible = "qcom,pm8150-gpio";
+                       reg = <0xc000>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       pm8450g: pmic@c {
+               compatible = "qcom,pm8150", "qcom,spmi-pmic";
+               reg = <0xc SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pm8450g_gpios: gpio@c000 {
+                       compatible = "qcom,pm8150-gpio";
+                       reg = <0xc000>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+};
+
+&ufs_mem_hc {
+       reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l17c>;
+       vcc-max-microamp = <800000>;
+       vccq-supply = <&vreg_l6c>;
+       vccq-max-microamp = <900000>;
+
+       status = "okay";
+};
+
+&ufs_mem_phy {
+       vdda-phy-supply = <&vreg_l8g>;
+       vdda-pll-supply = <&vreg_l3g>;
+
+       status = "okay";
+};
+
+&ufs_card_hc {
+       reset-gpios = <&tlmm 229 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l10c>;
+       vcc-max-microamp = <800000>;
+       vccq-supply = <&vreg_l3c>;
+       vccq-max-microamp = <900000>;
+
+       status = "okay";
+};
+
+&ufs_card_phy {
+       vdda-phy-supply = <&vreg_l8g>;
+       vdda-pll-supply = <&vreg_l3g>;
+
+       status = "okay";
+};
+
+&usb_0 {
+       status = "okay";
+};
+
+&usb_0_dwc3 {
+       /* TODO: Define USB-C connector properly */
+       dr_mode = "peripheral";
+};
+
+&usb_0_hsphy {
+       vdda-pll-supply = <&vreg_l5a>;
+       vdda18-supply = <&vreg_l7a>;
+       vdda33-supply = <&vreg_l13a>;
+
+       status = "okay";
+};
+
+&usb_0_qmpphy {
+       vdda-phy-supply = <&vreg_l3a>;
+       vdda-pll-supply = <&vreg_l5a>;
+
+       status = "okay";
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       /* TODO: Define USB-C connector properly */
+       dr_mode = "host";
+};
+
+&usb_1_hsphy {
+       vdda-pll-supply = <&vreg_l1c>;
+       vdda18-supply = <&vreg_l7c>;
+       vdda33-supply = <&vreg_l2c>;
+
+       status = "okay";
+};
+
+&usb_1_qmpphy {
+       vdda-phy-supply = <&vreg_l4c>;
+       vdda-pll-supply = <&vreg_l1c>;
+
+       status = "okay";
+};
+
+&usb_2_hsphy0 {
+       vdda-pll-supply = <&vreg_l5a>;
+       vdda18-supply = <&vreg_l7g>;
+       vdda33-supply = <&vreg_l13a>;
+
+       status = "okay";
+};
+
+&usb_2_hsphy1 {
+       vdda-pll-supply = <&vreg_l5a>;
+       vdda18-supply = <&vreg_l7g>;
+       vdda33-supply = <&vreg_l13a>;
+
+       status = "okay";
+};
+
+&usb_2_hsphy2 {
+       vdda-pll-supply = <&vreg_l5a>;
+       vdda18-supply = <&vreg_l7g>;
+       vdda33-supply = <&vreg_l13a>;
+
+       status = "okay";
+};
+
+&usb_2_hsphy3 {
+       vdda-pll-supply = <&vreg_l5a>;
+       vdda18-supply = <&vreg_l7g>;
+       vdda33-supply = <&vreg_l13a>;
+
+       status = "okay";
+};
+
+&usb_2_qmpphy0 {
+       vdda-phy-supply = <&vreg_l3a>;
+       vdda-pll-supply = <&vreg_l5a>;
+
+       status = "okay";
+};
+
+&usb_2_qmpphy1 {
+       vdda-phy-supply = <&vreg_l3a>;
+       vdda-pll-supply = <&vreg_l5a>;
+
+       status = "okay";
+};
+
+&xo_board_clk {
+       clock-frequency = <38400000>;
+};
+
+/* PINCTRL */
diff --git a/arch/arm64/boot/dts/qcom/sa8540p.dtsi b/arch/arm64/boot/dts/qcom/sa8540p.dtsi
new file mode 100644 (file)
index 0000000..8ea2886
--- /dev/null
@@ -0,0 +1,133 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+#include "sc8280xp.dtsi"
+
+/delete-node/ &cpu0_opp_table;
+/delete-node/ &cpu4_opp_table;
+
+/ {
+       cpu0_opp_table: cpu0-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-403200000 {
+                       opp-hz = /bits/ 64 <403200000>;
+               };
+               opp-499200000 {
+                       opp-hz = /bits/ 64 <499200000>;
+               };
+               opp-595200000 {
+                       opp-hz = /bits/ 64 <595200000>;
+               };
+               opp-710400000 {
+                       opp-hz = /bits/ 64 <710400000>;
+               };
+               opp-806400000 {
+                       opp-hz = /bits/ 64 <806400000>;
+               };
+               opp-902400000 {
+                       opp-hz = /bits/ 64 <902400000>;
+               };
+               opp-1017600000 {
+                       opp-hz = /bits/ 64 <1017600000>;
+               };
+               opp-1113600000 {
+                       opp-hz = /bits/ 64 <1113600000>;
+               };
+               opp-1209600000 {
+                       opp-hz = /bits/ 64 <1209600000>;
+               };
+               opp-1324800000 {
+                       opp-hz = /bits/ 64 <1324800000>;
+               };
+               opp-1440000000 {
+                       opp-hz = /bits/ 64 <1440000000>;
+               };
+               opp-1555200000 {
+                       opp-hz = /bits/ 64 <1555200000>;
+               };
+               opp-1670400000 {
+                       opp-hz = /bits/ 64 <1670400000>;
+               };
+               opp-1785600000 {
+                       opp-hz = /bits/ 64 <1785600000>;
+               };
+               opp-1881600000 {
+                       opp-hz = /bits/ 64 <1881600000>;
+               };
+               opp-2016000000 {
+                       opp-hz = /bits/ 64 <2016000000>;
+               };
+               opp-2131200000 {
+                       opp-hz = /bits/ 64 <2131200000>;
+               };
+               opp-2246400000 {
+                       opp-hz = /bits/ 64 <2246400000>;
+               };
+       };
+
+       cpu4_opp_table: cpu4-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-825600000 {
+                       opp-hz = /bits/ 64 <825600000>;
+               };
+               opp-940800000 {
+                       opp-hz = /bits/ 64 <940800000>;
+               };
+               opp-1056000000 {
+                       opp-hz = /bits/ 64 <1056000000>;
+               };
+               opp-1171200000 {
+                       opp-hz = /bits/ 64 <1171200000>;
+               };
+               opp-1286400000 {
+                       opp-hz = /bits/ 64 <1286400000>;
+               };
+               opp-1401600000 {
+                       opp-hz = /bits/ 64 <1401600000>;
+               };
+               opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+               };
+               opp-1632000000 {
+                       opp-hz = /bits/ 64 <1632000000>;
+               };
+               opp-1747200000 {
+                       opp-hz = /bits/ 64 <1747200000>;
+               };
+               opp-1862400000 {
+                       opp-hz = /bits/ 64 <1862400000>;
+               };
+               opp-1977600000 {
+                       opp-hz = /bits/ 64 <1977600000>;
+               };
+               opp-2073600000 {
+                       opp-hz = /bits/ 64 <2073600000>;
+               };
+               opp-2169600000 {
+                       opp-hz = /bits/ 64 <2169600000>;
+               };
+               opp-2284800000 {
+                       opp-hz = /bits/ 64 <2284800000>;
+               };
+               opp-2380800000 {
+                       opp-hz = /bits/ 64 <2380800000>;
+               };
+               opp-2496000000 {
+                       opp-hz = /bits/ 64 <2496000000>;
+               };
+               opp-2592000000 {
+                       opp-hz = /bits/ 64 <2592000000>;
+               };
+       };
+};
+
+&rpmhpd {
+       compatible = "qcom,sa8540p-rpmhpd";
+};
index acdb36f..9dee131 100644 (file)
 
 &dsi_phy {
        status = "okay";
+       vdds-supply = <&vreg_l4a_0p8>;
 };
 
 &mdp {
        pinctrl-names = "default","sleep";
        pinctrl-0 = <&sdc2_on>;
        pinctrl-1 = <&sdc2_off>;
-       vmmc-supply  = <&vreg_l9c_2p9>;
+       vmmc-supply = <&vreg_l9c_2p9>;
        vqmmc-supply = <&vreg_l6c_2p9>;
 
        cd-gpios = <&tlmm 69 GPIO_ACTIVE_LOW>;
 /* PINCTRL - additions to nodes defined in sc7180.dtsi */
 
 &pm6150l_gpio {
-       disp_pins: disp-pins {
+       disp_pins: disp-state {
                pinconf {
                        pins = "gpio3";
                        function = PMIC_GPIO_FUNC_FUNC1;
index 8ac1f1e..7ee407f 100644 (file)
 };
 
 &cros_ec {
+       keyboard-controller {
+               compatible = "google,cros-ec-keyb-switches";
+       };
+
        cros_ec_proximity: proximity {
                compatible = "google,cros-ec-mkbp-proximity";
                label = "proximity-wifi";
index 9b3e3d1..1bd6c7d 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2021 Google LLC.
  */
 
-#include "sc7180-trogdor.dtsi"
+/* This file must be included after sc7180-trogdor.dtsi */
 
 / {
        /* BOARD-SPECIFIC TOP LEVEL NODES */
@@ -114,6 +114,12 @@ ap_ts_pen_1v8: &i2c4 {
        status = "okay";
 };
 
+&cros_ec {
+       keyboard-controller {
+               compatible = "google,cros-ec-keyb-switches";
+       };
+};
+
 &panel {
        compatible = "samsung,atna33xc20";
        enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r0.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r0.dts
new file mode 100644 (file)
index 0000000..1a62e8d
--- /dev/null
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Kingoftown board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+#include "sc7180-trogdor-ti-sn65dsi86.dtsi"
+#include "sc7180-trogdor-kingoftown.dtsi"
+
+/ {
+       model = "Google Kingoftown (rev0)";
+       compatible = "google,kingoftown-rev0", "qcom,sc7180";
+};
+
+/*
+ * In rev1+, the enable pin of pp3300_fp_tp will be tied to pp1800_l10a
+ * power rail instead, since kingoftown does not have FP.
+ */
+&pp3300_fp_tp {
+       gpio = <&tlmm 74 GPIO_ACTIVE_HIGH>;
+       enable-active-high;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&en_fp_rails>;
+};
+
+&tlmm {
+       en_fp_rails: en-fp-rails {
+               pinmux {
+                       pins = "gpio74";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio74";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dts
new file mode 100644 (file)
index 0000000..e0752ba
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Kingoftown board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+#include "sc7180-trogdor-parade-ps8640.dtsi"
+#include "sc7180-trogdor-kingoftown.dtsi"
+
+/ {
+       model = "Google Kingoftown (rev1+)";
+       compatible = "google,kingoftown", "qcom,sc7180";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown.dtsi
new file mode 100644 (file)
index 0000000..74f0e07
--- /dev/null
@@ -0,0 +1,225 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Kingoftown board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/* This file must be included after sc7180-trogdor.dtsi */
+#include <arm/cros-ec-keyboard.dtsi>
+#include "sc7180-trogdor-lte-sku.dtsi"
+
+&alc5682 {
+       compatible = "realtek,rt5682s";
+       realtek,dmic1-clk-pin = <2>;
+       realtek,dmic-clk-rate-hz = <2048000>;
+};
+
+&ap_tp_i2c {
+       status = "okay";
+};
+
+ap_ts_pen_1v8: &i2c4 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       ap_ts: touchscreen@10 {
+               compatible = "elan,ekth3500";
+               reg = <0x10>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_int_l>, <&ts_reset_l>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
+
+               vcc33-supply = <&pp3300_ts>;
+
+               reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&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
+       >;
+};
+
+&panel {
+       compatible = "edp-panel";
+};
+
+&pp3300_dx_edp {
+       gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
+};
+
+&sound {
+       compatible = "google,sc7180-trogdor";
+       model = "sc7180-rt5682s-max98357a-1mic";
+};
+
+&wifi {
+       qcom,ath10k-calibration-variant = "GO_KINGOFTOWN";
+};
+
+/* PINCTRL - modifications to sc7180-trogdor.dtsi */
+
+&en_pp3300_dx_edp {
+       pinmux {
+               pins = "gpio67";
+       };
+
+       pinconf {
+               pins = "gpio67";
+       };
+};
+
+/* PINCTRL - board-specific pinctrl */
+
+&tlmm {
+       gpio-line-names = "TP_INT_L",           /* 0 */
+                         "AP_RAM_ID0",
+                         "AP_SKU_ID2",
+                         "AP_RAM_ID1",
+                         "",
+                         "AP_RAM_ID2",
+                         "AP_TP_I2C_SDA",
+                         "AP_TP_I2C_SCL",
+                         "TS_RESET_L",
+                         "TS_INT_L",
+                         "",                   /* 10 */
+                         "EDP_BRIJ_IRQ",
+                         "AP_EDP_BKLTEN",
+                         "",
+                         "",
+                         "EDP_BRIJ_I2C_SDA",
+                         "EDP_BRIJ_I2C_SCL",
+                         "HUB_RST_L",
+                         "",
+                         "",
+                         "",                   /* 20 */
+                         "",
+                         "",
+                         "AMP_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "HP_IRQ",
+                         "",
+                         "",                   /* 30 */
+                         "AP_BRD_ID2",
+                         "BRIJ_SUSPEND",
+                         "AP_BRD_ID0",
+                         "AP_H1_SPI_MISO",
+                         "AP_H1_SPI_MOSI",
+                         "AP_H1_SPI_CLK",
+                         "AP_H1_SPI_CS_L",
+                         "BT_UART_CTS",
+                         "BT_UART_RTS",
+                         "BT_UART_TXD",        /* 40 */
+                         "BT_UART_RXD",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "HP_I2C_SDA",
+                         "HP_I2C_SCL",
+                         "FORCED_USB_BOOT",
+                         "AMP_BCLK",
+                         "AMP_LRCLK",          /* 50 */
+                         "AMP_DIN",
+                         "",
+                         "HP_BCLK",
+                         "HP_LRCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+                         "HP_MCLK",
+                         "AP_SKU_ID0",
+                         "AP_EC_SPI_MISO",
+                         "AP_EC_SPI_MOSI",     /* 60 */
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "AP_SPI_CLK",
+                         "AP_SPI_MOSI",
+                         "AP_SPI_MISO",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_L.
+                          */
+                         "AP_FLASH_WP_L",
+                         "EN_PP3300_DX_EDP",
+                         "AP_SPI_CS0_L",
+                         "",
+                         "",                   /* 70 */
+                         "",
+                         "",
+                         "",
+                         "EN_FP_RAILS",
+                         "UIM2_DATA",
+                         "UIM2_CLK",
+                         "UIM2_RST",
+                         "UIM2_PRESENT_L",
+                         "UIM1_DATA",
+                         "UIM1_CLK",           /* 80 */
+                         "UIM1_RST",
+                         "",
+                         "CODEC_PWR_EN",
+                         "HUB_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "AP_SKU_ID1",         /* 90 */
+                         "AP_RST_REQ",
+                         "",
+                         "AP_BRD_ID1",
+                         "AP_EC_INT_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",                   /* 100 */
+                         "",
+                         "",
+                         "",
+                         "EDP_BRIJ_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",                   /* 110 */
+                         "",
+                         "",
+                         "",
+                         "",
+                         "AP_TS_PEN_I2C_SDA",
+                         "AP_TS_PEN_I2C_SCL",
+                         "DP_HOT_PLUG_DET",
+                         "EC_IN_RW_ODL";
+};
index fe2369c..2cf7d52 100644 (file)
@@ -5,7 +5,8 @@
  * Copyright 2020 Google LLC.
  */
 
-#include "sc7180-trogdor.dtsi"
+/* This file must be included after sc7180-trogdor.dtsi */
+#include <arm/cros-ec-keyboard.dtsi>
 
 &ap_sar_sensor {
        semtech,cs0-ground;
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0-auo.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0-auo.dts
new file mode 100644 (file)
index 0000000..2767817
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Mrbland board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x0 => 0
+ *  - bits 7..4: Panel ID: 0x0 (AUO)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-mrbland-rev0.dtsi"
+
+/ {
+       model = "Google Mrbland rev0 AUO panel board";
+       compatible = "google,mrbland-rev0-sku0", "qcom,sc7180";
+};
+
+&panel {
+       compatible = "auo,b101uan08.3";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0-boe.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0-boe.dts
new file mode 100644 (file)
index 0000000..7114855
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Mrbland board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x10 => 16
+ *  - bits 7..4: Panel ID: 0x1 (BOE)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-mrbland-rev0.dtsi"
+
+/ {
+       model = "Google Mrbland rev0 BOE panel board";
+       compatible = "google,mrbland-rev0-sku16", "qcom,sc7180";
+};
+
+&panel {
+       compatible = "boe,tv101wum-n53";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev0.dtsi
new file mode 100644 (file)
index 0000000..7bc8402
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Mrbland board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-mrbland.dtsi"
+
+&avdd_lcd {
+       gpio = <&tlmm 80 GPIO_ACTIVE_HIGH>;
+};
+
+&panel {
+       enable-gpios = <&tlmm 76 GPIO_ACTIVE_HIGH>;
+};
+
+&v1p8_mipi {
+       gpio = <&tlmm 81 GPIO_ACTIVE_HIGH>;
+};
+
+/* PINCTRL - modifications to sc7180-trogdor-mrbland.dtsi */
+&avdd_lcd_en {
+       pinmux {
+               pins = "gpio80";
+       };
+
+       pinconf {
+               pins = "gpio80";
+       };
+};
+
+&mipi_1800_en {
+       pinmux {
+               pins = "gpio81";
+       };
+
+       pinconf {
+               pins = "gpio81";
+       };
+};
+&vdd_reset_1800 {
+       pinmux {
+               pins = "gpio76";
+       };
+
+       pinconf {
+               pins = "gpio76";
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev1-auo.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev1-auo.dts
new file mode 100644 (file)
index 0000000..275313e
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Mrbland board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x600 => 1536
+ *  - bits 11..8: Panel ID: 0x6 (AUO)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-mrbland.dtsi"
+
+/ {
+       model = "Google Mrbland rev1+ AUO panel board";
+       compatible = "google,mrbland-sku1536", "qcom,sc7180";
+};
+
+&panel {
+       compatible = "auo,b101uan08.3";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev1-boe.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland-rev1-boe.dts
new file mode 100644 (file)
index 0000000..87c6b6c
--- /dev/null
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Mrbland board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x300 => 768
+ *  - bits 11..8: Panel ID: 0x3 (BOE)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-mrbland.dtsi"
+
+/ {
+       model = "Google Mrbland (rev1 - 2) BOE panel board";
+       /* Uses ID 768 on rev1 and 1024 on rev2+ */
+       compatible = "google,mrbland-sku1024", "google,mrbland-sku768",
+               "qcom,sc7180";
+};
+
+&panel {
+       compatible = "boe,tv101wum-n53";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-mrbland.dtsi
new file mode 100644 (file)
index 0000000..97cba7f
--- /dev/null
@@ -0,0 +1,350 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Mrbland board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+
+/* This board only has 1 USB Type-C port. */
+/delete-node/ &usb_c1;
+
+/ {
+       avdd_lcd: avdd-lcd {
+               compatible = "regulator-fixed";
+               regulator-name = "avdd_lcd";
+
+               gpio = <&tlmm 88 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&avdd_lcd_en>;
+
+               vin-supply = <&pp5000_a>;
+       };
+
+       avee_lcd: avee-lcd {
+               compatible = "regulator-fixed";
+               regulator-name = "avee_lcd";
+
+               gpio = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&avee_lcd_en>;
+
+               vin-supply = <&pp5000_a>;
+       };
+
+       v1p8_mipi: v1p8-mipi {
+               compatible = "regulator-fixed";
+               regulator-name = "v1p8_mipi";
+
+               gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&mipi_1800_en>;
+
+               vin-supply = <&pp3300_a>;
+       };
+};
+
+&backlight {
+       pwms = <&cros_ec_pwm 0>;
+};
+
+&camcc {
+       status = "okay";
+};
+
+&cros_ec {
+       keyboard-controller {
+               compatible = "google,cros-ec-keyb-switches";
+       };
+};
+
+&dsi0 {
+
+       panel: panel@0 {
+               /* Compatible will be filled in per-board */
+               reg = <0>;
+               enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vdd_reset_1800>;
+               avdd-supply = <&avdd_lcd>;
+               avee-supply = <&avee_lcd>;
+               pp1800-supply = <&v1p8_mipi>;
+               pp3300-supply = <&pp3300_dx_edp>;
+               backlight = <&backlight>;
+               rotation = <270>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       port@0 {
+                               reg = <0>;
+                               panel_in: endpoint {
+                                       remote-endpoint = <&dsi0_out>;
+                               };
+                       };
+               };
+       };
+
+       ports {
+               port@1 {
+                       endpoint {
+                               remote-endpoint = <&panel_in>;
+                               data-lanes = <0 1 2 3>;
+                       };
+               };
+       };
+};
+
+&gpio_keys {
+       status = "okay";
+};
+
+&i2c4 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       ap_ts: touchscreen@5d {
+               compatible = "goodix,gt7375p";
+               reg = <0x5d>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_int_l>, <&ts_reset_l>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <9 IRQ_TYPE_LEVEL_LOW>;
+
+               reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
+
+               vdd-supply = <&pp3300_ts>;
+       };
+};
+
+&pp1800_uf_cam {
+       status = "okay";
+};
+
+&pp1800_wf_cam {
+       status = "okay";
+};
+
+&pp2800_uf_cam {
+       status = "okay";
+};
+
+&pp2800_wf_cam {
+       status = "okay";
+};
+
+&wifi {
+       qcom,ath10k-calibration-variant = "GO_MRBLAND";
+};
+
+/*
+ * No eDP on this board but it's logically the same signal so just give it
+ * a new name and assign the proper GPIO.
+ */
+pp3300_disp_on: &pp3300_dx_edp {
+       gpio = <&tlmm 85 GPIO_ACTIVE_HIGH>;
+};
+
+/* PINCTRL - modifications to sc7180-trogdor.dtsi */
+
+/*
+ * No eDP on this board but it's logically the same signal so just give it
+ * a new name and assign the proper GPIO.
+ */
+
+tp_en: &en_pp3300_dx_edp {
+       pinmux {
+               pins = "gpio85";
+       };
+
+       pinconf {
+               pins = "gpio85";
+       };
+};
+
+/* PINCTRL - board-specific pinctrl */
+
+&tlmm {
+       gpio-line-names = "HUB_RST_L",
+                         "AP_RAM_ID0",
+                         "AP_SKU_ID2",
+                         "AP_RAM_ID1",
+                         "",
+                         "AP_RAM_ID2",
+                         "UF_CAM_EN",
+                         "WF_CAM_EN",
+                         "TS_RESET_L",
+                         "TS_INT_L",
+                         "",
+                         "",
+                         "AP_EDP_BKLTEN",
+                         "UF_CAM_MCLK",
+                         "WF_CAM_CLK",
+                         "",
+                         "",
+                         "UF_CAM_SDA",
+                         "UF_CAM_SCL",
+                         "WF_CAM_SDA",
+                         "WF_CAM_SCL",
+                         "AVEE_LCD_EN",
+                         "",
+                         "AMP_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "HP_IRQ",
+                         "WF_CAM_RST_L",
+                         "UF_CAM_RST_L",
+                         "AP_BRD_ID2",
+                         "",
+                         "AP_BRD_ID0",
+                         "AP_H1_SPI_MISO",
+                         "AP_H1_SPI_MOSI",
+                         "AP_H1_SPI_CLK",
+                         "AP_H1_SPI_CS_L",
+                         "BT_UART_CTS",
+                         "BT_UART_RTS",
+                         "BT_UART_TXD",
+                         "BT_UART_RXD",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "HP_I2C_SDA",
+                         "HP_I2C_SCL",
+                         "FORCED_USB_BOOT",
+                         "AMP_BCLK",
+                         "AMP_LRCLK",
+                         "AMP_DIN",
+                         "PEN_DET_ODL",
+                         "HP_BCLK",
+                         "HP_LRCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+                         "HP_MCLK",
+                         "AP_SKU_ID0",
+                         "AP_EC_SPI_MISO",
+                         "AP_EC_SPI_MOSI",
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "AP_SPI_CLK",
+                         "AP_SPI_MOSI",
+                         "AP_SPI_MISO",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_L.
+                          */
+                         "AP_FLASH_WP_L",
+                         "",
+                         "AP_SPI_CS0_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "WLAN_SW_CTRL",
+                         "",
+                         "REPORT_E",
+                         "",
+                         "ID0",
+                         "",
+                         "ID1",
+                         "",
+                         "",
+                         "",
+                         "CODEC_PWR_EN",
+                         "HUB_EN",
+                         "TP_EN",
+                         "MIPI_1.8V_EN",
+                         "VDD_RESET_1.8V",
+                         "AVDD_LCD_EN",
+                         "",
+                         "AP_SKU_ID1",
+                         "AP_RST_REQ",
+                         "",
+                         "AP_BRD_ID1",
+                         "AP_EC_INT_L",
+                         "SDM_GRFC_3",
+                         "",
+                         "",
+                         "BOOT_CONFIG_4",
+                         "BOOT_CONFIG_2",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "BOOT_CONFIG_3",
+                         "WCI2_LTE_COEX_TXD",
+                         "WCI2_LTE_COEX_RXD",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "FORCED_USB_BOOT_POL",
+                         "AP_TS_PEN_I2C_SDA",
+                         "AP_TS_PEN_I2C_SCL",
+                         "DP_HOT_PLUG_DET",
+                         "EC_IN_RW_ODL";
+
+       avdd_lcd_en: avdd-lcd-en {
+               pinmux {
+                       pins = "gpio88";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio88";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       avee_lcd_en: avee-lcd-en {
+               pinmux {
+                       pins = "gpio21";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio21";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       mipi_1800_en: mipi-1800-en {
+               pinmux {
+                       pins = "gpio86";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio86";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       vdd_reset_1800: vdd-reset-1800 {
+               pinmux {
+                       pins = "gpio87";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio87";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-lte-parade.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-lte-parade.dts
new file mode 100644 (file)
index 0000000..764c451
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Pazquel board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+#include "sc7180-trogdor-parade-ps8640.dtsi"
+#include "sc7180-trogdor-pazquel.dtsi"
+#include "sc7180-trogdor-lte-sku.dtsi"
+
+/ {
+       model = "Google Pazquel (Parade,LTE)";
+       compatible = "google,pazquel-sku4", "qcom,sc7180";
+};
+
+&ap_sar_sensor_i2c {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-lte-ti.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-lte-ti.dts
new file mode 100644 (file)
index 0000000..9145b74
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Pazquel board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+#include "sc7180-trogdor-ti-sn65dsi86.dtsi"
+#include "sc7180-trogdor-pazquel.dtsi"
+#include "sc7180-trogdor-lte-sku.dtsi"
+
+/ {
+       model = "Google Pazquel (TI,LTE)";
+       compatible = "google,pazquel-sku0", "google,pazquel-sku2", "qcom,sc7180";
+};
+
+&ap_sar_sensor_i2c {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-parade.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-parade.dts
new file mode 100644 (file)
index 0000000..9a0e663
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Pazquel board device tree source
+ *
+ * Copyright 2022 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+#include "sc7180-trogdor-parade-ps8640.dtsi"
+#include "sc7180-trogdor-pazquel.dtsi"
+
+/ {
+       model = "Google Pazquel (Parade)";
+       compatible = "google,pazquel-sku5", "qcom,sc7180";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-ti.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel-ti.dts
new file mode 100644 (file)
index 0000000..47c5970
--- /dev/null
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Pazquel board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+#include "sc7180-trogdor-ti-sn65dsi86.dtsi"
+#include "sc7180-trogdor-pazquel.dtsi"
+
+/ {
+       model = "Google Pazquel (TI)";
+       compatible = "google,pazquel-sku1", "qcom,sc7180";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi
new file mode 100644 (file)
index 0000000..56d7877
--- /dev/null
@@ -0,0 +1,222 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Pazquel board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/* This file must be included after sc7180-trogdor.dtsi */
+#include <arm/cros-ec-keyboard.dtsi>
+
+&ap_sar_sensor {
+       compatible = "semtech,sx9324";
+       semtech,ph0-pin = <1 3 3>;
+       semtech,ph1-pin = <3 1 3>;
+       semtech,ph2-pin = <1 3 3>;
+       semtech,ph3-pin = <0 0 0>;
+       semtech,ph01-resolution = <1024>;
+       semtech,ph23-resolution = <1024>;
+       semtech,startup-sensor = <1>;
+       semtech,ph01-proxraw-strength = <3>;
+       semtech,ph23-proxraw-strength = <1>;
+       semtech,avg-pos-strength = <128>;
+       semtech,input-analog-gain = <0>;
+       semtech,cs-idle-sleep = "gnd";
+
+       /delete-property/ svdd-supply;
+       vdd-supply = <&pp1800_prox>;
+};
+
+/delete-node/&trackpad;
+&ap_tp_i2c {
+       status = "okay";
+       trackpad: trackpad@15 {
+               compatible = "hid-over-i2c";
+               reg = <0x15>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&tp_int_odl>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
+
+               vcc-supply = <&pp3300_fp_tp>;
+               post-power-on-delay-ms = <100>;
+               hid-descr-addr = <0x0001>;
+
+               wakeup-source;
+       };
+};
+
+&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
+       >;
+};
+
+&panel {
+       compatible = "edp-panel";
+};
+
+&pp3300_dx_edp {
+       gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
+};
+
+&en_pp3300_dx_edp {
+       pinmux {
+               pins = "gpio67";
+       };
+
+       pinconf {
+               pins = "gpio67";
+       };
+};
+
+/* PINCTRL - board-specific pinctrl */
+
+&tlmm {
+       gpio-line-names = "TP_INT_ODL",
+                         "AP_RAM_ID0",
+                         "AP_SKU_ID2",
+                         "AP_RAM_ID1",
+                         "",
+                         "AP_RAM_ID2",
+                         "AP_TP_I2C_SDA",
+                         "AP_TP_I2C_SCL",
+                         "TS_RESET_L",
+                         "TS_INT_L",
+                         "",
+                         "EDP_BRIJ_IRQ",
+                         "AP_EDP_BKLTEN",
+                         "",
+                         "",
+                         "EDP_BRIJ_I2C_SDA",
+                         "EDP_BRIJ_I2C_SCL",
+                         "HUB_RST_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "AMP_EN",
+                         "P_SENSOR_INT_L",
+                         "AP_SAR_SENSOR_SDA",
+                         "AP_SAR_SENSOR_SCL",
+                         "",
+                         "HP_IRQ",
+                         "",
+                         "",
+                         "AP_BRD_ID2",
+                         "BRIJ_SUSPEND",
+                         "AP_BRD_ID0",
+                         "AP_H1_SPI_MISO",
+                         "AP_H1_SPI_MOSI",
+                         "AP_H1_SPI_CLK",
+                         "AP_H1_SPI_CS_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "HP_I2C_SDA",
+                         "HP_I2C_SCL",
+                         "FORCED_USB_BOOT",
+                         "AMP_BCLK",
+                         "AMP_LRCLK",
+                         "AMP_DIN",
+                         "",
+                         "HP_BCLK",
+                         "HP_LRCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+                         "HP_MCLK",
+                         "AP_SKU_ID0",
+                         "AP_EC_SPI_MISO",
+                         "AP_EC_SPI_MOSI",
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "AP_SPI_CLK",
+                         "AP_SPI_MOSI",
+                         "AP_SPI_MISO",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_L.
+                          */
+                         "AP_FLASH_WP_L",
+                         "EN_PP3300_DX_EDP",
+                         "AP_SPI_CS0_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "UIM2_DATA",
+                         "UIM2_CLK",
+                         "UIM2_RST",
+                         "UIM2_PRESENT",
+                         "UIM1_DATA",
+                         "UIM1_CLK",
+                         "UIM1_RST",
+                         "",
+                         "CODEC_PWR_EN",
+                         "HUB_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "AP_SKU_ID1",
+                         "AP_RST_REQ",
+                         "",
+                         "AP_BRD_ID1",
+                         "AP_EC_INT_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "EDP_BRIJ_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "AP_TS_PEN_I2C_SDA",
+                         "AP_TS_PEN_I2C_SCL",
+                         "DP_HOT_PLUG_DET",
+                         "EC_IN_RW_ODL";
+};
index 3df4920..a7582fb 100644 (file)
@@ -6,6 +6,8 @@
  */
 
 #include "sc7180-trogdor.dtsi"
+/* Must come after sc7180-trogdor.dtsi to modify cros_ec */
+#include <arm/cros-ec-keyboard.dtsi>
 #include "sc7180-trogdor-ti-sn65dsi86.dtsi"
 
 / {
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick-r0-lte.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick-r0-lte.dts
new file mode 100644 (file)
index 0000000..35e8945
--- /dev/null
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Quackingstick board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x600 => 1536
+ *  - bits 11..8: Panel ID: 0x6 (AUO)
+ */
+
+#include "sc7180-trogdor-quackingstick-r0.dts"
+#include "sc7180-trogdor-lte-sku.dtsi"
+
+/ {
+       model = "Google Quackingstick (rev0+) with LTE";
+       compatible = "google,quackingstick-sku1536", "qcom,sc7180";
+};
+
+&ap_sar_sensor {
+       compatible = "semtech,sx9324";
+       semtech,ph0-pin = <3 1 3>;
+       semtech,ph1-pin = <2 1 2>;
+       semtech,ph2-pin = <3 3 1>;
+       semtech,ph3-pin = <1 3 3>;
+       semtech,ph01-resolution = <1024>;
+       semtech,ph23-resolution = <1024>;
+       semtech,startup-sensor = <1>;
+       semtech,ph01-proxraw-strength = <3>;
+       semtech,ph23-proxraw-strength = <3>;
+       semtech,avg-pos-strength = <256>;
+
+       /delete-property/ svdd-supply;
+       vdd-supply = <&pp1800_prox>;
+};
+
+&ap_sar_sensor_i2c {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick-r0.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick-r0.dts
new file mode 100644 (file)
index 0000000..5c81e44
--- /dev/null
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Quackingstick board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x601 => 1537
+ *  - bits 11..8: Panel ID: 0x6 (AUO)
+ */
+
+#include "sc7180-trogdor-quackingstick.dtsi"
+
+/ {
+       model = "Google Quackingstick (rev0+)";
+       compatible = "google,quackingstick-sku1537", "qcom,sc7180";
+};
+
+&dsi_phy {
+       qcom,phy-rescode-offset-top = /bits/ 8 <(-13) (-13) (-13) (-13) (-13)>;
+       qcom,phy-rescode-offset-bot = /bits/ 8 <(-13) (-13) (-13) (-13) (-13)>;
+       qcom,phy-drive-ldo-level = <375>;
+};
+
+&panel {
+       compatible = "auo,b101uan08.3";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-quackingstick.dtsi
new file mode 100644 (file)
index 0000000..695b04f
--- /dev/null
@@ -0,0 +1,324 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Quackingstick board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+
+/* This board only has 1 USB Type-C port. */
+/delete-node/ &usb_c1;
+
+/ {
+       ppvar_lcd: ppvar-lcd {
+               compatible = "regulator-fixed";
+               regulator-name = "ppvar_lcd";
+
+               gpio = <&tlmm 88 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ppvar_lcd_en>;
+
+               vin-supply = <&pp5000_a>;
+       };
+
+       v1p8_disp: v1p8-disp {
+               compatible = "regulator-fixed";
+               regulator-name = "v1p8_disp";
+
+               gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pp1800_disp_on>;
+
+               vin-supply = <&pp3300_a>;
+       };
+};
+
+&backlight {
+       pwms = <&cros_ec_pwm 0>;
+};
+
+&camcc {
+       status = "okay";
+};
+
+&cros_ec {
+       keyboard-controller {
+               compatible = "google,cros-ec-keyb-switches";
+       };
+};
+
+&dsi0 {
+       panel: panel@0 {
+               /* Compatible will be filled in per-board */
+               reg = <0>;
+               enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&lcd_rst>;
+               avdd-supply = <&ppvar_lcd>;
+               pp1800-supply = <&v1p8_disp>;
+               pp3300-supply = <&pp3300_dx_edp>;
+               backlight = <&backlight>;
+               rotation = <270>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       port@0 {
+                               reg = <0>;
+                               panel_in: endpoint {
+                                       remote-endpoint = <&dsi0_out>;
+                               };
+                       };
+               };
+       };
+
+       ports {
+               port@1 {
+                       endpoint {
+                               remote-endpoint = <&panel_in>;
+                               data-lanes = <0 1 2 3>;
+                       };
+               };
+       };
+};
+
+&gpio_keys {
+       status = "okay";
+};
+
+&i2c4 {
+       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 = <9 IRQ_TYPE_LEVEL_LOW>;
+
+               post-power-on-delay-ms = <20>;
+               hid-descr-addr = <0x0001>;
+
+               vdd-supply = <&pp3300_ts>;
+       };
+};
+
+&sdhc_2 {
+       status = "okay";
+};
+
+&pp1800_uf_cam {
+       status = "okay";
+};
+
+&pp1800_wf_cam {
+       status = "okay";
+};
+
+&pp2800_uf_cam {
+       status = "okay";
+};
+
+&pp2800_wf_cam {
+       status = "okay";
+};
+
+/*
+ * No eDP on this board but it's logically the same signal so just give it
+ * a new name and assign the proper GPIO.
+ */
+pp3300_disp_on: &pp3300_dx_edp {
+       gpio = <&tlmm 67 GPIO_ACTIVE_HIGH>;
+};
+
+/* PINCTRL - modifications to sc7180-trogdor.dtsi */
+
+/*
+ * No eDP on this board but it's logically the same signal so just give it
+ * a new name and assign the proper GPIO.
+ */
+
+tp_en: &en_pp3300_dx_edp {
+       pinmux {
+               pins = "gpio67";
+       };
+
+       pinconf {
+               pins = "gpio67";
+       };
+};
+
+/* PINCTRL - board-specific pinctrl */
+
+&tlmm {
+       gpio-line-names = "HUB_RST_L",
+                         "AP_RAM_ID0",
+                         "AP_SKU_ID2",
+                         "AP_RAM_ID1",
+                         "",
+                         "AP_RAM_ID2",
+                         "UF_CAM_EN",
+                         "WF_CAM_EN",
+                         "TS_RESET_L",
+                         "TS_INT_L",
+                         "",
+                         "",
+                         "AP_EDP_BKLTEN",
+                         "UF_CAM_MCLK",
+                         "WF_CAM_CLK",
+                         "EDP_BRIJ_I2C_SDA",
+                         "EDP_BRIJ_I2C_SCL",
+                         "UF_CAM_SDA",
+                         "UF_CAM_SCL",
+                         "WF_CAM_SDA",
+                         "WF_CAM_SCL",
+                         "",
+                         "",
+                         "AMP_EN",
+                         "P_SENSOR_INT_L",
+                         "AP_SAR_SENSOR_SDA",
+                         "AP_SAR_SENSOR_SCL",
+                         "",
+                         "HP_IRQ",
+                         "WF_CAM_RST_L",
+                         "UF_CAM_RST_L",
+                         "AP_BRD_ID2",
+                         "",
+                         "AP_BRD_ID0",
+                         "AP_H1_SPI_MISO",
+                         "AP_H1_SPI_MOSI",
+                         "AP_H1_SPI_CLK",
+                         "AP_H1_SPI_CS_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "HP_I2C_SDA",
+                         "HP_I2C_SCL",
+                         "FORCED_USB_BOOT",
+                         "",
+                         "",
+                         "AMP_DIN",
+                         "PEN_DET_ODL",
+                         "HP_BCLK",
+                         "HP_LRCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+                         "HP_MCLK",
+                         "AP_SKU_ID0",
+                         "AP_EC_SPI_MISO",
+                         "AP_EC_SPI_MOSI",
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "AP_SPI_CLK",
+                         "AP_SPI_MOSI",
+                         "AP_SPI_MISO",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_L.
+                          */
+                         "AP_FLASH_WP_L",
+                         "EN_PP3300_DX_EDP",
+                         "AP_SPI_CS0_L",
+                         "SD_CD_ODL",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "UIM2_DATA",
+                         "UIM2_CLK",
+                         "UIM2_RST",
+                         "UIM2_PRESENT_L",
+                         "UIM1_DATA",
+                         "UIM1_CLK",
+                         "UIM1_RST",
+                         "",
+                         "CODEC_PWR_EN",
+                         "HUB_EN",
+                         "",
+                         "PP1800_DISP_ON",
+                         "LCD_RST",
+                         "PPVAR_LCD_EN",
+                         "",
+                         "AP_SKU_ID1",
+                         "AP_RST_REQ",
+                         "",
+                         "AP_BRD_ID1",
+                         "AP_EC_INT_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "AP_TS_I2C_SDA",
+                         "AP_TS_I2C_SCL",
+                         "DP_HOT_PLUG_DET",
+                         "EC_IN_RW_ODL";
+
+       lcd_rst: lcd-rst {
+               pinmux {
+                       pins = "gpio87";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio87";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       ppvar_lcd_en: ppvar-lcd-en {
+               pinmux {
+                       pins = "gpio88";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio88";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       pp1800_disp_on: pp1800-disp-on {
+               pinmux {
+                       pins = "gpio86";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio86";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+};
index 352827e..59a23d0 100644 (file)
@@ -8,6 +8,8 @@
 /dts-v1/;
 
 #include "sc7180-trogdor.dtsi"
+/* Must come after sc7180-trogdor.dtsi to modify cros_ec */
+#include <arm/cros-ec-keyboard.dtsi>
 #include "sc7180-trogdor-ti-sn65dsi86.dtsi"
 
 / {
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0-boe.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0-boe.dts
new file mode 100644 (file)
index 0000000..d6ed7d0
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x10 => 16
+ *  - bits 7..4: Panel ID: 0x1 (BOE)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler-rev0.dtsi"
+
+/ {
+       model = "Google Wormdingler rev0 BOE panel board";
+       compatible = "google,wormdingler-rev0-sku16", "qcom,sc7180";
+};
+
+&panel {
+       compatible = "boe,tv110c9m-ll3";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0-inx.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0-inx.dts
new file mode 100644 (file)
index 0000000..c03525e
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x0 => 0
+ *  - bits 7..4: Panel ID: 0x0 (INX)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler-rev0.dtsi"
+
+/ {
+       model = "Google Wormdingler rev0 INX panel board";
+       compatible = "google,wormdingler-rev0-sku0", "qcom,sc7180";
+};
+
+&panel {
+       compatible = "innolux,hj110iz-01a";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev0.dtsi
new file mode 100644 (file)
index 0000000..db29e0c
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler.dtsi"
+
+&avdd_lcd {
+       gpio = <&tlmm 80 GPIO_ACTIVE_HIGH>;
+};
+
+&panel {
+       enable-gpios = <&tlmm 76 GPIO_ACTIVE_HIGH>;
+};
+
+&v1p8_mipi {
+       gpio = <&tlmm 81 GPIO_ACTIVE_HIGH>;
+};
+
+/* PINCTRL - modifications to sc7180-trogdor-wormdingler.dtsi */
+&avdd_lcd_en {
+       pinmux {
+               pins = "gpio80";
+       };
+
+       pinconf {
+               pins = "gpio80";
+       };
+};
+
+&mipi_1800_en {
+       pinmux {
+               pins = "gpio81";
+       };
+
+       pinconf {
+               pins = "gpio81";
+       };
+};
+&vdd_reset_1800 {
+       pinmux {
+               pins = "gpio76";
+       };
+
+       pinconf {
+               pins = "gpio76";
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe-rt5682s.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe-rt5682s.dts
new file mode 100644 (file)
index 0000000..aa60588
--- /dev/null
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x401 => 1025
+ *  - bits 11..8: Panel ID: 0x4 (BOE)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler-rev1-boe.dts"
+
+/ {
+       model = "Google Wormdingler rev1+ (BOE, rt5682s)";
+       compatible = "google,wormdingler-sku1025", "qcom,sc7180";
+};
+
+&alc5682 {
+       compatible = "realtek,rt5682s";
+       realtek,dmic1-clk-pin = <2>;
+       realtek,dmic-clk-rate-hz = <2048000>;
+};
+
+&sound {
+       compatible = "google,sc7180-trogdor";
+       model = "sc7180-rt5682s-max98357a-1mic";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-boe.dts
new file mode 100644 (file)
index 0000000..c5b0658
--- /dev/null
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x400 => 1024
+ *  - bits 11..8: Panel ID: 0x4 (BOE)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler.dtsi"
+
+/ {
+       model = "Google Wormdingler rev1+ BOE panel board";
+       compatible = "google,wormdingler-sku1024", "qcom,sc7180";
+};
+
+&dsi_phy {
+       qcom,phy-rescode-offset-top = /bits/ 8 <31 31 31 31 (-32)>;
+       qcom,phy-rescode-offset-bot = /bits/ 8 <31 31 31 31 (-32)>;
+       qcom,phy-drive-ldo-level = <450>;
+};
+
+&panel {
+       compatible = "boe,tv110c9m-ll3";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx-rt5682s.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx-rt5682s.dts
new file mode 100644 (file)
index 0000000..7116c44
--- /dev/null
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x0001 => 1
+ *  - bits 11..8: Panel ID: 0x0 (INX)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler-rev1-inx.dts"
+
+/ {
+       model = "Google Wormdingler rev1+ (INX, rt5682s)";
+       compatible = "google,wormdingler-sku1", "qcom,sc7180";
+};
+
+&alc5682 {
+       compatible = "realtek,rt5682s";
+       realtek,dmic1-clk-pin = <2>;
+       realtek,dmic-clk-rate-hz = <2048000>;
+};
+
+&sound {
+       compatible = "google,sc7180-trogdor";
+       model = "sc7180-rt5682s-max98357a-1mic";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx.dts b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler-rev1-inx.dts
new file mode 100644 (file)
index 0000000..dd34a22
--- /dev/null
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ *
+ * SKU: 0x0000 => 0
+ *  - bits 11..8: Panel ID: 0x0 (INX)
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor-wormdingler.dtsi"
+
+/ {
+       model = "Google Wormdingler rev1+ INX panel board";
+       compatible = "google,wormdingler-sku0", "qcom,sc7180";
+};
+
+&panel {
+       compatible = "innolux,hj110iz-01a";
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-wormdingler.dtsi
new file mode 100644 (file)
index 0000000..6312108
--- /dev/null
@@ -0,0 +1,412 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Google Wormdingler board device tree source
+ *
+ * Copyright 2021 Google LLC.
+ */
+
+/dts-v1/;
+
+#include "sc7180-trogdor.dtsi"
+
+/ {
+       avdd_lcd: avdd-lcd {
+               compatible = "regulator-fixed";
+               regulator-name = "avdd_lcd";
+
+               gpio = <&tlmm 88 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&avdd_lcd_en>;
+
+               vin-supply = <&pp5000_a>;
+       };
+
+       avee_lcd: avee-lcd {
+               compatible = "regulator-fixed";
+               regulator-name = "avee_lcd";
+
+               gpio = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&avee_lcd_en>;
+
+               vin-supply = <&pp5000_a>;
+       };
+
+       pp1800_ts:
+       v1p8_mipi: v1p8-mipi {
+               compatible = "regulator-fixed";
+               regulator-name = "v1p8_mipi";
+
+               gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+               pinctrl-names = "default";
+               pinctrl-0 = <&mipi_1800_en>;
+
+               vin-supply = <&pp3300_a>;
+       };
+
+       thermal-zones {
+               skin_temp_thermal: skin-temp-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <0>;
+
+                       thermal-sensors = <&pm6150_adc_tm 1>;
+                       sustainable-power = <574>;
+
+                       trips {
+                               skin_temp_alert0: trip-point0 {
+                                       temperature = <58000>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               skin_temp_alert1: trip-point1 {
+                                       temperature = <62500>;
+                                       hysteresis = <1000>;
+                                       type = "passive";
+                               };
+
+                               skin-temp-crit {
+                                       temperature = <68000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                               map0 {
+                                       trip = <&skin_temp_alert0>;
+                                       cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+
+                               map1 {
+                                       trip = <&skin_temp_alert1>;
+                                       cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                                        <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+       };
+};
+
+&backlight {
+       pwms = <&cros_ec_pwm 0>;
+};
+
+&camcc {
+       status = "okay";
+};
+
+&cros_ec {
+       base_detection: cbas {
+               compatible = "google,cros-cbas";
+       };
+
+       keyboard-controller {
+               compatible = "google,cros-ec-keyb-switches";
+       };
+};
+
+&dsi0 {
+
+       panel: panel@0 {
+               reg = <0>;
+               enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&vdd_reset_1800>;
+               avdd-supply = <&avdd_lcd>;
+               avee-supply = <&avee_lcd>;
+               pp1800-supply = <&v1p8_mipi>;
+               pp3300-supply = <&pp3300_dx_edp>;
+               backlight = <&backlight>;
+               rotation = <270>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       port@0 {
+                               reg = <0>;
+                               panel_in: endpoint {
+                                       remote-endpoint = <&dsi0_out>;
+                               };
+                       };
+               };
+       };
+
+       ports {
+               port@1 {
+                       endpoint {
+                               remote-endpoint = <&panel_in>;
+                               data-lanes = <0 1 2 3>;
+                       };
+               };
+       };
+};
+
+&i2c4 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       ap_ts: touchscreen@1 {
+               compatible = "hid-over-i2c";
+               reg = <0x01>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_int_l>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+
+               post-power-on-delay-ms = <70>;
+               hid-descr-addr = <0x0001>;
+
+               vdd-supply = <&pp3300_ts>;
+               vddl-supply = <&pp1800_ts>;
+       };
+};
+
+&pm6150_adc {
+       skin-temp-thermistor@4d {
+               reg = <ADC5_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time = <200>;
+       };
+};
+
+&pm6150_adc_tm {
+       status = "okay";
+
+       skin-temp-thermistor@1 {
+               reg = <1>;
+               io-channels = <&pm6150_adc ADC5_AMUX_THM1_100K_PU>;
+               qcom,ratiometric;
+               qcom,hw-settle-time-us = <200>;
+       };
+};
+
+&pp1800_uf_cam {
+       status = "okay";
+};
+
+&pp1800_wf_cam {
+       status = "okay";
+};
+
+&pp2800_uf_cam {
+       status = "okay";
+};
+
+&pp2800_wf_cam {
+       status = "okay";
+};
+
+&wifi {
+       qcom,ath10k-calibration-variant = "GO_WORMDINGLER";
+};
+
+/*
+ * No eDP on this board but it's logically the same signal so just give it
+ * a new name and assign the proper GPIO.
+ */
+pp3300_disp_on: &pp3300_dx_edp {
+       gpio = <&tlmm 85 GPIO_ACTIVE_HIGH>;
+};
+
+/* PINCTRL - modifications to sc7180-trogdor.dtsi */
+
+/*
+ * No eDP on this board but it's logically the same signal so just give it
+ * a new name and assign the proper GPIO.
+ */
+
+tp_en: &en_pp3300_dx_edp {
+       pinmux {
+               pins = "gpio85";
+       };
+
+       pinconf {
+               pins = "gpio85";
+       };
+};
+
+/* PINCTRL - board-specific pinctrl */
+
+&tlmm {
+       gpio-line-names = "HUB_RST_L",
+                         "AP_RAM_ID0",
+                         "AP_SKU_ID2",
+                         "AP_RAM_ID1",
+                         "",
+                         "AP_RAM_ID2",
+                         "UF_CAM_EN",
+                         "WF_CAM_EN",
+                         "TS_RESET_L",
+                         "TS_INT_L",
+                         "",
+                         "",
+                         "AP_EDP_BKLTEN",
+                         "UF_CAM_MCLK",
+                         "WF_CAM_CLK",
+                         "",
+                         "",
+                         "UF_CAM_SDA",
+                         "UF_CAM_SCL",
+                         "WF_CAM_SDA",
+                         "WF_CAM_SCL",
+                         "AVEE_LCD_EN",
+                         "",
+                         "AMP_EN",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "HP_IRQ",
+                         "WF_CAM_RST_L",
+                         "UF_CAM_RST_L",
+                         "AP_BRD_ID2",
+                         "",
+                         "AP_BRD_ID0",
+                         "AP_H1_SPI_MISO",
+                         "AP_H1_SPI_MOSI",
+                         "AP_H1_SPI_CLK",
+                         "AP_H1_SPI_CS_L",
+                         "BT_UART_CTS",
+                         "BT_UART_RTS",
+                         "BT_UART_TXD",
+                         "BT_UART_RXD",
+                         "H1_AP_INT_ODL",
+                         "",
+                         "UART_AP_TX_DBG_RX",
+                         "UART_DBG_TX_AP_RX",
+                         "HP_I2C_SDA",
+                         "HP_I2C_SCL",
+                         "FORCED_USB_BOOT",
+                         "AMP_BCLK",
+                         "AMP_LRCLK",
+                         "AMP_DIN",
+                         "",
+                         "HP_BCLK",
+                         "HP_LRCLK",
+                         "HP_DOUT",
+                         "HP_DIN",
+                         "HP_MCLK",
+                         "AP_SKU_ID0",
+                         "AP_EC_SPI_MISO",
+                         "AP_EC_SPI_MOSI",
+                         "AP_EC_SPI_CLK",
+                         "AP_EC_SPI_CS_L",
+                         "AP_SPI_CLK",
+                         "AP_SPI_MOSI",
+                         "AP_SPI_MISO",
+                         /*
+                          * AP_FLASH_WP_L is crossystem ABI. Schematics
+                          * call it BIOS_FLASH_WP_L.
+                          */
+                         "AP_FLASH_WP_L",
+                         "",
+                         "AP_SPI_CS0_L",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "WLAN_SW_CTRL",
+                         "",
+                         "REPORT_E",
+                         "",
+                         "ID0",
+                         "",
+                         "ID1",
+                         "",
+                         "",
+                         "",
+                         "CODEC_PWR_EN",
+                         "HUB_EN",
+                         "TP_EN",
+                         "MIPI_1.8V_EN",
+                         "VDD_RESET_1.8V",
+                         "AVDD_LCD_EN",
+                         "",
+                         "AP_SKU_ID1",
+                         "AP_RST_REQ",
+                         "",
+                         "AP_BRD_ID1",
+                         "AP_EC_INT_L",
+                         "SDM_GRFC_3",
+                         "",
+                         "",
+                         "BOOT_CONFIG_4",
+                         "BOOT_CONFIG_2",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "BOOT_CONFIG_3",
+                         "WCI2_LTE_COEX_TXD",
+                         "WCI2_LTE_COEX_RXD",
+                         "",
+                         "",
+                         "",
+                         "",
+                         "FORCED_USB_BOOT_POL",
+                         "AP_TS_PEN_I2C_SDA",
+                         "AP_TS_PEN_I2C_SCL",
+                         "DP_HOT_PLUG_DET",
+                         "EC_IN_RW_ODL";
+
+       avdd_lcd_en: avdd-lcd-en {
+               pinmux {
+                       pins = "gpio88";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio88";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       avee_lcd_en: avee-lcd-en {
+               pinmux {
+                       pins = "gpio21";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio21";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       mipi_1800_en: mipi-1800-en {
+               pinmux {
+                       pins = "gpio86";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio86";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+
+       vdd_reset_1800: vdd-reset-1800 {
+               pinmux {
+                       pins = "gpio87";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio87";
+                       drive-strength = <2>;
+                       bias-disable;
+               };
+       };
+};
index e55dbaa..b5f534d 100644 (file)
@@ -8,6 +8,7 @@
 #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/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/sound/sc7180-lpass.h>
 
@@ -43,6 +44,7 @@
  */
 
 /delete-node/ &hyp_mem;
+/delete-node/ &ipa_fw_mem;
 /delete-node/ &xbl_mem;
 /delete-node/ &aop_mem;
 /delete-node/ &sec_apps_mem;
                pinctrl-names = "default";
                pinctrl-0 = <&pen_pdct_l>;
 
-               pen_insert: pen-insert {
+               pen_insert: switch-pen-insert {
                        label = "Pen Insert";
 
                        /* Insert = low, eject = high */
                keyboard_backlight: keyboard-backlight {
                        status = "disabled";
                        label = "cros_ec::kbd_backlight";
+                       function = LED_FUNCTION_KBD_BACKLIGHT;
                        pwms = <&cros_ec_pwm 0>;
                        max-brightness = <1023>;
                };
@@ -812,8 +815,6 @@ hp_i2c: &i2c9 {
        pinctrl-names = "default";
        pinctrl-0 = <&dp_hot_plug_det>;
        data-lanes = <0 1>;
-       vdda-1p2-supply = <&vdda_usb_ss_dp_1p2>;
-       vdda-0p9-supply = <&vdda_usb_ss_dp_core>;
 };
 
 &pm6150_adc {
@@ -903,7 +904,6 @@ ap_spi_fp: &spi10 {
        };
 };
 
-#include <arm/cros-ec-keyboard.dtsi>
 #include <arm/cros-ec-sbs.dtsi>
 
 &uart3 {
index 5dcaac2..881e309 100644 (file)
                };
        };
 
-       cpu0_opp_table: cpu0_opp_table {
+       cpu0_opp_table: opp-table-cpu0 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu6_opp_table: cpu6_opp_table {
+       cpu6_opp_table: opp-table-cpu6 {
                compatible = "operating-points-v2";
                opp-shared;
 
                        };
                };
 
-               sdhc_1: sdhci@7c4000 {
+               sdhc_1: mmc@7c4000 {
                        compatible = "qcom,sc7180-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x7c4000 0 0x1000>,
                                <0 0x07c5000 0 0x1000>;
                                        <GIC_SPI 644 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC1_APPS_CLK>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
                                 <&rpmhcc RPMH_CXO_CLK>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
                        interconnects = <&aggre1_noc MASTER_EMMC 0 &mc_virt SLAVE_EBI1 0>,
                                        <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_EMMC_CFG 0>;
                        interconnect-names = "sdhc-ddr","cpu-sdhc";
 
                        status = "disabled";
 
-                       sdhc1_opp_table: sdhc1-opp-table {
+                       sdhc1_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-100000000 {
                        };
                };
 
-               qup_opp_table: qup-opp-table {
+               qup_opp_table: opp-table-qup {
                        compatible = "operating-points-v2";
 
                        opp-75000000 {
                };
 
                gmu: gmu@506a000 {
-                       compatible="qcom,adreno-gmu-618.0", "qcom,adreno-gmu";
+                       compatible = "qcom,adreno-gmu-618.0", "qcom,adreno-gmu";
                        reg = <0 0x0506a000 0 0x31000>, <0 0x0b290000 0 0x10000>,
                                <0 0x0b490000 0 0x10000>;
                        reg-names = "gmu", "gmu_pdc", "gmu_pdc_seq";
                        };
                };
 
-               sdhc_2: sdhci@8804000 {
+               sdhc_2: mmc@8804000 {
                        compatible = "qcom,sc7180-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x08804000 0 0x1000>;
 
                                        <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC2_APPS_CLK>,
-                                <&gcc GCC_SDCC2_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                                <&gcc GCC_SDCC2_APPS_CLK>,
                                 <&rpmhcc RPMH_CXO_CLK>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
 
                        interconnects = <&aggre1_noc MASTER_SDCC_2 0 &mc_virt SLAVE_EBI1 0>,
                                        <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_SDCC_2 0>;
 
                        status = "disabled";
 
-                       sdhc2_opp_table: sdhc2-opp-table {
+                       sdhc2_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-100000000 {
                        };
                };
 
-               qspi_opp_table: qspi-opp-table {
+               qspi_opp_table: opp-table-qspi {
                        compatible = "operating-points-v2";
 
                        opp-75000000 {
                                compatible = "venus-encoder";
                        };
 
-                       venus_opp_table: venus-opp-table {
+                       venus_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-150000000 {
                                 <&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>;
                                         <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
                                clock-names = "bus", "iface", "rot", "lut", "core",
                                              "vsync";
-                               assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
-                                                 <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
                                                  <&dispcc DISP_CC_MDSS_ROT_CLK>,
                                                  <&dispcc DISP_CC_MDSS_AHB_CLK>;
-                               assigned-clock-rates = <300000000>,
-                                                      <19200000>,
+                               assigned-clock-rates = <19200000>,
                                                       <19200000>,
                                                       <19200000>;
                                operating-points-v2 = <&mdp_opp_table>;
                                        };
                                };
 
-                               mdp_opp_table: mdp-opp-table {
+                               mdp_opp_table: opp-table {
                                        compatible = "operating-points-v2";
 
                                        opp-200000000 {
                                        };
                                };
 
-                               dsi_opp_table: dsi-opp-table {
+                               dsi_opp_table: opp-table {
                                        compatible = "operating-points-v2";
 
                                        opp-187500000 {
                };
 
                aoss_qmp: power-controller@c300000 {
-                       compatible = "qcom,sc7180-aoss-qmp";
+                       compatible = "qcom,sc7180-aoss-qmp", "qcom,aoss-qmp";
                        reg = <0 0x0c300000 0 0x400>;
                        interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>;
                        mboxes = <&apss_shared 0>;
                        cell-index = <0>;
                };
 
-               imem@146aa000 {
-                       compatible = "simple-mfd";
+               sram@146aa000 {
+                       compatible = "qcom,sc7180-imem", "syscon", "simple-mfd";
                        reg = <0 0x146aa000 0 0x2000>;
 
                        #address-cells = <1>;
                };
 
                timer@17c20000{
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0 0x17c20000 0 0x1000>;
 
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c21000 0 0x1000>,
-                                     <0 0x17c22000 0 0x1000>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
                        };
 
                        frame@17c23000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c23000 0 0x1000>;
+                               reg = <0x17c23000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c25000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c25000 0 0x1000>;
+                               reg = <0x17c25000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c27000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c27000 0 0x1000>;
+                               reg = <0x17c27000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c29000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c29000 0 0x1000>;
+                               reg = <0x17c29000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c2b000 0 0x1000>;
+                               reg = <0x17c2b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c2d000 0 0x1000>;
+                               reg = <0x17c2d000 0x1000>;
                                status = "disabled";
                        };
                };
                        compatible = "qcom,sc7180-lpass-cpu";
 
                        reg = <0 0x62d87000 0 0x68000>, <0 0x62f00000 0 0x29000>;
-                       reg-names =  "lpass-hdmiif", "lpass-lpaif";
+                       reg-names = "lpass-hdmiif", "lpass-lpaif";
 
                        iommus = <&apps_smmu 0x1020 0>,
                                <&apps_smmu 0x1021 0>,
index 9f4a9c2..cfe2741 100644 (file)
        status = "okay";
        compatible = "qcom,sc7280-mss-pil";
        iommus = <&apps_smmu 0x124 0x0>, <&apps_smmu 0x488 0x7>;
+       interconnects = <&mc_virt MASTER_LLCC 0 &mc_virt SLAVE_EBI1 0>;
        memory-region = <&mba_mem>, <&mpss_mem>;
+       firmware-name = "qcom/sc7280-herobrine/modem/mba.mbn",
+                       "qcom/sc7280-herobrine/modem/qdsp6sw.mbn";
+};
+
+&remoteproc_wpss {
+       status = "okay";
+       firmware-name = "ath11k/WCN6750/hw1.0/wpss.mdt";
 };
 
 /* Increase the size from 2.5MB to 8MB */
 &rmtfs_mem {
        reg = <0x0 0x9c900000 0x0 0x800000>;
 };
+
+&wifi {
+       status = "okay";
+
+       wifi-firmware {
+               iommus = <&apps_smmu 0x1c02 0x1>;
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-wcd9385.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-wcd9385.dtsi
new file mode 100644 (file)
index 0000000..32a1e78
--- /dev/null
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * sc7280 device tree source for boards using Max98360 and wcd9385 codec
+ *
+ * Copyright (c) 2022, The Linux Foundation. All rights reserved.
+ */
+
+&mi2s1_data0 {
+       drive-strength = <6>;
+       bias-disable;
+};
+
+&mi2s1_sclk {
+       drive-strength = <6>;
+       bias-disable;
+};
+
+&mi2s1_ws {
+       drive-strength = <6>;
+};
index a4ac33c..e9ca6c5 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 #include "sc7280-herobrine.dtsi"
+#include "sc7280-herobrine-audio-wcd9385.dtsi"
 
 / {
        model = "Qualcomm Technologies, Inc. sc7280 CRD platform (rev5+)";
@@ -134,6 +135,17 @@ ap_ts_pen_1v8: &i2c13 {
        status = "okay";
 };
 
+/* PINCTRL - ADDITIONS TO NODES IN PARENT DEVICE TREE FILES */
+
+/*
+ * This pin goes to the display panel but then doesn't actually do anything
+ * on the panel itself (it doesn't connect to the touchscreen controller).
+ * We'll set a pullup here just to park the line.
+ */
+&ts_rst_conn {
+       bias-pull-up;
+};
+
 /* PINCTRL - BOARD-SPECIFIC */
 
 /*
@@ -143,6 +155,67 @@ ap_ts_pen_1v8: &i2c13 {
  * - 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.
  */
+&lpass_dmic01_clk {
+       drive-strength = <8>;
+       bias-disable;
+};
+
+&lpass_dmic01_clk_sleep {
+       drive-strength = <2>;
+};
+
+&lpass_dmic01_data {
+       bias-pull-down;
+};
+
+&lpass_dmic23_clk {
+       drive-strength = <8>;
+       bias-disable;
+};
+
+&lpass_dmic23_clk_sleep {
+       drive-strength = <2>;
+};
+
+&lpass_dmic23_data {
+       bias-pull-down;
+};
+
+&lpass_rx_swr_clk {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-disable;
+};
+
+&lpass_rx_swr_clk_sleep {
+       bias-pull-down;
+};
+
+&lpass_rx_swr_data {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-bus-hold;
+};
+
+&lpass_rx_swr_data_sleep {
+       bias-pull-down;
+};
+
+&lpass_tx_swr_clk {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-disable;
+};
+
+&lpass_tx_swr_clk_sleep {
+       bias-pull-down;
+};
+
+&lpass_tx_swr_data {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-bus-hold;
+};
 
 &pm8350c_gpios {
        gpio-line-names = "FLASH_STROBE_1",             /* 1 */
index b69ca09..c1647a8 100644 (file)
@@ -128,6 +128,17 @@ ts_i2c: &i2c13 {
        status = "okay";
 };
 
+/* PINCTRL - ADDITIONS TO NODES IN PARENT DEVICE TREE FILES */
+
+/*
+ * This pin goes to the display panel but then doesn't actually do anything
+ * on the panel itself (it doesn't connect to the touchscreen controller).
+ * We'll set a pullup here just to park the line.
+ */
+&ts_rst_conn {
+       bias-pull-up;
+};
+
 /* PINCTRL - BOARD-SPECIFIC */
 
 /*
index d3d6ffa..2cacafd 100644 (file)
@@ -46,6 +46,25 @@ ap_tp_i2c: &i2c0 {
        };
 };
 
+ts_i2c: &i2c13 {
+       status = "okay";
+       clock-frequency = <400000>;
+
+       ap_ts: touchscreen@10 {
+               compatible = "elan,ekth6915";
+               reg = <0x10>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&ts_int_conn>, <&ts_rst_conn>;
+
+               interrupt-parent = <&tlmm>;
+               interrupts = <55 IRQ_TYPE_LEVEL_LOW>;
+
+               reset-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
+
+               vcc33-supply = <&ts_avdd>;
+       };
+};
+
 &ap_sar_sensor_i2c {
        status = "okay";
 };
@@ -76,11 +95,21 @@ ap_tp_i2c: &i2c0 {
        status = "okay";
 };
 
+&pwmleds {
+       status = "okay";
+};
+
 /* For eMMC */
 &sdhc_1 {
        status = "okay";
 };
 
+/* PINCTRL - ADDITIONS TO NODES IN PARENT DEVICE TREE FILES */
+
+&ts_rst_conn {
+       bias-disable;
+};
+
 /* PINCTRL - BOARD-SPECIFIC */
 
 /*
index 9cb1bc8..ed80081 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <dt-bindings/input/gpio-keys.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 #include "sc7280-qcard.dtsi"
 #include "sc7280-chrome-common.dtsi"
 
        /* BOARD-SPECIFIC TOP LEVEL NODES */
 
-       pwmleds {
+       pwmleds: pwmleds {
                compatible = "pwm-leds";
                status = "disabled";
                keyboard_backlight: keyboard-backlight {
-                       status = "disabled";
                        label = "cros_ec::kbd_backlight";
+                       function = LED_FUNCTION_KBD_BACKLIGHT;
                        pwms = <&cros_ec_pwm 0>;
                        max-brightness = <1023>;
                };
@@ -388,7 +389,7 @@ ap_sar_sensor_i2c: &i2c1 {
 
                vdd-supply = <&pp1800_prox>;
 
-               label = "proximity-wifi-lte0";
+               label = "proximity-wifi_cellular-0";
                status = "disabled";
        };
 
@@ -404,7 +405,7 @@ ap_sar_sensor_i2c: &i2c1 {
 
                vdd-supply = <&pp1800_prox>;
 
-               label = "proximity-wifi-lte1";
+               label = "proximity-wifi_cellular-1";
                status = "disabled";
        };
 };
@@ -429,6 +430,15 @@ ap_i2c_tpm: &i2c14 {
        status = "okay";
 };
 
+&mdss_dp {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&dp_hot_plug_det>;
+       data-lanes = <0 1>;
+       vdda-1p2-supply = <&vdd_a_usbssdp_0_1p2>;
+       vdda-0p9-supply = <&vdd_a_usbssdp_0_core>;
+};
+
 &mdss_mdp {
        status = "okay";
 };
@@ -476,6 +486,10 @@ ap_i2c_tpm: &i2c14 {
        cd-gpios = <&tlmm 91 GPIO_ACTIVE_LOW>;
 };
 
+&spi_flash {
+       spi-max-frequency = <50000000>;
+};
+
 /* 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>;
index 5eb6689..a74e0b7 100644 (file)
@@ -27,7 +27,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&key_vol_up_default>;
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pm7325_gpios 6 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
        bias-disable;
 };
 
+&lpass_dmic01_clk {
+       drive-strength = <8>;
+       bias-disable;
+};
+
+&lpass_dmic01_clk_sleep {
+       drive-strength = <2>;
+};
+
+&lpass_dmic01_data {
+       bias-pull-down;
+};
+
+&lpass_dmic23_clk {
+       drive-strength = <8>;
+       bias-disable;
+};
+
+&lpass_dmic23_clk_sleep {
+       drive-strength = <2>;
+};
+
+&lpass_dmic23_data {
+       bias-pull-down;
+};
+
+&lpass_rx_swr_clk {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-disable;
+};
+
+&lpass_rx_swr_clk_sleep {
+       bias-pull-down;
+};
+
+&lpass_rx_swr_data {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-bus-hold;
+};
+
+&lpass_rx_swr_data_sleep {
+       bias-pull-down;
+};
+
+&lpass_tx_swr_clk {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-disable;
+};
+
+&lpass_tx_swr_clk_sleep {
+       bias-pull-down;
+};
+
+&lpass_tx_swr_data {
+       drive-strength = <2>;
+       slew-rate = <1>;
+       bias-bus-hold;
+};
+
+&mi2s1_data0 {
+       drive-strength = <6>;
+       bias-disable;
+};
+
+&mi2s1_sclk {
+       drive-strength = <6>;
+       bias-disable;
+};
+
+&mi2s1_ws {
+       drive-strength = <6>;
+};
+
 &pm7325_gpios {
-       key_vol_up_default: key-vol-up-default {
+       key_vol_up_default: key-vol-up-state {
                pins = "gpio6";
                function = "normal";
                input-enable;
                bias-pull-down;
        };
 };
-
-&remoteproc_wpss {
-       status = "okay";
-};
-
-&wifi {
-       status = "okay";
-       wifi-firmware {
-               iommus = <&apps_smmu 0x1c02 0x1>;
-       };
-};
index d59002d..4c25ffc 100644 (file)
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                };
 
+               vreg_l17b_1p8: ldo17 {
+                       regulator-min-microvolt = <1700000>;
+                       regulator-max-microvolt = <1900000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
                vdd_px_wcd9385:
                vdd_txrx:
                vddpx_0:
@@ -517,7 +523,7 @@ mos_bt_uart: &uart7 {
  */
 
 &pm8350c_gpios {
-       pmic_edp_bl_en: pmic-edp-bl-en {
+       pmic_edp_bl_en: pmic-edp-bl-en-state {
                pins = "gpio7";
                function = "normal";
                bias-disable;
@@ -527,7 +533,7 @@ mos_bt_uart: &uart7 {
                output-low;
        };
 
-       pmic_edp_bl_pwm: pmic-edp-bl-pwm {
+       pmic_edp_bl_pwm: pmic-edp-bl-pwm-state {
                pins = "gpio8";
                function = "func1";
                bias-disable;
@@ -604,7 +610,6 @@ mos_bt_uart: &uart7 {
        ts_rst_conn: ts-rst-conn {
                pins = "gpio54";
                function = "gpio";
-               bias-pull-up;
                drive-strength = <2>;
        };
 };
index e66fc67..ef431c9 100644 (file)
                };
        };
 
-       cpu0_opp_table: cpu0-opp-table {
+       cpu0_opp_table: opp-table-cpu0 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu4_opp_table: cpu4-opp-table {
+       cpu4_opp_table: opp-table-cpu4 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu7_opp_table: cpu7-opp-table {
+       cpu7_opp_table: opp-table-cpu7 {
                compatible = "operating-points-v2";
                opp-shared;
 
                method = "smc";
        };
 
-       qspi_opp_table: qspi-opp-table {
+       qspi_opp_table: opp-table-qspi {
                compatible = "operating-points-v2";
 
                opp-75000000 {
                };
        };
 
-       qup_opp_table: qup-opp-table {
+       qup_opp_table: opp-table-qup {
                compatible = "operating-points-v2";
 
                opp-75000000 {
                        reg = <0 0x00100000 0 0x1f0000>;
                        clocks = <&rpmhcc RPMH_CXO_CLK>,
                                 <&rpmhcc RPMH_CXO_CLK_A>, <&sleep_clk>,
-                                <0>, <&pcie1_lane 0>,
+                                <0>, <&pcie1_lane>,
                                 <0>, <0>, <0>, <0>;
                        clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk",
                                      "pcie_0_pipe_clk", "pcie_1_pipe_clk",
                        };
                };
 
-               sdhc_1: sdhci@7c4000 {
+               sdhc_1: mmc@7c4000 {
                        compatible = "qcom,sc7280-sdhci", "qcom,sdhci-msm-v5";
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc1_clk>, <&sdc1_cmd>, <&sdc1_data>, <&sdc1_rclk>;
                                     <GIC_SPI 656 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC1_APPS_CLK>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
                                 <&rpmhcc RPMH_CXO_CLK>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
                        interconnects = <&aggre1_noc MASTER_SDCC_1 0 &mc_virt SLAVE_EBI1 0>,
                                        <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_SDCC_1 0>;
                        interconnect-names = "sdhc-ddr","cpu-sdhc";
 
                        clocks = <&gcc GCC_PCIE_1_PIPE_CLK>,
                                 <&gcc GCC_PCIE_1_PIPE_CLK_SRC>,
-                                <&pcie1_lane 0>,
+                                <&pcie1_lane>,
                                 <&rpmhcc RPMH_CXO_CLK>,
                                 <&gcc GCC_PCIE_1_AUX_CLK>,
                                 <&gcc GCC_PCIE_1_CFG_AHB_CLK>,
                                clock-names = "pipe0";
 
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clock-output-names = "pcie_1_pipe_clk";
                        };
                };
                lpasscore: clock-controller@3900000 {
                        compatible = "qcom,sc7280-lpasscorecc";
                        reg = <0 0x03900000 0 0x50000>;
-                       clocks =  <&rpmhcc RPMH_CXO_CLK>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
                        clock-names = "bi_tcxo";
                        power-domains = <&lpass_hm LPASS_CORE_CC_LPASS_CORE_HM_GDSC>;
                        #clock-cells = <1>;
                        qcom,bcm-voters = <&apps_bcm_voter>;
                };
 
+               lpass_tlmm: pinctrl@33c0000 {
+                       compatible = "qcom,sc7280-lpass-lpi-pinctrl";
+                       reg = <0 0x033c0000 0x0 0x20000>,
+                               <0 0x03550000 0x0 0x10000>;
+                       qcom,adsp-bypass-mode;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       gpio-ranges = <&lpass_tlmm 0 0 15>;
+
+                       #clock-cells = <1>;
+
+                       lpass_dmic01_clk: dmic01-clk {
+                               pins = "gpio6";
+                               function = "dmic1_clk";
+                       };
+
+                       lpass_dmic01_clk_sleep: dmic01-clk-sleep {
+                               pins = "gpio6";
+                               function = "dmic1_clk";
+                       };
+
+                       lpass_dmic01_data: dmic01-data {
+                               pins = "gpio7";
+                               function = "dmic1_data";
+                       };
+
+                       lpass_dmic01_data_sleep: dmic01-data-sleep {
+                               pins = "gpio7";
+                               function = "dmic1_data";
+                       };
+
+                       lpass_dmic23_clk: dmic23-clk {
+                               pins = "gpio8";
+                               function = "dmic2_clk";
+                       };
+
+                       lpass_dmic23_clk_sleep: dmic23-clk-sleep {
+                               pins = "gpio8";
+                               function = "dmic2_clk";
+                       };
+
+                       lpass_dmic23_data: dmic23-data {
+                               pins = "gpio9";
+                               function = "dmic2_data";
+                       };
+
+                       lpass_dmic23_data_sleep: dmic23-data-sleep {
+                               pins = "gpio9";
+                               function = "dmic2_data";
+                       };
+
+                       lpass_rx_swr_clk: rx-swr-clk {
+                               pins = "gpio3";
+                               function = "swr_rx_clk";
+                       };
+
+                       lpass_rx_swr_clk_sleep: rx-swr-clk-sleep {
+                               pins = "gpio3";
+                               function = "swr_rx_clk";
+                       };
+
+                       lpass_rx_swr_data: rx-swr-data {
+                               pins = "gpio4", "gpio5";
+                               function = "swr_rx_data";
+                       };
+
+                       lpass_rx_swr_data_sleep: rx-swr-data-sleep {
+                               pins = "gpio4", "gpio5";
+                               function = "swr_rx_data";
+                       };
+
+                       lpass_tx_swr_clk: tx-swr-clk {
+                               pins = "gpio0";
+                               function = "swr_tx_clk";
+                       };
+
+                       lpass_tx_swr_clk_sleep: tx-swr-clk-sleep {
+                               pins = "gpio0";
+                               function = "swr_tx_clk";
+                       };
+
+                       lpass_tx_swr_data: tx-swr-data {
+                               pins = "gpio1", "gpio2", "gpio14";
+                               function = "swr_tx_data";
+                       };
+
+                       lpass_tx_swr_data_sleep: tx-swr-data-sleep {
+                               pins = "gpio1", "gpio2", "gpio14";
+                               function = "swr_tx_data";
+                       };
+               };
+
                gpu: gpu@3d00000 {
                        compatible = "qcom,adreno-635.0", "qcom,adreno";
                        reg = <0 0x03d00000 0 0x40000>,
                };
 
                gmu: gmu@3d6a000 {
-                       compatible="qcom,adreno-gmu-635.0", "qcom,adreno-gmu";
+                       compatible = "qcom,adreno-gmu-635.0", "qcom,adreno-gmu";
                        reg = <0 0x03d6a000 0 0x34000>,
                                <0 0x3de0000 0 0x10000>,
                                <0 0x0b290000 0 0x10000>;
                        interrupts = <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
                                        <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hfi", "gmu";
-                       clocks = <&gpucc 5>,
-                                       <&gpucc 8>,
-                                       <&gcc GCC_DDRSS_GPU_AXI_CLK>,
-                                       <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
-                                       <&gpucc 2>,
-                                       <&gpucc 15>,
-                                       <&gpucc 11>;
+                       clocks = <&gpucc GPU_CC_CX_GMU_CLK>,
+                                <&gpucc GPU_CC_CXO_CLK>,
+                                <&gcc GCC_DDRSS_GPU_AXI_CLK>,
+                                <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
+                                <&gpucc GPU_CC_AHB_CLK>,
+                                <&gpucc GPU_CC_HUB_CX_INT_CLK>,
+                                <&gpucc GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK>;
                        clock-names = "gmu",
                                      "cxo",
                                      "axi",
                                      "ahb",
                                      "hub",
                                      "smmu_vote";
-                       power-domains = <&gpucc 0>,
-                                       <&gpucc 1>;
+                       power-domains = <&gpucc GPU_CC_CX_GDSC>,
+                                       <&gpucc GPU_CC_GX_GDSC>;
                        power-domain-names = "cx",
                                             "gx";
                        iommus = <&adreno_smmu 5 0x400>;
                                        <GIC_SPI 687 IRQ_TYPE_LEVEL_HIGH>;
 
                        clocks = <&gcc GCC_GPU_MEMNOC_GFX_CLK>,
-                                       <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>,
-                                       <&gpucc 2>,
-                                       <&gpucc 11>,
-                                       <&gpucc 5>,
-                                       <&gpucc 15>,
-                                       <&gpucc 13>;
+                                <&gcc GCC_GPU_SNOC_DVM_GFX_CLK>,
+                                <&gpucc GPU_CC_AHB_CLK>,
+                                <&gpucc GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK>,
+                                <&gpucc GPU_CC_CX_GMU_CLK>,
+                                <&gpucc GPU_CC_HUB_CX_INT_CLK>,
+                                <&gpucc GPU_CC_HUB_AON_CLK>;
                        clock-names = "gcc_gpu_memnoc_gfx_clk",
                                        "gcc_gpu_snoc_dvm_gfx_clk",
                                        "gpu_cc_ahb_clk",
                                        "gpu_cc_hub_cx_int_clk",
                                        "gpu_cc_hub_aon_clk";
 
-                       power-domains = <&gpucc 0>;
+                       power-domains = <&gpucc GPU_CC_CX_GDSC>;
                };
 
                remoteproc_mpss: remoteproc@4080000 {
                        };
                };
 
-               sdhc_2: sdhci@8804000 {
+               sdhc_2: mmc@8804000 {
                        compatible = "qcom,sc7280-sdhci", "qcom,sdhci-msm-v5";
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc2_clk>, <&sdc2_cmd>, <&sdc2_data>;
                                     <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC2_APPS_CLK>,
-                                <&gcc GCC_SDCC2_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                                <&gcc GCC_SDCC2_APPS_CLK>,
                                 <&rpmhcc RPMH_CXO_CLK>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
                        interconnects = <&aggre1_noc MASTER_SDCC_2 0 &mc_virt SLAVE_EBI1 0>,
                                        <&gem_noc MASTER_APPSS_PROC 0 &cnoc2 SLAVE_SDCC_2 0>;
                        interconnect-names = "sdhc-ddr","cpu-sdhc";
                                iommus = <&apps_smmu 0x21a2 0x0>;
                        };
 
-                       venus_opp_table: venus-opp-table {
+                       venus_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-133330000 {
                                      "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>;
                                              "lut",
                                              "core",
                                              "vsync";
-                               assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
-                                               <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>,
                                                <&dispcc DISP_CC_MDSS_AHB_CLK>;
-                               assigned-clock-rates = <300000000>,
-                                                       <19200000>,
+                               assigned-clock-rates = <19200000>,
                                                        <19200000>;
                                operating-points-v2 = <&mdp_opp_table>;
                                power-domains = <&rpmhpd SC7280_CX>;
                                         <&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",
+                               clock-names = "core_iface",
                                                "core_aux",
                                                "ctrl_link",
                                                "ctrl_link_iface",
                };
 
                aoss_qmp: power-controller@c300000 {
-                       compatible = "qcom,sc7280-aoss-qmp";
+                       compatible = "qcom,sc7280-aoss-qmp", "qcom,aoss-qmp";
                        reg = <0 0x0c300000 0 0x400>;
                        interrupts-extended = <&ipcc IPCC_CLIENT_AOP
                                                     IPCC_MPROC_SIGNAL_GLINK_QMP
                                function = "edp_hot";
                        };
 
+                       mi2s0_data0: mi2s0-data0 {
+                               pins = "gpio98";
+                               function = "mi2s0_data0";
+                       };
+
+                       mi2s0_data1: mi2s0-data1 {
+                               pins = "gpio99";
+                               function = "mi2s0_data1";
+                       };
+
+                       mi2s0_mclk: mi2s0-mclk {
+                               pins = "gpio96";
+                               function = "pri_mi2s";
+                       };
+
+                       mi2s0_sclk: mi2s0-sclk {
+                               pins = "gpio97";
+                               function = "mi2s0_sck";
+                       };
+
+                       mi2s0_ws: mi2s0-ws {
+                               pins = "gpio100";
+                               function = "mi2s0_ws";
+                       };
+
+                       mi2s1_data0: mi2s1-data0 {
+                               pins = "gpio107";
+                               function = "mi2s1_data0";
+                       };
+
+                       mi2s1_sclk: mi2s1-sclk {
+                               pins = "gpio106";
+                               function = "mi2s1_sck";
+                       };
+
+                       mi2s1_ws: mi2s1-ws {
+                               pins = "gpio108";
+                               function = "mi2s1_ws";
+                       };
+
                        pcie1_clkreq_n: pcie1-clkreq-n {
                                pins = "gpio79";
                                function = "pcie1_clkreqn";
                        };
                };
 
-               imem@146a5000 {
-                       compatible = "qcom,sc7280-imem", "syscon";
+               sram@146a5000 {
+                       compatible = "qcom,sc7280-imem", "syscon", "simple-mfd";
                        reg = <0 0x146a5000 0 0x6000>;
 
                        #address-cells = <1>;
                };
 
                timer@17c20000 {
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0 0x17c20000 0 0x1000>;
 
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c21000 0 0x1000>,
-                                     <0 0x17c22000 0 0x1000>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
                        };
 
                        frame@17c23000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c23000 0 0x1000>;
+                               reg = <0x17c23000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c25000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c25000 0 0x1000>;
+                               reg = <0x17c25000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c27000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c27000 0 0x1000>;
+                               reg = <0x17c27000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c29000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c29000 0 0x1000>;
+                               reg = <0x17c29000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c2b000 0 0x1000>;
+                               reg = <0x17c2b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17c2d000 0 0x1000>;
+                               reg = <0x17c2d000 0x1000>;
                                status = "disabled";
                        };
                };
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts
new file mode 100644 (file)
index 0000000..45058ad
--- /dev/null
@@ -0,0 +1,427 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+
+#include "sc8280xp.dtsi"
+#include "sc8280xp-pmics.dtsi"
+
+/ {
+       model = "Qualcomm SC8280XP CRD";
+       compatible = "qcom,sc8280xp-crd", "qcom,sc8280xp";
+
+       aliases {
+               serial0 = &qup2_uart17;
+       };
+
+       backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pmc8280c_lpg 3 1000000>;
+               enable-gpios = <&pmc8280_1_gpios 8 GPIO_ACTIVE_HIGH>;
+               power-supply = <&vreg_edp_bl>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       vreg_edp_bl: regulator-edp-bl {
+               compatible = "regulator-fixed";
+
+               regulator-name = "VREG_EDP_BL";
+               regulator-min-microvolt = <3600000>;
+               regulator-max-microvolt = <3600000>;
+
+               gpio = <&pmc8280_1_gpios 9 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&edp_bl_reg_en>;
+
+               regulator-boot-on;
+       };
+
+       vreg_misc_3p3: regulator-misc-3p3 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "VREG_MISC_3P3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&pmc8280_1_gpios 1 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&misc_3p3_reg_en>;
+
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
+&apps_rsc {
+       pmc8280-1-rpmh-regulators {
+               compatible = "qcom,pm8350-rpmh-regulators";
+               qcom,pmic-id = "b";
+
+               vdd-l3-l5-supply = <&vreg_s11b>;
+
+               vreg_s11b: smps11 {
+                       regulator-name = "vreg_s11b";
+                       regulator-min-microvolt = <1272000>;
+                       regulator-max-microvolt = <1272000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l3b: ldo3 {
+                       regulator-name = "vreg_l3b";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               vreg_l4b: ldo4 {
+                       regulator-name = "vreg_l4b";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l6b: ldo6 {
+                       regulator-name = "vreg_l6b";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+                       regulator-boot-on;
+               };
+       };
+
+       pmc8280c-rpmh-regulators {
+               compatible = "qcom,pm8350c-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vreg_l1c: ldo1 {
+                       regulator-name = "vreg_l1c";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7c: ldo7 {
+                       regulator-name = "vreg_l7c";
+                       regulator-min-microvolt = <2504000>;
+                       regulator-max-microvolt = <2504000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l13c: ldo13 {
+                       regulator-name = "vreg_l13c";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+
+       pmc8280-2-rpmh-regulators {
+               compatible = "qcom,pm8350-rpmh-regulators";
+               qcom,pmic-id = "d";
+
+               vdd-l1-l4-supply = <&vreg_s11b>;
+
+               vreg_l3d: ldo3 {
+                       regulator-name = "vreg_l3d";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l4d: ldo4 {
+                       regulator-name = "vreg_l4d";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l6d: ldo6 {
+                       regulator-name = "vreg_l6d";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7d: ldo7 {
+                       regulator-name = "vreg_l7d";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l9d: ldo9 {
+                       regulator-name = "vreg_l9d";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+};
+
+&pmc8280c_lpg {
+       status = "okay";
+};
+
+&pmk8280_pon_pwrkey {
+       status = "okay";
+};
+
+&qup0 {
+       status = "okay";
+};
+
+&qup0_i2c4 {
+       clock-frequency = <400000>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&qup0_i2c4_default>, <&ts0_default>;
+
+       status = "okay";
+
+       touchscreen@10 {
+               compatible = "hid-over-i2c";
+               reg = <0x10>;
+               hid-descr-addr = <0x1>;
+               interrupts-extended = <&tlmm 175 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vreg_misc_3p3>;
+       };
+};
+
+&qup1 {
+       status = "okay";
+};
+
+&qup2 {
+       status = "okay";
+};
+
+&qup2_i2c5 {
+       clock-frequency = <400000>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&qup2_i2c5_default>, <&kybd_default>, <&tpad_default>;
+
+       status = "okay";
+
+       touchpad@15 {
+               compatible = "hid-over-i2c";
+               reg = <0x15>;
+               hid-descr-addr = <0x1>;
+               interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vreg_misc_3p3>;
+       };
+
+       keyboard@68 {
+               compatible = "hid-over-i2c";
+               reg = <0x68>;
+               hid-descr-addr = <0x1>;
+               interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vreg_misc_3p3>;
+       };
+};
+
+&qup2_uart17 {
+       compatible = "qcom,geni-debug-uart";
+
+       status = "okay";
+};
+
+&remoteproc_adsp {
+       firmware-name = "qcom/sc8280xp/qcadsp8280.mbn";
+
+       status = "okay";
+};
+
+&remoteproc_nsp0 {
+       firmware-name = "qcom/sc8280xp/qccdsp8280.mbn";
+
+       status = "okay";
+};
+
+&ufs_mem_hc {
+       reset-gpios = <&tlmm 228 GPIO_ACTIVE_LOW>;
+
+       vcc-supply = <&vreg_l7c>;
+       vcc-max-microamp = <800000>;
+       vccq-supply = <&vreg_l3d>;
+       vccq-max-microamp = <900000>;
+
+       status = "okay";
+};
+
+&ufs_mem_phy {
+       vdda-phy-supply = <&vreg_l6b>;
+       vdda-pll-supply = <&vreg_l3b>;
+
+       status = "okay";
+};
+
+&usb_0 {
+       status = "okay";
+};
+
+&usb_0_dwc3 {
+       /* TODO: Define USB-C connector properly */
+       dr_mode = "host";
+};
+
+&usb_0_hsphy {
+       vdda-pll-supply = <&vreg_l9d>;
+       vdda18-supply = <&vreg_l1c>;
+       vdda33-supply = <&vreg_l7d>;
+
+       status = "okay";
+};
+
+&usb_0_qmpphy {
+       vdda-phy-supply = <&vreg_l9d>;
+       vdda-pll-supply = <&vreg_l4d>;
+
+       status = "okay";
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       /* TODO: Define USB-C connector properly */
+       dr_mode = "host";
+};
+
+&usb_1_hsphy {
+       vdda-pll-supply = <&vreg_l4b>;
+       vdda18-supply = <&vreg_l1c>;
+       vdda33-supply = <&vreg_l13c>;
+
+       status = "okay";
+};
+
+&usb_1_qmpphy {
+       vdda-phy-supply = <&vreg_l4b>;
+       vdda-pll-supply = <&vreg_l3b>;
+
+       status = "okay";
+};
+
+&xo_board_clk {
+       clock-frequency = <38400000>;
+};
+
+/* PINCTRL - additions to nodes defined in sc8280xp.dtsi */
+
+&pmc8280_1_gpios {
+       edp_bl_en: edp-bl-en-state {
+               pins = "gpio8";
+               function = "normal";
+       };
+
+       edp_bl_reg_en: edp-bl-reg-en-state {
+               pins = "gpio9";
+               function = "normal";
+       };
+
+       misc_3p3_reg_en: misc-3p3-reg-en-state {
+               pins = "gpio1";
+               function = "normal";
+       };
+};
+
+&pmc8280c_gpios {
+       edp_bl_pwm: edp-bl-pwm-state {
+               pins = "gpio8";
+               function = "func1";
+       };
+};
+
+&tlmm {
+       gpio-reserved-ranges = <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
+
+       kybd_default: kybd-default-state {
+               disable {
+                       pins = "gpio102";
+                       function = "gpio";
+                       output-low;
+               };
+
+               int-n {
+                       pins = "gpio104";
+                       function = "gpio";
+                       bias-disable;
+               };
+
+               reset {
+                       pins = "gpio105";
+                       function = "gpio";
+                       bias-disable;
+               };
+       };
+
+       qup0_i2c4_default: qup0-i2c4-default-state {
+               pins = "gpio171", "gpio172";
+               function = "qup4";
+
+               bias-disable;
+               drive-strength = <16>;
+       };
+
+       qup2_i2c5_default: qup2-i2c5-default-state {
+               pins = "gpio81", "gpio82";
+               function = "qup21";
+
+               bias-disable;
+               drive-strength = <16>;
+       };
+
+       tpad_default: tpad-default-state {
+               int-n {
+                       pins = "gpio182";
+                       function = "gpio";
+                       bias-disable;
+               };
+       };
+
+       ts0_default: ts0-default-state {
+               int-n {
+                       pins = "gpio175";
+                       function = "gpio";
+                       bias-pull-up;
+               };
+
+               reset-n {
+                       pins = "gpio99";
+                       function = "gpio";
+                       output-high;
+                       drive-strength = <16>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
new file mode 100644 (file)
index 0000000..84dc92d
--- /dev/null
@@ -0,0 +1,386 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+
+#include "sc8280xp.dtsi"
+#include "sc8280xp-pmics.dtsi"
+
+/ {
+       model = "Lenovo ThinkPad X13s";
+       compatible = "lenovo,thinkpad-x13s", "qcom,sc8280xp";
+
+       backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pmc8280c_lpg 3 1000000>;
+               enable-gpios = <&pmc8280_1_gpios 8 GPIO_ACTIVE_HIGH>;
+               power-supply = <&vreg_edp_bl>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>;
+       };
+
+       vreg_edp_bl: regulator-edp-bl {
+               compatible = "regulator-fixed";
+
+               regulator-name = "VBL9";
+               regulator-min-microvolt = <3600000>;
+               regulator-max-microvolt = <3600000>;
+
+               gpio = <&pmc8280_1_gpios 9 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&edp_bl_reg_en>;
+
+               regulator-boot-on;
+       };
+
+       vreg_misc_3p3: regulator-misc-3p3 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "VCC3B";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&pmc8280_1_gpios 1 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&misc_3p3_reg_en>;
+
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
+&apps_rsc {
+       pmc8280-1-rpmh-regulators {
+               compatible = "qcom,pm8350-rpmh-regulators";
+               qcom,pmic-id = "b";
+
+               vdd-l3-l5-supply = <&vreg_s11b>;
+
+               vreg_s11b: smps11 {
+                       regulator-name = "vreg_s11b";
+                       regulator-min-microvolt = <1272000>;
+                       regulator-max-microvolt = <1272000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l3b: ldo3 {
+                       regulator-name = "vreg_l3b";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+                       regulator-boot-on;
+               };
+
+               vreg_l4b: ldo4 {
+                       regulator-name = "vreg_l4b";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l6b: ldo6 {
+                       regulator-name = "vreg_l6b";
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+                       regulator-boot-on;
+                       regulator-always-on;    // FIXME: VDD_A_EDP_0_0P9
+               };
+       };
+
+       pmc8280c-rpmh-regulators {
+               compatible = "qcom,pm8350c-rpmh-regulators";
+               qcom,pmic-id = "c";
+
+               vreg_l1c: ldo1 {
+                       regulator-name = "vreg_l1c";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l12c: ldo12 {
+                       regulator-name = "vreg_l12c";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l13c: ldo13 {
+                       regulator-name = "vreg_l13c";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+
+       pmc8280-2-rpmh-regulators {
+               compatible = "qcom,pm8350-rpmh-regulators";
+               qcom,pmic-id = "d";
+
+               vdd-l1-l4-supply = <&vreg_s11b>;
+
+               vreg_l3d: ldo3 {
+                       regulator-name = "vreg_l3d";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l4d: ldo4 {
+                       regulator-name = "vreg_l4d";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7d: ldo7 {
+                       regulator-name = "vreg_l7d";
+                       regulator-min-microvolt = <3072000>;
+                       regulator-max-microvolt = <3072000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l9d: ldo9 {
+                       regulator-name = "vreg_l9d";
+                       regulator-min-microvolt = <912000>;
+                       regulator-max-microvolt = <912000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-allow-set-load;
+               };
+       };
+};
+
+&pmc8280c_lpg {
+       status = "okay";
+};
+
+&pmk8280_pon_pwrkey {
+       status = "okay";
+};
+
+&qup0 {
+       status = "okay";
+};
+
+&qup0_i2c4 {
+       clock-frequency = <400000>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&qup0_i2c4_default>, <&ts0_default>;
+
+       status = "okay";
+
+       /* FIXME: verify */
+       touchscreen@10 {
+               compatible = "hid-over-i2c";
+               reg = <0x10>;
+               hid-descr-addr = <0x1>;
+               interrupts-extended = <&tlmm 175 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vreg_misc_3p3>;
+       };
+};
+
+&qup1 {
+       status = "okay";
+};
+
+&qup2 {
+       status = "okay";
+};
+
+&qup2_i2c5 {
+       clock-frequency = <400000>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&qup2_i2c5_default>, <&kybd_default>, <&tpad_default>;
+
+       status = "okay";
+
+       touchpad@2c {
+               compatible = "hid-over-i2c";
+               reg = <0x2c>;
+               hid-descr-addr = <0x20>;
+               interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vreg_misc_3p3>;
+       };
+
+       keyboard@68 {
+               compatible = "hid-over-i2c";
+               reg = <0x68>;
+               hid-descr-addr = <0x1>;
+               interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
+               vdd-supply = <&vreg_misc_3p3>;
+       };
+};
+
+&remoteproc_adsp {
+       firmware-name = "qcom/sc8280xp/qcadsp8280.mbn";
+
+       status = "okay";
+};
+
+&remoteproc_nsp0 {
+       firmware-name = "qcom/sc8280xp/qccdsp8280.mbn";
+
+       status = "okay";
+};
+
+&usb_0 {
+       status = "okay";
+};
+
+&usb_0_dwc3 {
+       /* TODO: Define USB-C connector properly */
+       dr_mode = "host";
+};
+
+&usb_0_hsphy {
+       vdda-pll-supply = <&vreg_l9d>;
+       vdda18-supply = <&vreg_l1c>;
+       vdda33-supply = <&vreg_l7d>;
+
+       status = "okay";
+};
+
+&usb_0_qmpphy {
+       vdda-phy-supply = <&vreg_l9d>;
+       vdda-pll-supply = <&vreg_l4d>;
+
+       status = "okay";
+};
+
+&usb_1 {
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       /* TODO: Define USB-C connector properly */
+       dr_mode = "host";
+};
+
+&usb_1_hsphy {
+       vdda-pll-supply = <&vreg_l4b>;
+       vdda18-supply = <&vreg_l1c>;
+       vdda33-supply = <&vreg_l13c>;
+
+       status = "okay";
+};
+
+&usb_1_qmpphy {
+       vdda-phy-supply = <&vreg_l4b>;
+       vdda-pll-supply = <&vreg_l3b>;
+
+       status = "okay";
+};
+
+&xo_board_clk {
+       clock-frequency = <38400000>;
+};
+
+/* PINCTRL */
+
+&pmc8280_1_gpios {
+       edp_bl_en: edp-bl-en-state {
+               pins = "gpio8";
+               function = "normal";
+       };
+
+       edp_bl_reg_en: edp-bl-reg-en-state {
+               pins = "gpio9";
+               function = "normal";
+       };
+
+       misc_3p3_reg_en: misc-3p3-reg-en-state {
+               pins = "gpio1";
+               function = "normal";
+       };
+};
+
+&pmc8280c_gpios {
+       edp_bl_pwm: edp-bl-pwm-state {
+               pins = "gpio8";
+               function = "func1";
+       };
+};
+
+&tlmm {
+       gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
+
+       kybd_default: kybd-default-state {
+               disable {
+                       pins = "gpio102";
+                       function = "gpio";
+                       output-low;
+               };
+
+               int-n {
+                       pins = "gpio104";
+                       function = "gpio";
+                       bias-disable;
+               };
+
+               reset {
+                       pins = "gpio105";
+                       function = "gpio";
+                       bias-disable;
+               };
+       };
+
+       qup0_i2c4_default: qup0-i2c4-default-state {
+               pins = "gpio171", "gpio172";
+               function = "qup4";
+               bias-disable;
+               drive-strength = <16>;
+       };
+
+       qup2_i2c5_default: qup2-i2c5-default-state {
+               pins = "gpio81", "gpio82";
+               function = "qup21";
+               bias-disable;
+               drive-strength = <16>;
+       };
+
+       tpad_default: tpad-default-state {
+               int-n {
+                       pins = "gpio182";
+                       function = "gpio";
+                       bias-disable;
+               };
+       };
+
+       ts0_default: ts0-default-state {
+               int-n {
+                       pins = "gpio175";
+                       function = "gpio";
+                       bias-pull-up;
+               };
+
+               reset-n {
+                       pins = "gpio99";
+                       function = "gpio";
+                       output-high;
+                       drive-strength = <16>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
new file mode 100644 (file)
index 0000000..ae90b97
--- /dev/null
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/spmi/spmi.h>
+
+&spmi_bus {
+       pmk8280: pmic@0 {
+               compatible = "qcom,pmk8350", "qcom,spmi-pmic";
+               reg = <0x0 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pmk8280_pon: pon@1300 {
+                       compatible = "qcom,pm8998-pon";
+                       reg = <0x1300>;
+
+                       pmk8280_pon_pwrkey: pwrkey {
+                               compatible = "qcom,pmk8350-pwrkey";
+                               interrupts = <0x0 0x13 0x7 IRQ_TYPE_EDGE_BOTH>;
+                               linux,code = <KEY_POWER>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       pmc8280_1: pmic@1 {
+               compatible = "qcom,pm8350", "qcom,spmi-pmic";
+               reg = <0x1 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pmc8280_1_gpios: gpio@8800 {
+                       compatible = "qcom,pm8350-gpio", "qcom,spmi-gpio";
+                       reg = <0x8800>;
+                       gpio-controller;
+                       gpio-ranges = <&pmc8280_1_gpios 0 0 10>;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       pmc8280c: pmic@2 {
+               compatible = "qcom,pm8350c", "qcom,spmi-pmic";
+               reg = <0x2 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pmc8280c_gpios: gpio@8800 {
+                       compatible = "qcom,pm8350c-gpio", "qcom,spmi-gpio";
+                       reg = <0x8800>;
+                       gpio-controller;
+                       gpio-ranges = <&pmc8280c_gpios 0 0 9>;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               pmc8280c_lpg: lpg@e800 {
+                       compatible = "qcom,pm8350c-pwm";
+                       reg = <0xe800>;
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+       };
+
+       pmc8280_2: pmic@3 {
+               compatible = "qcom,pm8350", "qcom,spmi-pmic";
+               reg = <0x3 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pmc8280_2_gpios: gpio@8800 {
+                       compatible = "qcom,pm8350-gpio", "qcom,spmi-gpio";
+                       reg = <0x8800>;
+                       gpio-controller;
+                       gpio-ranges = <&pmc8280_2_gpios 0 0 10>;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       pmr735a: pmic@4 {
+               compatible = "qcom,pmr735a", "qcom,spmi-pmic";
+               reg = <0x4 SPMI_USID>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               pmr735a_gpios: gpio@8800 {
+                       compatible = "qcom,pmr735a-gpio", "qcom,spmi-gpio";
+                       reg = <0x8800>;
+                       gpio-controller;
+                       gpio-ranges = <&pmr735a_gpios 0 0 4>;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
new file mode 100644 (file)
index 0000000..7945cbb
--- /dev/null
@@ -0,0 +1,2139 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022, Linaro Limited
+ */
+
+#include <dt-bindings/clock/qcom,gcc-sc8280xp.h>
+#include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/interconnect/qcom,sc8280xp.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/mailbox/qcom-ipcc.h>
+#include <dt-bindings/power/qcom-rpmpd.h>
+#include <dt-bindings/soc/qcom,rpmh-rsc.h>
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+       interrupt-parent = <&intc>;
+
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       clocks {
+               xo_board_clk: xo-board-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+               };
+
+               sleep_clk: sleep-clk {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <32764>;
+               };
+       };
+
+       cpu0_opp_table: cpu0-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-403200000 {
+                       opp-hz = /bits/ 64 <403200000>;
+               };
+               opp-499200000 {
+                       opp-hz = /bits/ 64 <499200000>;
+               };
+               opp-595200000 {
+                       opp-hz = /bits/ 64 <595200000>;
+               };
+               opp-691200000 {
+                       opp-hz = /bits/ 64 <691200000>;
+               };
+               opp-806400000 {
+                       opp-hz = /bits/ 64 <806400000>;
+               };
+               opp-902400000 {
+                       opp-hz = /bits/ 64 <902400000>;
+               };
+               opp-1017600000 {
+                       opp-hz = /bits/ 64 <1017600000>;
+               };
+               opp-1113600000 {
+                       opp-hz = /bits/ 64 <1113600000>;
+               };
+               opp-1209600000 {
+                       opp-hz = /bits/ 64 <1209600000>;
+               };
+               opp-1324800000 {
+                       opp-hz = /bits/ 64 <1324800000>;
+               };
+               opp-1440000000 {
+                       opp-hz = /bits/ 64 <1440000000>;
+               };
+               opp-1555200000 {
+                       opp-hz = /bits/ 64 <1555200000>;
+               };
+               opp-1670400000 {
+                       opp-hz = /bits/ 64 <1670400000>;
+               };
+               opp-1785600000 {
+                       opp-hz = /bits/ 64 <1785600000>;
+               };
+               opp-1881600000 {
+                       opp-hz = /bits/ 64 <1881600000>;
+               };
+               opp-1996800000 {
+                       opp-hz = /bits/ 64 <1996800000>;
+               };
+               opp-2112000000 {
+                       opp-hz = /bits/ 64 <2112000000>;
+               };
+               opp-2227200000 {
+                       opp-hz = /bits/ 64 <2227200000>;
+               };
+               opp-2342400000 {
+                       opp-hz = /bits/ 64 <2342400000>;
+               };
+               opp-2438400000 {
+                       opp-hz = /bits/ 64 <2438400000>;
+               };
+       };
+
+       cpu4_opp_table: cpu4-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-825600000 {
+                       opp-hz = /bits/ 64 <825600000>;
+               };
+               opp-940800000 {
+                       opp-hz = /bits/ 64 <940800000>;
+               };
+               opp-1056000000 {
+                       opp-hz = /bits/ 64 <1056000000>;
+               };
+               opp-1171200000 {
+                       opp-hz = /bits/ 64 <1171200000>;
+               };
+               opp-1286400000 {
+                       opp-hz = /bits/ 64 <1286400000>;
+               };
+               opp-1401600000 {
+                       opp-hz = /bits/ 64 <1401600000>;
+               };
+               opp-1516800000 {
+                       opp-hz = /bits/ 64 <1516800000>;
+               };
+               opp-1632000000 {
+                       opp-hz = /bits/ 64 <1632000000>;
+               };
+               opp-1747200000 {
+                       opp-hz = /bits/ 64 <1747200000>;
+               };
+               opp-1862400000 {
+                       opp-hz = /bits/ 64 <1862400000>;
+               };
+               opp-1977600000 {
+                       opp-hz = /bits/ 64 <1977600000>;
+               };
+               opp-2073600000 {
+                       opp-hz = /bits/ 64 <2073600000>;
+               };
+               opp-2169600000 {
+                       opp-hz = /bits/ 64 <2169600000>;
+               };
+               opp-2284800000 {
+                       opp-hz = /bits/ 64 <2284800000>;
+               };
+               opp-2400000000 {
+                       opp-hz = /bits/ 64 <2400000000>;
+               };
+               opp-2496000000 {
+                       opp-hz = /bits/ 64 <2496000000>;
+               };
+               opp-2592000000 {
+                       opp-hz = /bits/ 64 <2592000000>;
+               };
+               opp-2688000000 {
+                       opp-hz = /bits/ 64 <2688000000>;
+               };
+               opp-2803200000 {
+                       opp-hz = /bits/ 64 <2803200000>;
+               };
+               opp-2899200000 {
+                       opp-hz = /bits/ 64 <2899200000>;
+               };
+               opp-2995200000 {
+                       opp-hz = /bits/ 64 <2995200000>;
+               };
+       };
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               CPU0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x0>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <602>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_0: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                               L3_0: l3-cache {
+                                     compatible = "cache";
+                               };
+                       };
+               };
+
+               CPU1: cpu@100 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x100>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <602>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_100: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               CPU2: cpu@200 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x200>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <602>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_200: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               CPU3: cpu@300 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x300>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <602>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_300: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               CPU4: cpu@400 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x400>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_400: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               CPU5: cpu@500 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x500>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_500: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               CPU6: cpu@600 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x600>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       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>;
+                       #cooling-cells = <2>;
+                       L2_600: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               CPU7: cpu@700 {
+                       device_type = "cpu";
+                       compatible = "qcom,kryo";
+                       reg = <0x0 0x700>;
+                       enable-method = "psci";
+                       capacity-dmips-mhz = <1024>;
+                       next-level-cache = <&L2_700>;
+                       power-domains = <&CPU_PD7>;
+                       power-domain-names = "psci";
+                       qcom,freq-domain = <&cpufreq_hw 1>;
+                       operating-points-v2 = <&cpu4_opp_table>;
+                       #cooling-cells = <2>;
+                       L2_700: l2-cache {
+                               compatible = "cache";
+                               next-level-cache = <&L3_0>;
+                       };
+               };
+
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&CPU0>;
+                               };
+
+                               core1 {
+                                       cpu = <&CPU1>;
+                               };
+
+                               core2 {
+                                       cpu = <&CPU2>;
+                               };
+
+                               core3 {
+                                       cpu = <&CPU3>;
+                               };
+
+                               core4 {
+                                       cpu = <&CPU4>;
+                               };
+
+                               core5 {
+                                       cpu = <&CPU5>;
+                               };
+
+                               core6 {
+                                       cpu = <&CPU6>;
+                               };
+
+                               core7 {
+                                       cpu = <&CPU7>;
+                               };
+                       };
+               };
+
+               idle-states {
+                       entry-method = "psci";
+
+                       LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
+                               compatible = "arm,idle-state";
+                               idle-state-name = "little-rail-power-collapse";
+                               arm,psci-suspend-param = <0x40000004>;
+                               entry-latency-us = <355>;
+                               exit-latency-us = <909>;
+                               min-residency-us = <3934>;
+                               local-timer-stop;
+                       };
+
+                       BIG_CPU_SLEEP_0: cpu-sleep-1-0 {
+                               compatible = "arm,idle-state";
+                               idle-state-name = "big-rail-power-collapse";
+                               arm,psci-suspend-param = <0x40000004>;
+                               entry-latency-us = <241>;
+                               exit-latency-us = <1461>;
+                               min-residency-us = <4488>;
+                               local-timer-stop;
+                       };
+               };
+
+               domain-idle-states {
+                       CLUSTER_SLEEP_0: cluster-sleep-0 {
+                               compatible = "domain-idle-state";
+                               idle-state-name = "cluster-power-collapse";
+                               arm,psci-suspend-param = <0x4100c344>;
+                               entry-latency-us = <3263>;
+                               exit-latency-us = <6562>;
+                               min-residency-us = <9987>;
+                       };
+               };
+       };
+
+       firmware {
+               scm: scm {
+                       compatible = "qcom,scm-sc8280xp", "qcom,scm";
+               };
+       };
+
+       aggre1_noc: interconnect-aggre1-noc {
+               compatible = "qcom,sc8280xp-aggre1-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       aggre2_noc: interconnect-aggre2-noc {
+               compatible = "qcom,sc8280xp-aggre2-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       clk_virt: interconnect-clk-virt {
+               compatible = "qcom,sc8280xp-clk-virt";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       config_noc: interconnect-config-noc {
+               compatible = "qcom,sc8280xp-config-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       dc_noc: interconnect-dc-noc {
+               compatible = "qcom,sc8280xp-dc-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       gem_noc: interconnect-gem-noc {
+               compatible = "qcom,sc8280xp-gem-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       lpass_noc: interconnect-lpass-ag-noc {
+               compatible = "qcom,sc8280xp-lpass-ag-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       mc_virt: interconnect-mc-virt {
+               compatible = "qcom,sc8280xp-mc-virt";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       mmss_noc: interconnect-mmss-noc {
+               compatible = "qcom,sc8280xp-mmss-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       nspa_noc: interconnect-nspa-noc {
+               compatible = "qcom,sc8280xp-nspa-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       nspb_noc: interconnect-nspb-noc {
+               compatible = "qcom,sc8280xp-nspb-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       system_noc: interconnect-system-noc {
+               compatible = "qcom,sc8280xp-system-noc";
+               #interconnect-cells = <2>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the size */
+               reg = <0x0 0x80000000 0x0 0x0>;
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <GIC_PPI 5 IRQ_TYPE_LEVEL_HIGH>;
+       };
+
+       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>;
+               };
+       };
+
+       qup_opp_table_100mhz: qup-100mhz-opp-table {
+               compatible = "operating-points-v2";
+
+               opp-75000000 {
+                       opp-hz = /bits/ 64 <75000000>;
+                       required-opps = <&rpmhpd_opp_low_svs>;
+               };
+
+               opp-100000000 {
+                       opp-hz = /bits/ 64 <100000000>;
+                       required-opps = <&rpmhpd_opp_svs>;
+               };
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               reserved-region@80000000 {
+                       reg = <0 0x80000000 0 0x860000>;
+                       no-map;
+               };
+
+               cmd_db: cmd-db-region@80860000 {
+                       compatible = "qcom,cmd-db";
+                       reg = <0 0x80860000 0 0x20000>;
+                       no-map;
+               };
+
+               reserved-region@80880000 {
+                       reg = <0 0x80880000 0 0x80000>;
+                       no-map;
+               };
+
+               smem_mem: smem-region@80900000 {
+                       compatible = "qcom,smem";
+                       reg = <0 0x80900000 0 0x200000>;
+                       no-map;
+                       hwlocks = <&tcsr_mutex 3>;
+               };
+
+               reserved-region@80b00000 {
+                       reg = <0 0x80b00000 0 0x100000>;
+                       no-map;
+               };
+
+               reserved-region@83b00000 {
+                       reg = <0 0x83b00000 0 0x1700000>;
+                       no-map;
+               };
+
+               reserved-region@85b00000 {
+                       reg = <0 0x85b00000 0 0xc00000>;
+                       no-map;
+               };
+
+               pil_adsp_mem: adsp-region@86c00000 {
+                       reg = <0 0x86c00000 0 0x2000000>;
+                       no-map;
+               };
+
+               pil_nsp0_mem: cdsp0-region@8a100000 {
+                       reg = <0 0x8a100000 0 0x1e00000>;
+                       no-map;
+               };
+
+               pil_nsp1_mem: cdsp1-region@8c600000 {
+                       reg = <0 0x8c600000 0 0x1e00000>;
+                       no-map;
+               };
+
+               reserved-region@aeb00000 {
+                       reg = <0 0xaeb00000 0 0x16600000>;
+                       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-nsp0 {
+               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_nsp0_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               smp2p_nsp0_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       smp2p-nsp1 {
+               compatible = "qcom,smp2p";
+               qcom,smem = <617>, <616>;
+               interrupts-extended = <&ipcc IPCC_CLIENT_NSP1
+                                            IPCC_MPROC_SIGNAL_SMP2P
+                                            IRQ_TYPE_EDGE_RISING>;
+               mboxes = <&ipcc IPCC_CLIENT_NSP1
+                               IPCC_MPROC_SIGNAL_SMP2P>;
+
+               qcom,local-pid = <0>;
+               qcom,remote-pid = <12>;
+
+               smp2p_nsp1_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               smp2p_nsp1_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
+       soc: soc@0 {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges = <0 0 0 0 0x10 0>;
+               dma-ranges = <0 0 0 0 0x10 0>;
+
+               gcc: clock-controller@100000 {
+                       compatible = "qcom,gcc-sc8280xp";
+                       reg = <0x0 0x00100000 0x0 0x1f0000>;
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       #power-domain-cells = <1>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>,
+                                <&sleep_clk>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <&usb_0_ssphy>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <&usb_1_ssphy>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>;
+                       power-domains = <&rpmhpd SC8280XP_CX>;
+               };
+
+               ipcc: mailbox@408000 {
+                       compatible = "qcom,sc8280xp-ipcc", "qcom,ipcc";
+                       reg = <0 0x00408000 0 0x1000>;
+                       interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       #mbox-cells = <2>;
+               };
+
+               qup2: geniqup@8c0000 {
+                       compatible = "qcom,geni-se-qup";
+                       reg = <0 0x008c0000 0 0x2000>;
+                       clocks = <&gcc GCC_QUPV3_WRAP_2_M_AHB_CLK>,
+                                <&gcc GCC_QUPV3_WRAP_2_S_AHB_CLK>;
+                       clock-names = "m-ahb", "s-ahb";
+                       iommus = <&apps_smmu 0xa3 0>;
+
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       status = "disabled";
+
+                       qup2_uart17: serial@884000 {
+                               compatible = "qcom,geni-uart";
+                               reg = <0 0x00884000 0 0x4000>;
+                               clocks = <&gcc GCC_QUPV3_WRAP2_S1_CLK>;
+                               clock-names = "se";
+                               interrupts = <GIC_SPI 583 IRQ_TYPE_LEVEL_HIGH>;
+                               operating-points-v2 = <&qup_opp_table_100mhz>;
+                               power-domains = <&rpmhpd SC8280XP_CX>;
+                               interconnects = <&clk_virt MASTER_QUP_CORE_2 0 &clk_virt SLAVE_QUP_CORE_2 0>,
+                                               <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_QUP_2 0>;
+                               interconnect-names = "qup-core", "qup-config";
+                               status = "disabled";
+                       };
+
+                       qup2_i2c5: i2c@894000 {
+                               compatible = "qcom,geni-i2c";
+                               reg = <0 0x00894000 0 0x4000>;
+                               clock-names = "se";
+                               clocks = <&gcc GCC_QUPV3_WRAP2_S5_CLK>;
+                               interrupts = <GIC_SPI 587 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               power-domains = <&rpmhpd SC8280XP_CX>;
+                               interconnects = <&clk_virt MASTER_QUP_CORE_2 0 &clk_virt SLAVE_QUP_CORE_2 0>,
+                                               <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_QUP_2 0>,
+                                               <&aggre1_noc MASTER_QUP_2 0 &mc_virt SLAVE_EBI1 0>;
+                               interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               status = "disabled";
+                       };
+               };
+
+               qup0: geniqup@9c0000 {
+                       compatible = "qcom,geni-se-qup";
+                       reg = <0 0x009c0000 0 0x6000>;
+                       clocks = <&gcc GCC_QUPV3_WRAP_0_M_AHB_CLK>,
+                                <&gcc GCC_QUPV3_WRAP_0_S_AHB_CLK>;
+                       clock-names = "m-ahb", "s-ahb";
+                       iommus = <&apps_smmu 0x563 0>;
+
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       status = "disabled";
+
+                       qup0_i2c4: i2c@990000 {
+                               compatible = "qcom,geni-i2c";
+                               reg = <0 0x00990000 0 0x4000>;
+                               clock-names = "se";
+                               clocks = <&gcc GCC_QUPV3_WRAP0_S4_CLK>;
+                               interrupts = <GIC_SPI 605 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               power-domains = <&rpmhpd SC8280XP_CX>;
+                               interconnects = <&clk_virt MASTER_QUP_CORE_0 0 &clk_virt SLAVE_QUP_CORE_0 0>,
+                                               <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_QUP_0 0>,
+                                               <&aggre1_noc MASTER_QUP_0 0 &mc_virt SLAVE_EBI1 0>;
+                               interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               status = "disabled";
+                       };
+               };
+
+               qup1: geniqup@ac0000 {
+                       compatible = "qcom,geni-se-qup";
+                       reg = <0 0x00ac0000 0 0x6000>;
+                       clocks = <&gcc GCC_QUPV3_WRAP_1_M_AHB_CLK>,
+                                <&gcc GCC_QUPV3_WRAP_1_S_AHB_CLK>;
+                       clock-names = "m-ahb", "s-ahb";
+                       iommus = <&apps_smmu 0x83 0>;
+
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       status = "disabled";
+               };
+
+               ufs_mem_hc: ufs@1d84000 {
+                       compatible = "qcom,sc8280xp-ufshc", "qcom,ufshc",
+                                    "jedec,ufs-2.0";
+                       reg = <0 0x01d84000 0 0x3000>;
+                       interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
+                       phys = <&ufs_mem_phy_lanes>;
+                       phy-names = "ufsphy";
+                       lanes-per-direction = <2>;
+                       #reset-cells = <1>;
+                       resets = <&gcc GCC_UFS_PHY_BCR>;
+                       reset-names = "rst";
+
+                       power-domains = <&gcc UFS_PHY_GDSC>;
+                       required-opps = <&rpmhpd_opp_nom>;
+
+                       iommus = <&apps_smmu 0xe0 0x0>;
+
+                       clocks = <&gcc GCC_UFS_PHY_AXI_CLK>,
+                                <&gcc GCC_AGGRE_UFS_PHY_AXI_CLK>,
+                                <&gcc GCC_UFS_PHY_AHB_CLK>,
+                                <&gcc GCC_UFS_PHY_UNIPRO_CORE_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_UFS_PHY_TX_SYMBOL_0_CLK>,
+                                <&gcc GCC_UFS_PHY_RX_SYMBOL_0_CLK>,
+                                <&gcc GCC_UFS_PHY_RX_SYMBOL_1_CLK>;
+                       clock-names = "core_clk",
+                                     "bus_aggr_clk",
+                                     "iface_clk",
+                                     "core_clk_unipro",
+                                     "ref_clk",
+                                     "tx_lane0_sync_clk",
+                                     "rx_lane0_sync_clk",
+                                     "rx_lane1_sync_clk";
+                       freq-table-hz = <75000000 300000000>,
+                                       <0 0>,
+                                       <0 0>,
+                                       <75000000 300000000>,
+                                       <0 0>,
+                                       <0 0>,
+                                       <0 0>,
+                                       <0 0>;
+                       status = "disabled";
+               };
+
+               ufs_mem_phy: phy@1d87000 {
+                       compatible = "qcom,sc8280xp-qmp-ufs-phy";
+                       reg = <0 0x01d87000 0 0xe10>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+                       clock-names = "ref",
+                                     "ref_aux";
+                       clocks = <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_UFS_PHY_PHY_AUX_CLK>;
+
+                       resets = <&ufs_mem_hc 0>;
+                       reset-names = "ufsphy";
+                       status = "disabled";
+
+                       ufs_mem_phy_lanes: phy@1d87400 {
+                               reg = <0 0x01d87400 0 0x108>,
+                                     <0 0x01d87600 0 0x1e0>,
+                                     <0 0x01d87c00 0 0x1dc>,
+                                     <0 0x01d87800 0 0x108>,
+                                     <0 0x01d87a00 0 0x1e0>;
+                               #phy-cells = <0>;
+                       };
+               };
+
+               ufs_card_hc: ufs@1da4000 {
+                       compatible = "qcom,sc8280xp-ufshc", "qcom,ufshc",
+                                    "jedec,ufs-2.0";
+                       reg = <0 0x01da4000 0 0x3000>;
+                       interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
+                       phys = <&ufs_card_phy_lanes>;
+                       phy-names = "ufsphy";
+                       lanes-per-direction = <2>;
+                       #reset-cells = <1>;
+                       resets = <&gcc GCC_UFS_CARD_BCR>;
+                       reset-names = "rst";
+
+                       power-domains = <&gcc UFS_CARD_GDSC>;
+
+                       iommus = <&apps_smmu 0x4a0 0x0>;
+
+                       clocks = <&gcc GCC_UFS_CARD_AXI_CLK>,
+                                <&gcc GCC_AGGRE_UFS_CARD_AXI_CLK>,
+                                <&gcc GCC_UFS_CARD_AHB_CLK>,
+                                <&gcc GCC_UFS_CARD_UNIPRO_CORE_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_UFS_CARD_TX_SYMBOL_0_CLK>,
+                                <&gcc GCC_UFS_CARD_RX_SYMBOL_0_CLK>,
+                                <&gcc GCC_UFS_CARD_RX_SYMBOL_1_CLK>;
+                       clock-names = "core_clk",
+                                     "bus_aggr_clk",
+                                     "iface_clk",
+                                     "core_clk_unipro",
+                                     "ref_clk",
+                                     "tx_lane0_sync_clk",
+                                     "rx_lane0_sync_clk",
+                                     "rx_lane1_sync_clk";
+                       freq-table-hz = <75000000 300000000>,
+                                       <0 0>,
+                                       <0 0>,
+                                       <75000000 300000000>,
+                                       <0 0>,
+                                       <0 0>,
+                                       <0 0>,
+                                       <0 0>;
+                       status = "disabled";
+               };
+
+               ufs_card_phy: phy@1da7000 {
+                       compatible = "qcom,sc8280xp-qmp-ufs-phy";
+                       reg = <0 0x01da7000 0 0xe10>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+                       clock-names = "ref",
+                                     "ref_aux";
+                       clocks = <&gcc GCC_UFS_1_CARD_CLKREF_CLK>,
+                                <&gcc GCC_UFS_CARD_PHY_AUX_CLK>;
+
+                       resets = <&ufs_card_hc 0>;
+                       reset-names = "ufsphy";
+
+                       status = "disabled";
+
+                       ufs_card_phy_lanes: phy@1da7400 {
+                               reg = <0 0x01da7400 0 0x108>,
+                                     <0 0x01da7600 0 0x1e0>,
+                                     <0 0x01da7c00 0 0x1dc>,
+                                     <0 0x01da7800 0 0x108>,
+                                     <0 0x01da7a00 0 0x1e0>;
+                               #phy-cells = <0>;
+                       };
+               };
+
+               tcsr_mutex: hwlock@1f40000 {
+                       compatible = "qcom,tcsr-mutex";
+                       reg = <0x0 0x01f40000 0x0 0x20000>;
+                       #hwlock-cells = <1>;
+               };
+
+               usb_0_hsphy: phy@88e5000 {
+                       compatible = "qcom,sc8280xp-usb-hs-phy",
+                                    "qcom,usb-snps-hs-5nm-phy";
+                       reg = <0 0x088e5000 0 0x400>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "ref";
+                       resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>;
+
+                       #phy-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               usb_2_hsphy0: phy@88e7000 {
+                       compatible = "qcom,sc8280xp-usb-hs-phy",
+                                    "qcom,usb-snps-hs-5nm-phy";
+                       reg = <0 0x088e7000 0 0x400>;
+                       clocks = <&gcc GCC_USB2_HS0_CLKREF_CLK>;
+                       clock-names = "ref";
+                       resets = <&gcc GCC_QUSB2PHY_HS0_MP_BCR>;
+
+                       #phy-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               usb_2_hsphy1: phy@88e8000 {
+                       compatible = "qcom,sc8280xp-usb-hs-phy",
+                                    "qcom,usb-snps-hs-5nm-phy";
+                       reg = <0 0x088e8000 0 0x400>;
+                       clocks = <&gcc GCC_USB2_HS1_CLKREF_CLK>;
+                       clock-names = "ref";
+                       resets = <&gcc GCC_QUSB2PHY_HS1_MP_BCR>;
+
+                       #phy-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               usb_2_hsphy2: phy@88e9000 {
+                       compatible = "qcom,sc8280xp-usb-hs-phy",
+                                    "qcom,usb-snps-hs-5nm-phy";
+                       reg = <0 0x088e9000 0 0x400>;
+                       clocks = <&gcc GCC_USB2_HS2_CLKREF_CLK>;
+                       clock-names = "ref";
+                       resets = <&gcc GCC_QUSB2PHY_HS2_MP_BCR>;
+
+                       #phy-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               usb_2_hsphy3: phy@88ea000 {
+                       compatible = "qcom,sc8280xp-usb-hs-phy",
+                                    "qcom,usb-snps-hs-5nm-phy";
+                       reg = <0 0x088ea000 0 0x400>;
+                       clocks = <&gcc GCC_USB2_HS3_CLKREF_CLK>;
+                       clock-names = "ref";
+                       resets = <&gcc GCC_QUSB2PHY_HS3_MP_BCR>;
+
+                       #phy-cells = <0>;
+
+                       status = "disabled";
+               };
+
+               usb_2_qmpphy0: phy-wrapper@88ef000 {
+                       compatible = "qcom,sc8280xp-qmp-usb3-uni-phy";
+                       reg = <0 0x088ef000 0 0x1c8>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB3_MP_PHY_AUX_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_USB3_MP0_CLKREF_CLK>,
+                                <&gcc GCC_USB3_MP_PHY_COM_AUX_CLK>;
+                       clock-names = "aux", "ref_clk_src", "ref", "com_aux";
+
+                       resets = <&gcc GCC_USB3_UNIPHY_MP0_BCR>,
+                                <&gcc GCC_USB3UNIPHY_PHY_MP0_BCR>;
+                       reset-names = "phy", "common";
+
+                       power-domains = <&gcc USB30_MP_GDSC>;
+
+                       status = "disabled";
+
+                       usb_2_ssphy0: phy@88efe00 {
+                               reg = <0 0x088efe00 0 0x160>,
+                                     <0 0x088f0000 0 0x1ec>,
+                                     <0 0x088ef200 0 0x1f0>;
+                               #phy-cells = <0>;
+                               #clock-cells = <0>;
+                               clocks = <&gcc GCC_USB3_MP_PHY_PIPE_0_CLK>;
+                               clock-names = "pipe0";
+                               clock-output-names = "usb2_phy0_pipe_clk";
+                       };
+               };
+
+               usb_2_qmpphy1: phy-wrapper@88f1000 {
+                       compatible = "qcom,sc8280xp-qmp-usb3-uni-phy";
+                       reg = <0 0x088f1000 0 0x1c8>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB3_MP_PHY_AUX_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_USB3_MP1_CLKREF_CLK>,
+                                <&gcc GCC_USB3_MP_PHY_COM_AUX_CLK>;
+                       clock-names = "aux", "ref_clk_src", "ref", "com_aux";
+
+                       resets = <&gcc GCC_USB3_UNIPHY_MP1_BCR>,
+                                <&gcc GCC_USB3UNIPHY_PHY_MP1_BCR>;
+                       reset-names = "phy", "common";
+
+                       power-domains = <&gcc USB30_MP_GDSC>;
+
+                       status = "disabled";
+
+                       usb_2_ssphy1: phy@88f1e00 {
+                               reg = <0 0x088f1e00 0 0x160>,
+                                     <0 0x088f2000 0 0x1ec>,
+                                     <0 0x088f1200 0 0x1f0>;
+                               #phy-cells = <0>;
+                               #clock-cells = <0>;
+                               clocks = <&gcc GCC_USB3_MP_PHY_PIPE_1_CLK>;
+                               clock-names = "pipe0";
+                               clock-output-names = "usb2_phy1_pipe_clk";
+                       };
+               };
+
+               remoteproc_adsp: remoteproc@3000000 {
+                       compatible = "qcom,sc8280xp-adsp-pas";
+                       reg = <0 0x03000000 0 0x100>;
+
+                       interrupts-extended = <&intc GIC_SPI 162 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>,
+                                             <&smp2p_adsp_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 SC8280XP_LCX>,
+                                       <&rpmhpd SC8280XP_LMX>;
+                       power-domain-names = "lcx", "lmx";
+
+                       memory-region = <&pil_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>;
+                       };
+               };
+
+               usb_0_qmpphy: phy-wrapper@88ec000 {
+                       compatible = "qcom,sc8280xp-qmp-usb43dp-phy";
+                       reg = <0 0x088ec000 0 0x1e4>,
+                             <0 0x088eb000 0 0x40>,
+                             <0 0x088ed000 0 0x1c8>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB3_PRIM_PHY_AUX_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_USB4_EUD_CLKREF_CLK>,
+                                <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>;
+                       clock-names = "aux", "ref_clk_src", "ref", "com_aux";
+
+                       resets = <&gcc GCC_USB3_PHY_PRIM_BCR>,
+                                <&gcc GCC_USB3_DP_PHY_PRIM_BCR>;
+                       reset-names = "phy", "common";
+
+                       power-domains = <&gcc USB30_PRIM_GDSC>;
+
+                       status = "disabled";
+
+                       usb_0_ssphy: usb3-phy@88eb400 {
+                               reg = <0 0x088eb400 0 0x100>,
+                                     <0 0x088eb600 0 0x3ec>,
+                                     <0 0x088ec400 0 0x1f0>,
+                                     <0 0x088eba00 0 0x100>,
+                                     <0 0x088ebc00 0 0x3ec>,
+                                     <0 0x088ec700 0 0x64>;
+                               #phy-cells = <0>;
+                               #clock-cells = <0>;
+                               clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
+                               clock-names = "pipe0";
+                               clock-output-names = "usb0_phy_pipe_clk_src";
+                       };
+
+                       usb_0_dpphy: dp-phy@88ed200 {
+                               reg = <0 0x088ed200 0 0x200>,
+                                     <0 0x088ed400 0 0x200>,
+                                     <0 0x088eda00 0 0x200>,
+                                     <0 0x088ea600 0 0x200>,
+                                     <0 0x088ea800 0 0x200>;
+                               #clock-cells = <1>;
+                               #phy-cells = <0>;
+                       };
+               };
+
+               usb_1_hsphy: phy@8902000 {
+                       compatible = "qcom,sc8280xp-usb-hs-phy",
+                                    "qcom,usb-snps-hs-5nm-phy";
+                       reg = <0 0x08902000 0 0x400>;
+                       #phy-cells = <0>;
+
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "ref";
+
+                       resets = <&gcc GCC_QUSB2PHY_SEC_BCR>;
+
+                       status = "disabled";
+               };
+
+               usb_1_qmpphy: phy-wrapper@8904000 {
+                       compatible = "qcom,sc8280xp-qmp-usb43dp-phy";
+                       reg = <0 0x08904000 0 0x1e4>,
+                             <0 0x08903000 0 0x40>,
+                             <0 0x08905000 0 0x1c8>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB3_SEC_PHY_AUX_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&gcc GCC_USB4_CLKREF_CLK>,
+                                <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>;
+                       clock-names = "aux", "ref_clk_src", "ref", "com_aux";
+
+                       resets = <&gcc GCC_USB3_PHY_SEC_BCR>,
+                                <&gcc GCC_USB4_1_DP_PHY_PRIM_BCR>;
+                       reset-names = "phy", "common";
+
+                       power-domains = <&gcc USB30_SEC_GDSC>;
+
+                       status = "disabled";
+
+                       usb_1_ssphy: usb3-phy@8903400 {
+                               reg = <0 0x08903400 0 0x100>,
+                                     <0 0x08903c00 0 0x3ec>,
+                                     <0 0x08904400 0 0x1f0>,
+                                     <0 0x08903a00 0 0x100>,
+                                     <0 0x08903c00 0 0x3ec>,
+                                     <0 0x08904200 0 0x18>;
+                               #phy-cells = <0>;
+                               #clock-cells = <0>;
+                               clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
+                               clock-names = "pipe0";
+                               clock-output-names = "usb1_phy_pipe_clk_src";
+                       };
+
+                       usb_1_dpphy: dp-phy@8904200 {
+                               reg = <0 0x08904200 0 0x200>,
+                                     <0 0x08904400 0 0x200>,
+                                     <0 0x08904a00 0 0x200>,
+                                     <0 0x08904600 0 0x200>,
+                                     <0 0x08904800 0 0x200>;
+                               #clock-cells = <1>;
+                               #phy-cells = <0>;
+                       };
+               };
+
+               system-cache-controller@9200000 {
+                       compatible = "qcom,sc8280xp-llcc";
+                       reg = <0 0x09200000 0 0x58000>, <0 0x09600000 0 0x58000>;
+                       reg-names = "llcc_base", "llcc_broadcast_base";
+                       interrupts = <GIC_SPI 582 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               usb_0: usb@a6f8800 {
+                       compatible = "qcom,sc8280xp-dwc3", "qcom,dwc3";
+                       reg = <0 0x0a6f8800 0 0x400>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB30_PRIM_MASTER_CLK>,
+                                <&gcc GCC_CFG_NOC_USB3_PRIM_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB3_PRIM_AXI_CLK>,
+                                <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>,
+                                <&gcc GCC_USB30_PRIM_SLEEP_CLK>,
+                                <&gcc GCC_AGGRE_USB_NOC_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB_NOC_NORTH_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB_NOC_SOUTH_AXI_CLK>,
+                                <&gcc GCC_SYS_NOC_USB_AXI_CLK>;
+                       clock-names = "core", "iface", "bus_aggr", "utmi", "sleep",
+                                     "noc_aggr", "noc_aggr_north", "noc_aggr_south", "noc_sys";
+
+                       assigned-clocks = <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>,
+                                         <&gcc GCC_USB30_PRIM_MASTER_CLK>;
+                       assigned-clock-rates = <19200000>, <200000000>;
+
+                       interrupts-extended = <&intc GIC_SPI 804 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 138 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
+                                         "dm_hs_phy_irq", "ss_phy_irq";
+
+                       power-domains = <&gcc USB30_PRIM_GDSC>;
+
+                       resets = <&gcc GCC_USB30_PRIM_BCR>;
+
+                       interconnects = <&aggre1_noc MASTER_USB3_0 0 &mc_virt SLAVE_EBI1 0>,
+                                       <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_0 0>;
+                       interconnect-names = "usb-ddr", "apps-usb";
+
+                       status = "disabled";
+
+                       usb_0_dwc3: usb@a600000 {
+                               compatible = "snps,dwc3";
+                               reg = <0 0x0a600000 0 0xcd00>;
+                               interrupts = <GIC_SPI 803 IRQ_TYPE_LEVEL_HIGH>;
+                               iommus = <&apps_smmu 0x820 0x0>;
+                               phys = <&usb_0_hsphy>, <&usb_0_ssphy>;
+                               phy-names = "usb2-phy", "usb3-phy";
+                       };
+               };
+
+               usb_1: usb@a8f8800 {
+                       compatible = "qcom,sc8280xp-dwc3", "qcom,dwc3";
+                       reg = <0 0x0a8f8800 0 0x400>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB30_SEC_MASTER_CLK>,
+                                <&gcc GCC_CFG_NOC_USB3_SEC_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB3_SEC_AXI_CLK>,
+                                <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>,
+                                <&gcc GCC_USB30_SEC_SLEEP_CLK>,
+                                <&gcc GCC_AGGRE_USB_NOC_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB_NOC_NORTH_AXI_CLK>,
+                                <&gcc GCC_AGGRE_USB_NOC_SOUTH_AXI_CLK>,
+                                <&gcc GCC_SYS_NOC_USB_AXI_CLK>;
+                       clock-names = "core", "iface", "bus_aggr", "utmi", "sleep",
+                                     "noc_aggr", "noc_aggr_north", "noc_aggr_south", "noc_sys";
+
+                       assigned-clocks = <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>,
+                                         <&gcc GCC_USB30_SEC_MASTER_CLK>;
+                       assigned-clock-rates = <19200000>, <200000000>;
+
+                       interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 13 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 16 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
+                                         "dm_hs_phy_irq", "ss_phy_irq";
+
+                       power-domains = <&gcc USB30_SEC_GDSC>;
+
+                       resets = <&gcc GCC_USB30_SEC_BCR>;
+
+                       interconnects = <&aggre1_noc MASTER_USB3_1 0 &mc_virt SLAVE_EBI1 0>,
+                                       <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_USB3_1 0>;
+                       interconnect-names = "usb-ddr", "apps-usb";
+
+                       status = "disabled";
+
+                       usb_1_dwc3: usb@a800000 {
+                               compatible = "snps,dwc3";
+                               reg = <0 0x0a800000 0 0xcd00>;
+                               interrupts = <GIC_SPI 810 IRQ_TYPE_LEVEL_HIGH>;
+                               iommus = <&apps_smmu 0x860 0x0>;
+                               phys = <&usb_1_hsphy>, <&usb_1_ssphy>;
+                               phy-names = "usb2-phy", "usb3-phy";
+                       };
+               };
+
+               pdc: interrupt-controller@b220000 {
+                       compatible = "qcom,sc8280xp-pdc", "qcom,pdc";
+                       reg = <0 0x0b220000 0 0x30000>, <0 0x17c000f0 0 0x60>;
+                       qcom,pdc-ranges = <0 480 40>,
+                                         <40 140 14>,
+                                         <54 263 1>,
+                                         <55 306 4>,
+                                         <59 312 3>,
+                                         <62 374 2>,
+                                         <64 434 2>,
+                                         <66 438 3>,
+                                         <69 86 1>,
+                                         <70 520 54>,
+                                         <124 609 28>,
+                                         <159 638 1>,
+                                         <160 720 8>,
+                                         <168 801 1>,
+                                         <169 728 30>,
+                                         <199 416 2>,
+                                         <201 449 1>,
+                                         <202 89 1>,
+                                         <203 451 1>,
+                                         <204 462 1>,
+                                         <205 264 1>,
+                                         <206 579 1>,
+                                         <207 653 1>,
+                                         <208 656 1>,
+                                         <209 659 1>,
+                                         <210 122 1>,
+                                         <211 699 1>,
+                                         <212 705 1>,
+                                         <213 450 1>,
+                                         <214 643 1>,
+                                         <216 646 5>,
+                                         <221 390 5>,
+                                         <226 700 3>,
+                                         <229 240 3>,
+                                         <232 269 1>,
+                                         <233 377 1>,
+                                         <234 372 1>,
+                                         <235 138 1>,
+                                         <236 857 1>,
+                                         <237 860 1>,
+                                         <238 137 1>,
+                                         <239 668 1>,
+                                         <240 366 1>,
+                                         <241 949 1>,
+                                         <242 815 5>,
+                                         <247 769 1>,
+                                         <248 768 1>,
+                                         <249 663 1>,
+                                         <250 799 2>,
+                                         <252 798 1>,
+                                         <253 765 1>,
+                                         <254 763 1>,
+                                         <255 454 1>,
+                                         <258 139 1>,
+                                         <259 786 2>,
+                                         <261 370 2>,
+                                         <263 158 2>;
+                       #interrupt-cells = <2>;
+                       interrupt-parent = <&intc>;
+                       interrupt-controller;
+               };
+
+               tsens0: thermal-sensor@c263000 {
+                       compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
+                       reg = <0 0x0c263000 0 0x1ff>, /* TM */
+                             <0 0x0c222000 0 0x8>; /* SROT */
+                       #qcom,sensors = <14>;
+                       interrupts-extended = <&pdc 26 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 28 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow", "critical";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               tsens1: thermal-sensor@c265000 {
+                       compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
+                       reg = <0 0x0c265000 0 0x1ff>, /* TM */
+                             <0 0x0c223000 0 0x8>; /* SROT */
+                       #qcom,sensors = <16>;
+                       interrupts-extended = <&pdc 27 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 29 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "uplow", "critical";
+                       #thermal-sensor-cells = <1>;
+               };
+
+               aoss_qmp: power-controller@c300000 {
+                       compatible = "qcom,sc8280xp-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>;
+               };
+
+               spmi_bus: spmi@c440000 {
+                       compatible = "qcom,spmi-pmic-arb";
+                       reg = <0 0x0c440000 0 0x1100>,
+                             <0 0x0c600000 0 0x2000000>,
+                             <0 0x0e600000 0 0x100000>,
+                             <0 0x0e700000 0 0xa0000>,
+                             <0 0x0c40a000 0 0x26000>;
+                       reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
+                       interrupt-names = "periph_irq";
+                       interrupts-extended = <&pdc 1 IRQ_TYPE_LEVEL_HIGH>;
+                       qcom,ee = <0>;
+                       qcom,channel = <0>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupt-controller;
+                       #interrupt-cells = <4>;
+               };
+
+               tlmm: pinctrl@f100000 {
+                       compatible = "qcom,sc8280xp-tlmm";
+                       reg = <0 0x0f100000 0 0x300000>;
+                       interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       gpio-ranges = <&tlmm 0 0 230>;
+               };
+
+               apps_smmu: iommu@15000000 {
+                       compatible = "qcom,sc8280xp-smmu-500", "arm,mmu-500";
+                       reg = <0 0x15000000 0 0x100000>;
+                       #iommu-cells = <2>;
+                       #global-interrupts = <2>;
+                       interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 65 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>,
+                                    <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 396 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 397 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 398 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 399 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 401 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 402 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 403 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 404 IRQ_TYPE_LEVEL_HIGH>,
+                                    <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>,
+                                    <GIC_SPI 409 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 418 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 412 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 706 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 689 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 690 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 691 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 692 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 693 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 694 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 695 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 410 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 411 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 413 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 707 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 708 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 709 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 710 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 711 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 414 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 712 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 713 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 714 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 715 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 912 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 911 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 910 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 909 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 908 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 907 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 906 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 905 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 904 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 903 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 902 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 901 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 900 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 899 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 898 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 897 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 896 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 895 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 894 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 893 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 892 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 891 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 890 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               intc: interrupt-controller@17a00000 {
+                       compatible = "arm,gic-v3";
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       reg = <0x0 0x17a00000 0x0 0x10000>,     /* GICD */
+                             <0x0 0x17a60000 0x0 0x100000>;    /* GICR * 8 */
+                       interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                       #redistributor-regions = <1>;
+                       redistributor-stride = <0 0x20000>;
+
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       gic-its@17a40000 {
+                               compatible = "arm,gic-v3-its";
+                               reg = <0 0x17a40000 0 0x20000>;
+                               msi-controller;
+                               #msi-cells = <1>;
+                       };
+               };
+
+               watchdog@17c10000 {
+                       compatible = "qcom,apss-wdt-sc8280xp", "qcom,kpss-wdt";
+                       reg = <0 0x17c10000 0 0x1000>;
+                       clocks = <&sleep_clk>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               timer@17c20000 {
+                       compatible = "arm,armv7-timer-mem";
+                       reg = <0x0 0x17c20000 0x0 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       frame@17c21000 {
+                               frame-number = <0>;
+                               interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
+                       };
+
+                       frame@17c23000 {
+                               frame-number = <1>;
+                               interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c23000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@17c25000 {
+                               frame-number = <2>;
+                               interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c25000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@17c27000 {
+                               frame-number = <3>;
+                               interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c26000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@17c29000 {
+                               frame-number = <4>;
+                               interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c29000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@17c2b000 {
+                               frame-number = <5>;
+                               interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c2b000 0x1000>;
+                               status = "disabled";
+                       };
+
+                       frame@17c2d000 {
+                               frame-number = <6>;
+                               interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x17c2d000 0x1000>;
+                               status = "disabled";
+                       };
+               };
+
+               apps_rsc: rsc@18200000 {
+                       compatible = "qcom,rpmh-rsc";
+                       reg = <0x0 0x18200000 0x0 0x10000>,
+                               <0x0 0x18210000 0x0 0x10000>,
+                               <0x0 0x18220000 0x0 0x10000>;
+                       reg-names = "drv-0", "drv-1", "drv-2";
+                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+                       qcom,tcs-offset = <0xd00>;
+                       qcom,drv-id = <2>;
+                       qcom,tcs-config = <ACTIVE_TCS  2>, <SLEEP_TCS   3>,
+                                         <WAKE_TCS    3>, <CONTROL_TCS 1>;
+                       label = "apps_rsc";
+
+                       apps_bcm_voter: bcm-voter {
+                               compatible = "qcom,bcm-voter";
+                       };
+
+                       rpmhcc: clock-controller {
+                               compatible = "qcom,sc8280xp-rpmh-clk";
+                               #clock-cells = <1>;
+                               clock-names = "xo";
+                               clocks = <&xo_board_clk>;
+                       };
+
+                       rpmhpd: power-controller {
+                               compatible = "qcom,sc8280xp-rpmhpd";
+                               #power-domain-cells = <1>;
+                               operating-points-v2 = <&rpmhpd_opp_table>;
+
+                               rpmhpd_opp_table: opp-table {
+                                       compatible = "operating-points-v2";
+
+                                       rpmhpd_opp_ret: opp1 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_RETENTION>;
+                                       };
+
+                                       rpmhpd_opp_min_svs: opp2 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
+                                       };
+
+                                       rpmhpd_opp_low_svs: opp3 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+                                       };
+
+                                       rpmhpd_opp_svs: opp4 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+                                       };
+
+                                       rpmhpd_opp_svs_l1: opp5 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+                                       };
+
+                                       rpmhpd_opp_nom: opp6 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
+                                       };
+
+                                       rpmhpd_opp_nom_l1: opp7 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
+                                       };
+
+                                       rpmhpd_opp_nom_l2: opp8 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_NOM_L2>;
+                                       };
+
+                                       rpmhpd_opp_turbo: opp9 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
+                                       };
+
+                                       rpmhpd_opp_turbo_l1: opp10 {
+                                               opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
+                                       };
+                               };
+                       };
+               };
+
+               cpufreq_hw: cpufreq@18591000 {
+                       compatible = "qcom,sc8280xp-cpufreq-epss", "qcom,cpufreq-epss";
+                       reg = <0 0x18591000 0 0x1000>,
+                             <0 0x18592000 0 0x1000>;
+                       reg-names = "freq-domain0", "freq-domain1";
+
+                       clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>;
+                       clock-names = "xo", "alternate";
+
+                       #freq-domain-cells = <1>;
+               };
+
+               remoteproc_nsp0: remoteproc@1b300000 {
+                       compatible = "qcom,sc8280xp-nsp0-pas";
+                       reg = <0 0x1b300000 0 0x100>;
+
+                       interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&smp2p_nsp0_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_nsp0_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_nsp0_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_nsp0_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 SC8280XP_NSP>;
+                       power-domain-names = "nsp";
+
+                       memory-region = <&pil_nsp0_mem>;
+
+                       qcom,smem-states = <&smp2p_nsp0_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       interconnects = <&nspa_noc MASTER_CDSP_PROC 0 &mc_virt SLAVE_EBI1 0>;
+
+                       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 = "nsp0";
+                               qcom,remote-pid = <5>;
+
+                               fastrpc {
+                                       compatible = "qcom,fastrpc";
+                                       qcom,glink-channels = "fastrpcglink-apps-dsp";
+                                       label = "cdsp";
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       compute-cb@1 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <1>;
+                                               iommus = <&apps_smmu 0x3181 0x0420>;
+                                       };
+
+                                       compute-cb@2 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <2>;
+                                               iommus = <&apps_smmu 0x3182 0x0420>;
+                                       };
+
+                                       compute-cb@3 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <3>;
+                                               iommus = <&apps_smmu 0x3183 0x0420>;
+                                       };
+
+                                       compute-cb@4 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <4>;
+                                               iommus = <&apps_smmu 0x3184 0x0420>;
+                                       };
+
+                                       compute-cb@5 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <5>;
+                                               iommus = <&apps_smmu 0x3185 0x0420>;
+                                       };
+
+                                       compute-cb@6 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <6>;
+                                               iommus = <&apps_smmu 0x3186 0x0420>;
+                                       };
+
+                                       compute-cb@7 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <7>;
+                                               iommus = <&apps_smmu 0x3187 0x0420>;
+                                       };
+
+                                       compute-cb@8 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <8>;
+                                               iommus = <&apps_smmu 0x3188 0x0420>;
+                                       };
+
+                                       compute-cb@9 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <9>;
+                                               iommus = <&apps_smmu 0x318b 0x0420>;
+                                       };
+
+                                       compute-cb@10 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <10>;
+                                               iommus = <&apps_smmu 0x318b 0x0420>;
+                                       };
+
+                                       compute-cb@11 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <11>;
+                                               iommus = <&apps_smmu 0x318c 0x0420>;
+                                       };
+
+                                       compute-cb@12 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <12>;
+                                               iommus = <&apps_smmu 0x318d 0x0420>;
+                                       };
+
+                                       compute-cb@13 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <13>;
+                                               iommus = <&apps_smmu 0x318e 0x0420>;
+                                       };
+
+                                       compute-cb@14 {
+                                               compatible = "qcom,fastrpc-compute-cb";
+                                               reg = <14>;
+                                               iommus = <&apps_smmu 0x318f 0x0420>;
+                                       };
+                               };
+                       };
+               };
+
+               remoteproc_nsp1: remoteproc@21300000 {
+                       compatible = "qcom,sc8280xp-nsp1-pas";
+                       reg = <0 0x21300000 0 0x100>;
+
+                       interrupts-extended = <&intc GIC_SPI 887 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&smp2p_nsp1_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_nsp1_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_nsp1_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&smp2p_nsp1_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 SC8280XP_NSP>;
+                       power-domain-names = "nsp";
+
+                       memory-region = <&pil_nsp1_mem>;
+
+                       qcom,smem-states = <&smp2p_nsp1_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       interconnects = <&nspb_noc MASTER_CDSP_PROC_B 0 &mc_virt SLAVE_EBI1 0>;
+
+                       status = "disabled";
+
+                       glink-edge {
+                               interrupts-extended = <&ipcc IPCC_CLIENT_NSP1
+                                                            IPCC_MPROC_SIGNAL_GLINK_QMP
+                                                            IRQ_TYPE_EDGE_RISING>;
+                               mboxes = <&ipcc IPCC_CLIENT_NSP1
+                                               IPCC_MPROC_SIGNAL_GLINK_QMP>;
+
+                               label = "nsp1";
+                               qcom,remote-pid = <12>;
+                       };
+               };
+       };
+
+       thermal-zones {
+               cpu0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 1>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu1-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 2>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu2-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 3>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu3-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 4>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu4-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 5>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu5-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 6>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu6-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 7>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cpu7-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 8>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               cluster0-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens0 9>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <110000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               mem-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+
+                       thermal-sensors = <&tsens1 15>;
+
+                       trips {
+                               trip-point0 {
+                                       temperature = <90000>;
+                                       hysteresis = <2000>;
+                                       type = "hot";
+                               };
+                       };
+               };
+       };
+
+       timer {
+               compatible = "arm,armv8-timer";
+               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)>;
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts b/arch/arm64/boot/dts/qcom/sda660-inforce-ifc6560.dts
new file mode 100644 (file)
index 0000000..28050bc
--- /dev/null
@@ -0,0 +1,461 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2021, Linaro Ltd.
+ * Copyright (c) 2020, Konrad Dybcio <konrad.dybcio@somainline.org>
+ * Copyright (c) 2020, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "sdm660.dtsi"
+#include "pm660.dtsi"
+#include "pm660l.dtsi"
+
+/ {
+       model = "Inforce 6560 Single Board Computer";
+       compatible = "inforce,ifc6560", "qcom,sda660";
+       chassis-type = "embedded"; /* SBC */
+
+       aliases {
+               serial0 = &blsp1_uart2;
+               serial1 = &blsp2_uart1;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               volup {
+                       label = "Volume Up";
+                       gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       debounce-interval = <15>;
+               };
+       };
+
+       /*
+        * Until we hook up type-c detection, we
+        * have to stick with this. But it works.
+        */
+       extcon_usb: extcon-usb {
+               compatible = "linux,extcon-usb-gpio";
+               id-gpio = <&tlmm 58 GPIO_ACTIVE_HIGH>;
+       };
+
+       hdmi-out {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con: endpoint {
+                               remote-endpoint = <&adv7533_out>;
+                       };
+               };
+       };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-min-microvolt = <3800000>;
+               regulator-max-microvolt = <3800000>;
+
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       v3p3_bck_bst: v3p3-bck-bst-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "v3p3_bck_bst";
+
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               vin-supply = <&vph_pwr>;
+       };
+
+       v1p2_ldo: v1p2-ldo-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "v1p2_ldo";
+
+               regulator-min-microvolt = <1200000>;
+               regulator-max-microvolt = <1200000>;
+
+               vin-supply = <&vph_pwr>;
+       };
+
+       v5p0_boost: v5p0-boost-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "v5p0_boost";
+
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+
+               vin-supply = <&vph_pwr>;
+       };
+};
+
+&adsp_pil {
+       firmware-name = "qcom/ifc6560/adsp.mbn";
+};
+
+&blsp_i2c6 {
+       status = "okay";
+
+       adv7533: hdmi@39 {
+               compatible = "adi,adv7535";
+               reg = <0x39>, <0x66>;
+               reg-names = "main", "edid";
+
+               interrupt-parent = <&pm660l_gpios>;
+               interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
+
+               clocks = <&rpmcc RPM_SMD_BB_CLK2>;
+               clock-names = "cec";
+               /*
+                * Limit to 3 lanes to prevent the bridge from changing amount
+                * of lanes in the fly. MSM DSI host doesn't like that.
+                */
+               adi,dsi-lanes = <3>;
+               avdd-supply = <&vreg_l13a_1p8>;
+               dvdd-supply = <&vreg_l13a_1p8>;
+               pvdd-supply = <&vreg_l13a_1p8>;
+               a2vdd-supply = <&vreg_l13a_1p8>;
+               v3p3-supply = <&v3p3_bck_bst>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               adv7533_in: endpoint {
+                                       remote-endpoint = <&dsi0_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               adv7533_out: endpoint {
+                                       remote-endpoint = <&hdmi_con>;
+                               };
+                       };
+               };
+       };
+};
+
+&blsp1_dma {
+       /*
+        * The board will lock up if we toggle the BLSP clock, unless the
+        * BAM DMA interconnects support is in place.
+        */
+       /delete-property/ clocks;
+};
+
+&blsp1_uart2 {
+       status = "okay";
+};
+
+&blsp2_dma {
+       /*
+        * The board will lock up if we toggle the BLSP clock, unless the
+        * BAM DMA interconnects support is in place.
+        */
+       /delete-property/ clocks;
+};
+
+&blsp2_uart1 {
+       status = "okay";
+
+       bluetooth {
+               compatible = "qcom,wcn3990-bt";
+
+               vddio-supply = <&vreg_l13a_1p8>;
+               vddxo-supply = <&vreg_l9a_1p8>;
+               vddrf-supply = <&vreg_l6a_1p3>;
+               vddch0-supply = <&vreg_l19a_3p3>;
+               max-speed = <3200000>;
+       };
+};
+
+&dsi0 {
+       status = "okay";
+       vdda-supply = <&vreg_l1a_1p225>;
+};
+
+&dsi0_out {
+       remote-endpoint = <&adv7533_in>;
+       data-lanes = <0 1 2 3>;
+};
+
+&dsi0_phy {
+       status = "okay";
+       vcca-supply = <&vreg_l1b_0p925>;
+};
+
+&mdss {
+       status = "okay";
+};
+
+&mmss_smmu {
+       status = "okay";
+};
+
+&pon_pwrkey {
+       status = "okay";
+};
+
+&pon_resin {
+       status = "okay";
+
+       linux,code = <KEY_VOLUMEUP>;
+};
+
+&qusb2phy0 {
+       status = "okay";
+
+       vdd-supply = <&vreg_l1b_0p925>;
+       vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
+};
+
+&qusb2phy1 {
+       status = "okay";
+
+       vdd-supply = <&vreg_l1b_0p925>;
+       vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
+};
+
+&rpm_requests {
+       pm660-regulators {
+               compatible = "qcom,rpm-pm660-regulators";
+
+               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_l1_l6_l7-supply = <&vreg_s5a_1p35>;
+               vdd_l2_l3-supply = <&vreg_s2b_1p05>;
+               vdd_l5-supply = <&vreg_s2b_1p05>;
+               vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
+               vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
+
+               vreg_s4a_2p04: s4 {
+                       regulator-min-microvolt = <1805000>;
+                       regulator-max-microvolt = <2040000>;
+                       regulator-enable-ramp-delay = <200>;
+                       regulator-ramp-delay = <0>;
+                       regulator-always-on;
+               };
+
+               vreg_s5a_1p35: s5 {
+                       regulator-min-microvolt = <1224000>;
+                       regulator-max-microvolt = <1350000>;
+                       regulator-enable-ramp-delay = <200>;
+                       regulator-ramp-delay = <0>;
+               };
+
+               vreg_l1a_1p225: l1 {
+                       regulator-min-microvolt = <1150000>;
+                       regulator-max-microvolt = <1250000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l6a_1p3: l6 {
+                       regulator-min-microvolt = <1304000>;
+                       regulator-max-microvolt = <1368000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l8a_1p8: l8 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+                       regulator-system-load = <325000>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l9a_1p8: l9 {
+                       regulator-min-microvolt = <1804000>;
+                       regulator-max-microvolt = <1896000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l13a_1p8: l13 {
+                       /* This gives power to the LPDDR4: never turn it off! */
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1944000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+                       regulator-always-on;
+                       regulator-boot-on;
+               };
+
+               vreg_l19a_3p3: l19 {
+                       regulator-min-microvolt = <3312000>;
+                       regulator-max-microvolt = <3400000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+                       regulator-allow-set-load;
+               };
+       };
+
+       pm660l-regulators {
+               compatible = "qcom,rpm-pm660l-regulators";
+
+               vdd_s1-supply = <&vph_pwr>;
+               vdd_s2-supply = <&vph_pwr>;
+               vdd_s3_s4-supply = <&vph_pwr>;
+               vdd_s5-supply = <&vph_pwr>;
+               vdd_s6-supply = <&vph_pwr>;
+
+               vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
+               vdd_l2-supply = <&vreg_bob>;
+               vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
+               vdd_l4_l6-supply = <&vreg_bob>;
+               vdd_bob-supply = <&vph_pwr>;
+
+               vreg_s2b_1p05: s2 {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1050000>;
+                       regulator-enable-ramp-delay = <200>;
+                       regulator-ramp-delay = <0>;
+               };
+
+               vreg_l1b_0p925: l1 {
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <925000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l2b_2p95: l2 {
+                       regulator-min-microvolt = <1648000>;
+                       regulator-max-microvolt = <3100000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l4b_2p95: l4 {
+                       regulator-min-microvolt = <2944000>;
+                       regulator-max-microvolt = <2952000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+
+                       regulator-min-microamp = <200>;
+                       regulator-max-microamp = <600000>;
+                       regulator-system-load = <570000>;
+                       regulator-allow-set-load;
+               };
+
+               /*
+                * Downstream specifies a range of 1721-3600mV,
+                * but the only assigned consumers are SDHCI2 VMMC
+                * and Coresight QPDI that both request pinned 2.95V.
+                * Tighten the range to 1.8-3.328 (closest to 3.3) to
+                * make the mmc driver happy.
+                */
+               vreg_l5b_2p95: l5 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <3328000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-system-load = <800000>;
+                       regulator-ramp-delay = <0>;
+                       regulator-allow-set-load;
+               };
+
+               vreg_l7b_3p125: l7 {
+                       regulator-min-microvolt = <2700000>;
+                       regulator-max-microvolt = <3125000>;
+                       regulator-enable-ramp-delay = <250>;
+               };
+
+               vreg_l8b_3p3: l8 {
+                       regulator-min-microvolt = <2800000>;
+                       regulator-max-microvolt = <3400000>;
+                       regulator-enable-ramp-delay = <250>;
+                       regulator-ramp-delay = <0>;
+               };
+
+               vreg_bob: bob {
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3624000>;
+                       regulator-enable-ramp-delay = <500>;
+                       regulator-ramp-delay = <0>;
+               };
+       };
+};
+
+&sdc2_state_on {
+       sd-cd {
+               pins = "gpio54";
+               bias-pull-up;
+               drive-strength = <2>;
+       };
+};
+
+&sdc2_state_off {
+       sd-cd {
+               pins = "gpio54";
+               bias-disable;
+               drive-strength = <2>;
+       };
+};
+
+&sdhc_1 {
+       status = "okay";
+       supports-cqe;
+
+       vmmc-supply = <&vreg_l4b_2p95>;
+       vqmmc-supply = <&vreg_l8a_1p8>;
+
+       mmc-ddr-1_8v;
+       mmc-hs400-1_8v;
+       mmc-hs400-enhanced-strobe;
+};
+
+&sdhc_2 {
+       status = "okay";
+
+       vmmc-supply = <&vreg_l5b_2p95>;
+       vqmmc-supply = <&vreg_l2b_2p95>;
+
+       cd-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
+       no-sdio;
+       no-emmc;
+};
+
+&tlmm {
+       gpio-reserved-ranges = <0 4>, <8 4>;
+};
+
+&usb2 {
+       status = "okay";
+};
+
+&usb2_dwc3 {
+       dr_mode = "host";
+};
+
+&usb3 {
+       status = "okay";
+};
+
+&usb3_dwc3 {
+       dr_mode = "peripheral";
+       extcon = <&extcon_usb>;
+};
index 42af1fa..09c0780 100644 (file)
@@ -10,6 +10,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        /* required for bootloader to select correct board */
@@ -34,7 +35,7 @@
                        height = <1920>;
                        stride = <(1080 * 4)>;
                        format = "a8r8g8b8";
-                       status= "okay";
+                       status = "okay";
                };
        };
 
                pinctrl-0 = <&imx300_vana_default>;
        };
 
-       gpio_keys {
-               status = "okay";
+       gpio-keys {
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
 
-               camera_focus {
+               key-camera-focus {
                        label = "Camera Focus";
                        gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        debounce-interval = <15>;
                };
 
-               camera_snapshot {
+               key-camera-snapshot {
                        label = "Camera Snapshot";
                        gpios = <&tlmm 113 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        debounce-interval = <15>;
                };
 
-               vol_down {
+               key-vol-down {
                        label = "Volume Down";
                        gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
        /* HCI Bluetooth */
 };
 
+&pm660l_lpg {
+       qcom,power-source = <1>;
+
+       status = "okay";
+
+       multi-led {
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_STATUS;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@1 {
+                       reg = <1>;
+                       color = <LED_COLOR_ID_BLUE>;
+               };
+
+               led@2 {
+                       reg = <2>;
+                       color = <LED_COLOR_ID_GREEN>;
+               };
+
+               led@3 {
+                       reg = <3>;
+                       color = <LED_COLOR_ID_RED>;
+               };
+       };
+};
+
 &pon_pwrkey {
        status = "okay";
 };
        linux,code = <KEY_VOLUMEUP>;
 };
 
-&qusb2phy {
+&qusb2phy0 {
        status = "okay";
 
        vdd-supply = <&vreg_l1b_0p925>;
        };
 };
 
+&sdc2_state_on {
+       sd-cd {
+               pins = "gpio54";
+               bias-pull-up;
+               drive-strength = <2>;
+       };
+};
+
+&sdc2_state_off {
+       sd-cd {
+               pins = "gpio54";
+               bias-disable;
+               drive-strength = <2>;
+       };
+};
+
 &sdhc_1 {
        status = "okay";
        supports-cqe;
index b72e8e6..1bc9091 100644 (file)
@@ -8,6 +8,7 @@
 #include <dt-bindings/clock/qcom,gpucc-sdm660.h>
 #include <dt-bindings/clock/qcom,mmcc-sdm660.h>
 #include <dt-bindings/clock/qcom,rpmcc.h>
+#include <dt-bindings/interconnect/qcom,sdm660.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
                };
 
                qfprom: qfprom@780000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,sdm630-qfprom", "qcom,qfprom";
                        reg = <0x00780000 0x621c>;
                        #address-cells = <1>;
                        #size-cells = <1>;
 
                        qusb2_hstx_trim: hstx-trim@240 {
-                               reg = <0x240 0x1>;
-                               bits = <25 3>;
+                               reg = <0x243 0x1>;
+                               bits = <1 3>;
                        };
 
                        gpu_speed_bin: gpu-speed-bin@41a0 {
-                               reg = <0x41a0 0x1>;
-                               bits = <21 7>;
+                               reg = <0x41a2 0x1>;
+                               bits = <5 7>;
                        };
                };
 
                                        bias-pull-up;
                                        drive-strength = <10>;
                                };
-
-                               sd-cd {
-                                       pins = "gpio54";
-                                       bias-pull-up;
-                                       drive-strength = <2>;
-                               };
                        };
 
                        sdc2_state_off: sdc2-off {
                                        bias-pull-up;
                                        drive-strength = <2>;
                                };
-
-                               sd-cd {
-                                       pins = "gpio54";
-                                       bias-disable;
-                                       drive-strength = <2>;
-                               };
                        };
                };
 
                        nvmem-cells = <&gpu_speed_bin>;
                        nvmem-cell-names = "speed_bin";
 
-                       interconnects = <&gnoc 1 &bimc 5>;
+                       interconnects = <&bimc MASTER_OXILI &bimc SLAVE_EBI>;
                        interconnect-names = "gfx-mem";
 
                        operating-points-v2 = <&gpu_sdm630_opp_table>;
 
+                       status = "disabled";
+
                        gpu_sdm630_opp_table: opp-table {
-                               compatible  = "operating-points-v2";
+                               compatible = "operating-points-v2";
                                opp-775000000 {
                                        opp-hz = /bits/ 64 <775000000>;
                                        opp-level = <RPM_SMD_LEVEL_TURBO>;
                                 * haven't seen any devices making use of it.
                                 */
                                maximum-speed = "high-speed";
-                               phys = <&qusb2phy>;
+                               phys = <&qusb2phy0>;
                                phy-names = "usb2-phy";
                                snps,hird-threshold = /bits/ 8 <0>;
                        };
                };
 
-               qusb2phy: phy@c012000 {
+               qusb2phy0: phy@c012000 {
                        compatible = "qcom,sdm660-qusb2-phy";
                        reg = <0x0c012000 0x180>;
                        #phy-cells = <0>;
 
                        clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
-                               <&gcc GCC_RX1_USB2_CLKREF_CLK>;
+                                <&gcc GCC_RX0_USB2_CLKREF_CLK>;
                        clock-names = "cfg_ahb", "ref";
 
                        resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>;
                        status = "disabled";
                };
 
-               sdhc_2: sdhci@c084000 {
+               qusb2phy1: phy@c014000 {
+                       compatible = "qcom,sdm660-qusb2-phy";
+                       reg = <0x0c014000 0x180>;
+                       #phy-cells = <0>;
+
+                       clocks = <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+                                <&gcc GCC_RX1_USB2_CLKREF_CLK>;
+                       clock-names = "cfg_ahb", "ref";
+
+                       resets = <&gcc GCC_QUSB2PHY_SEC_BCR>;
+                       nvmem-cells = <&qusb2_hstx_trim>;
+                       status = "disabled";
+               };
+
+               sdhc_2: mmc@c084000 {
                        compatible = "qcom,sdm630-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x0c084000 0x1000>;
                        reg-names = "hc";
                        interrupt-names = "hc_irq", "pwr_irq";
 
                        bus-width = <4>;
-                       clocks = <&gcc GCC_SDCC2_APPS_CLK>,
-                                       <&gcc GCC_SDCC2_AHB_CLK>,
+
+                       clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+                                       <&gcc GCC_SDCC2_APPS_CLK>,
                                        <&xo_board>;
-                       clock-names = "core", "iface", "xo";
+                       clock-names = "iface", "core", "xo";
+
 
                        interconnects = <&a2noc 3 &a2noc 10>,
                                        <&gnoc 0 &cnoc 28>;
+                       interconnect-names = "sdhc-ddr","cpu-sdhc";
                        operating-points-v2 = <&sdhc2_opp_table>;
 
                        pinctrl-names = "default", "sleep";
                        };
                };
 
-               sdhc_1: sdhci@c0c4000 {
+               sdhc_1: mmc@c0c4000 {
                        compatible = "qcom,sdm630-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x0c0c4000 0x1000>,
                              <0x0c0c5000 0x1000>,
                                        <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "hc_irq", "pwr_irq";
 
-                       clocks = <&gcc GCC_SDCC1_APPS_CLK>,
-                                <&gcc GCC_SDCC1_AHB_CLK>,
+                       clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+                                <&gcc GCC_SDCC1_APPS_CLK>,
                                 <&xo_board>,
                                 <&gcc GCC_SDCC1_ICE_CORE_CLK>;
-                       clock-names = "core", "iface", "xo", "ice";
+                       clock-names = "iface", "core", "xo", "ice";
 
                        interconnects = <&a2noc 2 &a2noc 10>,
                                        <&gnoc 0 &cnoc 27>;
-                       interconnect-names = "sdhc1-ddr", "cpu-sdhc1";
+                       interconnect-names = "sdhc-ddr", "cpu-sdhc";
                        operating-points-v2 = <&sdhc1_opp_table>;
                        pinctrl-names = "default", "sleep";
                        pinctrl-0 = <&sdc1_state_on>;
                        };
                };
 
+               usb2: usb@c2f8800 {
+                       compatible = "qcom,sdm660-dwc3", "qcom,dwc3";
+                       reg = <0x0c2f8800 0x400>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       clocks = <&gcc GCC_CFG_NOC_USB2_AXI_CLK>,
+                                <&gcc GCC_USB20_MASTER_CLK>,
+                                <&gcc GCC_USB20_MOCK_UTMI_CLK>,
+                                <&gcc GCC_USB20_SLEEP_CLK>;
+                       clock-names = "cfg_noc", "core",
+                                     "mock_utmi", "sleep";
+
+                       assigned-clocks = <&gcc GCC_USB20_MOCK_UTMI_CLK>,
+                                         <&gcc GCC_USB20_MASTER_CLK>;
+                       assigned-clock-rates = <19200000>, <60000000>;
+
+                       interrupts = <GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "hs_phy_irq";
+
+                       qcom,select-utmi-as-pipe-clk;
+
+                       resets = <&gcc GCC_USB_20_BCR>;
+
+                       usb2_dwc3: usb@c200000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x0c200000 0xc8d0>;
+                               interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+                               snps,dis_u2_susphy_quirk;
+                               snps,dis_enblslpm_quirk;
+
+                               /* This is the HS-only host */
+                               maximum-speed = "high-speed";
+                               phys = <&qusb2phy1>;
+                               phy-names = "usb2-phy";
+                               snps,hird-threshold = /bits/ 8 <0>;
+                       };
+               };
+
                mmcc: clock-controller@c8c0000 {
                        compatible = "qcom,mmcc-sdm630";
                        reg = <0x0c8c0000 0x40000>;
                                        <0>;
                };
 
-               dsi_opp_table: dsi-opp-table {
+               dsi_opp_table: opp-table-dsi {
                        compatible = "operating-points-v2";
 
                        opp-131250000 {
                                        };
                                };
 
-                               mdp_opp_table: mdp-opp {
+                               mdp_opp_table: opp-table {
                                        compatible = "operating-points-v2";
 
                                        opp-150000000 {
                                phys = <&dsi0_phy>;
                                phy-names = "dsi";
 
+                               status = "disabled";
+
                                ports {
                                        #address-cells = <1>;
                                        #size-cells = <0>;
 
                                clocks = <&mmcc MDSS_AHB_CLK>, <&xo_board>;
                                clock-names = "iface", "ref";
+                               status = "disabled";
                        };
                };
 
                        status = "disabled";
                };
 
-               imem@146bf000 {
-                       compatible = "simple-mfd";
+               sram@146bf000 {
+                       compatible = "qcom,sdm630-imem", "syscon", "simple-mfd";
                        reg = <0x146bf000 0x1000>;
 
                        #address-cells = <1>;
 
                camss: camss@ca00000 {
                        compatible = "qcom,sdm660-camss";
-                       reg = <0x0c824000 0x1000>,
+                       reg = <0x0ca00020 0x10>,
+                             <0x0ca30000 0x100>,
+                             <0x0ca30400 0x100>,
+                             <0x0ca30800 0x100>,
+                             <0x0ca30c00 0x100>,
+                             <0x0c824000 0x1000>,
                              <0x0ca00120 0x4>,
                              <0x0c825000 0x1000>,
                              <0x0ca00124 0x4>,
                              <0x0c826000 0x1000>,
                              <0x0ca00128 0x4>,
-                             <0x0ca30000 0x100>,
-                             <0x0ca30400 0x100>,
-                             <0x0ca30800 0x100>,
-                             <0x0ca30c00 0x100>,
                              <0x0ca31000 0x500>,
-                             <0x0ca00020 0x10>,
                              <0x0ca10000 0x1000>,
                              <0x0ca14000 0x1000>;
-                       reg-names = "csiphy0",
+                       reg-names = "csi_clk_mux",
+                                   "csid0",
+                                   "csid1",
+                                   "csid2",
+                                   "csid3",
+                                   "csiphy0",
                                    "csiphy0_clk_mux",
                                    "csiphy1",
                                    "csiphy1_clk_mux",
                                    "csiphy2",
                                    "csiphy2_clk_mux",
-                                   "csid0",
-                                   "csid1",
-                                   "csid2",
-                                   "csid3",
                                    "ispif",
-                                   "csi_clk_mux",
                                    "vfe0",
                                    "vfe1";
-                       interrupts = <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>,
-                                    <GIC_SPI 79 IRQ_TYPE_EDGE_RISING>,
-                                    <GIC_SPI 80 IRQ_TYPE_EDGE_RISING>,
-                                    <GIC_SPI 296 IRQ_TYPE_EDGE_RISING>,
+                       interrupts = <GIC_SPI 296 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 297 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 298 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 299 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 78 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 79 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 80 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 309 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 314 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 315 IRQ_TYPE_EDGE_RISING>;
-                       interrupt-names = "csiphy0",
-                                         "csiphy1",
-                                         "csiphy2",
-                                         "csid0",
+                       interrupt-names = "csid0",
                                          "csid1",
                                          "csid2",
                                          "csid3",
+                                         "csiphy0",
+                                         "csiphy1",
+                                         "csiphy2",
                                          "ispif",
                                          "vfe0",
                                          "vfe1";
-                       clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
-                               <&mmcc THROTTLE_CAMSS_AXI_CLK>,
-                               <&mmcc CAMSS_ISPIF_AHB_CLK>,
-                               <&mmcc CAMSS_CSI0PHYTIMER_CLK>,
-                               <&mmcc CAMSS_CSI1PHYTIMER_CLK>,
-                               <&mmcc CAMSS_CSI2PHYTIMER_CLK>,
-                               <&mmcc CAMSS_CSI0_AHB_CLK>,
-                               <&mmcc CAMSS_CSI0_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID0_CLK>,
-                               <&mmcc CAMSS_CSI0PIX_CLK>,
-                               <&mmcc CAMSS_CSI0RDI_CLK>,
-                               <&mmcc CAMSS_CSI1_AHB_CLK>,
-                               <&mmcc CAMSS_CSI1_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID1_CLK>,
-                               <&mmcc CAMSS_CSI1PIX_CLK>,
-                               <&mmcc CAMSS_CSI1RDI_CLK>,
-                               <&mmcc CAMSS_CSI2_AHB_CLK>,
-                               <&mmcc CAMSS_CSI2_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID2_CLK>,
-                               <&mmcc CAMSS_CSI2PIX_CLK>,
-                               <&mmcc CAMSS_CSI2RDI_CLK>,
-                               <&mmcc CAMSS_CSI3_AHB_CLK>,
-                               <&mmcc CAMSS_CSI3_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID3_CLK>,
-                               <&mmcc CAMSS_CSI3PIX_CLK>,
-                               <&mmcc CAMSS_CSI3RDI_CLK>,
-                               <&mmcc CAMSS_AHB_CLK>,
-                               <&mmcc CAMSS_VFE0_CLK>,
-                               <&mmcc CAMSS_CSI_VFE0_CLK>,
-                               <&mmcc CAMSS_VFE0_AHB_CLK>,
-                               <&mmcc CAMSS_VFE0_STREAM_CLK>,
-                               <&mmcc CAMSS_VFE1_CLK>,
-                               <&mmcc CAMSS_CSI_VFE1_CLK>,
-                               <&mmcc CAMSS_VFE1_AHB_CLK>,
-                               <&mmcc CAMSS_VFE1_STREAM_CLK>,
-                               <&mmcc CAMSS_VFE_VBIF_AHB_CLK>,
-                               <&mmcc CAMSS_VFE_VBIF_AXI_CLK>,
-                               <&mmcc CSIPHY_AHB2CRIF_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID0_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID1_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID2_CLK>,
-                               <&mmcc CAMSS_CPHY_CSID3_CLK>;
-                       clock-names = "top_ahb",
-                               "throttle_axi",
-                               "ispif_ahb",
-                               "csiphy0_timer",
-                               "csiphy1_timer",
-                               "csiphy2_timer",
-                               "csi0_ahb",
-                               "csi0",
-                               "csi0_phy",
-                               "csi0_pix",
-                               "csi0_rdi",
-                               "csi1_ahb",
-                               "csi1",
-                               "csi1_phy",
-                               "csi1_pix",
-                               "csi1_rdi",
-                               "csi2_ahb",
-                               "csi2",
-                               "csi2_phy",
-                               "csi2_pix",
-                               "csi2_rdi",
-                               "csi3_ahb",
-                               "csi3",
-                               "csi3_phy",
-                               "csi3_pix",
-                               "csi3_rdi",
-                               "ahb",
-                               "vfe0",
-                               "csi_vfe0",
-                               "vfe0_ahb",
-                               "vfe0_stream",
-                               "vfe1",
-                               "csi_vfe1",
-                               "vfe1_ahb",
-                               "vfe1_stream",
-                               "vfe_ahb",
-                               "vfe_axi",
-                               "csiphy_ahb2crif",
-                               "cphy_csid0",
-                               "cphy_csid1",
-                               "cphy_csid2",
-                               "cphy_csid3";
+                       clocks = <&mmcc CAMSS_AHB_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID0_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID1_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID2_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID3_CLK>,
+                                <&mmcc CAMSS_CSI0_AHB_CLK>,
+                                <&mmcc CAMSS_CSI0_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID0_CLK>,
+                                <&mmcc CAMSS_CSI0PIX_CLK>,
+                                <&mmcc CAMSS_CSI0RDI_CLK>,
+                                <&mmcc CAMSS_CSI1_AHB_CLK>,
+                                <&mmcc CAMSS_CSI1_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID1_CLK>,
+                                <&mmcc CAMSS_CSI1PIX_CLK>,
+                                <&mmcc CAMSS_CSI1RDI_CLK>,
+                                <&mmcc CAMSS_CSI2_AHB_CLK>,
+                                <&mmcc CAMSS_CSI2_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID2_CLK>,
+                                <&mmcc CAMSS_CSI2PIX_CLK>,
+                                <&mmcc CAMSS_CSI2RDI_CLK>,
+                                <&mmcc CAMSS_CSI3_AHB_CLK>,
+                                <&mmcc CAMSS_CSI3_CLK>,
+                                <&mmcc CAMSS_CPHY_CSID3_CLK>,
+                                <&mmcc CAMSS_CSI3PIX_CLK>,
+                                <&mmcc CAMSS_CSI3RDI_CLK>,
+                                <&mmcc CAMSS_CSI0PHYTIMER_CLK>,
+                                <&mmcc CAMSS_CSI1PHYTIMER_CLK>,
+                                <&mmcc CAMSS_CSI2PHYTIMER_CLK>,
+                                <&mmcc CSIPHY_AHB2CRIF_CLK>,
+                                <&mmcc CAMSS_CSI_VFE0_CLK>,
+                                <&mmcc CAMSS_CSI_VFE1_CLK>,
+                                <&mmcc CAMSS_ISPIF_AHB_CLK>,
+                                <&mmcc THROTTLE_CAMSS_AXI_CLK>,
+                                <&mmcc CAMSS_TOP_AHB_CLK>,
+                                <&mmcc CAMSS_VFE0_AHB_CLK>,
+                                <&mmcc CAMSS_VFE0_CLK>,
+                                <&mmcc CAMSS_VFE0_STREAM_CLK>,
+                                <&mmcc CAMSS_VFE1_AHB_CLK>,
+                                <&mmcc CAMSS_VFE1_CLK>,
+                                <&mmcc CAMSS_VFE1_STREAM_CLK>,
+                                <&mmcc CAMSS_VFE_VBIF_AHB_CLK>,
+                                <&mmcc CAMSS_VFE_VBIF_AXI_CLK>;
+                       clock-names = "ahb",
+                                     "cphy_csid0",
+                                     "cphy_csid1",
+                                     "cphy_csid2",
+                                     "cphy_csid3",
+                                     "csi0_ahb",
+                                     "csi0",
+                                     "csi0_phy",
+                                     "csi0_pix",
+                                     "csi0_rdi",
+                                     "csi1_ahb",
+                                     "csi1",
+                                     "csi1_phy",
+                                     "csi1_pix",
+                                     "csi1_rdi",
+                                     "csi2_ahb",
+                                     "csi2",
+                                     "csi2_phy",
+                                     "csi2_pix",
+                                     "csi2_rdi",
+                                     "csi3_ahb",
+                                     "csi3",
+                                     "csi3_phy",
+                                     "csi3_pix",
+                                     "csi3_rdi",
+                                     "csiphy0_timer",
+                                     "csiphy1_timer",
+                                     "csiphy2_timer",
+                                     "csiphy_ahb2crif",
+                                     "csi_vfe0",
+                                     "csi_vfe1",
+                                     "ispif_ahb",
+                                     "throttle_axi",
+                                     "top_ahb",
+                                     "vfe0_ahb",
+                                     "vfe0",
+                                     "vfe0_stream",
+                                     "vfe1_ahb",
+                                     "vfe1",
+                                     "vfe1_stream",
+                                     "vfe_ahb",
+                                     "vfe_axi";
                        interconnects = <&mnoc 5 &bimc 5>;
                        interconnect-names = "vfe-mem";
                        iommus = <&mmss_smmu 0xc00>,
                                label = "lpass";
                                mboxes = <&apcs_glb 9>;
                                qcom,remote-pid = <2>;
-                               #address-cells = <1>;
-                               #size-cells = <0>;
 
                                apr {
                                        compatible = "qcom,apr-v2";
index 8b815b2..891e314 100644 (file)
@@ -27,7 +27,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
index b96da53..58f687f 100644 (file)
@@ -19,7 +19,7 @@
 };
 
 &sdc2_state_on {
-       pinconf-clk {
+       clk {
                drive-strength = <14>;
        };
 };
index dcbaacf..a3559f6 100644 (file)
@@ -51,7 +51,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               volup {
+               key-volup {
                        label = "Volume Up";
                        gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
        linux,code = <KEY_VOLUMEDOWN>;
 };
 
-&qusb2phy {
+&qusb2phy0 {
        status = "okay";
 
        vdd-supply = <&vreg_l1b_0p925>;
        };
 };
 
+&pm660l_wled {
+       status = "okay";
+
+       qcom,switching-freq = <800>;
+       qcom,current-limit-microamp = <20000>;
+       qcom,num-strings = <2>;
+};
+
+&sdc2_state_on {
+       sd-cd {
+               pins = "gpio54";
+               bias-pull-up;
+               drive-strength = <2>;
+       };
+};
+
+&sdc2_state_off {
+       sd-cd {
+               pins = "gpio54";
+               bias-disable;
+               drive-strength = <2>;
+       };
+};
+
 &sdhc_1 {
        status = "okay";
        supports-cqe;
index 1d748c5..43220af 100644 (file)
@@ -14,7 +14,7 @@
        operating-points-v2 = <&gpu_sdm660_opp_table>;
 
        gpu_sdm660_opp_table: opp-table {
-               compatible  = "operating-points-v2";
+               compatible = "operating-points-v2";
 
                /*
                 * 775MHz is only available on the highest speed bin
                phys = <&dsi1_phy>;
                phy-names = "dsi";
 
+               status = "disabled";
+
                ports {
                        #address-cells = <1>;
                        #size-cells = <0>;
 
                clocks = <&mmcc MDSS_AHB_CLK>, <&rpmcc RPM_SMD_XO_CLK_SRC>;
                clock-names = "iface", "ref";
+               status = "disabled";
        };
 };
 
index e7e4cc5..b5eb8f7 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&pen_eject_odl>;
 
-               pen-insert {
+               switch-pen-insert {
                        label = "Pen Insert";
                        /* Insert = low, eject = high */
                        gpios = <&tlmm 119 GPIO_ACTIVE_LOW>;
        };
 
        panel: panel {
-               compatible ="innolux,p120zdg-bf1";
+               compatible = "innolux,p120zdg-bf1";
                power-supply = <&pp3300_dx_edp>;
                backlight = <&backlight>;
                no-hpd;
        };
 };
 
+&psci {
+       /delete-node/ cpu0;
+       /delete-node/ cpu1;
+       /delete-node/ cpu2;
+       /delete-node/ cpu3;
+       /delete-node/ cpu4;
+       /delete-node/ cpu5;
+       /delete-node/ cpu6;
+       /delete-node/ cpu7;
+       /delete-node/ cpu-cluster0;
+};
+
+&cpus {
+       /delete-node/ domain-idle-states;
+};
+
+&cpu_idle_states {
+       LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
+               compatible = "arm,idle-state";
+               idle-state-name = "little-power-down";
+               arm,psci-suspend-param = <0x40000003>;
+               entry-latency-us = <350>;
+               exit-latency-us = <461>;
+               min-residency-us = <1890>;
+               local-timer-stop;
+       };
+
+       LITTLE_CPU_SLEEP_1: cpu-sleep-0-1 {
+               compatible = "arm,idle-state";
+               idle-state-name = "little-rail-power-down";
+               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 = "big-power-down";
+               arm,psci-suspend-param = <0x40000003>;
+               entry-latency-us = <264>;
+               exit-latency-us = <621>;
+               min-residency-us = <952>;
+               local-timer-stop;
+       };
+
+       BIG_CPU_SLEEP_1: cpu-sleep-1-1 {
+               compatible = "arm,idle-state";
+               idle-state-name = "big-rail-power-down";
+               arm,psci-suspend-param = <0x40000004>;
+               entry-latency-us = <702>;
+               exit-latency-us = <1061>;
+               min-residency-us = <4488>;
+               local-timer-stop;
+       };
+
+       CLUSTER_SLEEP_0: cluster-sleep-0 {
+               compatible = "arm,idle-state";
+               idle-state-name = "cluster-power-down";
+               arm,psci-suspend-param = <0x400000F4>;
+               entry-latency-us = <3263>;
+               exit-latency-us = <6562>;
+               min-residency-us = <9987>;
+               local-timer-stop;
+       };
+};
+
+&CPU0 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
+                          &LITTLE_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU1 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
+                          &LITTLE_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU2 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
+                          &LITTLE_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU3 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
+                          &LITTLE_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU4 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&BIG_CPU_SLEEP_0
+                          &BIG_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU5 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&BIG_CPU_SLEEP_0
+                          &BIG_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU6 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&BIG_CPU_SLEEP_0
+                          &BIG_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
+&CPU7 {
+       /delete-property/ power-domains;
+       /delete-property/ power-domain-names;
+       cpu-idle-states = <&BIG_CPU_SLEEP_0
+                          &BIG_CPU_SLEEP_1
+                          &CLUSTER_SLEEP_0>;
+};
+
 /*
  * Reserved memory changes
  *
index 194ebeb..4afdb72 100644 (file)
@@ -5,6 +5,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include <dt-bindings/sound/qcom,q6afe.h>
                regulator-always-on;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
 
                pinctrl-names = "default";
                pinctrl-0 = <&vol_up_pin_a>;
 
-               vol-up {
+               key-vol-up {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
        leds {
                compatible = "gpio-leds";
 
-               user4 {
+               led-0 {
                        label = "green:user4";
+                       function = LED_FUNCTION_INDICATOR;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pm8998_gpio 13 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "panic-indicator";
                        default-state = "off";
                };
 
-               wlan {
+               led-1 {
                        label = "yellow:wlan";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_YELLOW>;
                        gpios = <&pm8998_gpio 9 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0tx";
                        default-state = "off";
                };
 
-               bt {
+               led-2 {
                        label = "blue:bt";
+                       function = LED_FUNCTION_BLUETOOTH;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&pm8998_gpio 5 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "bluetooth-power";
                        default-state = "off";
                "OPTION2",
                "PM845_SLB";
 
-       cam0_dvdd_1v2_en_default: cam0-dvdd-1v2-en {
+       cam0_dvdd_1v2_en_default: cam0-dvdd-1v2-en-state {
                pins = "gpio12";
                function = "normal";
 
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
        };
 
-       cam0_avdd_2v8_en_default: cam0-avdd-2v8-en {
+       cam0_avdd_2v8_en_default: cam0-avdd-2v8-en-state {
                pins = "gpio10";
                function = "normal";
 
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
        };
 
-       vol_up_pin_a: vol-up-active {
+       vol_up_pin_a: vol-up-active-state {
                pins = "gpio6";
                function = "normal";
                input-enable;
        };
 };
 
+&pmi8998_lpg {
+       status = "okay";
+
+       qcom,power-source = <1>;
+
+       led@3 {
+               reg = <3>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_HEARTBEAT;
+               function-enumerator = <3>;
+
+               linux,default-trigger = "heartbeat";
+               default-state = "on";
+       };
+
+       led@4 {
+               reg = <4>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_INDICATOR;
+               function-enumerator = <2>;
+       };
+
+       led@5 {
+               reg = <5>;
+               color = <LED_COLOR_ID_GREEN>;
+               function = LED_FUNCTION_INDICATOR;
+               function-enumerator = <1>;
+       };
+};
+
 /* QUAT I2S Uses 4 I2S SD Lines for audio on LT9611 HDMI Bridge */
 &q6afedai {
        qi2s@22 {
-               reg = <22>;
+               reg = <QUATERNARY_MI2S_RX>;
                qcom,sd-lines = <0 1 2 3>;
        };
 };
                };
 
                codec {
-                       sound-dai =  <&lt9611_codec 0>;
+                       sound-dai = <&lt9611_codec 0>;
                };
        };
 
                };
 
                codec {
-                       sound-dai =  <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
+                       sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
                };
        };
 
 };
 
 &camss {
-       vdda-supply = <&vreg_l1a_0p875>;
+       vdda-phy-supply = <&vreg_l1a_0p875>;
+       vdda-pll-supply = <&vreg_l26a_1p2>;
 
        status = "ok";
 
diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
new file mode 100644 (file)
index 0000000..20f275f
--- /dev/null
@@ -0,0 +1,614 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SDM845 LG G7 / V35 (judyln / judyp) common device tree
+ *
+ * Copyright (c) 2022, The Linux Foundation. All rights reserved.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+
+#include "sdm845.dtsi"
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
+
+/delete-node/ &adsp_mem;
+/delete-node/ &cdsp_mem;
+/delete-node/ &gpu_mem;
+/delete-node/ &ipa_fw_mem;
+/delete-node/ &mba_region;
+/delete-node/ &mpss_region;
+/delete-node/ &qseecom_mem;
+/delete-node/ &rmtfs_mem;
+/delete-node/ &slpi_mem;
+/delete-node/ &spss_mem;
+/delete-node/ &venus_mem;
+/delete-node/ &wlan_msa_mem;
+
+/ {
+       chosen {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+       };
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               qseecom_mem: memory@b2000000 {
+                       reg = <0 0xb2000000 0 0x1800000>;
+                       no-map;
+               };
+
+               gpu_mem: memory@8c415000 {
+                       reg = <0 0x8c415000 0 0x2000>;
+                       no-map;
+               };
+
+               ipa_fw_mem: memory@8c400000 {
+                       reg = <0 0x8c400000 0 0x10000>;
+                       no-map;
+               };
+
+               adsp_mem: memory@8c500000 {
+                       reg = <0 0x8c500000 0 0x1e00000>;
+                       no-map;
+               };
+
+               wlan_msa_mem: memory@8e300000 {
+                       reg = <0 0x8e300000 0 0x100000>;
+                       no-map;
+               };
+
+               mpss_region: memory@8e400000 {
+                       reg = <0 0x8e400000 0 0x8900000>;
+                       no-map;
+               };
+
+               venus_mem: memory@96d00000 {
+                       reg = <0 0x96d00000 0 0x500000>;
+                       no-map;
+               };
+
+               cdsp_mem: memory@97200000 {
+                       reg = <0 0x97200000 0 0x800000>;
+                       no-map;
+               };
+
+               mba_region: memory@97a00000 {
+                       reg = <0 0x97a00000 0 0x200000>;
+                       no-map;
+               };
+
+               slpi_mem: memory@97c00000 {
+                       reg = <0 0x97c00000 0 0x1400000>;
+                       no-map;
+               };
+
+               spss_mem: memory@99000000 {
+                       reg = <0 0x99000000 0 0x100000>;
+                       no-map;
+               };
+
+               /* Framebuffer region */
+               memory@9d400000 {
+                       reg = <0x0 0x9d400000 0x0 0x2400000>;
+                       no-map;
+               };
+
+               /* rmtfs lower guard */
+               memory@f0800000 {
+                       reg = <0 0xf0800000 0 0x1000>;
+                       no-map;
+               };
+
+               rmtfs_mem: memory@f0801000 {
+                       compatible = "qcom,rmtfs-mem";
+                       reg = <0 0xf0801000 0 0x200000>;
+                       no-map;
+
+                       qcom,client-id = <1>;
+                       qcom,vmid = <15>;
+               };
+
+               /* rmtfs upper guard */
+               memory@f0a01000 {
+                       reg = <0 0xf0a01000 0 0x1000>;
+                       no-map;
+               };
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&vol_up_pin_a>;
+
+               label = "GPIO Buttons";
+
+               key-vol-up {
+                       label = "Volume up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       vph_pwr: vph-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vph_pwr";
+               regulator-min-microvolt = <3700000>;
+               regulator-max-microvolt = <3700000>;
+       };
+
+       /*
+        * Apparently RPMh does not provide support for PM8998 S4 because it
+        * is always-on; model it as a fixed regulator.
+        */
+       vreg_s4a_1p8: pm8998-smps4-regulator {
+               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";
+};
+
+&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 = <1880000>;
+                       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_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_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 = <2800000>;
+                       regulator-max-microvolt = <2800000>;
+                       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 = <3000000>;
+                       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 = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       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";
+};
+
+&dispcc {
+       status = "disabled";
+};
+
+&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>;
+};
+
+&gpu {
+       status = "okay";
+
+       zap-shader {
+               memory-region = <&gpu_mem>;
+       };
+};
+
+&ipa {
+       status = "okay";
+       modem-init;
+};
+
+&mss_pil {
+       status = "okay";
+};
+
+&pm8998_pon {
+       resin {
+               compatible = "qcom,pm8941-resin";
+               interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+               debounce = <15625>;
+               bias-pull-up;
+               linux,code = <KEY_VOLUMEDOWN>;
+       };
+};
+
+&sdhc_2 {
+       status = "okay";
+
+       cd-gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&sdc2_clk &sdc2_cmd &sdc2_data &sd_card_det_n>;
+
+       vmmc-supply = <&vreg_l21a_2p95>;
+       vqmmc-supply = <&vddpx_2>;
+};
+
+/*
+ * UFS works partially and only with clk_ignore_unused.
+ * Sometimes it crashes with I/O errors.
+ */
+&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 {
+       /* TODO: these devices have usb id pin */
+       dr_mode = "peripheral";
+};
+
+&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>;
+};
+
+/* PINCTRL - additions to nodes defined in sdm845.dtsi */
+
+&tlmm {
+       gpio-reserved-ranges = <28 4>, <81 4>;
+
+       sdc2_clk: sdc2-clk {
+               pinconf {
+                       pins = "sdc2_clk";
+                       bias-disable;
+
+                       /*
+                        * It seems that mmc_test reports errors if drive
+                        * strength is not 16 on clk, cmd, and data pins.
+                        *
+                        * TODO: copy-pasted from mtp, try other values
+                        * on these devices.
+                        */
+                       drive-strength = <16>;
+               };
+       };
+
+       sdc2_cmd: sdc2-cmd {
+               pinconf {
+                       pins = "sdc2_cmd";
+                       bias-pull-up;
+                       drive-strength = <16>;
+               };
+       };
+
+       sdc2_data: sdc2-data {
+               pinconf {
+                       pins = "sdc2_data";
+                       bias-pull-up;
+                       drive-strength = <16>;
+               };
+       };
+
+       sd_card_det_n: sd-card-det-n {
+               pinmux {
+                       pins = "gpio126";
+                       function = "gpio";
+               };
+
+               pinconf {
+                       pins = "gpio126";
+                       bias-pull-up;
+               };
+       };
+};
+
+&pm8998_gpio {
+       vol_up_pin_a: vol-up-active-pins {
+               pins = "gpio6";
+               function = "normal";
+               input-enable;
+               bias-pull-up;
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts b/arch/arm64/boot/dts/qcom/sdm845-lg-judyln.dts
new file mode 100644 (file)
index 0000000..7d967a1
--- /dev/null
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SDM845 LG G7 (judyln) device tree.
+ *
+ * Copyright (c) 2022, The Linux Foundation. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "sdm845-lg-common.dtsi"
+
+/ {
+       model = "LG G7 ThinQ";
+       compatible = "lg,judyln", "qcom,sdm845";
+
+       chosen {
+               framebuffer@9d400000 {
+                       compatible = "simple-framebuffer";
+                       reg = <0x0 0x9d400000 0x0 (1440 * 3120 * 4)>;
+                       width = <1440>;
+                       height = <3120>;
+                       stride = <(1440 * 4)>;
+                       format = "a8r8g8b8";
+                       lab-supply = <&lab>;
+                       ibb-supply = <&ibb>;
+               };
+       };
+
+       /* Additional ThinQ key */
+       gpio-keys {
+               pinctrl-0 = <&vol_up_pin_a &thinq_key_default>;
+
+               key-thinq {
+                       label = "ThinQ";
+                       linux,code = <KEY_ASSISTANT>;
+                       interrupt-parent = <&tlmm>;
+                       interrupts = <89 IRQ_TYPE_LEVEL_LOW>;
+               };
+       };
+};
+
+&adsp_pas {
+       firmware-name = "qcom/sdm845/judyln/adsp.mbn";
+};
+
+&cdsp_pas {
+       firmware-name = "qcom/sdm845/judyln/cdsp.mbn";
+};
+
+&gpu {
+       zap-shader {
+               firmware-name = "qcom/sdm845/judyln/a630_zap.mbn";
+       };
+};
+
+&mss_pil {
+       firmware-name = "qcom/sdm845/judyln/mba.mbn", "qcom/sdm845/judyln/modem.mbn";
+};
+
+&tlmm {
+       thinq_key_default: thinq-key-default {
+               pins = "gpio89";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-pull-up;
+       };
+};
diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-judyp.dts b/arch/arm64/boot/dts/qcom/sdm845-lg-judyp.dts
new file mode 100644 (file)
index 0000000..d17d4d4
--- /dev/null
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SDM845 LG V35 (judyp) device tree.
+ *
+ * Copyright (c) 2022, The Linux Foundation. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "sdm845-lg-common.dtsi"
+
+/ {
+       model = "LG V35 ThinQ";
+       compatible = "lg,judyp", "qcom,sdm845";
+
+       chosen {
+               framebuffer@9d400000 {
+                       compatible = "simple-framebuffer";
+                       reg = <0x0 0x9d400000 0x0 (1440 * 2880 * 4)>;
+                       width = <1440>;
+                       height = <2880>;
+                       stride = <(1440 * 4)>;
+                       format = "a8r8g8b8";
+               };
+       };
+};
+
+&adsp_pas {
+       firmware-name = "qcom/sdm845/judyp/adsp.mbn";
+};
+
+&cdsp_pas {
+       firmware-name = "qcom/sdm845/judyp/cdsp.mbn";
+};
+
+&gpu {
+       zap-shader {
+               firmware-name = "qcom/sdm845/judyp/a630_zap.mbn";
+       };
+};
+
+&mss_pil {
+       firmware-name = "qcom/sdm845/judyp/mba.mbn", "qcom/sdm845/judyp/modem.mbn";
+};
index 07b729f..392461c 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&volume_down_gpio &volume_up_gpio>;
 
-               vol-down {
+               key-vol-down {
                        label = "Volume down";
                        linux,code = <KEY_VOLUMEDOWN>;
                        gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
                        debounce-interval = <15>;
                };
 
-               vol-up {
+               key-vol-up {
                        label = "Volume up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
 };
 
 &pm8998_gpio {
-       volume_down_gpio: pm8998_gpio5 {
+       volume_down_gpio: pm8998-gpio5-state {
                pinconf {
                        pins = "gpio5";
                        function = "normal";
                };
        };
 
-       volume_up_gpio: pm8998_gpio6 {
+       volume_up_gpio: pm8998-gpio6-state {
                pinconf {
                        pins = "gpio6";
                        function = "normal";
index 103cc40..83261c9 100644 (file)
@@ -2,11 +2,13 @@
 /*
  * Copyright (c) 2022, Alexander Martinz <amartinz@shiftphones.com>
  * Copyright (c) 2022, Caleb Connolly <caleb@connolly.tech>
+ * Copyright (c) 2022, Dylan Van Assche <me@dylanvanassche.be>
  */
 
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
@@ -48,7 +50,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&volume_up_gpio>;
 
-               vol-up {
+               key-vol-up {
                        label = "volume_up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
 };
 
 &i2c5 {
-       status="okay";
+       status = "okay";
 
        touchscreen@38 {
                compatible = "focaltech,fts8719";
 };
 
 &pm8998_gpio {
-       volume_up_gpio: pm8998_gpio6 {
+       volume_up_gpio: pm8998-gpio6-state {
                pinconf {
                        pins = "gpio6";
                        function = "normal";
        };
 };
 
+&pmi8998_lpg {
+       status = "okay";
+
+       multi-led {
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_STATUS;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@3 {
+                       reg = <3>;
+                       color = <LED_COLOR_ID_BLUE>;
+               };
+
+               led@4 {
+                       reg = <4>;
+                       color = <LED_COLOR_ID_GREEN>;
+               };
+
+               led@5 {
+                       reg = <5>;
+                       color = <LED_COLOR_ID_RED>;
+               };
+       };
+};
+
 &qup_uart9_default {
        pinconf-rx {
                pins = "gpio5";
index 8a0d94e..2f5e12d 100644 (file)
@@ -19,8 +19,9 @@
 };
 
 &vreg_l22a_2p8 {
-       regulator-min-microvolt = <2700000>;
-       regulator-max-microvolt = <2700000>;
+       /* Note: Round-down from 2700000 to be a multiple of PLDO step-size 8000 */
+       regulator-min-microvolt = <2696000>;
+       regulator-max-microvolt = <2696000>;
 };
 
 &vreg_l28a_2p8 {
index 281fe6d..51ee42e 100644 (file)
@@ -19,7 +19,7 @@
 
                /* Neither Camera Focus, nor Camera Shutter seem to work... */
 
-               vol-down {
+               key-vol-down {
                        label = "volume_down";
                        gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
index d88dc07..82c27f9 100644 (file)
@@ -45,7 +45,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&vol_up_pin_a>;
 
-               vol-up {
+               key-vol-up {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
 };
 
 &pm8998_gpio {
-       vol_up_pin_a: vol-up-active {
+       vol_up_pin_a: vol-up-active-state {
                pins = "gpio6";
                function = "normal";
                input-enable;
 /* QUAT I2S Uses 1 I2S SD Line for audio on TAS2559/60 amplifiers */
 &q6afedai {
        qi2s@22 {
-               reg = <22>;
+               reg = <QUATERNARY_MI2S_RX>;
                qcom,sd-lines = <0>;
        };
 };
                };
 
                codec {
-                       sound-dai =  <&wcd9340 0>;
+                       sound-dai = <&wcd9340 0>;
                };
        };
 
index 0692ae0..7fb10c2 100644 (file)
                };
        };
 
-       cpus {
+       cpus: cpus {
                #address-cells = <2>;
                #size-cells = <0>;
 
                        compatible = "qcom,kryo385";
                        reg = <0x0 0x0>;
                        enable-method = "psci";
-                       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
-                                          &LITTLE_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        capacity-dmips-mhz = <611>;
                        dynamic-power-coefficient = <290>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD0>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_0>;
                        L2_0: l2-cache {
                        compatible = "qcom,kryo385";
                        reg = <0x0 0x100>;
                        enable-method = "psci";
-                       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
-                                          &LITTLE_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        capacity-dmips-mhz = <611>;
                        dynamic-power-coefficient = <290>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD1>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_100>;
                        L2_100: l2-cache {
                        compatible = "qcom,kryo385";
                        reg = <0x0 0x200>;
                        enable-method = "psci";
-                       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
-                                          &LITTLE_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        capacity-dmips-mhz = <611>;
                        dynamic-power-coefficient = <290>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        operating-points-v2 = <&cpu0_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD2>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_200>;
                        L2_200: l2-cache {
                        compatible = "qcom,kryo385";
                        reg = <0x0 0x300>;
                        enable-method = "psci";
-                       cpu-idle-states = <&LITTLE_CPU_SLEEP_0
-                                          &LITTLE_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        capacity-dmips-mhz = <611>;
                        dynamic-power-coefficient = <290>;
                        qcom,freq-domain = <&cpufreq_hw 0>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
                        #cooling-cells = <2>;
+                       power-domains = <&CPU_PD3>;
+                       power-domain-names = "psci";
                        next-level-cache = <&L2_300>;
                        L2_300: l2-cache {
                                compatible = "cache";
                        reg = <0x0 0x400>;
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
-                       cpu-idle-states = <&BIG_CPU_SLEEP_0
-                                          &BIG_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        dynamic-power-coefficient = <442>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD4>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_400>;
                        L2_400: l2-cache {
                        reg = <0x0 0x500>;
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
-                       cpu-idle-states = <&BIG_CPU_SLEEP_0
-                                          &BIG_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        dynamic-power-coefficient = <442>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD5>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_500>;
                        L2_500: l2-cache {
                        reg = <0x0 0x600>;
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
-                       cpu-idle-states = <&BIG_CPU_SLEEP_0
-                                          &BIG_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        dynamic-power-coefficient = <442>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD6>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_600>;
                        L2_600: l2-cache {
                        reg = <0x0 0x700>;
                        enable-method = "psci";
                        capacity-dmips-mhz = <1024>;
-                       cpu-idle-states = <&BIG_CPU_SLEEP_0
-                                          &BIG_CPU_SLEEP_1
-                                          &CLUSTER_SLEEP_0>;
                        dynamic-power-coefficient = <442>;
                        qcom,freq-domain = <&cpufreq_hw 1>;
                        operating-points-v2 = <&cpu4_opp_table>;
                        interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
                                        <&osm_l3 MASTER_OSM_L3_APPS &osm_l3 SLAVE_OSM_L3>;
+                       power-domains = <&CPU_PD7>;
+                       power-domain-names = "psci";
                        #cooling-cells = <2>;
                        next-level-cache = <&L2_700>;
                        L2_700: l2-cache {
                        };
                };
 
-               idle-states {
+               cpu_idle_states: idle-states {
                        entry-method = "psci";
 
                        LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 {
                                compatible = "arm,idle-state";
-                               idle-state-name = "little-power-down";
-                               arm,psci-suspend-param = <0x40000003>;
+                               idle-state-name = "little-rail-power-collapse";
+                               arm,psci-suspend-param = <0x40000004>;
                                entry-latency-us = <350>;
                                exit-latency-us = <461>;
                                min-residency-us = <1890>;
                                local-timer-stop;
                        };
 
-                       LITTLE_CPU_SLEEP_1: cpu-sleep-0-1 {
-                               compatible = "arm,idle-state";
-                               idle-state-name = "little-rail-power-down";
-                               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 = "big-power-down";
-                               arm,psci-suspend-param = <0x40000003>;
+                               idle-state-name = "big-rail-power-collapse";
+                               arm,psci-suspend-param = <0x40000004>;
                                entry-latency-us = <264>;
                                exit-latency-us = <621>;
                                min-residency-us = <952>;
                                local-timer-stop;
                        };
+               };
 
-                       BIG_CPU_SLEEP_1: cpu-sleep-1-1 {
-                               compatible = "arm,idle-state";
-                               idle-state-name = "big-rail-power-down";
-                               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 = "arm,idle-state";
-                               idle-state-name = "cluster-power-down";
-                               arm,psci-suspend-param = <0x400000F4>;
+                               compatible = "domain-idle-state";
+                               idle-state-name = "cluster-power-collapse";
+                               arm,psci-suspend-param = <0x4100c244>;
                                entry-latency-us = <3263>;
                                exit-latency-us = <6562>;
                                min-residency-us = <9987>;
                };
        };
 
-       cpu0_opp_table: cpu0_opp_table {
+       cpu0_opp_table: opp-table-cpu0 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu4_opp_table: cpu4_opp_table {
+       cpu4_opp_table: opp-table-cpu4 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       psci {
+       psci: psci {
                compatible = "arm,psci-1.0";
                method = "smc";
+
+               CPU_PD0: power-domain-cpu0 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD1: power-domain-cpu1 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD2: power-domain-cpu2 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD3: power-domain-cpu3 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&LITTLE_CPU_SLEEP_0>;
+               };
+
+               CPU_PD4: power-domain-cpu4 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CPU_PD5: power-domain-cpu5 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CPU_PD6: power-domain-cpu6 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CPU_PD7: power-domain-cpu7 {
+                       #power-domain-cells = <0>;
+                       power-domains = <&CLUSTER_PD>;
+                       domain-idle-states = <&BIG_CPU_SLEEP_0>;
+               };
+
+               CLUSTER_PD: power-domain-cluster {
+                       #power-domain-cells = <0>;
+                       domain-idle-states = <&CLUSTER_SLEEP_0>;
+               };
        };
 
        soc: soc@0 {
                        clock-names = "core";
                };
 
-               qup_opp_table: qup-opp-table {
+               qup_opp_table: opp-table-qup {
                        compatible = "operating-points-v2";
 
                        opp-50000000 {
                        interrupts = <GIC_SPI 582 IRQ_TYPE_LEVEL_HIGH>;
                };
 
+               pmu@1436400 {
+                       compatible = "qcom,sdm845-bwmon", "qcom,msm8998-bwmon";
+                       reg = <0 0x01436400 0 0x600>;
+                       interrupts = <GIC_SPI 581 IRQ_TYPE_LEVEL_HIGH>;
+                       interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_LLCC 3>;
+
+                       operating-points-v2 = <&cpu_bwmon_opp_table>;
+
+                       cpu_bwmon_opp_table: opp-table {
+                               compatible = "operating-points-v2";
+
+                               /*
+                                * The interconnect path bandwidth taken from
+                                * cpu4_opp_table bandwidth for OSM L3
+                                * interconnect.  This also matches the OSM L3
+                                * from bandwidth table of qcom,cpu4-l3lat-mon
+                                * (qcom,core-dev-table, bus width: 16 bytes)
+                                * from msm-4.9 downstream kernel.
+                                */
+                               opp-0 {
+                                       opp-peak-kBps = <4800000>;
+                               };
+                               opp-1 {
+                                       opp-peak-kBps = <9216000>;
+                               };
+                               opp-2 {
+                                       opp-peak-kBps = <15052800>;
+                               };
+                               opp-3 {
+                                       opp-peak-kBps = <20889600>;
+                               };
+                               opp-4 {
+                                       opp-peak-kBps = <25497600>;
+                               };
+                       };
+               };
+
                pcie0: pci@1c00000 {
                        compatible = "qcom,pcie-sdm845";
                        reg = <0 0x01c00000 0 0x2000>,
                        };
                };
 
-               sdhc_2: sdhci@8804000 {
+               sdhc_2: mmc@8804000 {
                        compatible = "qcom,sdm845-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x08804000 0 0x1000>;
 
 
                        status = "disabled";
 
-                       sdhc2_opp_table: sdhc2-opp-table {
+                       sdhc2_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-9600000 {
                        };
                };
 
-               qspi_opp_table: qspi-opp-table {
+               qspi_opp_table: opp-table-qspi {
                        compatible = "operating-points-v2";
 
                        opp-19200000 {
                        qcom,apps-ch-pipes = <0x780000>;
                        qcom,ea-pc = <0x270>;
                        status = "okay";
-                       dmas =  <&slimbam 3>, <&slimbam 4>,
+                       dmas = <&slimbam 3>, <&slimbam 4>,
                                <&slimbam 5>, <&slimbam 6>;
                        dma-names = "rx", "tx", "tx2", "rx2";
 
 
                                wcd9340_ifd: ifd@0{
                                        compatible = "slim217,250";
-                                       reg  = <0 0>;
+                                       reg = <0 0>;
                                };
 
                                wcd9340: codec@1{
                                        compatible = "slim217,250";
-                                       reg  = <1 0>;
-                                       slim-ifc-dev  = <&wcd9340_ifd>;
+                                       reg = <1 0>;
+                                       slim-ifc-dev = <&wcd9340_ifd>;
 
                                        #sound-dai-cells = <1>;
 
                                                reg = <0xc85 0x40>;
                                                interrupts-extended = <&wcd9340 20>;
 
-                                               qcom,dout-ports = <6>;
-                                               qcom,din-ports  = <2>;
+                                               qcom,dout-ports = <6>;
+                                               qcom,din-ports = <2>;
                                                qcom,ports-sinterval-low =/bits/ 8  <0x07 0x1F 0x3F 0x7 0x1F 0x3F 0x0F 0x0F>;
                                                qcom,ports-offset1 = /bits/ 8 <0x01 0x02 0x0C 0x6 0x12 0x0D 0x07 0x0A >;
                                                qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x1F 0x00 0x00 0x1F 0x00 0x00>;
                                compatible = "venus-encoder";
                        };
 
-                       venus_opp_table: venus-opp-table {
+                       venus_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-100000000 {
                        clock-names = "bi_tcxo";
                };
 
-               dsi_opp_table: dsi-opp-table {
+               dsi_opp_table: opp-table-dsi {
                        compatible = "operating-points-v2";
 
                        opp-19200000 {
 
                        power-domains = <&dispcc MDSS_GDSC>;
 
-                       clocks = <&gcc GCC_DISP_AHB_CLK>,
+                       clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
                                 <&dispcc DISP_CC_MDSS_MDP_CLK>;
                        clock-names = "iface", "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>;
                                         <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
                                clock-names = "gcc-bus", "iface", "bus", "core", "vsync";
 
-                               assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
-                                                 <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
-                               assigned-clock-rates = <300000000>,
-                                                      <19200000>;
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
+                               assigned-clock-rates = <19200000>;
                                operating-points-v2 = <&mdp_opp_table>;
                                power-domains = <&rpmhpd SDM845_CX>;
 
                                        };
                                };
 
-                               mdp_opp_table: mdp-opp-table {
+                               mdp_opp_table: opp-table {
                                        compatible = "operating-points-v2";
 
                                        opp-19200000 {
                };
 
                gmu: gmu@506a000 {
-                       compatible="qcom,adreno-gmu-630.2", "qcom,adreno-gmu";
+                       compatible = "qcom,adreno-gmu-630.2", "qcom,adreno-gmu";
 
                        reg = <0 0x506a000 0 0x30000>,
                              <0 0xb280000 0 0x10000>,
                        cell-index = <0>;
                };
 
-               imem@146bf000 {
-                       compatible = "simple-mfd";
+               sram@146bf000 {
+                       compatible = "qcom,sdm845-imem", "syscon", "simple-mfd";
                        reg = <0 0x146bf000 0 0x1000>;
 
                        #address-cells = <1>;
                        compatible = "qcom,bam-v1.7.0";
                        qcom,controlled-remotely;
                        reg = <0 0x17184000 0 0x2a000>;
-                       num-channels  = <31>;
+                       num-channels = <31>;
                        interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
                        #dma-cells = <1>;
                        qcom,ee = <1>;
                };
 
                timer@17c90000 {
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0 0x17c90000 0 0x1000>;
 
                                frame-number = <0>;
                                interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17ca0000 0 0x1000>,
-                                     <0 0x17cb0000 0 0x1000>;
+                               reg = <0x17ca0000 0x1000>,
+                                     <0x17cb0000 0x1000>;
                        };
 
                        frame@17cc0000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17cc0000 0 0x1000>;
+                               reg = <0x17cc0000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17cd0000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17cd0000 0 0x1000>;
+                               reg = <0x17cd0000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17ce0000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17ce0000 0 0x1000>;
+                               reg = <0x17ce0000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17cf0000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17cf0000 0 0x1000>;
+                               reg = <0x17cf0000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17d00000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17d00000 0 0x1000>;
+                               reg = <0x17d00000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17d10000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0 0x17d10000 0 0x1000>;
+                               reg = <0x17d10000 0x1000>;
                                status = "disabled";
                        };
                };
index f1619b3..a7af1be 100644 (file)
@@ -41,7 +41,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&lid_pin_active>, <&mode_pin_active>;
 
-               lid {
+               switch-lid {
                        gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
                        linux,input-type = <EV_SW>;
                        linux,code = <SW_LID>;
@@ -49,7 +49,7 @@
                        wakeup-event-action = <EV_ACT_DEASSERTED>;
                };
 
-               mode {
+               switch-mode {
                        gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
                        linux,input-type = <EV_SW>;
                        linux,code = <SW_TABLET_MODE>;
                };
 
                codec {
-                       sound-dai =  <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
+                       sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
                };
        };
 
                };
 
                codec {
-                       sound-dai =  <&wcd9340 2>;
+                       sound-dai = <&wcd9340 2>;
                };
        };
 };
 
 &crypto {
        /* FIXME: qce_start triggers an SError */
-       status= "disable";
+       status = "disable";
 };
index 2a552d8..b0315ee 100644 (file)
                };
 
                codec {
-                       sound-dai =  <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
+                       sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
                };
        };
 
                };
 
                codec {
-                       sound-dai =  <&wcd9340 2>;
+                       sound-dai = <&wcd9340 2>;
                };
        };
 };
index 871ccbb..0aad2e9 100644 (file)
        gpio-keys {
                status = "okay";
                compatible = "gpio-keys";
-               #address-cells = <1>;
-               #size-cells = <0>;
                autorepeat;
 
-               vol-dn {
+               key-vol-dn {
                        label = "Volume Down";
                        gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
        status = "okay";
 };
 
-&sdc2_state_off {
+&sdc2_off_state {
        sd-cd {
                pins = "gpio98";
+               drive-strength = <2>;
                bias-disable;
+       };
+};
+
+&sdc2_on_state {
+       sd-cd {
+               pins = "gpio98";
                drive-strength = <2>;
+               bias-pull-up;
        };
 };
 
 
 &tlmm {
        gpio-reserved-ranges = <22 2>, <28 6>;
-
-       sdc2_state_on: sdc2-on {
-               clk {
-                       pins = "sdc2_clk";
-                       bias-disable;
-                       drive-strength = <16>;
-               };
-
-               cmd {
-                       pins = "sdc2_cmd";
-                       bias-pull-up;
-                       drive-strength = <10>;
-               };
-
-               data {
-                       pins = "sdc2_data";
-                       bias-pull-up;
-                       drive-strength = <10>;
-               };
-
-               sd-cd {
-                       pins = "gpio98";
-                       bias-pull-up;
-                       drive-strength = <2>;
-               };
-       };
 };
 
 &usb3 {
index 135e6e0..8c582a9 100644 (file)
                        interrupt-controller;
                        #interrupt-cells = <2>;
 
-                       sdc2_state_off: sdc2-off {
+                       sdc2_off_state: sdc2-off-state {
                                clk {
                                        pins = "sdc2_clk";
-                                       bias-disable;
                                        drive-strength = <2>;
+                                       bias-disable;
                                };
 
                                cmd {
                                        pins = "sdc2_cmd";
+                                       drive-strength = <2>;
                                        bias-pull-up;
+                               };
+
+                               data {
+                                       pins = "sdc2_data";
                                        drive-strength = <2>;
+                                       bias-pull-up;
+                               };
+                       };
+
+                       sdc2_on_state: sdc2-on-state {
+                               clk {
+                                       pins = "sdc2_clk";
+                                       drive-strength = <16>;
+                                       bias-disable;
+                               };
+
+                               cmd {
+                                       pins = "sdc2_cmd";
+                                       drive-strength = <10>;
+                                       bias-pull-up;
                                };
 
                                data {
                                        pins = "sdc2_data";
+                                       drive-strength = <10>;
                                        bias-pull-up;
-                                       drive-strength = <2>;
                                };
                        };
                };
                        reg = <0x045f0000 0x7000>;
                };
 
-               sdhc_1: sdhci@4744000 {
+               sdhc_1: mmc@4744000 {
                        compatible = "qcom,sm6125-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x04744000 0x1000>, <0x04745000 0x1000>;
                        reg-names = "hc", "core";
 
                        power-domains = <&rpmpd SM6125_VDDCX>;
 
+                       qcom,dll-config = <0x000f642c>;
+                       qcom,ddr-config = <0x80040873>;
+
                        bus-width = <8>;
                        non-removable;
                        status = "disabled";
                };
 
-               sdhc_2: sdhci@4784000 {
+               sdhc_2: mmc@4784000 {
                        compatible = "qcom,sm6125-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x04784000 0x1000>;
                        reg-names = "hc";
                                 <&xo_board>;
                        clock-names = "iface", "core", "xo";
 
-                       pinctrl-0 = <&sdc2_state_on>;
-                       pinctrl-1 = <&sdc2_state_off>;
+                       pinctrl-0 = <&sdc2_on_state>;
+                       pinctrl-1 = <&sdc2_off_state>;
                        pinctrl-names = "default", "sleep";
 
                        power-domains = <&rpmpd SM6125_VDDCX>;
 
+                       qcom,dll-config = <0x0007642c>;
+                       qcom,ddr-config = <0x80040873>;
+
                        bus-width = <4>;
                        status = "disabled";
                };
index d4f8f33..bb9349b 100644 (file)
                        clock-names = "core";
                };
 
-               sdhc_1: sdhci@7c4000 {
+               sdhc_1: mmc@7c4000 {
                        compatible = "qcom,sm6350-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x007c4000 0 0x1000>,
                                <0 0x007c5000 0 0x1000>,
 
                        status = "disabled";
 
-                       sdhc1_opp_table: sdhc1-opp-table {
+                       sdhc1_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-19200000 {
                        };
                };
 
-               sdhc_2: sdhci@8804000 {
+               sdhc_2: mmc@8804000 {
                        compatible = "qcom,sm6350-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x08804000 0 0x1000>;
 
 
                        status = "disabled";
 
-                       sdhc2_opp_table: sdhc2-opp-table {
+                       sdhc2_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-100000000 {
                        compatible = "arm,armv7-timer-mem";
                        reg = <0x0 0x17c20000 0x0 0x1000>;
                        clock-frequency = <19200000>;
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
 
                        frame@17c21000 {
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c21000 0x0 0x1000>,
-                                     <0x0 0x17c22000 0x0 0x1000>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
                        };
 
                        frame@17c23000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c23000 0x0 0x1000>;
+                               reg = <0x17c23000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c25000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c25000 0x0 0x1000>;
+                               reg = <0x17c25000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c27000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c27000 0x0 0x1000>;
+                               reg = <0x17c27000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c29000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c29000 0x0 0x1000>;
+                               reg = <0x17c29000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2b000 0x0 0x1000>;
+                               reg = <0x17c2b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2d000 0x0 0x1000>;
+                               reg = <0x17c2d000 0x1000>;
                                status = "disabled";
                        };
                };
index 6192521..c76abe7 100644 (file)
@@ -48,7 +48,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin>;
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm6350_gpios 2 GPIO_ACTIVE_LOW>;
 };
 
 &pm6350_gpios {
-       gpio_keys_pin: gpio-keys-pin {
+       gpio_keys_pin: gpio-keys-state {
                pins = "gpio2";
                function = PMIC_GPIO_FUNC_NORMAL;
                bias-pull-up;
index 37ddca0..3331ee9 100644 (file)
                vin-supply = <&vph_pwr>;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               vol-up {
+               key-vol-up {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
index a73317e..bb278ec 100644 (file)
                vin-supply = <&vph_pwr>;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               vol_up {
+               key-vol-up {
                        label = "Volume Up";
                        gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
index 8ea44c4..7d509ec 100644 (file)
                };
        };
 
-       cpu0_opp_table: cpu0_opp_table {
+       cpu0_opp_table: opp-table-cpu0 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu4_opp_table: cpu4_opp_table {
+       cpu4_opp_table: opp-table-cpu4 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu7_opp_table: cpu7_opp_table {
+       cpu7_opp_table: opp-table-cpu7 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
 
                gmu: gmu@2c6a000 {
-                       compatible="qcom,adreno-gmu-640.1", "qcom,adreno-gmu";
+                       compatible = "qcom,adreno-gmu-640.1", "qcom,adreno-gmu";
 
                        reg = <0 0x02c6a000 0 0x30000>,
                              <0 0x0b290000 0 0x10000>,
                        };
                };
 
-               sdhc_2: sdhci@8804000 {
+               sdhc_2: mmc@8804000 {
                        compatible = "qcom,sm8150-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x08804000 0 0x1000>;
 
 
                        status = "disabled";
 
-                       sdhc2_opp_table: sdhc2-opp-table {
+                       sdhc2_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-19200000 {
                };
 
                aoss_qmp: power-controller@c300000 {
-                       compatible = "qcom,sm8150-aoss-qmp";
+                       compatible = "qcom,sm8150-aoss-qmp", "qcom,aoss-qmp";
                        reg = <0x0 0x0c300000 0x0 0x400>;
                        interrupts = <GIC_SPI 389 IRQ_TYPE_EDGE_RISING>;
                        mboxes = <&apss_shared 0>;
                };
 
                timer@17c20000 {
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0x0 0x17c20000 0x0 0x1000>;
                        clock-frequency = <19200000>;
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c21000 0x0 0x1000>,
-                                     <0x0 0x17c22000 0x0 0x1000>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
                        };
 
                        frame@17c23000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c23000 0x0 0x1000>;
+                               reg = <0x17c23000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c25000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c25000 0x0 0x1000>;
+                               reg = <0x17c25000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c27000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c26000 0x0 0x1000>;
+                               reg = <0x17c26000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c29000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c29000 0x0 0x1000>;
+                               reg = <0x17c29000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2b000 0x0 0x1000>;
+                               reg = <0x17c2b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2d000 0x0 0x1000>;
+                               reg = <0x17c2d000 0x1000>;
                                status = "disabled";
                        };
                };
index 3b08247..632e981 100644 (file)
                vin-supply = <&vph_pwr>;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               vol-up {
+               key-vol-up {
                        label = "Volume Up";
                        linux,code = <KEY_VOLUMEUP>;
                        gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
index e819b5b..549e0a2 100644 (file)
@@ -57,7 +57,7 @@
                 * case, they are both on &pm8150b_gpios: camera focus(2), camera snapshot(1).
                 */
 
-               vol-down {
+               key-vol-down {
                        label = "Volume Down";
                        linux,code = <KEY_VOLUMEDOWN>;
                        gpios = <&pm8150_gpios 1 GPIO_ACTIVE_LOW>;
index cf0c97b..92fb49b 100644 (file)
@@ -8,6 +8,8 @@
 #include <dt-bindings/clock/qcom,gcc-sm8250.h>
 #include <dt-bindings/clock/qcom,gpucc-sm8250.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sm8250-lpass-aoncc.h>
+#include <dt-bindings/clock/qcom,sm8250-lpass-audiocc.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interconnect/qcom,osm-l3.h>
                };
        };
 
-       cpu0_opp_table: cpu0_opp_table {
+       cpu0_opp_table: opp-table-cpu0 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu4_opp_table: cpu4_opp_table {
+       cpu4_opp_table: opp-table-cpu4 {
                compatible = "operating-points-v2";
                opp-shared;
 
                };
        };
 
-       cpu7_opp_table: cpu7_opp_table {
+       cpu7_opp_table: opp-table-cpu7 {
                compatible = "operating-points-v2";
                opp-shared;
 
 
        firmware {
                scm: scm {
-                       compatible = "qcom,scm";
+                       compatible = "qcom,scm-sm8250", "qcom,scm";
                        #reset-cells = <1>;
                };
        };
                };
        };
 
+       qup_opp_table: opp-table-qup {
+               compatible = "operating-points-v2";
+
+               opp-50000000 {
+                       opp-hz = /bits/ 64 <50000000>;
+                       required-opps = <&rpmhpd_opp_min_svs>;
+               };
+
+               opp-75000000 {
+                       opp-hz = /bits/ 64 <75000000>;
+                       required-opps = <&rpmhpd_opp_low_svs>;
+               };
+
+               opp-120000000 {
+                       opp-hz = /bits/ 64 <120000000>;
+                       required-opps = <&rpmhpd_opp_svs>;
+               };
+       };
+
        reserved-memory {
                #address-cells = <2>;
                #size-cells = <2>;
                        clock-names = "core";
                };
 
-               qup_opp_table: qup-opp-table {
-                       compatible = "operating-points-v2";
-
-                       opp-50000000 {
-                               opp-hz = /bits/ 64 <50000000>;
-                               required-opps = <&rpmhpd_opp_min_svs>;
-                       };
-
-                       opp-75000000 {
-                               opp-hz = /bits/ 64 <75000000>;
-                               required-opps = <&rpmhpd_opp_low_svs>;
-                       };
-
-                       opp-120000000 {
-                               opp-hz = /bits/ 64 <120000000>;
-                               required-opps = <&rpmhpd_opp_svs>;
-                       };
-               };
-
                gpi_dma2: dma-controller@800000 {
                        compatible = "qcom,sm8250-gpi-dma";
                        reg = <0 0x00800000 0 0x70000>;
                                clock-names = "pipe0";
 
                                #phy-cells = <0>;
+
+                               #clock-cells = <0>;
                                clock-output-names = "pcie_0_pipe_clk";
                        };
                };
                                clock-names = "pipe0";
 
                                #phy-cells = <0>;
+
+                               #clock-cells = <0>;
                                clock-output-names = "pcie_1_pipe_clk";
                        };
                };
                                clock-names = "pipe0";
 
                                #phy-cells = <0>;
+
+                               #clock-cells = <0>;
                                clock-output-names = "pcie_2_pipe_clk";
                        };
                };
                wsamacro: codec@3240000 {
                        compatible = "qcom,sm8250-lpass-wsa-macro";
                        reg = <0 0x03240000 0 0x1000>;
-                       clocks = <&audiocc 1>,
-                                <&audiocc 0>,
+                       clocks = <&audiocc LPASS_CDC_WSA_MCLK>,
+                                <&audiocc LPASS_CDC_WSA_NPL>,
                                 <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
                                 <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
-                                <&aoncc 0>,
+                                <&aoncc LPASS_CDC_VA_MCLK>,
                                 <&vamacro>;
 
                        clock-names = "mclk", "npl", "macro", "dcodec", "va", "fsgen";
                vamacro: codec@3370000 {
                        compatible = "qcom,sm8250-lpass-va-macro";
                        reg = <0 0x03370000 0 0x1000>;
-                       clocks = <&aoncc 0>,
+                       clocks = <&aoncc LPASS_CDC_VA_MCLK>,
                                <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
                                <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>;
 
                };
 
                gmu: gmu@3d6a000 {
-                       compatible="qcom,adreno-gmu-650.2", "qcom,adreno-gmu";
+                       compatible = "qcom,adreno-gmu-650.2", "qcom,adreno-gmu";
 
                        reg = <0 0x03d6a000 0 0x30000>,
                              <0 0x3de0000 0 0x10000>,
                };
 
                adreno_smmu: iommu@3da0000 {
-                       compatible = "qcom,sm8250-smmu-500", "arm,mmu-500";
+                       compatible = "qcom,sm8250-smmu-500", "qcom,adreno-smmu", "arm,mmu-500";
                        reg = <0 0x03da0000 0 0x10000>;
                        #iommu-cells = <2>;
                        #global-interrupts = <2>;
                        };
                };
 
-               sdhc_2: sdhci@8804000 {
+               sdhc_2: mmc@8804000 {
                        compatible = "qcom,sm8250-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0 0x08804000 0 0x1000>;
 
 
                        status = "disabled";
 
-                       sdhc2_opp_table: sdhc2-opp-table {
+                       sdhc2_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-19200000 {
                                compatible = "venus-encoder";
                        };
 
-                       venus_opp_table: venus-opp-table {
+                       venus_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-720000000 {
                        clock-names = "iface", "bi_tcxo", "bi_tcxo_ao", "sleep_clk";
                        power-domains = <&rpmhpd SM8250_MMCX>;
                        required-opps = <&rpmhpd_opp_low_svs>;
+                       status = "disabled";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                        #power-domain-cells = <1>;
                                 <&dispcc DISP_CC_MDSS_MDP_CLK>;
                        clock-names = "iface", "bus", "nrt_bus", "core";
 
-                       assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>;
-                       assigned-clock-rates = <460000000>;
-
                        interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-controller;
                        #interrupt-cells = <1>;
                                         <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
                                clock-names = "iface", "bus", "core", "vsync";
 
-                               assigned-clocks = <&dispcc DISP_CC_MDSS_MDP_CLK>,
-                                                 <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
-                               assigned-clock-rates = <460000000>,
-                                                      <19200000>;
+                               assigned-clocks = <&dispcc DISP_CC_MDSS_VSYNC_CLK>;
+                               assigned-clock-rates = <19200000>;
 
                                operating-points-v2 = <&mdp_opp_table>;
                                power-domains = <&rpmhpd SM8250_MMCX>;
                                        };
                                };
 
-                               mdp_opp_table: mdp-opp-table {
+                               mdp_opp_table: opp-table {
                                        compatible = "operating-points-v2";
 
                                        opp-200000000 {
 
                                status = "disabled";
 
-                               dsi_opp_table: dsi-opp-table {
+                               dsi_opp_table: opp-table {
                                        compatible = "operating-points-v2";
 
                                        opp-187500000 {
                };
 
                aoss_qmp: power-controller@c300000 {
-                       compatible = "qcom,sm8250-aoss-qmp";
+                       compatible = "qcom,sm8250-aoss-qmp", "qcom,aoss-qmp";
                        reg = <0 0x0c300000 0 0x400>;
                        interrupts-extended = <&ipcc IPCC_CLIENT_AOP
                                                     IPCC_MPROC_SIGNAL_GLINK_QMP
                };
 
                timer@17c20000 {
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        compatible = "arm,armv7-timer-mem";
                        reg = <0x0 0x17c20000 0x0 0x1000>;
                        clock-frequency = <19200000>;
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c21000 0x0 0x1000>,
-                                     <0x0 0x17c22000 0x0 0x1000>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
                        };
 
                        frame@17c23000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c23000 0x0 0x1000>;
+                               reg = <0x17c23000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c25000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c25000 0x0 0x1000>;
+                               reg = <0x17c25000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c27000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c27000 0x0 0x1000>;
+                               reg = <0x17c27000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c29000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c29000 0x0 0x1000>;
+                               reg = <0x17c29000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2b000 0x0 0x1000>;
+                               reg = <0x17c2b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2d000 0x0 0x1000>;
+                               reg = <0x17c2d000 0x1000>;
                                status = "disabled";
                        };
                };
index 9a6faa9..9c4cfd9 100644 (file)
        status = "okay";
 
        vdda-phy-supply = <&vreg_l5b_0p88>;
-       vdda-max-microamp = <91600>;
        vdda-pll-supply = <&vreg_l6b_1p2>;
-       vdda-pll-max-microamp = <19000>;
 };
 
 &usb_1 {
index 90b13cb..cb9bbd2 100644 (file)
@@ -49,7 +49,7 @@
 
                /* For reasons still unknown, GAssist key and Camera Focus/Shutter don't work.. */
 
-               vol-down {
+               key-vol-down {
                        label = "Volume Down";
                        linux,code = <KEY_VOLUMEDOWN>;
                        gpios = <&pmk8350_gpios 3 GPIO_ACTIVE_LOW>;
index 743cba9..65c7fe5 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/qcom,dispcc-sm8350.h>
 #include <dt-bindings/clock/qcom,gcc-sm8350.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
 #include <dt-bindings/dma/qcom-gpi.h>
                };
        };
 
+       qup_opp_table_100mhz: opp-table-qup100mhz {
+               compatible = "operating-points-v2";
+
+               opp-50000000 {
+                       opp-hz = /bits/ 64 <50000000>;
+                       required-opps = <&rpmhpd_opp_min_svs>;
+               };
+
+               opp-75000000 {
+                       opp-hz = /bits/ 64 <75000000>;
+                       required-opps = <&rpmhpd_opp_low_svs>;
+               };
+
+               opp-100000000 {
+                       opp-hz = /bits/ 64 <100000000>;
+                       required-opps = <&rpmhpd_opp_svs>;
+               };
+       };
+
+       qup_opp_table_120mhz: opp-table-qup120mhz {
+               compatible = "operating-points-v2";
+
+               opp-50000000 {
+                       opp-hz = /bits/ 64 <50000000>;
+                       required-opps = <&rpmhpd_opp_min_svs>;
+               };
+
+               opp-75000000 {
+                       opp-hz = /bits/ 64 <75000000>;
+                       required-opps = <&rpmhpd_opp_low_svs>;
+               };
+
+               opp-120000000 {
+                       opp-hz = /bits/ 64 <120000000>;
+                       required-opps = <&rpmhpd_opp_svs>;
+               };
+       };
+
        reserved_memory: reserved-memory {
                #address-cells = <2>;
                #size-cells = <2>;
                        #mbox-cells = <2>;
                };
 
-               qup_opp_table_100mhz: qup-100mhz-opp-table {
-                       compatible = "operating-points-v2";
-
-                       opp-50000000 {
-                               opp-hz = /bits/ 64 <50000000>;
-                               required-opps = <&rpmhpd_opp_min_svs>;
-                       };
-
-                       opp-75000000 {
-                               opp-hz = /bits/ 64 <75000000>;
-                               required-opps = <&rpmhpd_opp_low_svs>;
-                       };
-
-                       opp-100000000 {
-                               opp-hz = /bits/ 64 <100000000>;
-                               required-opps = <&rpmhpd_opp_svs>;
-                       };
-               };
-
-               qup_opp_table_120mhz: qup-120mhz-opp-table {
-                       compatible = "operating-points-v2";
-
-                       opp-50000000 {
-                               opp-hz = /bits/ 64 <50000000>;
-                               required-opps = <&rpmhpd_opp_min_svs>;
-                       };
-
-                       opp-75000000 {
-                               opp-hz = /bits/ 64 <75000000>;
-                               required-opps = <&rpmhpd_opp_low_svs>;
-                       };
-
-                       opp-120000000 {
-                               opp-hz = /bits/ 64 <120000000>;
-                               required-opps = <&rpmhpd_opp_svs>;
-                       };
-               };
-
                gpi_dma2: dma-controller@800000 {
                        compatible = "qcom,sm8350-gpi-dma";
                        reg = <0 0x00800000 0 0x60000>;
                        clocks = <&rpmhcc RPMH_CXO_CLK>;
                        clock-names = "xo";
 
-                       power-domains = <&rpmhpd 0>,
-                                       <&rpmhpd 12>;
+                       power-domains = <&rpmhpd SM8350_CX>,
+                                       <&rpmhpd SM8350_MSS>;
                        power-domain-names = "cx", "mss";
 
                        interconnects = <&mc_virt MASTER_LLCC &mc_virt SLAVE_EBI1>;
                                                             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>;
                        };
                };
 
                aoss_qmp: power-controller@c300000 {
-                       compatible = "qcom,sm8350-aoss-qmp";
+                       compatible = "qcom,sm8350-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>;
 
                timer@17c20000 {
                        compatible = "arm,armv7-timer-mem";
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        reg = <0x0 0x17c20000 0x0 0x1000>;
                        clock-frequency = <19200000>;
 
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c21000 0x0 0x1000>,
-                                     <0x0 0x17c22000 0x0 0x1000>;
+                               reg = <0x17c21000 0x1000>,
+                                     <0x17c22000 0x1000>;
                        };
 
                        frame@17c23000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c23000 0x0 0x1000>;
+                               reg = <0x17c23000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c25000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c25000 0x0 0x1000>;
+                               reg = <0x17c25000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c27000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c27000 0x0 0x1000>;
+                               reg = <0x17c27000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c29000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c29000 0x0 0x1000>;
+                               reg = <0x17c29000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2b000 0x0 0x1000>;
+                               reg = <0x17c2b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17c2d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17c2d000 0x0 0x1000>;
+                               reg = <0x17c2d000 0x1000>;
                                status = "disabled";
                        };
                };
                                      <0 0x01d87800 0 0x108>,
                                      <0 0x01d87a00 0 0x1e0>;
                                #phy-cells = <0>;
-                               #clock-cells = <0>;
                        };
                };
 
                        clocks = <&rpmhcc RPMH_CXO_CLK>;
                        clock-names = "xo";
 
-                       power-domains = <&rpmhpd 4>,
-                                       <&rpmhpd 5>;
+                       power-domains = <&rpmhpd SM8350_LCX>,
+                                       <&rpmhpd SM8350_LMX>;
                        power-domain-names = "lcx", "lmx";
 
                        memory-region = <&pil_slpi_mem>;
                        clocks = <&rpmhcc RPMH_CXO_CLK>;
                        clock-names = "xo";
 
-                       power-domains = <&rpmhpd 0>,
-                                       <&rpmhpd 10>;
+                       power-domains = <&rpmhpd SM8350_CX>,
+                                       <&rpmhpd SM8350_MXC>;
                        power-domain-names = "cx", "mxc";
 
                        interconnects = <&compute_noc MASTER_CDSP_PROC &mc_virt SLAVE_EBI1>;
                                      <0 0x088e9800 0 0x200>,
                                      <0 0x088e9a00 0 0x100>;
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "usb3_phy_pipe_clk_src";
                                      <0 0x088ec000 0 0x200>,
                                      <0 0x088eb200 0 0x1100>;
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "usb3_uni_phy_pipe_clk_src";
                        };
                };
 
+               dispcc: clock-controller@af00000 {
+                       compatible = "qcom,sm8350-dispcc";
+                       reg = <0 0x0af00000 0 0x10000>;
+                       clocks = <&rpmhcc RPMH_CXO_CLK>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>,
+                                <0>;
+                       clock-names = "bi_tcxo",
+                                     "dsi0_phy_pll_out_byteclk",
+                                     "dsi0_phy_pll_out_dsiclk",
+                                     "dsi1_phy_pll_out_byteclk",
+                                     "dsi1_phy_pll_out_dsiclk",
+                                     "dp_phy_pll_link_clk",
+                                     "dp_phy_pll_vco_div_clk";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       #power-domain-cells = <1>;
+
+                       power-domains = <&rpmhpd SM8350_MMCX>;
+                       power-domain-names = "mmcx";
+               };
+
                adsp: remoteproc@17300000 {
                        compatible = "qcom,sm8350-adsp-pas";
                        reg = <0 0x17300000 0 0x100>;
                        clocks = <&rpmhcc RPMH_CXO_CLK>;
                        clock-names = "xo";
 
-                       power-domains = <&rpmhpd 4>,
-                                       <&rpmhpd 5>;
+                       power-domains = <&rpmhpd SM8350_LCX>,
+                                       <&rpmhpd SM8350_LMX>;
                        power-domain-names = "lcx", "lmx";
 
                        memory-region = <&pil_adsp_mem>;
index 4e51a9d..38ccd44 100644 (file)
 
        vdda-phy-supply = <&vreg_l5b_0p88>;
        vdda-pll-supply = <&vreg_l6b_1p2>;
-       vdda-max-microamp = <173000>;
-       vdda-pll-max-microamp = <24900>;
 };
 
 &usb_1 {
index 236e539..e58fc73 100644 (file)
 
        vdda-phy-supply = <&vreg_l5b_0p88>;
        vdda-pll-supply = <&vreg_l6b_1p2>;
-       vdda-max-microamp = <173000>;
-       vdda-pll-max-microamp = <24900>;
 };
 
 &usb_1 {
index 7d08fad..4978c5b 100644 (file)
@@ -6,6 +6,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,gcc-sm8450.h>
 #include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sm8450-camcc.h>
 #include <dt-bindings/dma/qcom-gpi.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/mailbox/qcom-ipcc.h>
        firmware {
                scm: scm {
                        compatible = "qcom,scm-sm8450", "qcom,scm";
+                       interconnects = <&aggre2_noc MASTER_CRYPTO 0 &mc_virt SLAVE_EBI1 0>;
                        #reset-cells = <1>;
                };
        };
 
-       clk_virt: interconnect@0 {
+       clk_virt: interconnect-0 {
                compatible = "qcom,sm8450-clk-virt";
                #interconnect-cells = <2>;
                qcom,bcm-voters = <&apps_bcm_voter>;
        };
 
-       mc_virt: interconnect@1 {
+       mc_virt: interconnect-1 {
                compatible = "qcom,sm8450-mc-virt";
                #interconnect-cells = <2>;
                qcom,bcm-voters = <&apps_bcm_voter>;
                };
        };
 
-       qup_opp_table_100mhz: qup-100mhz-opp-table {
+       qup_opp_table_100mhz: opp-table-qup {
                compatible = "operating-points-v2";
 
                opp-50000000 {
                                status = "disabled";
                        };
 
+                       uart20: serial@894000 {
+                               compatible = "qcom,geni-uart";
+                               reg = <0 0x00894000 0 0x4000>;
+                               clock-names = "se";
+                               clocks = <&gcc GCC_QUPV3_WRAP2_S5_CLK>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&qup_uart20_default>;
+                               interrupts = <GIC_SPI 587 IRQ_TYPE_LEVEL_HIGH>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               status = "disabled";
+                       };
+
                        spi20: spi@894000 {
                                compatible = "qcom,geni-spi";
                                reg = <0 0x00894000 0 0x4000>;
                                      <0 0x088e9800 0 0x200>,
                                      <0 0x088e9a00 0 0x100>;
                                #phy-cells = <0>;
-                               #clock-cells = <1>;
+                               #clock-cells = <0>;
                                clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
                                clock-names = "pipe0";
                                clock-output-names = "usb3_phy_pipe_clk_src";
                        compatible = "qcom,sm8450-slpi-pas";
                        reg = <0 0x02400000 0 0x4000>;
 
-                       interrupts-extended = <&pdc 9 IRQ_TYPE_LEVEL_HIGH>,
+                       interrupts-extended = <&pdc 9 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_slpi_in 0 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_slpi_in 1 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_slpi_in 2 IRQ_TYPE_EDGE_RISING>,
                        compatible = "qcom,sm8450-adsp-pas";
                        reg = <0 0x030000000 0 0x100>;
 
-                       interrupts-extended = <&pdc 6 IRQ_TYPE_LEVEL_HIGH>,
+                       interrupts-extended = <&pdc 6 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_adsp_in 1 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_adsp_in 2 IRQ_TYPE_EDGE_RISING>,
                        compatible = "qcom,sm8450-cdsp-pas";
                        reg = <0 0x032300000 0 0x1400000>;
 
-                       interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_LEVEL_HIGH>,
+                       interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_cdsp_in 0 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_cdsp_in 1 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_cdsp_in 2 IRQ_TYPE_EDGE_RISING>,
                        compatible = "qcom,sm8450-mpss-pas";
                        reg = <0x0 0x04080000 0x0 0x4040>;
 
-                       interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>,
+                       interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_modem_in 0 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_modem_in 1 IRQ_TYPE_EDGE_RISING>,
                                              <&smp2p_modem_in 2 IRQ_TYPE_EDGE_RISING>,
                                                             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>;
                        };
                };
 
+               camcc: clock-controller@ade0000 {
+                       compatible = "qcom,sm8450-camcc";
+                       reg = <0 0x0ade0000 0 0x20000>;
+                       clocks = <&gcc GCC_CAMERA_AHB_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK>,
+                                <&rpmhcc RPMH_CXO_CLK_A>,
+                                <&sleep_clk>;
+                       power-domains = <&rpmhpd SM8450_MMCX>;
+                       required-opps = <&rpmhpd_opp_low_svs>;
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+                       #power-domain-cells = <1>;
+                       status = "disabled";
+               };
+
                pdc: interrupt-controller@b220000 {
                        compatible = "qcom,sm8450-pdc", "qcom,pdc";
                        reg = <0 0x0b220000 0 0x30000>, <0 0x174000f0 0 0x64>;
                                drive-strength = <2>;
                                bias-disable;
                        };
+
+                       qup_uart20_default: qup-uart20-default {
+                               pins = "gpio76", "gpio77", "gpio78", "gpio79";
+                               function = "qup20";
+                       };
+
                };
 
                apps_smmu: iommu@15000000 {
                        reg = <0x0 0x17100000 0x0 0x10000>,     /* GICD */
                              <0x0 0x17180000 0x0 0x200000>;    /* GICR * 8 */
                        interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       ranges;
+
+                       gic_its: msi-controller@17140000 {
+                               compatible = "arm,gic-v3-its";
+                               reg = <0x0 0x17140000 0x0 0x20000>;
+                               msi-controller;
+                               #msi-cells = <1>;
+                       };
                };
 
                timer@17420000 {
                        compatible = "arm,armv7-timer-mem";
-                       #address-cells = <2>;
-                       #size-cells = <2>;
-                       ranges;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0 0 0x20000000>;
                        reg = <0x0 0x17420000 0x0 0x1000>;
                        clock-frequency = <19200000>;
 
                                frame-number = <0>;
                                interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
                                             <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17421000 0x0 0x1000>,
-                                     <0x0 0x17422000 0x0 0x1000>;
+                               reg = <0x17421000 0x1000>,
+                                     <0x17422000 0x1000>;
                        };
 
                        frame@17423000 {
                                frame-number = <1>;
                                interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17423000 0x0 0x1000>;
+                               reg = <0x17423000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17425000 {
                                frame-number = <2>;
                                interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17425000 0x0 0x1000>;
+                               reg = <0x17425000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17427000 {
                                frame-number = <3>;
                                interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17427000 0x0 0x1000>;
+                               reg = <0x17427000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@17429000 {
                                frame-number = <4>;
                                interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x17429000 0x0 0x1000>;
+                               reg = <0x17429000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@1742b000 {
                                frame-number = <5>;
                                interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x1742b000 0x0 0x1000>;
+                               reg = <0x1742b000 0x1000>;
                                status = "disabled";
                        };
 
                        frame@1742d000 {
                                frame-number = <6>;
                                interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-                               reg = <0x0 0x1742d000 0x0 0x1000>;
+                               reg = <0x1742d000 0x1000>;
                                status = "disabled";
                        };
                };
 
                        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>;
+                       interconnects = <&aggre1_noc MASTER_UFS_MEM 0 &mc_virt SLAVE_EBI1 0>,
+                                       <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_UFS_MEM_CFG 0>;
                        interconnect-names = "ufs-ddr", "cpu-ufs";
                        clock-names =
                                "core_clk",
                                      <0 0x01d87800 0 0x108>,
                                      <0 0x01d87a00 0 0x1e0>;
                                #phy-cells = <0>;
-                               #clock-cells = <0>;
                        };
                };
 
index e66d76d..7a64786 100644 (file)
@@ -85,3 +85,6 @@ dtb-$(CONFIG_ARCH_R9A07G044) += r9a07g044l2-smarc.dtb
 dtb-$(CONFIG_ARCH_R9A07G054) += r9a07g054l2-smarc.dtb
 
 dtb-$(CONFIG_ARCH_R9A09G011) += r9a09g011-v2mevk2.dtb
+
+dtb-$(CONFIG_ARCH_RCAR_GEN3) += draak-ebisu-panel-aa104xd12.dtbo
+dtb-$(CONFIG_ARCH_RCAR_GEN3) += salvator-panel-aa104xd12.dtbo
index 142e7ff..63e7a39 100644 (file)
                };
        };
 
-       reg_audio: regulator_audio {
+       reg_audio: regulator-audio {
                compatible = "regulator-fixed";
                regulator-name = "audio-1.8V";
                regulator-min-microvolt = <1800000>;
                vin-supply = <&reg_lcd>;
        };
 
-       reg_cam0: regulator_camera {
+       reg_cam0: regulator-cam0 {
                compatible = "regulator-fixed";
                regulator-name = "reg_cam0";
                regulator-min-microvolt = <1800000>;
                enable-active-high;
        };
 
-       reg_cam1: regulator_camera {
+       reg_cam1: regulator-cam1 {
                compatible = "regulator-fixed";
                regulator-name = "reg_cam1";
                regulator-min-microvolt = <1800000>;
index 877d076..f5c1d74 100644 (file)
@@ -20,7 +20,7 @@
                clock-output-names = "osc_32k";
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
@@ -29,7 +29,7 @@
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
diff --git a/arch/arm64/boot/dts/renesas/draak-ebisu-panel-aa104xd12.dts b/arch/arm64/boot/dts/renesas/draak-ebisu-panel-aa104xd12.dts
new file mode 100644 (file)
index 0000000..258f866
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree overlay for the AA104XD12 panel connected to LVDS1 on a Draak or
+ * Ebisu board
+ *
+ * Copyright 2021 Ideas on Board Oy
+ */
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+#include "panel-aa104xd12.dtsi"
+};
+
+&{/panel} {
+       backlight = <&backlight>;
+
+       port {
+               panel_in: endpoint {
+                       remote-endpoint = <&lvds1_out>;
+               };
+       };
+};
+
+&lvds1 {
+       status = "okay";
+
+       ports {
+               port@1 {
+                       lvds1_out: endpoint {
+                               remote-endpoint = <&panel_in>;
+                       };
+               };
+       };
+};
index 7231f82..ef3bb83 100644 (file)
                                bitclock-master = <&rsnd_for_ak4613>;
                                frame-master = <&rsnd_for_ak4613>;
                                playback = <&ssi3>, <&src5>, <&dvc0>;
-                               capture  = <&ssi4>, <&src6>, <&dvc1>;
+                               capture = <&ssi4>, <&src6>, <&dvc1>;
                        };
                };
        };
index 72f359e..8fc0349 100644 (file)
                reg = <0x0 0x48000000 0x0 0x38000000>;
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
                regulator-always-on;
        };
 
-       reg_12p0v: regulator2 {
+       reg_12p0v: regulator-12p0v {
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;
        rcar_sound,dai {
                dai0 {
                        playback = <&ssi0>, <&src0>, <&dvc0>;
-                       capture  = <&ssi1>, <&src1>, <&dvc1>;
+                       capture = <&ssi1>, <&src1>, <&dvc1>;
                };
        };
 
index 935d065..b062f41 100644 (file)
@@ -53,7 +53,7 @@
                };
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
@@ -62,7 +62,7 @@
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
diff --git a/arch/arm64/boot/dts/renesas/panel-aa104xd12.dtsi b/arch/arm64/boot/dts/renesas/panel-aa104xd12.dtsi
new file mode 100644 (file)
index 0000000..4b1f098
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Common file for the AA104XD12 panel connected to Renesas R-Car Gen3 boards.
+ *
+ * Copyright (C) 2014 Renesas Electronics Corp.
+ */
+
+panel {
+       compatible = "mitsubishi,aa104xd12", "panel-lvds";
+
+       width-mm = <210>;
+       height-mm = <158>;
+       data-mapping = "jeida-18";
+
+       panel-timing {
+               /* 1024x768 @65Hz */
+               clock-frequency = <65000000>;
+               hactive = <1024>;
+               vactive = <768>;
+               hsync-len = <136>;
+               hfront-porch = <20>;
+               hback-porch = <160>;
+               vfront-porch = <3>;
+               vback-porch = <29>;
+               vsync-len = <6>;
+       };
+
+       port {
+       };
+};
index b6aeb22..c563d26 100644 (file)
 
                                        vin4csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin4>;
+                                               remote-endpoint = <&csi40vin4>;
                                        };
                                };
                        };
 
                                        vin5csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin5>;
+                                               remote-endpoint = <&csi40vin5>;
                                        };
                                };
                        };
                cpu-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <0>;
-                       thermal-sensors = <&thermal 0>;
+                       thermal-sensors = <&thermal>;
                        sustainable-power = <717>;
 
                        cooling-maps {
index d330212..565e9d8 100644 (file)
 
                                        vin4csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin4>;
+                                               remote-endpoint = <&csi40vin4>;
                                        };
                                };
                        };
 
                                        vin5csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin5>;
+                                               remote-endpoint = <&csi40vin5>;
                                        };
                                };
                        };
                cpu-thermal {
                        polling-delay-passive = <250>;
                        polling-delay = <0>;
-                       thermal-sensors = <&thermal 0>;
+                       thermal-sensors = <&thermal>;
                        sustainable-power = <717>;
 
                        cooling-maps {
index b973150..3d66870 100644 (file)
@@ -41,6 +41,7 @@
                        device_type = "cpu";
                        power-domains = <&sysc R8A779A0_PD_A1E0D0C0>;
                        next-level-cache = <&L3_CA76_0>;
+                       clocks = <&cpg CPG_CORE R8A779A0_CLK_Z0>;
                };
 
                L3_CA76_0: cache-controller-0 {
                };
 
                gpio0: gpio@e6058180 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6058180 0 0x54>;
                        interrupts = <GIC_SPI 832 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 916>;
                };
 
                gpio1: gpio@e6050180 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6050180 0 0x54>;
                        interrupts = <GIC_SPI 836 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 915>;
                };
 
                gpio2: gpio@e6050980 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6050980 0 0x54>;
                        interrupts = <GIC_SPI 840 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 915>;
                };
 
                gpio3: gpio@e6058980 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6058980 0 0x54>;
                        interrupts = <GIC_SPI 844 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 916>;
                };
 
                gpio4: gpio@e6060180 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6060180 0 0x54>;
                        interrupts = <GIC_SPI 848 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 917>;
                };
 
                gpio5: gpio@e6060980 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6060980 0 0x54>;
                        interrupts = <GIC_SPI 852 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 917>;
                };
 
                gpio6: gpio@e6068180 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6068180 0 0x54>;
                        interrupts = <GIC_SPI 856 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                };
 
                gpio7: gpio@e6068980 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6068980 0 0x54>;
                        interrupts = <GIC_SPI 860 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                };
 
                gpio8: gpio@e6069180 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6069180 0 0x54>;
                        interrupts = <GIC_SPI 864 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
                };
 
                gpio9: gpio@e6069980 {
-                       compatible = "renesas,gpio-r8a779a0";
+                       compatible = "renesas,gpio-r8a779a0",
+                                    "renesas,rcar-gen4-gpio";
                        reg = <0 0xe6069980 0 0x54>;
                        interrupts = <GIC_SPI 868 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 918>;
index 41aa859..28fbf7b 100644 (file)
                function = "i2c4";
        };
 
+       scif0_pins: scif0 {
+               groups = "scif0_data", "scif0_ctrl";
+               function = "scif0";
+       };
+
        scif3_pins: scif3 {
                groups = "scif3_data", "scif3_ctrl";
                function = "scif3";
        status = "okay";
 };
 
+&scif0 {
+       pinctrl-0 = <&scif0_pins>;
+       pinctrl-names = "default";
+
+       uart-has-rtscts;
+       status = "okay";
+};
+
 &scif3 {
        pinctrl-0 = <&scif3_pins>;
        pinctrl-names = "default";
index 2e3b719..7a7c8ff 100644 (file)
@@ -15,6 +15,7 @@
 
        aliases {
                serial0 = &scif3;
+               serial1 = &scif0;
        };
 
        chosen {
index df46fb8..384817f 100644 (file)
                #address-cells = <1>;
                #size-cells = <0>;
 
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&a55_0>;
+                               };
+                               core1 {
+                                       cpu = <&a55_1>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&a55_2>;
+                               };
+                               core1 {
+                                       cpu = <&a55_3>;
+                               };
+                       };
+
+                       cluster2 {
+                               core0 {
+                                       cpu = <&a55_4>;
+                               };
+                               core1 {
+                                       cpu = <&a55_5>;
+                               };
+                       };
+
+                       cluster3 {
+                               core0 {
+                                       cpu = <&a55_6>;
+                               };
+                               core1 {
+                                       cpu = <&a55_7>;
+                               };
+                       };
+               };
+
                a55_0: cpu@0 {
                        compatible = "arm,cortex-a55";
                        reg = <0>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A779F0_PD_A1E0D0C0>;
+                       next-level-cache = <&L3_CA55_0>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>;
+               };
+
+               a55_1: cpu@100 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x100>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E0D0C1>;
+                       next-level-cache = <&L3_CA55_0>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>;
+               };
+
+               a55_2: cpu@10000 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x10000>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E0D1C0>;
+                       next-level-cache = <&L3_CA55_1>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>;
+               };
+
+               a55_3: cpu@10100 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x10100>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E0D1C1>;
+                       next-level-cache = <&L3_CA55_1>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z0>;
+               };
+
+               a55_4: cpu@20000 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x20000>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E1D0C0>;
+                       next-level-cache = <&L3_CA55_2>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>;
+               };
+
+               a55_5: cpu@20100 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x20100>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E1D0C1>;
+                       next-level-cache = <&L3_CA55_2>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>;
+               };
+
+               a55_6: cpu@30000 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x30000>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E1D1C0>;
+                       next-level-cache = <&L3_CA55_3>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>;
+               };
+
+               a55_7: cpu@30100 {
+                       compatible = "arm,cortex-a55";
+                       reg = <0x30100>;
+                       device_type = "cpu";
+                       power-domains = <&sysc R8A779F0_PD_A1E1D1C1>;
+                       next-level-cache = <&L3_CA55_3>;
+                       enable-method = "psci";
+                       cpu-idle-states = <&CPU_SLEEP_0>;
+                       clocks = <&cpg CPG_CORE R8A779F0_CLK_Z1>;
+               };
+
+               L3_CA55_0: cache-controller-0 {
+                       compatible = "cache";
+                       power-domains = <&sysc R8A779F0_PD_A2E0D0>;
+                       cache-unified;
+                       cache-level = <3>;
+               };
+
+               L3_CA55_1: cache-controller-1 {
+                       compatible = "cache";
+                       power-domains = <&sysc R8A779F0_PD_A2E0D1>;
+                       cache-unified;
+                       cache-level = <3>;
+               };
+
+               L3_CA55_2: cache-controller-2 {
+                       compatible = "cache";
+                       power-domains = <&sysc R8A779F0_PD_A2E1D0>;
+                       cache-unified;
+                       cache-level = <3>;
+               };
+
+               L3_CA55_3: cache-controller-3 {
+                       compatible = "cache";
+                       power-domains = <&sysc R8A779F0_PD_A2E1D1>;
+                       cache-unified;
+                       cache-level = <3>;
+               };
+
+               idle-states {
+                       entry-method = "psci";
+
+                       CPU_SLEEP_0: cpu-sleep-0 {
+                               compatible = "arm,idle-state";
+                               arm,psci-suspend-param = <0x0010000>;
+                               local-timer-stop;
+                               entry-latency-us = <400>;
+                               exit-latency-us = <500>;
+                               min-residency-us = <4000>;
+                       };
                };
        };
 
                interrupts-extended = <&gic GIC_PPI 7 IRQ_TYPE_LEVEL_LOW>;
        };
 
+       psci {
+               compatible = "arm,psci-1.0", "arm,psci-0.2";
+               method = "smc";
+       };
+
        /* External SCIF clock - to be overridden by boards that provide it */
        scif_clk: scif {
                compatible = "fixed-clock";
                        #power-domain-cells = <1>;
                };
 
+               tsc: thermal@e6198000 {
+                       compatible = "renesas,r8a779f0-thermal";
+                       /* The 4th sensor is in control domain and not for Linux */
+                       reg = <0 0xe6198000 0 0x200>,
+                             <0 0xe61a0000 0 0x200>,
+                             <0 0xe61a8000 0 0x200>;
+                       clocks = <&cpg CPG_MOD 919>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 919>;
+                       #thermal-sensor-cells = <1>;
+               };
+
                i2c0: i2c@e6500000 {
                        compatible = "renesas,i2c-r8a779f0",
                                     "renesas,rcar-gen4-i2c";
                        status = "disabled";
                };
 
+               hscif0: serial@e6540000 {
+                       compatible = "renesas,hscif-r8a779f0",
+                                    "renesas,rcar-gen4-hscif", "renesas,hscif";
+                       reg = <0 0xe6540000 0 0x60>;
+                       interrupts = <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 514>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x31>, <&dmac0 0x30>,
+                              <&dmac1 0x31>, <&dmac1 0x30>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 514>;
+                       status = "disabled";
+               };
+
+               hscif1: serial@e6550000 {
+                       compatible = "renesas,hscif-r8a779f0",
+                                    "renesas,rcar-gen4-hscif", "renesas,hscif";
+                       reg = <0 0xe6550000 0 0x60>;
+                       interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 515>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x33>, <&dmac0 0x32>,
+                              <&dmac1 0x33>, <&dmac1 0x32>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 515>;
+                       status = "disabled";
+               };
+
+               hscif2: serial@e6560000 {
+                       compatible = "renesas,hscif-r8a779f0",
+                                    "renesas,rcar-gen4-hscif", "renesas,hscif";
+                       reg = <0 0xe6560000 0 0x60>;
+                       interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 516>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x35>, <&dmac0 0x34>,
+                              <&dmac1 0x35>, <&dmac1 0x34>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 516>;
+                       status = "disabled";
+               };
+
+               hscif3: serial@e66a0000 {
+                       compatible = "renesas,hscif-r8a779f0",
+                                    "renesas,rcar-gen4-hscif", "renesas,hscif";
+                       reg = <0 0xe66a0000 0 0x60>;
+                       interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 517>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x37>, <&dmac0 0x36>,
+                              <&dmac1 0x37>, <&dmac1 0x36>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 517>;
+                       status = "disabled";
+               };
+
+               ufs: ufs@e6860000 {
+                       compatible = "renesas,r8a779f0-ufs";
+                       reg = <0 0xe6860000 0 0x100>;
+                       interrupts = <GIC_SPI 235 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 1514>, <&ufs30_clk>;
+                       clock-names = "fck", "ref_clk";
+                       freq-table-hz = <200000000 200000000>, <38400000 38400000>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 1514>;
+                       status = "disabled";
+               };
+
+               scif0: serial@e6e60000 {
+                       compatible = "renesas,scif-r8a779f0",
+                                    "renesas,rcar-gen4-scif", "renesas,scif";
+                       reg = <0 0xe6e60000 0 64>;
+                       interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 702>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3_PER>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x51>, <&dmac0 0x50>,
+                              <&dmac1 0x51>, <&dmac1 0x50>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 702>;
+                       status = "disabled";
+               };
+
+               scif1: serial@e6e68000 {
+                       compatible = "renesas,scif-r8a779f0",
+                                    "renesas,rcar-gen4-scif", "renesas,scif";
+                       reg = <0 0xe6e68000 0 64>;
+                       interrupts = <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 703>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3_PER>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x53>, <&dmac0 0x52>,
+                              <&dmac1 0x53>, <&dmac1 0x52>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 703>;
+                       status = "disabled";
+               };
+
                scif3: serial@e6c50000 {
                        compatible = "renesas,scif-r8a779f0",
                                     "renesas,rcar-gen4-scif", "renesas,scif";
                                 <&cpg CPG_CORE R8A779F0_CLK_S0D3_PER>,
                                 <&scif_clk>;
                        clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x57>, <&dmac0 0x56>,
+                              <&dmac1 0x57>, <&dmac1 0x56>;
+                       dma-names = "tx", "rx", "tx", "rx";
                        power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
                        resets = <&cpg 704>;
                        status = "disabled";
                };
 
+               scif4: serial@e6c40000 {
+                       compatible = "renesas,scif-r8a779f0",
+                                    "renesas,rcar-gen4-scif", "renesas,scif";
+                       reg = <0 0xe6c40000 0 64>;
+                       interrupts = <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 705>,
+                                <&cpg CPG_CORE R8A779F0_CLK_S0D3_PER>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x59>, <&dmac0 0x58>,
+                              <&dmac1 0x59>, <&dmac1 0x58>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       resets = <&cpg 705>;
+                       status = "disabled";
+               };
+
                dmac0: dma-controller@e7350000 {
                        compatible = "renesas,dmac-r8a779f0",
                                     "renesas,rcar-gen4-dmac";
                        resets = <&cpg 709>;
                        #dma-cells = <1>;
                        dma-channels = <16>;
+                       iommus = <&ipmmu_ds0 0>, <&ipmmu_ds0 1>,
+                                <&ipmmu_ds0 2>, <&ipmmu_ds0 3>,
+                                <&ipmmu_ds0 4>, <&ipmmu_ds0 5>,
+                                <&ipmmu_ds0 6>, <&ipmmu_ds0 7>,
+                                <&ipmmu_ds0 8>, <&ipmmu_ds0 9>,
+                                <&ipmmu_ds0 10>, <&ipmmu_ds0 11>,
+                                <&ipmmu_ds0 12>, <&ipmmu_ds0 13>,
+                                <&ipmmu_ds0 14>, <&ipmmu_ds0 15>;
                };
 
                dmac1: dma-controller@e7351000 {
                        resets = <&cpg 710>;
                        #dma-cells = <1>;
                        dma-channels = <16>;
+                       iommus = <&ipmmu_ds0 16>, <&ipmmu_ds0 17>,
+                                <&ipmmu_ds0 18>, <&ipmmu_ds0 19>,
+                                <&ipmmu_ds0 20>, <&ipmmu_ds0 21>,
+                                <&ipmmu_ds0 22>, <&ipmmu_ds0 23>,
+                                <&ipmmu_ds0 24>, <&ipmmu_ds0 25>,
+                                <&ipmmu_ds0 26>, <&ipmmu_ds0 27>,
+                                <&ipmmu_ds0 28>, <&ipmmu_ds0 29>,
+                                <&ipmmu_ds0 30>, <&ipmmu_ds0 31>;
+               };
+
+               ipmmu_rt0: iommu@ee480000 {
+                       compatible = "renesas,ipmmu-r8a779f0",
+                                    "renesas,rcar-gen4-ipmmu-vmsa";
+                       reg = <0 0xee480000 0 0x20000>;
+                       renesas,ipmmu-main = <&ipmmu_mm 10>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       #iommu-cells = <1>;
+               };
+
+               ipmmu_rt1: iommu@ee4c0000 {
+                       compatible = "renesas,ipmmu-r8a779f0",
+                                    "renesas,rcar-gen4-ipmmu-vmsa";
+                       reg = <0 0xee4c0000 0 0x20000>;
+                       renesas,ipmmu-main = <&ipmmu_mm 19>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       #iommu-cells = <1>;
+               };
+
+               ipmmu_ds0: iommu@eed00000 {
+                       compatible = "renesas,ipmmu-r8a779f0",
+                                    "renesas,rcar-gen4-ipmmu-vmsa";
+                       reg = <0 0xeed00000 0 0x20000>;
+                       renesas,ipmmu-main = <&ipmmu_mm 0>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       #iommu-cells = <1>;
+               };
+
+               ipmmu_hc: iommu@eed40000 {
+                       compatible = "renesas,ipmmu-r8a779f0",
+                                    "renesas,rcar-gen4-ipmmu-vmsa";
+                       reg = <0 0xeed40000 0 0x20000>;
+                       renesas,ipmmu-main = <&ipmmu_mm 2>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       #iommu-cells = <1>;
+               };
+
+               ipmmu_mm: iommu@eefc0000 {
+                       compatible = "renesas,ipmmu-r8a779f0",
+                                    "renesas,rcar-gen4-ipmmu-vmsa";
+                       reg = <0 0xeefc0000 0 0x20000>;
+                       interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+                       power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+                       #iommu-cells = <1>;
                };
 
                gic: interrupt-controller@f1000000 {
                        reg = <0x0 0xf1000000 0 0x20000>,
                              <0x0 0xf1060000 0 0x110000>;
                        interrupts = <GIC_PPI 9
-                                     (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>;
+                                     (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>;
                };
 
                prr: chipid@fff00044 {
                };
        };
 
+       thermal-zones {
+               sensor_thermal1: sensor1-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsc 0>;
+
+                       trips {
+                               sensor1_crit: sensor1-crit {
+                                       temperature = <120000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               sensor_thermal2: sensor2-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsc 1>;
+
+                       trips {
+                               sensor2_crit: sensor2-crit {
+                                       temperature = <120000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+
+               sensor_thermal3: sensor3-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&tsc 2>;
+
+                       trips {
+                               sensor3_crit: sensor3-crit {
+                                       temperature = <120000>;
+                                       hysteresis = <1000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
+
        timer {
                compatible = "arm,armv8-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)>;
+               interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
+       ufs30_clk: ufs30-clk {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               /* This value must be overridden by the board */
+               clock-frequency = <0>;
        };
 };
index 752440b..750bd8c 100644 (file)
@@ -10,3 +10,8 @@
 / {
        compatible = "renesas,r8a779m8", "renesas,r8a7795";
 };
+
+&cluster0_opp {
+       /delete-node/ opp-1600000000;
+       /delete-node/ opp-1700000000;
+};
index b31fb71..40201a1 100644 (file)
                };
 
                adc: adc@10059000 {
+                       compatible = "renesas,r9a07g043-adc", "renesas,rzg2l-adc";
                        reg = <0 0x10059000 0 0x400>;
-                       /* place holder */
+                       interrupts = <GIC_SPI 347 IRQ_TYPE_EDGE_RISING>;
+                       clocks = <&cpg CPG_MOD R9A07G043_ADC_ADCLK>,
+                                <&cpg CPG_MOD R9A07G043_ADC_PCLK>;
+                       clock-names = "adclk", "pclk";
+                       resets = <&cpg R9A07G043_ADC_PRESETN>,
+                                <&cpg R9A07G043_ADC_ADRST_N>;
+                       reset-names = "presetn", "adrst-n";
+                       power-domains = <&cpg>;
+                       status = "disabled";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       channel@0 {
+                               reg = <0>;
+                       };
+                       channel@1 {
+                               reg = <1>;
+                       };
                };
 
                tsu: thermal@10059400 {
index 2d740bd..121e552 100644 (file)
@@ -13,9 +13,3 @@
        model = "Renesas SMARC EVK based on r9a07g043u11";
        compatible = "renesas,smarc-evk", "renesas,r9a07g043u11", "renesas,r9a07g043";
 };
-
-&spi1 {
-       /delete-property/ pinctrl-0;
-       /delete-property/ pinctrl-names;
-       status = "disabled";
-};
index 4e07e1a..3d01a4c 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 board
+ * Device Tree Source for the RZ/V2L SMARC EVK board
  *
  * Copyright (C) 2021 Renesas Electronics Corp.
  */
index c207d8c..c3a52fa 100644 (file)
@@ -14,6 +14,7 @@
 
        aliases {
                serial0 = &uart0;
+               ethernet0 = &avb;
        };
 
        chosen {
        };
 };
 
+&avb {
+       renesas,no-ether-link;
+       phy-handle = <&phy0>;
+       phy-mode = "gmii";
+       status = "okay";
+
+       phy0: ethernet-phy@0 {
+               compatible = "ethernet-phy-id001c.c916",
+                            "ethernet-phy-ieee802.3-c22";
+               reg = <0>;
+       };
+};
+
 &extal_clk {
        clock-frequency = <48000000>;
 };
index 27810f4..d4cc545 100644 (file)
                        clock-names = "clk";
                };
 
+               avb: ethernet@a3300000 {
+                       compatible = "renesas,etheravb-r9a09g011","renesas,etheravb-rzv2m";
+                       reg = <0 0xa3300000 0 0x800>;
+                       interrupts = <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH>, /* ch0: Rx0 BE */
+                                    <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH>, /* ch1: Rx1 NC */
+                                    <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>,
+                                    <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>, /* ch18: Tx0 BE */
+                                    <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>, /* ch19: Tx1 NC */
+                                    <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>, /* DiA */
+                                    <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>, /* DiB */
+                                    <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>, /* Line1_A */
+                                    <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>, /* Line1_B */
+                                    <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>, /* Line2_A */
+                                    <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>, /* Line2_B */
+                                    <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>; /* Line3 MAC */
+                       interrupt-names = "ch0", "ch1", "ch2", "ch3",
+                                         "ch4", "ch5", "ch6", "ch7",
+                                         "ch8", "ch9", "ch10", "ch11",
+                                         "ch12", "ch13", "ch14", "ch15",
+                                         "ch16", "ch17", "ch18", "ch19",
+                                         "ch20", "ch21", "dia", "dib",
+                                         "err_a", "err_b", "mgmt_a", "mgmt_b",
+                                         "line3";
+                       clocks = <&cpg CPG_MOD R9A09G011_ETH0_CLK_AXI>,
+                                <&cpg CPG_MOD R9A09G011_ETH0_CLK_CHI>,
+                                <&cpg CPG_MOD R9A09G011_ETH0_GPTP_EXT>;
+                       clock-names = "axi", "chi", "gptp";
+                       resets = <&cpg R9A09G011_ETH0_RST_HW_N>;
+                       power-domains = <&cpg>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disable";
+               };
+
                cpg: clock-controller@a3500000 {
                        compatible = "renesas,r9a09g011-cpg";
                        reg = <0 0xa3500000 0 0x1000>;
index aeacd22..9410796 100644 (file)
@@ -34,7 +34,7 @@
                reg = <0x0 0x48000000 0x0 0x78000000>;
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
@@ -43,7 +43,7 @@
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
index 959a0ad..78e6e23 100644 (file)
@@ -23,7 +23,7 @@
                reg = <0x0 0x48000000 0x0 0x38000000>;
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
@@ -32,7 +32,7 @@
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
index aa17049..6be25a8 100644 (file)
@@ -29,7 +29,7 @@
 #define SW_RSPI_CAN    1
 #endif
 
-#if (SW_SCIF_CAN & SW_RSPI_CAN)
+#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
 
index a663115..cf3b3d1 100644 (file)
@@ -24,7 +24,7 @@
                reg = <0x0 0x48000000 0x0 0x38000000>;
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
@@ -33,7 +33,7 @@
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
 #endif
 };
 
+#if (SW_SW0_DEV_SEL)
+&adc {
+       pinctrl-0 = <&adc_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+};
+#endif
+
 #if (!SW_ET0_EN_N)
 &eth0 {
        pinctrl-0 = <&eth0_pins>;
 };
 
 &pinctrl {
+       adc_pins: adc {
+               pinmux = <RZG2L_PORT_PINMUX(6, 2, 1)>; /* ADC_TRG */
+       };
+
        eth0_pins: eth0 {
                pinmux = <RZG2L_PORT_PINMUX(4, 5, 1)>, /* ET0_LINKSTA */
                         <RZG2L_PORT_PINMUX(4, 3, 1)>, /* ET0_MDC */
                        pinmux = <RZG2L_PORT_PINMUX(0, 0, 1)>; /* SD0_CD */
                };
        };
+
+       spi1_pins: rspi1 {
+               pinmux = <RZG2L_PORT_PINMUX(4, 0, 2)>, /* CK */
+                        <RZG2L_PORT_PINMUX(4, 1, 2)>, /* MOSI */
+                        <RZG2L_PORT_PINMUX(4, 2, 2)>, /* MISO */
+                        <RZG2L_PORT_PINMUX(4, 3, 2)>; /* SSL */
+       };
 };
 
 #if (SW_SW0_DEV_SEL)
index 0051634..f9835c1 100644 (file)
        status = "disabled";
 };
 
+&spi1 {
+       /delete-property/ pinctrl-0;
+       /delete-property/ pinctrl-names;
+       status = "disabled";
+};
+
 &ssi1 {
        /delete-property/ pinctrl-0;
        /delete-property/ pinctrl-names;
index 31837fc..b7c7911 100644 (file)
                };
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
                regulator-always-on;
        };
 
-       reg_12v: regulator2 {
+       reg_12v: regulator-12v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-12V";
                regulator-min-microvolt = <12000000>;
                                frame-master = <&rsnd_endpoint0>;
 
                                playback = <&ssi0>, <&src0>, <&dvc0>;
-                               capture  = <&ssi1>, <&src1>, <&dvc1>;
+                               capture = <&ssi1>, <&src1>, <&dvc1>;
                        };
                };
 
diff --git a/arch/arm64/boot/dts/renesas/salvator-panel-aa104xd12.dts b/arch/arm64/boot/dts/renesas/salvator-panel-aa104xd12.dts
new file mode 100644 (file)
index 0000000..c83a30a
--- /dev/null
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree overlay for the AA104XD12 panel connected to LVDS0 on a
+ * Salvator-X or Salvator-XS board
+ *
+ * Copyright 2021 Ideas on Board Oy
+ */
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+#include "panel-aa104xd12.dtsi"
+};
+
+&{/panel} {
+       backlight = <&backlight>;
+
+       port {
+               panel_in: endpoint {
+                       remote-endpoint = <&lvds0_out>;
+               };
+       };
+};
+
+&lvds0 {
+       status = "okay";
+
+       ports {
+               port@1 {
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&panel_in>;
+                       };
+               };
+       };
+};
index 5bcb844..408871c 100644 (file)
                                clocks = <&clksndsel>;
                                clock-names = "scki";
 
-                               VDD1-supply     = <&snd_3p3v>;
-                               VDD2-supply     = <&snd_3p3v>;
-                               VCCAD1-supply   = <&snd_vcc5v>;
-                               VCCAD2-supply   = <&snd_vcc5v>;
-                               VCCDA1-supply   = <&snd_vcc5v>;
-                               VCCDA2-supply   = <&snd_vcc5v>;
+                               VDD1-supply = <&snd_3p3v>;
+                               VDD2-supply = <&snd_3p3v>;
+                               VCCAD1-supply = <&snd_vcc5v>;
+                               VCCAD2-supply = <&snd_vcc5v>;
+                               VCCDA1-supply = <&snd_vcc5v>;
+                               VCCDA2-supply = <&snd_vcc5v>;
 
                                ports {
                                        #address-cells = <1>;
                                bitclock-master;
                                frame-master;
                                dai-tdm-slot-num = <6>;
-                               capture  = <&ssi4>;
+                               capture = <&ssi4>;
                        };
                };
        };
index 90a4c06..0772dfe 100644 (file)
@@ -76,7 +76,7 @@
                };
        };
 
-       reg_1p8v: regulator0 {
+       reg_1p8v: regulator-1p8v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-1.8V";
                regulator-min-microvolt = <1800000>;
@@ -85,7 +85,7 @@
                regulator-always-on;
        };
 
-       reg_3p3v: regulator1 {
+       reg_3p3v: regulator-3p3v {
                compatible = "regulator-fixed";
                regulator-name = "fixed-3.3V";
                regulator-min-microvolt = <3300000>;
                                bitclock-master;
                                frame-master;
                                playback = <&ssi0>, <&src0>, <&dvc0>;
-                               capture  = <&ssi1>, <&src1>, <&dvc1>;
+                               capture = <&ssi1>, <&src1>, <&dvc1>;
                        };
                };
                rsnd_port1: port@1 {
index 18d00ea..ef79a67 100644 (file)
@@ -5,6 +5,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-engicam-px30-core-ctouch2-of10.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-engicam-px30-core-edimm2.2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-rock-pi-s.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3318-a95x-z2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb
index 56dfbb2..214f94f 100644 (file)
        i2c0: i2c@ff180000 {
                compatible = "rockchip,px30-i2c", "rockchip,rk3399-i2c";
                reg = <0x0 0xff180000 0x0 0x1000>;
-               clocks =  <&cru SCLK_I2C0>, <&cru PCLK_I2C0>;
+               clocks = <&cru SCLK_I2C0>, <&cru PCLK_I2C0>;
                clock-names = "i2c", "pclk";
                interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
                pinctrl-names = "default";
index 9b4f855..9fe9b0d 100644 (file)
@@ -75,7 +75,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
                        label = "GPIO Key Power";
diff --git a/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts b/arch/arm64/boot/dts/rockchip/rk3308-rock-pi-s.dts
new file mode 100644 (file)
index 0000000..a71f249
--- /dev/null
@@ -0,0 +1,253 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 Akash Gajjar <akash@openedev.com>
+ * Copyright (c) 2019 Jagan Teki <jagan@openedev.com>
+ */
+
+/dts-v1/;
+#include "rk3308.dtsi"
+
+/ {
+       model = "Radxa ROCK Pi S";
+       compatible = "radxa,rockpis", "rockchip,rk3308";
+
+       aliases {
+               ethernet0 = &gmac;
+               mmc0 = &emmc;
+               mmc1 = &sdmmc;
+       };
+
+       chosen {
+               stdout-path = "serial0:1500000n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&green_led_gio>, <&heartbeat_led_gpio>;
+
+               green-led {
+                       default-state = "on";
+                       gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
+                       label = "rockpis:green:power";
+                       linux,default-trigger = "default-on";
+               };
+
+               blue-led {
+                       default-state = "on";
+                       gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
+                       label = "rockpis:blue:user";
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+
+       sdio_pwrseq: sdio-pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               pinctrl-0 = <&wifi_enable_h>;
+               pinctrl-names = "default";
+               reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
+       };
+
+       vcc_1v8: vcc-1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_1v8";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               vin-supply = <&vcc_io>;
+       };
+
+       vcc_io: vcc-io {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_io";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc_ddr: vcc-ddr {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_ddr";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1500000>;
+               regulator-max-microvolt = <1500000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       vcc5v0_otg: vcc5v0-otg {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&otg_vbus_drv>;
+               regulator-name = "vcc5v0_otg";
+               regulator-always-on;
+               vin-supply = <&vcc5v0_sys>;
+       };
+
+       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>;
+       };
+
+       vdd_core: vdd-core {
+               compatible = "pwm-regulator";
+               pwms = <&pwm0 0 5000 1>;
+               pwm-supply = <&vcc5v0_sys>;
+               regulator-name = "vdd_core";
+               regulator-min-microvolt = <827000>;
+               regulator-max-microvolt = <1340000>;
+               regulator-init-microvolt = <1015000>;
+               regulator-settling-time-up-us = <250>;
+               regulator-always-on;
+               regulator-boot-on;
+       };
+
+       vdd_log: vdd-log {
+               compatible = "regulator-fixed";
+               regulator-name = "vdd_log";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <1050000>;
+               regulator-max-microvolt = <1050000>;
+               vin-supply = <&vcc5v0_sys>;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&vdd_core>;
+};
+
+&emmc {
+       bus-width = <4>;
+       cap-mmc-highspeed;
+       mmc-hs200-1_8v;
+       non-removable;
+       vmmc-supply = <&vcc_io>;
+       status = "okay";
+};
+
+&gmac {
+       clock_in_out = "output";
+       phy-supply = <&vcc_io>;
+       snps,reset-gpio = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
+       snps,reset-active-low;
+       snps,reset-delays-us = <0 50000 50000>;
+       status = "okay";
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&pinctrl {
+       pinctrl-names = "default";
+       pinctrl-0 = <&rtc_32k>;
+
+       leds {
+               green_led_gio: green-led-gpio {
+                       rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               heartbeat_led_gpio: heartbeat-led-gpio {
+                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       usb {
+               otg_vbus_drv: otg-vbus-drv {
+                       rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
+       sdio-pwrseq {
+               wifi_enable_h: wifi-enable-h {
+                       rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               wifi_host_wake: wifi-host-wake {
+                       rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_down>;
+               };
+       };
+};
+
+&pwm0 {
+       status = "okay";
+       pinctrl-0 = <&pwm0_pin_pull_down>;
+};
+
+&saradc {
+       vref-supply = <&vcc_1v8>;
+       status = "okay";
+};
+
+&sdio {
+       #address-cells = <1>;
+       #size-cells = <0>;
+       cap-sd-highspeed;
+       cap-sdio-irq;
+       keep-power-in-suspend;
+       max-frequency = <1000000>;
+       mmc-pwrseq = <&sdio_pwrseq>;
+       non-removable;
+       sd-uhs-sdr104;
+       status = "okay";
+};
+
+&sdmmc {
+       cap-sd-highspeed;
+       status = "okay";
+};
+
+&u2phy {
+       status = "okay";
+
+       u2phy_host: host-port {
+               phy-supply = <&vcc5v0_otg>;
+               status = "okay";
+       };
+
+       u2phy_otg: otg-port {
+               phy-supply = <&vcc5v0_otg>;
+               status = "okay";
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart4 {
+       status = "okay";
+
+       bluetooth {
+               compatible = "realtek,rtl8723bs-bt";
+               device-wake-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>;
+               host-wake-gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+&usb_host_ehci {
+       status = "okay";
+};
+
+&usb_host_ohci {
+       status = "okay";
+};
+
+&usb20_otg {
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&wdt {
+       status = "okay";
+};
index ea0695b..415aa9f 100644 (file)
                 * |------------------------------------------------|
                 */
 
-               sw1 {
+               button-sw1 {
                        gpios = <&gpio1 RK_PB4 GPIO_ACTIVE_LOW>;
                        label = "DPAD-UP";
                        linux,code = <BTN_DPAD_UP>;
                };
-               sw2 {
+               button-sw2 {
                        gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_LOW>;
                        label = "DPAD-DOWN";
                        linux,code = <BTN_DPAD_DOWN>;
                };
-               sw3 {
+               button-sw3 {
                        gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_LOW>;
                        label = "DPAD-LEFT";
                        linux,code = <BTN_DPAD_LEFT>;
                };
-               sw4 {
+               button-sw4 {
                        gpios = <&gpio1 RK_PB7 GPIO_ACTIVE_LOW>;
                        label = "DPAD-RIGHT";
                        linux,code = <BTN_DPAD_RIGHT>;
                };
-               sw5 {
+               button-sw5 {
                        gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "BTN-A";
                        linux,code = <BTN_EAST>;
                };
-               sw6 {
+               button-sw6 {
                        gpios = <&gpio1 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "BTN-B";
                        linux,code = <BTN_SOUTH>;
                };
-               sw7 {
+               button-sw7 {
                        gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_LOW>;
                        label = "BTN-Y";
                        linux,code = <BTN_WEST>;
                };
-               sw8 {
+               button-sw8 {
                        gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_LOW>;
                        label = "BTN-X";
                        linux,code = <BTN_NORTH>;
                };
-               sw9 {
+               button-sw9 {
                        gpios = <&gpio2 RK_PA0 GPIO_ACTIVE_LOW>;
                        label = "F1";
                        linux,code = <BTN_TRIGGER_HAPPY1>;
                };
-               sw10 {
+               button-sw10 {
                        gpios = <&gpio2 RK_PA1 GPIO_ACTIVE_LOW>;
                        label = "F2";
                        linux,code = <BTN_TRIGGER_HAPPY2>;
                };
-               sw11 {
+               button-sw11 {
                        gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "F3";
                        linux,code = <BTN_TRIGGER_HAPPY3>;
                };
-               sw12 {
+               button-sw12 {
                        gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_LOW>;
                        label = "F4";
                        linux,code = <BTN_TRIGGER_HAPPY4>;
                };
-               sw13 {
+               button-sw13 {
                        gpios = <&gpio2 RK_PA4 GPIO_ACTIVE_LOW>;
                        label = "F5";
                        linux,code = <BTN_TRIGGER_HAPPY5>;
                };
-               sw14 {
+               button-sw14 {
                        gpios = <&gpio2 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "F6";
                        linux,code = <BTN_TRIGGER_HAPPY6>;
                };
-               sw15 {
+               button-sw15 {
                        gpios = <&gpio2 RK_PA6 GPIO_ACTIVE_LOW>;
                        label = "TOP-LEFT";
                        linux,code = <BTN_TL>;
                };
-               sw16 {
+               button-sw16 {
                        gpios = <&gpio2 RK_PA7 GPIO_ACTIVE_LOW>;
                        label = "TOP-RIGHT";
                        linux,code = <BTN_TR>;
index 3857d48..1445b87 100644 (file)
@@ -34,7 +34,7 @@
                pinctrl-0 = <&reset_button_pin>;
                pinctrl-names = "default";
 
-               reset {
+               key-reset {
                        label = "reset";
                        gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
index 15d1fc5..083452c 100644 (file)
@@ -76,7 +76,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key>;
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 62aa97a..be06e6e 100644 (file)
@@ -43,7 +43,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
                        linux,code = <KEY_POWER>;
index 3ebe15e..7f5bba0 100644 (file)
@@ -44,7 +44,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key>;
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
                        label = "GPIO Power";
 
        vccio_sd: vcc-io-sd-regulator {
                compatible = "regulator-fixed";
-               regulator-name= "vccio_sd";
+               regulator-name = "vccio_sd";
                regulator-min-microvolt = <1800000>;
                regulator-max-microvolt = <3300000>;
                regulator-always-on;
index 5ccaa5f..29df84b 100644 (file)
@@ -30,7 +30,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key>;
 
-               power {
+               key-power {
                        gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
                        linux,code = <KEY_POWER>;
index 959d3cc..38d757c 100644 (file)
@@ -37,7 +37,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key>;
 
-               power {
+               key-power {
                        wakeup-source;
                        gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 4f0b5fe..a4c5aaf 100644 (file)
 
                gmac {
                        rgmii_pins: rgmii-pins {
-                               rockchip,pins = <3 RK_PC6 1 &pcfg_pull_none>,
+                               rockchip,pins = <3 RK_PC6 1 &pcfg_pull_none>,
                                                <3 RK_PD0 1 &pcfg_pull_none>,
                                                <3 RK_PC3 1 &pcfg_pull_none>,
                                                <3 RK_PB0 1 &pcfg_pull_none_12ma>,
                        };
 
                        rmii_pins: rmii-pins {
-                               rockchip,pins = <3 RK_PC6 1 &pcfg_pull_none>,
+                               rockchip,pins = <3 RK_PC6 1 &pcfg_pull_none>,
                                                <3 RK_PD0 1 &pcfg_pull_none>,
                                                <3 RK_PC3 1 &pcfg_pull_none>,
                                                <3 RK_PB0 1 &pcfg_pull_none_12ma>,
 
                spdif {
                        spdif_tx: spdif-tx {
-                               rockchip,pins = <2 RK_PC7 1 &pcfg_pull_none>;
+                               rockchip,pins = <2 RK_PC7 1 &pcfg_pull_none>;
                        };
                };
 
index 7b717eb..3d1e126 100644 (file)
@@ -55,7 +55,7 @@
        };
 
        edp_panel: edp-panel {
-               compatible ="lg,lp079qx1-sp0v";
+               compatible = "lg,lp079qx1-sp0v";
                backlight = <&backlight>;
                enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
                power-supply = <&vcc3v3_s0>;
index b340c9e..c5db64f 100644 (file)
@@ -87,7 +87,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Key Power";
index 50d459e..cd07464 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&bt_host_wake_l>;
 
-               wake_on_bt: wake-on-bt {
+               wake_on_bt: key-wake-on-bt {
                        label = "Wake-on-Bluetooth";
                        gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_WAKEUP>;
index 6863689..2cc9b33 100644 (file)
@@ -92,7 +92,7 @@
        pinctrl-names = "default";
        pinctrl-0 = <&bt_host_wake_l>, <&cpu1_pen_eject>;
 
-       pen-insert {
+       switch-pen-insert {
                label = "Pen Insert";
                /* Insert = low, eject = high */
                gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
index 913d845..0dadac5 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&pen_eject_odl>;
 
-               pen-insert {
+               switch-pen-insert {
                        label = "Pen Insert";
                        /* Insert = low, eject = high */
                        gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
index 46c4581..2a33276 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Key Power";
index cef4d18..fe5b526 100644 (file)
@@ -46,9 +46,9 @@
        gpio-keys {
                pinctrl-0 = <&reset_button_pin>;
 
-               /delete-node/ power;
+               /delete-node/ key-power;
 
-               reset {
+               key-reset {
                        debounce-interval = <50>;
                        gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
                        label = "reset";
index 248ad41..278123b 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&power_key>;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Key Power";
index ed856bf..9e2e246 100644 (file)
@@ -78,7 +78,7 @@
                compatible = "gpio-keys";
                autorepeat;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index d6b68d7..194e48c 100644 (file)
@@ -76,7 +76,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&lidbtn_pin>;
 
-               lid {
+               switch-lid {
                        debounce-interval = <20>;
                        gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;
                        label = "Lid";
@@ -92,7 +92,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn_pin>;
 
-               power {
+               key-power {
                        debounce-interval = <20>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "Power";
index 3ae5d72..04c752f 100644 (file)
@@ -49,7 +49,7 @@
        sgtl5000_clk: sgtl5000-oscillator  {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
-                       clock-frequency  = <24576000>;
+                       clock-frequency = <24576000>;
        };
 
        dc_12v: dc-12v {
index 0e45cc2..acb174d 100644 (file)
@@ -54,7 +54,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwr_key_l>;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Key Power";
index 45e77f8..7815752 100644 (file)
                stdout-path = "serial2:1500000n8";
        };
 
+       /* enable for panel backlight support */
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               brightness-levels = <0 4 8 16 32 64 128 255>;
+               default-brightness-level = <5>;
+               pwms = <&pwm0 0 1000000 0>;
+               status = "disabled";
+       };
+
        clkin_gmac: external-gmac-clock {
                compatible = "fixed-clock";
                clock-frequency = <125000000>;
@@ -33,7 +42,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&pwrbtn>;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Key Power";
                };
        };
 
+       avdd: avdd-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "avdd";
+               regulator-min-microvolt = <11000000>;
+               regulator-max-microvolt = <11000000>;
+               vin-supply = <&vcc3v3_s0>;
+       };
+
        vcc12v_dcin: vcc12v-dcin {
                compatible = "regulator-fixed";
                regulator-name = "vcc12v_dcin";
 
                        vcc3v0_touch: LDO_REG2 {
                                regulator-name = "vcc3v0_touch";
-                               regulator-always-on;
-                               regulator-boot-on;
                                regulator-min-microvolt = <3000000>;
                                regulator-max-microvolt = <3000000>;
                                regulator-state-mem {
 
                        vcc3v3_s0: SWITCH_REG2 {
                                regulator-name = "vcc3v3_s0";
-                               regulator-always-on;
-                               regulator-boot-on;
                                regulator-state-mem {
                                        regulator-off-in-suspend;
                                };
                vbus-supply = <&vcc5v0_typec>;
                status = "okay";
        };
+
+       /* enable for pine64 touch screen support */
+       touch: touchscreen@5d {
+               compatible = "goodix,gt911";
+               reg = <0x5d>;
+               interrupt-parent = <&gpio4>;
+               interrupts = <RK_PD5 IRQ_TYPE_EDGE_FALLING>;
+               AVDD28-supply = <&vcc3v0_touch>;
+               VDDIO-supply = <&vcc3v0_touch>;
+               irq-gpios = <&gpio4 RK_PD5 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&gpio4 RK_PD6 GPIO_ACTIVE_HIGH>;
+               status = "disabled";
+       };
 };
 
 &i2s0 {
        gpio1830-supply = <&vcc_3v0>;
 };
 
+/* enable for pine64 panel display support */
+&mipi_dsi {
+       clock-master;
+       status = "disabled";
+
+       ports {
+               mipi_out: port@1 {
+                       reg = <1>;
+
+                       mipi_out_panel: endpoint {
+                               remote-endpoint = <&mipi_in_panel>;
+                       };
+               };
+       };
+
+       mipi_panel: panel@0 {
+               compatible = "feiyang,fy07024di26a30d";
+               reg = <0>;
+               avdd-supply = <&avdd>;
+               backlight = <&backlight>;
+               dvdd-supply = <&vcc3v3_s0>;
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               mipi_in_panel: endpoint {
+                                       remote-endpoint = <&mipi_out_panel>;
+                               };
+                       };
+               };
+       };
+};
+
 &pcie0 {
        ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
        num-lanes = <4>;
index f6b2199..13927e7 100644 (file)
@@ -88,7 +88,7 @@
        };
 
        edp_panel: edp-panel {
-               compatible ="lg,lp079qx1-sp0v";
+               compatible = "lg,lp079qx1-sp0v";
                backlight = <&backlight>;
                enable-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
                pinctrl-names = "default";
index 2aa0fad..e6ac292 100644 (file)
@@ -53,7 +53,7 @@
                compatible = "gpio-keys";
                autorepeat;
 
-               power {
+               key-power {
                        debounce-interval = <100>;
                        gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
                        label = "GPIO Power";
index 01d1a75..935b8c6 100644 (file)
 
        pcie {
                pcie_pwr: pcie-pwr {
-                       rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
+                       rockchip,pins = <4 RK_PD4 RK_FUNC_GPIO &pcfg_pull_up>;
                };
        };
 
index e01668e..0d45868 100644 (file)
@@ -49,7 +49,7 @@
                pinctrl-0 = <&hall_int_l>;
                pinctrl-names = "default";
 
-               cover {
+               switch-cover {
                        label = "cover";
                        gpios = <&gpio0 RK_PC7 GPIO_ACTIVE_LOW>;
                        linux,input-type = <EV_SW>;
index 1534e11..981c4ae 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
 #include "rk3566.dtsi"
 
 / {
                gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>;
                gpio-fan,speed-map = <0    0
                                      4500 1>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&fan_en_h>;
                #cooling-cells = <2>;
        };
 
+       hdmi-con {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
                vin-supply = <&vcc12v_dcin>;
        };
 
+       vcc3v3_pcie_p: vcc3v3-pcie-p-regulator {
+               compatible = "regulator-fixed";
+               enable-active-high;
+               gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&pcie_enable_h>;
+               regulator-name = "vcc3v3_pcie_p";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc_3v3>;
+       };
+
        vcc5v0_usb: vcc5v0_usb {
                compatible = "regulator-fixed";
                regulator-name = "vcc5v0_usb";
        status = "okay";
 };
 
+&combphy2 {
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&vdd_cpu>;
 };
        status = "okay";
 };
 
+&hdmi {
+       avdd-0v9-supply = <&vdda_0v9>;
+       avdd-1v8-supply = <&vcc_1v8>;
+       status = "okay";
+};
+
+&hdmi_in {
+       hdmi_in_vp0: endpoint {
+               remote-endpoint = <&vp0_out_hdmi>;
+       };
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
        status = "okay";
 };
 
+&i2s0_8ch {
+       status = "okay";
+};
+
 &i2s1_8ch {
        pinctrl-names = "default";
        pinctrl-0 = <&i2s1m0_sclktx
        };
 };
 
+&pcie2x1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pcie_reset_h>;
+       reset-gpios = <&gpio1 RK_PB2 GPIO_ACTIVE_HIGH>;
+       vpcie3v3-supply = <&vcc3v3_pcie_p>;
+       status = "okay";
+};
+
 &pinctrl {
        bt {
                bt_enable_h: bt-enable-h {
                };
        };
 
+       fan {
+               fan_en_h: fan-en-h {
+                       rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        leds {
                work_led_enable_h: work-led-enable-h {
                        rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
 
+       pcie {
+               pcie_enable_h: pcie-enable-h {
+                       rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               pcie_reset_h: pcie-reset-h {
+                       rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pmic {
                pmic_int_l: pmic-int-l {
                        rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
        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";
        status = "okay";
 };
 
+&sfc {
+       pinctrl-0 = <&fspi_pins>;
+       pinctrl-names = "default";
+       #address-cells = <1>;
+       #size-cells = <0>;
+       status = "disabled";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <24000000>;
+               spi-rx-bus-width = <4>;
+               spi-tx-bus-width = <1>;
+       };
+};
+
 /* spdif is exposed on con40 pin 18 */
 &spdif {
        status = "okay";
        phy-supply = <&vcc5v0_usb20_host>;
        status = "okay";
 };
+
+&vop {
+       assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+       assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+       status = "okay";
+};
+
+&vop_mmu {
+       status = "okay";
+};
+
+&vp0 {
+       vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+               reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+               remote-endpoint = <&hdmi_in_vp0>;
+       };
+};
index 0b95706..6c4b17d 100644 (file)
@@ -29,3 +29,7 @@
        extcon = <&usb2phy0>;
        maximum-speed = "high-speed";
 };
+
+&vop {
+       compatible = "rockchip,rk3566-vop";
+};
index 40cf223..1d3ffbf 100644 (file)
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
 #include "rk3568.dtsi"
 
 / {
                regulator-max-microvolt = <12000000>;
        };
 
+       hdmi-con {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        vcc3v3_sys: vcc3v3-sys {
                compatible = "regulator-fixed";
                regulator-name = "vcc3v3_sys";
        status = "okay";
 };
 
+&gpu {
+       mali-supply = <&vdd_gpu>;
+       status = "okay";
+};
+
+&hdmi {
+       avdd-0v9-supply = <&vdda0v9_image>;
+       avdd-1v8-supply = <&vcca1v8_image>;
+       status = "okay";
+};
+
+&hdmi_in {
+       hdmi_in_vp0: endpoint {
+               remote-endpoint = <&vp0_out_hdmi>;
+       };
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
 
                        vdd_gpu: DCDC_REG2 {
                                regulator-name = "vdd_gpu";
+                               regulator-always-on;
                                regulator-init-microvolt = <900000>;
                                regulator-initial-mode = <0x2>;
                                regulator-min-microvolt = <500000>;
 
                        vdda0v9_image: LDO_REG1 {
                                regulator-name = "vdda0v9_image";
+                               regulator-always-on;
                                regulator-min-microvolt = <900000>;
                                regulator-max-microvolt = <900000>;
 
 
                        vcca1v8_image: LDO_REG9 {
                                regulator-name = "vcca1v8_image";
+                               regulator-always-on;
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
 
        };
 };
 
+&i2c3 {
+       status = "okay";
+
+       hym8563: rtc@51 {
+               compatible = "haoyu,hym8563";
+               reg = <0x51>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <RK_PD3 IRQ_TYPE_EDGE_FALLING>;
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+               clock-output-names = "rtcic_32kout";
+               pinctrl-names = "default";
+               pinctrl-0 = <&hym8563_int>;
+               wakeup-source;
+       };
+};
+
 &i2c5 {
        /* pin 3 (SDA) + 4 (SCL) of header con2 */
        status = "disabled";
 };
 
+&i2s0_8ch {
+       /* hdmi sound */
+       status = "okay";
+};
+
 &mdio1 {
        rgmii_phy1: ethernet-phy@0 {
                compatible = "ethernet-phy-ieee802.3-c22";
                };
        };
 
+       hym8563 {
+               hym8563_int: hym8563-int {
+                       rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+       };
+
        pmic {
                pmic_int: pmic_int {
                        rockchip,pins =
 };
 
 &tsadc {
+       rockchip,hw-tshut-mode = <1>;
+       rockchip,hw-tshut-polarity = <0>;
        status = "okay";
 };
 
        phy-supply = <&vcc5v0_usb_otg>;
        status = "okay";
 };
+
+&vop {
+       assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+       assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+       status = "okay";
+};
+
+&vop_mmu {
+       status = "okay";
+};
+
+&vp0 {
+       vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+               reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+               remote-endpoint = <&hdmi_in_vp0>;
+       };
+};
index 622be8b..6ff89ff 100644 (file)
@@ -8,6 +8,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
 #include "rk3568.dtsi"
 
 / {
                regulator-max-microvolt = <12000000>;
        };
 
+       hdmi-con {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
        status = "okay";
 };
 
+&hdmi {
+       avdd-0v9-supply = <&vdda0v9_image>;
+       avdd-1v8-supply = <&vcca1v8_image>;
+       status = "okay";
+};
+
+&hdmi_in {
+       hdmi_in_vp0: endpoint {
+               remote-endpoint = <&vp0_out_hdmi>;
+       };
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
        };
 };
 
+&i2s0_8ch {
+       status = "okay";
+};
+
 &i2s1_8ch {
        rockchip,trcm-sync-tx-only;
        status = "okay";
        phy-supply = <&vcc5v0_usb_host>;
        status = "okay";
 };
+
+&vop {
+       assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+       assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+       status = "okay";
+};
+
+&vop_mmu {
+       status = "okay";
+};
+
+&vp0 {
+       vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+               reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+               remote-endpoint = <&hdmi_in_vp0>;
+       };
+};
index 0813c0c..6b5093a 100644 (file)
@@ -4,6 +4,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
 #include "rk3568.dtsi"
 
 / {
                stdout-path = "serial2:1500000n8";
        };
 
+       hdmi-con {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
        status = "okay";
 };
 
+&hdmi {
+       avdd-0v9-supply = <&vdda0v9_image>;
+       avdd-1v8-supply = <&vcca1v8_image>;
+       status = "okay";
+};
+
+&hdmi_in {
+       hdmi_in_vp0: endpoint {
+               remote-endpoint = <&vp0_out_hdmi>;
+       };
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&hdmi_sound {
+       status = "okay";
+};
+
 &i2c0 {
        status = "okay";
 
        };
 };
 
+&i2s0_8ch {
+       status = "okay";
+};
+
 &i2s1_8ch {
        rockchip,trcm-sync-tx-only;
        status = "okay";
        phy-supply = <&vcc5v0_usb_host>;
        status = "okay";
 };
+
+&vop {
+       assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+       assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+       status = "okay";
+};
+
+&vop_mmu {
+       status = "okay";
+};
+
+&vp0 {
+       vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+               reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+               remote-endpoint = <&hdmi_in_vp0>;
+       };
+};
index 5eafddf..2bdf8c7 100644 (file)
        phys = <&usb2phy0_otg>, <&combphy0 PHY_TYPE_USB3>;
        phy-names = "usb2-phy", "usb3-phy";
 };
+
+&vop {
+       compatible = "rockchip,rk3568-vop";
+};
index 914f13c..319981c 100644 (file)
                };
        };
 
+       display_subsystem: display-subsystem {
+               compatible = "rockchip,display-subsystem";
+               ports = <&vop_out>;
+       };
+
        firmware {
                scmi: scmi {
                        compatible = "arm,scmi-smc";
                };
        };
 
+       hdmi_sound: hdmi-sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "HDMI";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,mclk-fs = <256>;
+               status = "disabled";
+
+               simple-audio-card,codec {
+                       sound-dai = <&hdmi>;
+               };
+
+               simple-audio-card,cpu {
+                       sound-dai = <&i2s0_8ch>;
+               };
+       };
+
        pmu {
                compatible = "arm,cortex-a55-pmu";
                interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_HIGH>,
                };
        };
 
+       vop: vop@fe040000 {
+               reg = <0x0 0xfe040000 0x0 0x3000>, <0x0 0xfe044000 0x0 0x1000>;
+               reg-names = "vop", "gamma-lut";
+               interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>, <&cru DCLK_VOP0>,
+                        <&cru DCLK_VOP1>, <&cru DCLK_VOP2>;
+               clock-names = "aclk", "hclk", "dclk_vp0", "dclk_vp1", "dclk_vp2";
+               iommus = <&vop_mmu>;
+               power-domains = <&power RK3568_PD_VO>;
+               rockchip,grf = <&grf>;
+               status = "disabled";
+
+               vop_out: ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       vp0: port@0 {
+                               reg = <0>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       vp1: port@1 {
+                               reg = <1>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+
+                       vp2: port@2 {
+                               reg = <2>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+       };
+
+       vop_mmu: iommu@fe043e00 {
+               compatible = "rockchip,rk3568-iommu";
+               reg = <0x0 0xfe043e00 0x0 0x100>, <0x0 0xfe043f00 0x0 0x100>;
+               interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
+               clock-names = "aclk", "iface";
+               #iommu-cells = <0>;
+               status = "disabled";
+       };
+
+       hdmi: hdmi@fe0a0000 {
+               compatible = "rockchip,rk3568-dw-hdmi";
+               reg = <0x0 0xfe0a0000 0x0 0x20000>;
+               interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru PCLK_HDMI_HOST>,
+                        <&cru CLK_HDMI_SFR>,
+                        <&cru CLK_HDMI_CEC>,
+                        <&pmucru CLK_HDMI_REF>,
+                        <&cru HCLK_VO>;
+               clock-names = "iahb", "isfr", "cec", "ref";
+               pinctrl-names = "default";
+               pinctrl-0 = <&hdmitx_scl &hdmitx_sda &hdmitxm0_cec>;
+               power-domains = <&power RK3568_PD_VO>;
+               reg-io-width = <4>;
+               rockchip,grf = <&grf>;
+               #sound-dai-cells = <0>;
+               status = "disabled";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       hdmi_in: port@0 {
+                               reg = <0>;
+                       };
+
+                       hdmi_out: port@1 {
+                               reg = <1>;
+                       };
+               };
+       };
+
        qos_gpu: qos@fe128000 {
                compatible = "rockchip,rk3568-qos", "syscon";
                reg = <0x0 0xfe128000 0x0 0x20>;
                reg = <0x0 0xfe1a8100 0x0 0x20>;
        };
 
+       pcie2x1: pcie@fe260000 {
+               compatible = "rockchip,rk3568-pcie";
+               reg = <0x3 0xc0000000 0x0 0x00400000>,
+                     <0x0 0xfe260000 0x0 0x00010000>,
+                     <0x3 0x3f000000 0x0 0x01000000>;
+               reg-names = "dbi", "apb", "config";
+               interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-names = "sys", "pmc", "msi", "legacy", "err";
+               bus-range = <0x0 0xf>;
+               clocks = <&cru ACLK_PCIE20_MST>, <&cru ACLK_PCIE20_SLV>,
+                        <&cru ACLK_PCIE20_DBI>, <&cru PCLK_PCIE20>,
+                        <&cru CLK_PCIE20_AUX_NDFT>;
+               clock-names = "aclk_mst", "aclk_slv",
+                             "aclk_dbi", "pclk", "aux";
+               device_type = "pci";
+               interrupt-map-mask = <0 0 0 7>;
+               interrupt-map = <0 0 0 1 &pcie_intc 0>,
+                               <0 0 0 2 &pcie_intc 1>,
+                               <0 0 0 3 &pcie_intc 2>,
+                               <0 0 0 4 &pcie_intc 3>;
+               linux,pci-domain = <0>;
+               num-ib-windows = <6>;
+               num-ob-windows = <2>;
+               max-link-speed = <2>;
+               msi-map = <0x0 &gic 0x0 0x1000>;
+               num-lanes = <1>;
+               phys = <&combphy2 PHY_TYPE_PCIE>;
+               phy-names = "pcie-phy";
+               power-domains = <&power RK3568_PD_PIPE>;
+               ranges = <0x01000000 0x0 0x3ef00000 0x3 0x3ef00000 0x0 0x00100000
+                         0x02000000 0x0 0x00000000 0x3 0x00000000 0x0 0x3ef00000>;
+               resets = <&cru SRST_PCIE20_POWERUP>;
+               reset-names = "pipe";
+               #address-cells = <3>;
+               #size-cells = <2>;
+               status = "disabled";
+
+               pcie_intc: legacy-interrupt-controller {
+                       #address-cells = <0>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
+                       interrupt-parent = <&gic>;
+                       interrupts = <GIC_SPI 72 IRQ_TYPE_EDGE_RISING>;
+               };
+       };
+
        sdmmc0: mmc@fe2b0000 {
                compatible = "rockchip,rk3568-dw-mshc", "rockchip,rk3288-dw-mshc";
                reg = <0x0 0xfe2b0000 0x0 0x4000>;
                status = "disabled";
        };
 
+       i2s0_8ch: i2s@fe400000 {
+               compatible = "rockchip,rk3568-i2s-tdm";
+               reg = <0x0 0xfe400000 0x0 0x1000>;
+               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+               assigned-clocks = <&cru CLK_I2S0_8CH_TX_SRC>, <&cru CLK_I2S0_8CH_RX_SRC>;
+               assigned-clock-rates = <1188000000>, <1188000000>;
+               clocks = <&cru MCLK_I2S0_8CH_TX>, <&cru MCLK_I2S0_8CH_RX>, <&cru HCLK_I2S0_8CH>;
+               clock-names = "mclk_tx", "mclk_rx", "hclk";
+               dmas = <&dmac1 0>;
+               dma-names = "tx";
+               resets = <&cru SRST_M_I2S0_8CH_TX>, <&cru SRST_M_I2S0_8CH_RX>;
+               reset-names = "tx-m", "rx-m";
+               rockchip,grf = <&grf>;
+               #sound-dai-cells = <0>;
+               status = "disabled";
+       };
+
        i2s1_8ch: i2s@fe410000 {
                compatible = "rockchip,rk3568-i2s-tdm";
                reg = <0x0 0xfe410000 0x0 0x1000>;
index 231436b..8bb8a70 100644 (file)
        };
 
        psci {
-               compatible      = "arm,psci";
-               method          = "smc";
-               cpu_on          = <0xc4000003>;
-               cpu_off         = <0x84000002>;
-               cpu_suspend     = <0xc4000001>;
+               compatible = "arm,psci";
+               method = "smc";
+               cpu_on = <0xc4000003>;
+               cpu_off = <0x84000002>;
+               cpu_suspend = <0xc4000001>;
        };
 
        timer {
index 8cf4a65..22d81ac 100644 (file)
                        ranges;
 
                        sdio0: sdio@20300000 {
-                               compatible  = "sprd,sdhci-r11";
+                               compatible = "sprd,sdhci-r11";
                                reg = <0 0x20300000 0 0x1000>;
                                interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
 
                        };
 
                        sdio3: sdio@20600000 {
-                               compatible  = "sprd,sdhci-r11";
+                               compatible = "sprd,sdhci-r11";
                                reg = <0 0x20600000 0 0x1000>;
                                interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
 
index 89d91ab..fece497 100644 (file)
                        };
 
                        sdio3: sdio@50430000 {
-                               compatible  = "sprd,sdhci-r11";
+                               compatible = "sprd,sdhci-r11";
                                reg = <0 0x50430000 0 0x1000>;
                                interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
 
index 5af560c..1db6ddf 100644 (file)
@@ -37,3 +37,7 @@
 &serial_0 {
        status = "okay";
 };
+
+&ufs {
+       status = "okay";
+};
index d4d0cb0..d0abb9a 100644 (file)
@@ -8,7 +8,7 @@
  *             https://www.tesla.com
  */
 
-#include <dt-bindings/pinctrl/samsung.h>
+#include "fsd-pinctrl.h"
 
 &pinctrl_fsys0 {
        gpf0: gpf0-gpio-bank {
                interrupt-controller;
                #interrupt-cells = <2>;
        };
+
+       ufs_rst_n: ufs-rst-n-pins {
+               samsung,pins = "gpf5-0";
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_NONE>;
+               samsung,pin-drv = <FSD_PIN_DRV_LV2>;
+       };
+
+       ufs_refclk_out: ufs-refclk-out-pins {
+               samsung,pins = "gpf5-1";
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_NONE>;
+               samsung,pin-drv = <FSD_PIN_DRV_LV2>;
+       };
 };
 
 &pinctrl_peric {
 
        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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_NONE>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_NONE>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_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>;
+               samsung,pin-function = <FSD_PIN_FUNC_2>;
+               samsung,pin-pud = <FSD_PIN_PULL_UP>;
+               samsung,pin-drv = <FSD_PIN_DRV_LV1>;
        };
 };
 
diff --git a/arch/arm64/boot/dts/tesla/fsd-pinctrl.h b/arch/arm64/boot/dts/tesla/fsd-pinctrl.h
new file mode 100644 (file)
index 0000000..6ffbda3
--- /dev/null
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Tesla FSD DTS pinctrl constants
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ * Copyright (c) 2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzk@kernel.org>
+ */
+
+#ifndef __DTS_ARM64_TESLA_FSD_PINCTRL_H__
+#define __DTS_ARM64_TESLA_FSD_PINCTRL_H__
+
+#define FSD_PIN_PULL_NONE              0
+#define FSD_PIN_PULL_DOWN              1
+#define FSD_PIN_PULL_UP                        3
+
+#define FSD_PIN_DRV_LV1                        0
+#define FSD_PIN_DRV_LV2                        2
+#define FSD_PIN_DRV_LV3                        1
+#define FSD_PIN_DRV_LV4                        3
+
+#define FSD_PIN_FUNC_INPUT             0
+#define FSD_PIN_FUNC_OUTPUT            1
+#define FSD_PIN_FUNC_2                 2
+#define FSD_PIN_FUNC_3                 3
+#define FSD_PIN_FUNC_4                 4
+#define FSD_PIN_FUNC_5                 5
+#define FSD_PIN_FUNC_6                 6
+#define FSD_PIN_FUNC_EINT              0xf
+#define FSD_PIN_FUNC_F                 FSD_PIN_FUNC_EINT
+
+#endif /* __DTS_ARM64_TESLA_FSD_PINCTRL_H__ */
index af39655..f35bc5a 100644 (file)
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl0_1: cpu@1 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl0_2: cpu@2 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl0_3: cpu@3 {
                                reg = <0x0 0x003>;
                                enable-method = "psci";
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                /* Cluster 1 */
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl1_1: cpu@101 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl1_2: cpu@102 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl1_3: cpu@103 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                /* Cluster 2 */
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl2_1: cpu@201 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl2_2: cpu@202 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
                };
 
                cpucl2_3: cpu@203 {
                                enable-method = "psci";
                                clock-frequency = <2400000000>;
                                cpu-idle-states = <&CPU_SLEEP>;
+                               i-cache-size = <0xc000>;
+                               i-cache-line-size = <64>;
+                               i-cache-sets = <256>;
+                               d-cache-size = <0x8000>;
+                               d-cache-line-size = <64>;
+                               d-cache-sets = <256>;
+                               next-level-cache = <&cpucl_l2>;
+               };
+
+               cpucl_l2: l2-cache0 {
+                       compatible = "cache";
+                       cache-size = <0x400000>;
+                       cache-line-size = <64>;
+                       cache-sets = <4096>;
                };
 
                idle-states {
                        clocks = <&fin_pll>, <&clock_imem IMEM_MCT_PCLK>;
                        clock-names = "fin_pll", "mct";
                };
+
+               ufs: ufs@15120000 {
+                       compatible = "tesla,fsd-ufs";
+                       reg = <0x0 0x15120000 0x0 0x200>,  /* 0: HCI standard */
+                             <0x0 0x15121100 0x0 0x200>,  /* 1: Vendor specified */
+                             <0x0 0x15110000 0x0 0x8000>,  /* 2: UNIPRO */
+                             <0x0 0x15130000 0x0 0x100>;  /* 3: UFS protector */
+                       reg-names = "hci", "vs_hci", "unipro", "ufsp";
+                       interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clock_fsys0 UFS0_TOP0_HCLK_BUS>,
+                                <&clock_fsys0 UFS0_TOP0_CLK_UNIPRO>;
+                       clock-names = "core_clk", "sclk_unipro_main";
+                       freq-table-hz = <0 0>, <0 0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>;
+                       phys = <&ufs_phy>;
+                       phy-names = "ufs-phy";
+                       status = "disabled";
+               };
+
+               ufs_phy: ufs-phy@15124000 {
+                       compatible = "tesla,fsd-ufs-phy";
+                       reg = <0x0 0x15124000 0x0 0x800>;
+                       reg-names = "phy-pma";
+                       samsung,pmu-syscon = <&pmu_system_controller>;
+                       #phy-cells = <0>;
+                       clocks = <&clock_fsys0 UFS0_MPHY_REFCLK_IXTAL26>;
+                       clock-names = "ref_clk";
+               };
        };
 };
 
index d08abad..12ab754 100644 (file)
                compatible = "ti,k2g-sci";
                ti,host-id = <12>;
                mbox-names = "rx", "tx";
-               mboxes= <&secure_proxy_main 12>,
-                       <&secure_proxy_main 13>;
+               mboxes = <&secure_proxy_main 12>,
+                        <&secure_proxy_main 13>;
                reg-names = "debug_messages";
                reg = <0x00 0x44043000 0x00 0xfe0>;
 
                };
        };
 
+       crypto: crypto@40900000 {
+               compatible = "ti,am62-sa3ul";
+               reg = <0x00 0x40900000 0x00 0x1200>;
+               power-domains = <&k3_pds 70 TI_SCI_PD_SHARED>;
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges = <0x00 0x40900000 0x00 0x40900000 0x00 0x30000>;
+
+               dmas = <&main_pktdma 0xf501 0>, <&main_pktdma 0x7506 0>,
+                      <&main_pktdma 0x7507 0>;
+               dma-names = "tx", "rx1", "rx2";
+       };
+
        main_pmx0: pinctrl@f4000 {
                compatible = "pinctrl-single";
                reg = <0x00 0xf4000 0x00 0x2ac>;
index 39fb1d7..9b4dbae 100644 (file)
@@ -13,7 +13,7 @@
 #include "k3-am625.dtsi"
 
 / {
-       compatible =  "ti,am625-sk", "ti,am625";
+       compatible = "ti,am625-sk", "ti,am625";
        model = "Texas Instruments AM625 SK";
 
        aliases {
                #size-cells = <2>;
                ranges;
 
+               ramoops@9ca00000 {
+                       compatible = "ramoops";
+                       reg = <0x00 0x9ca00000 0x00 0x00100000>;
+                       record-size = <0x8000>;
+                       console-size = <0x8000>;
+                       ftrace-size = <0x00>;
+                       pmsg-size = <0x8000>;
+               };
+
                secure_tfa_ddr: tfa@9e780000 {
                        reg = <0x00 0x9e780000 0x00 0x80000>;
                        alignment = <0x1000>;
index f64b368..ada0057 100644 (file)
                compatible = "ti,k2g-sci";
                ti,host-id = <12>;
                mbox-names = "rx", "tx";
-               mboxes= <&secure_proxy_main 12>,
+               mboxes = <&secure_proxy_main 12>,
                        <&secure_proxy_main 13>;
                reg-names = "debug_messages";
                reg = <0x00 0x44043000 0x00 0xfe0>;
                clock-names = "clk_ahb", "clk_xin";
                mmc-ddr-1_8v;
                mmc-hs200-1_8v;
-               mmc-hs400-1_8v;
                ti,trm-icp = <0x2>;
                ti,otap-del-sel-legacy = <0x0>;
                ti,otap-del-sel-mmc-hs = <0x0>;
                ti,otap-del-sel-ddr52 = <0x6>;
                ti,otap-del-sel-hs200 = <0x7>;
-               ti,otap-del-sel-hs400 = <0x4>;
        };
 
        sdhci1: mmc@fa00000 {
                      <0x00 0x20718000 0x00 0x8000>;
                reg-names = "m_can", "message_ram";
                power-domains = <&k3_pds 99 TI_SCI_PD_EXCLUSIVE>;
-               clocks =  <&k3_clks 99 5>, <&k3_clks 99 0>;
+               clocks = <&k3_clks 99 5>, <&k3_clks 99 0>;
                clock-names = "hclk", "cclk";
                interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>,
                             <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
index 8e7893e..ad150c7 100644 (file)
@@ -13,7 +13,7 @@
 #include "k3-am642.dtsi"
 
 / {
-       compatible =  "ti,am642-evm", "ti,am642";
+       compatible = "ti,am642-evm", "ti,am642";
        model = "Texas Instruments AM642 EVM";
 
        chosen {
index 59f506c..2620469 100644 (file)
@@ -12,7 +12,7 @@
 #include "k3-am642.dtsi"
 
 / {
-       compatible =  "ti,am642-sk", "ti,am642";
+       compatible = "ti,am642-sk", "ti,am642";
        model = "Texas Instruments AM642 SK";
 
        chosen {
                >;
        };
 
+       main_uart0_pins_default: main-uart0-pins-default {
+               pinctrl-single,pins = <
+                       AM64X_IOPAD(0x0238, PIN_INPUT, 0) /* (B16) UART0_CTSn */
+                       AM64X_IOPAD(0x023c, PIN_OUTPUT, 0) /* (A16) UART0_RTSn */
+                       AM64X_IOPAD(0x0230, PIN_INPUT, 0) /* (D15) UART0_RXD */
+                       AM64X_IOPAD(0x0234, PIN_OUTPUT, 0) /* (C16) UART0_TXD */
+               >;
+       };
+
        main_usb0_pins_default: main-usb0-pins-default {
                pinctrl-single,pins = <
                        AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */
        status = "disabled";
 };
 
+&main_uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&main_uart0_pins_default>;
+};
+
 &main_uart1 {
        /* main_uart1 is reserved for firmware usage */
        status = "reserved";
index 6e41f2f..32b7972 100644 (file)
 
        psu: regulator@60 {
                compatible = "ti,tps62363";
-               reg =  <0x60>;
+               reg = <0x60>;
                regulator-name = "tps62363-vout";
                regulator-min-microvolt = <500000>;
                regulator-max-microvolt = <1500000>;
        pinctrl-0 = <&mcu_spi0_pins_default>;
 
        #address-cells = <1>;
-       #size-cells= <0>;
+       #size-cells = <0>;
        ti,pindir-d0-out-d1-in;
 };
 
index e749343..8919fed 100644 (file)
 
        pcie0_rc: pcie@5500000 {
                compatible = "ti,am654-pcie-rc";
-               reg =  <0x0 0x5500000 0x0 0x1000>, <0x0 0x5501000 0x0 0x1000>, <0x0 0x10000000 0x0 0x2000>, <0x0 0x5506000 0x0 0x1000>;
+               reg = <0x0 0x5500000 0x0 0x1000>, <0x0 0x5501000 0x0 0x1000>, <0x0 0x10000000 0x0 0x2000>, <0x0 0x5506000 0x0 0x1000>;
                reg-names = "app", "dbics", "config", "atu";
                power-domains = <&k3_pds 120 TI_SCI_PD_EXCLUSIVE>;
                #address-cells = <3>;
 
        pcie0_ep: pcie-ep@5500000 {
                compatible = "ti,am654-pcie-ep";
-               reg =  <0x0 0x5500000 0x0 0x1000>, <0x0 0x5501000 0x0 0x1000>, <0x0 0x10000000 0x0 0x8000000>, <0x0 0x5506000 0x0 0x1000>;
+               reg = <0x0 0x5500000 0x0 0x1000>, <0x0 0x5501000 0x0 0x1000>, <0x0 0x10000000 0x0 0x8000000>, <0x0 0x5506000 0x0 0x1000>;
                reg-names = "app", "dbics", "addr_space", "atu";
                power-domains = <&k3_pds 120 TI_SCI_PD_EXCLUSIVE>;
                ti,syscon-pcie-mode = <&pcie0_mode>;
 
        pcie1_rc: pcie@5600000 {
                compatible = "ti,am654-pcie-rc";
-               reg =  <0x0 0x5600000 0x0 0x1000>, <0x0 0x5601000 0x0 0x1000>, <0x0 0x18000000 0x0 0x2000>, <0x0 0x5606000 0x0 0x1000>;
+               reg = <0x0 0x5600000 0x0 0x1000>, <0x0 0x5601000 0x0 0x1000>, <0x0 0x18000000 0x0 0x2000>, <0x0 0x5606000 0x0 0x1000>;
                reg-names = "app", "dbics", "config", "atu";
                power-domains = <&k3_pds 121 TI_SCI_PD_EXCLUSIVE>;
                #address-cells = <3>;
 
        pcie1_ep: pcie-ep@5600000 {
                compatible = "ti,am654-pcie-ep";
-               reg =  <0x0 0x5600000 0x0 0x1000>, <0x0 0x5601000 0x0 0x1000>, <0x0 0x18000000 0x0 0x4000000>, <0x0 0x5606000 0x0 0x1000>;
+               reg = <0x0 0x5600000 0x0 0x1000>, <0x0 0x5601000 0x0 0x1000>, <0x0 0x18000000 0x0 0x4000000>, <0x0 0x5606000 0x0 0x1000>;
                reg-names = "app", "dbics", "addr_space", "atu";
                power-domains = <&k3_pds 121 TI_SCI_PD_EXCLUSIVE>;
                ti,syscon-pcie-mode = <&pcie1_mode>;
 
                power-domains = <&k3_pds 67 TI_SCI_PD_EXCLUSIVE>;
 
-               clocks =        <&k3_clks 67 1>,
-                               <&k3_clks 216 1>,
-                               <&k3_clks 67 2>;
+               clocks = <&k3_clks 67 1>,
+                        <&k3_clks 216 1>,
+                        <&k3_clks 67 2>;
                clock-names = "fck", "vp1", "vp2";
 
                /*
index 9c69d09..fa11d71 100644 (file)
@@ -12,8 +12,8 @@
 
                mbox-names = "rx", "tx";
 
-               mboxes= <&secure_proxy_main 11>,
-                       <&secure_proxy_main 13>;
+               mboxes = <&secure_proxy_main 11>,
+                        <&secure_proxy_main 13>;
 
                reg-names = "debug_messages";
                reg = <0x44083000 0x1000>;
index 57497cb..5850582 100644 (file)
@@ -10,7 +10,7 @@
 #include <dt-bindings/net/ti-dp83867.h>
 
 / {
-       compatible =  "ti,am654-evm", "ti,am654";
+       compatible = "ti,am654-evm", "ti,am654";
        model = "Texas Instruments AM654 Base Board";
 
        chosen {
                pinctrl-names = "default";
                pinctrl-0 = <&push_button_pins_default>;
 
-               sw5 {
+               switch-5 {
                        label = "GPIO Key USER1";
                        linux,code = <BTN_0>;
                        gpios = <&wkup_gpio0 24 GPIO_ACTIVE_LOW>;
                };
 
-               sw6 {
+               switch-6 {
                        label = "GPIO Key USER2";
                        linux,code = <BTN_1>;
                        gpios = <&wkup_gpio0 27 GPIO_ACTIVE_LOW>;
        pinctrl-names = "default";
        pinctrl-0 = <&main_spi0_pins_default>;
        #address-cells = <1>;
-       #size-cells= <0>;
+       #size-cells = <0>;
        ti,pindir-d0-out-d1-in;
 
        flash@0 {
index 1044ec6..ff13bbe 100644 (file)
@@ -12,8 +12,8 @@
 
                mbox-names = "rx", "tx";
 
-               mboxes= <&secure_proxy_main 11>,
-                       <&secure_proxy_main 13>;
+               mboxes = <&secure_proxy_main 11>,
+                        <&secure_proxy_main 13>;
 
                reg-names = "debug_messages";
                reg = <0x00 0x44083000 0x00 0x1000>;
index 2bc26a2..b1691ac 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&sw10_button_pins_default &sw11_button_pins_default>;
 
-               sw10: sw10 {
+               sw10: switch-10 {
                        label = "GPIO Key USER1";
                        linux,code = <BTN_0>;
                        gpios = <&main_gpio0 0 GPIO_ACTIVE_LOW>;
                };
 
-               sw11: sw11 {
+               sw11: switch-11 {
                        label = "GPIO Key USER2";
                        linux,code = <BTN_1>;
                        gpios = <&wkup_gpio0 7 GPIO_ACTIVE_LOW>;
index b4972df..df08724 100644 (file)
@@ -12,8 +12,8 @@
 
                mbox-names = "rx", "tx";
 
-               mboxes= <&secure_proxy_main 11>,
-                       <&secure_proxy_main 13>;
+               mboxes = <&secure_proxy_main 11>,
+                        <&secure_proxy_main 13>;
 
                reg-names = "debug_messages";
                reg = <0x00 0x44083000 0x0 0x1000>;
index be7f392..34e7d57 100644 (file)
@@ -33,7 +33,7 @@
                ranges;
                #interrupt-cells = <3>;
                interrupt-controller;
-               reg = <0x00 0x01800000 0x00 0x200000>, /* GICD */
+               reg = <0x00 0x01800000 0x00 0x100000>, /* GICD */
                      <0x00 0x01900000 0x00 0x100000>, /* GICR */
                      <0x00 0x6f000000 0x00 0x2000>,   /* GICC */
                      <0x00 0x6f010000 0x00 0x1000>,   /* GICH */
                interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
                power-domains = <&k3_pds 98 TI_SCI_PD_EXCLUSIVE>;
                clocks = <&k3_clks 98 7>, <&k3_clks 98 1>;
-               clock-names =  "clk_ahb", "clk_xin";
+               clock-names = "clk_ahb", "clk_xin";
                assigned-clocks = <&k3_clks 98 1>;
                assigned-clock-parents = <&k3_clks 98 2>;
                bus-width = <8>;
                interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
                power-domains = <&k3_pds 99 TI_SCI_PD_EXCLUSIVE>;
                clocks = <&k3_clks 99 8>, <&k3_clks 99 1>;
-               clock-names =  "clk_ahb", "clk_xin";
+               clock-names = "clk_ahb", "clk_xin";
                assigned-clocks = <&k3_clks 99 1>;
                assigned-clock-parents = <&k3_clks 99 2>;
                bus-width = <4>;
index 6c5c02e..4d1bfab 100644 (file)
@@ -12,8 +12,8 @@
 
                mbox-names = "rx", "tx";
 
-               mboxes= <&secure_proxy_main 11>,
-                       <&secure_proxy_main 13>;
+               mboxes = <&secure_proxy_main 11>,
+                        <&secure_proxy_main 13>;
 
                reg-names = "debug_messages";
                reg = <0x00 0x44083000 0x00 0x1000>;
index 8493dd7..e172fa0 100644 (file)
        clocks = <&zynqmp_clk LPD_WDT>;
 };
 
+&xilinx_ams {
+       clocks = <&zynqmp_clk AMS_REF>;
+};
+
 &zynqmp_dpdma {
        clocks = <&zynqmp_clk DPDMA_REF>;
 };
index 550b389..20e83ca 100644 (file)
@@ -52,7 +52,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               fwuen {
+               key-fwuen {
                        label = "fwuen";
                        gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
                };
                          "", "", "", "", "", /* 155 - 159 */
                          "", "", "", "", "", /* 160 - 164 */
                          "", "", "", "", "", /* 165 - 169 */
-                         "", "", "", ""; /* 170 - 174 */
+                         "", "", "", ""; /* 170 - 173 */
 };
index f6aad41..d61a297 100644 (file)
@@ -49,7 +49,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               sw4 {
+               switch-4 {
                        label = "sw4";
                        gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;
index 7b9a88b..5fd6b70 100644 (file)
@@ -47,7 +47,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               sw19 {
+               switch-19 {
                        label = "sw19";
                        gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_DOWN>;
index 20b7c75..e2dd72f 100644 (file)
@@ -47,7 +47,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               sw19 {
+               switch-19 {
                        label = "sw19";
                        gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_DOWN>;
index e36df6a..d685d8f 100644 (file)
@@ -47,7 +47,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               sw19 {
+               switch-19 {
                        label = "sw19";
                        gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_DOWN>;
index c715a18..a549265 100644 (file)
                        timeout-sec = <10>;
                };
 
+               xilinx_ams: ams@ffa50000 {
+                       compatible = "xlnx,zynqmp-ams";
+                       status = "disabled";
+                       interrupt-parent = <&gic>;
+                       interrupts = <0 56 4>;
+                       reg = <0x0 0xffa50000 0x0 0x800>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       #io-channel-cells = <1>;
+                       ranges = <0 0 0xffa50800 0x800>;
+
+                       ams_ps: ams_ps@0 {
+                               compatible = "xlnx,zynqmp-ams-ps";
+                               status = "disabled";
+                               reg = <0x0 0x400>;
+                       };
+
+                       ams_pl: ams_pl@400 {
+                               compatible = "xlnx,zynqmp-ams-pl";
+                               status = "disabled";
+                               reg = <0x400 0x400>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
                zynqmp_dpdma: dma-controller@fd4c0000 {
                        compatible = "xlnx,zynqmp-dpdma";
                        status = "disabled";
index 47a1e25..de32152 100644 (file)
@@ -362,11 +362,6 @@ struct kvm_vcpu_arch {
        struct arch_timer_cpu timer_cpu;
        struct kvm_pmu pmu;
 
-       /*
-        * Anything that is not used directly from assembly code goes
-        * here.
-        */
-
        /*
         * Guest registers we preserve during guest debugging.
         *
index 55f998c..42ff95d 100644 (file)
 #define ID_AA64SMFR0_F32F32_SHIFT      32
 
 #define ID_AA64SMFR0_FA64              0x1
-#define ID_AA64SMFR0_I16I64            0x4
+#define ID_AA64SMFR0_I16I64            0xf
 #define ID_AA64SMFR0_F64F64            0x1
-#define ID_AA64SMFR0_I8I32             0x4
+#define ID_AA64SMFR0_I8I32             0xf
 #define ID_AA64SMFR0_F16F32            0x1
 #define ID_AA64SMFR0_B16F32            0x1
 #define ID_AA64SMFR0_F32F32            0x1
index 3c8af03..0e80db4 100644 (file)
@@ -113,6 +113,9 @@ static __always_inline bool has_vhe(void)
        /*
         * Code only run in VHE/NVHE hyp context can assume VHE is present or
         * absent. Otherwise fall back to caps.
+        * This allows the compiler to discard VHE-specific code from the
+        * nVHE object, reducing the number of external symbol references
+        * needed to link.
         */
        if (is_vhe_hyp_code())
                return true;
diff --git a/arch/arm64/include/asm/xen/xen-ops.h b/arch/arm64/include/asm/xen/xen-ops.h
new file mode 100644 (file)
index 0000000..7ebb7eb
--- /dev/null
@@ -0,0 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <xen/arm/xen-ops.h>
index 42ea2bd..8d88433 100644 (file)
@@ -1974,15 +1974,7 @@ static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap)
 #ifdef CONFIG_KVM
 static bool is_kvm_protected_mode(const struct arm64_cpu_capabilities *entry, int __unused)
 {
-       if (kvm_get_mode() != KVM_MODE_PROTECTED)
-               return false;
-
-       if (is_kernel_in_hyp_mode()) {
-               pr_warn("Protected KVM not available with VHE\n");
-               return false;
-       }
-
-       return true;
+       return kvm_get_mode() == KVM_MODE_PROTECTED;
 }
 #endif /* CONFIG_KVM */
 
@@ -3109,7 +3101,6 @@ void cpu_set_feature(unsigned int num)
        WARN_ON(num >= MAX_CPU_FEATURES);
        elf_hwcap |= BIT(num);
 }
-EXPORT_SYMBOL_GPL(cpu_set_feature);
 
 bool cpu_have_feature(unsigned int num)
 {
index d42a205..bd5df50 100644 (file)
@@ -102,7 +102,6 @@ SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL)
  * x19-x29 per the AAPCS, and we created frame records upon entry, so we need
  * to restore x0-x8, x29, and x30.
  */
-ftrace_common_return:
        /* Restore function arguments */
        ldp     x0, x1, [sp]
        ldp     x2, x3, [sp, #S_X2]
index 8199793..aecf307 100644 (file)
@@ -331,7 +331,7 @@ void task_set_vl_onexec(struct task_struct *task, enum vec_type type,
  *    trapping to the kernel.
  *
  *    When stored, Z0-Z31 (incorporating Vn in bits[127:0] or the
- *    corresponding Zn), P0-P15 and FFR are encoded in in
+ *    corresponding Zn), P0-P15 and FFR are encoded in
  *    task->thread.sve_state, formatted appropriately for vector
  *    length task->thread.sve_vl or, if SVCR.SM is set,
  *    task->thread.sme_vl.
@@ -1916,10 +1916,15 @@ void __efi_fpsimd_begin(void)
                        if (system_supports_sme()) {
                                svcr = read_sysreg_s(SYS_SVCR);
 
-                               if (!system_supports_fa64())
-                                       ffr = svcr & SVCR_SM_MASK;
+                               __this_cpu_write(efi_sm_state,
+                                                svcr & SVCR_SM_MASK);
 
-                               __this_cpu_write(efi_sm_state, ffr);
+                               /*
+                                * Unless we have FA64 FFR does not
+                                * exist in streaming mode.
+                                */
+                               if (!system_supports_fa64())
+                                       ffr = !(svcr & SVCR_SM_MASK);
                        }
 
                        sve_save_state(sve_state + sve_ffr_offset(sve_max_vl()),
@@ -1964,8 +1969,13 @@ void __efi_fpsimd_end(void)
                                        sysreg_clear_set_s(SYS_SVCR,
                                                           0,
                                                           SVCR_SM_MASK);
+
+                                       /*
+                                        * Unless we have FA64 FFR does not
+                                        * exist in streaming mode.
+                                        */
                                        if (!system_supports_fa64())
-                                               ffr = efi_sm_state;
+                                               ffr = false;
                                }
                        }
 
index f447c4a..ea5dc7c 100644 (file)
@@ -78,47 +78,76 @@ static struct plt_entry *get_ftrace_plt(struct module *mod, unsigned long addr)
 }
 
 /*
- * Turn on the call to ftrace_caller() in instrumented function
+ * Find the address the callsite must branch to in order to reach '*addr'.
+ *
+ * Due to the limited range of 'BL' instructions, modules may be placed too far
+ * away to branch directly and must use a PLT.
+ *
+ * Returns true when '*addr' contains a reachable target address, or has been
+ * modified to contain a PLT address. Returns false otherwise.
  */
-int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
+static bool ftrace_find_callable_addr(struct dyn_ftrace *rec,
+                                     struct module *mod,
+                                     unsigned long *addr)
 {
        unsigned long pc = rec->ip;
-       u32 old, new;
-       long offset = (long)pc - (long)addr;
+       long offset = (long)*addr - (long)pc;
+       struct plt_entry *plt;
 
-       if (offset < -SZ_128M || offset >= SZ_128M) {
-               struct module *mod;
-               struct plt_entry *plt;
+       /*
+        * When the target is within range of the 'BL' instruction, use 'addr'
+        * as-is and branch to that directly.
+        */
+       if (offset >= -SZ_128M && offset < SZ_128M)
+               return true;
 
-               if (!IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
-                       return -EINVAL;
+       /*
+        * When the target is outside of the range of a 'BL' instruction, we
+        * must use a PLT to reach it. We can only place PLTs for modules, and
+        * only when module PLT support is built-in.
+        */
+       if (!IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
+               return false;
 
-               /*
-                * On kernels that support module PLTs, the offset between the
-                * branch instruction and its target may legally exceed the
-                * range of an ordinary relative 'bl' opcode. In this case, we
-                * need to branch via a trampoline in the module.
-                *
-                * NOTE: __module_text_address() must be called with preemption
-                * disabled, but we can rely on ftrace_lock to ensure that 'mod'
-                * retains its validity throughout the remainder of this code.
-                */
+       /*
+        * 'mod' is only set at module load time, but if we end up
+        * dealing with an out-of-range condition, we can assume it
+        * is due to a module being loaded far away from the kernel.
+        *
+        * NOTE: __module_text_address() must be called with preemption
+        * disabled, but we can rely on ftrace_lock to ensure that 'mod'
+        * retains its validity throughout the remainder of this code.
+        */
+       if (!mod) {
                preempt_disable();
                mod = __module_text_address(pc);
                preempt_enable();
+       }
 
-               if (WARN_ON(!mod))
-                       return -EINVAL;
+       if (WARN_ON(!mod))
+               return false;
 
-               plt = get_ftrace_plt(mod, addr);
-               if (!plt) {
-                       pr_err("ftrace: no module PLT for %ps\n", (void *)addr);
-                       return -EINVAL;
-               }
-
-               addr = (unsigned long)plt;
+       plt = get_ftrace_plt(mod, *addr);
+       if (!plt) {
+               pr_err("ftrace: no module PLT for %ps\n", (void *)*addr);
+               return false;
        }
 
+       *addr = (unsigned long)plt;
+       return true;
+}
+
+/*
+ * Turn on the call to ftrace_caller() in instrumented function
+ */
+int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
+{
+       unsigned long pc = rec->ip;
+       u32 old, new;
+
+       if (!ftrace_find_callable_addr(rec, NULL, &addr))
+               return -EINVAL;
+
        old = aarch64_insn_gen_nop();
        new = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK);
 
@@ -132,6 +161,11 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
        unsigned long pc = rec->ip;
        u32 old, new;
 
+       if (!ftrace_find_callable_addr(rec, NULL, &old_addr))
+               return -EINVAL;
+       if (!ftrace_find_callable_addr(rec, NULL, &addr))
+               return -EINVAL;
+
        old = aarch64_insn_gen_branch_imm(pc, old_addr,
                                          AARCH64_INSN_BRANCH_LINK);
        new = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK);
@@ -181,54 +215,15 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
                    unsigned long addr)
 {
        unsigned long pc = rec->ip;
-       bool validate = true;
        u32 old = 0, new;
-       long offset = (long)pc - (long)addr;
 
-       if (offset < -SZ_128M || offset >= SZ_128M) {
-               u32 replaced;
-
-               if (!IS_ENABLED(CONFIG_ARM64_MODULE_PLTS))
-                       return -EINVAL;
-
-               /*
-                * 'mod' is only set at module load time, but if we end up
-                * dealing with an out-of-range condition, we can assume it
-                * is due to a module being loaded far away from the kernel.
-                */
-               if (!mod) {
-                       preempt_disable();
-                       mod = __module_text_address(pc);
-                       preempt_enable();
-
-                       if (WARN_ON(!mod))
-                               return -EINVAL;
-               }
-
-               /*
-                * The instruction we are about to patch may be a branch and
-                * link instruction that was redirected via a PLT entry. In
-                * this case, the normal validation will fail, but we can at
-                * least check that we are dealing with a branch and link
-                * instruction that points into the right module.
-                */
-               if (aarch64_insn_read((void *)pc, &replaced))
-                       return -EFAULT;
-
-               if (!aarch64_insn_is_bl(replaced) ||
-                   !within_module(pc + aarch64_get_branch_offset(replaced),
-                                  mod))
-                       return -EINVAL;
-
-               validate = false;
-       } else {
-               old = aarch64_insn_gen_branch_imm(pc, addr,
-                                                 AARCH64_INSN_BRANCH_LINK);
-       }
+       if (!ftrace_find_callable_addr(rec, mod, &addr))
+               return -EINVAL;
 
+       old = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK);
        new = aarch64_insn_gen_nop();
 
-       return ftrace_modify_code(pc, old, new, validate);
+       return ftrace_modify_code(pc, old, new, true);
 }
 
 void arch_ftrace_update_code(int command)
index 57b30bc..f6b0074 100644 (file)
@@ -244,6 +244,11 @@ static void mte_update_gcr_excl(struct task_struct *task)
                SYS_GCR_EL1);
 }
 
+#ifdef CONFIG_KASAN_HW_TAGS
+/* Only called from assembly, silence sparse */
+void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
+                                __le32 *updptr, int nr_inst);
+
 void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
                                 __le32 *updptr, int nr_inst)
 {
@@ -252,6 +257,7 @@ void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
        if (kasan_hw_tags_enabled())
                *updptr = cpu_to_le32(aarch64_insn_gen_nop());
 }
+#endif
 
 void mte_thread_init_user(void)
 {
index cf3a759..fea3223 100644 (file)
@@ -303,14 +303,13 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p)
        early_fixmap_init();
        early_ioremap_init();
 
+       setup_machine_fdt(__fdt_pointer);
+
        /*
         * Initialise the static keys early as they may be enabled by the
-        * cpufeature code, early parameters, and DT setup.
+        * cpufeature code and early parameters.
         */
        jump_label_init();
-
-       setup_machine_fdt(__fdt_pointer);
-
        parse_early_param();
 
        /*
index 4e39ace..3b8d062 100644 (file)
@@ -1230,6 +1230,9 @@ bool kvm_arch_timer_get_input_level(int vintid)
        struct kvm_vcpu *vcpu = kvm_get_running_vcpu();
        struct arch_timer_context *timer;
 
+       if (WARN(!vcpu, "No vcpu context!\n"))
+               return false;
+
        if (vintid == vcpu_vtimer(vcpu)->irq.irq)
                timer = vcpu_vtimer(vcpu);
        else if (vintid == vcpu_ptimer(vcpu)->irq.irq)
index 400bb0f..83a7f61 100644 (file)
@@ -150,8 +150,10 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
        if (ret)
                goto out_free_stage2_pgd;
 
-       if (!zalloc_cpumask_var(&kvm->arch.supported_cpus, GFP_KERNEL))
+       if (!zalloc_cpumask_var(&kvm->arch.supported_cpus, GFP_KERNEL)) {
+               ret = -ENOMEM;
                goto out_free_stage2_pgd;
+       }
        cpumask_copy(kvm->arch.supported_cpus, cpu_possible_mask);
 
        kvm_vgic_early_init(kvm);
@@ -2110,11 +2112,11 @@ static int finalize_hyp_mode(void)
                return 0;
 
        /*
-        * Exclude HYP BSS from kmemleak so that it doesn't get peeked
-        * at, which would end badly once the section is inaccessible.
-        * None of other sections should ever be introspected.
+        * Exclude HYP sections from kmemleak so that they don't get peeked
+        * at, which would end badly once inaccessible.
         */
        kmemleak_free_part(__hyp_bss_start, __hyp_bss_end - __hyp_bss_start);
+       kmemleak_free_part(__va(hyp_mem_base), hyp_mem_size);
        return pkvm_drop_host_privileges();
 }
 
@@ -2271,7 +2273,11 @@ static int __init early_kvm_mode_cfg(char *arg)
                return -EINVAL;
 
        if (strcmp(arg, "protected") == 0) {
-               kvm_mode = KVM_MODE_PROTECTED;
+               if (!is_kernel_in_hyp_mode())
+                       kvm_mode = KVM_MODE_PROTECTED;
+               else
+                       pr_warn_once("Protected KVM not available with VHE\n");
+
                return 0;
        }
 
index 3d251a4..6012b08 100644 (file)
@@ -80,6 +80,7 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
        vcpu->arch.flags &= ~KVM_ARM64_FP_ENABLED;
        vcpu->arch.flags |= KVM_ARM64_FP_HOST;
 
+       vcpu->arch.flags &= ~KVM_ARM64_HOST_SVE_ENABLED;
        if (read_sysreg(cpacr_el1) & CPACR_EL1_ZEN_EL0EN)
                vcpu->arch.flags |= KVM_ARM64_HOST_SVE_ENABLED;
 
@@ -93,6 +94,7 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
         * operations. Do this for ZA as well for now for simplicity.
         */
        if (system_supports_sme()) {
+               vcpu->arch.flags &= ~KVM_ARM64_HOST_SME_ENABLED;
                if (read_sysreg(cpacr_el1) & CPACR_EL1_SMEN_EL0EN)
                        vcpu->arch.flags |= KVM_ARM64_HOST_SME_ENABLED;
 
index 78edf07..1e78acf 100644 (file)
@@ -314,15 +314,11 @@ static int host_stage2_adjust_range(u64 addr, struct kvm_mem_range *range)
 int host_stage2_idmap_locked(phys_addr_t addr, u64 size,
                             enum kvm_pgtable_prot prot)
 {
-       hyp_assert_lock_held(&host_kvm.lock);
-
        return host_stage2_try(__host_stage2_idmap, addr, addr + size, prot);
 }
 
 int host_stage2_set_owner_locked(phys_addr_t addr, u64 size, u8 owner_id)
 {
-       hyp_assert_lock_held(&host_kvm.lock);
-
        return host_stage2_try(kvm_pgtable_stage2_set_owner, &host_kvm.pgt,
                               addr, size, &host_s2_pool, owner_id);
 }
index b6d86e4..35a4331 100644 (file)
@@ -243,15 +243,9 @@ u64 pvm_read_id_reg(const struct kvm_vcpu *vcpu, u32 id)
        case SYS_ID_AA64MMFR2_EL1:
                return get_pvm_id_aa64mmfr2(vcpu);
        default:
-               /*
-                * Should never happen because all cases are covered in
-                * pvm_sys_reg_descs[].
-                */
-               WARN_ON(1);
-               break;
+               /* Unhandled ID register, RAZ */
+               return 0;
        }
-
-       return 0;
 }
 
 static u64 read_id_reg(const struct kvm_vcpu *vcpu,
@@ -332,6 +326,16 @@ static bool pvm_gic_read_sre(struct kvm_vcpu *vcpu,
 /* Mark the specified system register as an AArch64 feature id register. */
 #define AARCH64(REG) { SYS_DESC(REG), .access = pvm_access_id_aarch64 }
 
+/*
+ * sys_reg_desc initialiser for architecturally unallocated cpufeature ID
+ * register with encoding Op0=3, Op1=0, CRn=0, CRm=crm, Op2=op2
+ * (1 <= crm < 8, 0 <= Op2 < 8).
+ */
+#define ID_UNALLOCATED(crm, op2) {                     \
+       Op0(3), Op1(0), CRn(0), CRm(crm), Op2(op2),     \
+       .access = pvm_access_id_aarch64,                \
+}
+
 /* Mark the specified system register as Read-As-Zero/Write-Ignored */
 #define RAZ_WI(REG) { SYS_DESC(REG), .access = pvm_access_raz_wi }
 
@@ -375,24 +379,46 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = {
        AARCH32(SYS_MVFR0_EL1),
        AARCH32(SYS_MVFR1_EL1),
        AARCH32(SYS_MVFR2_EL1),
+       ID_UNALLOCATED(3,3),
        AARCH32(SYS_ID_PFR2_EL1),
        AARCH32(SYS_ID_DFR1_EL1),
        AARCH32(SYS_ID_MMFR5_EL1),
+       ID_UNALLOCATED(3,7),
 
        /* AArch64 ID registers */
        /* CRm=4 */
        AARCH64(SYS_ID_AA64PFR0_EL1),
        AARCH64(SYS_ID_AA64PFR1_EL1),
+       ID_UNALLOCATED(4,2),
+       ID_UNALLOCATED(4,3),
        AARCH64(SYS_ID_AA64ZFR0_EL1),
+       ID_UNALLOCATED(4,5),
+       ID_UNALLOCATED(4,6),
+       ID_UNALLOCATED(4,7),
        AARCH64(SYS_ID_AA64DFR0_EL1),
        AARCH64(SYS_ID_AA64DFR1_EL1),
+       ID_UNALLOCATED(5,2),
+       ID_UNALLOCATED(5,3),
        AARCH64(SYS_ID_AA64AFR0_EL1),
        AARCH64(SYS_ID_AA64AFR1_EL1),
+       ID_UNALLOCATED(5,6),
+       ID_UNALLOCATED(5,7),
        AARCH64(SYS_ID_AA64ISAR0_EL1),
        AARCH64(SYS_ID_AA64ISAR1_EL1),
+       AARCH64(SYS_ID_AA64ISAR2_EL1),
+       ID_UNALLOCATED(6,3),
+       ID_UNALLOCATED(6,4),
+       ID_UNALLOCATED(6,5),
+       ID_UNALLOCATED(6,6),
+       ID_UNALLOCATED(6,7),
        AARCH64(SYS_ID_AA64MMFR0_EL1),
        AARCH64(SYS_ID_AA64MMFR1_EL1),
        AARCH64(SYS_ID_AA64MMFR2_EL1),
+       ID_UNALLOCATED(7,3),
+       ID_UNALLOCATED(7,4),
+       ID_UNALLOCATED(7,5),
+       ID_UNALLOCATED(7,6),
+       ID_UNALLOCATED(7,7),
 
        /* Scalable Vector Registers are restricted. */
 
index 77a67e9..e070cda 100644 (file)
@@ -429,11 +429,11 @@ static const struct vgic_register_region vgic_v2_dist_registers[] = {
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_BITS_PER_IRQ(GIC_DIST_PENDING_SET,
                vgic_mmio_read_pending, vgic_mmio_write_spending,
-               NULL, vgic_uaccess_write_spending, 1,
+               vgic_uaccess_read_pending, vgic_uaccess_write_spending, 1,
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_BITS_PER_IRQ(GIC_DIST_PENDING_CLEAR,
                vgic_mmio_read_pending, vgic_mmio_write_cpending,
-               NULL, vgic_uaccess_write_cpending, 1,
+               vgic_uaccess_read_pending, vgic_uaccess_write_cpending, 1,
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_BITS_PER_IRQ(GIC_DIST_ACTIVE_SET,
                vgic_mmio_read_active, vgic_mmio_write_sactive,
index f7aa7bc..f15e29c 100644 (file)
@@ -353,42 +353,6 @@ static unsigned long vgic_mmio_read_v3_idregs(struct kvm_vcpu *vcpu,
        return 0;
 }
 
-static unsigned long vgic_v3_uaccess_read_pending(struct kvm_vcpu *vcpu,
-                                                 gpa_t addr, unsigned int len)
-{
-       u32 intid = VGIC_ADDR_TO_INTID(addr, 1);
-       u32 value = 0;
-       int i;
-
-       /*
-        * pending state of interrupt is latched in pending_latch variable.
-        * Userspace will save and restore pending state and line_level
-        * separately.
-        * Refer to Documentation/virt/kvm/devices/arm-vgic-v3.rst
-        * for handling of ISPENDR and ICPENDR.
-        */
-       for (i = 0; i < len * 8; i++) {
-               struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i);
-               bool state = irq->pending_latch;
-
-               if (irq->hw && vgic_irq_is_sgi(irq->intid)) {
-                       int err;
-
-                       err = irq_get_irqchip_state(irq->host_irq,
-                                                   IRQCHIP_STATE_PENDING,
-                                                   &state);
-                       WARN_ON(err);
-               }
-
-               if (state)
-                       value |= (1U << i);
-
-               vgic_put_irq(vcpu->kvm, irq);
-       }
-
-       return value;
-}
-
 static int vgic_v3_uaccess_write_pending(struct kvm_vcpu *vcpu,
                                         gpa_t addr, unsigned int len,
                                         unsigned long val)
@@ -666,7 +630,7 @@ static const struct vgic_register_region vgic_v3_dist_registers[] = {
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_BITS_PER_IRQ_SHARED(GICD_ISPENDR,
                vgic_mmio_read_pending, vgic_mmio_write_spending,
-               vgic_v3_uaccess_read_pending, vgic_v3_uaccess_write_pending, 1,
+               vgic_uaccess_read_pending, vgic_v3_uaccess_write_pending, 1,
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_BITS_PER_IRQ_SHARED(GICD_ICPENDR,
                vgic_mmio_read_pending, vgic_mmio_write_cpending,
@@ -750,7 +714,7 @@ static const struct vgic_register_region vgic_v3_rd_registers[] = {
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_LENGTH_UACCESS(SZ_64K + GICR_ISPENDR0,
                vgic_mmio_read_pending, vgic_mmio_write_spending,
-               vgic_v3_uaccess_read_pending, vgic_v3_uaccess_write_pending, 4,
+               vgic_uaccess_read_pending, vgic_v3_uaccess_write_pending, 4,
                VGIC_ACCESS_32bit),
        REGISTER_DESC_WITH_LENGTH_UACCESS(SZ_64K + GICR_ICPENDR0,
                vgic_mmio_read_pending, vgic_mmio_write_cpending,
index 49837d3..997d0fc 100644 (file)
@@ -226,8 +226,9 @@ int vgic_uaccess_write_cenable(struct kvm_vcpu *vcpu,
        return 0;
 }
 
-unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu,
-                                    gpa_t addr, unsigned int len)
+static unsigned long __read_pending(struct kvm_vcpu *vcpu,
+                                   gpa_t addr, unsigned int len,
+                                   bool is_user)
 {
        u32 intid = VGIC_ADDR_TO_INTID(addr, 1);
        u32 value = 0;
@@ -239,6 +240,15 @@ unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu,
                unsigned long flags;
                bool val;
 
+               /*
+                * When used from userspace with a GICv3 model:
+                *
+                * Pending state of interrupt is latched in pending_latch
+                * variable.  Userspace will save and restore pending state
+                * and line_level separately.
+                * Refer to Documentation/virt/kvm/devices/arm-vgic-v3.rst
+                * for handling of ISPENDR and ICPENDR.
+                */
                raw_spin_lock_irqsave(&irq->irq_lock, flags);
                if (irq->hw && vgic_irq_is_sgi(irq->intid)) {
                        int err;
@@ -248,10 +258,20 @@ unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu,
                                                    IRQCHIP_STATE_PENDING,
                                                    &val);
                        WARN_RATELIMIT(err, "IRQ %d", irq->host_irq);
-               } else if (vgic_irq_is_mapped_level(irq)) {
+               } else if (!is_user && vgic_irq_is_mapped_level(irq)) {
                        val = vgic_get_phys_line_level(irq);
                } else {
-                       val = irq_is_pending(irq);
+                       switch (vcpu->kvm->arch.vgic.vgic_model) {
+                       case KVM_DEV_TYPE_ARM_VGIC_V3:
+                               if (is_user) {
+                                       val = irq->pending_latch;
+                                       break;
+                               }
+                               fallthrough;
+                       default:
+                               val = irq_is_pending(irq);
+                               break;
+                       }
                }
 
                value |= ((u32)val << i);
@@ -263,6 +283,18 @@ unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu,
        return value;
 }
 
+unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu,
+                                    gpa_t addr, unsigned int len)
+{
+       return __read_pending(vcpu, addr, len, false);
+}
+
+unsigned long vgic_uaccess_read_pending(struct kvm_vcpu *vcpu,
+                                       gpa_t addr, unsigned int len)
+{
+       return __read_pending(vcpu, addr, len, true);
+}
+
 static bool is_vgic_v2_sgi(struct kvm_vcpu *vcpu, struct vgic_irq *irq)
 {
        return (vgic_irq_is_sgi(irq->intid) &&
index 3fa696f..6082d4b 100644 (file)
@@ -149,6 +149,9 @@ int vgic_uaccess_write_cenable(struct kvm_vcpu *vcpu,
 unsigned long vgic_mmio_read_pending(struct kvm_vcpu *vcpu,
                                     gpa_t addr, unsigned int len);
 
+unsigned long vgic_uaccess_read_pending(struct kvm_vcpu *vcpu,
+                                       gpa_t addr, unsigned int len);
+
 void vgic_mmio_write_spending(struct kvm_vcpu *vcpu,
                              gpa_t addr, unsigned int len,
                              unsigned long val);
index 8d5f050..d78ae63 100644 (file)
@@ -66,7 +66,7 @@ static void flush_context(void)
         * the next context-switch, we broadcast TLB flush + I-cache
         * invalidation over the inner shareable domain on rollover.
         */
-        kvm_call_hyp(__kvm_flush_vm_context);
+       kvm_call_hyp(__kvm_flush_vm_context);
 }
 
 static bool check_update_reserved_vmid(u64 vmid, u64 newvmid)
index 0ea6cc2..21c9079 100644 (file)
@@ -218,8 +218,6 @@ SYM_FUNC_ALIAS(__dma_flush_area, __pi___dma_flush_area)
  */
 SYM_FUNC_START(__pi___dma_map_area)
        add     x1, x0, x1
-       cmp     w2, #DMA_FROM_DEVICE
-       b.eq    __pi_dcache_inval_poc
        b       __pi_dcache_clean_poc
 SYM_FUNC_END(__pi___dma_map_area)
 SYM_FUNC_ALIAS(__dma_map_area, __pi___dma_map_area)
index 6719f9e..6099c81 100644 (file)
@@ -9,9 +9,9 @@
 #include <linux/dma-map-ops.h>
 #include <linux/dma-iommu.h>
 #include <xen/xen.h>
-#include <xen/swiotlb-xen.h>
 
 #include <asm/cacheflush.h>
+#include <asm/xen/xen-ops.h>
 
 void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
                enum dma_data_direction dir)
@@ -52,8 +52,5 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
        if (iommu)
                iommu_setup_dma_ops(dev, dma_base, dma_base + size - 1);
 
-#ifdef CONFIG_XEN
-       if (xen_swiotlb_detect())
-               dev->dma_ops = &xen_swiotlb_dma_ops;
-#endif
+       xen_setup_dma_ops(dev);
 }
index 8ab4035..42f2e9a 100644 (file)
@@ -1478,6 +1478,7 @@ skip_init_ctx:
                        bpf_jit_binary_free(header);
                        prog->bpf_func = NULL;
                        prog->jited = 0;
+                       prog->jited_len = 0;
                        goto out_off;
                }
                bpf_jit_binary_lock_ro(header);
index 89bfb74..5c55509 100755 (executable)
@@ -253,7 +253,7 @@ END {
        next
 }
 
-/0b[01]+/ && block = "Enum" {
+/0b[01]+/ && block == "Enum" {
        expect_fields(2)
        val = $1
        name = $2
index 80657bf..1920d52 100644 (file)
@@ -343,6 +343,7 @@ config NR_CPUS
 
 config NUMA
        bool "NUMA Support"
+       select SMP
        select ACPI_NUMA if ACPI
        help
          Say Y to compile the kernel with NUMA (Non-Uniform Memory Access)
index 3f33c89..9a133e4 100644 (file)
@@ -12,10 +12,9 @@ static inline unsigned long exception_era(struct pt_regs *regs)
        return regs->csr_era;
 }
 
-static inline int compute_return_era(struct pt_regs *regs)
+static inline void compute_return_era(struct pt_regs *regs)
 {
        regs->csr_era += 4;
-       return 0;
 }
 
 #endif /* _ASM_BRANCH_H */
index befe818..0ef3b18 100644 (file)
@@ -19,7 +19,7 @@ typedef struct {
        unsigned int __softirq_pending;
 } ____cacheline_aligned irq_cpustat_t;
 
-DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat);
+DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
 
 #define __ARCH_IRQ_STAT
 
index 34f15a6..e6569f1 100644 (file)
@@ -6,6 +6,7 @@
 #define __ASM_PERCPU_H
 
 #include <asm/cmpxchg.h>
+#include <asm/loongarch.h>
 
 /* Use r21 for fast access */
 register unsigned long __my_cpu_offset __asm__("$r21");
index 5dc84d8..d9e86cf 100644 (file)
@@ -426,6 +426,11 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
 
 #define kern_addr_valid(addr)  (1)
 
+static inline unsigned long pmd_pfn(pmd_t pmd)
+{
+       return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
+}
+
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 
 /* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/
@@ -497,11 +502,6 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd)
        return pmd;
 }
 
-static inline unsigned long pmd_pfn(pmd_t pmd)
-{
-       return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
-}
-
 static inline struct page *pmd_page(pmd_t pmd)
 {
        if (pmd_trans_huge(pmd))
index 551e1f3..71189b2 100644 (file)
@@ -9,10 +9,16 @@
 #include <linux/atomic.h>
 #include <linux/bitops.h>
 #include <linux/linkage.h>
-#include <linux/smp.h>
 #include <linux/threads.h>
 #include <linux/cpumask.h>
 
+extern int smp_num_siblings;
+extern int num_processors;
+extern int disabled_cpus;
+extern cpumask_t cpu_sibling_map[];
+extern cpumask_t cpu_core_map[];
+extern cpumask_t cpu_foreign_map[];
+
 void loongson3_smp_setup(void);
 void loongson3_prepare_cpus(unsigned int max_cpus);
 void loongson3_boot_secondary(int cpu, struct task_struct *idle);
@@ -25,26 +31,11 @@ int loongson3_cpu_disable(void);
 void loongson3_cpu_die(unsigned int cpu);
 #endif
 
-#ifdef CONFIG_SMP
-
 static inline void plat_smp_setup(void)
 {
        loongson3_smp_setup();
 }
 
-#else /* !CONFIG_SMP */
-
-static inline void plat_smp_setup(void) { }
-
-#endif /* !CONFIG_SMP */
-
-extern int smp_num_siblings;
-extern int num_processors;
-extern int disabled_cpus;
-extern cpumask_t cpu_sibling_map[];
-extern cpumask_t cpu_core_map[];
-extern cpumask_t cpu_foreign_map[];
-
 static inline int raw_smp_processor_id(void)
 {
 #if defined(__VDSO__)
index d3ed99a..fb41e9e 100644 (file)
 #include <asm/cpu.h>
 #include <asm/cpu-features.h>
 
-/*
- * Standard way to access the cycle counter.
- * Currently only used on SMP for scheduling.
- *
- * We know that all SMP capable CPUs have cycle counters.
- */
-
 typedef unsigned long cycles_t;
 
 #define get_cycles get_cycles
index b16c3de..bb729ee 100644 (file)
@@ -138,6 +138,7 @@ void __init acpi_boot_table_init(void)
        }
 }
 
+#ifdef CONFIG_SMP
 static int set_processor_mask(u32 id, u32 flags)
 {
 
@@ -166,15 +167,18 @@ static int set_processor_mask(u32 id, u32 flags)
 
        return cpu;
 }
+#endif
 
 static void __init acpi_process_madt(void)
 {
+#ifdef CONFIG_SMP
        int i;
 
        for (i = 0; i < NR_CPUS; i++) {
                __cpu_number_map[i] = -1;
                __cpu_logical_map[i] = -1;
        }
+#endif
 
        loongson_sysconf.nr_cpus = num_processors;
 }
index 8c9fe29..b38f548 100644 (file)
@@ -4,6 +4,7 @@
  *
  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  */
+#include <asm/cpu-info.h>
 #include <linux/cacheinfo.h>
 
 /* Populates leaf and increments to next leaf */
index 6c87ea3..529ab8f 100644 (file)
@@ -263,7 +263,7 @@ void cpu_probe(void)
 
        c->cputype      = CPU_UNKNOWN;
        c->processor_id = read_cpucfg(LOONGARCH_CPUCFG0);
-       c->fpu_vers     = (read_cpucfg(LOONGARCH_CPUCFG2) >> 3) & 0x3;
+       c->fpu_vers     = (read_cpucfg(LOONGARCH_CPUCFG2) & CPUCFG2_FPVERS) >> 3;
 
        c->fpu_csr0     = FPU_CSR_RN;
        c->fpu_mask     = FPU_CSR_RSVD;
index e596dfc..d01e62d 100644 (file)
@@ -14,8 +14,6 @@
 
        __REF
 
-SYM_ENTRY(_stext, SYM_L_GLOBAL, SYM_A_NONE)
-
 SYM_CODE_START(kernel_entry)                   # kernel entry point
 
        /* Config direct window and set PG */
index 4b671d3..b34b8d7 100644 (file)
@@ -22,6 +22,8 @@
 #include <asm/setup.h>
 
 DEFINE_PER_CPU(unsigned long, irq_stack);
+DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
+EXPORT_PER_CPU_SYMBOL(irq_stat);
 
 struct irq_domain *cpu_domain;
 struct irq_domain *liointc_domain;
@@ -56,8 +58,11 @@ int arch_show_interrupts(struct seq_file *p, int prec)
 
 void __init init_IRQ(void)
 {
-       int i, r, ipi_irq;
+       int i;
+#ifdef CONFIG_SMP
+       int r, ipi_irq;
        static int ipi_dummy_dev;
+#endif
        unsigned int order = get_order(IRQ_STACK_SIZE);
        struct page *page;
 
index 6d944d6..bfa0dfe 100644 (file)
@@ -120,10 +120,12 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 /*
  * Copy architecture-specific thread state
  */
-int copy_thread(unsigned long clone_flags, unsigned long usp,
-       unsigned long kthread_arg, struct task_struct *p, unsigned long tls)
+int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
 {
        unsigned long childksp;
+       unsigned long tls = args->tls;
+       unsigned long usp = args->stack;
+       unsigned long clone_flags = args->flags;
        struct pt_regs *childregs, *regs = current_pt_regs();
 
        childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32;
@@ -136,12 +138,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        p->thread.csr_crmd = csr_read32(LOONGARCH_CSR_CRMD);
        p->thread.csr_prmd = csr_read32(LOONGARCH_CSR_PRMD);
        p->thread.csr_ecfg = csr_read32(LOONGARCH_CSR_ECFG);
-       if (unlikely(p->flags & (PF_KTHREAD | PF_IO_WORKER))) {
+       if (unlikely(args->fn)) {
                /* kernel thread */
-               p->thread.reg23 = usp; /* fn */
-               p->thread.reg24 = kthread_arg;
                p->thread.reg03 = childksp;
-               p->thread.reg01 = (unsigned long) ret_from_kernel_thread;
+               p->thread.reg23 = (unsigned long)args->fn;
+               p->thread.reg24 = (unsigned long)args->fn_arg;
+               p->thread.reg01 = (unsigned long)ret_from_kernel_thread;
                memset(childregs, 0, sizeof(struct pt_regs));
                childregs->csr_euen = p->thread.csr_euen;
                childregs->csr_crmd = p->thread.csr_crmd;
index 185e403..c74860b 100644 (file)
@@ -39,7 +39,6 @@
 #include <asm/pgalloc.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
-#include <asm/smp.h>
 #include <asm/time.h>
 
 #define SMBIOS_BIOSSIZE_OFFSET         0x09
@@ -349,8 +348,6 @@ static void __init prefill_possible_map(void)
 
        nr_cpu_ids = possible;
 }
-#else
-static inline void prefill_possible_map(void) {}
 #endif
 
 void __init setup_arch(char **cmdline_p)
@@ -367,8 +364,10 @@ void __init setup_arch(char **cmdline_p)
        arch_mem_init(cmdline_p);
 
        resource_init();
+#ifdef CONFIG_SMP
        plat_smp_setup();
        prefill_possible_map();
+#endif
 
        paging_init();
 }
index b8c53b7..73cec62 100644 (file)
@@ -66,8 +66,6 @@ static cpumask_t cpu_core_setup_map;
 
 struct secondary_data cpuboot_data;
 static DEFINE_PER_CPU(int, cpu_state);
-DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
-EXPORT_PER_CPU_SYMBOL(irq_stat);
 
 enum ipi_msg_type {
        IPI_RESCHEDULE,
index e4060f8..1bf58c6 100644 (file)
@@ -475,8 +475,7 @@ asmlinkage void noinstr do_ri(struct pt_regs *regs)
 
        die_if_kernel("Reserved instruction in kernel code", regs);
 
-       if (unlikely(compute_return_era(regs) < 0))
-               goto out;
+       compute_return_era(regs);
 
        if (unlikely(get_user(opcode, era) < 0)) {
                status = SIGSEGV;
index 9d50815..69c76f2 100644 (file)
@@ -37,6 +37,7 @@ SECTIONS
        HEAD_TEXT_SECTION
 
        . = ALIGN(PECOFF_SEGMENT_ALIGN);
+       _stext = .;
        .text : {
                TEXT_TEXT
                SCHED_TEXT
@@ -101,6 +102,7 @@ SECTIONS
 
        STABS_DEBUG
        DWARF_DEBUG
+       ELF_DETAILS
 
        .gptab.sdata : {
                *(.gptab.data)
index e272f8a..9818ce1 100644 (file)
@@ -281,15 +281,16 @@ void setup_tlb_handler(int cpu)
                if (pcpu_handlers[cpu])
                        return;
 
-               page = alloc_pages_node(cpu_to_node(cpu), GFP_KERNEL, get_order(vec_sz));
+               page = alloc_pages_node(cpu_to_node(cpu), GFP_ATOMIC, get_order(vec_sz));
                if (!page)
                        return;
 
                addr = page_address(page);
-               pcpu_handlers[cpu] = virt_to_phys(addr);
+               pcpu_handlers[cpu] = (unsigned long)addr;
                memcpy((void *)addr, (void *)eentry, vec_sz);
                local_flush_icache_range((unsigned long)addr, (unsigned long)addr + vec_sz);
-               csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_TLBRENTRY);
+               csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_EENTRY);
+               csr_write64(pcpu_handlers[cpu], LOONGARCH_CSR_MERRENTRY);
                csr_write64(pcpu_handlers[cpu] + 80*VECSIZE, LOONGARCH_CSR_TLBRENTRY);
        }
 #endif
index b0a034b..42e6966 100644 (file)
 
                clocks = <&cgu X1000_CLK_RTCLK>,
                         <&cgu X1000_CLK_EXCLK>,
-                        <&cgu X1000_CLK_PCLK>;
-               clock-names = "rtc", "ext", "pclk";
+                        <&cgu X1000_CLK_PCLK>,
+                        <&cgu X1000_CLK_TCU>;
+               clock-names = "rtc", "ext", "pclk", "tcu";
 
                interrupt-controller;
                #interrupt-cells = <1>;
index dbf21af..65a5da7 100644 (file)
 
                clocks = <&cgu X1830_CLK_RTCLK>,
                         <&cgu X1830_CLK_EXCLK>,
-                        <&cgu X1830_CLK_PCLK>;
-               clock-names = "rtc", "ext", "pclk";
+                        <&cgu X1830_CLK_PCLK>,
+                        <&cgu X1830_CLK_TCU>;
+               clock-names = "rtc", "ext", "pclk", "tcu";
 
                interrupt-controller;
                #interrupt-cells = <1>;
index a89aaad..930c450 100644 (file)
@@ -44,6 +44,7 @@ static __init unsigned int ranchu_measure_hpt_freq(void)
                      __func__);
 
        rtc_base = of_iomap(np, 0);
+       of_node_put(np);
        if (!rtc_base)
                panic("%s(): Failed to ioremap Goldfish RTC base!", __func__);
 
index 5204fc6..1187729 100644 (file)
@@ -208,6 +208,12 @@ void __init ltq_soc_init(void)
                        of_address_to_resource(np_sysgpe, 0, &res_sys[2]))
                panic("Failed to get core resources");
 
+       of_node_put(np_status);
+       of_node_put(np_ebu);
+       of_node_put(np_sys1);
+       of_node_put(np_syseth);
+       of_node_put(np_sysgpe);
+
        if ((request_mem_region(res_status.start, resource_size(&res_status),
                                res_status.name) < 0) ||
                (request_mem_region(res_ebu.start, resource_size(&res_ebu),
index b732495..20622bf 100644 (file)
@@ -408,6 +408,7 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent)
                if (!ltq_eiu_membase)
                        panic("Failed to remap eiu memory");
        }
+       of_node_put(eiu_node);
 
        return 0;
 }
index 084f6ca..d444a1b 100644 (file)
@@ -441,6 +441,10 @@ void __init ltq_soc_init(void)
                        of_address_to_resource(np_ebu, 0, &res_ebu))
                panic("Failed to get core resources");
 
+       of_node_put(np_pmu);
+       of_node_put(np_cgu);
+       of_node_put(np_ebu);
+
        if (!request_mem_region(res_pmu.start, resource_size(&res_pmu),
                                res_pmu.name) ||
                !request_mem_region(res_cgu.start, resource_size(&res_cgu),
index bbf1e38..2cb708c 100644 (file)
@@ -214,6 +214,8 @@ static void update_gic_frequency_dt(void)
 
        if (of_update_property(node, &gic_frequency_prop) < 0)
                pr_err("error updating gic frequency property\n");
+
+       of_node_put(node);
 }
 
 #endif
index 1299156..d9c8c4e 100644 (file)
@@ -98,13 +98,18 @@ static int __init pic32_of_prepare_platform_data(struct of_dev_auxdata *lookup)
                np = of_find_compatible_node(NULL, NULL, lookup->compatible);
                if (np) {
                        lookup->name = (char *)np->name;
-                       if (lookup->phys_addr)
+                       if (lookup->phys_addr) {
+                               of_node_put(np);
                                continue;
+                       }
                        if (!of_address_to_resource(np, 0, &res))
                                lookup->phys_addr = res.start;
+                       of_node_put(np);
                }
        }
 
+       of_node_put(root);
+
        return 0;
 }
 
index 7174e9a..777b515 100644 (file)
@@ -32,6 +32,9 @@ static unsigned int pic32_xlate_core_timer_irq(void)
                goto default_map;
 
        irq = irq_of_parse_and_map(node, 0);
+
+       of_node_put(node);
+
        if (!irq)
                goto default_map;
 
index 587c7b9..ea8072a 100644 (file)
@@ -40,6 +40,8 @@ __iomem void *plat_of_remap_node(const char *node)
        if (of_address_to_resource(np, 0, &res))
                panic("Failed to get resource for %s", node);
 
+       of_node_put(np);
+
        if (!request_mem_region(res.start,
                                resource_size(&res),
                                res.name))
index 7b7f25b..9240bcd 100644 (file)
@@ -640,8 +640,6 @@ static int icu_get_irq(unsigned int irq)
 
        printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);
 
-       atomic_inc(&irq_err_count);
-
        return -1;
 }
 
index 5f2448d..fa40005 100644 (file)
@@ -10,6 +10,7 @@ config PARISC
        select ARCH_WANT_FRAME_POINTERS
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_STRICT_KERNEL_RWX
+       select ARCH_HAS_STRICT_MODULE_RWX
        select ARCH_HAS_UBSAN_SANITIZE_ALL
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_NO_SG_CHAIN
index d63a2ac..55d29c4 100644 (file)
@@ -12,7 +12,7 @@ static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
        pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
 }
 
-#if defined(CONFIG_STI_CONSOLE) || defined(CONFIG_FB_STI)
+#if defined(CONFIG_FB_STI)
 int fb_is_primary_device(struct fb_info *info);
 #else
 static inline int fb_is_primary_device(struct fb_info *info)
index c8a11fc..a9bc578 100644 (file)
@@ -722,7 +722,10 @@ void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned lon
                return;
 
        if (parisc_requires_coherency()) {
-               flush_user_cache_page(vma, vmaddr);
+               if (vma->vm_flags & VM_SHARED)
+                       flush_data_cache();
+               else
+                       flush_user_cache_page(vma, vmaddr);
                return;
        }
 
index 494ca41..d41ddb3 100644 (file)
@@ -102,7 +102,7 @@ decode_fpu(unsigned int Fpu_register[], unsigned int trap_counts[])
      * that happen.  Want to keep this overhead low, but still provide
      * some information to the customer.  All exits from this routine
      * need to restore Fpu_register[0]
-    */
+     */
 
     bflags=(Fpu_register[0] & 0xf8000000);
     Fpu_register[0] &= 0x07ffffff;
index be68c1f..c2ce2e6 100644 (file)
@@ -223,7 +223,6 @@ config PPC
        select HAVE_HARDLOCKUP_DETECTOR_PERF    if PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !HAVE_HARDLOCKUP_DETECTOR_ARCH
        select HAVE_HW_BREAKPOINT               if PERF_EVENTS && (PPC_BOOK3S || PPC_8xx)
        select HAVE_IOREMAP_PROT
-       select HAVE_IRQ_EXIT_ON_IRQ_STACK
        select HAVE_IRQ_TIME_ACCOUNTING
        select HAVE_KERNEL_GZIP
        select HAVE_KERNEL_LZMA                 if DEFAULT_UIMAGE
@@ -786,7 +785,6 @@ config THREAD_SHIFT
        range 13 15
        default "15" if PPC_256K_PAGES
        default "14" if PPC64
-       default "14" if KASAN
        default "13"
        help
          Used to define the stack size. The default is almost always what you
index 125328d..af58f1e 100644 (file)
 
 #ifdef __KERNEL__
 
-#if defined(CONFIG_VMAP_STACK) && CONFIG_THREAD_SHIFT < PAGE_SHIFT
+#ifdef CONFIG_KASAN
+#define MIN_THREAD_SHIFT       (CONFIG_THREAD_SHIFT + 1)
+#else
+#define MIN_THREAD_SHIFT       CONFIG_THREAD_SHIFT
+#endif
+
+#if defined(CONFIG_VMAP_STACK) && MIN_THREAD_SHIFT < PAGE_SHIFT
 #define THREAD_SHIFT           PAGE_SHIFT
 #else
-#define THREAD_SHIFT           CONFIG_THREAD_SHIFT
+#define THREAD_SHIFT           MIN_THREAD_SHIFT
 #endif
 
 #define THREAD_SIZE            (1 << THREAD_SHIFT)
index 2e2a2a9..f91f0f2 100644 (file)
@@ -37,6 +37,8 @@ KASAN_SANITIZE_paca.o := n
 KASAN_SANITIZE_setup_64.o := n
 KASAN_SANITIZE_mce.o := n
 KASAN_SANITIZE_mce_power.o := n
+KASAN_SANITIZE_udbg.o := n
+KASAN_SANITIZE_udbg_16550.o := n
 
 # we have to be particularly careful in ppc64 to exclude code that
 # runs with translations off, as we cannot access the shadow with
index b62046b..0fbda89 100644 (file)
@@ -1855,7 +1855,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
                tm_reclaim_current(0);
 #endif
 
-       memset(regs->gpr, 0, sizeof(regs->gpr));
+       memset(&regs->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0]));
        regs->ctr = 0;
        regs->link = 0;
        regs->xer = 0;
@@ -2158,12 +2158,12 @@ static unsigned long ___get_wchan(struct task_struct *p)
                return 0;
 
        do {
-               sp = *(unsigned long *)sp;
+               sp = READ_ONCE_NOCHECK(*(unsigned long *)sp);
                if (!validate_sp(sp, p, STACK_FRAME_OVERHEAD) ||
                    task_is_running(p))
                        return 0;
                if (count > 0) {
-                       ip = ((unsigned long *)sp)[STACK_FRAME_LR_SAVE];
+                       ip = READ_ONCE_NOCHECK(((unsigned long *)sp)[STACK_FRAME_LR_SAVE]);
                        if (!in_sched_functions(ip))
                                return ip;
                }
index 04694ec..13d6cb1 100644 (file)
@@ -2302,7 +2302,7 @@ static void __init prom_init_stdout(void)
 
 static int __init prom_find_machine_type(void)
 {
-       char compat[256];
+       static char compat[256] __prombss;
        int len, i = 0;
 #ifdef CONFIG_PPC64
        phandle rtas;
index 5dca193..09c4963 100644 (file)
@@ -17,9 +17,13 @@ int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data)
 
 #ifdef CONFIG_PPC_FPU_REGS
        flush_fp_to_thread(child);
-       if (fpidx < (PT_FPSCR - PT_FPR0))
-               memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long));
-       else
+       if (fpidx < (PT_FPSCR - PT_FPR0)) {
+               if (IS_ENABLED(CONFIG_PPC32))
+                       // On 32-bit the index we are passed refers to 32-bit words
+                       *data = ((u32 *)child->thread.fp_state.fpr)[fpidx];
+               else
+                       memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long));
+       } else
                *data = child->thread.fp_state.fpscr;
 #else
        *data = 0;
@@ -39,9 +43,13 @@ int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data)
 
 #ifdef CONFIG_PPC_FPU_REGS
        flush_fp_to_thread(child);
-       if (fpidx < (PT_FPSCR - PT_FPR0))
-               memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long));
-       else
+       if (fpidx < (PT_FPSCR - PT_FPR0)) {
+               if (IS_ENABLED(CONFIG_PPC32))
+                       // On 32-bit the index we are passed refers to 32-bit words
+                       ((u32 *)child->thread.fp_state.fpr)[fpidx] = data;
+               else
+                       memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long));
+       } else
                child->thread.fp_state.fpscr = data;
 #endif
 
index 4d2dc22..5d7a72b 100644 (file)
@@ -444,4 +444,7 @@ void __init pt_regs_check(void)
         * real registers.
         */
        BUILD_BUG_ON(PT_DSCR < sizeof(struct user_pt_regs) / sizeof(unsigned long));
+
+       // ptrace_get/put_fpr() rely on PPC32 and VSX being incompatible
+       BUILD_BUG_ON(IS_ENABLED(CONFIG_PPC32) && IS_ENABLED(CONFIG_VSX));
 }
index 9bb43aa..6931339 100644 (file)
@@ -993,8 +993,8 @@ int rtas_call_reentrant(int token, int nargs, int nret, int *outputs, ...)
  *
  * Return: A pointer to the specified errorlog or NULL if not found.
  */
-struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
-                                             uint16_t section_id)
+noinstr struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log,
+                                                     uint16_t section_id)
 {
        struct rtas_ext_event_log_v6 *ext_log =
                (struct rtas_ext_event_log_v6 *)log->buffer;
@@ -1071,7 +1071,7 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
        { "get-time-of-day", -1, -1, -1, -1, -1 },
        { "ibm,get-vpd", -1, 0, -1, 1, 2 },
        { "ibm,lpar-perftools", -1, 2, 3, -1, -1 },
-       { "ibm,platform-dump", -1, 4, 5, -1, -1 },
+       { "ibm,platform-dump", -1, 4, 5, -1, -1 },              /* Special cased */
        { "ibm,read-slot-reset-state", -1, -1, -1, -1, -1 },
        { "ibm,scan-log-dump", -1, 0, 1, -1, -1 },
        { "ibm,set-dynamic-indicator", -1, 2, -1, -1, -1 },
@@ -1120,6 +1120,15 @@ static bool block_rtas_call(int token, int nargs,
                                size = 1;
 
                        end = base + size - 1;
+
+                       /*
+                        * Special case for ibm,platform-dump - NULL buffer
+                        * address is used to indicate end of dump processing
+                        */
+                       if (!strcmp(f->name, "ibm,platform-dump") &&
+                           base == 0)
+                               return false;
+
                        if (!in_rmo_buf(base, end))
                                goto err;
                }
index eb0077b..1a02629 100644 (file)
@@ -935,12 +935,6 @@ void __init setup_arch(char **cmdline_p)
        /* Print various info about the machine that has been gathered so far. */
        print_system_info();
 
-       /* Reserve large chunks of memory for use by CMA for KVM. */
-       kvm_cma_reserve();
-
-       /*  Reserve large chunks of memory for us by CMA for hugetlb */
-       gigantic_hugetlb_cma_reserve();
-
        klp_init_thread_info(&init_task);
 
        setup_initial_init_mm(_stext, _etext, _edata, _end);
@@ -955,6 +949,13 @@ void __init setup_arch(char **cmdline_p)
 
        initmem_init();
 
+       /*
+        * Reserve large chunks of memory for use by CMA for KVM and hugetlb. These must
+        * be called after initmem_init(), so that pageblock_order is initialised.
+        */
+       kvm_cma_reserve();
+       gigantic_hugetlb_cma_reserve();
+
        early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
 
        if (ppc_md.setup_arch)
index d85fa9f..80f5472 100644 (file)
@@ -224,7 +224,7 @@ void crash_kexec_secondary(struct pt_regs *regs)
 
 /* wait for all the CPUs to hit real mode but timeout if they don't come in */
 #if defined(CONFIG_SMP) && defined(CONFIG_PPC64)
-static void __maybe_unused crash_kexec_wait_realmode(int cpu)
+noinstr static void __maybe_unused crash_kexec_wait_realmode(int cpu)
 {
        unsigned int msecs;
        int i;
index 1f3f9fe..0d04f9d 100644 (file)
@@ -19,7 +19,6 @@
 #include <asm/cacheflush.h>
 #include <asm/kdump.h>
 #include <mm/mmu_decl.h>
-#include <generated/compile.h>
 #include <generated/utsrelease.h>
 
 struct regions {
@@ -37,10 +36,6 @@ struct regions {
        int reserved_mem_size_cells;
 };
 
-/* Simplified build-specific string for starting entropy. */
-static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@"
-               LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION;
-
 struct regions __initdata regions;
 
 static __init void kaslr_get_cmdline(void *fdt)
@@ -71,7 +66,8 @@ static unsigned long __init get_boot_seed(void *fdt)
 {
        unsigned long hash = 0;
 
-       hash = rotate_xor(hash, build_str, sizeof(build_str));
+       /* build-specific string for starting entropy. */
+       hash = rotate_xor(hash, linux_banner, strlen(linux_banner));
        hash = rotate_xor(hash, fdt, fdt_totalsize(fdt));
 
        return hash;
diff --git a/arch/powerpc/platforms/microwatt/microwatt.h b/arch/powerpc/platforms/microwatt/microwatt.h
new file mode 100644 (file)
index 0000000..335417e
--- /dev/null
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _MICROWATT_H
+#define _MICROWATT_H
+
+void microwatt_rng_init(void);
+
+#endif /* _MICROWATT_H */
index 7bc4d1c..8ece87d 100644 (file)
@@ -11,6 +11,7 @@
 #include <asm/archrandom.h>
 #include <asm/cputable.h>
 #include <asm/machdep.h>
+#include "microwatt.h"
 
 #define DARN_ERR 0xFFFFFFFFFFFFFFFFul
 
@@ -29,7 +30,7 @@ static int microwatt_get_random_darn(unsigned long *v)
        return 1;
 }
 
-static __init int rng_init(void)
+void __init microwatt_rng_init(void)
 {
        unsigned long val;
        int i;
@@ -37,12 +38,7 @@ static __init int rng_init(void)
        for (i = 0; i < 10; i++) {
                if (microwatt_get_random_darn(&val)) {
                        ppc_md.get_random_seed = microwatt_get_random_darn;
-                       return 0;
+                       return;
                }
        }
-
-       pr_warn("Unable to use DARN for get_random_seed()\n");
-
-       return -EIO;
 }
-machine_subsys_initcall(, rng_init);
index 0b02603..6b32539 100644 (file)
@@ -16,6 +16,8 @@
 #include <asm/xics.h>
 #include <asm/udbg.h>
 
+#include "microwatt.h"
+
 static void __init microwatt_init_IRQ(void)
 {
        xics_init();
@@ -32,10 +34,16 @@ static int __init microwatt_populate(void)
 }
 machine_arch_initcall(microwatt, microwatt_populate);
 
+static void __init microwatt_setup_arch(void)
+{
+       microwatt_rng_init();
+}
+
 define_machine(microwatt) {
        .name                   = "microwatt",
        .probe                  = microwatt_probe,
        .init_IRQ               = microwatt_init_IRQ,
+       .setup_arch             = microwatt_setup_arch,
        .progress               = udbg_progress,
        .calibrate_decr         = generic_calibrate_decr,
 };
index 6488b38..19f0fc5 100644 (file)
@@ -4,6 +4,7 @@
 # in particular, idle code runs a bunch of things in real mode
 KASAN_SANITIZE_idle.o := n
 KASAN_SANITIZE_pci-ioda.o := n
+KASAN_SANITIZE_pci-ioda-tce.o := n
 # pnv_machine_check_early
 KASAN_SANITIZE_setup.o := n
 
index e297bf4..866efdc 100644 (file)
@@ -42,4 +42,6 @@ ssize_t memcons_copy(struct memcons *mc, char *to, loff_t pos, size_t count);
 u32 __init memcons_get_size(struct memcons *mc);
 struct memcons *__init memcons_init(struct device_node *node, const char *mc_prop_name);
 
+void pnv_rng_init(void);
+
 #endif /* _POWERNV_H */
index e3d44b3..463c78c 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/smp.h>
+#include "powernv.h"
 
 #define DARN_ERR 0xFFFFFFFFFFFFFFFFul
 
@@ -28,7 +29,6 @@ struct powernv_rng {
 
 static DEFINE_PER_CPU(struct powernv_rng *, powernv_rng);
 
-
 int powernv_hwrng_present(void)
 {
        struct powernv_rng *rng;
@@ -98,9 +98,6 @@ static int __init initialise_darn(void)
                        return 0;
                }
        }
-
-       pr_warn("Unable to use DARN for get_random_seed()\n");
-
        return -EIO;
 }
 
@@ -163,32 +160,55 @@ static __init int rng_create(struct device_node *dn)
 
        rng_init_per_cpu(rng, dn);
 
-       pr_info_once("Registering arch random hook.\n");
-
        ppc_md.get_random_seed = powernv_get_random_long;
 
        return 0;
 }
 
-static __init int rng_init(void)
+static int __init pnv_get_random_long_early(unsigned long *v)
 {
        struct device_node *dn;
-       int rc;
+
+       if (!slab_is_available())
+               return 0;
+
+       if (cmpxchg(&ppc_md.get_random_seed, pnv_get_random_long_early,
+                   NULL) != pnv_get_random_long_early)
+               return 0;
 
        for_each_compatible_node(dn, NULL, "ibm,power-rng") {
-               rc = rng_create(dn);
-               if (rc) {
-                       pr_err("Failed creating rng for %pOF (%d).\n",
-                               dn, rc);
+               if (rng_create(dn))
                        continue;
-               }
-
                /* Create devices for hwrng driver */
                of_platform_device_create(dn, NULL, NULL);
        }
 
-       initialise_darn();
+       if (!ppc_md.get_random_seed)
+               return 0;
+       return ppc_md.get_random_seed(v);
+}
+
+void __init pnv_rng_init(void)
+{
+       struct device_node *dn;
 
+       /* Prefer darn over the rest. */
+       if (!initialise_darn())
+               return;
+
+       dn = of_find_compatible_node(NULL, NULL, "ibm,power-rng");
+       if (dn)
+               ppc_md.get_random_seed = pnv_get_random_long_early;
+
+       of_node_put(dn);
+}
+
+static int __init pnv_rng_late_init(void)
+{
+       unsigned long v;
+       /* In case it wasn't called during init for some other reason. */
+       if (ppc_md.get_random_seed == pnv_get_random_long_early)
+               pnv_get_random_long_early(&v);
        return 0;
 }
-machine_subsys_initcall(powernv, rng_init);
+machine_subsys_initcall(powernv, pnv_rng_late_init);
index 824c3ad..dac545a 100644 (file)
@@ -203,6 +203,8 @@ static void __init pnv_setup_arch(void)
        pnv_check_guarded_cores();
 
        /* XXX PMCS */
+
+       pnv_rng_init();
 }
 
 static void __init pnv_init(void)
index 181b855..82cae08 100644 (file)
@@ -465,6 +465,9 @@ static int papr_scm_pmu_check_events(struct papr_scm_priv *p, struct nvdimm_pmu
        u32 available_events;
        int index, rc = 0;
 
+       if (!p->stat_buffer_len)
+               return -ENOENT;
+
        available_events = (p->stat_buffer_len  - sizeof(struct papr_scm_perf_stats))
                        / sizeof(struct papr_scm_perf_stat);
        if (available_events == 0)
index f5c916c..1d75b77 100644 (file)
@@ -122,4 +122,6 @@ void pseries_lpar_read_hblkrm_characteristics(void);
 static inline void pseries_lpar_read_hblkrm_characteristics(void) { }
 #endif
 
+void pseries_rng_init(void);
+
 #endif /* _PSERIES_PSERIES_H */
index 6268545..6ddfdea 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/archrandom.h>
 #include <asm/machdep.h>
 #include <asm/plpar_wrappers.h>
+#include "pseries.h"
 
 
 static int pseries_get_random_long(unsigned long *v)
@@ -24,19 +25,13 @@ static int pseries_get_random_long(unsigned long *v)
        return 0;
 }
 
-static __init int rng_init(void)
+void __init pseries_rng_init(void)
 {
        struct device_node *dn;
 
        dn = of_find_compatible_node(NULL, NULL, "ibm,random");
        if (!dn)
-               return -ENODEV;
-
-       pr_info("Registering arch random hook.\n");
-
+               return;
        ppc_md.get_random_seed = pseries_get_random_long;
-
        of_node_put(dn);
-       return 0;
 }
-machine_subsys_initcall(pseries, rng_init);
index afb0742..ee4f1db 100644 (file)
@@ -839,6 +839,7 @@ static void __init pSeries_setup_arch(void)
        }
 
        ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare;
+       pseries_rng_init();
 }
 
 static void pseries_panic(char *str)
index c22f581..32ffef9 100644 (file)
@@ -364,8 +364,13 @@ config RISCV_ISA_SVPBMT
        select RISCV_ALTERNATIVE
        default y
        help
-          Adds support to dynamically detect the presence of the SVPBMT extension
-          (Supervisor-mode: page-based memory types) and enable its usage.
+          Adds support to dynamically detect the presence of the SVPBMT
+          ISA-extension (Supervisor-mode: page-based memory types) and
+          enable its usage.
+
+          The memory type for a page contains a combination of attributes
+          that indicate the cacheability, idempotency, and ordering
+          properties for access to that page.
 
           The SVPBMT extension is only available on 64Bit cpus.
 
index ebfcd5c..457ac72 100644 (file)
@@ -35,6 +35,7 @@ config ERRATA_SIFIVE_CIP_1200
 
 config ERRATA_THEAD
        bool "T-HEAD errata"
+       depends on !XIP_KERNEL
        select RISCV_ALTERNATIVE
        help
          All T-HEAD errata Kconfig depend on this Kconfig. Disabling
index 8c32591..3095d08 100644 (file)
                        riscv,ndev = <186>;
                };
 
+               pdma: dma-controller@3000000 {
+                       compatible = "sifive,fu540-c000-pdma", "sifive,pdma0";
+                       reg = <0x0 0x3000000 0x0 0x8000>;
+                       interrupt-parent = <&plic>;
+                       interrupts = <5 6>, <7 8>, <9 10>, <11 12>;
+                       dma-channels = <4>;
+                       #dma-cells = <1>;
+               };
+
                clkcfg: clkcfg@20002000 {
                        compatible = "microchip,mpfs-clkcfg";
                        reg = <0x0 0x20002000 0x0 0x1000>, <0x0 0x3E001000 0x0 0x1000>;
index 9e2888d..416ead0 100644 (file)
@@ -75,20 +75,20 @@ asm volatile(ALTERNATIVE(                                           \
        "nop\n\t"                                                       \
        "nop\n\t"                                                       \
        "nop",                                                          \
-       "li      t3, %2\n\t"                                            \
-       "slli    t3, t3, %4\n\t"                                        \
+       "li      t3, %1\n\t"                                            \
+       "slli    t3, t3, %3\n\t"                                        \
        "and     t3, %0, t3\n\t"                                        \
        "bne     t3, zero, 2f\n\t"                                      \
-       "li      t3, %3\n\t"                                            \
-       "slli    t3, t3, %4\n\t"                                        \
+       "li      t3, %2\n\t"                                            \
+       "slli    t3, t3, %3\n\t"                                        \
        "or      %0, %0, t3\n\t"                                        \
        "2:",  THEAD_VENDOR_ID,                                         \
                ERRATA_THEAD_PBMT, CONFIG_ERRATA_THEAD_PBMT)            \
        : "+r"(_val)                                                    \
-       : "0"(_val),                                                    \
-         "I"(_PAGE_MTMASK_THEAD >> ALT_THEAD_PBMT_SHIFT),              \
+       : "I"(_PAGE_MTMASK_THEAD >> ALT_THEAD_PBMT_SHIFT),              \
          "I"(_PAGE_PMA_THEAD >> ALT_THEAD_PBMT_SHIFT),                 \
-         "I"(ALT_THEAD_PBMT_SHIFT))
+         "I"(ALT_THEAD_PBMT_SHIFT)                                     \
+       : "t3")
 #else
 #define ALT_THEAD_PMA(_val)
 #endif
index a6f62a6..12b05ce 100644 (file)
@@ -293,7 +293,6 @@ void __init_or_module riscv_cpufeature_patch_func(struct alt_entry *begin,
                                                  unsigned int stage)
 {
        u32 cpu_req_feature = cpufeature_probe(stage);
-       u32 cpu_apply_feature = 0;
        struct alt_entry *alt;
        u32 tmp;
 
@@ -307,10 +306,8 @@ void __init_or_module riscv_cpufeature_patch_func(struct alt_entry *begin,
                }
 
                tmp = (1U << alt->errata_id);
-               if (cpu_req_feature & tmp) {
+               if (cpu_req_feature & tmp)
                        patch_text_nosync(alt->old_ptr, alt->alt_ptr, alt->alt_len);
-                       cpu_apply_feature |= tmp;
-               }
        }
 }
 #endif
index 9f764df..6cd9399 100644 (file)
@@ -97,7 +97,7 @@ void kvm_riscv_gstage_vmid_update(struct kvm_vcpu *vcpu)
                 * We ran out of VMIDs so we increment vmid_version and
                 * start assigning VMIDs from 1.
                 *
-                * This also means existing VMIDs assignement to all Guest
+                * This also means existing VMIDs assignment to all Guest
                 * instances is invalid and we have force VMID re-assignement
                 * for all Guest instances. The Guest instances that were not
                 * running will automatically pick-up new VMIDs because will
index b1a88f6..91c0b80 100644 (file)
@@ -125,6 +125,7 @@ config S390
        select CLONE_BACKWARDS2
        select DMA_OPS if PCI
        select DYNAMIC_FTRACE if FUNCTION_TRACER
+       select GCC12_NO_ARRAY_BOUNDS
        select GENERIC_ALLOCATOR
        select GENERIC_CPU_AUTOPROBE
        select GENERIC_CPU_VULNERABILITIES
@@ -768,7 +769,6 @@ menu "Virtualization"
 config PROTECTED_VIRTUALIZATION_GUEST
        def_bool n
        prompt "Protected virtualization guest support"
-       select ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS
        help
          Select this option, if you want to be able to run this
          kernel as a protected virtualization KVM guest.
index d73611b..495c68a 100644 (file)
@@ -32,15 +32,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
 KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
 KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
 KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))
-
-ifdef CONFIG_CC_IS_GCC
-       ifeq ($(call cc-ifversion, -ge, 1200, y), y)
-               ifeq ($(call cc-ifversion, -lt, 1300, y), y)
-                       KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds)
-                       KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, array-bounds)
-               endif
-       endif
-endif
+KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_CC_NO_ARRAY_BOUNDS),-Wno-array-bounds)
 
 UTS_MACHINE    := s390x
 STACK_SIZE     := $(if $(CONFIG_KASAN),65536,16384)
index a2c1c55..28124d0 100644 (file)
@@ -219,6 +219,11 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, size_t csize,
        unsigned long src;
        int rc;
 
+       if (!(iter_is_iovec(iter) || iov_iter_is_kvec(iter)))
+               return -EINVAL;
+       /* Multi-segment iterators are not supported */
+       if (iter->nr_segs > 1)
+               return -EINVAL;
        if (!csize)
                return 0;
        src = pfn_to_phys(pfn) + offset;
@@ -228,7 +233,10 @@ ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, size_t csize,
                rc = copy_oldmem_user(iter->iov->iov_base, src, csize);
        else
                rc = copy_oldmem_kernel(iter->kvec->iov_base, src, csize);
-       return rc;
+       if (rc < 0)
+               return rc;
+       iov_iter_advance(iter, csize);
+       return csize;
 }
 
 /*
index 483ab5e..f7dd3c8 100644 (file)
@@ -516,6 +516,26 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
        return err;
 }
 
+/* Events CPU_CYLCES and INSTRUCTIONS can be submitted with two different
+ * attribute::type values:
+ * - PERF_TYPE_HARDWARE:
+ * - pmu->type:
+ * Handle both type of invocations identical. They address the same hardware.
+ * The result is different when event modifiers exclude_kernel and/or
+ * exclude_user are also set.
+ */
+static int cpumf_pmu_event_type(struct perf_event *event)
+{
+       u64 ev = event->attr.config;
+
+       if (cpumf_generic_events_basic[PERF_COUNT_HW_CPU_CYCLES] == ev ||
+           cpumf_generic_events_basic[PERF_COUNT_HW_INSTRUCTIONS] == ev ||
+           cpumf_generic_events_user[PERF_COUNT_HW_CPU_CYCLES] == ev ||
+           cpumf_generic_events_user[PERF_COUNT_HW_INSTRUCTIONS] == ev)
+               return PERF_TYPE_HARDWARE;
+       return PERF_TYPE_RAW;
+}
+
 static int cpumf_pmu_event_init(struct perf_event *event)
 {
        unsigned int type = event->attr.type;
@@ -525,7 +545,7 @@ static int cpumf_pmu_event_init(struct perf_event *event)
                err = __hw_perf_event_init(event, type);
        else if (event->pmu->type == type)
                /* Registered as unknown PMU */
-               err = __hw_perf_event_init(event, PERF_TYPE_RAW);
+               err = __hw_perf_event_init(event, cpumf_pmu_event_type(event));
        else
                return -ENOENT;
 
index 8c15459..b38b4ae 100644 (file)
@@ -193,8 +193,9 @@ static int paicrypt_event_init(struct perf_event *event)
        /* PAI crypto PMU registered as PERF_TYPE_RAW, check event type */
        if (a->type != PERF_TYPE_RAW && event->pmu->type != a->type)
                return -ENOENT;
-       /* PAI crypto event must be valid */
-       if (a->config > PAI_CRYPTO_BASE + paicrypt_cnt)
+       /* PAI crypto event must be in valid range */
+       if (a->config < PAI_CRYPTO_BASE ||
+           a->config > PAI_CRYPTO_BASE + paicrypt_cnt)
                return -EINVAL;
        /* Allow only CPU wide operation, no process context for now. */
        if (event->hw.target || event->cpu == -1)
@@ -208,6 +209,12 @@ static int paicrypt_event_init(struct perf_event *event)
        if (rc)
                return rc;
 
+       /* Event initialization sets last_tag to 0. When later on the events
+        * are deleted and re-added, do not reset the event count value to zero.
+        * Events are added, deleted and re-added when 2 or more events
+        * are active at the same time.
+        */
+       event->hw.last_tag = 0;
        cpump->event = event;
        event->destroy = paicrypt_event_destroy;
 
@@ -242,9 +249,12 @@ static void paicrypt_start(struct perf_event *event, int flags)
 {
        u64 sum;
 
-       sum = paicrypt_getall(event);           /* Get current value */
-       local64_set(&event->hw.prev_count, sum);
-       local64_set(&event->count, 0);
+       if (!event->hw.last_tag) {
+               event->hw.last_tag = 1;
+               sum = paicrypt_getall(event);           /* Get current value */
+               local64_set(&event->count, 0);
+               local64_set(&event->hw.prev_count, sum);
+       }
 }
 
 static int paicrypt_add(struct perf_event *event, int flags)
index 6fb6bf6..6a0ac00 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/cma.h>
 #include <linux/gfp.h>
 #include <linux/dma-direct.h>
+#include <linux/platform-feature.h>
 #include <asm/processor.h>
 #include <linux/uaccess.h>
 #include <asm/pgalloc.h>
@@ -168,22 +169,14 @@ bool force_dma_unencrypted(struct device *dev)
        return is_prot_virt_guest();
 }
 
-#ifdef CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS
-
-int arch_has_restricted_virtio_memory_access(void)
-{
-       return is_prot_virt_guest();
-}
-EXPORT_SYMBOL(arch_has_restricted_virtio_memory_access);
-
-#endif
-
 /* protected virtualization */
 static void pv_init(void)
 {
        if (!is_prot_virt_guest())
                return;
 
+       platform_set(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS);
+
        /* make sure bounce buffers are shared */
        swiotlb_init(true, SWIOTLB_FORCE | SWIOTLB_VERBOSE);
        swiotlb_update_mem_attributes();
index 5c092a9..0278470 100644 (file)
@@ -544,6 +544,8 @@ static int um_pci_init_vqs(struct um_pci_device *dev)
        dev->cmd_vq = vqs[0];
        dev->irq_vq = vqs[1];
 
+       virtio_device_ready(dev->vdev);
+
        for (i = 0; i < NUM_IRQ_MSGS; i++) {
                void *msg = kzalloc(MAX_IRQ_MSG_SIZE, GFP_KERNEL);
 
@@ -587,7 +589,7 @@ static int um_pci_virtio_probe(struct virtio_device *vdev)
        dev->irq = irq_alloc_desc(numa_node_id());
        if (dev->irq < 0) {
                err = dev->irq;
-               goto error;
+               goto err_reset;
        }
        um_pci_devices[free].dev = dev;
        vdev->priv = dev;
@@ -604,6 +606,9 @@ static int um_pci_virtio_probe(struct virtio_device *vdev)
 
        um_pci_rescan();
        return 0;
+err_reset:
+       virtio_reset_device(vdev);
+       vdev->config->del_vqs(vdev);
 error:
        mutex_unlock(&um_pci_mtx);
        kfree(dev);
index 9783ebc..be0b95e 100644 (file)
@@ -1542,7 +1542,6 @@ config X86_CPA_STATISTICS
 config X86_MEM_ENCRYPT
        select ARCH_HAS_FORCE_DMA_UNENCRYPTED
        select DYNAMIC_PHYSICAL_MASK
-       select ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS
        def_bool n
 
 config AMD_MEM_ENCRYPT
index 03deb4d..928dcf7 100644 (file)
@@ -124,6 +124,51 @@ static u64 get_cc_mask(void)
        return BIT_ULL(gpa_width - 1);
 }
 
+/*
+ * The TDX module spec states that #VE may be injected for a limited set of
+ * reasons:
+ *
+ *  - Emulation of the architectural #VE injection on EPT violation;
+ *
+ *  - As a result of guest TD execution of a disallowed instruction,
+ *    a disallowed MSR access, or CPUID virtualization;
+ *
+ *  - A notification to the guest TD about anomalous behavior;
+ *
+ * The last one is opt-in and is not used by the kernel.
+ *
+ * The Intel Software Developer's Manual describes cases when instruction
+ * length field can be used in section "Information for VM Exits Due to
+ * Instruction Execution".
+ *
+ * For TDX, it ultimately means GET_VEINFO provides reliable instruction length
+ * information if #VE occurred due to instruction execution, but not for EPT
+ * violations.
+ */
+static int ve_instr_len(struct ve_info *ve)
+{
+       switch (ve->exit_reason) {
+       case EXIT_REASON_HLT:
+       case EXIT_REASON_MSR_READ:
+       case EXIT_REASON_MSR_WRITE:
+       case EXIT_REASON_CPUID:
+       case EXIT_REASON_IO_INSTRUCTION:
+               /* It is safe to use ve->instr_len for #VE due instructions */
+               return ve->instr_len;
+       case EXIT_REASON_EPT_VIOLATION:
+               /*
+                * For EPT violations, ve->insn_len is not defined. For those,
+                * the kernel must decode instructions manually and should not
+                * be using this function.
+                */
+               WARN_ONCE(1, "ve->instr_len is not defined for EPT violations");
+               return 0;
+       default:
+               WARN_ONCE(1, "Unexpected #VE-type: %lld\n", ve->exit_reason);
+               return ve->instr_len;
+       }
+}
+
 static u64 __cpuidle __halt(const bool irq_disabled, const bool do_sti)
 {
        struct tdx_hypercall_args args = {
@@ -147,7 +192,7 @@ static u64 __cpuidle __halt(const bool irq_disabled, const bool do_sti)
        return __tdx_hypercall(&args, do_sti ? TDX_HCALL_ISSUE_STI : 0);
 }
 
-static bool handle_halt(void)
+static int handle_halt(struct ve_info *ve)
 {
        /*
         * Since non safe halt is mainly used in CPU offlining
@@ -158,9 +203,9 @@ static bool handle_halt(void)
        const bool do_sti = false;
 
        if (__halt(irq_disabled, do_sti))
-               return false;
+               return -EIO;
 
-       return true;
+       return ve_instr_len(ve);
 }
 
 void __cpuidle tdx_safe_halt(void)
@@ -180,7 +225,7 @@ void __cpuidle tdx_safe_halt(void)
                WARN_ONCE(1, "HLT instruction emulation failed\n");
 }
 
-static bool read_msr(struct pt_regs *regs)
+static int read_msr(struct pt_regs *regs, struct ve_info *ve)
 {
        struct tdx_hypercall_args args = {
                .r10 = TDX_HYPERCALL_STANDARD,
@@ -194,14 +239,14 @@ static bool read_msr(struct pt_regs *regs)
         * (GHCI), section titled "TDG.VP.VMCALL<Instruction.RDMSR>".
         */
        if (__tdx_hypercall(&args, TDX_HCALL_HAS_OUTPUT))
-               return false;
+               return -EIO;
 
        regs->ax = lower_32_bits(args.r11);
        regs->dx = upper_32_bits(args.r11);
-       return true;
+       return ve_instr_len(ve);
 }
 
-static bool write_msr(struct pt_regs *regs)
+static int write_msr(struct pt_regs *regs, struct ve_info *ve)
 {
        struct tdx_hypercall_args args = {
                .r10 = TDX_HYPERCALL_STANDARD,
@@ -215,10 +260,13 @@ static bool write_msr(struct pt_regs *regs)
         * can be found in TDX Guest-Host-Communication Interface
         * (GHCI) section titled "TDG.VP.VMCALL<Instruction.WRMSR>".
         */
-       return !__tdx_hypercall(&args, 0);
+       if (__tdx_hypercall(&args, 0))
+               return -EIO;
+
+       return ve_instr_len(ve);
 }
 
-static bool handle_cpuid(struct pt_regs *regs)
+static int handle_cpuid(struct pt_regs *regs, struct ve_info *ve)
 {
        struct tdx_hypercall_args args = {
                .r10 = TDX_HYPERCALL_STANDARD,
@@ -236,7 +284,7 @@ static bool handle_cpuid(struct pt_regs *regs)
         */
        if (regs->ax < 0x40000000 || regs->ax > 0x4FFFFFFF) {
                regs->ax = regs->bx = regs->cx = regs->dx = 0;
-               return true;
+               return ve_instr_len(ve);
        }
 
        /*
@@ -245,7 +293,7 @@ static bool handle_cpuid(struct pt_regs *regs)
         * (GHCI), section titled "VP.VMCALL<Instruction.CPUID>".
         */
        if (__tdx_hypercall(&args, TDX_HCALL_HAS_OUTPUT))
-               return false;
+               return -EIO;
 
        /*
         * As per TDX GHCI CPUID ABI, r12-r15 registers contain contents of
@@ -257,7 +305,7 @@ static bool handle_cpuid(struct pt_regs *regs)
        regs->cx = args.r14;
        regs->dx = args.r15;
 
-       return true;
+       return ve_instr_len(ve);
 }
 
 static bool mmio_read(int size, unsigned long addr, unsigned long *val)
@@ -283,10 +331,10 @@ static bool mmio_write(int size, unsigned long addr, unsigned long val)
                               EPT_WRITE, addr, val);
 }
 
-static bool handle_mmio(struct pt_regs *regs, struct ve_info *ve)
+static int handle_mmio(struct pt_regs *regs, struct ve_info *ve)
 {
+       unsigned long *reg, val, vaddr;
        char buffer[MAX_INSN_SIZE];
-       unsigned long *reg, val;
        struct insn insn = {};
        enum mmio_type mmio;
        int size, extend_size;
@@ -294,34 +342,49 @@ static bool handle_mmio(struct pt_regs *regs, struct ve_info *ve)
 
        /* Only in-kernel MMIO is supported */
        if (WARN_ON_ONCE(user_mode(regs)))
-               return false;
+               return -EFAULT;
 
        if (copy_from_kernel_nofault(buffer, (void *)regs->ip, MAX_INSN_SIZE))
-               return false;
+               return -EFAULT;
 
        if (insn_decode(&insn, buffer, MAX_INSN_SIZE, INSN_MODE_64))
-               return false;
+               return -EINVAL;
 
        mmio = insn_decode_mmio(&insn, &size);
        if (WARN_ON_ONCE(mmio == MMIO_DECODE_FAILED))
-               return false;
+               return -EINVAL;
 
        if (mmio != MMIO_WRITE_IMM && mmio != MMIO_MOVS) {
                reg = insn_get_modrm_reg_ptr(&insn, regs);
                if (!reg)
-                       return false;
+                       return -EINVAL;
        }
 
-       ve->instr_len = insn.length;
+       /*
+        * Reject EPT violation #VEs that split pages.
+        *
+        * MMIO accesses are supposed to be naturally aligned and therefore
+        * never cross page boundaries. Seeing split page accesses indicates
+        * a bug or a load_unaligned_zeropad() that stepped into an MMIO page.
+        *
+        * load_unaligned_zeropad() will recover using exception fixups.
+        */
+       vaddr = (unsigned long)insn_get_addr_ref(&insn, regs);
+       if (vaddr / PAGE_SIZE != (vaddr + size - 1) / PAGE_SIZE)
+               return -EFAULT;
 
        /* Handle writes first */
        switch (mmio) {
        case MMIO_WRITE:
                memcpy(&val, reg, size);
-               return mmio_write(size, ve->gpa, val);
+               if (!mmio_write(size, ve->gpa, val))
+                       return -EIO;
+               return insn.length;
        case MMIO_WRITE_IMM:
                val = insn.immediate.value;
-               return mmio_write(size, ve->gpa, val);
+               if (!mmio_write(size, ve->gpa, val))
+                       return -EIO;
+               return insn.length;
        case MMIO_READ:
        case MMIO_READ_ZERO_EXTEND:
        case MMIO_READ_SIGN_EXTEND:
@@ -334,15 +397,15 @@ static bool handle_mmio(struct pt_regs *regs, struct ve_info *ve)
                 * decoded or handled properly. It was likely not using io.h
                 * helpers or accessed MMIO accidentally.
                 */
-               return false;
+               return -EINVAL;
        default:
                WARN_ONCE(1, "Unknown insn_decode_mmio() decode value?");
-               return false;
+               return -EINVAL;
        }
 
        /* Handle reads */
        if (!mmio_read(size, ve->gpa, &val))
-               return false;
+               return -EIO;
 
        switch (mmio) {
        case MMIO_READ:
@@ -364,13 +427,13 @@ static bool handle_mmio(struct pt_regs *regs, struct ve_info *ve)
        default:
                /* All other cases has to be covered with the first switch() */
                WARN_ON_ONCE(1);
-               return false;
+               return -EINVAL;
        }
 
        if (extend_size)
                memset(reg, extend_val, extend_size);
        memcpy(reg, &val, size);
-       return true;
+       return insn.length;
 }
 
 static bool handle_in(struct pt_regs *regs, int size, int port)
@@ -421,13 +484,14 @@ static bool handle_out(struct pt_regs *regs, int size, int port)
  *
  * Return True on success or False on failure.
  */
-static bool handle_io(struct pt_regs *regs, u32 exit_qual)
+static int handle_io(struct pt_regs *regs, struct ve_info *ve)
 {
+       u32 exit_qual = ve->exit_qual;
        int size, port;
-       bool in;
+       bool in, ret;
 
        if (VE_IS_IO_STRING(exit_qual))
-               return false;
+               return -EIO;
 
        in   = VE_IS_IO_IN(exit_qual);
        size = VE_GET_IO_SIZE(exit_qual);
@@ -435,9 +499,13 @@ static bool handle_io(struct pt_regs *regs, u32 exit_qual)
 
 
        if (in)
-               return handle_in(regs, size, port);
+               ret = handle_in(regs, size, port);
        else
-               return handle_out(regs, size, port);
+               ret = handle_out(regs, size, port);
+       if (!ret)
+               return -EIO;
+
+       return ve_instr_len(ve);
 }
 
 /*
@@ -447,13 +515,19 @@ static bool handle_io(struct pt_regs *regs, u32 exit_qual)
 __init bool tdx_early_handle_ve(struct pt_regs *regs)
 {
        struct ve_info ve;
+       int insn_len;
 
        tdx_get_ve_info(&ve);
 
        if (ve.exit_reason != EXIT_REASON_IO_INSTRUCTION)
                return false;
 
-       return handle_io(regs, ve.exit_qual);
+       insn_len = handle_io(regs, &ve);
+       if (insn_len < 0)
+               return false;
+
+       regs->ip += insn_len;
+       return true;
 }
 
 void tdx_get_ve_info(struct ve_info *ve)
@@ -486,54 +560,65 @@ void tdx_get_ve_info(struct ve_info *ve)
        ve->instr_info  = upper_32_bits(out.r10);
 }
 
-/* Handle the user initiated #VE */
-static bool virt_exception_user(struct pt_regs *regs, struct ve_info *ve)
+/*
+ * Handle the user initiated #VE.
+ *
+ * On success, returns the number of bytes RIP should be incremented (>=0)
+ * or -errno on error.
+ */
+static int virt_exception_user(struct pt_regs *regs, struct ve_info *ve)
 {
        switch (ve->exit_reason) {
        case EXIT_REASON_CPUID:
-               return handle_cpuid(regs);
+               return handle_cpuid(regs, ve);
        default:
                pr_warn("Unexpected #VE: %lld\n", ve->exit_reason);
-               return false;
+               return -EIO;
        }
 }
 
-/* Handle the kernel #VE */
-static bool virt_exception_kernel(struct pt_regs *regs, struct ve_info *ve)
+/*
+ * Handle the kernel #VE.
+ *
+ * On success, returns the number of bytes RIP should be incremented (>=0)
+ * or -errno on error.
+ */
+static int virt_exception_kernel(struct pt_regs *regs, struct ve_info *ve)
 {
        switch (ve->exit_reason) {
        case EXIT_REASON_HLT:
-               return handle_halt();
+               return handle_halt(ve);
        case EXIT_REASON_MSR_READ:
-               return read_msr(regs);
+               return read_msr(regs, ve);
        case EXIT_REASON_MSR_WRITE:
-               return write_msr(regs);
+               return write_msr(regs, ve);
        case EXIT_REASON_CPUID:
-               return handle_cpuid(regs);
+               return handle_cpuid(regs, ve);
        case EXIT_REASON_EPT_VIOLATION:
                return handle_mmio(regs, ve);
        case EXIT_REASON_IO_INSTRUCTION:
-               return handle_io(regs, ve->exit_qual);
+               return handle_io(regs, ve);
        default:
                pr_warn("Unexpected #VE: %lld\n", ve->exit_reason);
-               return false;
+               return -EIO;
        }
 }
 
 bool tdx_handle_virt_exception(struct pt_regs *regs, struct ve_info *ve)
 {
-       bool ret;
+       int insn_len;
 
        if (user_mode(regs))
-               ret = virt_exception_user(regs, ve);
+               insn_len = virt_exception_user(regs, ve);
        else
-               ret = virt_exception_kernel(regs, ve);
+               insn_len = virt_exception_kernel(regs, ve);
+       if (insn_len < 0)
+               return false;
 
        /* After successful #VE handling, move the IP */
-       if (ret)
-               regs->ip += ve->instr_len;
+       regs->ip += insn_len;
 
-       return ret;
+       return true;
 }
 
 static bool tdx_tlb_flush_required(bool private)
index 8b392b6..3de6d8b 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/io.h>
 #include <asm/apic.h>
 #include <asm/desc.h>
+#include <asm/sev.h>
 #include <asm/hypervisor.h>
 #include <asm/hyperv-tlfs.h>
 #include <asm/mshyperv.h>
@@ -405,6 +406,11 @@ void __init hyperv_init(void)
        }
 
        if (hv_isolation_type_snp()) {
+               /* Negotiate GHCB Version. */
+               if (!hv_ghcb_negotiate_protocol())
+                       hv_ghcb_terminate(SEV_TERM_SET_GEN,
+                                         GHCB_SEV_ES_PROT_UNSUPPORTED);
+
                hv_ghcb_pg = alloc_percpu(union hv_ghcb *);
                if (!hv_ghcb_pg)
                        goto free_vp_assist_page;
index 2b99411..1dbcbd9 100644 (file)
@@ -53,6 +53,8 @@ union hv_ghcb {
        } hypercall;
 } __packed __aligned(HV_HYP_PAGE_SIZE);
 
+static u16 hv_ghcb_version __ro_after_init;
+
 u64 hv_ghcb_hypercall(u64 control, void *input, void *output, u32 input_size)
 {
        union hv_ghcb *hv_ghcb;
@@ -96,12 +98,85 @@ u64 hv_ghcb_hypercall(u64 control, void *input, void *output, u32 input_size)
        return status;
 }
 
+static inline u64 rd_ghcb_msr(void)
+{
+       return __rdmsr(MSR_AMD64_SEV_ES_GHCB);
+}
+
+static inline void wr_ghcb_msr(u64 val)
+{
+       native_wrmsrl(MSR_AMD64_SEV_ES_GHCB, val);
+}
+
+static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code,
+                                  u64 exit_info_1, u64 exit_info_2)
+{
+       /* Fill in protocol and format specifiers */
+       ghcb->protocol_version = hv_ghcb_version;
+       ghcb->ghcb_usage       = GHCB_DEFAULT_USAGE;
+
+       ghcb_set_sw_exit_code(ghcb, exit_code);
+       ghcb_set_sw_exit_info_1(ghcb, exit_info_1);
+       ghcb_set_sw_exit_info_2(ghcb, exit_info_2);
+
+       VMGEXIT();
+
+       if (ghcb->save.sw_exit_info_1 & GENMASK_ULL(31, 0))
+               return ES_VMM_ERROR;
+       else
+               return ES_OK;
+}
+
+void hv_ghcb_terminate(unsigned int set, unsigned int reason)
+{
+       u64 val = GHCB_MSR_TERM_REQ;
+
+       /* Tell the hypervisor what went wrong. */
+       val |= GHCB_SEV_TERM_REASON(set, reason);
+
+       /* Request Guest Termination from Hypvervisor */
+       wr_ghcb_msr(val);
+       VMGEXIT();
+
+       while (true)
+               asm volatile("hlt\n" : : : "memory");
+}
+
+bool hv_ghcb_negotiate_protocol(void)
+{
+       u64 ghcb_gpa;
+       u64 val;
+
+       /* Save ghcb page gpa. */
+       ghcb_gpa = rd_ghcb_msr();
+
+       /* Do the GHCB protocol version negotiation */
+       wr_ghcb_msr(GHCB_MSR_SEV_INFO_REQ);
+       VMGEXIT();
+       val = rd_ghcb_msr();
+
+       if (GHCB_MSR_INFO(val) != GHCB_MSR_SEV_INFO_RESP)
+               return false;
+
+       if (GHCB_MSR_PROTO_MAX(val) < GHCB_PROTOCOL_MIN ||
+           GHCB_MSR_PROTO_MIN(val) > GHCB_PROTOCOL_MAX)
+               return false;
+
+       hv_ghcb_version = min_t(size_t, GHCB_MSR_PROTO_MAX(val),
+                            GHCB_PROTOCOL_MAX);
+
+       /* Write ghcb page back after negotiating protocol. */
+       wr_ghcb_msr(ghcb_gpa);
+       VMGEXIT();
+
+       return true;
+}
+
 void hv_ghcb_msr_write(u64 msr, u64 value)
 {
        union hv_ghcb *hv_ghcb;
        void **ghcb_base;
        unsigned long flags;
-       struct es_em_ctxt ctxt;
 
        if (!hv_ghcb_pg)
                return;
@@ -120,8 +195,7 @@ void hv_ghcb_msr_write(u64 msr, u64 value)
        ghcb_set_rax(&hv_ghcb->ghcb, lower_32_bits(value));
        ghcb_set_rdx(&hv_ghcb->ghcb, upper_32_bits(value));
 
-       if (sev_es_ghcb_hv_call(&hv_ghcb->ghcb, false, &ctxt,
-                               SVM_EXIT_MSR, 1, 0))
+       if (hv_ghcb_hv_call(&hv_ghcb->ghcb, SVM_EXIT_MSR, 1, 0))
                pr_warn("Fail to write msr via ghcb %llx.\n", msr);
 
        local_irq_restore(flags);
@@ -133,7 +207,6 @@ void hv_ghcb_msr_read(u64 msr, u64 *value)
        union hv_ghcb *hv_ghcb;
        void **ghcb_base;
        unsigned long flags;
-       struct es_em_ctxt ctxt;
 
        /* Check size of union hv_ghcb here. */
        BUILD_BUG_ON(sizeof(union hv_ghcb) != HV_HYP_PAGE_SIZE);
@@ -152,8 +225,7 @@ void hv_ghcb_msr_read(u64 msr, u64 *value)
        }
 
        ghcb_set_rcx(&hv_ghcb->ghcb, msr);
-       if (sev_es_ghcb_hv_call(&hv_ghcb->ghcb, false, &ctxt,
-                               SVM_EXIT_MSR, 0, 0))
+       if (hv_ghcb_hv_call(&hv_ghcb->ghcb, SVM_EXIT_MSR, 0, 0))
                pr_warn("Fail to read msr via ghcb %llx.\n", msr);
        else
                *value = (u64)lower_32_bits(hv_ghcb->ghcb.save.rax)
index 393f2bb..03acc82 100644 (file)
 #define X86_BUG_TAA                    X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
 #define X86_BUG_ITLB_MULTIHIT          X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
 #define X86_BUG_SRBDS                  X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
+#define X86_BUG_MMIO_STALE_DATA                X86_BUG(25) /* CPU is affected by Processor MMIO Stale Data vulnerabilities */
 
 #endif /* _ASM_X86_CPUFEATURES_H */
index 5a39ed5..e8f58dd 100644 (file)
@@ -4,9 +4,6 @@
 
 #include <asm/e820/types.h>
 
-struct device;
-struct resource;
-
 extern struct e820_table *e820_table;
 extern struct e820_table *e820_table_kexec;
 extern struct e820_table *e820_table_firmware;
@@ -46,8 +43,6 @@ extern void e820__register_nosave_regions(unsigned long limit_pfn);
 
 extern int  e820__get_entry_type(u64 start, u64 end);
 
-extern void remove_e820_regions(struct device *dev, struct resource *avail);
-
 /*
  * Returns true iff the specified range [start,end) is completely contained inside
  * the ISA region.
index 71943dc..9636742 100644 (file)
@@ -323,7 +323,7 @@ static inline u32 efi64_convert_status(efi_status_t status)
 #define __efi64_argmap_get_memory_space_descriptor(phys, desc) \
        (__efi64_split(phys), (desc))
 
-#define __efi64_argmap_set_memory_space_descriptor(phys, size, flags) \
+#define __efi64_argmap_set_memory_space_attributes(phys, size, flags) \
        (__efi64_split(phys), __efi64_split(size), __efi64_split(flags))
 
 /*
index 959d66b..9217bd6 100644 (file)
@@ -653,6 +653,7 @@ struct kvm_vcpu_arch {
        u64 ia32_misc_enable_msr;
        u64 smbase;
        u64 smi_count;
+       bool at_instruction_boundary;
        bool tpr_access_reporting;
        bool xsaves_enabled;
        bool xfd_no_write_intercept;
@@ -1046,14 +1047,77 @@ struct kvm_x86_msr_filter {
 };
 
 enum kvm_apicv_inhibit {
+
+       /********************************************************************/
+       /* INHIBITs that are relevant to both Intel's APICv and AMD's AVIC. */
+       /********************************************************************/
+
+       /*
+        * APIC acceleration is disabled by a module parameter
+        * and/or not supported in hardware.
+        */
        APICV_INHIBIT_REASON_DISABLE,
+
+       /*
+        * APIC acceleration is inhibited because AutoEOI feature is
+        * being used by a HyperV guest.
+        */
        APICV_INHIBIT_REASON_HYPERV,
+
+       /*
+        * APIC acceleration is inhibited because the userspace didn't yet
+        * enable the kernel/split irqchip.
+        */
+       APICV_INHIBIT_REASON_ABSENT,
+
+       /* APIC acceleration is inhibited because KVM_GUESTDBG_BLOCKIRQ
+        * (out of band, debug measure of blocking all interrupts on this vCPU)
+        * was enabled, to avoid AVIC/APICv bypassing it.
+        */
+       APICV_INHIBIT_REASON_BLOCKIRQ,
+
+       /*
+        * For simplicity, the APIC acceleration is inhibited
+        * first time either APIC ID or APIC base are changed by the guest
+        * from their reset values.
+        */
+       APICV_INHIBIT_REASON_APIC_ID_MODIFIED,
+       APICV_INHIBIT_REASON_APIC_BASE_MODIFIED,
+
+       /******************************************************/
+       /* INHIBITs that are relevant only to the AMD's AVIC. */
+       /******************************************************/
+
+       /*
+        * AVIC is inhibited on a vCPU because it runs a nested guest.
+        *
+        * This is needed because unlike APICv, the peers of this vCPU
+        * cannot use the doorbell mechanism to signal interrupts via AVIC when
+        * a vCPU runs nested.
+        */
        APICV_INHIBIT_REASON_NESTED,
+
+       /*
+        * On SVM, the wait for the IRQ window is implemented with pending vIRQ,
+        * which cannot be injected when the AVIC is enabled, thus AVIC
+        * is inhibited while KVM waits for IRQ window.
+        */
        APICV_INHIBIT_REASON_IRQWIN,
+
+       /*
+        * PIT (i8254) 're-inject' mode, relies on EOI intercept,
+        * which AVIC doesn't support for edge triggered interrupts.
+        */
        APICV_INHIBIT_REASON_PIT_REINJ,
+
+       /*
+        * AVIC is inhibited because the guest has x2apic in its CPUID.
+        */
        APICV_INHIBIT_REASON_X2APIC,
-       APICV_INHIBIT_REASON_BLOCKIRQ,
-       APICV_INHIBIT_REASON_ABSENT,
+
+       /*
+        * AVIC is disabled because SEV doesn't support it.
+        */
        APICV_INHIBIT_REASON_SEV,
 };
 
@@ -1300,6 +1364,8 @@ struct kvm_vcpu_stat {
        u64 nested_run;
        u64 directed_yield_attempted;
        u64 directed_yield_successful;
+       u64 preemption_reported;
+       u64 preemption_other;
        u64 guest_mode;
 };
 
index a82f603..61f0c20 100644 (file)
@@ -179,9 +179,13 @@ int hv_set_mem_host_visibility(unsigned long addr, int numpages, bool visible);
 #ifdef CONFIG_AMD_MEM_ENCRYPT
 void hv_ghcb_msr_write(u64 msr, u64 value);
 void hv_ghcb_msr_read(u64 msr, u64 *value);
+bool hv_ghcb_negotiate_protocol(void);
+void hv_ghcb_terminate(unsigned int set, unsigned int reason);
 #else
 static inline void hv_ghcb_msr_write(u64 msr, u64 value) {}
 static inline void hv_ghcb_msr_read(u64 msr, u64 *value) {}
+static inline bool hv_ghcb_negotiate_protocol(void) { return false; }
+static inline void hv_ghcb_terminate(unsigned int set, unsigned int reason) {}
 #endif
 
 extern bool hv_isolation_type_snp(void);
index 403e83b..d27e058 100644 (file)
                                                 * Not susceptible to
                                                 * TSX Async Abort (TAA) vulnerabilities.
                                                 */
+#define ARCH_CAP_SBDR_SSDP_NO          BIT(13) /*
+                                                * Not susceptible to SBDR and SSDP
+                                                * variants of Processor MMIO stale data
+                                                * vulnerabilities.
+                                                */
+#define ARCH_CAP_FBSDP_NO              BIT(14) /*
+                                                * Not susceptible to FBSDP variant of
+                                                * Processor MMIO stale data
+                                                * vulnerabilities.
+                                                */
+#define ARCH_CAP_PSDP_NO               BIT(15) /*
+                                                * Not susceptible to PSDP variant of
+                                                * Processor MMIO stale data
+                                                * vulnerabilities.
+                                                */
+#define ARCH_CAP_FB_CLEAR              BIT(17) /*
+                                                * VERW clears CPU fill buffer
+                                                * even on MDS_NO CPUs.
+                                                */
+#define ARCH_CAP_FB_CLEAR_CTRL         BIT(18) /*
+                                                * MSR_IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]
+                                                * bit available to control VERW
+                                                * behavior.
+                                                */
 
 #define MSR_IA32_FLUSH_CMD             0x0000010b
 #define L1D_FLUSH                      BIT(0)  /*
 #define MSR_IA32_MCU_OPT_CTRL          0x00000123
 #define RNGDS_MITG_DIS                 BIT(0)  /* SRBDS support */
 #define RTM_ALLOW                      BIT(1)  /* TSX development mode */
+#define FB_CLEAR_DIS                   BIT(3)  /* CPU Fill buffer clear disable */
 
 #define MSR_IA32_SYSENTER_CS           0x00000174
 #define MSR_IA32_SYSENTER_ESP          0x00000175
index acbaeaf..da251a5 100644 (file)
@@ -269,6 +269,8 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear);
 
 DECLARE_STATIC_KEY_FALSE(switch_mm_cond_l1d_flush);
 
+DECLARE_STATIC_KEY_FALSE(mmio_stale_data_clear);
+
 #include <asm/segment.h>
 
 /**
index f52a886..70533fd 100644 (file)
@@ -69,6 +69,8 @@ void pcibios_scan_specific_bus(int busn);
 
 /* pci-irq.c */
 
+struct pci_dev;
+
 struct irq_info {
        u8 bus, devfn;                  /* Bus, device and function */
        struct {
@@ -246,3 +248,9 @@ static inline void mmio_config_writel(void __iomem *pos, u32 val)
 # define x86_default_pci_init_irq      NULL
 # define x86_default_pci_fixup_irqs    NULL
 #endif
+
+#if defined(CONFIG_PCI) && defined(CONFIG_ACPI)
+extern bool pci_use_e820;
+#else
+#define pci_use_e820 false
+#endif
index 7590ac2..f8b9ee9 100644 (file)
@@ -108,19 +108,16 @@ extern unsigned long _brk_end;
 void *extend_brk(size_t size, size_t align);
 
 /*
- * Reserve space in the brk section.  The name must be unique within the file,
- * and somewhat descriptive.  The size is in bytes.
+ * Reserve space in the .brk section, which is a block of memory from which the
+ * caller is allowed to allocate very early (before even memblock is available)
+ * by calling extend_brk().  All allocated memory will be eventually converted
+ * to memblock.  Any leftover unallocated memory will be freed.
  *
- * The allocation is done using inline asm (rather than using a section
- * attribute on a normal variable) in order to allow the use of @nobits, so
- * that it doesn't take up any space in the vmlinux file.
+ * The size is in bytes.
  */
-#define RESERVE_BRK(name, size)                                                \
-       asm(".pushsection .brk_reservation,\"aw\",@nobits\n\t"          \
-           ".brk." #name ":\n\t"                                       \
-           ".skip " __stringify(size) "\n\t"                           \
-           ".size .brk." #name ", " __stringify(size) "\n\t"           \
-           ".popsection\n\t")
+#define RESERVE_BRK(name, size)                                        \
+       __section(".bss..brk") __aligned(1) __used      \
+       static char __brk_##name[size]
 
 extern void probe_roms(void);
 #ifdef __i386__
@@ -133,12 +130,19 @@ asmlinkage void __init x86_64_start_reservations(char *real_mode_data);
 
 #endif /* __i386__ */
 #endif /* _SETUP */
-#else
-#define RESERVE_BRK(name,sz)                           \
-       .pushsection .brk_reservation,"aw",@nobits;     \
-.brk.name:                                             \
-1:     .skip sz;                                       \
-       .size .brk.name,.-1b;                           \
+
+#else  /* __ASSEMBLY */
+
+.macro __RESERVE_BRK name, size
+       .pushsection .bss..brk, "aw"
+SYM_DATA_START(__brk_\name)
+       .skip \size
+SYM_DATA_END(__brk_\name)
        .popsection
+.endm
+
+#define RESERVE_BRK(name, size) __RESERVE_BRK name, size
+
 #endif /* __ASSEMBLY__ */
+
 #endif /* _ASM_X86_SETUP_H */
index 35f222a..913e593 100644 (file)
@@ -439,7 +439,7 @@ do {                                                                        \
                       [ptr] "+m" (*_ptr),                              \
                       [old] "+a" (__old)                               \
                     : [new] ltype (__new)                              \
-                    : "memory", "cc");                                 \
+                    : "memory");                                       \
        if (unlikely(__err))                                            \
                goto label;                                             \
        if (unlikely(!success))                                         \
index 03364dc..4c8b6ae 100644 (file)
@@ -36,10 +36,6 @@ KCSAN_SANITIZE := n
 
 OBJECT_FILES_NON_STANDARD_test_nx.o                    := y
 
-ifdef CONFIG_FRAME_POINTER
-OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o             := y
-endif
-
 # If instrumentation of this dir is enabled, boot hangs during first second.
 # Probably could be more selective here, but note that files related to irqs,
 # boot, dumpstack/stacktrace, etc are either non-interesting or can lead to
index d879a6c..74c62cc 100644 (file)
@@ -41,8 +41,10 @@ static void __init spectre_v2_select_mitigation(void);
 static void __init ssb_select_mitigation(void);
 static void __init l1tf_select_mitigation(void);
 static void __init mds_select_mitigation(void);
-static void __init mds_print_mitigation(void);
+static void __init md_clear_update_mitigation(void);
+static void __init md_clear_select_mitigation(void);
 static void __init taa_select_mitigation(void);
+static void __init mmio_select_mitigation(void);
 static void __init srbds_select_mitigation(void);
 static void __init l1d_flush_select_mitigation(void);
 
@@ -85,6 +87,10 @@ EXPORT_SYMBOL_GPL(mds_idle_clear);
  */
 DEFINE_STATIC_KEY_FALSE(switch_mm_cond_l1d_flush);
 
+/* Controls CPU Fill buffer clear before KVM guest MMIO accesses */
+DEFINE_STATIC_KEY_FALSE(mmio_stale_data_clear);
+EXPORT_SYMBOL_GPL(mmio_stale_data_clear);
+
 void __init check_bugs(void)
 {
        identify_boot_cpu();
@@ -117,17 +123,10 @@ void __init check_bugs(void)
        spectre_v2_select_mitigation();
        ssb_select_mitigation();
        l1tf_select_mitigation();
-       mds_select_mitigation();
-       taa_select_mitigation();
+       md_clear_select_mitigation();
        srbds_select_mitigation();
        l1d_flush_select_mitigation();
 
-       /*
-        * As MDS and TAA mitigations are inter-related, print MDS
-        * mitigation until after TAA mitigation selection is done.
-        */
-       mds_print_mitigation();
-
        arch_smt_update();
 
 #ifdef CONFIG_X86_32
@@ -267,14 +266,6 @@ static void __init mds_select_mitigation(void)
        }
 }
 
-static void __init mds_print_mitigation(void)
-{
-       if (!boot_cpu_has_bug(X86_BUG_MDS) || cpu_mitigations_off())
-               return;
-
-       pr_info("%s\n", mds_strings[mds_mitigation]);
-}
-
 static int __init mds_cmdline(char *str)
 {
        if (!boot_cpu_has_bug(X86_BUG_MDS))
@@ -329,7 +320,7 @@ static void __init taa_select_mitigation(void)
        /* TSX previously disabled by tsx=off */
        if (!boot_cpu_has(X86_FEATURE_RTM)) {
                taa_mitigation = TAA_MITIGATION_TSX_DISABLED;
-               goto out;
+               return;
        }
 
        if (cpu_mitigations_off()) {
@@ -343,7 +334,7 @@ static void __init taa_select_mitigation(void)
         */
        if (taa_mitigation == TAA_MITIGATION_OFF &&
            mds_mitigation == MDS_MITIGATION_OFF)
-               goto out;
+               return;
 
        if (boot_cpu_has(X86_FEATURE_MD_CLEAR))
                taa_mitigation = TAA_MITIGATION_VERW;
@@ -375,18 +366,6 @@ static void __init taa_select_mitigation(void)
 
        if (taa_nosmt || cpu_mitigations_auto_nosmt())
                cpu_smt_disable(false);
-
-       /*
-        * Update MDS mitigation, if necessary, as the mds_user_clear is
-        * now enabled for TAA mitigation.
-        */
-       if (mds_mitigation == MDS_MITIGATION_OFF &&
-           boot_cpu_has_bug(X86_BUG_MDS)) {
-               mds_mitigation = MDS_MITIGATION_FULL;
-               mds_select_mitigation();
-       }
-out:
-       pr_info("%s\n", taa_strings[taa_mitigation]);
 }
 
 static int __init tsx_async_abort_parse_cmdline(char *str)
@@ -410,6 +389,151 @@ static int __init tsx_async_abort_parse_cmdline(char *str)
 }
 early_param("tsx_async_abort", tsx_async_abort_parse_cmdline);
 
+#undef pr_fmt
+#define pr_fmt(fmt)    "MMIO Stale Data: " fmt
+
+enum mmio_mitigations {
+       MMIO_MITIGATION_OFF,
+       MMIO_MITIGATION_UCODE_NEEDED,
+       MMIO_MITIGATION_VERW,
+};
+
+/* Default mitigation for Processor MMIO Stale Data vulnerabilities */
+static enum mmio_mitigations mmio_mitigation __ro_after_init = MMIO_MITIGATION_VERW;
+static bool mmio_nosmt __ro_after_init = false;
+
+static const char * const mmio_strings[] = {
+       [MMIO_MITIGATION_OFF]           = "Vulnerable",
+       [MMIO_MITIGATION_UCODE_NEEDED]  = "Vulnerable: Clear CPU buffers attempted, no microcode",
+       [MMIO_MITIGATION_VERW]          = "Mitigation: Clear CPU buffers",
+};
+
+static void __init mmio_select_mitigation(void)
+{
+       u64 ia32_cap;
+
+       if (!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA) ||
+           cpu_mitigations_off()) {
+               mmio_mitigation = MMIO_MITIGATION_OFF;
+               return;
+       }
+
+       if (mmio_mitigation == MMIO_MITIGATION_OFF)
+               return;
+
+       ia32_cap = x86_read_arch_cap_msr();
+
+       /*
+        * Enable CPU buffer clear mitigation for host and VMM, if also affected
+        * by MDS or TAA. Otherwise, enable mitigation for VMM only.
+        */
+       if (boot_cpu_has_bug(X86_BUG_MDS) || (boot_cpu_has_bug(X86_BUG_TAA) &&
+                                             boot_cpu_has(X86_FEATURE_RTM)))
+               static_branch_enable(&mds_user_clear);
+       else
+               static_branch_enable(&mmio_stale_data_clear);
+
+       /*
+        * If Processor-MMIO-Stale-Data bug is present and Fill Buffer data can
+        * be propagated to uncore buffers, clearing the Fill buffers on idle
+        * is required irrespective of SMT state.
+        */
+       if (!(ia32_cap & ARCH_CAP_FBSDP_NO))
+               static_branch_enable(&mds_idle_clear);
+
+       /*
+        * Check if the system has the right microcode.
+        *
+        * CPU Fill buffer clear mitigation is enumerated by either an explicit
+        * FB_CLEAR or by the presence of both MD_CLEAR and L1D_FLUSH on MDS
+        * affected systems.
+        */
+       if ((ia32_cap & ARCH_CAP_FB_CLEAR) ||
+           (boot_cpu_has(X86_FEATURE_MD_CLEAR) &&
+            boot_cpu_has(X86_FEATURE_FLUSH_L1D) &&
+            !(ia32_cap & ARCH_CAP_MDS_NO)))
+               mmio_mitigation = MMIO_MITIGATION_VERW;
+       else
+               mmio_mitigation = MMIO_MITIGATION_UCODE_NEEDED;
+
+       if (mmio_nosmt || cpu_mitigations_auto_nosmt())
+               cpu_smt_disable(false);
+}
+
+static int __init mmio_stale_data_parse_cmdline(char *str)
+{
+       if (!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA))
+               return 0;
+
+       if (!str)
+               return -EINVAL;
+
+       if (!strcmp(str, "off")) {
+               mmio_mitigation = MMIO_MITIGATION_OFF;
+       } else if (!strcmp(str, "full")) {
+               mmio_mitigation = MMIO_MITIGATION_VERW;
+       } else if (!strcmp(str, "full,nosmt")) {
+               mmio_mitigation = MMIO_MITIGATION_VERW;
+               mmio_nosmt = true;
+       }
+
+       return 0;
+}
+early_param("mmio_stale_data", mmio_stale_data_parse_cmdline);
+
+#undef pr_fmt
+#define pr_fmt(fmt)     "" fmt
+
+static void __init md_clear_update_mitigation(void)
+{
+       if (cpu_mitigations_off())
+               return;
+
+       if (!static_key_enabled(&mds_user_clear))
+               goto out;
+
+       /*
+        * mds_user_clear is now enabled. Update MDS, TAA and MMIO Stale Data
+        * mitigation, if necessary.
+        */
+       if (mds_mitigation == MDS_MITIGATION_OFF &&
+           boot_cpu_has_bug(X86_BUG_MDS)) {
+               mds_mitigation = MDS_MITIGATION_FULL;
+               mds_select_mitigation();
+       }
+       if (taa_mitigation == TAA_MITIGATION_OFF &&
+           boot_cpu_has_bug(X86_BUG_TAA)) {
+               taa_mitigation = TAA_MITIGATION_VERW;
+               taa_select_mitigation();
+       }
+       if (mmio_mitigation == MMIO_MITIGATION_OFF &&
+           boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA)) {
+               mmio_mitigation = MMIO_MITIGATION_VERW;
+               mmio_select_mitigation();
+       }
+out:
+       if (boot_cpu_has_bug(X86_BUG_MDS))
+               pr_info("MDS: %s\n", mds_strings[mds_mitigation]);
+       if (boot_cpu_has_bug(X86_BUG_TAA))
+               pr_info("TAA: %s\n", taa_strings[taa_mitigation]);
+       if (boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA))
+               pr_info("MMIO Stale Data: %s\n", mmio_strings[mmio_mitigation]);
+}
+
+static void __init md_clear_select_mitigation(void)
+{
+       mds_select_mitigation();
+       taa_select_mitigation();
+       mmio_select_mitigation();
+
+       /*
+        * As MDS, TAA and MMIO Stale Data mitigations are inter-related, update
+        * and print their mitigation after MDS, TAA and MMIO Stale Data
+        * mitigation selection is done.
+        */
+       md_clear_update_mitigation();
+}
+
 #undef pr_fmt
 #define pr_fmt(fmt)    "SRBDS: " fmt
 
@@ -478,11 +602,13 @@ static void __init srbds_select_mitigation(void)
                return;
 
        /*
-        * Check to see if this is one of the MDS_NO systems supporting
-        * TSX that are only exposed to SRBDS when TSX is enabled.
+        * Check to see if this is one of the MDS_NO systems supporting TSX that
+        * are only exposed to SRBDS when TSX is enabled or when CPU is affected
+        * by Processor MMIO Stale Data vulnerability.
         */
        ia32_cap = x86_read_arch_cap_msr();
-       if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM))
+       if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM) &&
+           !boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA))
                srbds_mitigation = SRBDS_MITIGATION_TSX_OFF;
        else if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
                srbds_mitigation = SRBDS_MITIGATION_HYPERVISOR;
@@ -1116,6 +1242,8 @@ static void update_indir_branch_cond(void)
 /* Update the static key controlling the MDS CPU buffer clear in idle */
 static void update_mds_branch_idle(void)
 {
+       u64 ia32_cap = x86_read_arch_cap_msr();
+
        /*
         * Enable the idle clearing if SMT is active on CPUs which are
         * affected only by MSBDS and not any other MDS variant.
@@ -1127,14 +1255,17 @@ static void update_mds_branch_idle(void)
        if (!boot_cpu_has_bug(X86_BUG_MSBDS_ONLY))
                return;
 
-       if (sched_smt_active())
+       if (sched_smt_active()) {
                static_branch_enable(&mds_idle_clear);
-       else
+       } else if (mmio_mitigation == MMIO_MITIGATION_OFF ||
+                  (ia32_cap & ARCH_CAP_FBSDP_NO)) {
                static_branch_disable(&mds_idle_clear);
+       }
 }
 
 #define MDS_MSG_SMT "MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.\n"
 #define TAA_MSG_SMT "TAA CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/tsx_async_abort.html for more details.\n"
+#define MMIO_MSG_SMT "MMIO Stale Data CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/processor_mmio_stale_data.html for more details.\n"
 
 void cpu_bugs_smt_update(void)
 {
@@ -1179,6 +1310,16 @@ void cpu_bugs_smt_update(void)
                break;
        }
 
+       switch (mmio_mitigation) {
+       case MMIO_MITIGATION_VERW:
+       case MMIO_MITIGATION_UCODE_NEEDED:
+               if (sched_smt_active())
+                       pr_warn_once(MMIO_MSG_SMT);
+               break;
+       case MMIO_MITIGATION_OFF:
+               break;
+       }
+
        mutex_unlock(&spec_ctrl_mutex);
 }
 
@@ -1781,6 +1922,20 @@ static ssize_t tsx_async_abort_show_state(char *buf)
                       sched_smt_active() ? "vulnerable" : "disabled");
 }
 
+static ssize_t mmio_stale_data_show_state(char *buf)
+{
+       if (mmio_mitigation == MMIO_MITIGATION_OFF)
+               return sysfs_emit(buf, "%s\n", mmio_strings[mmio_mitigation]);
+
+       if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
+               return sysfs_emit(buf, "%s; SMT Host state unknown\n",
+                                 mmio_strings[mmio_mitigation]);
+       }
+
+       return sysfs_emit(buf, "%s; SMT %s\n", mmio_strings[mmio_mitigation],
+                         sched_smt_active() ? "vulnerable" : "disabled");
+}
+
 static char *stibp_state(void)
 {
        if (spectre_v2_in_eibrs_mode(spectre_v2_enabled))
@@ -1881,6 +2036,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
        case X86_BUG_SRBDS:
                return srbds_show_state(buf);
 
+       case X86_BUG_MMIO_STALE_DATA:
+               return mmio_stale_data_show_state(buf);
+
        default:
                break;
        }
@@ -1932,4 +2090,9 @@ ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr, char *
 {
        return cpu_show_common(dev, attr, buf, X86_BUG_SRBDS);
 }
+
+ssize_t cpu_show_mmio_stale_data(struct device *dev, struct device_attribute *attr, char *buf)
+{
+       return cpu_show_common(dev, attr, buf, X86_BUG_MMIO_STALE_DATA);
+}
 #endif
index c296cb1..4730b0a 100644 (file)
@@ -1211,18 +1211,42 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
                                            X86_FEATURE_ANY, issues)
 
 #define SRBDS          BIT(0)
+/* CPU is affected by X86_BUG_MMIO_STALE_DATA */
+#define MMIO           BIT(1)
+/* CPU is affected by Shared Buffers Data Sampling (SBDS), a variant of X86_BUG_MMIO_STALE_DATA */
+#define MMIO_SBDS      BIT(2)
 
 static const struct x86_cpu_id cpu_vuln_blacklist[] __initconst = {
        VULNBL_INTEL_STEPPINGS(IVYBRIDGE,       X86_STEPPING_ANY,               SRBDS),
        VULNBL_INTEL_STEPPINGS(HASWELL,         X86_STEPPING_ANY,               SRBDS),
        VULNBL_INTEL_STEPPINGS(HASWELL_L,       X86_STEPPING_ANY,               SRBDS),
        VULNBL_INTEL_STEPPINGS(HASWELL_G,       X86_STEPPING_ANY,               SRBDS),
+       VULNBL_INTEL_STEPPINGS(HASWELL_X,       BIT(2) | BIT(4),                MMIO),
+       VULNBL_INTEL_STEPPINGS(BROADWELL_D,     X86_STEPPINGS(0x3, 0x5),        MMIO),
        VULNBL_INTEL_STEPPINGS(BROADWELL_G,     X86_STEPPING_ANY,               SRBDS),
+       VULNBL_INTEL_STEPPINGS(BROADWELL_X,     X86_STEPPING_ANY,               MMIO),
        VULNBL_INTEL_STEPPINGS(BROADWELL,       X86_STEPPING_ANY,               SRBDS),
+       VULNBL_INTEL_STEPPINGS(SKYLAKE_L,       X86_STEPPINGS(0x3, 0x3),        SRBDS | MMIO),
        VULNBL_INTEL_STEPPINGS(SKYLAKE_L,       X86_STEPPING_ANY,               SRBDS),
+       VULNBL_INTEL_STEPPINGS(SKYLAKE_X,       BIT(3) | BIT(4) | BIT(6) |
+                                               BIT(7) | BIT(0xB),              MMIO),
+       VULNBL_INTEL_STEPPINGS(SKYLAKE,         X86_STEPPINGS(0x3, 0x3),        SRBDS | MMIO),
        VULNBL_INTEL_STEPPINGS(SKYLAKE,         X86_STEPPING_ANY,               SRBDS),
-       VULNBL_INTEL_STEPPINGS(KABYLAKE_L,      X86_STEPPINGS(0x0, 0xC),        SRBDS),
-       VULNBL_INTEL_STEPPINGS(KABYLAKE,        X86_STEPPINGS(0x0, 0xD),        SRBDS),
+       VULNBL_INTEL_STEPPINGS(KABYLAKE_L,      X86_STEPPINGS(0x9, 0xC),        SRBDS | MMIO),
+       VULNBL_INTEL_STEPPINGS(KABYLAKE_L,      X86_STEPPINGS(0x0, 0x8),        SRBDS),
+       VULNBL_INTEL_STEPPINGS(KABYLAKE,        X86_STEPPINGS(0x9, 0xD),        SRBDS | MMIO),
+       VULNBL_INTEL_STEPPINGS(KABYLAKE,        X86_STEPPINGS(0x0, 0x8),        SRBDS),
+       VULNBL_INTEL_STEPPINGS(ICELAKE_L,       X86_STEPPINGS(0x5, 0x5),        MMIO | MMIO_SBDS),
+       VULNBL_INTEL_STEPPINGS(ICELAKE_D,       X86_STEPPINGS(0x1, 0x1),        MMIO),
+       VULNBL_INTEL_STEPPINGS(ICELAKE_X,       X86_STEPPINGS(0x4, 0x6),        MMIO),
+       VULNBL_INTEL_STEPPINGS(COMETLAKE,       BIT(2) | BIT(3) | BIT(5),       MMIO | MMIO_SBDS),
+       VULNBL_INTEL_STEPPINGS(COMETLAKE_L,     X86_STEPPINGS(0x1, 0x1),        MMIO | MMIO_SBDS),
+       VULNBL_INTEL_STEPPINGS(COMETLAKE_L,     X86_STEPPINGS(0x0, 0x0),        MMIO),
+       VULNBL_INTEL_STEPPINGS(LAKEFIELD,       X86_STEPPINGS(0x1, 0x1),        MMIO | MMIO_SBDS),
+       VULNBL_INTEL_STEPPINGS(ROCKETLAKE,      X86_STEPPINGS(0x1, 0x1),        MMIO),
+       VULNBL_INTEL_STEPPINGS(ATOM_TREMONT,    X86_STEPPINGS(0x1, 0x1),        MMIO | MMIO_SBDS),
+       VULNBL_INTEL_STEPPINGS(ATOM_TREMONT_D,  X86_STEPPING_ANY,               MMIO),
+       VULNBL_INTEL_STEPPINGS(ATOM_TREMONT_L,  X86_STEPPINGS(0x0, 0x0),        MMIO | MMIO_SBDS),
        {}
 };
 
@@ -1243,6 +1267,13 @@ u64 x86_read_arch_cap_msr(void)
        return ia32_cap;
 }
 
+static bool arch_cap_mmio_immune(u64 ia32_cap)
+{
+       return (ia32_cap & ARCH_CAP_FBSDP_NO &&
+               ia32_cap & ARCH_CAP_PSDP_NO &&
+               ia32_cap & ARCH_CAP_SBDR_SSDP_NO);
+}
+
 static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
 {
        u64 ia32_cap = x86_read_arch_cap_msr();
@@ -1296,12 +1327,27 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
        /*
         * SRBDS affects CPUs which support RDRAND or RDSEED and are listed
         * in the vulnerability blacklist.
+        *
+        * Some of the implications and mitigation of Shared Buffers Data
+        * Sampling (SBDS) are similar to SRBDS. Give SBDS same treatment as
+        * SRBDS.
         */
        if ((cpu_has(c, X86_FEATURE_RDRAND) ||
             cpu_has(c, X86_FEATURE_RDSEED)) &&
-           cpu_matches(cpu_vuln_blacklist, SRBDS))
+           cpu_matches(cpu_vuln_blacklist, SRBDS | MMIO_SBDS))
                    setup_force_cpu_bug(X86_BUG_SRBDS);
 
+       /*
+        * Processor MMIO Stale Data bug enumeration
+        *
+        * Affected CPU list is generally enough to enumerate the vulnerability,
+        * but for virtualization case check for ARCH_CAP MSR bits also, VMM may
+        * not want the guest to enumerate the bug.
+        */
+       if (cpu_matches(cpu_vuln_blacklist, MMIO) &&
+           !arch_cap_mmio_immune(ia32_cap))
+               setup_force_cpu_bug(X86_BUG_MMIO_STALE_DATA);
+
        if (cpu_matches(cpu_vuln_whitelist, NO_MELTDOWN))
                return;
 
index 4ec1360..dfeb227 100644 (file)
@@ -175,6 +175,7 @@ SYM_INNER_LABEL(ftrace_caller_end, SYM_L_GLOBAL)
 
        jmp ftrace_epilogue
 SYM_FUNC_END(ftrace_caller);
+STACK_FRAME_NON_STANDARD_FP(ftrace_caller)
 
 SYM_FUNC_START(ftrace_epilogue)
 /*
@@ -282,6 +283,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL)
        jmp     ftrace_epilogue
 
 SYM_FUNC_END(ftrace_regs_caller)
+STACK_FRAME_NON_STANDARD_FP(ftrace_regs_caller)
 
 
 #else /* ! CONFIG_DYNAMIC_FTRACE */
@@ -311,10 +313,14 @@ trace:
        jmp ftrace_stub
 SYM_FUNC_END(__fentry__)
 EXPORT_SYMBOL(__fentry__)
+STACK_FRAME_NON_STANDARD_FP(__fentry__)
+
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
-SYM_FUNC_START(return_to_handler)
+SYM_CODE_START(return_to_handler)
+       UNWIND_HINT_EMPTY
+       ANNOTATE_NOENDBR
        subq  $16, %rsp
 
        /* Save the return values */
@@ -339,7 +345,6 @@ SYM_FUNC_START(return_to_handler)
        int3
 .Ldo_rop:
        mov %rdi, (%rsp)
-       UNWIND_HINT_FUNC
        RET
-SYM_FUNC_END(return_to_handler)
+SYM_CODE_END(return_to_handler)
 #endif
index db2b350..bba1abd 100644 (file)
@@ -1,7 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
-#include <linux/dev_printk.h>
 #include <linux/ioport.h>
+#include <linux/printk.h>
 #include <asm/e820/api.h>
+#include <asm/pci_x86.h>
 
 static void resource_clip(struct resource *res, resource_size_t start,
                          resource_size_t end)
@@ -24,14 +25,14 @@ static void resource_clip(struct resource *res, resource_size_t start,
                res->start = end + 1;
 }
 
-void remove_e820_regions(struct device *dev, struct resource *avail)
+static void remove_e820_regions(struct resource *avail)
 {
        int i;
        struct e820_entry *entry;
        u64 e820_start, e820_end;
        struct resource orig = *avail;
 
-       if (!(avail->flags & IORESOURCE_MEM))
+       if (!pci_use_e820)
                return;
 
        for (i = 0; i < e820_table->nr_entries; i++) {
@@ -41,7 +42,7 @@ void remove_e820_regions(struct device *dev, struct resource *avail)
 
                resource_clip(avail, e820_start, e820_end);
                if (orig.start != avail->start || orig.end != avail->end) {
-                       dev_info(dev, "clipped %pR to %pR for e820 entry [mem %#010Lx-%#010Lx]\n",
+                       pr_info("clipped %pR to %pR for e820 entry [mem %#010Lx-%#010Lx]\n",
                                 &orig, avail, e820_start, e820_end);
                        orig = *avail;
                }
@@ -55,6 +56,9 @@ void arch_remove_reservations(struct resource *avail)
         * the low 1MB unconditionally, as this area is needed for some ISA
         * cards requiring a memory range, e.g. the i82365 PCMCIA controller.
         */
-       if (avail->flags & IORESOURCE_MEM)
+       if (avail->flags & IORESOURCE_MEM) {
                resource_clip(avail, BIOS_ROM_BASE, BIOS_ROM_END);
+
+               remove_e820_regions(avail);
+       }
 }
index 3ebb853..bd6c6fd 100644 (file)
@@ -67,11 +67,6 @@ RESERVE_BRK(dmi_alloc, 65536);
 #endif
 
 
-/*
- * Range of the BSS area. The size of the BSS area is determined
- * at link time, with RESERVE_BRK() facility reserving additional
- * chunks.
- */
 unsigned long _brk_start = (unsigned long)__brk_base;
 unsigned long _brk_end   = (unsigned long)__brk_base;
 
index f5f6dc2..81aba71 100644 (file)
@@ -385,10 +385,10 @@ SECTIONS
        __end_of_kernel_reserve = .;
 
        . = ALIGN(PAGE_SIZE);
-       .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
+       .brk (NOLOAD) : AT(ADDR(.brk) - LOAD_OFFSET) {
                __brk_base = .;
                . += 64 * 1024;         /* 64k alignment slop space */
-               *(.brk_reservation)     /* areas brk users have reserved */
+               *(.bss..brk)            /* areas brk users have reserved */
                __brk_limit = .;
        }
 
index f1bdac3..0e68b4c 100644 (file)
@@ -2039,6 +2039,19 @@ static void apic_manage_nmi_watchdog(struct kvm_lapic *apic, u32 lvt0_val)
        }
 }
 
+static void kvm_lapic_xapic_id_updated(struct kvm_lapic *apic)
+{
+       struct kvm *kvm = apic->vcpu->kvm;
+
+       if (KVM_BUG_ON(apic_x2apic_mode(apic), kvm))
+               return;
+
+       if (kvm_xapic_id(apic) == apic->vcpu->vcpu_id)
+               return;
+
+       kvm_set_apicv_inhibit(apic->vcpu->kvm, APICV_INHIBIT_REASON_APIC_ID_MODIFIED);
+}
+
 static int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
 {
        int ret = 0;
@@ -2047,10 +2060,12 @@ static int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val)
 
        switch (reg) {
        case APIC_ID:           /* Local APIC ID */
-               if (!apic_x2apic_mode(apic))
+               if (!apic_x2apic_mode(apic)) {
                        kvm_apic_set_xapic_id(apic, val >> 24);
-               else
+                       kvm_lapic_xapic_id_updated(apic);
+               } else {
                        ret = 1;
+               }
                break;
 
        case APIC_TASKPRI:
@@ -2336,8 +2351,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
                             MSR_IA32_APICBASE_BASE;
 
        if ((value & MSR_IA32_APICBASE_ENABLE) &&
-            apic->base_address != APIC_DEFAULT_PHYS_BASE)
-               pr_warn_once("APIC base relocation is unsupported by KVM");
+            apic->base_address != APIC_DEFAULT_PHYS_BASE) {
+               kvm_set_apicv_inhibit(apic->vcpu->kvm,
+                                     APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
+       }
 }
 
 void kvm_apic_update_apicv(struct kvm_vcpu *vcpu)
@@ -2648,6 +2665,8 @@ static int kvm_apic_state_fixup(struct kvm_vcpu *vcpu,
                        icr = __kvm_lapic_get_reg64(s->regs, APIC_ICR);
                        __kvm_lapic_set_reg(s->regs, APIC_ICR2, icr >> 32);
                }
+       } else {
+               kvm_lapic_xapic_id_updated(vcpu->arch.apic);
        }
 
        return 0;
index f465368..17252f3 100644 (file)
@@ -3411,7 +3411,7 @@ static int mmu_alloc_direct_roots(struct kvm_vcpu *vcpu)
                        root = mmu_alloc_root(vcpu, i << (30 - PAGE_SHIFT),
                                              i << 30, PT32_ROOT_LEVEL, true);
                        mmu->pae_root[i] = root | PT_PRESENT_MASK |
-                                          shadow_me_mask;
+                                          shadow_me_value;
                }
                mmu->root.hpa = __pa(mmu->pae_root);
        } else {
@@ -5179,7 +5179,7 @@ static void __kvm_mmu_free_obsolete_roots(struct kvm *kvm, struct kvm_mmu *mmu)
                roots_to_free |= KVM_MMU_ROOT_CURRENT;
 
        for (i = 0; i < KVM_MMU_NUM_PREV_ROOTS; i++) {
-               if (is_obsolete_root(kvm, mmu->root.hpa))
+               if (is_obsolete_root(kvm, mmu->prev_roots[i].hpa))
                        roots_to_free |= KVM_MMU_ROOT_PREVIOUS(i);
        }
 
index 6d3b3e5..ee4802d 100644 (file)
@@ -145,6 +145,15 @@ static bool try_step_up(struct tdp_iter *iter)
        return true;
 }
 
+/*
+ * Step the iterator back up a level in the paging structure. Should only be
+ * used when the iterator is below the root level.
+ */
+void tdp_iter_step_up(struct tdp_iter *iter)
+{
+       WARN_ON(!try_step_up(iter));
+}
+
 /*
  * Step to the next SPTE in a pre-order traversal of the paging structure.
  * To get to the next SPTE, the iterator either steps down towards the goal
index f0af385..adfca0c 100644 (file)
@@ -114,5 +114,6 @@ void tdp_iter_start(struct tdp_iter *iter, struct kvm_mmu_page *root,
                    int min_level, gfn_t next_last_level_gfn);
 void tdp_iter_next(struct tdp_iter *iter);
 void tdp_iter_restart(struct tdp_iter *iter);
+void tdp_iter_step_up(struct tdp_iter *iter);
 
 #endif /* __KVM_X86_MMU_TDP_ITER_H */
index 841feaa..7b9265d 100644 (file)
@@ -1742,12 +1742,12 @@ static void zap_collapsible_spte_range(struct kvm *kvm,
        gfn_t start = slot->base_gfn;
        gfn_t end = start + slot->npages;
        struct tdp_iter iter;
+       int max_mapping_level;
        kvm_pfn_t pfn;
 
        rcu_read_lock();
 
        tdp_root_for_each_pte(iter, root, start, end) {
-retry:
                if (tdp_mmu_iter_cond_resched(kvm, &iter, false, true))
                        continue;
 
@@ -1755,15 +1755,41 @@ retry:
                    !is_last_spte(iter.old_spte, iter.level))
                        continue;
 
+               /*
+                * This is a leaf SPTE. Check if the PFN it maps can
+                * be mapped at a higher level.
+                */
                pfn = spte_to_pfn(iter.old_spte);
-               if (kvm_is_reserved_pfn(pfn) ||
-                   iter.level >= kvm_mmu_max_mapping_level(kvm, slot, iter.gfn,
-                                                           pfn, PG_LEVEL_NUM))
+
+               if (kvm_is_reserved_pfn(pfn))
                        continue;
 
+               max_mapping_level = kvm_mmu_max_mapping_level(kvm, slot,
+                               iter.gfn, pfn, PG_LEVEL_NUM);
+
+               WARN_ON(max_mapping_level < iter.level);
+
+               /*
+                * If this page is already mapped at the highest
+                * viable level, there's nothing more to do.
+                */
+               if (max_mapping_level == iter.level)
+                       continue;
+
+               /*
+                * The page can be remapped at a higher level, so step
+                * up to zap the parent SPTE.
+                */
+               while (max_mapping_level > iter.level)
+                       tdp_iter_step_up(&iter);
+
                /* Note, a successful atomic zap also does a remote TLB flush. */
-               if (tdp_mmu_zap_spte_atomic(kvm, &iter))
-                       goto retry;
+               tdp_mmu_zap_spte_atomic(kvm, &iter);
+
+               /*
+                * If the atomic zap fails, the iter will recurse back into
+                * the same subtree to retry.
+                */
        }
 
        rcu_read_unlock();
index 54fe037..d1bc582 100644 (file)
@@ -291,58 +291,91 @@ void avic_ring_doorbell(struct kvm_vcpu *vcpu)
 static int avic_kick_target_vcpus_fast(struct kvm *kvm, struct kvm_lapic *source,
                                       u32 icrl, u32 icrh, u32 index)
 {
-       u32 dest, apic_id;
-       struct kvm_vcpu *vcpu;
+       u32 l1_physical_id, dest;
+       struct kvm_vcpu *target_vcpu;
        int dest_mode = icrl & APIC_DEST_MASK;
        int shorthand = icrl & APIC_SHORT_MASK;
        struct kvm_svm *kvm_svm = to_kvm_svm(kvm);
-       u32 *avic_logical_id_table = page_address(kvm_svm->avic_logical_id_table_page);
 
        if (shorthand != APIC_DEST_NOSHORT)
                return -EINVAL;
 
-       /*
-        * The AVIC incomplete IPI #vmexit info provides index into
-        * the physical APIC ID table, which can be used to derive
-        * guest physical APIC ID.
-        */
+       if (apic_x2apic_mode(source))
+               dest = icrh;
+       else
+               dest = GET_APIC_DEST_FIELD(icrh);
+
        if (dest_mode == APIC_DEST_PHYSICAL) {
-               apic_id = index;
+               /* broadcast destination, use slow path */
+               if (apic_x2apic_mode(source) && dest == X2APIC_BROADCAST)
+                       return -EINVAL;
+               if (!apic_x2apic_mode(source) && dest == APIC_BROADCAST)
+                       return -EINVAL;
+
+               l1_physical_id = dest;
+
+               if (WARN_ON_ONCE(l1_physical_id != index))
+                       return -EINVAL;
+
        } else {
-               if (!apic_x2apic_mode(source)) {
-                       /* For xAPIC logical mode, the index is for logical APIC table. */
-                       apic_id = avic_logical_id_table[index] & 0x1ff;
+               u32 bitmap, cluster;
+               int logid_index;
+
+               if (apic_x2apic_mode(source)) {
+                       /* 16 bit dest mask, 16 bit cluster id */
+                       bitmap = dest & 0xFFFF0000;
+                       cluster = (dest >> 16) << 4;
+               } else if (kvm_lapic_get_reg(source, APIC_DFR) == APIC_DFR_FLAT) {
+                       /* 8 bit dest mask*/
+                       bitmap = dest;
+                       cluster = 0;
                } else {
-                       return -EINVAL;
+                       /* 4 bit desk mask, 4 bit cluster id */
+                       bitmap = dest & 0xF;
+                       cluster = (dest >> 4) << 2;
                }
-       }
 
-       /*
-        * Assuming vcpu ID is the same as physical apic ID,
-        * and use it to retrieve the target vCPU.
-        */
-       vcpu = kvm_get_vcpu_by_id(kvm, apic_id);
-       if (!vcpu)
-               return -EINVAL;
+               if (unlikely(!bitmap))
+                       /* guest bug: nobody to send the logical interrupt to */
+                       return 0;
 
-       if (apic_x2apic_mode(vcpu->arch.apic))
-               dest = icrh;
-       else
-               dest = GET_APIC_DEST_FIELD(icrh);
+               if (!is_power_of_2(bitmap))
+                       /* multiple logical destinations, use slow path */
+                       return -EINVAL;
 
-       /*
-        * Try matching the destination APIC ID with the vCPU.
-        */
-       if (kvm_apic_match_dest(vcpu, source, shorthand, dest, dest_mode)) {
-               vcpu->arch.apic->irr_pending = true;
-               svm_complete_interrupt_delivery(vcpu,
-                                               icrl & APIC_MODE_MASK,
-                                               icrl & APIC_INT_LEVELTRIG,
-                                               icrl & APIC_VECTOR_MASK);
-               return 0;
+               logid_index = cluster + __ffs(bitmap);
+
+               if (apic_x2apic_mode(source)) {
+                       l1_physical_id = logid_index;
+               } else {
+                       u32 *avic_logical_id_table =
+                               page_address(kvm_svm->avic_logical_id_table_page);
+
+                       u32 logid_entry = avic_logical_id_table[logid_index];
+
+                       if (WARN_ON_ONCE(index != logid_index))
+                               return -EINVAL;
+
+                       /* guest bug: non existing/reserved logical destination */
+                       if (unlikely(!(logid_entry & AVIC_LOGICAL_ID_ENTRY_VALID_MASK)))
+                               return 0;
+
+                       l1_physical_id = logid_entry &
+                                        AVIC_LOGICAL_ID_ENTRY_GUEST_PHYSICAL_ID_MASK;
+               }
        }
 
-       return -EINVAL;
+       target_vcpu = kvm_get_vcpu_by_id(kvm, l1_physical_id);
+       if (unlikely(!target_vcpu))
+               /* guest bug: non existing vCPU is a target of this IPI*/
+               return 0;
+
+       target_vcpu->arch.apic->irr_pending = true;
+       svm_complete_interrupt_delivery(target_vcpu,
+                                       icrl & APIC_MODE_MASK,
+                                       icrl & APIC_INT_LEVELTRIG,
+                                       icrl & APIC_VECTOR_MASK);
+       return 0;
 }
 
 static void avic_kick_target_vcpus(struct kvm *kvm, struct kvm_lapic *source,
@@ -508,35 +541,6 @@ static int avic_handle_ldr_update(struct kvm_vcpu *vcpu)
        return ret;
 }
 
-static int avic_handle_apic_id_update(struct kvm_vcpu *vcpu)
-{
-       u64 *old, *new;
-       struct vcpu_svm *svm = to_svm(vcpu);
-       u32 id = kvm_xapic_id(vcpu->arch.apic);
-
-       if (vcpu->vcpu_id == id)
-               return 0;
-
-       old = avic_get_physical_id_entry(vcpu, vcpu->vcpu_id);
-       new = avic_get_physical_id_entry(vcpu, id);
-       if (!new || !old)
-               return 1;
-
-       /* We need to move physical_id_entry to new offset */
-       *new = *old;
-       *old = 0ULL;
-       to_svm(vcpu)->avic_physical_id_cache = new;
-
-       /*
-        * Also update the guest physical APIC ID in the logical
-        * APIC ID table entry if already setup the LDR.
-        */
-       if (svm->ldr_reg)
-               avic_handle_ldr_update(vcpu);
-
-       return 0;
-}
-
 static void avic_handle_dfr_update(struct kvm_vcpu *vcpu)
 {
        struct vcpu_svm *svm = to_svm(vcpu);
@@ -555,10 +559,6 @@ static int avic_unaccel_trap_write(struct kvm_vcpu *vcpu)
                                AVIC_UNACCEL_ACCESS_OFFSET_MASK;
 
        switch (offset) {
-       case APIC_ID:
-               if (avic_handle_apic_id_update(vcpu))
-                       return 0;
-               break;
        case APIC_LDR:
                if (avic_handle_ldr_update(vcpu))
                        return 0;
@@ -650,8 +650,6 @@ int avic_init_vcpu(struct vcpu_svm *svm)
 
 void avic_apicv_post_state_restore(struct kvm_vcpu *vcpu)
 {
-       if (avic_handle_apic_id_update(vcpu) != 0)
-               return;
        avic_handle_dfr_update(vcpu);
        avic_handle_ldr_update(vcpu);
 }
@@ -910,7 +908,9 @@ bool avic_check_apicv_inhibit_reasons(enum kvm_apicv_inhibit reason)
                          BIT(APICV_INHIBIT_REASON_PIT_REINJ) |
                          BIT(APICV_INHIBIT_REASON_X2APIC) |
                          BIT(APICV_INHIBIT_REASON_BLOCKIRQ) |
-                         BIT(APICV_INHIBIT_REASON_SEV);
+                         BIT(APICV_INHIBIT_REASON_SEV)      |
+                         BIT(APICV_INHIBIT_REASON_APIC_ID_MODIFIED) |
+                         BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
 
        return supported & BIT(reason);
 }
@@ -946,7 +946,7 @@ out:
        return ret;
 }
 
-void __avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
+void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
 {
        u64 entry;
        int h_physical_id = kvm_cpu_get_apicid(cpu);
@@ -978,7 +978,7 @@ void __avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
        avic_update_iommu_vcpu_affinity(vcpu, h_physical_id, true);
 }
 
-void __avic_vcpu_put(struct kvm_vcpu *vcpu)
+void avic_vcpu_put(struct kvm_vcpu *vcpu)
 {
        u64 entry;
        struct vcpu_svm *svm = to_svm(vcpu);
@@ -997,25 +997,6 @@ void __avic_vcpu_put(struct kvm_vcpu *vcpu)
        WRITE_ONCE(*(svm->avic_physical_id_cache), entry);
 }
 
-static void avic_vcpu_load(struct kvm_vcpu *vcpu)
-{
-       int cpu = get_cpu();
-
-       WARN_ON(cpu != vcpu->cpu);
-
-       __avic_vcpu_load(vcpu, cpu);
-
-       put_cpu();
-}
-
-static void avic_vcpu_put(struct kvm_vcpu *vcpu)
-{
-       preempt_disable();
-
-       __avic_vcpu_put(vcpu);
-
-       preempt_enable();
-}
 
 void avic_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
 {
@@ -1042,7 +1023,7 @@ void avic_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu)
        vmcb_mark_dirty(vmcb, VMCB_AVIC);
 
        if (activated)
-               avic_vcpu_load(vcpu);
+               avic_vcpu_load(vcpu, vcpu->cpu);
        else
                avic_vcpu_put(vcpu);
 
@@ -1075,5 +1056,5 @@ void avic_vcpu_unblocking(struct kvm_vcpu *vcpu)
        if (!kvm_vcpu_apicv_active(vcpu))
                return;
 
-       avic_vcpu_load(vcpu);
+       avic_vcpu_load(vcpu, vcpu->cpu);
 }
index bed5e16..ba7cd26 100644 (file)
@@ -616,6 +616,8 @@ static void nested_vmcb02_prepare_control(struct vcpu_svm *svm)
        struct kvm_vcpu *vcpu = &svm->vcpu;
        struct vmcb *vmcb01 = svm->vmcb01.ptr;
        struct vmcb *vmcb02 = svm->nested.vmcb02.ptr;
+       u32 pause_count12;
+       u32 pause_thresh12;
 
        /*
         * Filled at exit: exit_code, exit_code_hi, exit_info_1, exit_info_2,
@@ -671,27 +673,25 @@ static void nested_vmcb02_prepare_control(struct vcpu_svm *svm)
        if (!nested_vmcb_needs_vls_intercept(svm))
                vmcb02->control.virt_ext |= VIRTUAL_VMLOAD_VMSAVE_ENABLE_MASK;
 
+       pause_count12 = svm->pause_filter_enabled ? svm->nested.ctl.pause_filter_count : 0;
+       pause_thresh12 = svm->pause_threshold_enabled ? svm->nested.ctl.pause_filter_thresh : 0;
        if (kvm_pause_in_guest(svm->vcpu.kvm)) {
-               /* use guest values since host doesn't use them */
-               vmcb02->control.pause_filter_count =
-                               svm->pause_filter_enabled ?
-                               svm->nested.ctl.pause_filter_count : 0;
+               /* use guest values since host doesn't intercept PAUSE */
+               vmcb02->control.pause_filter_count = pause_count12;
+               vmcb02->control.pause_filter_thresh = pause_thresh12;
 
-               vmcb02->control.pause_filter_thresh =
-                               svm->pause_threshold_enabled ?
-                               svm->nested.ctl.pause_filter_thresh : 0;
-
-       } else if (!vmcb12_is_intercept(&svm->nested.ctl, INTERCEPT_PAUSE)) {
-               /* use host values when guest doesn't use them */
+       } else {
+               /* start from host values otherwise */
                vmcb02->control.pause_filter_count = vmcb01->control.pause_filter_count;
                vmcb02->control.pause_filter_thresh = vmcb01->control.pause_filter_thresh;
-       } else {
-               /*
-                * Intercept every PAUSE otherwise and
-                * ignore both host and guest values
-                */
-               vmcb02->control.pause_filter_count = 0;
-               vmcb02->control.pause_filter_thresh = 0;
+
+               /* ... but ensure filtering is disabled if so requested.  */
+               if (vmcb12_is_intercept(&svm->nested.ctl, INTERCEPT_PAUSE)) {
+                       if (!pause_count12)
+                               vmcb02->control.pause_filter_count = 0;
+                       if (!pause_thresh12)
+                               vmcb02->control.pause_filter_thresh = 0;
+               }
        }
 
        nested_svm_transition_tlb_flush(vcpu);
@@ -951,8 +951,11 @@ int nested_svm_vmexit(struct vcpu_svm *svm)
        vmcb12->control.event_inj         = svm->nested.ctl.event_inj;
        vmcb12->control.event_inj_err     = svm->nested.ctl.event_inj_err;
 
-       if (!kvm_pause_in_guest(vcpu->kvm) && vmcb02->control.pause_filter_count)
+       if (!kvm_pause_in_guest(vcpu->kvm)) {
                vmcb01->control.pause_filter_count = vmcb02->control.pause_filter_count;
+               vmcb_mark_dirty(vmcb01, VMCB_INTERCEPTS);
+
+       }
 
        nested_svm_copy_common_state(svm->nested.vmcb02.ptr, svm->vmcb01.ptr);
 
@@ -982,7 +985,7 @@ int nested_svm_vmexit(struct vcpu_svm *svm)
        if (svm->tsc_ratio_msr != kvm_default_tsc_scaling_ratio) {
                WARN_ON(!svm->tsc_scaling_enabled);
                vcpu->arch.tsc_scaling_ratio = vcpu->arch.l1_tsc_scaling_ratio;
-               svm_write_tsc_multiplier(vcpu, vcpu->arch.tsc_scaling_ratio);
+               __svm_write_tsc_multiplier(vcpu->arch.tsc_scaling_ratio);
        }
 
        svm->nested.ctl.nested_cr3 = 0;
@@ -1387,7 +1390,7 @@ void nested_svm_update_tsc_ratio_msr(struct kvm_vcpu *vcpu)
        vcpu->arch.tsc_scaling_ratio =
                kvm_calc_nested_tsc_multiplier(vcpu->arch.l1_tsc_scaling_ratio,
                                               svm->tsc_ratio_msr);
-       svm_write_tsc_multiplier(vcpu, vcpu->arch.tsc_scaling_ratio);
+       __svm_write_tsc_multiplier(vcpu->arch.tsc_scaling_ratio);
 }
 
 /* Inverse operation of nested_copy_vmcb_control_to_cache(). asid is copied too. */
index 51fd985..0c240ed 100644 (file)
@@ -844,7 +844,7 @@ static int __sev_dbg_encrypt_user(struct kvm *kvm, unsigned long paddr,
 
        /* If source buffer is not aligned then use an intermediate buffer */
        if (!IS_ALIGNED((unsigned long)vaddr, 16)) {
-               src_tpage = alloc_page(GFP_KERNEL);
+               src_tpage = alloc_page(GFP_KERNEL_ACCOUNT);
                if (!src_tpage)
                        return -ENOMEM;
 
@@ -865,7 +865,7 @@ static int __sev_dbg_encrypt_user(struct kvm *kvm, unsigned long paddr,
        if (!IS_ALIGNED((unsigned long)dst_vaddr, 16) || !IS_ALIGNED(size, 16)) {
                int dst_offset;
 
-               dst_tpage = alloc_page(GFP_KERNEL);
+               dst_tpage = alloc_page(GFP_KERNEL_ACCOUNT);
                if (!dst_tpage) {
                        ret = -ENOMEM;
                        goto e_free;
@@ -1665,19 +1665,24 @@ static void sev_migrate_from(struct kvm *dst_kvm, struct kvm *src_kvm)
 {
        struct kvm_sev_info *dst = &to_kvm_svm(dst_kvm)->sev_info;
        struct kvm_sev_info *src = &to_kvm_svm(src_kvm)->sev_info;
+       struct kvm_vcpu *dst_vcpu, *src_vcpu;
+       struct vcpu_svm *dst_svm, *src_svm;
        struct kvm_sev_info *mirror;
+       unsigned long i;
 
        dst->active = true;
        dst->asid = src->asid;
        dst->handle = src->handle;
        dst->pages_locked = src->pages_locked;
        dst->enc_context_owner = src->enc_context_owner;
+       dst->es_active = src->es_active;
 
        src->asid = 0;
        src->active = false;
        src->handle = 0;
        src->pages_locked = 0;
        src->enc_context_owner = NULL;
+       src->es_active = false;
 
        list_cut_before(&dst->regions_list, &src->regions_list, &src->regions_list);
 
@@ -1704,26 +1709,21 @@ static void sev_migrate_from(struct kvm *dst_kvm, struct kvm *src_kvm)
                list_del(&src->mirror_entry);
                list_add_tail(&dst->mirror_entry, &owner_sev_info->mirror_vms);
        }
-}
 
-static int sev_es_migrate_from(struct kvm *dst, struct kvm *src)
-{
-       unsigned long i;
-       struct kvm_vcpu *dst_vcpu, *src_vcpu;
-       struct vcpu_svm *dst_svm, *src_svm;
+       kvm_for_each_vcpu(i, dst_vcpu, dst_kvm) {
+               dst_svm = to_svm(dst_vcpu);
 
-       if (atomic_read(&src->online_vcpus) != atomic_read(&dst->online_vcpus))
-               return -EINVAL;
+               sev_init_vmcb(dst_svm);
 
-       kvm_for_each_vcpu(i, src_vcpu, src) {
-               if (!src_vcpu->arch.guest_state_protected)
-                       return -EINVAL;
-       }
+               if (!dst->es_active)
+                       continue;
 
-       kvm_for_each_vcpu(i, src_vcpu, src) {
+               /*
+                * Note, the source is not required to have the same number of
+                * vCPUs as the destination when migrating a vanilla SEV VM.
+                */
+               src_vcpu = kvm_get_vcpu(dst_kvm, i);
                src_svm = to_svm(src_vcpu);
-               dst_vcpu = kvm_get_vcpu(dst, i);
-               dst_svm = to_svm(dst_vcpu);
 
                /*
                 * Transfer VMSA and GHCB state to the destination.  Nullify and
@@ -1740,8 +1740,23 @@ static int sev_es_migrate_from(struct kvm *dst, struct kvm *src)
                src_svm->vmcb->control.vmsa_pa = INVALID_PAGE;
                src_vcpu->arch.guest_state_protected = false;
        }
-       to_kvm_svm(src)->sev_info.es_active = false;
-       to_kvm_svm(dst)->sev_info.es_active = true;
+}
+
+static int sev_check_source_vcpus(struct kvm *dst, struct kvm *src)
+{
+       struct kvm_vcpu *src_vcpu;
+       unsigned long i;
+
+       if (!sev_es_guest(src))
+               return 0;
+
+       if (atomic_read(&src->online_vcpus) != atomic_read(&dst->online_vcpus))
+               return -EINVAL;
+
+       kvm_for_each_vcpu(i, src_vcpu, src) {
+               if (!src_vcpu->arch.guest_state_protected)
+                       return -EINVAL;
+       }
 
        return 0;
 }
@@ -1789,11 +1804,9 @@ int sev_vm_move_enc_context_from(struct kvm *kvm, unsigned int source_fd)
        if (ret)
                goto out_dst_vcpu;
 
-       if (sev_es_guest(source_kvm)) {
-               ret = sev_es_migrate_from(kvm, source_kvm);
-               if (ret)
-                       goto out_source_vcpu;
-       }
+       ret = sev_check_source_vcpus(kvm, source_kvm);
+       if (ret)
+               goto out_source_vcpu;
 
        sev_migrate_from(kvm, source_kvm);
        kvm_vm_dead(source_kvm);
@@ -2914,7 +2927,7 @@ int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in)
                                    count, in);
 }
 
-void sev_es_init_vmcb(struct vcpu_svm *svm)
+static void sev_es_init_vmcb(struct vcpu_svm *svm)
 {
        struct kvm_vcpu *vcpu = &svm->vcpu;
 
@@ -2967,6 +2980,15 @@ void sev_es_init_vmcb(struct vcpu_svm *svm)
        }
 }
 
+void sev_init_vmcb(struct vcpu_svm *svm)
+{
+       svm->vmcb->control.nested_ctl |= SVM_NESTED_CTL_SEV_ENABLE;
+       clr_exception_intercept(svm, UD_VECTOR);
+
+       if (sev_es_guest(svm->vcpu.kvm))
+               sev_es_init_vmcb(svm);
+}
+
 void sev_es_vcpu_reset(struct vcpu_svm *svm)
 {
        /*
index 200045f..44bbf25 100644 (file)
@@ -465,11 +465,24 @@ static int has_svm(void)
        return 1;
 }
 
+void __svm_write_tsc_multiplier(u64 multiplier)
+{
+       preempt_disable();
+
+       if (multiplier == __this_cpu_read(current_tsc_ratio))
+               goto out;
+
+       wrmsrl(MSR_AMD64_TSC_RATIO, multiplier);
+       __this_cpu_write(current_tsc_ratio, multiplier);
+out:
+       preempt_enable();
+}
+
 static void svm_hardware_disable(void)
 {
        /* Make sure we clean up behind us */
        if (tsc_scaling)
-               wrmsrl(MSR_AMD64_TSC_RATIO, SVM_TSC_RATIO_DEFAULT);
+               __svm_write_tsc_multiplier(SVM_TSC_RATIO_DEFAULT);
 
        cpu_svm_disable();
 
@@ -515,8 +528,7 @@ static int svm_hardware_enable(void)
                 * Set the default value, even if we don't use TSC scaling
                 * to avoid having stale value in the msr
                 */
-               wrmsrl(MSR_AMD64_TSC_RATIO, SVM_TSC_RATIO_DEFAULT);
-               __this_cpu_write(current_tsc_ratio, SVM_TSC_RATIO_DEFAULT);
+               __svm_write_tsc_multiplier(SVM_TSC_RATIO_DEFAULT);
        }
 
 
@@ -909,7 +921,7 @@ static void grow_ple_window(struct kvm_vcpu *vcpu)
        struct vmcb_control_area *control = &svm->vmcb->control;
        int old = control->pause_filter_count;
 
-       if (kvm_pause_in_guest(vcpu->kvm) || !old)
+       if (kvm_pause_in_guest(vcpu->kvm))
                return;
 
        control->pause_filter_count = __grow_ple_window(old,
@@ -930,7 +942,7 @@ static void shrink_ple_window(struct kvm_vcpu *vcpu)
        struct vmcb_control_area *control = &svm->vmcb->control;
        int old = control->pause_filter_count;
 
-       if (kvm_pause_in_guest(vcpu->kvm) || !old)
+       if (kvm_pause_in_guest(vcpu->kvm))
                return;
 
        control->pause_filter_count =
@@ -999,11 +1011,12 @@ static void svm_write_tsc_offset(struct kvm_vcpu *vcpu, u64 offset)
        vmcb_mark_dirty(svm->vmcb, VMCB_INTERCEPTS);
 }
 
-void svm_write_tsc_multiplier(struct kvm_vcpu *vcpu, u64 multiplier)
+static void svm_write_tsc_multiplier(struct kvm_vcpu *vcpu, u64 multiplier)
 {
-       wrmsrl(MSR_AMD64_TSC_RATIO, multiplier);
+       __svm_write_tsc_multiplier(multiplier);
 }
 
+
 /* Evaluate instruction intercepts that depend on guest CPUID features. */
 static void svm_recalc_instruction_intercepts(struct kvm_vcpu *vcpu,
                                              struct vcpu_svm *svm)
@@ -1199,15 +1212,8 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
                svm->vmcb->control.int_ctl |= V_GIF_ENABLE_MASK;
        }
 
-       if (sev_guest(vcpu->kvm)) {
-               svm->vmcb->control.nested_ctl |= SVM_NESTED_CTL_SEV_ENABLE;
-               clr_exception_intercept(svm, UD_VECTOR);
-
-               if (sev_es_guest(vcpu->kvm)) {
-                       /* Perform SEV-ES specific VMCB updates */
-                       sev_es_init_vmcb(svm);
-               }
-       }
+       if (sev_guest(vcpu->kvm))
+               sev_init_vmcb(svm);
 
        svm_hv_init_vmcb(vmcb);
        init_vmcb_after_set_cpuid(vcpu);
@@ -1363,13 +1369,8 @@ static void svm_prepare_switch_to_guest(struct kvm_vcpu *vcpu)
                sev_es_prepare_switch_to_guest(hostsa);
        }
 
-       if (tsc_scaling) {
-               u64 tsc_ratio = vcpu->arch.tsc_scaling_ratio;
-               if (tsc_ratio != __this_cpu_read(current_tsc_ratio)) {
-                       __this_cpu_write(current_tsc_ratio, tsc_ratio);
-                       wrmsrl(MSR_AMD64_TSC_RATIO, tsc_ratio);
-               }
-       }
+       if (tsc_scaling)
+               __svm_write_tsc_multiplier(vcpu->arch.tsc_scaling_ratio);
 
        if (likely(tsc_aux_uret_slot >= 0))
                kvm_set_user_return_msr(tsc_aux_uret_slot, svm->tsc_aux, -1ull);
@@ -1392,13 +1393,13 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
                indirect_branch_prediction_barrier();
        }
        if (kvm_vcpu_apicv_active(vcpu))
-               __avic_vcpu_load(vcpu, cpu);
+               avic_vcpu_load(vcpu, cpu);
 }
 
 static void svm_vcpu_put(struct kvm_vcpu *vcpu)
 {
        if (kvm_vcpu_apicv_active(vcpu))
-               __avic_vcpu_put(vcpu);
+               avic_vcpu_put(vcpu);
 
        svm_prepare_host_switch(vcpu);
 
@@ -4255,6 +4256,8 @@ out:
 
 static void svm_handle_exit_irqoff(struct kvm_vcpu *vcpu)
 {
+       if (to_svm(vcpu)->vmcb->control.exit_code == SVM_EXIT_INTR)
+               vcpu->arch.at_instruction_boundary = true;
 }
 
 static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
index 21c5460..9223ac1 100644 (file)
@@ -590,7 +590,7 @@ int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
                               bool has_error_code, u32 error_code);
 int nested_svm_exit_special(struct vcpu_svm *svm);
 void nested_svm_update_tsc_ratio_msr(struct kvm_vcpu *vcpu);
-void svm_write_tsc_multiplier(struct kvm_vcpu *vcpu, u64 multiplier);
+void __svm_write_tsc_multiplier(u64 multiplier);
 void nested_copy_vmcb_control_to_cache(struct vcpu_svm *svm,
                                       struct vmcb_control_area *control);
 void nested_copy_vmcb_save_to_cache(struct vcpu_svm *svm,
@@ -610,8 +610,8 @@ void avic_init_vmcb(struct vcpu_svm *svm, struct vmcb *vmcb);
 int avic_incomplete_ipi_interception(struct kvm_vcpu *vcpu);
 int avic_unaccelerated_access_interception(struct kvm_vcpu *vcpu);
 int avic_init_vcpu(struct vcpu_svm *svm);
-void __avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
-void __avic_vcpu_put(struct kvm_vcpu *vcpu);
+void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
+void avic_vcpu_put(struct kvm_vcpu *vcpu);
 void avic_apicv_post_state_restore(struct kvm_vcpu *vcpu);
 void avic_set_virtual_apic_mode(struct kvm_vcpu *vcpu);
 void avic_refresh_apicv_exec_ctrl(struct kvm_vcpu *vcpu);
@@ -649,10 +649,10 @@ void __init sev_set_cpu_caps(void);
 void __init sev_hardware_setup(void);
 void sev_hardware_unsetup(void);
 int sev_cpu_init(struct svm_cpu_data *sd);
+void sev_init_vmcb(struct vcpu_svm *svm);
 void sev_free_vcpu(struct kvm_vcpu *vcpu);
 int sev_handle_vmgexit(struct kvm_vcpu *vcpu);
 int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in);
-void sev_es_init_vmcb(struct vcpu_svm *svm);
 void sev_es_vcpu_reset(struct vcpu_svm *svm);
 void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector);
 void sev_es_prepare_switch_to_guest(struct sev_es_save_area *hostsa);
index a07e8cd..3a919e4 100644 (file)
@@ -229,6 +229,9 @@ static const struct {
 #define L1D_CACHE_ORDER 4
 static void *vmx_l1d_flush_pages;
 
+/* Control for disabling CPU Fill buffer clear */
+static bool __read_mostly vmx_fb_clear_ctrl_available;
+
 static int vmx_setup_l1d_flush(enum vmx_l1d_flush_state l1tf)
 {
        struct page *page;
@@ -360,6 +363,60 @@ static int vmentry_l1d_flush_get(char *s, const struct kernel_param *kp)
        return sprintf(s, "%s\n", vmentry_l1d_param[l1tf_vmx_mitigation].option);
 }
 
+static void vmx_setup_fb_clear_ctrl(void)
+{
+       u64 msr;
+
+       if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES) &&
+           !boot_cpu_has_bug(X86_BUG_MDS) &&
+           !boot_cpu_has_bug(X86_BUG_TAA)) {
+               rdmsrl(MSR_IA32_ARCH_CAPABILITIES, msr);
+               if (msr & ARCH_CAP_FB_CLEAR_CTRL)
+                       vmx_fb_clear_ctrl_available = true;
+       }
+}
+
+static __always_inline void vmx_disable_fb_clear(struct vcpu_vmx *vmx)
+{
+       u64 msr;
+
+       if (!vmx->disable_fb_clear)
+               return;
+
+       rdmsrl(MSR_IA32_MCU_OPT_CTRL, msr);
+       msr |= FB_CLEAR_DIS;
+       wrmsrl(MSR_IA32_MCU_OPT_CTRL, msr);
+       /* Cache the MSR value to avoid reading it later */
+       vmx->msr_ia32_mcu_opt_ctrl = msr;
+}
+
+static __always_inline void vmx_enable_fb_clear(struct vcpu_vmx *vmx)
+{
+       if (!vmx->disable_fb_clear)
+               return;
+
+       vmx->msr_ia32_mcu_opt_ctrl &= ~FB_CLEAR_DIS;
+       wrmsrl(MSR_IA32_MCU_OPT_CTRL, vmx->msr_ia32_mcu_opt_ctrl);
+}
+
+static void vmx_update_fb_clear_dis(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx)
+{
+       vmx->disable_fb_clear = vmx_fb_clear_ctrl_available;
+
+       /*
+        * If guest will not execute VERW, there is no need to set FB_CLEAR_DIS
+        * at VMEntry. Skip the MSR read/write when a guest has no use case to
+        * execute VERW.
+        */
+       if ((vcpu->arch.arch_capabilities & ARCH_CAP_FB_CLEAR) ||
+          ((vcpu->arch.arch_capabilities & ARCH_CAP_MDS_NO) &&
+           (vcpu->arch.arch_capabilities & ARCH_CAP_TAA_NO) &&
+           (vcpu->arch.arch_capabilities & ARCH_CAP_PSDP_NO) &&
+           (vcpu->arch.arch_capabilities & ARCH_CAP_FBSDP_NO) &&
+           (vcpu->arch.arch_capabilities & ARCH_CAP_SBDR_SSDP_NO)))
+               vmx->disable_fb_clear = false;
+}
+
 static const struct kernel_param_ops vmentry_l1d_flush_ops = {
        .set = vmentry_l1d_flush_set,
        .get = vmentry_l1d_flush_get,
@@ -2252,6 +2309,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
                        ret = kvm_set_msr_common(vcpu, msr_info);
        }
 
+       /* FB_CLEAR may have changed, also update the FB_CLEAR_DIS behavior */
+       if (msr_index == MSR_IA32_ARCH_CAPABILITIES)
+               vmx_update_fb_clear_dis(vcpu, vmx);
+
        return ret;
 }
 
@@ -4553,6 +4614,8 @@ static void vmx_vcpu_reset(struct kvm_vcpu *vcpu, bool init_event)
        kvm_make_request(KVM_REQ_APIC_PAGE_RELOAD, vcpu);
 
        vpid_sync_context(vmx->vpid);
+
+       vmx_update_fb_clear_dis(vcpu, vmx);
 }
 
 static void vmx_enable_irq_window(struct kvm_vcpu *vcpu)
@@ -6547,6 +6610,7 @@ static void handle_external_interrupt_irqoff(struct kvm_vcpu *vcpu)
                return;
 
        handle_interrupt_nmi_irqoff(vcpu, gate_offset(desc));
+       vcpu->arch.at_instruction_boundary = true;
 }
 
 static void vmx_handle_exit_irqoff(struct kvm_vcpu *vcpu)
@@ -6771,6 +6835,11 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
                vmx_l1d_flush(vcpu);
        else if (static_branch_unlikely(&mds_user_clear))
                mds_clear_cpu_buffers();
+       else if (static_branch_unlikely(&mmio_stale_data_clear) &&
+                kvm_arch_has_assigned_device(vcpu->kvm))
+               mds_clear_cpu_buffers();
+
+       vmx_disable_fb_clear(vmx);
 
        if (vcpu->arch.cr2 != native_read_cr2())
                native_write_cr2(vcpu->arch.cr2);
@@ -6780,6 +6849,8 @@ static noinstr void vmx_vcpu_enter_exit(struct kvm_vcpu *vcpu,
 
        vcpu->arch.cr2 = native_read_cr2();
 
+       vmx_enable_fb_clear(vmx);
+
        guest_state_exit_irqoff();
 }
 
@@ -7708,7 +7779,9 @@ static bool vmx_check_apicv_inhibit_reasons(enum kvm_apicv_inhibit reason)
        ulong supported = BIT(APICV_INHIBIT_REASON_DISABLE) |
                          BIT(APICV_INHIBIT_REASON_ABSENT) |
                          BIT(APICV_INHIBIT_REASON_HYPERV) |
-                         BIT(APICV_INHIBIT_REASON_BLOCKIRQ);
+                         BIT(APICV_INHIBIT_REASON_BLOCKIRQ) |
+                         BIT(APICV_INHIBIT_REASON_APIC_ID_MODIFIED) |
+                         BIT(APICV_INHIBIT_REASON_APIC_BASE_MODIFIED);
 
        return supported & BIT(reason);
 }
@@ -8211,6 +8284,8 @@ static int __init vmx_init(void)
                return r;
        }
 
+       vmx_setup_fb_clear_ctrl();
+
        for_each_possible_cpu(cpu) {
                INIT_LIST_HEAD(&per_cpu(loaded_vmcss_on_cpu, cpu));
 
index b98c7e9..8d2342e 100644 (file)
@@ -348,6 +348,8 @@ struct vcpu_vmx {
        u64 msr_ia32_feature_control_valid_bits;
        /* SGX Launch Control public key hash */
        u64 msr_ia32_sgxlepubkeyhash[4];
+       u64 msr_ia32_mcu_opt_ctrl;
+       bool disable_fb_clear;
 
        struct pt_desc pt_desc;
        struct lbr_desc lbr_desc;
index e9473c7..1910e1e 100644 (file)
@@ -296,6 +296,8 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
        STATS_DESC_COUNTER(VCPU, nested_run),
        STATS_DESC_COUNTER(VCPU, directed_yield_attempted),
        STATS_DESC_COUNTER(VCPU, directed_yield_successful),
+       STATS_DESC_COUNTER(VCPU, preemption_reported),
+       STATS_DESC_COUNTER(VCPU, preemption_other),
        STATS_DESC_ICOUNTER(VCPU, guest_mode)
 };
 
@@ -1615,6 +1617,9 @@ static u64 kvm_get_arch_capabilities(void)
                 */
        }
 
+       /* Guests don't need to know "Fill buffer clear control" exists */
+       data &= ~ARCH_CAP_FB_CLEAR_CTRL;
+
        return data;
 }
 
@@ -4625,6 +4630,19 @@ static void kvm_steal_time_set_preempted(struct kvm_vcpu *vcpu)
        struct kvm_memslots *slots;
        static const u8 preempted = KVM_VCPU_PREEMPTED;
 
+       /*
+        * The vCPU can be marked preempted if and only if the VM-Exit was on
+        * an instruction boundary and will not trigger guest emulation of any
+        * kind (see vcpu_run).  Vendor specific code controls (conservatively)
+        * when this is true, for example allowing the vCPU to be marked
+        * preempted if and only if the VM-Exit was due to a host interrupt.
+        */
+       if (!vcpu->arch.at_instruction_boundary) {
+               vcpu->stat.preemption_other++;
+               return;
+       }
+
+       vcpu->stat.preemption_reported++;
        if (!(vcpu->arch.st.msr_val & KVM_MSR_ENABLED))
                return;
 
@@ -4654,19 +4672,21 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
 {
        int idx;
 
-       if (vcpu->preempted && !vcpu->arch.guest_state_protected)
-               vcpu->arch.preempted_in_kernel = !static_call(kvm_x86_get_cpl)(vcpu);
+       if (vcpu->preempted) {
+               if (!vcpu->arch.guest_state_protected)
+                       vcpu->arch.preempted_in_kernel = !static_call(kvm_x86_get_cpl)(vcpu);
 
-       /*
-        * Take the srcu lock as memslots will be accessed to check the gfn
-        * cache generation against the memslots generation.
-        */
-       idx = srcu_read_lock(&vcpu->kvm->srcu);
-       if (kvm_xen_msr_enabled(vcpu->kvm))
-               kvm_xen_runstate_set_preempted(vcpu);
-       else
-               kvm_steal_time_set_preempted(vcpu);
-       srcu_read_unlock(&vcpu->kvm->srcu, idx);
+               /*
+                * Take the srcu lock as memslots will be accessed to check the gfn
+                * cache generation against the memslots generation.
+                */
+               idx = srcu_read_lock(&vcpu->kvm->srcu);
+               if (kvm_xen_msr_enabled(vcpu->kvm))
+                       kvm_xen_runstate_set_preempted(vcpu);
+               else
+                       kvm_steal_time_set_preempted(vcpu);
+               srcu_read_unlock(&vcpu->kvm->srcu, idx);
+       }
 
        static_call(kvm_x86_vcpu_put)(vcpu);
        vcpu->arch.last_host_tsc = rdtsc();
@@ -9833,6 +9853,7 @@ void kvm_vcpu_update_apicv(struct kvm_vcpu *vcpu)
                return;
 
        down_read(&vcpu->kvm->arch.apicv_update_lock);
+       preempt_disable();
 
        activate = kvm_vcpu_apicv_activated(vcpu);
 
@@ -9853,6 +9874,7 @@ void kvm_vcpu_update_apicv(struct kvm_vcpu *vcpu)
                kvm_make_request(KVM_REQ_EVENT, vcpu);
 
 out:
+       preempt_enable();
        up_read(&vcpu->kvm->arch.apicv_update_lock);
 }
 EXPORT_SYMBOL_GPL(kvm_vcpu_update_apicv);
@@ -10422,6 +10444,13 @@ static int vcpu_run(struct kvm_vcpu *vcpu)
        vcpu->arch.l1tf_flush_l1d = true;
 
        for (;;) {
+               /*
+                * If another guest vCPU requests a PV TLB flush in the middle
+                * of instruction emulation, the rest of the emulation could
+                * use a stale page translation. Assume that any code after
+                * this point can start executing an instruction.
+                */
+               vcpu->arch.at_instruction_boundary = false;
                if (kvm_vcpu_running(vcpu)) {
                        r = vcpu_enter_guest(vcpu);
                } else {
index ee5c4ae..532a535 100644 (file)
@@ -159,8 +159,10 @@ static inline void kvm_xen_runstate_set_preempted(struct kvm_vcpu *vcpu)
         * behalf of the vCPU. Only if the VMM does actually block
         * does it need to enter RUNSTATE_blocked.
         */
-       if (vcpu->preempted)
-               kvm_xen_update_runstate_guest(vcpu, RUNSTATE_runnable);
+       if (WARN_ON_ONCE(!vcpu->preempted))
+               return;
+
+       kvm_xen_update_runstate_guest(vcpu, RUNSTATE_runnable);
 }
 
 /* 32-bit compatibility definitions, also used natively in 32-bit build */
index 11350e2..9f27e14 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/swiotlb.h>
 #include <linux/cc_platform.h>
 #include <linux/mem_encrypt.h>
-#include <linux/virtio_config.h>
 
 /* Override for DMA direct allocation check - ARCH_HAS_FORCE_DMA_UNENCRYPTED */
 bool force_dma_unencrypted(struct device *dev)
@@ -87,9 +86,3 @@ void __init mem_encrypt_init(void)
 
        print_mem_encrypt_feature_info();
 }
-
-int arch_has_restricted_virtio_memory_access(void)
-{
-       return cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT);
-}
-EXPORT_SYMBOL_GPL(arch_has_restricted_virtio_memory_access);
index e8f7953..f6d038e 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/virtio_config.h>
 #include <linux/cc_platform.h>
+#include <linux/platform-feature.h>
 
 #include <asm/tlbflush.h>
 #include <asm/fixmap.h>
@@ -242,6 +243,9 @@ void __init sev_setup_arch(void)
        size = total_mem * 6 / 100;
        size = clamp_val(size, IO_TLB_DEFAULT_SIZE, SZ_1G);
        swiotlb_adjust_size(size);
+
+       /* Set restricted memory access for virtio. */
+       platform_set(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS);
 }
 
 static unsigned long pg_level_to_pfn(int level, pte_t *kpte, pgprot_t *ret_prot)
index f298b18..c98b8c0 100644 (file)
@@ -1420,8 +1420,9 @@ st:                       if (is_imm8(insn->off))
                case BPF_JMP | BPF_CALL:
                        func = (u8 *) __bpf_call_base + imm32;
                        if (tail_call_reachable) {
+                               /* mov rax, qword ptr [rbp - rounded_stack_depth - 8] */
                                EMIT3_off32(0x48, 0x8B, 0x85,
-                                           -(bpf_prog->aux->stack_depth + 8));
+                                           -round_up(bpf_prog->aux->stack_depth, 8) - 8);
                                if (!imm32 || emit_call(&prog, func, image + addrs[i - 1] + 7))
                                        return -EINVAL;
                        } else {
index a4f4305..2f82480 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/pci-acpi.h>
 #include <asm/numa.h>
 #include <asm/pci_x86.h>
-#include <asm/e820/api.h>
 
 struct pci_root_info {
        struct acpi_pci_root_info common;
@@ -20,7 +19,7 @@ struct pci_root_info {
 #endif
 };
 
-static bool pci_use_e820 = true;
+bool pci_use_e820 = true;
 static bool pci_use_crs = true;
 static bool pci_ignore_seg;
 
@@ -387,11 +386,6 @@ static int pci_acpi_root_prepare_resources(struct acpi_pci_root_info *ci)
 
        status = acpi_pci_probe_root_resources(ci);
 
-       if (pci_use_e820) {
-               resource_list_for_each_entry(entry, &ci->resources)
-                       remove_e820_regions(&device->dev, entry->res);
-       }
-
        if (pci_use_crs) {
                resource_list_for_each_entry_safe(entry, tmp, &ci->resources)
                        if (resource_is_pcicfg_ioport(entry->res))
index 517a9d8..8b71b1d 100644 (file)
@@ -195,6 +195,8 @@ static void __init xen_hvm_guest_init(void)
        if (xen_pv_domain())
                return;
 
+       xen_set_restricted_virtio_memory_access();
+
        init_hvm_pv_info();
 
        reserve_shared_info();
index f33a442..e3297b1 100644 (file)
@@ -109,6 +109,8 @@ static DEFINE_PER_CPU(struct tls_descs, shadow_tls_desc);
 
 static void __init xen_pv_init_platform(void)
 {
+       xen_set_restricted_virtio_memory_access();
+
        populate_extra_pte(fix_to_virt(FIX_PARAVIRT_BOOTMAP));
 
        set_fixmap(FIX_PARAVIRT_BOOTMAP, xen_start_info->shared_info);
index e3eae64..ab30bcb 100644 (file)
@@ -2173,7 +2173,7 @@ ENDPROC(ret_from_kernel_thread)
 
 #ifdef CONFIG_HIBERNATION
 
-       .bss
+       .section        .bss, "aw"
        .align  4
 .Lsaved_regs:
 #if defined(__XTENSA_WINDOWED_ABI__)
index e8ceb15..16b8a62 100644 (file)
@@ -154,6 +154,7 @@ static void __init calibrate_ccount(void)
        cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
        if (cpu) {
                clk = of_clk_get(cpu, 0);
+               of_node_put(cpu);
                if (!IS_ERR(clk)) {
                        ccount_freq = clk_get_rate(clk);
                        return;
index 538e674..c79c1d0 100644 (file)
@@ -133,6 +133,7 @@ static int __init machine_setup(void)
 
        if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
                update_local_mac(eth);
+       of_node_put(eth);
        return 0;
 }
 arch_initcall(machine_setup);
index 0d46cb7..e6d7e6b 100644 (file)
@@ -7046,6 +7046,7 @@ static void bfq_exit_queue(struct elevator_queue *e)
        spin_unlock_irq(&bfqd->lock);
 #endif
 
+       blk_stat_disable_accounting(bfqd->queue);
        wbt_enable_default(bfqd->queue);
 
        kfree(bfqd);
@@ -7188,7 +7189,12 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e)
        bfq_init_root_group(bfqd->root_group, bfqd);
        bfq_init_entity(&bfqd->oom_bfqq.entity, bfqd->root_group);
 
+       /* We dispatch from request queue wide instead of hw queue */
+       blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
+
        wbt_disable_default(q);
+       blk_stat_enable_accounting(q);
+
        return 0;
 
 out_free:
index f92d022..51c99f2 100644 (file)
@@ -1747,26 +1747,6 @@ bad:
 }
 EXPORT_SYMBOL(bioset_init);
 
-/*
- * Initialize and setup a new bio_set, based on the settings from
- * another bio_set.
- */
-int bioset_init_from_src(struct bio_set *bs, struct bio_set *src)
-{
-       int flags;
-
-       flags = 0;
-       if (src->bvec_pool.min_nr)
-               flags |= BIOSET_NEED_BVECS;
-       if (src->rescue_workqueue)
-               flags |= BIOSET_NEED_RESCUER;
-       if (src->cache)
-               flags |= BIOSET_PERCPU_CACHE;
-
-       return bioset_init(bs, src->bio_pool.min_nr, src->front_pad, flags);
-}
-EXPORT_SYMBOL(bioset_init_from_src);
-
 static int __init init_bio(void)
 {
        int i;
index 06ff5bb..27fb135 100644 (file)
@@ -322,19 +322,6 @@ void blk_cleanup_queue(struct request_queue *q)
                blk_mq_exit_queue(q);
        }
 
-       /*
-        * In theory, request pool of sched_tags belongs to request queue.
-        * However, the current implementation requires tag_set for freeing
-        * requests, so free the pool now.
-        *
-        * Queue has become frozen, there can't be any in-queue requests, so
-        * it is safe to free requests now.
-        */
-       mutex_lock(&q->sysfs_lock);
-       if (q->elevator)
-               blk_mq_sched_free_rqs(q);
-       mutex_unlock(&q->sysfs_lock);
-
        /* @q is and will stay empty, shutdown and put */
        blk_put_queue(q);
 }
index 56ed48d..47c89e6 100644 (file)
@@ -144,7 +144,6 @@ int disk_register_independent_access_ranges(struct gendisk *disk,
        }
 
        for (i = 0; i < iars->nr_ia_ranges; i++) {
-               iars->ia_range[i].queue = q;
                ret = kobject_init_and_add(&iars->ia_range[i].kobj,
                                           &blk_ia_range_ktype, &iars->kobj,
                                           "%d", i);
index 7e4136a..4d1ce9e 100644 (file)
@@ -711,11 +711,6 @@ void blk_mq_debugfs_register(struct request_queue *q)
        }
 }
 
-void blk_mq_debugfs_unregister(struct request_queue *q)
-{
-       q->sched_debugfs_dir = NULL;
-}
-
 static void blk_mq_debugfs_register_ctx(struct blk_mq_hw_ctx *hctx,
                                        struct blk_mq_ctx *ctx)
 {
@@ -746,6 +741,8 @@ void blk_mq_debugfs_register_hctx(struct request_queue *q,
 
 void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
 {
+       if (!hctx->queue->debugfs_dir)
+               return;
        debugfs_remove_recursive(hctx->debugfs_dir);
        hctx->sched_debugfs_dir = NULL;
        hctx->debugfs_dir = NULL;
@@ -773,6 +770,8 @@ void blk_mq_debugfs_register_sched(struct request_queue *q)
 {
        struct elevator_type *e = q->elevator->type;
 
+       lockdep_assert_held(&q->debugfs_mutex);
+
        /*
         * If the parent directory has not been created yet, return, we will be
         * called again later on and the directory/files will be created then.
@@ -790,6 +789,8 @@ void blk_mq_debugfs_register_sched(struct request_queue *q)
 
 void blk_mq_debugfs_unregister_sched(struct request_queue *q)
 {
+       lockdep_assert_held(&q->debugfs_mutex);
+
        debugfs_remove_recursive(q->sched_debugfs_dir);
        q->sched_debugfs_dir = NULL;
 }
@@ -811,6 +812,10 @@ static const char *rq_qos_id_to_name(enum rq_qos_id id)
 
 void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
 {
+       lockdep_assert_held(&rqos->q->debugfs_mutex);
+
+       if (!rqos->q->debugfs_dir)
+               return;
        debugfs_remove_recursive(rqos->debugfs_dir);
        rqos->debugfs_dir = NULL;
 }
@@ -820,6 +825,8 @@ void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
        struct request_queue *q = rqos->q;
        const char *dir_name = rq_qos_id_to_name(rqos->id);
 
+       lockdep_assert_held(&q->debugfs_mutex);
+
        if (rqos->debugfs_dir || !rqos->ops->debugfs_attrs)
                return;
 
@@ -833,17 +840,13 @@ void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
        debugfs_create_files(rqos->debugfs_dir, rqos, rqos->ops->debugfs_attrs);
 }
 
-void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q)
-{
-       debugfs_remove_recursive(q->rqos_debugfs_dir);
-       q->rqos_debugfs_dir = NULL;
-}
-
 void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
                                        struct blk_mq_hw_ctx *hctx)
 {
        struct elevator_type *e = q->elevator->type;
 
+       lockdep_assert_held(&q->debugfs_mutex);
+
        /*
         * If the parent debugfs directory has not been created yet, return;
         * We will be called again later on with appropriate parent debugfs
@@ -863,6 +866,10 @@ void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
 
 void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
 {
+       lockdep_assert_held(&hctx->queue->debugfs_mutex);
+
+       if (!hctx->queue->debugfs_dir)
+               return;
        debugfs_remove_recursive(hctx->sched_debugfs_dir);
        hctx->sched_debugfs_dir = NULL;
 }
index 69918f4..9c7d4b6 100644 (file)
@@ -21,7 +21,6 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
 int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
 
 void blk_mq_debugfs_register(struct request_queue *q);
-void blk_mq_debugfs_unregister(struct request_queue *q);
 void blk_mq_debugfs_register_hctx(struct request_queue *q,
                                  struct blk_mq_hw_ctx *hctx);
 void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
@@ -36,16 +35,11 @@ void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
 
 void blk_mq_debugfs_register_rqos(struct rq_qos *rqos);
 void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos);
-void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q);
 #else
 static inline void blk_mq_debugfs_register(struct request_queue *q)
 {
 }
 
-static inline void blk_mq_debugfs_unregister(struct request_queue *q)
-{
-}
-
 static inline void blk_mq_debugfs_register_hctx(struct request_queue *q,
                                                struct blk_mq_hw_ctx *hctx)
 {
@@ -87,10 +81,6 @@ static inline void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
 static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
 {
 }
-
-static inline void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q)
-{
-}
 #endif
 
 #ifdef CONFIG_BLK_DEBUG_FS_ZONED
index 9e56a69..a4f7c10 100644 (file)
@@ -564,6 +564,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e)
        int ret;
 
        if (!e) {
+               blk_queue_flag_clear(QUEUE_FLAG_SQ_SCHED, q);
                q->elevator = NULL;
                q->nr_requests = q->tag_set->queue_depth;
                return 0;
@@ -593,7 +594,9 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e)
        if (ret)
                goto err_free_map_and_rqs;
 
+       mutex_lock(&q->debugfs_mutex);
        blk_mq_debugfs_register_sched(q);
+       mutex_unlock(&q->debugfs_mutex);
 
        queue_for_each_hw_ctx(q, hctx, i) {
                if (e->ops.init_hctx) {
@@ -606,7 +609,9 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e)
                                return ret;
                        }
                }
+               mutex_lock(&q->debugfs_mutex);
                blk_mq_debugfs_register_sched_hctx(q, hctx);
+               mutex_unlock(&q->debugfs_mutex);
        }
 
        return 0;
@@ -647,14 +652,21 @@ void blk_mq_exit_sched(struct request_queue *q, struct elevator_queue *e)
        unsigned int flags = 0;
 
        queue_for_each_hw_ctx(q, hctx, i) {
+               mutex_lock(&q->debugfs_mutex);
                blk_mq_debugfs_unregister_sched_hctx(hctx);
+               mutex_unlock(&q->debugfs_mutex);
+
                if (e->type->ops.exit_hctx && hctx->sched_data) {
                        e->type->ops.exit_hctx(hctx, i);
                        hctx->sched_data = NULL;
                }
                flags = hctx->flags;
        }
+
+       mutex_lock(&q->debugfs_mutex);
        blk_mq_debugfs_unregister_sched(q);
+       mutex_unlock(&q->debugfs_mutex);
+
        if (e->type->ops.exit_sched)
                e->type->ops.exit_sched(e);
        blk_mq_sched_tags_teardown(q, flags);
index e9bf950..93d9d60 100644 (file)
@@ -579,6 +579,8 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q,
        if (!blk_mq_hw_queue_mapped(data.hctx))
                goto out_queue_exit;
        cpu = cpumask_first_and(data.hctx->cpumask, cpu_online_mask);
+       if (cpu >= nr_cpu_ids)
+               goto out_queue_exit;
        data.ctx = __blk_mq_get_ctx(q, cpu);
 
        if (!q->elevator)
@@ -2140,20 +2142,6 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
 }
 EXPORT_SYMBOL(blk_mq_run_hw_queue);
 
-/*
- * Is the request queue handled by an IO scheduler that does not respect
- * hardware queues when dispatching?
- */
-static bool blk_mq_has_sqsched(struct request_queue *q)
-{
-       struct elevator_queue *e = q->elevator;
-
-       if (e && e->type->ops.dispatch_request &&
-           !(e->type->elevator_features & ELEVATOR_F_MQ_AWARE))
-               return true;
-       return false;
-}
-
 /*
  * Return prefered queue to dispatch from (if any) for non-mq aware IO
  * scheduler.
@@ -2186,7 +2174,7 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async)
        unsigned long i;
 
        sq_hctx = NULL;
-       if (blk_mq_has_sqsched(q))
+       if (blk_queue_sq_sched(q))
                sq_hctx = blk_mq_get_sq_hctx(q);
        queue_for_each_hw_ctx(q, hctx, i) {
                if (blk_mq_hctx_stopped(hctx))
@@ -2214,7 +2202,7 @@ void blk_mq_delay_run_hw_queues(struct request_queue *q, unsigned long msecs)
        unsigned long i;
 
        sq_hctx = NULL;
-       if (blk_mq_has_sqsched(q))
+       if (blk_queue_sq_sched(q))
                sq_hctx = blk_mq_get_sq_hctx(q);
        queue_for_each_hw_ctx(q, hctx, i) {
                if (blk_mq_hctx_stopped(hctx))
@@ -2777,15 +2765,20 @@ static inline struct request *blk_mq_get_cached_request(struct request_queue *q,
                return NULL;
        }
 
-       rq_qos_throttle(q, *bio);
-
        if (blk_mq_get_hctx_type((*bio)->bi_opf) != rq->mq_hctx->type)
                return NULL;
        if (op_is_flush(rq->cmd_flags) != op_is_flush((*bio)->bi_opf))
                return NULL;
 
-       rq->cmd_flags = (*bio)->bi_opf;
+       /*
+        * If any qos ->throttle() end up blocking, we will have flushed the
+        * plug and hence killed the cached_rq list as well. Pop this entry
+        * before we throttle.
+        */
        plug->cached_rq = rq_list_next(rq);
+       rq_qos_throttle(q, *bio);
+
+       rq->cmd_flags = (*bio)->bi_opf;
        INIT_LIST_HEAD(&rq->queuelist);
        return rq;
 }
@@ -3443,8 +3436,9 @@ static void blk_mq_exit_hctx(struct request_queue *q,
        if (blk_mq_hw_queue_mapped(hctx))
                blk_mq_tag_idle(hctx);
 
-       blk_mq_clear_flush_rq_mapping(set->tags[hctx_idx],
-                       set->queue_depth, flush_rq);
+       if (blk_queue_init_done(q))
+               blk_mq_clear_flush_rq_mapping(set->tags[hctx_idx],
+                               set->queue_depth, flush_rq);
        if (set->ops->exit_request)
                set->ops->exit_request(set, flush_rq, hctx_idx);
 
@@ -4438,12 +4432,14 @@ static bool blk_mq_elv_switch_none(struct list_head *head,
        if (!qe)
                return false;
 
+       /* q->elevator needs protection from ->sysfs_lock */
+       mutex_lock(&q->sysfs_lock);
+
        INIT_LIST_HEAD(&qe->node);
        qe->q = q;
        qe->type = q->elevator->type;
        list_add(&qe->node, head);
 
-       mutex_lock(&q->sysfs_lock);
        /*
         * After elevator_switch_mq, the previous elevator_queue will be
         * released by elevator_release. The reference of the io scheduler
index e83af7b..d3a7569 100644 (file)
@@ -294,8 +294,6 @@ void rq_qos_wait(struct rq_wait *rqw, void *private_data,
 
 void rq_qos_exit(struct request_queue *q)
 {
-       blk_mq_debugfs_unregister_queue_rqos(q);
-
        while (q->rq_qos) {
                struct rq_qos *rqos = q->rq_qos;
                q->rq_qos = rqos->next;
index 6826700..0e46052 100644 (file)
@@ -104,8 +104,11 @@ static inline void rq_qos_add(struct request_queue *q, struct rq_qos *rqos)
 
        blk_mq_unfreeze_queue(q);
 
-       if (rqos->ops->debugfs_attrs)
+       if (rqos->ops->debugfs_attrs) {
+               mutex_lock(&q->debugfs_mutex);
                blk_mq_debugfs_register_rqos(rqos);
+               mutex_unlock(&q->debugfs_mutex);
+       }
 }
 
 static inline void rq_qos_del(struct request_queue *q, struct rq_qos *rqos)
@@ -129,7 +132,9 @@ static inline void rq_qos_del(struct request_queue *q, struct rq_qos *rqos)
 
        blk_mq_unfreeze_queue(q);
 
+       mutex_lock(&q->debugfs_mutex);
        blk_mq_debugfs_unregister_rqos(rqos);
+       mutex_unlock(&q->debugfs_mutex);
 }
 
 typedef bool (acquire_inflight_cb_t)(struct rq_wait *rqw, void *private_data);
index 88bd41d..9b905e9 100644 (file)
@@ -779,14 +779,6 @@ static void blk_release_queue(struct kobject *kobj)
        if (queue_is_mq(q))
                blk_mq_release(q);
 
-       blk_trace_shutdown(q);
-       mutex_lock(&q->debugfs_mutex);
-       debugfs_remove_recursive(q->debugfs_dir);
-       mutex_unlock(&q->debugfs_mutex);
-
-       if (queue_is_mq(q))
-               blk_mq_debugfs_unregister(q);
-
        bioset_exit(&q->bio_split);
 
        if (blk_queue_has_srcu(q))
@@ -836,17 +828,16 @@ int blk_register_queue(struct gendisk *disk)
                goto unlock;
        }
 
+       if (queue_is_mq(q))
+               __blk_mq_register_dev(dev, q);
+       mutex_lock(&q->sysfs_lock);
+
        mutex_lock(&q->debugfs_mutex);
        q->debugfs_dir = debugfs_create_dir(kobject_name(q->kobj.parent),
                                            blk_debugfs_root);
-       mutex_unlock(&q->debugfs_mutex);
-
-       if (queue_is_mq(q)) {
-               __blk_mq_register_dev(dev, q);
+       if (queue_is_mq(q))
                blk_mq_debugfs_register(q);
-       }
-
-       mutex_lock(&q->sysfs_lock);
+       mutex_unlock(&q->debugfs_mutex);
 
        ret = disk_register_independent_access_ranges(disk, NULL);
        if (ret)
@@ -948,8 +939,15 @@ void blk_unregister_queue(struct gendisk *disk)
        /* Now that we've deleted all child objects, we can delete the queue. */
        kobject_uevent(&q->kobj, KOBJ_REMOVE);
        kobject_del(&q->kobj);
-
        mutex_unlock(&q->sysfs_dir_lock);
 
+       mutex_lock(&q->debugfs_mutex);
+       blk_trace_shutdown(q);
+       debugfs_remove_recursive(q->debugfs_dir);
+       q->debugfs_dir = NULL;
+       q->sched_debugfs_dir = NULL;
+       q->rqos_debugfs_dir = NULL;
+       mutex_unlock(&q->debugfs_mutex);
+
        kobject_put(&disk_to_dev(disk)->kobj);
 }
index 27205ae..278227b 100644 (file)
@@ -623,6 +623,7 @@ void del_gendisk(struct gendisk *disk)
         * Prevent new I/O from crossing bio_queue_enter().
         */
        blk_queue_start_drain(q);
+       blk_mq_freeze_queue_wait(q);
 
        if (!(disk->flags & GENHD_FL_HIDDEN)) {
                sysfs_remove_link(&disk_to_dev(disk)->kobj, "bdi");
@@ -646,12 +647,21 @@ void del_gendisk(struct gendisk *disk)
        pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);
        device_del(disk_to_dev(disk));
 
-       blk_mq_freeze_queue_wait(q);
-
        blk_throtl_cancel_bios(disk->queue);
 
        blk_sync_queue(q);
        blk_flush_integrity();
+       blk_mq_cancel_work_sync(q);
+
+       blk_mq_quiesce_queue(q);
+       if (q->elevator) {
+               mutex_lock(&q->sysfs_lock);
+               elevator_exit(q);
+               mutex_unlock(&q->sysfs_lock);
+       }
+       rq_qos_exit(q);
+       blk_mq_unquiesce_queue(q);
+
        /*
         * Allow using passthrough request again after the queue is torn down.
         */
@@ -1120,31 +1130,6 @@ static const struct attribute_group *disk_attr_groups[] = {
        NULL
 };
 
-static void disk_release_mq(struct request_queue *q)
-{
-       blk_mq_cancel_work_sync(q);
-
-       /*
-        * There can't be any non non-passthrough bios in flight here, but
-        * requests stay around longer, including passthrough ones so we
-        * still need to freeze the queue here.
-        */
-       blk_mq_freeze_queue(q);
-
-       /*
-        * Since the I/O scheduler exit code may access cgroup information,
-        * perform I/O scheduler exit before disassociating from the block
-        * cgroup controller.
-        */
-       if (q->elevator) {
-               mutex_lock(&q->sysfs_lock);
-               elevator_exit(q);
-               mutex_unlock(&q->sysfs_lock);
-       }
-       rq_qos_exit(q);
-       __blk_mq_unfreeze_queue(q, true);
-}
-
 /**
  * disk_release - releases all allocated resources of the gendisk
  * @dev: the device representing this disk
@@ -1166,9 +1151,6 @@ static void disk_release(struct device *dev)
        might_sleep();
        WARN_ON_ONCE(disk_live(disk));
 
-       if (queue_is_mq(disk->queue))
-               disk_release_mq(disk->queue);
-
        blkcg_exit_queue(disk->queue);
 
        disk_release_events(disk);
index 8d75028..5283bc8 100644 (file)
@@ -79,10 +79,6 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk)
 
        WARN_ON_ONCE(!bdev->bd_holder);
 
-       /* FIXME: remove the following once add_disk() handles errors */
-       if (WARN_ON(!bdev->bd_holder_dir))
-               goto out_unlock;
-
        holder = bd_find_holder_disk(bdev, disk);
        if (holder) {
                holder->refcnt++;
index 70ff2a5..8f7c745 100644 (file)
@@ -421,6 +421,8 @@ static int kyber_init_sched(struct request_queue *q, struct elevator_type *e)
 
        blk_stat_enable_accounting(q);
 
+       blk_queue_flag_clear(QUEUE_FLAG_SQ_SCHED, q);
+
        eq->elevator_data = kqd;
        q->elevator = eq;
 
@@ -1033,7 +1035,6 @@ static struct elevator_type kyber_sched = {
 #endif
        .elevator_attrs = kyber_sched_attrs,
        .elevator_name = "kyber",
-       .elevator_features = ELEVATOR_F_MQ_AWARE,
        .elevator_owner = THIS_MODULE,
 };
 
index 6ed602b..1a9e835 100644 (file)
@@ -642,6 +642,9 @@ static int dd_init_sched(struct request_queue *q, struct elevator_type *e)
        spin_lock_init(&dd->lock);
        spin_lock_init(&dd->zone_lock);
 
+       /* We dispatch from request queue wide instead of hw queue */
+       blk_queue_flag_set(QUEUE_FLAG_SQ_SCHED, q);
+
        q->elevator = eq;
        return 0;
 
index 56637ac..cec5465 100644 (file)
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
-/blacklist_hashes_checked
+/blacklist_hash_list
 /extract-cert
 /x509_certificate_list
 /x509_revocation_list
index bb904f9..88a73b2 100644 (file)
@@ -3,26 +3,26 @@
 # Makefile for the linux kernel signature checking certificates.
 #
 
-obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o common.o
-obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o
+obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o
+obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o
 obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o
 ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),)
-quiet_cmd_check_blacklist_hashes = CHECK   $(patsubst "%",%,$(2))
-      cmd_check_blacklist_hashes = $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(2); touch $@
 
-$(eval $(call config_filename,SYSTEM_BLACKLIST_HASH_LIST))
+$(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list
+CFLAGS_blacklist_hashes.o := -I $(obj)
 
-$(obj)/blacklist_hashes.o: $(obj)/blacklist_hashes_checked
+quiet_cmd_check_and_copy_blacklist_hash_list = GEN     $@
+      cmd_check_and_copy_blacklist_hash_list = \
+       $(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \
+       cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@
 
-CFLAGS_blacklist_hashes.o += -I$(srctree)
-
-targets += blacklist_hashes_checked
-$(obj)/blacklist_hashes_checked: $(SYSTEM_BLACKLIST_HASH_LIST_SRCPREFIX)$(SYSTEM_BLACKLIST_HASH_LIST_FILENAME) scripts/check-blacklist-hashes.awk FORCE
-       $(call if_changed,check_blacklist_hashes,$(SYSTEM_BLACKLIST_HASH_LIST_SRCPREFIX)$(CONFIG_SYSTEM_BLACKLIST_HASH_LIST))
+$(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE
+       $(call if_changed,check_and_copy_blacklist_hash_list)
 obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o
 else
 obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o
 endif
+targets += blacklist_hash_list
 
 quiet_cmd_extract_certs  = CERT    $@
       cmd_extract_certs  = $(obj)/extract-cert $(extract-cert-in) $@
@@ -33,7 +33,7 @@ $(obj)/system_certificates.o: $(obj)/x509_certificate_list
 $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert FORCE
        $(call if_changed,extract_certs)
 
-targets += x509_certificate_list blacklist_hashes_checked
+targets += x509_certificate_list
 
 # If module signing is requested, say by allyesconfig, but a key has not been
 # supplied, then one will need to be generated to make sure the build does not
index 25094ea..41f1060 100644 (file)
 #include <linux/err.h>
 #include <linux/seq_file.h>
 #include <linux/uidgid.h>
-#include <linux/verification.h>
+#include <keys/asymmetric-type.h>
 #include <keys/system_keyring.h>
 #include "blacklist.h"
-#include "common.h"
 
 /*
  * According to crypto/asymmetric_keys/x509_cert_parser.c:x509_note_pkey_algo(),
@@ -365,8 +364,9 @@ static __init int load_revocation_certificate_list(void)
        if (revocation_certificate_list_size)
                pr_notice("Loading compiled-in revocation X.509 certificates\n");
 
-       return load_certificate_list(revocation_certificate_list, revocation_certificate_list_size,
-                                    blacklist_keyring);
+       return x509_load_certificate_list(revocation_certificate_list,
+                                         revocation_certificate_list_size,
+                                         blacklist_keyring);
 }
 late_initcall(load_revocation_certificate_list);
 #endif
index 3448923..86d66fe 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "blacklist.h"
 
-const char __initdata *const blacklist_hashes[] = {
-#include CONFIG_SYSTEM_BLACKLIST_HASH_LIST
+const char __initconst *const blacklist_hashes[] = {
+#include "blacklist_hash_list"
        , NULL
 };
diff --git a/certs/common.c b/certs/common.c
deleted file mode 100644 (file)
index 16a2208..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include <linux/kernel.h>
-#include <linux/key.h>
-#include "common.h"
-
-int load_certificate_list(const u8 cert_list[],
-                         const unsigned long list_size,
-                         const struct key *keyring)
-{
-       key_ref_t key;
-       const u8 *p, *end;
-       size_t plen;
-
-       p = cert_list;
-       end = p + list_size;
-       while (p < end) {
-               /* Each cert begins with an ASN.1 SEQUENCE tag and must be more
-                * than 256 bytes in size.
-                */
-               if (end - p < 4)
-                       goto dodgy_cert;
-               if (p[0] != 0x30 &&
-                   p[1] != 0x82)
-                       goto dodgy_cert;
-               plen = (p[2] << 8) | p[3];
-               plen += 4;
-               if (plen > end - p)
-                       goto dodgy_cert;
-
-               key = key_create_or_update(make_key_ref(keyring, 1),
-                                          "asymmetric",
-                                          NULL,
-                                          p,
-                                          plen,
-                                          ((KEY_POS_ALL & ~KEY_POS_SETATTR) |
-                                          KEY_USR_VIEW | KEY_USR_READ),
-                                          KEY_ALLOC_NOT_IN_QUOTA |
-                                          KEY_ALLOC_BUILT_IN |
-                                          KEY_ALLOC_BYPASS_RESTRICTION);
-               if (IS_ERR(key)) {
-                       pr_err("Problem loading in-kernel X.509 certificate (%ld)\n",
-                              PTR_ERR(key));
-               } else {
-                       pr_notice("Loaded X.509 cert '%s'\n",
-                                 key_ref_to_ptr(key)->description);
-                       key_ref_put(key);
-               }
-               p += plen;
-       }
-
-       return 0;
-
-dodgy_cert:
-       pr_err("Problem parsing in-kernel X.509 certificate list\n");
-       return 0;
-}
diff --git a/certs/common.h b/certs/common.h
deleted file mode 100644 (file)
index abdb579..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-
-#ifndef _CERT_COMMON_H
-#define _CERT_COMMON_H
-
-int load_certificate_list(const u8 cert_list[], const unsigned long list_size,
-                         const struct key *keyring);
-
-#endif
index f7ef786..8c1fb9a 100644 (file)
 #include <openssl/err.h>
 #include <openssl/engine.h>
 
+/*
+ * OpenSSL 3.0 deprecates the OpenSSL's ENGINE API.
+ *
+ * Remove this if/when that API is no longer used
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 #define PKEY_ID_PKCS7 2
 
 static __attribute__((noreturn))
index 05b66ce..5042cc5 100644 (file)
@@ -16,7 +16,6 @@
 #include <keys/asymmetric-type.h>
 #include <keys/system_keyring.h>
 #include <crypto/pkcs7.h>
-#include "common.h"
 
 static struct key *builtin_trusted_keys;
 #ifdef CONFIG_SECONDARY_TRUSTED_KEYRING
@@ -183,7 +182,8 @@ __init int load_module_cert(struct key *keyring)
 
        pr_notice("Loading compiled-in module X.509 certificates\n");
 
-       return load_certificate_list(system_certificate_list, module_cert_size, keyring);
+       return x509_load_certificate_list(system_certificate_list,
+                                         module_cert_size, keyring);
 }
 
 /*
@@ -204,7 +204,7 @@ static __init int load_system_certificate_list(void)
        size = system_certificate_list_size - module_cert_size;
 #endif
 
-       return load_certificate_list(p, size, builtin_trusted_keys);
+       return x509_load_certificate_list(p, size, builtin_trusted_keys);
 }
 late_initcall(load_system_certificate_list);
 
index 1919746..1d44893 100644 (file)
@@ -15,6 +15,7 @@ source "crypto/async_tx/Kconfig"
 #
 menuconfig CRYPTO
        tristate "Cryptographic API"
+       select LIB_MEMNEQ
        help
          This option provides the core Cryptographic API.
 
index 43bc33e..ceaaa9f 100644 (file)
@@ -4,7 +4,7 @@
 #
 
 obj-$(CONFIG_CRYPTO) += crypto.o
-crypto-y := api.o cipher.o compress.o memneq.o
+crypto-y := api.o cipher.o compress.o
 
 obj-$(CONFIG_CRYPTO_ENGINE) += crypto_engine.o
 obj-$(CONFIG_CRYPTO_FIPS) += fips.o
index 460bc5d..3df3fe4 100644 (file)
@@ -75,4 +75,14 @@ config SIGNED_PE_FILE_VERIFICATION
          This option provides support for verifying the signature(s) on a
          signed PE binary.
 
+config FIPS_SIGNATURE_SELFTEST
+       bool "Run FIPS selftests on the X.509+PKCS7 signature verification"
+       help
+         This option causes some selftests to be run on the signature
+         verification code, using some built in data.  This is required
+         for FIPS.
+       depends on KEYS
+       depends on ASYMMETRIC_KEY_TYPE
+       depends on PKCS7_MESSAGE_PARSER
+
 endif # ASYMMETRIC_KEY_TYPE
index c38424f..0d1fa1b 100644 (file)
@@ -20,7 +20,9 @@ x509_key_parser-y := \
        x509.asn1.o \
        x509_akid.asn1.o \
        x509_cert_parser.o \
+       x509_loader.o \
        x509_public_key.o
+x509_key_parser-$(CONFIG_FIPS_SIGNATURE_SELFTEST) += selftest.o
 
 $(obj)/x509_cert_parser.o: \
        $(obj)/x509.asn1.h \
diff --git a/crypto/asymmetric_keys/selftest.c b/crypto/asymmetric_keys/selftest.c
new file mode 100644 (file)
index 0000000..fa0bf7f
--- /dev/null
@@ -0,0 +1,224 @@
+/* Self-testing for signature checking.
+ *
+ * Copyright (C) 2022 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells@redhat.com)
+ */
+
+#include <linux/kernel.h>
+#include <linux/cred.h>
+#include <linux/key.h>
+#include <crypto/pkcs7.h>
+#include "x509_parser.h"
+
+struct certs_test {
+       const u8        *data;
+       size_t          data_len;
+       const u8        *pkcs7;
+       size_t          pkcs7_len;
+};
+
+/*
+ * Set of X.509 certificates to provide public keys for the tests.  These will
+ * be loaded into a temporary keyring for the duration of the testing.
+ */
+static const __initconst u8 certs_selftest_keys[] = {
+       "\x30\x82\x05\x55\x30\x82\x03\x3d\xa0\x03\x02\x01\x02\x02\x14\x73"
+       "\x98\xea\x98\x2d\xd0\x2e\xa8\xb1\xcf\x57\xc7\xf2\x97\xb3\xe6\x1a"
+       "\xfc\x8c\x0a\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01\x01\x0b"
+       "\x05\x00\x30\x34\x31\x32\x30\x30\x06\x03\x55\x04\x03\x0c\x29\x43"
+       "\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x76\x65\x72\x69\x66"
+       "\x69\x63\x61\x74\x69\x6f\x6e\x20\x73\x65\x6c\x66\x2d\x74\x65\x73"
+       "\x74\x69\x6e\x67\x20\x6b\x65\x79\x30\x20\x17\x0d\x32\x32\x30\x35"
+       "\x31\x38\x32\x32\x33\x32\x34\x31\x5a\x18\x0f\x32\x31\x32\x32\x30"
+       "\x34\x32\x34\x32\x32\x33\x32\x34\x31\x5a\x30\x34\x31\x32\x30\x30"
+       "\x06\x03\x55\x04\x03\x0c\x29\x43\x65\x72\x74\x69\x66\x69\x63\x61"
+       "\x74\x65\x20\x76\x65\x72\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x20"
+       "\x73\x65\x6c\x66\x2d\x74\x65\x73\x74\x69\x6e\x67\x20\x6b\x65\x79"
+       "\x30\x82\x02\x22\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01\x01"
+       "\x01\x05\x00\x03\x82\x02\x0f\x00\x30\x82\x02\x0a\x02\x82\x02\x01"
+       "\x00\xcc\xac\x49\xdd\x3b\xca\xb0\x15\x7e\x84\x6a\xb2\x0a\x69\x5f"
+       "\x1c\x0a\x61\x82\x3b\x4f\x2c\xa3\x95\x2c\x08\x58\x4b\xb1\x5d\x99"
+       "\xe0\xc3\xc1\x79\xc2\xb3\xeb\xc0\x1e\x6d\x3e\x54\x1d\xbd\xb7\x92"
+       "\x7b\x4d\xb5\x95\x58\xb2\x52\x2e\xc6\x24\x4b\x71\x63\x80\x32\x77"
+       "\xa7\x38\x5e\xdb\x72\xae\x6e\x0d\xec\xfb\xb6\x6d\x01\x7f\xe9\x55"
+       "\x66\xdf\xbf\x1d\x76\x78\x02\x31\xe8\xe5\x07\xf8\xb7\x82\x5c\x0d"
+       "\xd4\xbb\xfb\xa2\x59\x0d\x2e\x3a\x78\x95\x3a\x8b\x46\x06\x47\x44"
+       "\x46\xd7\xcd\x06\x6a\x41\x13\xe3\x19\xf6\xbb\x6e\x38\xf4\x83\x01"
+       "\xa3\xbf\x4a\x39\x4f\xd7\x0a\xe9\x38\xb3\xf5\x94\x14\x4e\xdd\xf7"
+       "\x43\xfd\x24\xb2\x49\x3c\xa5\xf7\x7a\x7c\xd4\x45\x3d\x97\x75\x68"
+       "\xf1\xed\x4c\x42\x0b\x70\xca\x85\xf3\xde\xe5\x88\x2c\xc5\xbe\xb6"
+       "\x97\x34\xba\x24\x02\xcd\x8b\x86\x9f\xa9\x73\xca\x73\xcf\x92\x81"
+       "\xee\x75\x55\xbb\x18\x67\x5c\xff\x3f\xb5\xdd\x33\x1b\x0c\xe9\x78"
+       "\xdb\x5c\xcf\xaa\x5c\x43\x42\xdf\x5e\xa9\x6d\xec\xd7\xd7\xff\xe6"
+       "\xa1\x3a\x92\x1a\xda\xae\xf6\x8c\x6f\x7b\xd5\xb4\x6e\x06\xe9\x8f"
+       "\xe8\xde\x09\x31\x89\xed\x0e\x11\xa1\xfa\x8a\xe9\xe9\x64\x59\x62"
+       "\x53\xda\xd1\x70\xbe\x11\xd4\x99\x97\x11\xcf\x99\xde\x0b\x9d\x94"
+       "\x7e\xaa\xb8\x52\xea\x37\xdb\x90\x7e\x35\xbd\xd9\xfe\x6d\x0a\x48"
+       "\x70\x28\xdd\xd5\x0d\x7f\x03\x80\x93\x14\x23\x8f\xb9\x22\xcd\x7c"
+       "\x29\xfe\xf1\x72\xb5\x5c\x0b\x12\xcf\x9c\x15\xf6\x11\x4c\x7a\x45"
+       "\x25\x8c\x45\x0a\x34\xac\x2d\x9a\x81\xca\x0b\x13\x22\xcd\xeb\x1a"
+       "\x38\x88\x18\x97\x96\x08\x81\xaa\xcc\x8f\x0f\x8a\x32\x7b\x76\x68"
+       "\x03\x68\x43\xbf\x11\xba\x55\x60\xfd\x80\x1c\x0d\x9b\x69\xb6\x09"
+       "\x72\xbc\x0f\x41\x2f\x07\x82\xc6\xe3\xb2\x13\x91\xc4\x6d\x14\x95"
+       "\x31\xbe\x19\xbd\xbc\xed\xe1\x4c\x74\xa2\xe0\x78\x0b\xbb\x94\xec"
+       "\x4c\x53\x3a\xa2\xb5\x84\x1d\x4b\x65\x7e\xdc\xf7\xdb\x36\x7d\xbe"
+       "\x9e\x3b\x36\x66\x42\x66\x76\x35\xbf\xbe\xf0\xc1\x3c\x7c\xe9\x42"
+       "\x5c\x24\x53\x03\x05\xa8\x67\x24\x50\x02\x75\xff\x24\x46\x3b\x35"
+       "\x89\x76\xe6\x70\xda\xc5\x51\x8c\x9a\xe5\x05\xb0\x0b\xd0\x2d\xd4"
+       "\x7d\x57\x75\x94\x6b\xf9\x0a\xad\x0e\x41\x00\x15\xd0\x4f\xc0\x7f"
+       "\x90\x2d\x18\x48\x8f\x28\xfe\x5d\xa7\xcd\x99\x9e\xbd\x02\x6c\x8a"
+       "\x31\xf3\x1c\xc7\x4b\xe6\x93\xcd\x42\xa2\xe4\x68\x10\x47\x9d\xfc"
+       "\x21\x02\x03\x01\x00\x01\xa3\x5d\x30\x5b\x30\x0c\x06\x03\x55\x1d"
+       "\x13\x01\x01\xff\x04\x02\x30\x00\x30\x0b\x06\x03\x55\x1d\x0f\x04"
+       "\x04\x03\x02\x07\x80\x30\x1d\x06\x03\x55\x1d\x0e\x04\x16\x04\x14"
+       "\xf5\x87\x03\xbb\x33\xce\x1b\x73\xee\x02\xec\xcd\xee\x5b\x88\x17"
+       "\x51\x8f\xe3\xdb\x30\x1f\x06\x03\x55\x1d\x23\x04\x18\x30\x16\x80"
+       "\x14\xf5\x87\x03\xbb\x33\xce\x1b\x73\xee\x02\xec\xcd\xee\x5b\x88"
+       "\x17\x51\x8f\xe3\xdb\x30\x0d\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01"
+       "\x01\x0b\x05\x00\x03\x82\x02\x01\x00\xc0\x2e\x12\x41\x7b\x73\x85"
+       "\x16\xc8\xdb\x86\x79\xe8\xf5\xcd\x44\xf4\xc6\xe2\x81\x23\x5e\x47"
+       "\xcb\xab\x25\xf1\x1e\x58\x3e\x31\x7f\x78\xad\x85\xeb\xfe\x14\x88"
+       "\x60\xf7\x7f\xd2\x26\xa2\xf4\x98\x2a\xfd\xba\x05\x0c\x20\x33\x12"
+       "\xcc\x4d\x14\x61\x64\x81\x93\xd3\x33\xed\xc8\xff\xf1\x78\xcc\x5f"
+       "\x51\x9f\x09\xd7\xbe\x0d\x5c\x74\xfd\x9b\xdf\x52\x4a\xc9\xa8\x71"
+       "\x25\x33\x04\x10\x67\x36\xd0\xb3\x0b\xc9\xa1\x40\x72\xae\x41\x7b"
+       "\x68\xe6\xe4\x7b\xd0\x28\xf7\x6d\xe7\x3f\x50\xfc\x91\x7c\x91\x56"
+       "\xd4\xdf\xa6\xbb\xe8\x4d\x1b\x58\xaa\x28\xfa\xc1\x19\xeb\x11\x2f"
+       "\x24\x8b\x7c\xc5\xa9\x86\x26\xaa\x6e\xb7\x9b\xd5\xf8\x06\xfb\x02"
+       "\x52\x7b\x9c\x9e\xa1\xe0\x07\x8b\x5e\xe4\xb8\x55\x29\xf6\x48\x52"
+       "\x1c\x1b\x54\x2d\x46\xd8\xe5\x71\xb9\x60\xd1\x45\xb5\x92\x89\x8a"
+       "\x63\x58\x2a\xb3\xc6\xb2\x76\xe2\x3c\x82\x59\x04\xae\x5a\xc4\x99"
+       "\x7b\x2e\x4b\x46\x57\xb8\x29\x24\xb2\xfd\xee\x2c\x0d\xa4\x83\xfa"
+       "\x65\x2a\x07\x35\x8b\x97\xcf\xbd\x96\x2e\xd1\x7e\x6c\xc2\x1e\x87"
+       "\xb6\x6c\x76\x65\xb5\xb2\x62\xda\x8b\xe9\x73\xe3\xdb\x33\xdd\x13"
+       "\x3a\x17\x63\x6a\x76\xde\x8d\x8f\xe0\x47\x61\x28\x3a\x83\xff\x8f"
+       "\xe7\xc7\xe0\x4a\xa3\xe5\x07\xcf\xe9\x8c\x35\x35\x2e\xe7\x80\x66"
+       "\x31\xbf\x91\x58\x0a\xe1\x25\x3d\x38\xd3\xa4\xf0\x59\x34\x47\x07"
+       "\x62\x0f\xbe\x30\xdd\x81\x88\x58\xf0\x28\xb0\x96\xe5\x82\xf8\x05"
+       "\xb7\x13\x01\xbc\xfa\xc6\x1f\x86\x72\xcc\xf9\xee\x8e\xd9\xd6\x04"
+       "\x8c\x24\x6c\xbf\x0f\x5d\x37\x39\xcf\x45\xc1\x93\x3a\xd2\xed\x5c"
+       "\x58\x79\x74\x86\x62\x30\x7e\x8e\xbb\xdd\x7a\xa9\xed\xca\x40\xcb"
+       "\x62\x47\xf4\xb4\x9f\x52\x7f\x72\x63\xa8\xf0\x2b\xaf\x45\x2a\x48"
+       "\x19\x6d\xe3\xfb\xf9\x19\x66\x69\xc8\xcc\x62\x87\x6c\x53\x2b\x2d"
+       "\x6e\x90\x6c\x54\x3a\x82\x25\x41\xcb\x18\x6a\xa4\x22\xa8\xa1\xc4"
+       "\x47\xd7\x81\x00\x1c\x15\x51\x0f\x1a\xaf\xef\x9f\xa6\x61\x8c\xbd"
+       "\x6b\x8b\xed\xe6\xac\x0e\xb6\x3a\x4c\x92\xe6\x0f\x91\x0a\x0f\x71"
+       "\xc7\xa0\xb9\x0d\x3a\x17\x5a\x6f\x35\xc8\xe7\x50\x4f\x46\xe8\x70"
+       "\x60\x48\x06\x82\x8b\x66\x58\xe6\x73\x91\x9c\x12\x3d\x35\x8e\x46"
+       "\xad\x5a\xf5\xb3\xdb\x69\x21\x04\xfd\xd3\x1c\xdf\x94\x9d\x56\xb0"
+       "\x0a\xd1\x95\x76\x8d\xec\x9e\xdd\x0b\x15\x97\x64\xad\xe5\xf2\x62"
+       "\x02\xfc\x9e\x5f\x56\x42\x39\x05\xb3"
+};
+
+/*
+ * Signed data and detached signature blobs that form the verification tests.
+ */
+static const __initconst u8 certs_selftest_1_data[] = {
+       "\x54\x68\x69\x73\x20\x69\x73\x20\x73\x6f\x6d\x65\x20\x74\x65\x73"
+       "\x74\x20\x64\x61\x74\x61\x20\x75\x73\x65\x64\x20\x66\x6f\x72\x20"
+       "\x73\x65\x6c\x66\x2d\x74\x65\x73\x74\x69\x6e\x67\x20\x63\x65\x72"
+       "\x74\x69\x66\x69\x63\x61\x74\x65\x20\x76\x65\x72\x69\x66\x69\x63"
+       "\x61\x74\x69\x6f\x6e\x2e\x0a"
+};
+
+static const __initconst u8 certs_selftest_1_pkcs7[] = {
+       "\x30\x82\x02\xab\x06\x09\x2a\x86\x48\x86\xf7\x0d\x01\x07\x02\xa0"
+       "\x82\x02\x9c\x30\x82\x02\x98\x02\x01\x01\x31\x0d\x30\x0b\x06\x09"
+       "\x60\x86\x48\x01\x65\x03\x04\x02\x01\x30\x0b\x06\x09\x2a\x86\x48"
+       "\x86\xf7\x0d\x01\x07\x01\x31\x82\x02\x75\x30\x82\x02\x71\x02\x01"
+       "\x01\x30\x4c\x30\x34\x31\x32\x30\x30\x06\x03\x55\x04\x03\x0c\x29"
+       "\x43\x65\x72\x74\x69\x66\x69\x63\x61\x74\x65\x20\x76\x65\x72\x69"
+       "\x66\x69\x63\x61\x74\x69\x6f\x6e\x20\x73\x65\x6c\x66\x2d\x74\x65"
+       "\x73\x74\x69\x6e\x67\x20\x6b\x65\x79\x02\x14\x73\x98\xea\x98\x2d"
+       "\xd0\x2e\xa8\xb1\xcf\x57\xc7\xf2\x97\xb3\xe6\x1a\xfc\x8c\x0a\x30"
+       "\x0b\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x30\x0d\x06\x09"
+       "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01\x05\x00\x04\x82\x02\x00\xac"
+       "\xb0\xf2\x07\xd6\x99\x6d\xc0\xc0\xd9\x8d\x31\x0d\x7e\x04\xeb\xc3"
+       "\x88\x90\xc4\x58\x46\xd4\xe2\xa0\xa3\x25\xe3\x04\x50\x37\x85\x8c"
+       "\x91\xc6\xfc\xc5\xd4\x92\xfd\x05\xd8\xb8\xa3\xb8\xba\x89\x13\x00"
+       "\x88\x79\x99\x51\x6b\x5b\x28\x31\xc0\xb3\x1b\x7a\x68\x2c\x00\xdb"
+       "\x4b\x46\x11\xf3\xfa\x50\x8e\x19\x89\xa2\x4c\xda\x4c\x89\x01\x11"
+       "\x89\xee\xd3\xc8\xc1\xe7\xa7\xf6\xb2\xa2\xf8\x65\xb8\x35\x20\x33"
+       "\xba\x12\x62\xd5\xbd\xaa\x71\xe5\x5b\xc0\x6a\x32\xff\x6a\x2e\x23"
+       "\xef\x2b\xb6\x58\xb1\xfb\x5f\x82\x34\x40\x6d\x9f\xbc\x27\xac\x37"
+       "\x23\x99\xcf\x7d\x20\xb2\x39\x01\xc0\x12\xce\xd7\x5d\x2f\xb6\xab"
+       "\xb5\x56\x4f\xef\xf4\x72\x07\x58\x65\xa9\xeb\x1f\x75\x1c\x5f\x0c"
+       "\x88\xe0\xa4\xe2\xcd\x73\x2b\x9e\xb2\x05\x7e\x12\xf8\xd0\x66\x41"
+       "\xcc\x12\x63\xd4\xd6\xac\x9b\x1d\x14\x77\x8d\x1c\x57\xd5\x27\xc6"
+       "\x49\xa2\x41\x43\xf3\x59\x29\xe5\xcb\xd1\x75\xbc\x3a\x97\x2a\x72"
+       "\x22\x66\xc5\x3b\xc1\xba\xfc\x53\x18\x98\xe2\x21\x64\xc6\x52\x87"
+       "\x13\xd5\x7c\x42\xe8\xfb\x9c\x9a\x45\x32\xd5\xa5\x22\x62\x9d\xd4"
+       "\xcb\xa4\xfa\x77\xbb\x50\x24\x0b\x8b\x88\x99\x15\x56\xa9\x1e\x92"
+       "\xbf\x5d\x94\x77\xb6\xf1\x67\x01\x60\x06\x58\x5c\xdf\x18\x52\x79"
+       "\x37\x30\x93\x7d\x87\x04\xf1\xe0\x55\x59\x52\xf3\xc2\xb1\x1c\x5b"
+       "\x12\x7c\x49\x87\xfb\xf7\xed\xdd\x95\x71\xec\x4b\x1a\x85\x08\xb0"
+       "\xa0\x36\xc4\x7b\xab\x40\xe0\xf1\x98\xcc\xaf\x19\x40\x8f\x47\x6f"
+       "\xf0\x6c\x84\x29\x7f\x7f\x04\x46\xcb\x08\x0f\xe0\xc1\xc9\x70\x6e"
+       "\x95\x3b\xa4\xbc\x29\x2b\x53\x67\x45\x1b\x0d\xbc\x13\xa5\x76\x31"
+       "\xaf\xb9\xd0\xe0\x60\x12\xd2\xf4\xb7\x7c\x58\x7e\xf6\x2d\xbb\x24"
+       "\x14\x5a\x20\x24\xa8\x12\xdf\x25\xbd\x42\xce\x96\x7c\x2e\xba\x14"
+       "\x1b\x81\x9f\x18\x45\xa4\xc6\x70\x3e\x0e\xf0\xd3\x7b\x9c\x10\xbe"
+       "\xb8\x7a\x89\xc5\x9e\xd9\x97\xdf\xd7\xe7\xc6\x1d\xc0\x20\x6c\xb8"
+       "\x1e\x3a\x63\xb8\x39\x8e\x8e\x62\xd5\xd2\xb4\xcd\xff\x46\xfc\x8e"
+       "\xec\x07\x35\x0c\xff\xb0\x05\xe6\xf4\xe5\xfe\xa2\xe3\x0a\xe6\x36"
+       "\xa7\x4a\x7e\x62\x1d\xc4\x50\x39\x35\x4e\x28\xcb\x4a\xfb\x9d\xdb"
+       "\xdd\x23\xd6\x53\xb1\x74\x77\x12\xf7\x9c\xf0\x9a\x6b\xf7\xa9\x64"
+       "\x2d\x86\x21\x2a\xcf\xc6\x54\xf5\xc9\xad\xfa\xb5\x12\xb4\xf3\x51"
+       "\x77\x55\x3c\x6f\x0c\x32\xd3\x8c\x44\x39\x71\x25\xfe\x96\xd2"
+};
+
+/*
+ * List of tests to be run.
+ */
+#define TEST(data, pkcs7) { data, sizeof(data) - 1, pkcs7, sizeof(pkcs7) - 1 }
+static const struct certs_test certs_tests[] __initconst = {
+       TEST(certs_selftest_1_data, certs_selftest_1_pkcs7),
+};
+
+int __init fips_signature_selftest(void)
+{
+       struct key *keyring;
+       int ret, i;
+
+       pr_notice("Running certificate verification selftests\n");
+
+       keyring = keyring_alloc(".certs_selftest",
+                               GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, current_cred(),
+                               (KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                               KEY_USR_VIEW | KEY_USR_READ |
+                               KEY_USR_SEARCH,
+                               KEY_ALLOC_NOT_IN_QUOTA,
+                               NULL, NULL);
+       if (IS_ERR(keyring))
+               panic("Can't allocate certs selftest keyring: %ld\n",
+                     PTR_ERR(keyring));
+
+       ret = x509_load_certificate_list(certs_selftest_keys,
+                                        sizeof(certs_selftest_keys) - 1, keyring);
+       if (ret < 0)
+               panic("Can't allocate certs selftest keyring: %d\n", ret);
+
+       for (i = 0; i < ARRAY_SIZE(certs_tests); i++) {
+               const struct certs_test *test = &certs_tests[i];
+               struct pkcs7_message *pkcs7;
+
+               pkcs7 = pkcs7_parse_message(test->pkcs7, test->pkcs7_len);
+               if (IS_ERR(pkcs7))
+                       panic("Certs selftest %d: pkcs7_parse_message() = %d\n", i, ret);
+
+               pkcs7_supply_detached_data(pkcs7, test->data, test->data_len);
+
+               ret = pkcs7_verify(pkcs7, VERIFYING_MODULE_SIGNATURE);
+               if (ret < 0)
+                       panic("Certs selftest %d: pkcs7_verify() = %d\n", i, ret);
+
+               ret = pkcs7_validate_trust(pkcs7, keyring);
+               if (ret < 0)
+                       panic("Certs selftest %d: pkcs7_validate_trust() = %d\n", i, ret);
+
+               pkcs7_free_message(pkcs7);
+       }
+
+       key_put(keyring);
+       return 0;
+}
diff --git a/crypto/asymmetric_keys/x509_loader.c b/crypto/asymmetric_keys/x509_loader.c
new file mode 100644 (file)
index 0000000..1bc169d
--- /dev/null
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include <linux/kernel.h>
+#include <linux/key.h>
+#include <keys/asymmetric-type.h>
+
+int x509_load_certificate_list(const u8 cert_list[],
+                              const unsigned long list_size,
+                              const struct key *keyring)
+{
+       key_ref_t key;
+       const u8 *p, *end;
+       size_t plen;
+
+       p = cert_list;
+       end = p + list_size;
+       while (p < end) {
+               /* Each cert begins with an ASN.1 SEQUENCE tag and must be more
+                * than 256 bytes in size.
+                */
+               if (end - p < 4)
+                       goto dodgy_cert;
+               if (p[0] != 0x30 &&
+                   p[1] != 0x82)
+                       goto dodgy_cert;
+               plen = (p[2] << 8) | p[3];
+               plen += 4;
+               if (plen > end - p)
+                       goto dodgy_cert;
+
+               key = key_create_or_update(make_key_ref(keyring, 1),
+                                          "asymmetric",
+                                          NULL,
+                                          p,
+                                          plen,
+                                          ((KEY_POS_ALL & ~KEY_POS_SETATTR) |
+                                          KEY_USR_VIEW | KEY_USR_READ),
+                                          KEY_ALLOC_NOT_IN_QUOTA |
+                                          KEY_ALLOC_BUILT_IN |
+                                          KEY_ALLOC_BYPASS_RESTRICTION);
+               if (IS_ERR(key)) {
+                       pr_err("Problem loading in-kernel X.509 certificate (%ld)\n",
+                              PTR_ERR(key));
+               } else {
+                       pr_notice("Loaded X.509 cert '%s'\n",
+                                 key_ref_to_ptr(key)->description);
+                       key_ref_put(key);
+               }
+               p += plen;
+       }
+
+       return 0;
+
+dodgy_cert:
+       pr_err("Problem parsing in-kernel X.509 certificate list\n");
+       return 0;
+}
index 97a886c..a299c9c 100644 (file)
@@ -40,6 +40,15 @@ struct x509_certificate {
        bool            blacklisted;
 };
 
+/*
+ * selftest.c
+ */
+#ifdef CONFIG_FIPS_SIGNATURE_SELFTEST
+extern int __init fips_signature_selftest(void);
+#else
+static inline int fips_signature_selftest(void) { return 0; }
+#endif
+
 /*
  * x509_cert_parser.c
  */
index 77ed4e9..0b4943a 100644 (file)
@@ -244,9 +244,15 @@ static struct asymmetric_key_parser x509_key_parser = {
 /*
  * Module stuff
  */
+extern int __init certs_selftest(void);
 static int __init x509_key_init(void)
 {
-       return register_asymmetric_key_parser(&x509_key_parser);
+       int ret;
+
+       ret = register_asymmetric_key_parser(&x509_key_parser);
+       if (ret < 0)
+               return ret;
+       return fips_signature_selftest();
 }
 
 static void __exit x509_key_exit(void)
diff --git a/crypto/memneq.c b/crypto/memneq.c
deleted file mode 100644 (file)
index fb11608..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Constant-time equality testing of memory regions.
- *
- * Authors:
- *
- *   James Yonan <james@openvpn.net>
- *   Daniel Borkmann <dborkman@redhat.com>
- *
- * This file is provided under a dual BSD/GPLv2 license.  When using or
- * redistributing this file, you may do so under either license.
- *
- * GPL LICENSE SUMMARY
- *
- * Copyright(c) 2013 OpenVPN Technologies, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
- * The full GNU General Public License is included in this distribution
- * in the file called LICENSE.GPL.
- *
- * BSD LICENSE
- *
- * Copyright(c) 2013 OpenVPN Technologies, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- *   * Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- *   * Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in
- *     the documentation and/or other materials provided with the
- *     distribution.
- *   * Neither the name of OpenVPN Technologies nor the names of its
- *     contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <crypto/algapi.h>
-#include <asm/unaligned.h>
-
-#ifndef __HAVE_ARCH_CRYPTO_MEMNEQ
-
-/* Generic path for arbitrary size */
-static inline unsigned long
-__crypto_memneq_generic(const void *a, const void *b, size_t size)
-{
-       unsigned long neq = 0;
-
-#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
-       while (size >= sizeof(unsigned long)) {
-               neq |= get_unaligned((unsigned long *)a) ^
-                      get_unaligned((unsigned long *)b);
-               OPTIMIZER_HIDE_VAR(neq);
-               a += sizeof(unsigned long);
-               b += sizeof(unsigned long);
-               size -= sizeof(unsigned long);
-       }
-#endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
-       while (size > 0) {
-               neq |= *(unsigned char *)a ^ *(unsigned char *)b;
-               OPTIMIZER_HIDE_VAR(neq);
-               a += 1;
-               b += 1;
-               size -= 1;
-       }
-       return neq;
-}
-
-/* Loop-free fast-path for frequently used 16-byte size */
-static inline unsigned long __crypto_memneq_16(const void *a, const void *b)
-{
-       unsigned long neq = 0;
-
-#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-       if (sizeof(unsigned long) == 8) {
-               neq |= get_unaligned((unsigned long *)a) ^
-                      get_unaligned((unsigned long *)b);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= get_unaligned((unsigned long *)(a + 8)) ^
-                      get_unaligned((unsigned long *)(b + 8));
-               OPTIMIZER_HIDE_VAR(neq);
-       } else if (sizeof(unsigned int) == 4) {
-               neq |= get_unaligned((unsigned int *)a) ^
-                      get_unaligned((unsigned int *)b);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= get_unaligned((unsigned int *)(a + 4)) ^
-                      get_unaligned((unsigned int *)(b + 4));
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= get_unaligned((unsigned int *)(a + 8)) ^
-                      get_unaligned((unsigned int *)(b + 8));
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= get_unaligned((unsigned int *)(a + 12)) ^
-                      get_unaligned((unsigned int *)(b + 12));
-               OPTIMIZER_HIDE_VAR(neq);
-       } else
-#endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
-       {
-               neq |= *(unsigned char *)(a)    ^ *(unsigned char *)(b);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+1)  ^ *(unsigned char *)(b+1);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+2)  ^ *(unsigned char *)(b+2);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+3)  ^ *(unsigned char *)(b+3);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+4)  ^ *(unsigned char *)(b+4);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+5)  ^ *(unsigned char *)(b+5);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+6)  ^ *(unsigned char *)(b+6);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+7)  ^ *(unsigned char *)(b+7);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+8)  ^ *(unsigned char *)(b+8);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+9)  ^ *(unsigned char *)(b+9);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+10) ^ *(unsigned char *)(b+10);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+11) ^ *(unsigned char *)(b+11);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+12) ^ *(unsigned char *)(b+12);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+13) ^ *(unsigned char *)(b+13);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+14) ^ *(unsigned char *)(b+14);
-               OPTIMIZER_HIDE_VAR(neq);
-               neq |= *(unsigned char *)(a+15) ^ *(unsigned char *)(b+15);
-               OPTIMIZER_HIDE_VAR(neq);
-       }
-
-       return neq;
-}
-
-/* Compare two areas of memory without leaking timing information,
- * and with special optimizations for common sizes.  Users should
- * not call this function directly, but should instead use
- * crypto_memneq defined in crypto/algapi.h.
- */
-noinline unsigned long __crypto_memneq(const void *a, const void *b,
-                                      size_t size)
-{
-       switch (size) {
-       case 16:
-               return __crypto_memneq_16(a, b);
-       default:
-               return __crypto_memneq_generic(a, b, size);
-       }
-}
-EXPORT_SYMBOL(__crypto_memneq);
-
-#endif /* __HAVE_ARCH_CRYPTO_MEMNEQ */
index 40e8164..9601fa9 100644 (file)
@@ -2010,16 +2010,16 @@ retry:
        return err_mask;
 }
 
-static bool ata_log_supported(struct ata_device *dev, u8 log)
+static int 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;
+               return 0;
 
        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;
+               return 0;
+       return get_unaligned_le16(&ap->sector_buf[log * 2]);
 }
 
 static bool ata_identify_page_supported(struct ata_device *dev, u8 page)
@@ -2455,15 +2455,20 @@ static void ata_dev_config_cpr(struct ata_device *dev)
        struct ata_cpr_log *cpr_log = NULL;
        u8 *desc, *buf = NULL;
 
-       if (ata_id_major_version(dev->id) < 11 ||
-           !ata_log_supported(dev, ATA_LOG_CONCURRENT_POSITIONING_RANGES))
+       if (ata_id_major_version(dev->id) < 11)
+               goto out;
+
+       buf_len = ata_log_supported(dev, ATA_LOG_CONCURRENT_POSITIONING_RANGES);
+       if (buf_len == 0)
                goto out;
 
        /*
         * Read the concurrent positioning ranges log (0x47). We can have at
-        * most 255 32B range descriptors plus a 64B header.
+        * most 255 32B range descriptors plus a 64B header. This log varies in
+        * size, so use the size reported in the GPL directory. Reading beyond
+        * the supported length will result in an error.
         */
-       buf_len = (64 + 255 * 32 + 511) & ~511;
+       buf_len <<= 9;
        buf = kzalloc(buf_len, GFP_KERNEL);
        if (!buf)
                goto out;
@@ -5462,7 +5467,7 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev,
                                      const struct ata_port_info * const * ppi,
                                      int n_ports)
 {
-       const struct ata_port_info *pi;
+       const struct ata_port_info *pi = &ata_dummy_port_info;
        struct ata_host *host;
        int i, j;
 
@@ -5470,7 +5475,7 @@ struct ata_host *ata_host_alloc_pinfo(struct device *dev,
        if (!host)
                return NULL;
 
-       for (i = 0, j = 0, pi = NULL; i < host->n_ports; i++) {
+       for (i = 0, j = 0; i < host->n_ports; i++) {
                struct ata_port *ap = host->ports[i];
 
                if (ppi[j])
index 42cecf9..86dbb1c 100644 (file)
@@ -2125,7 +2125,7 @@ static unsigned int ata_scsiop_inq_b9(struct ata_scsi_args *args, u8 *rbuf)
 
        /* SCSI Concurrent Positioning Ranges VPD page: SBC-5 rev 1 or later */
        rbuf[1] = 0xb9;
-       put_unaligned_be16(64 + (int)cpr_log->nr_cpr * 32 - 4, &rbuf[3]);
+       put_unaligned_be16(64 + (int)cpr_log->nr_cpr * 32 - 4, &rbuf[2]);
 
        for (i = 0; i < cpr_log->nr_cpr; i++, desc += 32) {
                desc[0] = cpr_log->cpr[i].num;
index ca12985..c380278 100644 (file)
@@ -196,7 +196,7 @@ static struct {
        { XFER_PIO_0,                   "XFER_PIO_0" },
        { XFER_PIO_SLOW,                "XFER_PIO_SLOW" }
 };
-ata_bitfield_name_match(xfer,ata_xfer_names)
+ata_bitfield_name_search(xfer, ata_xfer_names)
 
 /*
  * ATA Port attributes
index 6b5ed30..35608a0 100644 (file)
@@ -856,12 +856,14 @@ static int octeon_cf_probe(struct platform_device *pdev)
                                int i;
                                res_dma = platform_get_resource(dma_dev, IORESOURCE_MEM, 0);
                                if (!res_dma) {
+                                       put_device(&dma_dev->dev);
                                        of_node_put(dma_node);
                                        return -EINVAL;
                                }
                                cf_port->dma_base = (u64)devm_ioremap(&pdev->dev, res_dma->start,
                                                                         resource_size(res_dma));
                                if (!cf_port->dma_base) {
+                                       put_device(&dma_dev->dev);
                                        of_node_put(dma_node);
                                        return -EINVAL;
                                }
@@ -871,6 +873,7 @@ static int octeon_cf_probe(struct platform_device *pdev)
                                        irq = i;
                                        irq_handler = octeon_cf_interrupt;
                                }
+                               put_device(&dma_dev->dev);
                        }
                        of_node_put(dma_node);
                }
index 2ef23fc..a97776e 100644 (file)
@@ -564,6 +564,12 @@ ssize_t __weak cpu_show_srbds(struct device *dev,
        return sysfs_emit(buf, "Not affected\n");
 }
 
+ssize_t __weak cpu_show_mmio_stale_data(struct device *dev,
+                                       struct device_attribute *attr, char *buf)
+{
+       return sysfs_emit(buf, "Not affected\n");
+}
+
 static DEVICE_ATTR(meltdown, 0444, cpu_show_meltdown, NULL);
 static DEVICE_ATTR(spectre_v1, 0444, cpu_show_spectre_v1, NULL);
 static DEVICE_ATTR(spectre_v2, 0444, cpu_show_spectre_v2, NULL);
@@ -573,6 +579,7 @@ static DEVICE_ATTR(mds, 0444, cpu_show_mds, NULL);
 static DEVICE_ATTR(tsx_async_abort, 0444, cpu_show_tsx_async_abort, NULL);
 static DEVICE_ATTR(itlb_multihit, 0444, cpu_show_itlb_multihit, NULL);
 static DEVICE_ATTR(srbds, 0444, cpu_show_srbds, NULL);
+static DEVICE_ATTR(mmio_stale_data, 0444, cpu_show_mmio_stale_data, NULL);
 
 static struct attribute *cpu_root_vulnerabilities_attrs[] = {
        &dev_attr_meltdown.attr,
@@ -584,6 +591,7 @@ static struct attribute *cpu_root_vulnerabilities_attrs[] = {
        &dev_attr_tsx_async_abort.attr,
        &dev_attr_itlb_multihit.attr,
        &dev_attr_srbds.attr,
+       &dev_attr_mmio_stale_data.attr,
        NULL
 };
 
index d8d0fe6..397eb98 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/init.h>
 #include <linux/memory.h>
 #include <linux/of.h>
+#include <linux/backing-dev.h>
 
 #include "base.h"
 
@@ -20,6 +21,7 @@
 void __init driver_init(void)
 {
        /* These are the core pieces */
+       bdi_init(&noop_backing_dev_info);
        devtmpfs_init();
        devices_init();
        buses_init();
index 084d67f..bc60c9c 100644 (file)
@@ -558,7 +558,7 @@ static ssize_t hard_offline_page_store(struct device *dev,
        if (kstrtoull(buf, 0, &pfn) < 0)
                return -EINVAL;
        pfn >>= PAGE_SHIFT;
-       ret = memory_failure(pfn, 0);
+       ret = memory_failure(pfn, MF_SW_SIMULATED);
        if (ret == -EOPNOTSUPP)
                ret = 0;
        return ret ? ret : count;
index 400c741..a6db605 100644 (file)
@@ -252,6 +252,7 @@ static void regmap_irq_enable(struct irq_data *data)
        struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
        struct regmap *map = d->map;
        const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);
+       unsigned int reg = irq_data->reg_offset / map->reg_stride;
        unsigned int mask, type;
 
        type = irq_data->type.type_falling_val | irq_data->type.type_rising_val;
@@ -268,14 +269,14 @@ static void regmap_irq_enable(struct irq_data *data)
         * at the corresponding offset in regmap_irq_set_type().
         */
        if (d->chip->type_in_mask && type)
-               mask = d->type_buf[irq_data->reg_offset / map->reg_stride];
+               mask = d->type_buf[reg] & irq_data->mask;
        else
                mask = irq_data->mask;
 
        if (d->chip->clear_on_unmask)
                d->clear_status = true;
 
-       d->mask_buf[irq_data->reg_offset / map->reg_stride] &= ~mask;
+       d->mask_buf[reg] &= ~mask;
 }
 
 static void regmap_irq_disable(struct irq_data *data)
@@ -386,6 +387,7 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
                subreg = &chip->sub_reg_offsets[b];
                for (i = 0; i < subreg->num_regs; i++) {
                        unsigned int offset = subreg->offset[i];
+                       unsigned int index = offset / map->reg_stride;
 
                        if (chip->not_fixed_stride)
                                ret = regmap_read(map,
@@ -394,7 +396,7 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
                        else
                                ret = regmap_read(map,
                                                chip->status_base + offset,
-                                               &data->status_buf[offset]);
+                                               &data->status_buf[index]);
 
                        if (ret)
                                break;
index 2221d98..c3517cc 100644 (file)
@@ -1880,8 +1880,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
  */
 bool regmap_can_raw_write(struct regmap *map)
 {
-       return map->bus && map->bus->write && map->format.format_val &&
-               map->format.format_reg;
+       return map->write && map->format.format_val && map->format.format_reg;
 }
 EXPORT_SYMBOL_GPL(regmap_can_raw_write);
 
@@ -2155,10 +2154,9 @@ int regmap_noinc_write(struct regmap *map, unsigned int reg,
        size_t write_len;
        int ret;
 
-       if (!map->bus)
-               return -EINVAL;
-       if (!map->bus->write)
+       if (!map->write)
                return -ENOTSUPP;
+
        if (val_len % map->format.val_bytes)
                return -EINVAL;
        if (!IS_ALIGNED(reg, map->reg_stride))
@@ -2278,7 +2276,7 @@ int regmap_bulk_write(struct regmap *map, unsigned int reg, const void *val,
         * Some devices don't support bulk write, for them we have a series of
         * single write operations.
         */
-       if (!map->bus || !map->format.parse_inplace) {
+       if (!map->write || !map->format.parse_inplace) {
                map->lock(map->lock_arg);
                for (i = 0; i < val_count; i++) {
                        unsigned int ival;
@@ -2904,6 +2902,9 @@ int regmap_noinc_read(struct regmap *map, unsigned int reg,
        size_t read_len;
        int ret;
 
+       if (!map->read)
+               return -ENOTSUPP;
+
        if (val_len % map->format.val_bytes)
                return -EINVAL;
        if (!IS_ALIGNED(reg, map->reg_stride))
@@ -3017,7 +3018,7 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
        if (val_count == 0)
                return -EINVAL;
 
-       if (map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {
+       if (map->read && map->format.parse_inplace && (vol || map->cache_type == REGCACHE_NONE)) {
                ret = regmap_raw_read(map, reg, val, val_bytes * val_count);
                if (ret != 0)
                        return ret;
index a88ce44..33f04ef 100644 (file)
@@ -2114,9 +2114,11 @@ static void blkfront_closing(struct blkfront_info *info)
                return;
 
        /* No more blkif_request(). */
-       blk_mq_stop_hw_queues(info->rq);
-       blk_mark_disk_dead(info->gd);
-       set_capacity(info->gd, 0);
+       if (info->rq && info->gd) {
+               blk_mq_stop_hw_queues(info->rq);
+               blk_mark_disk_dead(info->gd);
+               set_capacity(info->gd, 0);
+       }
 
        for_each_rinfo(info, rinfo, i) {
                /* No more gnttab callback work. */
@@ -2457,16 +2459,19 @@ static int blkfront_remove(struct xenbus_device *xbdev)
 
        dev_dbg(&xbdev->dev, "%s removed", xbdev->nodename);
 
-       del_gendisk(info->gd);
+       if (info->gd)
+               del_gendisk(info->gd);
 
        mutex_lock(&blkfront_mutex);
        list_del(&info->info_list);
        mutex_unlock(&blkfront_mutex);
 
        blkif_free(info, 0);
-       xlbd_release_minors(info->gd->first_minor, info->gd->minors);
-       blk_cleanup_disk(info->gd);
-       blk_mq_free_tag_set(&info->tag_set);
+       if (info->gd) {
+               xlbd_release_minors(info->gd->first_minor, info->gd->minors);
+               blk_cleanup_disk(info->gd);
+               blk_mq_free_tag_set(&info->tag_set);
+       }
 
        kfree(info);
        return 0;
index b25ff94..63b1b4a 100644 (file)
@@ -175,10 +175,9 @@ static int bt1_apb_request_rst(struct bt1_apb *apb)
        int ret;
 
        apb->prst = devm_reset_control_get_optional_exclusive(apb->dev, "prst");
-       if (IS_ERR(apb->prst)) {
-               dev_warn(apb->dev, "Couldn't get reset control line\n");
-               return PTR_ERR(apb->prst);
-       }
+       if (IS_ERR(apb->prst))
+               return dev_err_probe(apb->dev, PTR_ERR(apb->prst),
+                                    "Couldn't get reset control line\n");
 
        ret = reset_control_deassert(apb->prst);
        if (ret)
@@ -199,10 +198,9 @@ static int bt1_apb_request_clk(struct bt1_apb *apb)
        int ret;
 
        apb->pclk = devm_clk_get(apb->dev, "pclk");
-       if (IS_ERR(apb->pclk)) {
-               dev_err(apb->dev, "Couldn't get APB clock descriptor\n");
-               return PTR_ERR(apb->pclk);
-       }
+       if (IS_ERR(apb->pclk))
+               return dev_err_probe(apb->dev, PTR_ERR(apb->pclk),
+                                    "Couldn't get APB clock descriptor\n");
 
        ret = clk_prepare_enable(apb->pclk);
        if (ret) {
index e7a6744..70e49a6 100644 (file)
@@ -135,10 +135,9 @@ static int bt1_axi_request_rst(struct bt1_axi *axi)
        int ret;
 
        axi->arst = devm_reset_control_get_optional_exclusive(axi->dev, "arst");
-       if (IS_ERR(axi->arst)) {
-               dev_warn(axi->dev, "Couldn't get reset control line\n");
-               return PTR_ERR(axi->arst);
-       }
+       if (IS_ERR(axi->arst))
+               return dev_err_probe(axi->dev, PTR_ERR(axi->arst),
+                                    "Couldn't get reset control line\n");
 
        ret = reset_control_deassert(axi->arst);
        if (ret)
@@ -159,10 +158,9 @@ static int bt1_axi_request_clk(struct bt1_axi *axi)
        int ret;
 
        axi->aclk = devm_clk_get(axi->dev, "aclk");
-       if (IS_ERR(axi->aclk)) {
-               dev_err(axi->dev, "Couldn't get AXI Interconnect clock\n");
-               return PTR_ERR(axi->aclk);
-       }
+       if (IS_ERR(axi->aclk))
+               return dev_err_probe(axi->dev, PTR_ERR(axi->aclk),
+                                    "Couldn't get AXI Interconnect clock\n");
 
        ret = clk_prepare_enable(axi->aclk);
        if (ret) {
index e81a970..6143dbf 100644 (file)
@@ -1239,14 +1239,14 @@ error_cleanup_mc_io:
 static int fsl_mc_bus_remove(struct platform_device *pdev)
 {
        struct fsl_mc *mc = platform_get_drvdata(pdev);
+       struct fsl_mc_io *mc_io;
 
        if (!fsl_mc_is_root_dprc(&mc->root_mc_bus_dev->dev))
                return -EINVAL;
 
+       mc_io = mc->root_mc_bus_dev->mc_io;
        fsl_mc_device_remove(mc->root_mc_bus_dev);
-
-       fsl_destroy_mc_io(mc->root_mc_bus_dev->mc_io);
-       mc->root_mc_bus_dev->mc_io = NULL;
+       fsl_destroy_mc_io(mc_io);
 
        bus_unregister_notifier(&fsl_mc_bus_type, &fsl_mc_nb);
 
index 69fd31f..0b6c036 100644 (file)
@@ -429,28 +429,40 @@ config ADI
          driver include crash and makedumpfile.
 
 config RANDOM_TRUST_CPU
-       bool "Trust the CPU manufacturer to initialize Linux's CRNG"
+       bool "Initialize RNG using CPU RNG instructions"
+       default y
        depends on ARCH_RANDOM
-       default n
        help
-       Assume that CPU manufacturer (e.g., Intel or AMD for RDSEED or
-       RDRAND, IBM for the S390 and Power PC architectures) is trustworthy
-       for the purposes of initializing Linux's CRNG.  Since this is not
-       something that can be independently audited, this amounts to trusting
-       that CPU manufacturer (perhaps with the insistence or mandate
-       of a Nation State's intelligence or law enforcement agencies)
-       has not installed a hidden back door to compromise the CPU's
-       random number generation facilities. This can also be configured
-       at boot with "random.trust_cpu=on/off".
+         Initialize the RNG using random numbers supplied by the CPU's
+         RNG instructions (e.g. RDRAND), if supported and available. These
+         random numbers are never used directly, but are rather hashed into
+         the main input pool, and this happens regardless of whether or not
+         this option is enabled. Instead, this option controls whether the
+         they are credited and hence can initialize the RNG. Additionally,
+         other sources of randomness are always used, regardless of this
+         setting.  Enabling this implies trusting that the CPU can supply high
+         quality and non-backdoored random numbers.
+
+         Say Y here unless you have reason to mistrust your CPU or believe
+         its RNG facilities may be faulty. This may also be configured at
+         boot time with "random.trust_cpu=on/off".
 
 config RANDOM_TRUST_BOOTLOADER
-       bool "Trust the bootloader to initialize Linux's CRNG"
-       help
-       Some bootloaders can provide entropy to increase the kernel's initial
-       device randomness. Say Y here to assume the entropy provided by the
-       booloader is trustworthy so it will be added to the kernel's entropy
-       pool. Otherwise, say N here so it will be regarded as device input that
-       only mixes the entropy pool. This can also be configured at boot with
-       "random.trust_bootloader=on/off".
+       bool "Initialize RNG using bootloader-supplied seed"
+       default y
+       help
+         Initialize the RNG using a seed supplied by the bootloader or boot
+         environment (e.g. EFI or a bootloader-generated device tree). This
+         seed is not used directly, but is rather hashed into the main input
+         pool, and this happens regardless of whether or not this option is
+         enabled. Instead, this option controls whether the seed is credited
+         and hence can initialize the RNG. Additionally, other sources of
+         randomness are always used, regardless of this setting. Enabling
+         this implies trusting that the bootloader can supply high quality and
+         non-backdoored seeds.
+
+         Say Y here unless you have reason to mistrust your bootloader or
+         believe its RNG facilities may be faulty. This may also be configured
+         at boot time with "random.trust_bootloader=on/off".
 
 endmenu
index e856df7..a6f3a8a 100644 (file)
@@ -159,6 +159,8 @@ static int probe_common(struct virtio_device *vdev)
                goto err_find;
        }
 
+       virtio_device_ready(vdev);
+
        /* we always have a pending entropy request */
        request_entropy(vi);
 
index 0e22e3b..38aad99 100644 (file)
@@ -1019,7 +1019,7 @@ static struct parport_driver lp_driver = {
 
 static int __init lp_init(void)
 {
-       int i, err = 0;
+       int i, err;
 
        if (parport_nr[0] == LP_PARPORT_OFF)
                return 0;
index b691b9d..e3dd1dd 100644 (file)
@@ -87,7 +87,7 @@ static struct fasync_struct *fasync;
 
 /* Control how we warn userspace. */
 static struct ratelimit_state urandom_warning =
-       RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3);
+       RATELIMIT_STATE_INIT_FLAGS("urandom_warning", HZ, 3, RATELIMIT_MSG_ON_RELEASE);
 static int ratelimit_disable __read_mostly =
        IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM);
 module_param_named(ratelimit_disable, ratelimit_disable, int, 0644);
@@ -408,7 +408,7 @@ static ssize_t get_random_bytes_user(struct iov_iter *iter)
 
        /*
         * Immediately overwrite the ChaCha key at index 4 with random
-        * bytes, in case userspace causes copy_to_user() below to sleep
+        * bytes, in case userspace causes copy_to_iter() below to sleep
         * forever, so that we still retain forward secrecy in that case.
         */
        crng_make_state(chacha_state, (u8 *)&chacha_state[4], CHACHA_KEY_SIZE);
@@ -650,7 +650,8 @@ static void __cold _credit_init_bits(size_t bits)
 
        if (orig < POOL_READY_BITS && new >= POOL_READY_BITS) {
                crng_reseed(); /* Sets crng_init to CRNG_READY under base_crng.lock. */
-               execute_in_process_context(crng_set_ready, &set_ready);
+               if (static_key_initialized)
+                       execute_in_process_context(crng_set_ready, &set_ready);
                wake_up_interruptible(&crng_init_wait);
                kill_fasync(&fasync, SIGIO, POLL_IN);
                pr_notice("crng init done\n");
@@ -724,9 +725,8 @@ static void __cold _credit_init_bits(size_t bits)
  *
  **********************************************************************/
 
-static bool used_arch_random;
-static bool trust_cpu __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU);
-static bool trust_bootloader __ro_after_init = IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER);
+static bool trust_cpu __initdata = IS_ENABLED(CONFIG_RANDOM_TRUST_CPU);
+static bool trust_bootloader __initdata = IS_ENABLED(CONFIG_RANDOM_TRUST_BOOTLOADER);
 static int __init parse_trust_cpu(char *arg)
 {
        return kstrtobool(arg, &trust_cpu);
@@ -776,7 +776,7 @@ static struct notifier_block pm_notifier = { .notifier_call = random_pm_notifica
 int __init random_init(const char *command_line)
 {
        ktime_t now = ktime_get_real();
-       unsigned int i, arch_bytes;
+       unsigned int i, arch_bits;
        unsigned long entropy;
 
 #if defined(LATENT_ENTROPY_PLUGIN)
@@ -784,12 +784,12 @@ int __init random_init(const char *command_line)
        _mix_pool_bytes(compiletime_seed, sizeof(compiletime_seed));
 #endif
 
-       for (i = 0, arch_bytes = BLAKE2S_BLOCK_SIZE;
+       for (i = 0, arch_bits = BLAKE2S_BLOCK_SIZE * 8;
             i < BLAKE2S_BLOCK_SIZE; i += sizeof(entropy)) {
                if (!arch_get_random_seed_long_early(&entropy) &&
                    !arch_get_random_long_early(&entropy)) {
                        entropy = random_get_entropy();
-                       arch_bytes -= sizeof(entropy);
+                       arch_bits -= sizeof(entropy) * 8;
                }
                _mix_pool_bytes(&entropy, sizeof(entropy));
        }
@@ -798,11 +798,18 @@ int __init random_init(const char *command_line)
        _mix_pool_bytes(command_line, strlen(command_line));
        add_latent_entropy();
 
+       /*
+        * If we were initialized by the bootloader before jump labels are
+        * initialized, then we should enable the static branch here, where
+        * it's guaranteed that jump labels have been initialized.
+        */
+       if (!static_branch_likely(&crng_is_ready) && crng_init >= CRNG_READY)
+               crng_set_ready(NULL);
+
        if (crng_ready())
                crng_reseed();
        else if (trust_cpu)
-               credit_init_bits(arch_bytes * 8);
-       used_arch_random = arch_bytes * 8 >= POOL_READY_BITS;
+               _credit_init_bits(arch_bits);
 
        WARN_ON(register_pm_notifier(&pm_notifier));
 
@@ -811,17 +818,6 @@ int __init random_init(const char *command_line)
        return 0;
 }
 
-/*
- * Returns whether arch randomness has been mixed into the initial
- * state of the RNG, regardless of whether or not that randomness
- * was credited. Knowing this is only good for a very limited set
- * of uses, such as early init printk pointer obfuscation.
- */
-bool rng_has_arch_random(void)
-{
-       return used_arch_random;
-}
-
 /*
  * Add device- or boot-specific data to the input pool to help
  * initialize it.
@@ -865,13 +861,12 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);
  * Handle random seed passed by bootloader, and credit it if
  * CONFIG_RANDOM_TRUST_BOOTLOADER is set.
  */
-void __cold add_bootloader_randomness(const void *buf, size_t len)
+void __init add_bootloader_randomness(const void *buf, size_t len)
 {
        mix_pool_bytes(buf, len);
        if (trust_bootloader)
                credit_init_bits(len * 8);
 }
-EXPORT_SYMBOL_GPL(add_bootloader_randomness);
 
 #if IS_ENABLED(CONFIG_VMGENID)
 static BLOCKING_NOTIFIER_HEAD(vmfork_chain);
@@ -1014,7 +1009,7 @@ void add_interrupt_randomness(int irq)
        if (new_count & MIX_INFLIGHT)
                return;
 
-       if (new_count < 64 && !time_is_before_jiffies(fast_pool->last + HZ))
+       if (new_count < 1024 && !time_is_before_jiffies(fast_pool->last + HZ))
                return;
 
        if (unlikely(!fast_pool->mix.func))
index ff188ab..bb47610 100644 (file)
@@ -565,4 +565,3 @@ void __init hv_init_clocksource(void)
        hv_sched_clock_offset = hv_read_reference_counter();
        hv_setup_sched_clock(read_hv_sched_clock_msr);
 }
-EXPORT_SYMBOL_GPL(hv_init_clocksource);
index 46023ad..4536ed4 100644 (file)
@@ -684,7 +684,7 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev)
        if (!devpriv->usb_rx_buf)
                return -ENOMEM;
 
-       size = max(usb_endpoint_maxp(devpriv->ep_rx), MIN_BUF_SIZE);
+       size = max(usb_endpoint_maxp(devpriv->ep_tx), MIN_BUF_SIZE);
        devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL);
        if (!devpriv->usb_tx_buf)
                return -ENOMEM;
index e733068..9631f2f 100644 (file)
@@ -32,8 +32,11 @@ static vm_fault_t udmabuf_vm_fault(struct vm_fault *vmf)
 {
        struct vm_area_struct *vma = vmf->vma;
        struct udmabuf *ubuf = vma->vm_private_data;
+       pgoff_t pgoff = vmf->pgoff;
 
-       vmf->page = ubuf->pages[vmf->pgoff];
+       if (pgoff >= ubuf->pagecount)
+               return VM_FAULT_SIGBUS;
+       vmf->page = ubuf->pages[pgoff];
        get_page(vmf->page);
        return 0;
 }
index c9fe590..9c89f7d 100644 (file)
@@ -1211,7 +1211,7 @@ static int ioctl_get_cycle_timer2(struct client *client, union ioctl_arg *arg)
        struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2;
        struct fw_card *card = client->device->card;
        struct timespec64 ts = {0, 0};
-       u32 cycle_time;
+       u32 cycle_time = 0;
        int ret = 0;
 
        local_irq_disable();
index 90ed8fd..adddd8c 100644 (file)
@@ -372,8 +372,7 @@ static ssize_t rom_index_show(struct device *dev,
        struct fw_device *device = fw_device(dev->parent);
        struct fw_unit *unit = fw_unit(dev);
 
-       return snprintf(buf, PAGE_SIZE, "%d\n",
-                       (int)(unit->directory - device->config_rom));
+       return sysfs_emit(buf, "%td\n", unit->directory - device->config_rom);
 }
 
 static struct device_attribute fw_unit_attributes[] = {
@@ -403,8 +402,7 @@ static ssize_t guid_show(struct device *dev,
        int ret;
 
        down_read(&fw_device_rwsem);
-       ret = snprintf(buf, PAGE_SIZE, "0x%08x%08x\n",
-                      device->config_rom[3], device->config_rom[4]);
+       ret = sysfs_emit(buf, "0x%08x%08x\n", device->config_rom[3], device->config_rom[4]);
        up_read(&fw_device_rwsem);
 
        return ret;
index 20fba73..a52f084 100644 (file)
@@ -36,7 +36,7 @@ struct scmi_msg_resp_base_attributes {
 
 struct scmi_msg_resp_base_discover_agent {
        __le32 agent_id;
-       u8 name[SCMI_MAX_STR_SIZE];
+       u8 name[SCMI_SHORT_NAME_MAX_SIZE];
 };
 
 
@@ -119,7 +119,7 @@ scmi_base_vendor_id_get(const struct scmi_protocol_handle *ph, bool sub_vendor)
 
        ret = ph->xops->do_xfer(ph, t);
        if (!ret)
-               memcpy(vendor_id, t->rx.buf, size);
+               strscpy(vendor_id, t->rx.buf, size);
 
        ph->xops->xfer_put(ph, t);
 
@@ -221,11 +221,17 @@ scmi_base_implementation_list_get(const struct scmi_protocol_handle *ph,
                calc_list_sz = (1 + (loop_num_ret - 1) / sizeof(u32)) *
                                sizeof(u32);
                if (calc_list_sz != real_list_sz) {
-                       dev_err(dev,
-                               "Malformed reply - real_sz:%zd  calc_sz:%u\n",
-                               real_list_sz, calc_list_sz);
-                       ret = -EPROTO;
-                       break;
+                       dev_warn(dev,
+                                "Malformed reply - real_sz:%zd  calc_sz:%u  (loop_num_ret:%d)\n",
+                                real_list_sz, calc_list_sz, loop_num_ret);
+                       /*
+                        * Bail out if the expected list size is bigger than the
+                        * total payload size of the received reply.
+                        */
+                       if (calc_list_sz > real_list_sz) {
+                               ret = -EPROTO;
+                               break;
+                       }
                }
 
                for (loop = 0; loop < loop_num_ret; loop++)
@@ -270,7 +276,7 @@ static int scmi_base_discover_agent_get(const struct scmi_protocol_handle *ph,
        ret = ph->xops->do_xfer(ph, t);
        if (!ret) {
                agent_info = t->rx.buf;
-               strlcpy(name, agent_info->name, SCMI_MAX_STR_SIZE);
+               strscpy(name, agent_info->name, SCMI_SHORT_NAME_MAX_SIZE);
        }
 
        ph->xops->xfer_put(ph, t);
@@ -369,7 +375,7 @@ static int scmi_base_protocol_init(const struct scmi_protocol_handle *ph)
        int id, ret;
        u8 *prot_imp;
        u32 version;
-       char name[SCMI_MAX_STR_SIZE];
+       char name[SCMI_SHORT_NAME_MAX_SIZE];
        struct device *dev = ph->dev;
        struct scmi_revision_info *rev = scmi_revision_area_get(ph);
 
index 4d36a9a..c7a83f6 100644 (file)
@@ -153,7 +153,7 @@ static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
        if (!ret) {
                u32 latency = 0;
                attributes = le32_to_cpu(attr->attributes);
-               strlcpy(clk->name, attr->name, SCMI_MAX_STR_SIZE);
+               strscpy(clk->name, attr->name, SCMI_SHORT_NAME_MAX_SIZE);
                /* clock_enable_latency field is present only since SCMI v3.1 */
                if (PROTOCOL_REV_MAJOR(version) >= 0x2)
                        latency = le32_to_cpu(attr->clock_enable_latency);
@@ -266,9 +266,7 @@ scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
                              struct scmi_clock_info *clk)
 {
        int ret;
-
        void *iter;
-       struct scmi_msg_clock_describe_rates *msg;
        struct scmi_iterator_ops ops = {
                .prepare_message = iter_clk_describe_prepare_message,
                .update_state = iter_clk_describe_update_state,
@@ -281,7 +279,8 @@ scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
 
        iter = ph->hops->iter_response_init(ph, &ops, SCMI_MAX_NUM_RATES,
                                            CLOCK_DESCRIBE_RATES,
-                                           sizeof(*msg), &cpriv);
+                                           sizeof(struct scmi_msg_clock_describe_rates),
+                                           &cpriv);
        if (IS_ERR(iter))
                return PTR_ERR(iter);
 
index 8f4051a..bbb0331 100644 (file)
@@ -252,7 +252,7 @@ scmi_perf_domain_attributes_get(const struct scmi_protocol_handle *ph,
                        dom_info->mult_factor =
                                        (dom_info->sustained_freq_khz * 1000) /
                                        dom_info->sustained_perf_level;
-               strlcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
+               strscpy(dom_info->name, attr->name, SCMI_SHORT_NAME_MAX_SIZE);
        }
 
        ph->xops->xfer_put(ph, t);
@@ -332,7 +332,6 @@ scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph, u32 domain,
 {
        int ret;
        void *iter;
-       struct scmi_msg_perf_describe_levels *msg;
        struct scmi_iterator_ops ops = {
                .prepare_message = iter_perf_levels_prepare_message,
                .update_state = iter_perf_levels_update_state,
@@ -345,7 +344,8 @@ scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph, u32 domain,
 
        iter = ph->hops->iter_response_init(ph, &ops, MAX_OPPS,
                                            PERF_DESCRIBE_LEVELS,
-                                           sizeof(*msg), &ppriv);
+                                           sizeof(struct scmi_msg_perf_describe_levels),
+                                           &ppriv);
        if (IS_ERR(iter))
                return PTR_ERR(iter);
 
index 964882c..356e836 100644 (file)
@@ -122,7 +122,7 @@ scmi_power_domain_attributes_get(const struct scmi_protocol_handle *ph,
                dom_info->state_set_notify = SUPPORTS_STATE_SET_NOTIFY(flags);
                dom_info->state_set_async = SUPPORTS_STATE_SET_ASYNC(flags);
                dom_info->state_set_sync = SUPPORTS_STATE_SET_SYNC(flags);
-               strlcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
+               strscpy(dom_info->name, attr->name, SCMI_SHORT_NAME_MAX_SIZE);
        }
        ph->xops->xfer_put(ph, t);
 
index 73304af..c679f3f 100644 (file)
@@ -24,8 +24,6 @@
 
 #include <asm/unaligned.h>
 
-#define SCMI_SHORT_NAME_MAX_SIZE       16
-
 #define PROTOCOL_REV_MINOR_MASK        GENMASK(15, 0)
 #define PROTOCOL_REV_MAJOR_MASK        GENMASK(31, 16)
 #define PROTOCOL_REV_MAJOR(x)  ((u16)(FIELD_GET(PROTOCOL_REV_MAJOR_MASK, (x))))
index a420a91..673f3eb 100644 (file)
@@ -116,7 +116,7 @@ scmi_reset_domain_attributes_get(const struct scmi_protocol_handle *ph,
                dom_info->latency_us = le32_to_cpu(attr->latency);
                if (dom_info->latency_us == U32_MAX)
                        dom_info->latency_us = 0;
-               strlcpy(dom_info->name, attr->name, SCMI_MAX_STR_SIZE);
+               strscpy(dom_info->name, attr->name, SCMI_SHORT_NAME_MAX_SIZE);
        }
 
        ph->xops->xfer_put(ph, t);
index 21e0ce8..7288c61 100644 (file)
@@ -338,7 +338,6 @@ static int scmi_sensor_update_intervals(const struct scmi_protocol_handle *ph,
                                        struct scmi_sensor_info *s)
 {
        void *iter;
-       struct scmi_msg_sensor_list_update_intervals *msg;
        struct scmi_iterator_ops ops = {
                .prepare_message = iter_intervals_prepare_message,
                .update_state = iter_intervals_update_state,
@@ -351,22 +350,28 @@ static int scmi_sensor_update_intervals(const struct scmi_protocol_handle *ph,
 
        iter = ph->hops->iter_response_init(ph, &ops, s->intervals.count,
                                            SENSOR_LIST_UPDATE_INTERVALS,
-                                           sizeof(*msg), &upriv);
+                                           sizeof(struct scmi_msg_sensor_list_update_intervals),
+                                           &upriv);
        if (IS_ERR(iter))
                return PTR_ERR(iter);
 
        return ph->hops->iter_response_run(iter);
 }
 
+struct scmi_apriv {
+       bool any_axes_support_extended_names;
+       struct scmi_sensor_info *s;
+};
+
 static void iter_axes_desc_prepare_message(void *message,
                                           const unsigned int desc_index,
                                           const void *priv)
 {
        struct scmi_msg_sensor_axis_description_get *msg = message;
-       const struct scmi_sensor_info *s = priv;
+       const struct scmi_apriv *apriv = priv;
 
        /* Set the number of sensors to be skipped/already read */
-       msg->id = cpu_to_le32(s->id);
+       msg->id = cpu_to_le32(apriv->s->id);
        msg->axis_desc_index = cpu_to_le32(desc_index);
 }
 
@@ -393,19 +398,21 @@ iter_axes_desc_process_response(const struct scmi_protocol_handle *ph,
        u32 attrh, attrl;
        struct scmi_sensor_axis_info *a;
        size_t dsize = SCMI_MSG_RESP_AXIS_DESCR_BASE_SZ;
-       struct scmi_sensor_info *s = priv;
+       struct scmi_apriv *apriv = priv;
        const struct scmi_axis_descriptor *adesc = st->priv;
 
        attrl = le32_to_cpu(adesc->attributes_low);
+       if (SUPPORTS_EXTENDED_AXIS_NAMES(attrl))
+               apriv->any_axes_support_extended_names = true;
 
-       a = &s->axis[st->desc_index + st->loop_idx];
+       a = &apriv->s->axis[st->desc_index + st->loop_idx];
        a->id = le32_to_cpu(adesc->id);
        a->extended_attrs = SUPPORTS_EXTEND_ATTRS(attrl);
 
        attrh = le32_to_cpu(adesc->attributes_high);
        a->scale = S32_EXT(SENSOR_SCALE(attrh));
        a->type = SENSOR_TYPE(attrh);
-       strscpy(a->name, adesc->name, SCMI_MAX_STR_SIZE);
+       strscpy(a->name, adesc->name, SCMI_SHORT_NAME_MAX_SIZE);
 
        if (a->extended_attrs) {
                unsigned int ares = le32_to_cpu(adesc->resolution);
@@ -444,10 +451,19 @@ iter_axes_extended_name_process_response(const struct scmi_protocol_handle *ph,
                                         void *priv)
 {
        struct scmi_sensor_axis_info *a;
-       const struct scmi_sensor_info *s = priv;
+       const struct scmi_apriv *apriv = priv;
        struct scmi_sensor_axis_name_descriptor *adesc = st->priv;
+       u32 axis_id = le32_to_cpu(adesc->axis_id);
 
-       a = &s->axis[st->desc_index + st->loop_idx];
+       if (axis_id >= st->max_resources)
+               return -EPROTO;
+
+       /*
+        * Pick the corresponding descriptor based on the axis_id embedded
+        * in the reply since the list of axes supporting extended names
+        * can be a subset of all the axes.
+        */
+       a = &apriv->s->axis[axis_id];
        strscpy(a->name, adesc->name, SCMI_MAX_STR_SIZE);
        st->priv = ++adesc;
 
@@ -458,21 +474,36 @@ static int
 scmi_sensor_axis_extended_names_get(const struct scmi_protocol_handle *ph,
                                    struct scmi_sensor_info *s)
 {
+       int ret;
        void *iter;
-       struct scmi_msg_sensor_axis_description_get *msg;
        struct scmi_iterator_ops ops = {
                .prepare_message = iter_axes_desc_prepare_message,
                .update_state = iter_axes_extended_name_update_state,
                .process_response = iter_axes_extended_name_process_response,
        };
+       struct scmi_apriv apriv = {
+               .any_axes_support_extended_names = false,
+               .s = s,
+       };
 
        iter = ph->hops->iter_response_init(ph, &ops, s->num_axis,
                                            SENSOR_AXIS_NAME_GET,
-                                           sizeof(*msg), s);
+                                           sizeof(struct scmi_msg_sensor_axis_description_get),
+                                           &apriv);
        if (IS_ERR(iter))
                return PTR_ERR(iter);
 
-       return ph->hops->iter_response_run(iter);
+       /*
+        * Do not cause whole protocol initialization failure when failing to
+        * get extended names for axes.
+        */
+       ret = ph->hops->iter_response_run(iter);
+       if (ret)
+               dev_warn(ph->dev,
+                        "Failed to get axes extended names for %s (ret:%d).\n",
+                        s->name, ret);
+
+       return 0;
 }
 
 static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph,
@@ -481,12 +512,15 @@ static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph,
 {
        int ret;
        void *iter;
-       struct scmi_msg_sensor_axis_description_get *msg;
        struct scmi_iterator_ops ops = {
                .prepare_message = iter_axes_desc_prepare_message,
                .update_state = iter_axes_desc_update_state,
                .process_response = iter_axes_desc_process_response,
        };
+       struct scmi_apriv apriv = {
+               .any_axes_support_extended_names = false,
+               .s = s,
+       };
 
        s->axis = devm_kcalloc(ph->dev, s->num_axis,
                               sizeof(*s->axis), GFP_KERNEL);
@@ -495,7 +529,8 @@ static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph,
 
        iter = ph->hops->iter_response_init(ph, &ops, s->num_axis,
                                            SENSOR_AXIS_DESCRIPTION_GET,
-                                           sizeof(*msg), s);
+                                           sizeof(struct scmi_msg_sensor_axis_description_get),
+                                           &apriv);
        if (IS_ERR(iter))
                return PTR_ERR(iter);
 
@@ -503,7 +538,8 @@ static int scmi_sensor_axis_description(const struct scmi_protocol_handle *ph,
        if (ret)
                return ret;
 
-       if (PROTOCOL_REV_MAJOR(version) >= 0x3)
+       if (PROTOCOL_REV_MAJOR(version) >= 0x3 &&
+           apriv.any_axes_support_extended_names)
                ret = scmi_sensor_axis_extended_names_get(ph, s);
 
        return ret;
@@ -598,7 +634,7 @@ iter_sens_descr_process_response(const struct scmi_protocol_handle *ph,
                            SUPPORTS_AXIS(attrh) ?
                            SENSOR_AXIS_NUMBER(attrh) : 0,
                            SCMI_MAX_NUM_SENSOR_AXIS);
-       strscpy(s->name, sdesc->name, SCMI_MAX_STR_SIZE);
+       strscpy(s->name, sdesc->name, SCMI_SHORT_NAME_MAX_SIZE);
 
        /*
         * If supported overwrite short name with the extended
index 9d195d8..eaa8d94 100644 (file)
@@ -180,7 +180,6 @@ static int scmi_voltage_levels_get(const struct scmi_protocol_handle *ph,
 {
        int ret;
        void *iter;
-       struct scmi_msg_cmd_describe_levels *msg;
        struct scmi_iterator_ops ops = {
                .prepare_message = iter_volt_levels_prepare_message,
                .update_state = iter_volt_levels_update_state,
@@ -193,7 +192,8 @@ static int scmi_voltage_levels_get(const struct scmi_protocol_handle *ph,
 
        iter = ph->hops->iter_response_init(ph, &ops, v->num_levels,
                                            VOLTAGE_DESCRIBE_LEVELS,
-                                           sizeof(*msg), &vpriv);
+                                           sizeof(struct scmi_msg_cmd_describe_levels),
+                                           &vpriv);
        if (IS_ERR(iter))
                return PTR_ERR(iter);
 
@@ -225,15 +225,14 @@ static int scmi_voltage_descriptors_get(const struct scmi_protocol_handle *ph,
 
                /* Retrieve domain attributes at first ... */
                put_unaligned_le32(dom, td->tx.buf);
-               ret = ph->xops->do_xfer(ph, td);
                /* Skip domain on comms error */
-               if (ret)
+               if (ph->xops->do_xfer(ph, td))
                        continue;
 
                v = vinfo->domains + dom;
                v->id = dom;
                attributes = le32_to_cpu(resp_dom->attr);
-               strlcpy(v->name, resp_dom->name, SCMI_MAX_STR_SIZE);
+               strscpy(v->name, resp_dom->name, SCMI_SHORT_NAME_MAX_SIZE);
 
                /*
                 * If supported overwrite short name with the extended one;
@@ -249,12 +248,8 @@ static int scmi_voltage_descriptors_get(const struct scmi_protocol_handle *ph,
                                v->async_level_set = true;
                }
 
-               ret = scmi_voltage_levels_get(ph, v);
                /* Skip invalid voltage descriptors */
-               if (ret)
-                       continue;
-
-               ph->xops->reset_rx_to_maxsz(ph, td);
+               scmi_voltage_levels_get(ph, v);
        }
 
        ph->xops->xfer_put(ph, td);
index 4c7c9dd..7882d4b 100644 (file)
@@ -26,8 +26,6 @@
 #include <linux/sysfb.h>
 #include <video/vga.h>
 
-#include <asm/efi.h>
-
 enum {
        OVERRIDE_NONE = 0x0,
        OVERRIDE_BASE = 0x1,
index b55c74a..1ee62cd 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/seq_file.h>
+#include <linux/types.h>
 
 #define CRYSTALCOVE_GPIO_NUM   16
 #define CRYSTALCOVE_VGPIO_NUM  95
@@ -110,8 +111,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
        return reg + gpio % 8;
 }
 
-static void crystalcove_update_irq_mask(struct crystalcove_gpio *cg,
-                                       int gpio)
+static void crystalcove_update_irq_mask(struct crystalcove_gpio *cg, int gpio)
 {
        u8 mirqs0 = gpio < 8 ? MGPIO0IRQS0 : MGPIO1IRQS0;
        int mask = BIT(gpio % 8);
@@ -140,8 +140,7 @@ static int crystalcove_gpio_dir_in(struct gpio_chip *chip, unsigned int gpio)
        return regmap_write(cg->regmap, reg, CTLO_INPUT_SET);
 }
 
-static int crystalcove_gpio_dir_out(struct gpio_chip *chip, unsigned int gpio,
-                                   int value)
+static int crystalcove_gpio_dir_out(struct gpio_chip *chip, unsigned int gpio, int value)
 {
        struct crystalcove_gpio *cg = gpiochip_get_data(chip);
        int reg = to_reg(gpio, CTRL_OUT);
@@ -168,8 +167,7 @@ static int crystalcove_gpio_get(struct gpio_chip *chip, unsigned int gpio)
        return val & 0x1;
 }
 
-static void crystalcove_gpio_set(struct gpio_chip *chip,
-                                unsigned int gpio, int value)
+static void crystalcove_gpio_set(struct gpio_chip *chip, unsigned int gpio, int value)
 {
        struct crystalcove_gpio *cg = gpiochip_get_data(chip);
        int reg = to_reg(gpio, CTRL_OUT);
@@ -185,10 +183,10 @@ static void crystalcove_gpio_set(struct gpio_chip *chip,
 
 static int crystalcove_irq_type(struct irq_data *data, unsigned int type)
 {
-       struct crystalcove_gpio *cg =
-               gpiochip_get_data(irq_data_get_irq_chip_data(data));
+       struct crystalcove_gpio *cg = gpiochip_get_data(irq_data_get_irq_chip_data(data));
+       irq_hw_number_t hwirq = irqd_to_hwirq(data);
 
-       if (data->hwirq >= CRYSTALCOVE_GPIO_NUM)
+       if (hwirq >= CRYSTALCOVE_GPIO_NUM)
                return 0;
 
        switch (type) {
@@ -215,22 +213,20 @@ static int crystalcove_irq_type(struct irq_data *data, unsigned int type)
 
 static void crystalcove_bus_lock(struct irq_data *data)
 {
-       struct crystalcove_gpio *cg =
-               gpiochip_get_data(irq_data_get_irq_chip_data(data));
+       struct crystalcove_gpio *cg = gpiochip_get_data(irq_data_get_irq_chip_data(data));
 
        mutex_lock(&cg->buslock);
 }
 
 static void crystalcove_bus_sync_unlock(struct irq_data *data)
 {
-       struct crystalcove_gpio *cg =
-               gpiochip_get_data(irq_data_get_irq_chip_data(data));
-       int gpio = data->hwirq;
+       struct crystalcove_gpio *cg = gpiochip_get_data(irq_data_get_irq_chip_data(data));
+       irq_hw_number_t hwirq = irqd_to_hwirq(data);
 
        if (cg->update & UPDATE_IRQ_TYPE)
-               crystalcove_update_irq_ctrl(cg, gpio);
+               crystalcove_update_irq_ctrl(cg, hwirq);
        if (cg->update & UPDATE_IRQ_MASK)
-               crystalcove_update_irq_mask(cg, gpio);
+               crystalcove_update_irq_mask(cg, hwirq);
        cg->update = 0;
 
        mutex_unlock(&cg->buslock);
@@ -238,34 +234,43 @@ static void crystalcove_bus_sync_unlock(struct irq_data *data)
 
 static void crystalcove_irq_unmask(struct irq_data *data)
 {
-       struct crystalcove_gpio *cg =
-               gpiochip_get_data(irq_data_get_irq_chip_data(data));
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
+       struct crystalcove_gpio *cg = gpiochip_get_data(gc);
+       irq_hw_number_t hwirq = irqd_to_hwirq(data);
 
-       if (data->hwirq < CRYSTALCOVE_GPIO_NUM) {
-               cg->set_irq_mask = false;
-               cg->update |= UPDATE_IRQ_MASK;
-       }
+       if (hwirq >= CRYSTALCOVE_GPIO_NUM)
+               return;
+
+       gpiochip_enable_irq(gc, hwirq);
+
+       cg->set_irq_mask = false;
+       cg->update |= UPDATE_IRQ_MASK;
 }
 
 static void crystalcove_irq_mask(struct irq_data *data)
 {
-       struct crystalcove_gpio *cg =
-               gpiochip_get_data(irq_data_get_irq_chip_data(data));
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
+       struct crystalcove_gpio *cg = gpiochip_get_data(gc);
+       irq_hw_number_t hwirq = irqd_to_hwirq(data);
 
-       if (data->hwirq < CRYSTALCOVE_GPIO_NUM) {
-               cg->set_irq_mask = true;
-               cg->update |= UPDATE_IRQ_MASK;
-       }
+       if (hwirq >= CRYSTALCOVE_GPIO_NUM)
+               return;
+
+       cg->set_irq_mask = true;
+       cg->update |= UPDATE_IRQ_MASK;
+
+       gpiochip_disable_irq(gc, hwirq);
 }
 
-static struct irq_chip crystalcove_irqchip = {
+static const struct irq_chip crystalcove_irqchip = {
        .name                   = "Crystal Cove",
        .irq_mask               = crystalcove_irq_mask,
        .irq_unmask             = crystalcove_irq_unmask,
        .irq_set_type           = crystalcove_irq_type,
        .irq_bus_lock           = crystalcove_bus_lock,
        .irq_bus_sync_unlock    = crystalcove_bus_sync_unlock,
-       .flags                  = IRQCHIP_SKIP_SET_WAKE,
+       .flags                  = IRQCHIP_SKIP_SET_WAKE | IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data)
@@ -293,8 +298,7 @@ static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data)
        return IRQ_HANDLED;
 }
 
-static void crystalcove_gpio_dbg_show(struct seq_file *s,
-                                     struct gpio_chip *chip)
+static void crystalcove_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 {
        struct crystalcove_gpio *cg = gpiochip_get_data(chip);
        int gpio, offset;
@@ -353,7 +357,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
        cg->regmap = pmic->regmap;
 
        girq = &cg->chip.irq;
-       girq->chip = &crystalcove_irqchip;
+       gpio_irq_chip_set_chip(girq, &crystalcove_irqchip);
        /* This will let us handle the parent IRQ in the driver */
        girq->parent_handler = NULL;
        girq->num_parents = 0;
index 08b9e2c..71fa437 100644 (file)
@@ -46,7 +46,6 @@
 struct dln2_gpio {
        struct platform_device *pdev;
        struct gpio_chip gpio;
-       struct irq_chip irqchip;
 
        /*
         * Cache pin direction to save us one transfer, since the hardware has
@@ -306,6 +305,7 @@ static void dln2_irq_unmask(struct irq_data *irqd)
        struct dln2_gpio *dln2 = gpiochip_get_data(gc);
        int pin = irqd_to_hwirq(irqd);
 
+       gpiochip_enable_irq(gc, pin);
        set_bit(pin, dln2->unmasked_irqs);
 }
 
@@ -316,6 +316,7 @@ static void dln2_irq_mask(struct irq_data *irqd)
        int pin = irqd_to_hwirq(irqd);
 
        clear_bit(pin, dln2->unmasked_irqs);
+       gpiochip_disable_irq(gc, pin);
 }
 
 static int dln2_irq_set_type(struct irq_data *irqd, unsigned type)
@@ -384,6 +385,17 @@ static void dln2_irq_bus_unlock(struct irq_data *irqd)
        mutex_unlock(&dln2->irq_lock);
 }
 
+static const struct irq_chip dln2_irqchip = {
+       .name = "dln2-irq",
+       .irq_mask = dln2_irq_mask,
+       .irq_unmask = dln2_irq_unmask,
+       .irq_set_type = dln2_irq_set_type,
+       .irq_bus_lock = dln2_irq_bus_lock,
+       .irq_bus_sync_unlock = dln2_irq_bus_unlock,
+       .flags = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
+};
+
 static void dln2_gpio_event(struct platform_device *pdev, u16 echo,
                            const void *data, int len)
 {
@@ -465,15 +477,8 @@ static int dln2_gpio_probe(struct platform_device *pdev)
        dln2->gpio.direction_output = dln2_gpio_direction_output;
        dln2->gpio.set_config = dln2_gpio_set_config;
 
-       dln2->irqchip.name = "dln2-irq",
-       dln2->irqchip.irq_mask = dln2_irq_mask,
-       dln2->irqchip.irq_unmask = dln2_irq_unmask,
-       dln2->irqchip.irq_set_type = dln2_irq_set_type,
-       dln2->irqchip.irq_bus_lock = dln2_irq_bus_lock,
-       dln2->irqchip.irq_bus_sync_unlock = dln2_irq_bus_unlock,
-
        girq = &dln2->gpio.irq;
-       girq->chip = &dln2->irqchip;
+       gpio_irq_chip_set_chip(girq, &dln2_irqchip);
        /* The event comes from the outside so no parent handler */
        girq->parent_handler = NULL;
        girq->num_parents = 0;
index 04afe72..c22fcaa 100644 (file)
@@ -662,10 +662,9 @@ static int dwapb_get_clks(struct dwapb_gpio *gpio)
        gpio->clks[1].id = "db";
        err = devm_clk_bulk_get_optional(gpio->dev, DWAPB_NR_CLOCKS,
                                         gpio->clks);
-       if (err) {
-               dev_err(gpio->dev, "Cannot get APB/Debounce clocks\n");
-               return err;
-       }
+       if (err)
+               return dev_err_probe(gpio->dev, err,
+                                    "Cannot get APB/Debounce clocks\n");
 
        err = clk_bulk_prepare_enable(DWAPB_NR_CLOCKS, gpio->clks);
        if (err) {
index df56361..bea0e32 100644 (file)
@@ -434,25 +434,13 @@ static int grgpio_probe(struct platform_device *ofdev)
 static int grgpio_remove(struct platform_device *ofdev)
 {
        struct grgpio_priv *priv = platform_get_drvdata(ofdev);
-       int i;
-       int ret = 0;
-
-       if (priv->domain) {
-               for (i = 0; i < GRGPIO_MAX_NGPIO; i++) {
-                       if (priv->uirqs[i].refcnt != 0) {
-                               ret = -EBUSY;
-                               goto out;
-                       }
-               }
-       }
 
        gpiochip_remove(&priv->gc);
 
        if (priv->domain)
                irq_domain_remove(priv->domain);
 
-out:
-       return ret;
+       return 0;
 }
 
 static const struct of_device_id grgpio_match[] = {
index f3d1bae..72ac09a 100644 (file)
@@ -220,10 +220,8 @@ static void mrfld_irq_ack(struct irq_data *d)
        raw_spin_unlock_irqrestore(&priv->lock, flags);
 }
 
-static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask)
+static void mrfld_irq_unmask_mask(struct mrfld_gpio *priv, u32 gpio, bool unmask)
 {
-       struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
-       u32 gpio = irqd_to_hwirq(d);
        void __iomem *gimr = gpio_reg(&priv->chip, gpio, GIMR);
        unsigned long flags;
        u32 value;
@@ -241,12 +239,20 @@ static void mrfld_irq_unmask_mask(struct irq_data *d, bool unmask)
 
 static void mrfld_irq_mask(struct irq_data *d)
 {
-       mrfld_irq_unmask_mask(d, false);
+       struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
+       u32 gpio = irqd_to_hwirq(d);
+
+       mrfld_irq_unmask_mask(priv, gpio, false);
+       gpiochip_disable_irq(&priv->chip, gpio);
 }
 
 static void mrfld_irq_unmask(struct irq_data *d)
 {
-       mrfld_irq_unmask_mask(d, true);
+       struct mrfld_gpio *priv = irq_data_get_irq_chip_data(d);
+       u32 gpio = irqd_to_hwirq(d);
+
+       gpiochip_enable_irq(&priv->chip, gpio);
+       mrfld_irq_unmask_mask(priv, gpio, true);
 }
 
 static int mrfld_irq_set_type(struct irq_data *d, unsigned int type)
@@ -329,13 +335,15 @@ static int mrfld_irq_set_wake(struct irq_data *d, unsigned int on)
        return 0;
 }
 
-static struct irq_chip mrfld_irqchip = {
+static const struct irq_chip mrfld_irqchip = {
        .name           = "gpio-merrifield",
        .irq_ack        = mrfld_irq_ack,
        .irq_mask       = mrfld_irq_mask,
        .irq_unmask     = mrfld_irq_unmask,
        .irq_set_type   = mrfld_irq_set_type,
        .irq_set_wake   = mrfld_irq_set_wake,
+       .flags          = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static void mrfld_irq_handler(struct irq_desc *desc)
@@ -482,7 +490,7 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
                return retval;
 
        girq = &priv->chip.irq;
-       girq->chip = &mrfld_irqchip;
+       gpio_irq_chip_set_chip(girq, &mrfld_irqchip);
        girq->init_hw = mrfld_irq_init_hw;
        girq->parent_handler = mrfld_irq_handler;
        girq->num_parents = 1;
index c5166cd..7f59e5d 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 //
-// MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
+// MXS GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
 // Copyright 2008 Juergen Beisert, kernel@pengutronix.de
 //
 // Based on code from Freescale,
index c52b2cb..63dcf42 100644 (file)
@@ -172,6 +172,8 @@ static void realtek_gpio_irq_unmask(struct irq_data *data)
        unsigned long flags;
        u16 m;
 
+       gpiochip_enable_irq(&ctrl->gc, line);
+
        raw_spin_lock_irqsave(&ctrl->lock, flags);
        m = ctrl->intr_mask[port];
        m |= realtek_gpio_imr_bits(port_pin, REALTEK_GPIO_IMR_LINE_MASK);
@@ -195,6 +197,8 @@ static void realtek_gpio_irq_mask(struct irq_data *data)
        ctrl->intr_mask[port] = m;
        realtek_gpio_write_imr(ctrl, port, ctrl->intr_type[port], m);
        raw_spin_unlock_irqrestore(&ctrl->lock, flags);
+
+       gpiochip_disable_irq(&ctrl->gc, line);
 }
 
 static int realtek_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type)
@@ -315,13 +319,15 @@ static int realtek_gpio_irq_init(struct gpio_chip *gc)
        return 0;
 }
 
-static struct irq_chip realtek_gpio_irq_chip = {
+static const struct irq_chip realtek_gpio_irq_chip = {
        .name = "realtek-otto-gpio",
        .irq_ack = realtek_gpio_irq_ack,
        .irq_mask = realtek_gpio_irq_mask,
        .irq_unmask = realtek_gpio_irq_unmask,
        .irq_set_type = realtek_gpio_irq_set_type,
        .irq_set_affinity = realtek_gpio_irq_set_affinity,
+       .flags = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static const struct of_device_id realtek_gpio_of_match[] = {
@@ -404,7 +410,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
        irq = platform_get_irq_optional(pdev, 0);
        if (!(dev_flags & GPIO_INTERRUPTS_DISABLED) && irq > 0) {
                girq = &ctrl->gc.irq;
-               girq->chip = &realtek_gpio_irq_chip;
+               gpio_irq_chip_set_chip(girq, &realtek_gpio_irq_chip);
                girq->default_type = IRQ_TYPE_NONE;
                girq->handler = handle_bad_irq;
                girq->parent_handler = realtek_gpio_irq_handler;
index acda4c5..8a83f7b 100644 (file)
@@ -38,7 +38,6 @@
 
 struct sch_gpio {
        struct gpio_chip chip;
-       struct irq_chip irqchip;
        spinlock_t lock;
        unsigned short iobase;
        unsigned short resume_base;
@@ -218,11 +217,9 @@ static void sch_irq_ack(struct irq_data *d)
        spin_unlock_irqrestore(&sch->lock, flags);
 }
 
-static void sch_irq_mask_unmask(struct irq_data *d, int val)
+static void sch_irq_mask_unmask(struct gpio_chip *gc, irq_hw_number_t gpio_num, int val)
 {
-       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
        struct sch_gpio *sch = gpiochip_get_data(gc);
-       irq_hw_number_t gpio_num = irqd_to_hwirq(d);
        unsigned long flags;
 
        spin_lock_irqsave(&sch->lock, flags);
@@ -232,14 +229,32 @@ static void sch_irq_mask_unmask(struct irq_data *d, int val)
 
 static void sch_irq_mask(struct irq_data *d)
 {
-       sch_irq_mask_unmask(d, 0);
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+       irq_hw_number_t gpio_num = irqd_to_hwirq(d);
+
+       sch_irq_mask_unmask(gc, gpio_num, 0);
+       gpiochip_disable_irq(gc, gpio_num);
 }
 
 static void sch_irq_unmask(struct irq_data *d)
 {
-       sch_irq_mask_unmask(d, 1);
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+       irq_hw_number_t gpio_num = irqd_to_hwirq(d);
+
+       gpiochip_enable_irq(gc, gpio_num);
+       sch_irq_mask_unmask(gc, gpio_num, 1);
 }
 
+static const struct irq_chip sch_irqchip = {
+       .name = "sch_gpio",
+       .irq_ack = sch_irq_ack,
+       .irq_mask = sch_irq_mask,
+       .irq_unmask = sch_irq_unmask,
+       .irq_set_type = sch_irq_type,
+       .flags = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
+};
+
 static u32 sch_gpio_gpe_handler(acpi_handle gpe_device, u32 gpe, void *context)
 {
        struct sch_gpio *sch = context;
@@ -367,14 +382,8 @@ static int sch_gpio_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, sch);
 
-       sch->irqchip.name = "sch_gpio";
-       sch->irqchip.irq_ack = sch_irq_ack;
-       sch->irqchip.irq_mask = sch_irq_mask;
-       sch->irqchip.irq_unmask = sch_irq_unmask;
-       sch->irqchip.irq_set_type = sch_irq_type;
-
        girq = &sch->chip.irq;
-       girq->chip = &sch->irqchip;
+       gpio_irq_chip_set_chip(girq, &sch_irqchip);
        girq->num_parents = 0;
        girq->parents = NULL;
        girq->parent_handler = NULL;
index 98cd715..8d09b61 100644 (file)
@@ -217,8 +217,6 @@ static int giu_get_irq(unsigned int irq)
        printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
               maskl, pendl, maskh, pendh);
 
-       atomic_inc(&irq_err_count);
-
        return -EINVAL;
 }
 
index 16a0fae..c18b6b4 100644 (file)
@@ -299,6 +299,8 @@ static void wcove_irq_unmask(struct irq_data *data)
        if (gpio >= WCOVE_GPIO_NUM)
                return;
 
+       gpiochip_enable_irq(chip, gpio);
+
        wg->set_irq_mask = false;
        wg->update |= UPDATE_IRQ_MASK;
 }
@@ -314,15 +316,19 @@ static void wcove_irq_mask(struct irq_data *data)
 
        wg->set_irq_mask = true;
        wg->update |= UPDATE_IRQ_MASK;
+
+       gpiochip_disable_irq(chip, gpio);
 }
 
-static struct irq_chip wcove_irqchip = {
+static const struct irq_chip wcove_irqchip = {
        .name                   = "Whiskey Cove",
        .irq_mask               = wcove_irq_mask,
        .irq_unmask             = wcove_irq_unmask,
        .irq_set_type           = wcove_irq_type,
        .irq_bus_lock           = wcove_bus_lock,
        .irq_bus_sync_unlock    = wcove_bus_sync_unlock,
+       .flags                  = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
 };
 
 static irqreturn_t wcove_gpio_irq_handler(int irq, void *data)
@@ -452,7 +458,7 @@ static int wcove_gpio_probe(struct platform_device *pdev)
        }
 
        girq = &wg->chip.irq;
-       girq->chip = &wcove_irqchip;
+       gpio_irq_chip_set_chip(girq, &wcove_irqchip);
        /* This will let us handle the parent IRQ in the driver */
        girq->parent_handler = NULL;
        girq->num_parents = 0;
index 7f8f5b0..4b61d97 100644 (file)
@@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset)
        unsigned long *base = gpiochip_get_data(gc);
        const struct winbond_gpio_info *info;
        bool val;
+       int ret;
 
        winbond_gpio_get_info(&offset, &info);
 
-       val = winbond_sio_enter(*base);
-       if (val)
-               return val;
+       ret = winbond_sio_enter(*base);
+       if (ret)
+               return ret;
 
        winbond_sio_select_logical(*base, info->dev);
 
index 67abf8d..6b6d46e 100644 (file)
@@ -1918,9 +1918,6 @@ int amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel(struct amdgpu_device *adev,
                return -EINVAL;
        }
 
-       /* delete kgd_mem from kfd_bo_list to avoid re-validating
-        * this BO in BO's restoring after eviction.
-        */
        mutex_lock(&mem->process_info->lock);
 
        ret = amdgpu_bo_reserve(bo, true);
@@ -1943,7 +1940,6 @@ int amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel(struct amdgpu_device *adev,
 
        amdgpu_amdkfd_remove_eviction_fence(
                bo, mem->process_info->eviction_fence);
-       list_del_init(&mem->validate_list.head);
 
        if (size)
                *size = amdgpu_bo_size(bo);
@@ -2512,12 +2508,15 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
        process_info->eviction_fence = new_fence;
        *ef = dma_fence_get(&new_fence->base);
 
-       /* Attach new eviction fence to all BOs */
+       /* Attach new eviction fence to all BOs except pinned ones */
        list_for_each_entry(mem, &process_info->kfd_bo_list,
-               validate_list.head)
+               validate_list.head) {
+               if (mem->bo->tbo.pin_count)
+                       continue;
+
                amdgpu_bo_fence(mem->bo,
                        &process_info->eviction_fence->base, true);
-
+       }
        /* Attach eviction fence to PD / PT BOs */
        list_for_each_entry(peer_vm, &process_info->vm_list_head,
                            vm_list_node) {
index ede2fa5..1669915 100644 (file)
@@ -594,17 +594,20 @@ int amdgpu_get_gfx_off_status(struct amdgpu_device *adev, uint32_t *value)
 int amdgpu_gfx_ras_late_init(struct amdgpu_device *adev, struct ras_common_if *ras_block)
 {
        int r;
-       r = amdgpu_ras_block_late_init(adev, ras_block);
-       if (r)
-               return r;
 
        if (amdgpu_ras_is_supported(adev, ras_block->block)) {
                if (!amdgpu_persistent_edc_harvesting_supported(adev))
                        amdgpu_ras_reset_error_status(adev, AMDGPU_RAS_BLOCK__GFX);
 
+               r = amdgpu_ras_block_late_init(adev, ras_block);
+               if (r)
+                       return r;
+
                r = amdgpu_irq_get(adev, &adev->gfx.cp_ecc_error_irq, 0);
                if (r)
                        goto late_fini;
+       } else {
+               amdgpu_ras_feature_enable_on_boot(adev, ras_block, 0);
        }
 
        return 0;
index 798c562..aebc384 100644 (file)
@@ -518,6 +518,8 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
        case IP_VERSION(9, 1, 0):
        /* RENOIR looks like RAVEN */
        case IP_VERSION(9, 3, 0):
+       /* GC 10.3.7 */
+       case IP_VERSION(10, 3, 7):
                if (amdgpu_tmz == 0) {
                        adev->gmc.tmz_enabled = false;
                        dev_info(adev->dev,
@@ -540,8 +542,6 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
        case IP_VERSION(10, 3, 1):
        /* YELLOW_CARP*/
        case IP_VERSION(10, 3, 3):
-       /* GC 10.3.7 */
-       case IP_VERSION(10, 3, 7):
                /* Don't enable it by default yet.
                 */
                if (amdgpu_tmz < 1) {
index 801f6fa..6de63ea 100644 (file)
@@ -642,7 +642,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                            atomic64_read(&adev->visible_pin_size),
                            vram_gtt.vram_size);
                vram_gtt.gtt_size = ttm_manager_type(&adev->mman.bdev, TTM_PL_TT)->size;
-               vram_gtt.gtt_size *= PAGE_SIZE;
                vram_gtt.gtt_size -= atomic64_read(&adev->gart_pin_size);
                return copy_to_user(out, &vram_gtt,
                                    min((size_t)size, sizeof(vram_gtt))) ? -EFAULT : 0;
@@ -675,7 +674,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        mem.cpu_accessible_vram.usable_heap_size * 3 / 4;
 
                mem.gtt.total_heap_size = gtt_man->size;
-               mem.gtt.total_heap_size *= PAGE_SIZE;
                mem.gtt.usable_heap_size = mem.gtt.total_heap_size -
                        atomic64_read(&adev->gart_pin_size);
                mem.gtt.heap_usage = ttm_resource_manager_usage(gtt_man);
index 2de9309..dac202a 100644 (file)
@@ -197,6 +197,13 @@ static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf,
        if (amdgpu_ras_query_error_status(obj->adev, &info))
                return -EINVAL;
 
+       /* Hardware counter will be reset automatically after the query on Vega20 and Arcturus */
+       if (obj->adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 2) &&
+           obj->adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 4)) {
+               if (amdgpu_ras_reset_error_status(obj->adev, info.head.block))
+                       dev_warn(obj->adev->dev, "Failed to reset error counter and error status");
+       }
+
        s = snprintf(val, sizeof(val), "%s: %lu\n%s: %lu\n",
                        "ue", info.ue_count,
                        "ce", info.ce_count);
@@ -550,9 +557,10 @@ static ssize_t amdgpu_ras_sysfs_read(struct device *dev,
        if (amdgpu_ras_query_error_status(obj->adev, &info))
                return -EINVAL;
 
-       if (obj->adev->asic_type == CHIP_ALDEBARAN) {
+       if (obj->adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 2) &&
+           obj->adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 4)) {
                if (amdgpu_ras_reset_error_status(obj->adev, info.head.block))
-                       DRM_WARN("Failed to reset error counter and error status");
+                       dev_warn(obj->adev->dev, "Failed to reset error counter and error status");
        }
 
        return sysfs_emit(buf, "%s: %lu\n%s: %lu\n", "ue", info.ue_count,
@@ -1027,9 +1035,6 @@ int amdgpu_ras_query_error_status(struct amdgpu_device *adev,
                }
        }
 
-       if (!amdgpu_persistent_edc_harvesting_supported(adev))
-               amdgpu_ras_reset_error_status(adev, info->head.block);
-
        return 0;
 }
 
@@ -1149,6 +1154,12 @@ int amdgpu_ras_query_error_count(struct amdgpu_device *adev,
                if (res)
                        return res;
 
+               if (adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 2) &&
+                   adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 4)) {
+                       if (amdgpu_ras_reset_error_status(adev, info.head.block))
+                               dev_warn(adev->dev, "Failed to reset error counter and error status");
+               }
+
                ce += info.ce_count;
                ue += info.ue_count;
        }
@@ -1792,6 +1803,12 @@ static void amdgpu_ras_log_on_err_counter(struct amdgpu_device *adev)
                        continue;
 
                amdgpu_ras_query_error_status(adev, &info);
+
+               if (adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 2) &&
+                   adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 4)) {
+                       if (amdgpu_ras_reset_error_status(adev, info.head.block))
+                               dev_warn(adev->dev, "Failed to reset error counter and error status");
+               }
        }
 }
 
@@ -2278,8 +2295,9 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev)
            !amdgpu_ras_asic_supported(adev))
                return;
 
-       if (!(amdgpu_sriov_vf(adev) &&
-               (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 2))))
+       /* If driver run on sriov guest side, only enable ras for aldebaran */
+       if (amdgpu_sriov_vf(adev) &&
+               adev->ip_versions[MP1_HWIP][0] != IP_VERSION(13, 0, 2))
                return;
 
        if (!adev->gmc.xgmi.connected_to_cpu) {
index be6f76a..3b4c194 100644 (file)
@@ -1798,18 +1798,26 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
        DRM_INFO("amdgpu: %uM of VRAM memory ready\n",
                 (unsigned) (adev->gmc.real_vram_size / (1024 * 1024)));
 
-       /* Compute GTT size, either bsaed on 3/4th the size of RAM size
+       /* Compute GTT size, either based on 1/2 the size of RAM size
         * or whatever the user passed on module init */
        if (amdgpu_gtt_size == -1) {
                struct sysinfo si;
 
                si_meminfo(&si);
-               gtt_size = min(max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
-                              adev->gmc.mc_vram_size),
-                              ((uint64_t)si.totalram * si.mem_unit * 3/4));
-       }
-       else
+               /* Certain GL unit tests for large textures can cause problems
+                * with the OOM killer since there is no way to link this memory
+                * to a process.  This was originally mitigated (but not necessarily
+                * eliminated) by limiting the GTT size.  The problem is this limit
+                * is often too low for many modern games so just make the limit 1/2
+                * of system memory which aligns with TTM. The OOM accounting needs
+                * to be addressed, but we shouldn't prevent common 3D applications
+                * from being usable just to potentially mitigate that corner case.
+                */
+               gtt_size = max((AMDGPU_DEFAULT_GTT_SIZE_MB << 20),
+                              (u64)si.totalram * si.mem_unit / 2);
+       } else {
                gtt_size = (uint64_t)amdgpu_gtt_size << 20;
+       }
 
        /* Initialize GTT memory pool */
        r = amdgpu_gtt_mgr_init(adev, gtt_size);
index 2ceeaa4..dc76d2b 100644 (file)
@@ -679,6 +679,7 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
 {
        struct amdgpu_vm_update_params params;
        struct amdgpu_vm_bo_base *entry;
+       bool flush_tlb_needed = false;
        int r, idx;
 
        if (list_empty(&vm->relocated))
@@ -697,6 +698,9 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
                goto error;
 
        list_for_each_entry(entry, &vm->relocated, vm_status) {
+               /* vm_flush_needed after updating moved PDEs */
+               flush_tlb_needed |= entry->moved;
+
                r = amdgpu_vm_pde_update(&params, entry);
                if (r)
                        goto error;
@@ -706,8 +710,8 @@ int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
        if (r)
                goto error;
 
-       /* vm_flush_needed after updating PDEs */
-       atomic64_inc(&vm->tlb_seq);
+       if (flush_tlb_needed)
+               atomic64_inc(&vm->tlb_seq);
 
        while (!list_empty(&vm->relocated)) {
                entry = list_first_entry(&vm->relocated,
@@ -789,6 +793,11 @@ int amdgpu_vm_update_range(struct amdgpu_device *adev, struct amdgpu_vm *vm,
        flush_tlb |= adev->gmc.xgmi.num_physical_nodes &&
                     adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 0);
 
+       /*
+        * On GFX8 and older any 8 PTE block with a valid bit set enters the TLB
+        */
+       flush_tlb |= adev->ip_versions[GC_HWIP][0] < IP_VERSION(9, 0, 0);
+
        memset(&params, 0, sizeof(params));
        params.adev = adev;
        params.vm = vm;
index 8c0a3fc..a4a6751 100644 (file)
@@ -1096,6 +1096,7 @@ static void gfx_v11_0_read_wave_data(struct amdgpu_device *adev, uint32_t simd,
        dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_IB_STS2);
        dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_IB_DBG1);
        dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_M0);
+       dst[(*no_fields)++] = wave_read_ind(adev, wave, ixSQ_WAVE_MODE);
 }
 
 static void gfx_v11_0_read_wave_sgprs(struct amdgpu_device *adev, uint32_t simd,
@@ -1316,7 +1317,7 @@ static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *ade
                memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
 
        if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
-               *(uint64_t *)fw_autoload_mask |= 1 << id;
+               *(uint64_t *)fw_autoload_mask |= 1ULL << id;
 }
 
 static void gfx_v11_0_rlc_backdoor_autoload_copy_toc_ucode(struct amdgpu_device *adev,
@@ -1983,7 +1984,7 @@ static int gfx_v11_0_init_csb(struct amdgpu_device *adev)
        return 0;
 }
 
-void gfx_v11_0_rlc_stop(struct amdgpu_device *adev)
+static void gfx_v11_0_rlc_stop(struct amdgpu_device *adev)
 {
        u32 tmp = RREG32_SOC15(GC, 0, regRLC_CNTL);
 
@@ -6028,6 +6029,7 @@ static void gfx_v11_0_handle_priv_fault(struct amdgpu_device *adev,
                break;
        default:
                BUG();
+               break;
        }
 }
 
index a0c0b7d..7f4b480 100644 (file)
@@ -638,6 +638,12 @@ static int gmc_v11_0_mc_init(struct amdgpu_device *adev)
        adev->gmc.aper_base = pci_resource_start(adev->pdev, 0);
        adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);
 
+#ifdef CONFIG_X86_64
+       if ((adev->flags & AMD_IS_APU) && !amdgpu_passthrough(adev)) {
+               adev->gmc.aper_base = adev->mmhub.funcs->get_mc_fb_offset(adev);
+               adev->gmc.aper_size = adev->gmc.real_vram_size;
+       }
+#endif
        /* In case the PCI BAR is larger than the actual amount of vram */
        adev->gmc.visible_vram_size = adev->gmc.aper_size;
        if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
index 5d2dfef..d63d3f2 100644 (file)
@@ -299,7 +299,7 @@ static const struct imu_rlc_ram_golden imu_rlc_ram_golden_11_0_2[] =
        IMU_RLC_RAM_GOLDEN_VALUE(GC, 0, regCPG_PSP_DEBUG, CPG_PSP_DEBUG__GPA_OVERRIDE_MASK, 0)
 };
 
-void program_imu_rlc_ram(struct amdgpu_device *adev,
+static void program_imu_rlc_ram(struct amdgpu_device *adev,
                                const struct imu_rlc_ram_golden *regs,
                                const u32 array_size)
 {
index d2722ad..f3c1af5 100644 (file)
@@ -535,6 +535,10 @@ void jpeg_v2_0_dec_ring_emit_ib(struct amdgpu_ring *ring,
 {
        unsigned vmid = AMDGPU_JOB_GET_VMID(job);
 
+       amdgpu_ring_write(ring, PACKETJ(mmUVD_JPEG_IH_CTRL_INTERNAL_OFFSET,
+               0, 0, PACKETJ_TYPE0));
+       amdgpu_ring_write(ring, (vmid << JPEG_IH_CTRL__IH_VMID__SHIFT));
+
        amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_IB_VMID_INTERNAL_OFFSET,
                0, 0, PACKETJ_TYPE0));
        amdgpu_ring_write(ring, (vmid | (vmid << 4)));
@@ -768,7 +772,7 @@ static const struct amdgpu_ring_funcs jpeg_v2_0_dec_ring_vm_funcs = {
                8 + /* jpeg_v2_0_dec_ring_emit_vm_flush */
                18 + 18 + /* jpeg_v2_0_dec_ring_emit_fence x2 vm fence */
                8 + 16,
-       .emit_ib_size = 22, /* jpeg_v2_0_dec_ring_emit_ib */
+       .emit_ib_size = 24, /* jpeg_v2_0_dec_ring_emit_ib */
        .emit_ib = jpeg_v2_0_dec_ring_emit_ib,
        .emit_fence = jpeg_v2_0_dec_ring_emit_fence,
        .emit_vm_flush = jpeg_v2_0_dec_ring_emit_vm_flush,
index 1a03baa..654e43e 100644 (file)
@@ -41,6 +41,7 @@
 #define mmUVD_JRBC_RB_REF_DATA_INTERNAL_OFFSET                         0x4084
 #define mmUVD_JRBC_STATUS_INTERNAL_OFFSET                              0x4089
 #define mmUVD_JPEG_PITCH_INTERNAL_OFFSET                               0x401f
+#define mmUVD_JPEG_IH_CTRL_INTERNAL_OFFSET                             0x4149
 
 #define JRBC_DEC_EXTERNAL_REG_WRITE_ADDR                               0x18000
 
index fcf5194..7eee004 100644 (file)
@@ -541,7 +541,7 @@ static void mes_v11_0_enable(struct amdgpu_device *adev, bool enable)
 
 /* This function is for backdoor MES firmware */
 static int mes_v11_0_load_microcode(struct amdgpu_device *adev,
-                                   enum admgpu_mes_pipe pipe)
+                                   enum admgpu_mes_pipe pipe, bool prime_icache)
 {
        int r;
        uint32_t data;
@@ -593,16 +593,18 @@ static int mes_v11_0_load_microcode(struct amdgpu_device *adev,
        /* Set 0x3FFFF (256K-1) to CP_MES_MDBOUND_LO */
        WREG32_SOC15(GC, 0, regCP_MES_MDBOUND_LO, 0x3FFFF);
 
-       /* invalidate ICACHE */
-       data = RREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL);
-       data = REG_SET_FIELD(data, CP_MES_IC_OP_CNTL, PRIME_ICACHE, 0);
-       data = REG_SET_FIELD(data, CP_MES_IC_OP_CNTL, INVALIDATE_CACHE, 1);
-       WREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL, data);
-
-       /* prime the ICACHE. */
-       data = RREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL);
-       data = REG_SET_FIELD(data, CP_MES_IC_OP_CNTL, PRIME_ICACHE, 1);
-       WREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL, data);
+       if (prime_icache) {
+               /* invalidate ICACHE */
+               data = RREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL);
+               data = REG_SET_FIELD(data, CP_MES_IC_OP_CNTL, PRIME_ICACHE, 0);
+               data = REG_SET_FIELD(data, CP_MES_IC_OP_CNTL, INVALIDATE_CACHE, 1);
+               WREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL, data);
+
+               /* prime the ICACHE. */
+               data = RREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL);
+               data = REG_SET_FIELD(data, CP_MES_IC_OP_CNTL, PRIME_ICACHE, 1);
+               WREG32_SOC15(GC, 0, regCP_MES_IC_OP_CNTL, data);
+       }
 
        soc21_grbm_select(adev, 0, 0, 0, 0);
        mutex_unlock(&adev->srbm_mutex);
@@ -1044,17 +1046,19 @@ static int mes_v11_0_kiq_hw_init(struct amdgpu_device *adev)
        int r = 0;
 
        if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
-               r = mes_v11_0_load_microcode(adev, AMDGPU_MES_KIQ_PIPE);
+
+               r = mes_v11_0_load_microcode(adev, AMDGPU_MES_SCHED_PIPE, false);
                if (r) {
-                       DRM_ERROR("failed to load MES kiq fw, r=%d\n", r);
+                       DRM_ERROR("failed to load MES fw, r=%d\n", r);
                        return r;
                }
 
-               r = mes_v11_0_load_microcode(adev, AMDGPU_MES_SCHED_PIPE);
+               r = mes_v11_0_load_microcode(adev, AMDGPU_MES_KIQ_PIPE, true);
                if (r) {
-                       DRM_ERROR("failed to load MES fw, r=%d\n", r);
+                       DRM_ERROR("failed to load MES kiq fw, r=%d\n", r);
                        return r;
                }
+
        }
 
        mes_v11_0_enable(adev, true);
@@ -1086,7 +1090,7 @@ static int mes_v11_0_hw_init(void *handle)
        if (!adev->enable_mes_kiq) {
                if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
                        r = mes_v11_0_load_microcode(adev,
-                                            AMDGPU_MES_SCHED_PIPE);
+                                            AMDGPU_MES_SCHED_PIPE, true);
                        if (r) {
                                DRM_ERROR("failed to MES fw, r=%d\n", r);
                                return r;
index d016e3c..b3fba8d 100644 (file)
@@ -170,6 +170,7 @@ static const struct amdgpu_video_codec_info yc_video_codecs_decode_array[] = {
        {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC, 8192, 4352, 186)},
        {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9, 8192, 4352, 0)},
        {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG, 4096, 4096, 0)},
+       {codec_info_build(AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1, 8192, 4352, 0)},
 };
 
 static const struct amdgpu_video_codecs yc_video_codecs_decode = {
index 06b2635..83c6cca 100644 (file)
@@ -469,6 +469,7 @@ static void sdma_v5_2_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 se
        }
 }
 
+
 /**
  * sdma_v5_2_gfx_stop - stop the gfx async dma engines
  *
@@ -514,21 +515,17 @@ static void sdma_v5_2_rlc_stop(struct amdgpu_device *adev)
 }
 
 /**
- * sdma_v5_2_ctx_switch_enable_for_instance - start the async dma engines
- * context switch for an instance
+ * sdma_v5_2_ctx_switch_enable - stop the async dma engines context switch
  *
  * @adev: amdgpu_device pointer
- * @instance_idx: the index of the SDMA instance
+ * @enable: enable/disable the DMA MEs context switch.
  *
- * Unhalt the async dma engines context switch.
+ * Halt or unhalt the async dma engines context switch.
  */
-static void sdma_v5_2_ctx_switch_enable_for_instance(struct amdgpu_device *adev, int instance_idx)
+static void sdma_v5_2_ctx_switch_enable(struct amdgpu_device *adev, bool enable)
 {
        u32 f32_cntl, phase_quantum = 0;
-
-       if (WARN_ON(instance_idx >= adev->sdma.num_instances)) {
-               return;
-       }
+       int i;
 
        if (amdgpu_sdma_phase_quantum) {
                unsigned value = amdgpu_sdma_phase_quantum;
@@ -552,68 +549,50 @@ static void sdma_v5_2_ctx_switch_enable_for_instance(struct amdgpu_device *adev,
                phase_quantum =
                        value << SDMA0_PHASE0_QUANTUM__VALUE__SHIFT |
                        unit  << SDMA0_PHASE0_QUANTUM__UNIT__SHIFT;
-
-               WREG32_SOC15_IP(GC,
-                       sdma_v5_2_get_reg_offset(adev, instance_idx, mmSDMA0_PHASE0_QUANTUM),
-                       phase_quantum);
-               WREG32_SOC15_IP(GC,
-                       sdma_v5_2_get_reg_offset(adev, instance_idx, mmSDMA0_PHASE1_QUANTUM),
-                   phase_quantum);
-               WREG32_SOC15_IP(GC,
-                       sdma_v5_2_get_reg_offset(adev, instance_idx, mmSDMA0_PHASE2_QUANTUM),
-                   phase_quantum);
        }
 
-       if (!amdgpu_sriov_vf(adev)) {
-               f32_cntl = RREG32(sdma_v5_2_get_reg_offset(adev, instance_idx, mmSDMA0_CNTL));
-               f32_cntl = REG_SET_FIELD(f32_cntl, SDMA0_CNTL,
-                               AUTO_CTXSW_ENABLE, 1);
-               WREG32(sdma_v5_2_get_reg_offset(adev, instance_idx, mmSDMA0_CNTL), f32_cntl);
+       for (i = 0; i < adev->sdma.num_instances; i++) {
+               if (enable && amdgpu_sdma_phase_quantum) {
+                       WREG32_SOC15_IP(GC, sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_PHASE0_QUANTUM),
+                              phase_quantum);
+                       WREG32_SOC15_IP(GC, sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_PHASE1_QUANTUM),
+                              phase_quantum);
+                       WREG32_SOC15_IP(GC, sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_PHASE2_QUANTUM),
+                              phase_quantum);
+               }
+
+               if (!amdgpu_sriov_vf(adev)) {
+                       f32_cntl = RREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_CNTL));
+                       f32_cntl = REG_SET_FIELD(f32_cntl, SDMA0_CNTL,
+                                       AUTO_CTXSW_ENABLE, enable ? 1 : 0);
+                       WREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_CNTL), f32_cntl);
+               }
        }
+
 }
 
 /**
- * sdma_v5_2_ctx_switch_disable_all - stop the async dma engines context switch
+ * sdma_v5_2_enable - stop the async dma engines
  *
  * @adev: amdgpu_device pointer
+ * @enable: enable/disable the DMA MEs.
  *
- * Halt the async dma engines context switch.
+ * Halt or unhalt the async dma engines.
  */
-static void sdma_v5_2_ctx_switch_disable_all(struct amdgpu_device *adev)
+static void sdma_v5_2_enable(struct amdgpu_device *adev, bool enable)
 {
        u32 f32_cntl;
        int i;
 
-       if (amdgpu_sriov_vf(adev))
-               return;
-
-       for (i = 0; i < adev->sdma.num_instances; i++) {
-               f32_cntl = RREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_CNTL));
-               f32_cntl = REG_SET_FIELD(f32_cntl, SDMA0_CNTL,
-                               AUTO_CTXSW_ENABLE, 0);
-               WREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_CNTL), f32_cntl);
+       if (!enable) {
+               sdma_v5_2_gfx_stop(adev);
+               sdma_v5_2_rlc_stop(adev);
        }
-}
-
-/**
- * sdma_v5_2_halt - stop the async dma engines
- *
- * @adev: amdgpu_device pointer
- *
- * Halt the async dma engines.
- */
-static void sdma_v5_2_halt(struct amdgpu_device *adev)
-{
-       int i;
-       u32 f32_cntl;
-
-       sdma_v5_2_gfx_stop(adev);
-       sdma_v5_2_rlc_stop(adev);
 
        if (!amdgpu_sriov_vf(adev)) {
                for (i = 0; i < adev->sdma.num_instances; i++) {
                        f32_cntl = RREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_F32_CNTL));
-                       f32_cntl = REG_SET_FIELD(f32_cntl, SDMA0_F32_CNTL, HALT, 1);
+                       f32_cntl = REG_SET_FIELD(f32_cntl, SDMA0_F32_CNTL, HALT, enable ? 0 : 1);
                        WREG32(sdma_v5_2_get_reg_offset(adev, i, mmSDMA0_F32_CNTL), f32_cntl);
                }
        }
@@ -625,9 +604,6 @@ static void sdma_v5_2_halt(struct amdgpu_device *adev)
  * @adev: amdgpu_device pointer
  *
  * Set up the gfx DMA ring buffers and enable them.
- * It assumes that the dma engine is stopped for each instance.
- * The function enables the engine and preemptions sequentially for each instance.
- *
  * Returns 0 for success, error for failure.
  */
 static int sdma_v5_2_gfx_resume(struct amdgpu_device *adev)
@@ -769,7 +745,10 @@ static int sdma_v5_2_gfx_resume(struct amdgpu_device *adev)
 
                ring->sched.ready = true;
 
-               sdma_v5_2_ctx_switch_enable_for_instance(adev, i);
+               if (amdgpu_sriov_vf(adev)) { /* bare-metal sequence doesn't need below to lines */
+                       sdma_v5_2_ctx_switch_enable(adev, true);
+                       sdma_v5_2_enable(adev, true);
+               }
 
                r = amdgpu_ring_test_ring(ring);
                if (r) {
@@ -813,7 +792,7 @@ static int sdma_v5_2_load_microcode(struct amdgpu_device *adev)
        int i, j;
 
        /* halt the MEs */
-       sdma_v5_2_halt(adev);
+       sdma_v5_2_enable(adev, false);
 
        for (i = 0; i < adev->sdma.num_instances; i++) {
                if (!adev->sdma.instance[i].fw)
@@ -885,8 +864,8 @@ static int sdma_v5_2_start(struct amdgpu_device *adev)
        int r = 0;
 
        if (amdgpu_sriov_vf(adev)) {
-               sdma_v5_2_ctx_switch_disable_all(adev);
-               sdma_v5_2_halt(adev);
+               sdma_v5_2_ctx_switch_enable(adev, false);
+               sdma_v5_2_enable(adev, false);
 
                /* set RB registers */
                r = sdma_v5_2_gfx_resume(adev);
@@ -910,10 +889,12 @@ static int sdma_v5_2_start(struct amdgpu_device *adev)
                amdgpu_gfx_off_ctrl(adev, false);
 
        sdma_v5_2_soft_reset(adev);
+       /* unhalt the MEs */
+       sdma_v5_2_enable(adev, true);
+       /* enable sdma ring preemption */
+       sdma_v5_2_ctx_switch_enable(adev, true);
 
-       /* Soft reset supposes to disable the dma engine and preemption.
-        * Now start the gfx rings and rlc compute queues.
-        */
+       /* start the gfx rings and rlc compute queues */
        r = sdma_v5_2_gfx_resume(adev);
        if (adev->in_s0ix)
                amdgpu_gfx_off_ctrl(adev, true);
@@ -1447,8 +1428,8 @@ static int sdma_v5_2_hw_fini(void *handle)
        if (amdgpu_sriov_vf(adev))
                return 0;
 
-       sdma_v5_2_ctx_switch_disable_all(adev);
-       sdma_v5_2_halt(adev);
+       sdma_v5_2_ctx_switch_enable(adev, false);
+       sdma_v5_2_enable(adev, false);
 
        return 0;
 }
index 3cabcee..39405f0 100644 (file)
@@ -1761,23 +1761,21 @@ static const struct amdgpu_ring_funcs vcn_v3_0_dec_sw_ring_vm_funcs = {
        .emit_reg_write_reg_wait = amdgpu_ring_emit_reg_write_reg_wait_helper,
 };
 
-static int vcn_v3_0_limit_sched(struct amdgpu_cs_parser *p,
-                               struct amdgpu_job *job)
+static int vcn_v3_0_limit_sched(struct amdgpu_cs_parser *p)
 {
        struct drm_gpu_scheduler **scheds;
 
        /* The create msg must be in the first IB submitted */
-       if (atomic_read(&job->base.entity->fence_seq))
+       if (atomic_read(&p->entity->fence_seq))
                return -EINVAL;
 
        scheds = p->adev->gpu_sched[AMDGPU_HW_IP_VCN_DEC]
                [AMDGPU_RING_PRIO_DEFAULT].sched;
-       drm_sched_entity_modify_sched(job->base.entity, scheds, 1);
+       drm_sched_entity_modify_sched(p->entity, scheds, 1);
        return 0;
 }
 
-static int vcn_v3_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job,
-                           uint64_t addr)
+static int vcn_v3_0_dec_msg(struct amdgpu_cs_parser *p, uint64_t addr)
 {
        struct ttm_operation_ctx ctx = { false, false };
        struct amdgpu_bo_va_mapping *map;
@@ -1848,7 +1846,7 @@ static int vcn_v3_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job,
                if (create[0] == 0x7 || create[0] == 0x10 || create[0] == 0x11)
                        continue;
 
-               r = vcn_v3_0_limit_sched(p, job);
+               r = vcn_v3_0_limit_sched(p);
                if (r)
                        goto out;
        }
@@ -1862,7 +1860,7 @@ static int vcn_v3_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
                                           struct amdgpu_job *job,
                                           struct amdgpu_ib *ib)
 {
-       struct amdgpu_ring *ring = to_amdgpu_ring(job->base.sched);
+       struct amdgpu_ring *ring = to_amdgpu_ring(p->entity->rq->sched);
        uint32_t msg_lo = 0, msg_hi = 0;
        unsigned i;
        int r;
@@ -1881,8 +1879,7 @@ static int vcn_v3_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
                        msg_hi = val;
                } else if (reg == PACKET0(p->adev->vcn.internal.cmd, 0) &&
                           val == 0) {
-                       r = vcn_v3_0_dec_msg(p, job,
-                                            ((u64)msg_hi) << 32 | msg_lo);
+                       r = vcn_v3_0_dec_msg(p, ((u64)msg_hi) << 32 | msg_lo);
                        if (r)
                                return r;
                }
index 5e9adbc..cbfb32b 100644 (file)
@@ -1516,6 +1516,8 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
                        num_of_cache_types = ARRAY_SIZE(beige_goby_cache_info);
                        break;
                case IP_VERSION(10, 3, 3):
+               case IP_VERSION(10, 3, 6): /* TODO: Double check these on production silicon */
+               case IP_VERSION(10, 3, 7): /* TODO: Double check these on production silicon */
                        pcache_info = yellow_carp_cache_info;
                        num_of_cache_types = ARRAY_SIZE(yellow_carp_cache_info);
                        break;
index 8667e3d..bf42004 100644 (file)
@@ -73,6 +73,8 @@ static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd)
        case IP_VERSION(4, 1, 2):/* RENOIR */
        case IP_VERSION(5, 2, 1):/* VANGOGH */
        case IP_VERSION(5, 2, 3):/* YELLOW_CARP */
+       case IP_VERSION(5, 2, 6):/* GC 10.3.6 */
+       case IP_VERSION(5, 2, 7):/* GC 10.3.7 */
        case IP_VERSION(6, 0, 1):
                kfd->device_info.num_sdma_queues_per_engine = 2;
                break;
@@ -127,6 +129,8 @@ static void kfd_device_info_set_event_interrupt_class(struct kfd_dev *kfd)
        case IP_VERSION(9, 4, 2): /* ALDEBARAN */
        case IP_VERSION(10, 3, 1): /* VANGOGH */
        case IP_VERSION(10, 3, 3): /* YELLOW_CARP */
+       case IP_VERSION(10, 3, 6): /* GC 10.3.6 */
+       case IP_VERSION(10, 3, 7): /* GC 10.3.7 */
        case IP_VERSION(10, 1, 3): /* CYAN_SKILLFISH */
        case IP_VERSION(10, 1, 4):
        case IP_VERSION(10, 1, 10): /* NAVI10 */
@@ -178,7 +182,9 @@ static void kfd_device_info_init(struct kfd_dev *kfd,
 
                if (gc_version < IP_VERSION(11, 0, 0)) {
                        /* Navi2x+, Navi1x+ */
-                       if (gc_version >= IP_VERSION(10, 3, 0))
+                       if (gc_version == IP_VERSION(10, 3, 6))
+                               kfd->device_info.no_atomic_fw_version = 14;
+                       else if (gc_version >= IP_VERSION(10, 3, 0))
                                kfd->device_info.no_atomic_fw_version = 92;
                        else if (gc_version >= IP_VERSION(10, 1, 1))
                                kfd->device_info.no_atomic_fw_version = 145;
@@ -368,6 +374,16 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
                        if (!vf)
                                f2g = &gfx_v10_3_kfd2kgd;
                        break;
+               case IP_VERSION(10, 3, 6):
+                       gfx_target_version = 100306;
+                       if (!vf)
+                               f2g = &gfx_v10_3_kfd2kgd;
+                       break;
+               case IP_VERSION(10, 3, 7):
+                       gfx_target_version = 100307;
+                       if (!vf)
+                               f2g = &gfx_v10_3_kfd2kgd;
+                       break;
                case IP_VERSION(11, 0, 0):
                        gfx_target_version = 110000;
                        f2g = &gfx_v11_kfd2kgd;
index 997650d..e44376c 100644 (file)
@@ -296,7 +296,7 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
                         struct migrate_vma *migrate, struct dma_fence **mfence,
                         dma_addr_t *scratch)
 {
-       uint64_t npages = migrate->cpages;
+       uint64_t npages = migrate->npages;
        struct device *dev = adev->dev;
        struct amdgpu_res_cursor cursor;
        dma_addr_t *src;
@@ -344,7 +344,7 @@ svm_migrate_copy_to_vram(struct amdgpu_device *adev, struct svm_range *prange,
                                                mfence);
                                if (r)
                                        goto out_free_vram_pages;
-                               amdgpu_res_next(&cursor, j << PAGE_SHIFT);
+                               amdgpu_res_next(&cursor, (j + 1) << PAGE_SHIFT);
                                j = 0;
                        } else {
                                amdgpu_res_next(&cursor, PAGE_SIZE);
@@ -590,7 +590,7 @@ svm_migrate_copy_to_ram(struct amdgpu_device *adev, struct svm_range *prange,
                        continue;
                }
                src[i] = svm_migrate_addr(adev, spage);
-               if (i > 0 && src[i] != src[i - 1] + PAGE_SIZE) {
+               if (j > 0 && src[i] != src[i - 1] + PAGE_SIZE) {
                        r = svm_migrate_copy_memory_gart(adev, dst + i - j,
                                                         src + i - j, j,
                                                         FROM_VRAM_TO_RAM,
index 2ebf013..7b33224 100644 (file)
@@ -1295,7 +1295,7 @@ svm_range_map_to_gpu(struct kfd_process_device *pdd, struct svm_range *prange,
                r = amdgpu_vm_update_range(adev, vm, false, false, flush_tlb, NULL,
                                           last_start, prange->start + i,
                                           pte_flags,
-                                          last_start - prange->start,
+                                          (last_start - prange->start) << PAGE_SHIFT,
                                           bo_adev ? bo_adev->vm_manager.vram_base_offset : 0,
                                           NULL, dma_addr, &vm->last_update);
 
@@ -2307,6 +2307,8 @@ svm_range_cpu_invalidate_pagetables(struct mmu_interval_notifier *mni,
 
        if (range->event == MMU_NOTIFY_RELEASE)
                return true;
+       if (!mmget_not_zero(mni->mm))
+               return true;
 
        start = mni->interval_tree.start;
        last = mni->interval_tree.last;
@@ -2333,6 +2335,7 @@ svm_range_cpu_invalidate_pagetables(struct mmu_interval_notifier *mni,
        }
 
        svm_range_unlock(prange);
+       mmput(mni->mm);
 
        return true;
 }
index 70be67a..39b425d 100644 (file)
@@ -2812,7 +2812,7 @@ static struct drm_mode_config_helper_funcs amdgpu_dm_mode_config_helperfuncs = {
 
 static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
 {
-       u32 max_cll, min_cll, max, min, q, r;
+       u32 max_avg, min_cll, max, min, q, r;
        struct amdgpu_dm_backlight_caps *caps;
        struct amdgpu_display_manager *dm;
        struct drm_connector *conn_base;
@@ -2842,7 +2842,7 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
        caps = &dm->backlight_caps[i];
        caps->ext_caps = &aconnector->dc_link->dpcd_sink_ext_caps;
        caps->aux_support = false;
-       max_cll = conn_base->hdr_sink_metadata.hdmi_type1.max_cll;
+       max_avg = conn_base->hdr_sink_metadata.hdmi_type1.max_fall;
        min_cll = conn_base->hdr_sink_metadata.hdmi_type1.min_cll;
 
        if (caps->ext_caps->bits.oled == 1 /*||
@@ -2870,8 +2870,8 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
         * The results of the above expressions can be verified at
         * pre_computed_values.
         */
-       q = max_cll >> 5;
-       r = max_cll % 32;
+       q = max_avg >> 5;
+       r = max_avg % 32;
        max = (1 << q) * pre_computed_values[r];
 
        // min luminance: maxLum * (CV/255)^2 / 100
index ceb3437..bca5f01 100644 (file)
@@ -287,8 +287,11 @@ static void dcn31_enable_pme_wa(struct clk_mgr *clk_mgr_base)
 
 void dcn31_init_clocks(struct clk_mgr *clk_mgr)
 {
+       uint32_t ref_dtbclk = clk_mgr->clks.ref_dtbclk_khz;
+
        memset(&(clk_mgr->clks), 0, sizeof(struct dc_clocks));
        // Assumption is that boot state always supports pstate
+       clk_mgr->clks.ref_dtbclk_khz = ref_dtbclk;      // restore ref_dtbclk
        clk_mgr->clks.p_state_change_support = true;
        clk_mgr->clks.prev_p_state_change_support = true;
        clk_mgr->clks.pwr_state = DCN_PWR_STATE_UNKNOWN;
@@ -638,8 +641,14 @@ static void dcn31_set_low_power_state(struct clk_mgr *clk_mgr_base)
        }
 }
 
+int dcn31_get_dtb_ref_freq_khz(struct clk_mgr *clk_mgr_base)
+{
+       return clk_mgr_base->clks.ref_dtbclk_khz;
+}
+
 static struct clk_mgr_funcs dcn31_funcs = {
        .get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz,
+       .get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz,
        .update_clocks = dcn31_update_clocks,
        .init_clocks = dcn31_init_clocks,
        .enable_pme_wa = dcn31_enable_pme_wa,
@@ -719,7 +728,7 @@ void dcn31_clk_mgr_construct(
        }
 
        clk_mgr->base.base.dprefclk_khz = 600000;
-       clk_mgr->base.dccg->ref_dtbclk_khz = 600000;
+       clk_mgr->base.base.clks.ref_dtbclk_khz = 600000;
        dce_clock_read_ss_info(&clk_mgr->base);
        /*if bios enabled SS, driver needs to adjust dtb clock, only enable with correct bios*/
        //clk_mgr->base.dccg->ref_dtbclk_khz = dce_adjust_dp_ref_freq_for_ss(clk_mgr_internal, clk_mgr->base.base.dprefclk_khz);
index 961b10a..be06fdb 100644 (file)
@@ -51,6 +51,8 @@ void dcn31_clk_mgr_construct(struct dc_context *ctx,
                struct pp_smu_funcs *pp_smu,
                struct dccg *dccg);
 
+int dcn31_get_dtb_ref_freq_khz(struct clk_mgr *clk_mgr_base);
+
 void dcn31_clk_mgr_destroy(struct clk_mgr_internal *clk_mgr_int);
 
 #endif //__DCN31_CLK_MGR_H__
index a2ade6e..f438172 100644 (file)
@@ -41,9 +41,7 @@
 
 #include "dc_dmub_srv.h"
 
-#if defined (CONFIG_DRM_AMD_DC_DP2_0)
 #include "dc_link_dp.h"
-#endif
 
 #define TO_CLK_MGR_DCN315(clk_mgr)\
        container_of(clk_mgr, struct clk_mgr_dcn315, base)
@@ -552,7 +550,7 @@ static void dcn315_clk_mgr_helper_populate_bw_params(
                if (!bw_params->clk_table.entries[i].dtbclk_mhz)
                        bw_params->clk_table.entries[i].dtbclk_mhz = def_max.dtbclk_mhz;
        }
-       ASSERT(bw_params->clk_table.entries[i].dcfclk_mhz);
+       ASSERT(bw_params->clk_table.entries[i-1].dcfclk_mhz);
        bw_params->vram_type = bios_info->memory_type;
        bw_params->num_channels = bios_info->ma_channel_number;
        if (!bw_params->num_channels)
@@ -580,6 +578,7 @@ static void dcn315_enable_pme_wa(struct clk_mgr *clk_mgr_base)
 
 static struct clk_mgr_funcs dcn315_funcs = {
        .get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz,
+       .get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz,
        .update_clocks = dcn315_update_clocks,
        .init_clocks = dcn31_init_clocks,
        .enable_pme_wa = dcn315_enable_pme_wa,
@@ -656,9 +655,9 @@ void dcn315_clk_mgr_construct(
 
        clk_mgr->base.base.dprefclk_khz = 600000;
        clk_mgr->base.base.dprefclk_khz = dcn315_smu_get_dpref_clk(&clk_mgr->base);
-       clk_mgr->base.dccg->ref_dtbclk_khz = clk_mgr->base.base.dprefclk_khz;
+       clk_mgr->base.base.clks.ref_dtbclk_khz = clk_mgr->base.base.dprefclk_khz;
        dce_clock_read_ss_info(&clk_mgr->base);
-       clk_mgr->base.dccg->ref_dtbclk_khz = dce_adjust_dp_ref_freq_for_ss(&clk_mgr->base, clk_mgr->base.base.dprefclk_khz);
+       clk_mgr->base.base.clks.ref_dtbclk_khz = dce_adjust_dp_ref_freq_for_ss(&clk_mgr->base, clk_mgr->base.base.dprefclk_khz);
 
        clk_mgr->base.base.bw_params = &dcn315_bw_params;
 
index fc3af81..e4bb9c6 100644 (file)
@@ -571,6 +571,7 @@ static void dcn316_clk_mgr_helper_populate_bw_params(
 static struct clk_mgr_funcs dcn316_funcs = {
        .enable_pme_wa = dcn316_enable_pme_wa,
        .get_dp_ref_clk_frequency = dce12_get_dp_ref_freq_khz,
+       .get_dtb_ref_clk_frequency = dcn31_get_dtb_ref_freq_khz,
        .update_clocks = dcn316_update_clocks,
        .init_clocks = dcn31_init_clocks,
        .are_clock_states_equal = dcn31_are_clock_states_equal,
@@ -685,7 +686,7 @@ void dcn316_clk_mgr_construct(
 
        clk_mgr->base.base.dprefclk_khz = 600000;
        clk_mgr->base.base.dprefclk_khz = dcn316_smu_get_dpref_clk(&clk_mgr->base);
-       clk_mgr->base.dccg->ref_dtbclk_khz = clk_mgr->base.base.dprefclk_khz;
+       clk_mgr->base.base.clks.ref_dtbclk_khz = clk_mgr->base.base.dprefclk_khz;
        dce_clock_read_ss_info(&clk_mgr->base);
        /*clk_mgr->base.dccg->ref_dtbclk_khz =
        dce_adjust_dp_ref_freq_for_ss(&clk_mgr->base, clk_mgr->base.base.dprefclk_khz);*/
index dc30ac3..d8eee89 100644 (file)
@@ -114,8 +114,8 @@ static const struct dc_link_settings fail_safe_link_settings = {
 
 static bool decide_fallback_link_setting(
                struct dc_link *link,
-               struct dc_link_settings initial_link_settings,
-               struct dc_link_settings *current_link_setting,
+               struct dc_link_settings *max,
+               struct dc_link_settings *cur,
                enum link_training_result training_result);
 static void maximize_lane_settings(const struct link_training_settings *lt_settings,
                struct dc_lane_settings lane_settings[LANE_COUNT_DP_MAX]);
@@ -944,7 +944,7 @@ static void override_lane_settings(const struct link_training_settings *lt_setti
 
                return;
 
-       for (lane = 1; lane < LANE_COUNT_DP_MAX; lane++) {
+       for (lane = 0; lane < LANE_COUNT_DP_MAX; lane++) {
                if (lt_settings->voltage_swing)
                        lane_settings[lane].VOLTAGE_SWING = *lt_settings->voltage_swing;
                if (lt_settings->pre_emphasis)
@@ -2784,6 +2784,7 @@ bool perform_link_training_with_retries(
        enum dp_panel_mode panel_mode = dp_get_panel_mode(link);
        enum link_training_result status = LINK_TRAINING_CR_FAIL_LANE0;
        struct dc_link_settings cur_link_settings = *link_setting;
+       struct dc_link_settings max_link_settings = *link_setting;
        const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res);
        int fail_count = 0;
        bool is_link_bw_low = false; /* link bandwidth < stream bandwidth */
@@ -2793,7 +2794,6 @@ bool perform_link_training_with_retries(
 
        dp_trace_commit_lt_init(link);
 
-
        if (dp_get_link_encoding_format(&cur_link_settings) == DP_8b_10b_ENCODING)
                /* We need to do this before the link training to ensure the idle
                 * pattern in SST mode will be sent right after the link training
@@ -2909,19 +2909,15 @@ bool perform_link_training_with_retries(
                        uint32_t req_bw;
                        uint32_t link_bw;
 
-                       decide_fallback_link_setting(link, *link_setting, &cur_link_settings, status);
-                       /* Flag if reduced link bandwidth no longer meets stream requirements or fallen back to
-                        * minimum link bandwidth.
+                       decide_fallback_link_setting(link, &max_link_settings,
+                                       &cur_link_settings, status);
+                       /* Fail link training if reduced link bandwidth no longer meets
+                        * stream requirements.
                         */
                        req_bw = dc_bandwidth_in_kbps_from_timing(&stream->timing);
                        link_bw = dc_link_bandwidth_kbps(link, &cur_link_settings);
-                       is_link_bw_low = (req_bw > link_bw);
-                       is_link_bw_min = ((cur_link_settings.link_rate <= LINK_RATE_LOW) &&
-                               (cur_link_settings.lane_count <= LANE_COUNT_ONE));
-
-                       if (is_link_bw_low)
-                               DC_LOG_WARNING("%s: Link bandwidth too low after fallback req_bw(%d) > link_bw(%d)\n",
-                                       __func__, req_bw, link_bw);
+                       if (req_bw > link_bw)
+                               break;
                }
 
                msleep(delay_between_attempts);
@@ -3309,7 +3305,7 @@ static bool dp_verify_link_cap(
        int *fail_count)
 {
        struct dc_link_settings cur_link_settings = {0};
-       struct dc_link_settings initial_link_settings = *known_limit_link_setting;
+       struct dc_link_settings max_link_settings = *known_limit_link_setting;
        bool success = false;
        bool skip_video_pattern;
        enum clock_source_id dp_cs_id = get_clock_source_id(link);
@@ -3318,7 +3314,7 @@ static bool dp_verify_link_cap(
        struct link_resource link_res;
 
        memset(&irq_data, 0, sizeof(irq_data));
-       cur_link_settings = initial_link_settings;
+       cur_link_settings = max_link_settings;
 
        /* Grant extended timeout request */
        if ((link->lttpr_mode == LTTPR_MODE_NON_TRANSPARENT) && (link->dpcd_caps.lttpr_caps.max_ext_timeout > 0)) {
@@ -3361,7 +3357,7 @@ static bool dp_verify_link_cap(
                dp_trace_lt_result_update(link, status, true);
                dp_disable_link_phy(link, &link_res, link->connector_signal);
        } while (!success && decide_fallback_link_setting(link,
-                       initial_link_settings, &cur_link_settings, status));
+                       &max_link_settings, &cur_link_settings, status));
 
        link->verified_link_cap = success ?
                        cur_link_settings : fail_safe_link_settings;
@@ -3596,16 +3592,19 @@ static bool decide_fallback_link_setting_max_bw_policy(
  */
 static bool decide_fallback_link_setting(
                struct dc_link *link,
-               struct dc_link_settings initial_link_settings,
-               struct dc_link_settings *current_link_setting,
+               struct dc_link_settings *max,
+               struct dc_link_settings *cur,
                enum link_training_result training_result)
 {
-       if (!current_link_setting)
+       if (!cur)
+               return false;
+       if (!max)
                return false;
-       if (dp_get_link_encoding_format(&initial_link_settings) == DP_128b_132b_ENCODING ||
+
+       if (dp_get_link_encoding_format(max) == DP_128b_132b_ENCODING ||
                        link->dc->debug.force_dp2_lt_fallback_method)
-               return decide_fallback_link_setting_max_bw_policy(link, &initial_link_settings,
-                               current_link_setting, training_result);
+               return decide_fallback_link_setting_max_bw_policy(link, max, cur,
+                               training_result);
 
        switch (training_result) {
        case LINK_TRAINING_CR_FAIL_LANE0:
@@ -3613,28 +3612,18 @@ static bool decide_fallback_link_setting(
        case LINK_TRAINING_CR_FAIL_LANE23:
        case LINK_TRAINING_LQA_FAIL:
        {
-               if (!reached_minimum_link_rate
-                               (current_link_setting->link_rate)) {
-                       current_link_setting->link_rate =
-                               reduce_link_rate(
-                                       current_link_setting->link_rate);
-               } else if (!reached_minimum_lane_count
-                               (current_link_setting->lane_count)) {
-                       current_link_setting->link_rate =
-                               initial_link_settings.link_rate;
+               if (!reached_minimum_link_rate(cur->link_rate)) {
+                       cur->link_rate = reduce_link_rate(cur->link_rate);
+               } else if (!reached_minimum_lane_count(cur->lane_count)) {
+                       cur->link_rate = max->link_rate;
                        if (training_result == LINK_TRAINING_CR_FAIL_LANE0)
                                return false;
                        else if (training_result == LINK_TRAINING_CR_FAIL_LANE1)
-                               current_link_setting->lane_count =
-                                               LANE_COUNT_ONE;
-                       else if (training_result ==
-                                       LINK_TRAINING_CR_FAIL_LANE23)
-                               current_link_setting->lane_count =
-                                               LANE_COUNT_TWO;
+                               cur->lane_count = LANE_COUNT_ONE;
+                       else if (training_result == LINK_TRAINING_CR_FAIL_LANE23)
+                               cur->lane_count = LANE_COUNT_TWO;
                        else
-                               current_link_setting->lane_count =
-                                       reduce_lane_count(
-                                       current_link_setting->lane_count);
+                               cur->lane_count = reduce_lane_count(cur->lane_count);
                } else {
                        return false;
                }
@@ -3642,17 +3631,17 @@ static bool decide_fallback_link_setting(
        }
        case LINK_TRAINING_EQ_FAIL_EQ:
        {
-               if (!reached_minimum_lane_count
-                               (current_link_setting->lane_count)) {
-                       current_link_setting->lane_count =
-                               reduce_lane_count(
-                                       current_link_setting->lane_count);
-               } else if (!reached_minimum_link_rate
-                               (current_link_setting->link_rate)) {
-                       current_link_setting->link_rate =
-                               reduce_link_rate(
-                                       current_link_setting->link_rate);
-                       current_link_setting->lane_count = initial_link_settings.lane_count;
+               if (!reached_minimum_lane_count(cur->lane_count)) {
+                       cur->lane_count = reduce_lane_count(cur->lane_count);
+               } else if (!reached_minimum_link_rate(cur->link_rate)) {
+                       cur->link_rate = reduce_link_rate(cur->link_rate);
+                       /* Reduce max link rate to avoid potential infinite loop.
+                        * Needed so that any subsequent CR_FAIL fallback can't
+                        * re-set the link rate higher than the link rate from
+                        * the latest EQ_FAIL fallback.
+                        */
+                       max->link_rate = cur->link_rate;
+                       cur->lane_count = max->lane_count;
                } else {
                        return false;
                }
@@ -3660,12 +3649,15 @@ static bool decide_fallback_link_setting(
        }
        case LINK_TRAINING_EQ_FAIL_CR:
        {
-               if (!reached_minimum_link_rate
-                               (current_link_setting->link_rate)) {
-                       current_link_setting->link_rate =
-                               reduce_link_rate(
-                                       current_link_setting->link_rate);
-                       current_link_setting->lane_count = initial_link_settings.lane_count;
+               if (!reached_minimum_link_rate(cur->link_rate)) {
+                       cur->link_rate = reduce_link_rate(cur->link_rate);
+                       /* Reduce max link rate to avoid potential infinite loop.
+                        * Needed so that any subsequent CR_FAIL fallback can't
+                        * re-set the link rate higher than the link rate from
+                        * the latest EQ_FAIL fallback.
+                        */
+                       max->link_rate = cur->link_rate;
+                       cur->lane_count = max->lane_count;
                } else {
                        return false;
                }
index 3960c74..817028d 100644 (file)
@@ -47,7 +47,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.186"
+#define DC_VER "3.2.187"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
@@ -416,6 +416,7 @@ struct dc_clocks {
        bool p_state_change_support;
        enum dcn_zstate_support_state zstate_support;
        bool dtbclk_en;
+       int ref_dtbclk_khz;
        enum dcn_pwr_state pwr_state;
        /*
         * Elements below are not compared for the purposes of
@@ -719,6 +720,8 @@ struct dc_debug_options {
        bool apply_vendor_specific_lttpr_wa;
        bool extended_blank_optimization;
        union aux_wake_wa_options aux_wake_wa;
+       /* uses value at boot and disables switch */
+       bool disable_dtb_ref_clk_switch;
        uint8_t psr_power_use_phy_fsm;
        enum dml_hostvm_override_opts dml_hostvm_override;
 };
index 7eff781..5f2afa5 100644 (file)
@@ -1766,29 +1766,9 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
                                break;
                        }
                }
-
-               /*
-                * TO-DO: So far the code logic below only addresses single eDP case.
-                * For dual eDP case, there are a few things that need to be
-                * implemented first:
-                *
-                * 1. Change the fastboot logic above, so eDP link[0 or 1]'s
-                * stream[0 or 1] will all be checked.
-                *
-                * 2. Change keep_edp_vdd_on to an array, and maintain keep_edp_vdd_on
-                * for each eDP.
-                *
-                * Once above 2 things are completed, we can then change the logic below
-                * correspondingly, so dual eDP case will be fully covered.
-                */
-
-               // We are trying to enable eDP, don't power down VDD if eDP stream is existing
-               if ((edp_stream_num == 1 && edp_streams[0] != NULL) || can_apply_edp_fast_boot) {
+               // We are trying to enable eDP, don't power down VDD
+               if (can_apply_edp_fast_boot)
                        keep_edp_vdd_on = true;
-                       DC_LOG_EVENT_LINK_TRAINING("Keep eDP Vdd on\n");
-               } else {
-                       DC_LOG_EVENT_LINK_TRAINING("No eDP stream enabled, turn eDP Vdd off\n");
-               }
        }
 
        // Check seamless boot support
index 970b65e..eaa7032 100644 (file)
@@ -212,6 +212,9 @@ static void dpp2_cnv_setup (
                break;
        }
 
+       /* Set default color space based on format if none is given. */
+       color_space = input_color_space ? input_color_space : color_space;
+
        if (is_2bit == 1 && alpha_2bit_lut != NULL) {
                REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT0, alpha_2bit_lut->lut0);
                REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT1, alpha_2bit_lut->lut1);
index 8b6505b..f50ab96 100644 (file)
@@ -153,6 +153,9 @@ static void dpp201_cnv_setup(
                break;
        }
 
+       /* Set default color space based on format if none is given. */
+       color_space = input_color_space ? input_color_space : color_space;
+
        if (is_2bit == 1 && alpha_2bit_lut != NULL) {
                REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT0, alpha_2bit_lut->lut0);
                REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT1, alpha_2bit_lut->lut1);
index ab3918c..0dcc075 100644 (file)
@@ -294,6 +294,9 @@ static void dpp3_cnv_setup (
                break;
        }
 
+       /* Set default color space based on format if none is given. */
+       color_space = input_color_space ? input_color_space : color_space;
+
        if (is_2bit == 1 && alpha_2bit_lut != NULL) {
                REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT0, alpha_2bit_lut->lut0);
                REG_UPDATE(ALPHA_2BIT_LUT, ALPHA_2BIT_LUT1, alpha_2bit_lut->lut1);
index 287a106..bbc58d1 100644 (file)
@@ -513,12 +513,10 @@ void dccg31_set_physymclk(
 /* Controls the generation of pixel valid for OTG in (OTG -> HPO case) */
 static void dccg31_set_dtbclk_dto(
                struct dccg *dccg,
-               int dtbclk_inst,
-               int req_dtbclk_khz,
-               int num_odm_segments,
-               const struct dc_crtc_timing *timing)
+               struct dtbclk_dto_params *params)
 {
        struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+       int req_dtbclk_khz = params->pixclk_khz;
        uint32_t dtbdto_div;
 
        /* Mode                 DTBDTO Rate       DTBCLK_DTO<x>_DIV Register
@@ -529,57 +527,53 @@ static void dccg31_set_dtbclk_dto(
         * DSC native 4:2:2     pixel rate/2      4
         * Other modes          pixel rate        8
         */
-       if (num_odm_segments == 4) {
+       if (params->num_odm_segments == 4) {
                dtbdto_div = 2;
-               req_dtbclk_khz = req_dtbclk_khz / 4;
-       } else if ((num_odm_segments == 2) ||
-                       (timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) ||
-                       (timing->flags.DSC && timing->pixel_encoding == PIXEL_ENCODING_YCBCR422
-                                       && !timing->dsc_cfg.ycbcr422_simple)) {
+               req_dtbclk_khz = params->pixclk_khz / 4;
+       } else if ((params->num_odm_segments == 2) ||
+                       (params->timing->pixel_encoding == PIXEL_ENCODING_YCBCR420) ||
+                       (params->timing->flags.DSC && params->timing->pixel_encoding == PIXEL_ENCODING_YCBCR422
+                                       && !params->timing->dsc_cfg.ycbcr422_simple)) {
                dtbdto_div = 4;
-               req_dtbclk_khz = req_dtbclk_khz / 2;
+               req_dtbclk_khz = params->pixclk_khz / 2;
        } else
                dtbdto_div = 8;
 
-       if (dccg->ref_dtbclk_khz && req_dtbclk_khz) {
+       if (params->ref_dtbclk_khz && req_dtbclk_khz) {
                uint32_t modulo, phase;
 
                // phase / modulo = dtbclk / dtbclk ref
-               modulo = dccg->ref_dtbclk_khz * 1000;
-               phase = div_u64((((unsigned long long)modulo * req_dtbclk_khz) + dccg->ref_dtbclk_khz - 1),
-                       dccg->ref_dtbclk_khz);
+               modulo = params->ref_dtbclk_khz * 1000;
+               phase = div_u64((((unsigned long long)modulo * req_dtbclk_khz) + params->ref_dtbclk_khz - 1),
+                               params->ref_dtbclk_khz);
 
-               REG_UPDATE(OTG_PIXEL_RATE_CNTL[dtbclk_inst],
-                               DTBCLK_DTO_DIV[dtbclk_inst], dtbdto_div);
+               REG_UPDATE(OTG_PIXEL_RATE_CNTL[params->otg_inst],
+                               DTBCLK_DTO_DIV[params->otg_inst], dtbdto_div);
 
-               REG_WRITE(DTBCLK_DTO_MODULO[dtbclk_inst], modulo);
-               REG_WRITE(DTBCLK_DTO_PHASE[dtbclk_inst], phase);
+               REG_WRITE(DTBCLK_DTO_MODULO[params->otg_inst], modulo);
+               REG_WRITE(DTBCLK_DTO_PHASE[params->otg_inst], phase);
 
-               REG_UPDATE(OTG_PIXEL_RATE_CNTL[dtbclk_inst],
-                               DTBCLK_DTO_ENABLE[dtbclk_inst], 1);
+               REG_UPDATE(OTG_PIXEL_RATE_CNTL[params->otg_inst],
+                               DTBCLK_DTO_ENABLE[params->otg_inst], 1);
 
-               REG_WAIT(OTG_PIXEL_RATE_CNTL[dtbclk_inst],
-                               DTBCLKDTO_ENABLE_STATUS[dtbclk_inst], 1,
+               REG_WAIT(OTG_PIXEL_RATE_CNTL[params->otg_inst],
+                               DTBCLKDTO_ENABLE_STATUS[params->otg_inst], 1,
                                1, 100);
 
                /* The recommended programming sequence to enable DTBCLK DTO to generate
                 * valid pixel HPO DPSTREAM ENCODER, specifies that DTO source select should
                 * be set only after DTO is enabled
                 */
-               REG_UPDATE(OTG_PIXEL_RATE_CNTL[dtbclk_inst],
-                               PIPE_DTO_SRC_SEL[dtbclk_inst], 1);
-
-               dccg->dtbclk_khz[dtbclk_inst] = req_dtbclk_khz;
+               REG_UPDATE(OTG_PIXEL_RATE_CNTL[params->otg_inst],
+                               PIPE_DTO_SRC_SEL[params->otg_inst], 1);
        } else {
-               REG_UPDATE_3(OTG_PIXEL_RATE_CNTL[dtbclk_inst],
-                               DTBCLK_DTO_ENABLE[dtbclk_inst], 0,
-                               PIPE_DTO_SRC_SEL[dtbclk_inst], 0,
-                               DTBCLK_DTO_DIV[dtbclk_inst], dtbdto_div);
+               REG_UPDATE_3(OTG_PIXEL_RATE_CNTL[params->otg_inst],
+                               DTBCLK_DTO_ENABLE[params->otg_inst], 0,
+                               PIPE_DTO_SRC_SEL[params->otg_inst], 0,
+                               DTBCLK_DTO_DIV[params->otg_inst], dtbdto_div);
 
-               REG_WRITE(DTBCLK_DTO_MODULO[dtbclk_inst], 0);
-               REG_WRITE(DTBCLK_DTO_PHASE[dtbclk_inst], 0);
-
-               dccg->dtbclk_khz[dtbclk_inst] = 0;
+               REG_WRITE(DTBCLK_DTO_MODULO[params->otg_inst], 0);
+               REG_WRITE(DTBCLK_DTO_PHASE[params->otg_inst], 0);
        }
 }
 
@@ -606,16 +600,12 @@ void dccg31_set_audio_dtbclk_dto(
 
                REG_UPDATE(DCCG_AUDIO_DTO_SOURCE,
                                DCCG_AUDIO_DTO_SEL, 4);  //  04 - DCCG_AUDIO_DTO_SEL_AUDIO_DTO_DTBCLK
-
-               dccg->audio_dtbclk_khz = req_audio_dtbclk_khz;
        } else {
                REG_WRITE(DCCG_AUDIO_DTBCLK_DTO_PHASE, 0);
                REG_WRITE(DCCG_AUDIO_DTBCLK_DTO_MODULO, 0);
 
                REG_UPDATE(DCCG_AUDIO_DTO_SOURCE,
                                DCCG_AUDIO_DTO_SEL, 3);  //  03 - DCCG_AUDIO_DTO_SEL_NO_AUDIO_DTO
-
-               dccg->audio_dtbclk_khz = 0;
        }
 }
 
index d94fd10..8b12b41 100644 (file)
@@ -230,9 +230,7 @@ static void enc31_hw_init(struct link_encoder *enc)
        AUX_RX_PHASE_DETECT_LEN,  [21,20] = 0x3 default is 3
        AUX_RX_DETECTION_THRESHOLD [30:28] = 1
 */
-       AUX_REG_WRITE(AUX_DPHY_RX_CONTROL0, 0x103d1110);
-
-       AUX_REG_WRITE(AUX_DPHY_TX_CONTROL, 0x21c7a);
+       // dmub will read AUX_DPHY_RX_CONTROL0/AUX_DPHY_TX_CONTROL from vbios table in dp_aux_init
 
        //AUX_DPHY_TX_REF_CONTROL'AUX_TX_REF_DIV HW default is 0x32;
        // Set AUX_TX_REF_DIV Divider to generate 2 MHz reference from refclk
index 789f756..d227367 100644 (file)
@@ -1284,10 +1284,8 @@ static bool is_dtbclk_required(struct dc *dc, struct dc_state *context)
        for (i = 0; i < dc->res_pool->pipe_count; i++) {
                if (!context->res_ctx.pipe_ctx[i].stream)
                        continue;
-#if defined (CONFIG_DRM_AMD_DC_DP2_0)
                if (is_dp_128b_132b_signal(&context->res_ctx.pipe_ctx[i]))
                        return true;
-#endif
        }
        return false;
 }
index 46ce5a0..b5570aa 100644 (file)
@@ -237,6 +237,7 @@ struct clk_mgr_funcs {
                        bool safe_to_lower);
 
        int (*get_dp_ref_clk_frequency)(struct clk_mgr *clk_mgr);
+       int (*get_dtb_ref_clk_frequency)(struct clk_mgr *clk_mgr);
 
        void (*set_low_power_state)(struct clk_mgr *clk_mgr);
 
index b2fa4de..c702191 100644 (file)
@@ -60,8 +60,17 @@ struct dccg {
        const struct dccg_funcs *funcs;
        int pipe_dppclk_khz[MAX_PIPES];
        int ref_dppclk;
-       int dtbclk_khz[MAX_PIPES];
-       int audio_dtbclk_khz;
+       //int dtbclk_khz[MAX_PIPES];/* TODO needs to be removed */
+       //int audio_dtbclk_khz;/* TODO needs to be removed */
+       int ref_dtbclk_khz;/* TODO needs to be removed */
+};
+
+struct dtbclk_dto_params {
+       const struct dc_crtc_timing *timing;
+       int otg_inst;
+       int pixclk_khz;
+       int req_audio_dtbclk_khz;
+       int num_odm_segments;
        int ref_dtbclk_khz;
 };
 
@@ -111,10 +120,7 @@ struct dccg_funcs {
 
        void (*set_dtbclk_dto)(
                        struct dccg *dccg,
-                       int dtbclk_inst,
-                       int req_dtbclk_khz,
-                       int num_odm_segments,
-                       const struct dc_crtc_timing *timing);
+                       struct dtbclk_dto_params *dto_params);
 
        void (*set_audio_dtbclk_dto)(
                        struct dccg *dccg,
index 87972dc..ea6cf8b 100644 (file)
@@ -27,6 +27,7 @@
 #include "core_types.h"
 #include "dccg.h"
 #include "dc_link_dp.h"
+#include "clk_mgr.h"
 
 static enum phyd32clk_clock_source get_phyd32clk_src(struct dc_link *link)
 {
@@ -106,14 +107,18 @@ static void setup_hpo_dp_stream_encoder(struct pipe_ctx *pipe_ctx)
        struct hpo_dp_link_encoder *link_enc = pipe_ctx->link_res.hpo_dp_link_enc;
        struct dccg *dccg = dc->res_pool->dccg;
        struct timing_generator *tg = pipe_ctx->stream_res.tg;
-       int odm_segment_count = get_odm_segment_count(pipe_ctx);
+       struct dtbclk_dto_params dto_params = {0};
        enum phyd32clk_clock_source phyd32clk = get_phyd32clk_src(pipe_ctx->stream->link);
 
+       dto_params.otg_inst = tg->inst;
+       dto_params.pixclk_khz = pipe_ctx->stream->phy_pix_clk;
+       dto_params.num_odm_segments = get_odm_segment_count(pipe_ctx);
+       dto_params.timing = &pipe_ctx->stream->timing;
+       dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr);
+
        dccg->funcs->set_dpstreamclk(dccg, DTBCLK0, tg->inst);
        dccg->funcs->enable_symclk32_se(dccg, stream_enc->inst, phyd32clk);
-       dccg->funcs->set_dtbclk_dto(dccg, tg->inst, pipe_ctx->stream->phy_pix_clk,
-                       odm_segment_count,
-                       &pipe_ctx->stream->timing);
+       dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
        stream_enc->funcs->enable_stream(stream_enc);
        stream_enc->funcs->map_stream_to_link(stream_enc, stream_enc->inst, link_enc->inst);
 }
@@ -124,9 +129,13 @@ static void reset_hpo_dp_stream_encoder(struct pipe_ctx *pipe_ctx)
        struct hpo_dp_stream_encoder *stream_enc = pipe_ctx->stream_res.hpo_dp_stream_enc;
        struct dccg *dccg = dc->res_pool->dccg;
        struct timing_generator *tg = pipe_ctx->stream_res.tg;
+       struct dtbclk_dto_params dto_params = {0};
+
+       dto_params.otg_inst = tg->inst;
+       dto_params.timing = &pipe_ctx->stream->timing;
 
        stream_enc->funcs->disable(stream_enc);
-       dccg->funcs->set_dtbclk_dto(dccg, tg->inst, 0, 0, &pipe_ctx->stream->timing);
+       dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
        dccg->funcs->disable_symclk32_se(dccg, stream_enc->inst);
        dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst);
 }
index 7c9330a..c7bd7e2 100644 (file)
@@ -84,7 +84,7 @@ void dmub_dcn31_reset(struct dmub_srv *dmub)
 {
        union dmub_gpint_data_register cmd;
        const uint32_t timeout = 100;
-       uint32_t in_reset, scratch, i;
+       uint32_t in_reset, scratch, i, pwait_mode;
 
        REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &in_reset);
 
@@ -115,6 +115,13 @@ void dmub_dcn31_reset(struct dmub_srv *dmub)
                        udelay(1);
                }
 
+               for (i = 0; i < timeout; ++i) {
+                       REG_GET(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS, &pwait_mode);
+                       if (pwait_mode & (1 << 0))
+                               break;
+
+                       udelay(1);
+               }
                /* Force reset in case we timed out, DMCUB is likely hung. */
        }
 
@@ -125,6 +132,8 @@ void dmub_dcn31_reset(struct dmub_srv *dmub)
        REG_WRITE(DMCUB_INBOX1_WPTR, 0);
        REG_WRITE(DMCUB_OUTBOX1_RPTR, 0);
        REG_WRITE(DMCUB_OUTBOX1_WPTR, 0);
+       REG_WRITE(DMCUB_OUTBOX0_RPTR, 0);
+       REG_WRITE(DMCUB_OUTBOX0_WPTR, 0);
        REG_WRITE(DMCUB_SCRATCH0, 0);
 
        /* Clear the GPINT command manually so we don't send anything during boot. */
index 59ddc81..f6db6f8 100644 (file)
@@ -151,7 +151,8 @@ struct dmub_srv;
        DMUB_SF(DCN_VM_FB_OFFSET, FB_OFFSET) \
        DMUB_SF(DMCUB_INBOX0_WPTR, DMCUB_INBOX0_WPTR) \
        DMUB_SF(DMCUB_INTERRUPT_ENABLE, DMCUB_GPINT_IH_INT_EN) \
-       DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK)
+       DMUB_SF(DMCUB_INTERRUPT_ACK, DMCUB_GPINT_IH_INT_ACK) \
+       DMUB_SF(DMCUB_CNTL, DMCUB_PWAIT_MODE_STATUS)
 
 struct dmub_srv_dcn31_reg_offset {
 #define DMUB_SR(reg) uint32_t reg;
index 73b9e0a..20a3d4e 100644 (file)
@@ -127,6 +127,8 @@ struct av_sync_data {
 static const uint8_t DP_SINK_DEVICE_STR_ID_1[] = {7, 1, 8, 7, 3, 0};
 static const uint8_t DP_SINK_DEVICE_STR_ID_2[] = {7, 1, 8, 7, 5, 0};
 
+static const u8 DP_SINK_BRANCH_DEV_NAME_7580[] = "7580\x80u";
+
 /*MST Dock*/
 static const uint8_t SYNAPTICS_DEVICE_ID[] = "SYNA";
 
index 247c6e9..1cb399d 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef SMU_11_0_7_PPTABLE_H
 #define SMU_11_0_7_PPTABLE_H
 
+#pragma pack(push, 1)
 
 #define SMU_11_0_7_TABLE_FORMAT_REVISION                  15
 
@@ -139,7 +140,7 @@ struct smu_11_0_7_overdrive_table
     uint32_t max[SMU_11_0_7_MAX_ODSETTING];                   //default maximum settings
     uint32_t min[SMU_11_0_7_MAX_ODSETTING];                   //default minimum settings
     int16_t  pm_setting[SMU_11_0_7_MAX_PMSETTING];            //Optimized power mode feature settings
-} __attribute__((packed));
+};
 
 enum SMU_11_0_7_PPCLOCK_ID {
     SMU_11_0_7_PPCLOCK_GFXCLK = 0,
@@ -166,7 +167,7 @@ struct smu_11_0_7_power_saving_clock_table
     uint32_t count;                                           //power_saving_clock_count = SMU_11_0_7_PPCLOCK_COUNT
     uint32_t max[SMU_11_0_7_MAX_PPCLOCK];                       //PowerSavingClock Mode Clock Maximum array In MHz
     uint32_t min[SMU_11_0_7_MAX_PPCLOCK];                       //PowerSavingClock Mode Clock Minimum array In MHz
-} __attribute__((packed));
+};
 
 struct smu_11_0_7_powerplay_table
 {
@@ -191,6 +192,8 @@ struct smu_11_0_7_powerplay_table
       struct smu_11_0_7_overdrive_table               overdrive_table;
 
       PPTable_t smc_pptable;                        //PPTable_t in smu11_driver_if.h
-} __attribute__((packed));
+};
+
+#pragma pack(pop)
 
 #endif
index 7a63cf8..0116e3d 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef SMU_11_0_PPTABLE_H
 #define SMU_11_0_PPTABLE_H
 
+#pragma pack(push, 1)
 
 #define SMU_11_0_TABLE_FORMAT_REVISION                  12
 
@@ -109,7 +110,7 @@ struct smu_11_0_overdrive_table
     uint8_t  cap[SMU_11_0_MAX_ODFEATURE];                     //OD feature support flags
     uint32_t max[SMU_11_0_MAX_ODSETTING];                     //default maximum settings
     uint32_t min[SMU_11_0_MAX_ODSETTING];                     //default minimum settings
-} __attribute__((packed));
+};
 
 enum SMU_11_0_PPCLOCK_ID {
     SMU_11_0_PPCLOCK_GFXCLK = 0,
@@ -133,7 +134,7 @@ struct smu_11_0_power_saving_clock_table
     uint32_t count;                                           //power_saving_clock_count = SMU_11_0_PPCLOCK_COUNT
     uint32_t max[SMU_11_0_MAX_PPCLOCK];                       //PowerSavingClock Mode Clock Maximum array In MHz
     uint32_t min[SMU_11_0_MAX_PPCLOCK];                       //PowerSavingClock Mode Clock Minimum array In MHz
-} __attribute__((packed));
+};
 
 struct smu_11_0_powerplay_table
 {
@@ -162,6 +163,8 @@ struct smu_11_0_powerplay_table
 #ifndef SMU_11_0_PARTIAL_PPTABLE
       PPTable_t smc_pptable;                        //PPTable_t in smu11_driver_if.h
 #endif
-} __attribute__((packed));
+};
+
+#pragma pack(pop)
 
 #endif
index 3f29f43..478862d 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef SMU_13_0_7_PPTABLE_H
 #define SMU_13_0_7_PPTABLE_H
 
+#pragma pack(push, 1)
+
 #define SMU_13_0_7_TABLE_FORMAT_REVISION 15
 
 //// POWERPLAYTABLE::ulPlatformCaps
@@ -194,7 +196,8 @@ struct smu_13_0_7_powerplay_table
     struct smu_13_0_7_overdrive_table overdrive_table;
     uint8_t padding1;
     PPTable_t smc_pptable; //PPTable_t in driver_if.h
-} __attribute__((packed));
+};
 
+#pragma pack(pop)
 
 #endif
index 1f31139..0433074 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef SMU_13_0_PPTABLE_H
 #define SMU_13_0_PPTABLE_H
 
+#pragma pack(push, 1)
+
 #define SMU_13_0_TABLE_FORMAT_REVISION                  1
 
 //// POWERPLAYTABLE::ulPlatformCaps
@@ -109,7 +111,7 @@ struct smu_13_0_overdrive_table {
        uint8_t  cap[SMU_13_0_MAX_ODFEATURE];                     //OD feature support flags
        uint32_t max[SMU_13_0_MAX_ODSETTING];                     //default maximum settings
        uint32_t min[SMU_13_0_MAX_ODSETTING];                     //default minimum settings
-} __attribute__((packed));
+};
 
 enum SMU_13_0_PPCLOCK_ID {
        SMU_13_0_PPCLOCK_GFXCLK = 0,
@@ -132,7 +134,7 @@ struct smu_13_0_power_saving_clock_table {
        uint32_t count;                                           //power_saving_clock_count = SMU_11_0_PPCLOCK_COUNT
        uint32_t max[SMU_13_0_MAX_PPCLOCK];                       //PowerSavingClock Mode Clock Maximum array In MHz
        uint32_t min[SMU_13_0_MAX_PPCLOCK];                       //PowerSavingClock Mode Clock Minimum array In MHz
-} __attribute__((packed));
+};
 
 struct smu_13_0_powerplay_table {
        struct atom_common_table_header header;
@@ -160,6 +162,8 @@ struct smu_13_0_powerplay_table {
 #ifndef SMU_13_0_PARTIAL_PPTABLE
        PPTable_t smc_pptable;                        //PPTable_t in driver_if.h
 #endif
-} __attribute__((packed));
+};
+
+#pragma pack(pop)
 
 #endif
index 4551bc8..f573d58 100644 (file)
@@ -160,13 +160,12 @@ void ast_dp_launch(struct drm_device *dev, u8 bPower)
                }
 
                if (bDPExecute)
-                       ast->tx_chip_type = AST_TX_ASTDP;
+                       ast->tx_chip_types |= BIT(AST_TX_ASTDP);
 
                ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xE5,
                                                        (u8) ~ASTDP_HOST_EDID_READ_DONE_MASK,
                                                        ASTDP_HOST_EDID_READ_DONE);
-       } else
-               ast->tx_chip_type = AST_TX_NONE;
+       }
 }
 
 
index 204c926..4f75a9e 100644 (file)
@@ -450,7 +450,7 @@ void ast_init_3rdtx(struct drm_device *dev)
                        ast_init_dvo(dev);
                        break;
                default:
-                       if (ast->tx_chip_type == AST_TX_SIL164)
+                       if (ast->tx_chip_types & BIT(AST_TX_SIL164))
                                ast_init_dvo(dev);
                        else
                                ast_init_analog(dev);
index afebe35..a34db43 100644 (file)
@@ -73,6 +73,11 @@ enum ast_tx_chip {
        AST_TX_ASTDP,
 };
 
+#define AST_TX_NONE_BIT                BIT(AST_TX_NONE)
+#define AST_TX_SIL164_BIT      BIT(AST_TX_SIL164)
+#define AST_TX_DP501_BIT       BIT(AST_TX_DP501)
+#define AST_TX_ASTDP_BIT       BIT(AST_TX_ASTDP)
+
 #define AST_DRAM_512Mx16 0
 #define AST_DRAM_1Gx16   1
 #define AST_DRAM_512Mx32 2
@@ -173,7 +178,7 @@ struct ast_private {
        struct drm_plane primary_plane;
        struct ast_cursor_plane cursor_plane;
        struct drm_crtc crtc;
-       union {
+       struct {
                struct {
                        struct drm_encoder encoder;
                        struct ast_vga_connector vga_connector;
@@ -199,7 +204,7 @@ struct ast_private {
                ast_use_defaults
        } config_mode;
 
-       enum ast_tx_chip tx_chip_type;
+       unsigned long tx_chip_types;            /* bitfield of enum ast_chip_type */
        u8 *dp501_fw_addr;
        const struct firmware *dp501_fw;        /* dp501 fw */
 };
index d770d5a..0674532 100644 (file)
@@ -216,7 +216,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
        }
 
        /* Check 3rd Tx option (digital output afaik) */
-       ast->tx_chip_type = AST_TX_NONE;
+       ast->tx_chip_types |= AST_TX_NONE_BIT;
 
        /*
         * VGACRA3 Enhanced Color Mode Register, check if DVO is already
@@ -229,7 +229,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
        if (!*need_post) {
                jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xff);
                if (jreg & 0x80)
-                       ast->tx_chip_type = AST_TX_SIL164;
+                       ast->tx_chip_types = AST_TX_SIL164_BIT;
        }
 
        if ((ast->chip == AST2300) || (ast->chip == AST2400) || (ast->chip == AST2500)) {
@@ -241,7 +241,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
                jreg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff);
                switch (jreg) {
                case 0x04:
-                       ast->tx_chip_type = AST_TX_SIL164;
+                       ast->tx_chip_types = AST_TX_SIL164_BIT;
                        break;
                case 0x08:
                        ast->dp501_fw_addr = drmm_kzalloc(dev, 32*1024, GFP_KERNEL);
@@ -254,22 +254,19 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
                        }
                        fallthrough;
                case 0x0c:
-                       ast->tx_chip_type = AST_TX_DP501;
+                       ast->tx_chip_types = AST_TX_DP501_BIT;
                }
        } else if (ast->chip == AST2600)
                ast_dp_launch(&ast->base, 0);
 
        /* Print stuff for diagnostic purposes */
-       switch(ast->tx_chip_type) {
-       case AST_TX_SIL164:
+       if (ast->tx_chip_types & AST_TX_NONE_BIT)
+               drm_info(dev, "Using analog VGA\n");
+       if (ast->tx_chip_types & AST_TX_SIL164_BIT)
                drm_info(dev, "Using Sil164 TMDS transmitter\n");
-               break;
-       case AST_TX_DP501:
+       if (ast->tx_chip_types & AST_TX_DP501_BIT)
                drm_info(dev, "Using DP501 DisplayPort transmitter\n");
-               break;
-       default:
-               drm_info(dev, "Analog VGA only\n");
-       }
+
        return 0;
 }
 
index 323af27..db2010a 100644 (file)
@@ -997,10 +997,10 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
        case DRM_MODE_DPMS_ON:
                ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT,  0x01, 0xdf, 0);
                ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xfc, 0);
-               if (ast->tx_chip_type == AST_TX_DP501)
+               if (ast->tx_chip_types & AST_TX_DP501_BIT)
                        ast_set_dp501_video_output(crtc->dev, 1);
 
-               if (ast->tx_chip_type == AST_TX_ASTDP) {
+               if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
                        ast_dp_power_on_off(crtc->dev, AST_DP_POWER_ON);
                        ast_wait_for_vretrace(ast);
                        ast_dp_set_on_off(crtc->dev, 1);
@@ -1012,17 +1012,17 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
        case DRM_MODE_DPMS_SUSPEND:
        case DRM_MODE_DPMS_OFF:
                ch = mode;
-               if (ast->tx_chip_type == AST_TX_DP501)
+               if (ast->tx_chip_types & AST_TX_DP501_BIT)
                        ast_set_dp501_video_output(crtc->dev, 0);
-               break;
 
-               if (ast->tx_chip_type == AST_TX_ASTDP) {
+               if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
                        ast_dp_set_on_off(crtc->dev, 0);
                        ast_dp_power_on_off(crtc->dev, AST_DP_POWER_OFF);
                }
 
                ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT,  0x01, 0xdf, 0x20);
                ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xfc, ch);
+               break;
        }
 }
 
@@ -1155,7 +1155,7 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
                ast_crtc_load_lut(ast, crtc);
 
        //Set Aspeed Display-Port
-       if (ast->tx_chip_type == AST_TX_ASTDP)
+       if (ast->tx_chip_types & AST_TX_ASTDP_BIT)
                ast_dp_set_mode(crtc, vbios_mode_info);
 
        mutex_unlock(&ast->ioregs_lock);
@@ -1739,22 +1739,26 @@ int ast_mode_config_init(struct ast_private *ast)
 
        ast_crtc_init(dev);
 
-       switch (ast->tx_chip_type) {
-       case AST_TX_NONE:
+       if (ast->tx_chip_types & AST_TX_NONE_BIT) {
                ret = ast_vga_output_init(ast);
-               break;
-       case AST_TX_SIL164:
+               if (ret)
+                       return ret;
+       }
+       if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
                ret = ast_sil164_output_init(ast);
-               break;
-       case AST_TX_DP501:
+               if (ret)
+                       return ret;
+       }
+       if (ast->tx_chip_types & AST_TX_DP501_BIT) {
                ret = ast_dp501_output_init(ast);
-               break;
-       case AST_TX_ASTDP:
+               if (ret)
+                       return ret;
+       }
+       if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
                ret = ast_astdp_output_init(ast);
-               break;
+               if (ret)
+                       return ret;
        }
-       if (ret)
-               return ret;
 
        drm_mode_config_reset(dev);
 
index 0aa9cf0..82fd3c8 100644 (file)
@@ -391,7 +391,7 @@ void ast_post_gpu(struct drm_device *dev)
 
                ast_init_3rdtx(dev);
        } else {
-               if (ast->tx_chip_type != AST_TX_NONE)
+               if (ast->tx_chip_types & AST_TX_SIL164_BIT)
                        ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa3, 0xcf, 0x80);        /* Enable DVO */
        }
 }
index b97f6e8..01c8b80 100644 (file)
@@ -1266,6 +1266,25 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge,
        return 0;
 }
 
+static
+struct drm_crtc *analogix_dp_get_old_crtc(struct analogix_dp_device *dp,
+                                         struct drm_atomic_state *state)
+{
+       struct drm_encoder *encoder = dp->encoder;
+       struct drm_connector *connector;
+       struct drm_connector_state *conn_state;
+
+       connector = drm_atomic_get_old_connector_for_encoder(state, encoder);
+       if (!connector)
+               return NULL;
+
+       conn_state = drm_atomic_get_old_connector_state(state, connector);
+       if (!conn_state)
+               return NULL;
+
+       return conn_state->crtc;
+}
+
 static
 struct drm_crtc *analogix_dp_get_new_crtc(struct analogix_dp_device *dp,
                                          struct drm_atomic_state *state)
@@ -1446,14 +1465,16 @@ analogix_dp_bridge_atomic_disable(struct drm_bridge *bridge,
 {
        struct drm_atomic_state *old_state = old_bridge_state->base.state;
        struct analogix_dp_device *dp = bridge->driver_private;
-       struct drm_crtc *crtc;
+       struct drm_crtc *old_crtc, *new_crtc;
+       struct drm_crtc_state *old_crtc_state = NULL;
        struct drm_crtc_state *new_crtc_state = NULL;
+       int ret;
 
-       crtc = analogix_dp_get_new_crtc(dp, old_state);
-       if (!crtc)
+       new_crtc = analogix_dp_get_new_crtc(dp, old_state);
+       if (!new_crtc)
                goto out;
 
-       new_crtc_state = drm_atomic_get_new_crtc_state(old_state, crtc);
+       new_crtc_state = drm_atomic_get_new_crtc_state(old_state, new_crtc);
        if (!new_crtc_state)
                goto out;
 
@@ -1462,6 +1483,19 @@ analogix_dp_bridge_atomic_disable(struct drm_bridge *bridge,
                return;
 
 out:
+       old_crtc = analogix_dp_get_old_crtc(dp, old_state);
+       if (old_crtc) {
+               old_crtc_state = drm_atomic_get_old_crtc_state(old_state,
+                                                              old_crtc);
+
+               /* When moving from PSR to fully disabled, exit PSR first. */
+               if (old_crtc_state && old_crtc_state->self_refresh_active) {
+                       ret = analogix_dp_disable_psr(dp);
+                       if (ret)
+                               DRM_ERROR("Failed to disable psr (%d)\n", ret);
+               }
+       }
+
        analogix_dp_bridge_disable(bridge);
 }
 
index 2831f08..ac66f40 100644 (file)
@@ -577,7 +577,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
        ctx->host_node = of_graph_get_remote_port_parent(endpoint);
        of_node_put(endpoint);
 
-       if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
+       if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
                ret = -EINVAL;
                goto err_put_node;
        }
index 9603193..987e4b2 100644 (file)
@@ -1011,9 +1011,19 @@ crtc_needs_disable(struct drm_crtc_state *old_state,
                return drm_atomic_crtc_effectively_active(old_state);
 
        /*
-        * We need to run through the crtc_funcs->disable() function if the CRTC
-        * is currently on, if it's transitioning to self refresh mode, or if
-        * it's in self refresh mode and needs to be fully disabled.
+        * We need to disable bridge(s) and CRTC if we're transitioning out of
+        * self-refresh and changing CRTCs at the same time, because the
+        * bridge tracks self-refresh status via CRTC state.
+        */
+       if (old_state->self_refresh_active &&
+           old_state->crtc != new_state->crtc)
+               return true;
+
+       /*
+        * We also need to run through the crtc_funcs->disable() function if
+        * the CRTC is currently on, if it's transitioning to self refresh
+        * mode, or if it's in self refresh mode and needs to be fully
+        * disabled.
         */
        return old_state->active ||
               (old_state->self_refresh_active && !new_state->active) ||
index 4e853ac..df87ba9 100644 (file)
@@ -152,6 +152,12 @@ static const struct dmi_system_id orientation_data[] = {
                  DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AYA NEO 2021"),
                },
                .driver_data = (void *)&lcd800x1280_rightside_up,
+       }, {    /* AYA NEO NEXT */
+               .matches = {
+                 DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
+                 DMI_MATCH(DMI_BOARD_NAME, "NEXT"),
+               },
+               .driver_data = (void *)&lcd800x1280_rightside_up,
        }, {    /* Chuwi HiBook (CWI514) */
                .matches = {
                        DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
index 424ea23..16c5396 100644 (file)
@@ -176,15 +176,15 @@ static struct exynos_drm_driver_info exynos_drm_drivers[] = {
        }, {
                DRV_PTR(mixer_driver, CONFIG_DRM_EXYNOS_MIXER),
                DRM_COMPONENT_DRIVER
-       }, {
-               DRV_PTR(mic_driver, CONFIG_DRM_EXYNOS_MIC),
-               DRM_COMPONENT_DRIVER
        }, {
                DRV_PTR(dp_driver, CONFIG_DRM_EXYNOS_DP),
                DRM_COMPONENT_DRIVER
        }, {
                DRV_PTR(dsi_driver, CONFIG_DRM_EXYNOS_DSI),
                DRM_COMPONENT_DRIVER
+       }, {
+               DRV_PTR(mic_driver, CONFIG_DRM_EXYNOS_MIC),
+               DRM_COMPONENT_DRIVER
        }, {
                DRV_PTR(hdmi_driver, CONFIG_DRM_EXYNOS_HDMI),
                DRM_COMPONENT_DRIVER
index 9e06f8e..09ce28e 100644 (file)
@@ -26,6 +26,7 @@
 #include <drm/drm_print.h>
 
 #include "exynos_drm_drv.h"
+#include "exynos_drm_crtc.h"
 
 /* Sysreg registers for MIC */
 #define DSD_CFG_MUX    0x1004
@@ -100,9 +101,7 @@ struct exynos_mic {
 
        bool i80_mode;
        struct videomode vm;
-       struct drm_encoder *encoder;
        struct drm_bridge bridge;
-       struct drm_bridge *next_bridge;
 
        bool enabled;
 };
@@ -229,8 +228,6 @@ static void mic_set_reg_on(struct exynos_mic *mic, bool enable)
        writel(reg, mic->reg + MIC_OP);
 }
 
-static void mic_disable(struct drm_bridge *bridge) { }
-
 static void mic_post_disable(struct drm_bridge *bridge)
 {
        struct exynos_mic *mic = bridge->driver_private;
@@ -297,34 +294,30 @@ unlock:
        mutex_unlock(&mic_mutex);
 }
 
-static void mic_enable(struct drm_bridge *bridge) { }
-
-static int mic_attach(struct drm_bridge *bridge,
-                     enum drm_bridge_attach_flags flags)
-{
-       struct exynos_mic *mic = bridge->driver_private;
-
-       return drm_bridge_attach(bridge->encoder, mic->next_bridge,
-                                &mic->bridge, flags);
-}
-
 static const struct drm_bridge_funcs mic_bridge_funcs = {
-       .disable = mic_disable,
        .post_disable = mic_post_disable,
        .mode_set = mic_mode_set,
        .pre_enable = mic_pre_enable,
-       .enable = mic_enable,
-       .attach = mic_attach,
 };
 
 static int exynos_mic_bind(struct device *dev, struct device *master,
                           void *data)
 {
        struct exynos_mic *mic = dev_get_drvdata(dev);
+       struct drm_device *drm_dev = data;
+       struct exynos_drm_crtc *crtc = exynos_drm_crtc_get_by_type(drm_dev,
+                                                      EXYNOS_DISPLAY_TYPE_LCD);
+       struct drm_encoder *e, *encoder = NULL;
+
+       drm_for_each_encoder(e, drm_dev)
+               if (e->possible_crtcs == drm_crtc_mask(&crtc->base))
+                       encoder = e;
+       if (!encoder)
+               return -ENODEV;
 
        mic->bridge.driver_private = mic;
 
-       return 0;
+       return drm_bridge_attach(encoder, &mic->bridge, NULL, 0);
 }
 
 static void exynos_mic_unbind(struct device *dev, struct device *master,
@@ -388,7 +381,6 @@ static int exynos_mic_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct exynos_mic *mic;
-       struct device_node *remote;
        struct resource res;
        int ret, i;
 
@@ -432,16 +424,6 @@ static int exynos_mic_probe(struct platform_device *pdev)
                }
        }
 
-       remote = of_graph_get_remote_node(dev->of_node, 1, 0);
-       mic->next_bridge = of_drm_find_bridge(remote);
-       if (IS_ERR(mic->next_bridge)) {
-               DRM_DEV_ERROR(dev, "mic: Failed to find next bridge\n");
-               ret = PTR_ERR(mic->next_bridge);
-               goto err;
-       }
-
-       of_node_put(remote);
-
        platform_set_drvdata(pdev, mic);
 
        mic->bridge.funcs = &mic_bridge_funcs;
index e4a79c1..ff67899 100644 (file)
@@ -388,13 +388,23 @@ static int dg2_max_source_rate(struct intel_dp *intel_dp)
        return intel_dp_is_edp(intel_dp) ? 810000 : 1350000;
 }
 
+static bool is_low_voltage_sku(struct drm_i915_private *i915, enum phy phy)
+{
+       u32 voltage;
+
+       voltage = intel_de_read(i915, ICL_PORT_COMP_DW3(phy)) & VOLTAGE_INFO_MASK;
+
+       return voltage == VOLTAGE_INFO_0_85V;
+}
+
 static int icl_max_source_rate(struct intel_dp *intel_dp)
 {
        struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
        struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
        enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port);
 
-       if (intel_phy_is_combo(dev_priv, phy) && !intel_dp_is_edp(intel_dp))
+       if (intel_phy_is_combo(dev_priv, phy) &&
+           (is_low_voltage_sku(dev_priv, phy) || !intel_dp_is_edp(intel_dp)))
                return 540000;
 
        return 810000;
@@ -402,7 +412,23 @@ static int icl_max_source_rate(struct intel_dp *intel_dp)
 
 static int ehl_max_source_rate(struct intel_dp *intel_dp)
 {
-       if (intel_dp_is_edp(intel_dp))
+       struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+       struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
+       enum phy phy = intel_port_to_phy(dev_priv, dig_port->base.port);
+
+       if (intel_dp_is_edp(intel_dp) || is_low_voltage_sku(dev_priv, phy))
+               return 540000;
+
+       return 810000;
+}
+
+static int dg1_max_source_rate(struct intel_dp *intel_dp)
+{
+       struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
+       struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
+       enum phy phy = intel_port_to_phy(i915, dig_port->base.port);
+
+       if (intel_phy_is_combo(i915, phy) && is_low_voltage_sku(i915, phy))
                return 540000;
 
        return 810000;
@@ -445,7 +471,7 @@ intel_dp_set_source_rates(struct intel_dp *intel_dp)
                        max_rate = dg2_max_source_rate(intel_dp);
                else if (IS_ALDERLAKE_P(dev_priv) || IS_ALDERLAKE_S(dev_priv) ||
                         IS_DG1(dev_priv) || IS_ROCKETLAKE(dev_priv))
-                       max_rate = 810000;
+                       max_rate = dg1_max_source_rate(intel_dp);
                else if (IS_JSL_EHL(dev_priv))
                        max_rate = ehl_max_source_rate(intel_dp);
                else
index 22f5557..88c2f38 100644 (file)
@@ -2396,7 +2396,7 @@ static void icl_wrpll_params_populate(struct skl_wrpll_params *params,
 }
 
 /*
- * Display WA #22010492432: ehl, tgl, adl-p
+ * Display WA #22010492432: ehl, tgl, adl-s, adl-p
  * Program half of the nominal DCO divider fraction value.
  */
 static bool
@@ -2404,7 +2404,7 @@ ehl_combo_pll_div_frac_wa_needed(struct drm_i915_private *i915)
 {
        return ((IS_PLATFORM(i915, INTEL_ELKHARTLAKE) &&
                 IS_JSL_EHL_DISPLAY_STEP(i915, STEP_B0, STEP_FOREVER)) ||
-                IS_TIGERLAKE(i915) || IS_ALDERLAKE_P(i915)) &&
+                IS_TIGERLAKE(i915) || IS_ALDERLAKE_S(i915) || IS_ALDERLAKE_P(i915)) &&
                 i915->dpll.ref_clks.nssc == 38400;
 }
 
index c326bd2..30fe847 100644 (file)
@@ -999,7 +999,8 @@ static int eb_validate_vmas(struct i915_execbuffer *eb)
                        }
                }
 
-               err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
+               /* Reserve enough slots to accommodate composite fences */
+               err = dma_resv_reserve_fences(vma->obj->base.resv, eb->num_batches);
                if (err)
                        return err;
 
index 53307ca..51a0fe6 100644 (file)
@@ -785,6 +785,7 @@ void intel_gt_driver_unregister(struct intel_gt *gt)
 {
        intel_wakeref_t wakeref;
 
+       intel_gt_sysfs_unregister(gt);
        intel_rps_driver_unregister(&gt->rps);
        intel_gsc_fini(&gt->gsc);
 
index 8ec8bc6..9e4ebf5 100644 (file)
@@ -24,7 +24,7 @@ bool is_object_gt(struct kobject *kobj)
 
 static struct intel_gt *kobj_to_gt(struct kobject *kobj)
 {
-       return container_of(kobj, struct kobj_gt, base)->gt;
+       return container_of(kobj, struct intel_gt, sysfs_gt);
 }
 
 struct intel_gt *intel_gt_sysfs_get_drvdata(struct device *dev,
@@ -72,9 +72,9 @@ static struct attribute *id_attrs[] = {
 };
 ATTRIBUTE_GROUPS(id);
 
+/* A kobject needs a release() method even if it does nothing */
 static void kobj_gt_release(struct kobject *kobj)
 {
-       kfree(kobj);
 }
 
 static struct kobj_type kobj_gt_type = {
@@ -85,8 +85,6 @@ static struct kobj_type kobj_gt_type = {
 
 void intel_gt_sysfs_register(struct intel_gt *gt)
 {
-       struct kobj_gt *kg;
-
        /*
         * We need to make things right with the
         * ABI compatibility. The files were originally
@@ -98,25 +96,22 @@ void intel_gt_sysfs_register(struct intel_gt *gt)
        if (gt_is_root(gt))
                intel_gt_sysfs_pm_init(gt, gt_get_parent_obj(gt));
 
-       kg = kzalloc(sizeof(*kg), GFP_KERNEL);
-       if (!kg)
+       /* init and xfer ownership to sysfs tree */
+       if (kobject_init_and_add(&gt->sysfs_gt, &kobj_gt_type,
+                                gt->i915->sysfs_gt, "gt%d", gt->info.id))
                goto exit_fail;
 
-       kobject_init(&kg->base, &kobj_gt_type);
-       kg->gt = gt;
-
-       /* xfer ownership to sysfs tree */
-       if (kobject_add(&kg->base, gt->i915->sysfs_gt, "gt%d", gt->info.id))
-               goto exit_kobj_put;
-
-       intel_gt_sysfs_pm_init(gt, &kg->base);
+       intel_gt_sysfs_pm_init(gt, &gt->sysfs_gt);
 
        return;
 
-exit_kobj_put:
-       kobject_put(&kg->base);
-
 exit_fail:
+       kobject_put(&gt->sysfs_gt);
        drm_warn(&gt->i915->drm,
                 "failed to initialize gt%d sysfs root\n", gt->info.id);
 }
+
+void intel_gt_sysfs_unregister(struct intel_gt *gt)
+{
+       kobject_put(&gt->sysfs_gt);
+}
index 9471b26..a99aa7e 100644 (file)
 
 struct intel_gt;
 
-struct kobj_gt {
-       struct kobject base;
-       struct intel_gt *gt;
-};
-
 bool is_object_gt(struct kobject *kobj);
 
 struct drm_i915_private *kobj_to_i915(struct kobject *kobj);
@@ -28,6 +23,7 @@ intel_gt_create_kobj(struct intel_gt *gt,
                     const char *name);
 
 void intel_gt_sysfs_register(struct intel_gt *gt);
+void intel_gt_sysfs_unregister(struct intel_gt *gt);
 struct intel_gt *intel_gt_sysfs_get_drvdata(struct device *dev,
                                            const char *name);
 
index b06611c..edd7a3c 100644 (file)
@@ -224,6 +224,9 @@ struct intel_gt {
        } mocs;
 
        struct intel_pxp pxp;
+
+       /* gt/gtN sysfs */
+       struct kobject sysfs_gt;
 };
 
 enum intel_gt_scratch_field {
index d078f88..f0d7b57 100644 (file)
@@ -156,7 +156,7 @@ __uc_fw_auto_select(struct drm_i915_private *i915, struct intel_uc_fw *uc_fw)
                [INTEL_UC_FW_TYPE_GUC] = { blobs_guc, ARRAY_SIZE(blobs_guc) },
                [INTEL_UC_FW_TYPE_HUC] = { blobs_huc, ARRAY_SIZE(blobs_huc) },
        };
-       static const struct uc_fw_platform_requirement *fw_blobs;
+       const struct uc_fw_platform_requirement *fw_blobs;
        enum intel_platform p = INTEL_INFO(i915)->platform;
        u32 fw_count;
        u8 rev = INTEL_REVID(i915);
index 18d38cb..b09d1d3 100644 (file)
@@ -116,8 +116,9 @@ show_client_class(struct seq_file *m,
                total += busy_add(ctx, class);
        rcu_read_unlock();
 
-       seq_printf(m, "drm-engine-%s:\t%llu ns\n",
-                  uabi_class_names[class], total);
+       if (capacity)
+               seq_printf(m, "drm-engine-%s:\t%llu ns\n",
+                          uabi_class_names[class], total);
 
        if (capacity > 1)
                seq_printf(m, "drm-engine-capacity-%s:\t%u\n",
index 8521dab..1e27502 100644 (file)
@@ -166,7 +166,14 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
        struct device *kdev = kobj_to_dev(kobj);
        struct drm_i915_private *i915 = kdev_minor_to_i915(kdev);
        struct i915_gpu_coredump *gpu;
-       ssize_t ret;
+       ssize_t ret = 0;
+
+       /*
+        * FIXME: Concurrent clients triggering resets and reading + clearing
+        * dumps can cause inconsistent sysfs reads when a user calls in with a
+        * non-zero offset to complete a prior partial read but the
+        * gpu_coredump has been cleared or replaced.
+        */
 
        gpu = i915_first_error_state(i915);
        if (IS_ERR(gpu)) {
@@ -178,8 +185,10 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
                const char *str = "No error state collected\n";
                size_t len = strlen(str);
 
-               ret = min_t(size_t, count, len - off);
-               memcpy(buf, str + off, ret);
+               if (off < len) {
+                       ret = min_t(size_t, count, len - off);
+                       memcpy(buf, str + off, ret);
+               }
        }
 
        return ret;
@@ -259,4 +268,6 @@ void i915_teardown_sysfs(struct drm_i915_private *dev_priv)
 
        device_remove_bin_file(kdev,  &dpf_attrs_1);
        device_remove_bin_file(kdev,  &dpf_attrs);
+
+       kobject_put(dev_priv->sysfs_gt);
 }
index 4f6db53..0bffb70 100644 (file)
@@ -23,6 +23,7 @@
  */
 
 #include <linux/sched/mm.h>
+#include <linux/dma-fence-array.h>
 #include <drm/drm_gem.h>
 
 #include "display/intel_frontbuffer.h"
@@ -1823,6 +1824,21 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
        if (unlikely(err))
                return err;
 
+       /*
+        * Reserve fences slot early to prevent an allocation after preparing
+        * the workload and associating fences with dma_resv.
+        */
+       if (fence && !(flags & __EXEC_OBJECT_NO_RESERVE)) {
+               struct dma_fence *curr;
+               int idx;
+
+               dma_fence_array_for_each(curr, idx, fence)
+                       ;
+               err = dma_resv_reserve_fences(vma->obj->base.resv, idx);
+               if (unlikely(err))
+                       return err;
+       }
+
        if (flags & EXEC_OBJECT_WRITE) {
                struct intel_frontbuffer *front;
 
@@ -1832,31 +1848,23 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
                                i915_active_add_request(&front->write, rq);
                        intel_frontbuffer_put(front);
                }
+       }
 
-               if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
-                       err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
-                       if (unlikely(err))
-                               return err;
-               }
+       if (fence) {
+               struct dma_fence *curr;
+               enum dma_resv_usage usage;
+               int idx;
 
-               if (fence) {
-                       dma_resv_add_fence(vma->obj->base.resv, fence,
-                                          DMA_RESV_USAGE_WRITE);
+               obj->read_domains = 0;
+               if (flags & EXEC_OBJECT_WRITE) {
+                       usage = DMA_RESV_USAGE_WRITE;
                        obj->write_domain = I915_GEM_DOMAIN_RENDER;
-                       obj->read_domains = 0;
-               }
-       } else {
-               if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
-                       err = dma_resv_reserve_fences(vma->obj->base.resv, 1);
-                       if (unlikely(err))
-                               return err;
+               } else {
+                       usage = DMA_RESV_USAGE_READ;
                }
 
-               if (fence) {
-                       dma_resv_add_fence(vma->obj->base.resv, fence,
-                                          DMA_RESV_USAGE_READ);
-                       obj->write_domain = 0;
-               }
+               dma_fence_array_for_each(curr, idx, fence)
+                       dma_resv_add_fence(vma->obj->base.resv, curr, usage);
        }
 
        if (flags & EXEC_OBJECT_NEEDS_FENCE && vma->fence)
index 9c8829f..f7863d6 100644 (file)
@@ -69,7 +69,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc,
        drm_atomic_crtc_state_for_each_plane(plane, old_crtc_state) {
                if (plane == &ipu_crtc->plane[0]->base)
                        disable_full = true;
-               if (&ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
+               if (ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
                        disable_partial = true;
        }
 
index 4e665c8..efe9840 100644 (file)
@@ -498,10 +498,15 @@ int adreno_hw_init(struct msm_gpu *gpu)
 
                ring->cur = ring->start;
                ring->next = ring->start;
-
-               /* reset completed fence seqno: */
-               ring->memptrs->fence = ring->fctx->completed_fence;
                ring->memptrs->rptr = 0;
+
+               /* Detect and clean up an impossible fence, ie. if GPU managed
+                * to scribble something invalid, we don't want that to confuse
+                * us into mistakingly believing that submits have completed.
+                */
+               if (fence_before(ring->fctx->last_fence, ring->memptrs->fence)) {
+                       ring->memptrs->fence = ring->fctx->last_fence;
+               }
        }
 
        return 0;
@@ -1057,7 +1062,8 @@ void adreno_gpu_cleanup(struct adreno_gpu *adreno_gpu)
        for (i = 0; i < ARRAY_SIZE(adreno_gpu->info->fw); i++)
                release_firmware(adreno_gpu->fw[i]);
 
-       pm_runtime_disable(&priv->gpu_pdev->dev);
+       if (pm_runtime_enabled(&priv->gpu_pdev->dev))
+               pm_runtime_disable(&priv->gpu_pdev->dev);
 
        msm_gpu_cleanup(&adreno_gpu->base);
 }
index 399115e..2fd7870 100644 (file)
@@ -11,7 +11,14 @@ static int dpu_wb_conn_get_modes(struct drm_connector *connector)
        struct msm_drm_private *priv = dev->dev_private;
        struct dpu_kms *dpu_kms = to_dpu_kms(priv->kms);
 
-       return drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_linewidth,
+       /*
+        * We should ideally be limiting the modes only to the maxlinewidth but
+        * on some chipsets this will allow even 4k modes to be added which will
+        * fail the per SSPP bandwidth checks. So, till we have dual-SSPP support
+        * and source split support added lets limit the modes based on max_mixer_width
+        * as 4K modes can then be supported.
+        */
+       return drm_add_modes_noedid(connector, dpu_kms->catalog->caps->max_mixer_width,
                        dev->mode_config.max_height);
 }
 
index fb48c8c..17cb1fc 100644 (file)
@@ -216,6 +216,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
                encoder = mdp4_lcdc_encoder_init(dev, panel_node);
                if (IS_ERR(encoder)) {
                        DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n");
+                       of_node_put(panel_node);
                        return PTR_ERR(encoder);
                }
 
@@ -225,6 +226,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
                connector = mdp4_lvds_connector_init(dev, panel_node, encoder);
                if (IS_ERR(connector)) {
                        DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n");
+                       of_node_put(panel_node);
                        return PTR_ERR(connector);
                }
 
index b7f5b8d..7032493 100644 (file)
@@ -1534,6 +1534,8 @@ end:
        return ret;
 }
 
+static int dp_ctrl_on_stream_phy_test_report(struct dp_ctrl *dp_ctrl);
+
 static int dp_ctrl_process_phy_test_request(struct dp_ctrl_private *ctrl)
 {
        int ret = 0;
@@ -1557,7 +1559,7 @@ static int dp_ctrl_process_phy_test_request(struct dp_ctrl_private *ctrl)
 
        ret = dp_ctrl_on_link(&ctrl->dp_ctrl);
        if (!ret)
-               ret = dp_ctrl_on_stream(&ctrl->dp_ctrl);
+               ret = dp_ctrl_on_stream_phy_test_report(&ctrl->dp_ctrl);
        else
                DRM_ERROR("failed to enable DP link controller\n");
 
@@ -1813,7 +1815,27 @@ static int dp_ctrl_link_retrain(struct dp_ctrl_private *ctrl)
        return dp_ctrl_setup_main_link(ctrl, &training_step);
 }
 
-int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl)
+static int dp_ctrl_on_stream_phy_test_report(struct dp_ctrl *dp_ctrl)
+{
+       int ret;
+       struct dp_ctrl_private *ctrl;
+
+       ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
+
+       ctrl->dp_ctrl.pixel_rate = ctrl->panel->dp_mode.drm_mode.clock;
+
+       ret = dp_ctrl_enable_stream_clocks(ctrl);
+       if (ret) {
+               DRM_ERROR("Failed to start pixel clocks. ret=%d\n", ret);
+               return ret;
+       }
+
+       dp_ctrl_send_phy_test_pattern(ctrl);
+
+       return 0;
+}
+
+int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl, bool force_link_train)
 {
        int ret = 0;
        bool mainlink_ready = false;
@@ -1849,12 +1871,7 @@ int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl)
                goto end;
        }
 
-       if (ctrl->link->sink_request & DP_TEST_LINK_PHY_TEST_PATTERN) {
-               dp_ctrl_send_phy_test_pattern(ctrl);
-               return 0;
-       }
-
-       if (!dp_ctrl_channel_eq_ok(ctrl))
+       if (force_link_train || !dp_ctrl_channel_eq_ok(ctrl))
                dp_ctrl_link_retrain(ctrl);
 
        /* stop txing train pattern to end link training */
index 0745fde..b563e2e 100644 (file)
@@ -21,7 +21,7 @@ struct dp_ctrl {
 };
 
 int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl);
-int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl);
+int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl, bool force_link_train);
 int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl);
 int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl);
 int dp_ctrl_off(struct dp_ctrl *dp_ctrl);
index bce7793..ec26855 100644 (file)
@@ -309,7 +309,8 @@ static void dp_display_unbind(struct device *dev, struct device *master,
        struct msm_drm_private *priv = dev_get_drvdata(master);
 
        /* disable all HPD interrupts */
-       dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false);
+       if (dp->core_initialized)
+               dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false);
 
        kthread_stop(dp->ev_tsk);
 
@@ -872,7 +873,7 @@ static int dp_display_enable(struct dp_display_private *dp, u32 data)
                return 0;
        }
 
-       rc = dp_ctrl_on_stream(dp->ctrl);
+       rc = dp_ctrl_on_stream(dp->ctrl, data);
        if (!rc)
                dp_display->power_on = true;
 
@@ -1659,6 +1660,7 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge)
        int rc = 0;
        struct dp_display_private *dp_display;
        u32 state;
+       bool force_link_train = false;
 
        dp_display = container_of(dp, struct dp_display_private, dp_display);
        if (!dp_display->dp_mode.drm_mode.clock) {
@@ -1693,10 +1695,12 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge)
 
        state =  dp_display->hpd_state;
 
-       if (state == ST_DISPLAY_OFF)
+       if (state == ST_DISPLAY_OFF) {
                dp_display_host_phy_init(dp_display);
+               force_link_train = true;
+       }
 
-       dp_display_enable(dp_display, 0);
+       dp_display_enable(dp_display, force_link_train);
 
        rc = dp_display_post_enable(dp);
        if (rc) {
@@ -1705,10 +1709,6 @@ void dp_bridge_enable(struct drm_bridge *drm_bridge)
                dp_display_unprepare(dp);
        }
 
-       /* manual kick off plug event to train link */
-       if (state == ST_DISPLAY_OFF)
-               dp_add_event(dp_display, EV_IRQ_HPD_INT, 0, 0);
-
        /* completed connection */
        dp_display->hpd_state = ST_CONNECTED;
 
index 4448536..14ab9a6 100644 (file)
@@ -964,7 +964,7 @@ static const struct drm_driver msm_driver = {
        .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
        .gem_prime_import_sg_table = msm_gem_prime_import_sg_table,
-       .gem_prime_mmap     = drm_gem_prime_mmap,
+       .gem_prime_mmap     = msm_gem_prime_mmap,
 #ifdef CONFIG_DEBUG_FS
        .debugfs_init       = msm_debugfs_init,
 #endif
index 08388d7..099a67d 100644 (file)
@@ -246,6 +246,7 @@ unsigned long msm_gem_shrinker_shrink(struct drm_device *dev, unsigned long nr_t
 void msm_gem_shrinker_init(struct drm_device *dev);
 void msm_gem_shrinker_cleanup(struct drm_device *dev);
 
+int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
 struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj);
 int msm_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map);
 void msm_gem_prime_vunmap(struct drm_gem_object *obj, struct iosys_map *map);
index 3df2554..38e3323 100644 (file)
@@ -46,12 +46,14 @@ bool msm_fence_completed(struct msm_fence_context *fctx, uint32_t fence)
                (int32_t)(*fctx->fenceptr - fence) >= 0;
 }
 
-/* called from workqueue */
+/* called from irq handler and workqueue (in recover path) */
 void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence)
 {
-       spin_lock(&fctx->spinlock);
+       unsigned long flags;
+
+       spin_lock_irqsave(&fctx->spinlock, flags);
        fctx->completed_fence = max(fence, fctx->completed_fence);
-       spin_unlock(&fctx->spinlock);
+       spin_unlock_irqrestore(&fctx->spinlock, flags);
 }
 
 struct msm_fence {
index 97d5b4d..7f92231 100644 (file)
@@ -439,14 +439,12 @@ int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma)
        return ret;
 }
 
-void msm_gem_unpin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma)
+void msm_gem_unpin_locked(struct drm_gem_object *obj)
 {
        struct msm_gem_object *msm_obj = to_msm_bo(obj);
 
        GEM_WARN_ON(!msm_gem_is_locked(obj));
 
-       msm_gem_unpin_vma(vma);
-
        msm_obj->pin_count--;
        GEM_WARN_ON(msm_obj->pin_count < 0);
 
@@ -586,7 +584,8 @@ void msm_gem_unpin_iova(struct drm_gem_object *obj,
        msm_gem_lock(obj);
        vma = lookup_vma(obj, aspace);
        if (!GEM_WARN_ON(!vma)) {
-               msm_gem_unpin_vma_locked(obj, vma);
+               msm_gem_unpin_vma(vma);
+               msm_gem_unpin_locked(obj);
        }
        msm_gem_unlock(obj);
 }
index c75d3b8..6b7d5bb 100644 (file)
@@ -145,7 +145,7 @@ struct msm_gem_object {
 
 uint64_t msm_gem_mmap_offset(struct drm_gem_object *obj);
 int msm_gem_pin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma);
-void msm_gem_unpin_vma_locked(struct drm_gem_object *obj, struct msm_gem_vma *vma);
+void msm_gem_unpin_locked(struct drm_gem_object *obj);
 struct msm_gem_vma *msm_gem_get_vma_locked(struct drm_gem_object *obj,
                                           struct msm_gem_address_space *aspace);
 int msm_gem_get_iova(struct drm_gem_object *obj,
@@ -377,10 +377,11 @@ struct msm_gem_submit {
        } *cmd;  /* array of size nr_cmds */
        struct {
 /* make sure these don't conflict w/ MSM_SUBMIT_BO_x */
-#define BO_VALID    0x8000   /* is current addr in cmdstream correct/valid? */
-#define BO_LOCKED   0x4000   /* obj lock is held */
-#define BO_ACTIVE   0x2000   /* active refcnt is held */
-#define BO_PINNED   0x1000   /* obj is pinned and on active list */
+#define BO_VALID       0x8000  /* is current addr in cmdstream correct/valid? */
+#define BO_LOCKED      0x4000  /* obj lock is held */
+#define BO_ACTIVE      0x2000  /* active refcnt is held */
+#define BO_OBJ_PINNED  0x1000  /* obj (pages) is pinned and on active list */
+#define BO_VMA_PINNED  0x0800  /* vma (virtual address) is pinned */
                uint32_t flags;
                union {
                        struct msm_gem_object *obj;
index 94ab705..dcc8a57 100644 (file)
 #include "msm_drv.h"
 #include "msm_gem.h"
 
+int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
+{
+       int ret;
+
+       /* Ensure the mmap offset is initialized.  We lazily initialize it,
+        * so if it has not been first mmap'd directly as a GEM object, the
+        * mmap offset will not be already initialized.
+        */
+       ret = drm_gem_create_mmap_offset(obj);
+       if (ret)
+               return ret;
+
+       return drm_gem_prime_mmap(obj, vma);
+}
+
 struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj)
 {
        struct msm_gem_object *msm_obj = to_msm_bo(obj);
index 8097522..3c3a0cf 100644 (file)
@@ -232,8 +232,11 @@ static void submit_cleanup_bo(struct msm_gem_submit *submit, int i,
         */
        submit->bos[i].flags &= ~cleanup_flags;
 
-       if (flags & BO_PINNED)
-               msm_gem_unpin_vma_locked(obj, submit->bos[i].vma);
+       if (flags & BO_VMA_PINNED)
+               msm_gem_unpin_vma(submit->bos[i].vma);
+
+       if (flags & BO_OBJ_PINNED)
+               msm_gem_unpin_locked(obj);
 
        if (flags & BO_ACTIVE)
                msm_gem_active_put(obj);
@@ -244,7 +247,9 @@ static void submit_cleanup_bo(struct msm_gem_submit *submit, int i,
 
 static void submit_unlock_unpin_bo(struct msm_gem_submit *submit, int i)
 {
-       submit_cleanup_bo(submit, i, BO_PINNED | BO_ACTIVE | BO_LOCKED);
+       unsigned cleanup_flags = BO_VMA_PINNED | BO_OBJ_PINNED |
+                                BO_ACTIVE | BO_LOCKED;
+       submit_cleanup_bo(submit, i, cleanup_flags);
 
        if (!(submit->bos[i].flags & BO_VALID))
                submit->bos[i].iova = 0;
@@ -375,7 +380,7 @@ static int submit_pin_objects(struct msm_gem_submit *submit)
                if (ret)
                        break;
 
-               submit->bos[i].flags |= BO_PINNED;
+               submit->bos[i].flags |= BO_OBJ_PINNED | BO_VMA_PINNED;
                submit->bos[i].vma = vma;
 
                if (vma->iova == submit->bos[i].iova) {
@@ -511,7 +516,7 @@ static void submit_cleanup(struct msm_gem_submit *submit, bool error)
        unsigned i;
 
        if (error)
-               cleanup_flags |= BO_PINNED | BO_ACTIVE;
+               cleanup_flags |= BO_VMA_PINNED | BO_OBJ_PINNED | BO_ACTIVE;
 
        for (i = 0; i < submit->nr_bos; i++) {
                struct msm_gem_object *msm_obj = submit->bos[i].obj;
@@ -529,7 +534,8 @@ void msm_submit_retire(struct msm_gem_submit *submit)
                struct drm_gem_object *obj = &submit->bos[i].obj->base;
 
                msm_gem_lock(obj);
-               submit_cleanup_bo(submit, i, BO_PINNED | BO_ACTIVE);
+               /* Note, VMA already fence-unpinned before submit: */
+               submit_cleanup_bo(submit, i, BO_OBJ_PINNED | BO_ACTIVE);
                msm_gem_unlock(obj);
                drm_gem_object_put(obj);
        }
index 3c1dc92..c471aeb 100644 (file)
@@ -62,8 +62,7 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
        unsigned size = vma->node.size;
 
        /* Print a message if we try to purge a vma in use */
-       if (GEM_WARN_ON(msm_gem_vma_inuse(vma)))
-               return;
+       GEM_WARN_ON(msm_gem_vma_inuse(vma));
 
        /* Don't do anything if the memory isn't mapped */
        if (!vma->mapped)
@@ -128,8 +127,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
 void msm_gem_close_vma(struct msm_gem_address_space *aspace,
                struct msm_gem_vma *vma)
 {
-       if (GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped))
-               return;
+       GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped);
 
        spin_lock(&aspace->lock);
        if (vma->iova)
index eb8a666..c8cd9bf 100644 (file)
@@ -164,24 +164,6 @@ int msm_gpu_hw_init(struct msm_gpu *gpu)
        return ret;
 }
 
-static void update_fences(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
-               uint32_t fence)
-{
-       struct msm_gem_submit *submit;
-       unsigned long flags;
-
-       spin_lock_irqsave(&ring->submit_lock, flags);
-       list_for_each_entry(submit, &ring->submits, node) {
-               if (fence_after(submit->seqno, fence))
-                       break;
-
-               msm_update_fence(submit->ring->fctx,
-                       submit->hw_fence->seqno);
-               dma_fence_signal(submit->hw_fence);
-       }
-       spin_unlock_irqrestore(&ring->submit_lock, flags);
-}
-
 #ifdef CONFIG_DEV_COREDUMP
 static ssize_t msm_gpu_devcoredump_read(char *buffer, loff_t offset,
                size_t count, void *data, size_t datalen)
@@ -436,9 +418,9 @@ static void recover_worker(struct kthread_work *work)
                 * one more to clear the faulting submit
                 */
                if (ring == cur_ring)
-                       fence++;
+                       ring->memptrs->fence = ++fence;
 
-               update_fences(gpu, ring, fence);
+               msm_update_fence(ring->fctx, fence);
        }
 
        if (msm_gpu_active(gpu)) {
@@ -672,7 +654,6 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
        msm_submit_retire(submit);
 
        pm_runtime_mark_last_busy(&gpu->pdev->dev);
-       pm_runtime_put_autosuspend(&gpu->pdev->dev);
 
        spin_lock_irqsave(&ring->submit_lock, flags);
        list_del(&submit->node);
@@ -686,6 +667,8 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring,
                msm_devfreq_idle(gpu);
        mutex_unlock(&gpu->active_lock);
 
+       pm_runtime_put_autosuspend(&gpu->pdev->dev);
+
        msm_gem_submit_put(submit);
 }
 
@@ -735,7 +718,7 @@ void msm_gpu_retire(struct msm_gpu *gpu)
        int i;
 
        for (i = 0; i < gpu->nr_rings; i++)
-               update_fences(gpu, gpu->rb[i], gpu->rb[i]->memptrs->fence);
+               msm_update_fence(gpu->rb[i]->fctx, gpu->rb[i]->memptrs->fence);
 
        kthread_queue_work(gpu->worker, &gpu->retire_work);
        update_sw_cntrs(gpu);
index bcaddbb..a54ed35 100644 (file)
@@ -58,7 +58,7 @@ static int msm_iommu_pagetable_map(struct msm_mmu *mmu, u64 iova,
        u64 addr = iova;
        unsigned int i;
 
-       for_each_sg(sgt->sgl, sg, sgt->nents, i) {
+       for_each_sgtable_sg(sgt, sg, i) {
                size_t size = sg->length;
                phys_addr_t phys = sg_phys(sg);
 
index 4306632..56eecb4 100644 (file)
@@ -25,7 +25,7 @@ static struct dma_fence *msm_job_run(struct drm_sched_job *job)
 
                msm_gem_lock(obj);
                msm_gem_unpin_vma_fenced(submit->bos[i].vma, fctx);
-               submit->bos[i].flags &= ~BO_PINNED;
+               submit->bos[i].flags &= ~BO_VMA_PINNED;
                msm_gem_unlock(obj);
        }
 
index 7fcbc2a..087e69b 100644 (file)
@@ -233,6 +233,7 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
                struct drm_file *file)
 {
        struct panfrost_device *pfdev = dev->dev_private;
+       struct panfrost_file_priv *file_priv = file->driver_priv;
        struct drm_panfrost_submit *args = data;
        struct drm_syncobj *sync_out = NULL;
        struct panfrost_job *job;
@@ -262,12 +263,12 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data,
        job->jc = args->jc;
        job->requirements = args->requirements;
        job->flush_id = panfrost_gpu_get_latest_flush_id(pfdev);
-       job->file_priv = file->driver_priv;
+       job->mmu = file_priv->mmu;
 
        slot = panfrost_job_get_slot(job);
 
        ret = drm_sched_job_init(&job->base,
-                                &job->file_priv->sched_entity[slot],
+                                &file_priv->sched_entity[slot],
                                 NULL);
        if (ret)
                goto out_put_job;
index fda5871..7c42084 100644 (file)
@@ -201,7 +201,7 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js)
                return;
        }
 
-       cfg = panfrost_mmu_as_get(pfdev, job->file_priv->mmu);
+       cfg = panfrost_mmu_as_get(pfdev, job->mmu);
 
        job_write(pfdev, JS_HEAD_NEXT_LO(js), lower_32_bits(jc_head));
        job_write(pfdev, JS_HEAD_NEXT_HI(js), upper_32_bits(jc_head));
@@ -435,7 +435,7 @@ static void panfrost_job_handle_err(struct panfrost_device *pfdev,
                job->jc = 0;
        }
 
-       panfrost_mmu_as_put(pfdev, job->file_priv->mmu);
+       panfrost_mmu_as_put(pfdev, job->mmu);
        panfrost_devfreq_record_idle(&pfdev->pfdevfreq);
 
        if (signal_fence)
@@ -456,7 +456,7 @@ static void panfrost_job_handle_done(struct panfrost_device *pfdev,
         * happen when we receive the DONE interrupt while doing a GPU reset).
         */
        job->jc = 0;
-       panfrost_mmu_as_put(pfdev, job->file_priv->mmu);
+       panfrost_mmu_as_put(pfdev, job->mmu);
        panfrost_devfreq_record_idle(&pfdev->pfdevfreq);
 
        dma_fence_signal_locked(job->done_fence);
index 77e6d0e..8becc1b 100644 (file)
@@ -17,7 +17,7 @@ struct panfrost_job {
        struct kref refcount;
 
        struct panfrost_device *pfdev;
-       struct panfrost_file_priv *file_priv;
+       struct panfrost_mmu *mmu;
 
        /* Fence to be signaled by IRQ handler when the job is complete. */
        struct dma_fence *done_fence;
index 275f7e4..6eb1aab 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/component.h>
+#include <linux/dma-mapping.h>
 #include <linux/kfifo.h>
 #include <linux/module.h>
 #include <linux/of_graph.h>
@@ -73,7 +74,6 @@ static int sun4i_drv_bind(struct device *dev)
                goto free_drm;
        }
 
-       dev_set_drvdata(dev, drm);
        drm->dev_private = drv;
        INIT_LIST_HEAD(&drv->frontend_list);
        INIT_LIST_HEAD(&drv->engine_list);
@@ -114,6 +114,8 @@ static int sun4i_drv_bind(struct device *dev)
 
        drm_fbdev_generic_setup(drm, 32);
 
+       dev_set_drvdata(dev, drm);
+
        return 0;
 
 finish_poll:
@@ -130,6 +132,7 @@ static void sun4i_drv_unbind(struct device *dev)
 {
        struct drm_device *drm = dev_get_drvdata(dev);
 
+       dev_set_drvdata(dev, NULL);
        drm_dev_unregister(drm);
        drm_kms_helper_poll_fini(drm);
        drm_atomic_helper_shutdown(drm);
@@ -367,6 +370,13 @@ static int sun4i_drv_probe(struct platform_device *pdev)
 
        INIT_KFIFO(list.fifo);
 
+       /*
+        * DE2 and DE3 cores actually supports 40-bit addresses, but
+        * driver does not.
+        */
+       dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       dma_set_max_seg_size(&pdev->dev, UINT_MAX);
+
        for (i = 0;; i++) {
                struct device_node *pipeline = of_parse_phandle(np,
                                                                "allwinner,pipelines",
index 6d43080..85fb9e8 100644 (file)
@@ -117,7 +117,7 @@ static bool sun4i_layer_format_mod_supported(struct drm_plane *plane,
        struct sun4i_layer *layer = plane_to_sun4i_layer(plane);
 
        if (IS_ERR_OR_NULL(layer->backend->frontend))
-               sun4i_backend_format_is_supported(format, modifier);
+               return sun4i_backend_format_is_supported(format, modifier);
 
        return sun4i_backend_format_is_supported(format, modifier) ||
               sun4i_frontend_format_is_supported(format, modifier);
index a8d75fd..477cb69 100644 (file)
@@ -93,34 +93,10 @@ crtcs_exit:
        return crtcs;
 }
 
-static int sun8i_dw_hdmi_find_connector_pdev(struct device *dev,
-                                            struct platform_device **pdev_out)
-{
-       struct platform_device *pdev;
-       struct device_node *remote;
-
-       remote = of_graph_get_remote_node(dev->of_node, 1, -1);
-       if (!remote)
-               return -ENODEV;
-
-       if (!of_device_is_compatible(remote, "hdmi-connector")) {
-               of_node_put(remote);
-               return -ENODEV;
-       }
-
-       pdev = of_find_device_by_node(remote);
-       of_node_put(remote);
-       if (!pdev)
-               return -ENODEV;
-
-       *pdev_out = pdev;
-       return 0;
-}
-
 static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
                              void *data)
 {
-       struct platform_device *pdev = to_platform_device(dev), *connector_pdev;
+       struct platform_device *pdev = to_platform_device(dev);
        struct dw_hdmi_plat_data *plat_data;
        struct drm_device *drm = data;
        struct device_node *phy_node;
@@ -167,30 +143,16 @@ static int sun8i_dw_hdmi_bind(struct device *dev, struct device *master,
                return dev_err_probe(dev, PTR_ERR(hdmi->regulator),
                                     "Couldn't get regulator\n");
 
-       ret = sun8i_dw_hdmi_find_connector_pdev(dev, &connector_pdev);
-       if (!ret) {
-               hdmi->ddc_en = gpiod_get_optional(&connector_pdev->dev,
-                                                 "ddc-en", GPIOD_OUT_HIGH);
-               platform_device_put(connector_pdev);
-
-               if (IS_ERR(hdmi->ddc_en)) {
-                       dev_err(dev, "Couldn't get ddc-en gpio\n");
-                       return PTR_ERR(hdmi->ddc_en);
-               }
-       }
-
        ret = regulator_enable(hdmi->regulator);
        if (ret) {
                dev_err(dev, "Failed to enable regulator\n");
-               goto err_unref_ddc_en;
+               return ret;
        }
 
-       gpiod_set_value(hdmi->ddc_en, 1);
-
        ret = reset_control_deassert(hdmi->rst_ctrl);
        if (ret) {
                dev_err(dev, "Could not deassert ctrl reset control\n");
-               goto err_disable_ddc_en;
+               goto err_disable_regulator;
        }
 
        ret = clk_prepare_enable(hdmi->clk_tmds);
@@ -245,12 +207,8 @@ err_disable_clk_tmds:
        clk_disable_unprepare(hdmi->clk_tmds);
 err_assert_ctrl_reset:
        reset_control_assert(hdmi->rst_ctrl);
-err_disable_ddc_en:
-       gpiod_set_value(hdmi->ddc_en, 0);
+err_disable_regulator:
        regulator_disable(hdmi->regulator);
-err_unref_ddc_en:
-       if (hdmi->ddc_en)
-               gpiod_put(hdmi->ddc_en);
 
        return ret;
 }
@@ -264,11 +222,7 @@ static void sun8i_dw_hdmi_unbind(struct device *dev, struct device *master,
        sun8i_hdmi_phy_deinit(hdmi->phy);
        clk_disable_unprepare(hdmi->clk_tmds);
        reset_control_assert(hdmi->rst_ctrl);
-       gpiod_set_value(hdmi->ddc_en, 0);
        regulator_disable(hdmi->regulator);
-
-       if (hdmi->ddc_en)
-               gpiod_put(hdmi->ddc_en);
 }
 
 static const struct component_ops sun8i_dw_hdmi_ops = {
index bffe1b9..9ad0952 100644 (file)
@@ -9,7 +9,6 @@
 #include <drm/bridge/dw_hdmi.h>
 #include <drm/drm_encoder.h>
 #include <linux/clk.h>
-#include <linux/gpio/consumer.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/reset.h>
@@ -193,7 +192,6 @@ struct sun8i_dw_hdmi {
        struct regulator                *regulator;
        const struct sun8i_dw_hdmi_quirks *quirks;
        struct reset_control            *rst_ctrl;
-       struct gpio_desc                *ddc_en;
 };
 
 extern struct platform_driver sun8i_hdmi_phy_driver;
index 75d308e..406e9c3 100644 (file)
@@ -109,11 +109,11 @@ void ttm_bo_set_bulk_move(struct ttm_buffer_object *bo,
                return;
 
        spin_lock(&bo->bdev->lru_lock);
-       if (bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_del(bo->bulk_move, bo->resource);
+       if (bo->resource)
+               ttm_resource_del_bulk_move(bo->resource, bo);
        bo->bulk_move = bulk;
-       if (bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_add(bo->bulk_move, bo->resource);
+       if (bo->resource)
+               ttm_resource_add_bulk_move(bo->resource, bo);
        spin_unlock(&bo->bdev->lru_lock);
 }
 EXPORT_SYMBOL(ttm_bo_set_bulk_move);
@@ -689,8 +689,11 @@ void ttm_bo_pin(struct ttm_buffer_object *bo)
 {
        dma_resv_assert_held(bo->base.resv);
        WARN_ON_ONCE(!kref_read(&bo->kref));
-       if (!(bo->pin_count++) && bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_del(bo->bulk_move, bo->resource);
+       spin_lock(&bo->bdev->lru_lock);
+       if (bo->resource)
+               ttm_resource_del_bulk_move(bo->resource, bo);
+       ++bo->pin_count;
+       spin_unlock(&bo->bdev->lru_lock);
 }
 EXPORT_SYMBOL(ttm_bo_pin);
 
@@ -707,8 +710,11 @@ void ttm_bo_unpin(struct ttm_buffer_object *bo)
        if (WARN_ON_ONCE(!bo->pin_count))
                return;
 
-       if (!(--bo->pin_count) && bo->bulk_move && bo->resource)
-               ttm_lru_bulk_move_add(bo->bulk_move, bo->resource);
+       spin_lock(&bo->bdev->lru_lock);
+       --bo->pin_count;
+       if (bo->resource)
+               ttm_resource_add_bulk_move(bo->resource, bo);
+       spin_unlock(&bo->bdev->lru_lock);
 }
 EXPORT_SYMBOL(ttm_bo_unpin);
 
index a0562ab..e7147e3 100644 (file)
@@ -156,8 +156,12 @@ int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
 
                ttm_resource_manager_for_each_res(man, &cursor, res) {
                        struct ttm_buffer_object *bo = res->bo;
-                       uint32_t num_pages = PFN_UP(bo->base.size);
+                       uint32_t num_pages;
 
+                       if (!bo)
+                               continue;
+
+                       num_pages = PFN_UP(bo->base.size);
                        ret = ttm_bo_swapout(bo, ctx, gfp_flags);
                        /* ttm_bo_swapout has dropped the lru_lock */
                        if (!ret)
index 65889b3..20f9adc 100644 (file)
@@ -91,8 +91,8 @@ static void ttm_lru_bulk_move_pos_tail(struct ttm_lru_bulk_move_pos *pos,
 }
 
 /* Add the resource to a bulk_move cursor */
-void ttm_lru_bulk_move_add(struct ttm_lru_bulk_move *bulk,
-                          struct ttm_resource *res)
+static void ttm_lru_bulk_move_add(struct ttm_lru_bulk_move *bulk,
+                                 struct ttm_resource *res)
 {
        struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res);
 
@@ -105,8 +105,8 @@ void ttm_lru_bulk_move_add(struct ttm_lru_bulk_move *bulk,
 }
 
 /* Remove the resource from a bulk_move range */
-void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk,
-                          struct ttm_resource *res)
+static void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk,
+                                 struct ttm_resource *res)
 {
        struct ttm_lru_bulk_move_pos *pos = ttm_lru_bulk_move_pos(bulk, res);
 
@@ -122,6 +122,22 @@ void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk,
        }
 }
 
+/* Add the resource to a bulk move if the BO is configured for it */
+void ttm_resource_add_bulk_move(struct ttm_resource *res,
+                               struct ttm_buffer_object *bo)
+{
+       if (bo->bulk_move && !bo->pin_count)
+               ttm_lru_bulk_move_add(bo->bulk_move, res);
+}
+
+/* Remove the resource from a bulk move if the BO is configured for it */
+void ttm_resource_del_bulk_move(struct ttm_resource *res,
+                               struct ttm_buffer_object *bo)
+{
+       if (bo->bulk_move && !bo->pin_count)
+               ttm_lru_bulk_move_del(bo->bulk_move, res);
+}
+
 /* Move a resource to the LRU or bulk tail */
 void ttm_resource_move_to_lru_tail(struct ttm_resource *res)
 {
@@ -169,15 +185,14 @@ void ttm_resource_init(struct ttm_buffer_object *bo,
        res->bus.is_iomem = false;
        res->bus.caching = ttm_cached;
        res->bo = bo;
-       INIT_LIST_HEAD(&res->lru);
 
        man = ttm_manager_type(bo->bdev, place->mem_type);
        spin_lock(&bo->bdev->lru_lock);
-       man->usage += res->num_pages << PAGE_SHIFT;
-       if (bo->bulk_move)
-               ttm_lru_bulk_move_add(bo->bulk_move, res);
+       if (bo->pin_count)
+               list_add_tail(&res->lru, &bo->bdev->pinned);
        else
-               ttm_resource_move_to_lru_tail(res);
+               list_add_tail(&res->lru, &man->lru[bo->priority]);
+       man->usage += res->num_pages << PAGE_SHIFT;
        spin_unlock(&bo->bdev->lru_lock);
 }
 EXPORT_SYMBOL(ttm_resource_init);
@@ -210,8 +225,16 @@ int ttm_resource_alloc(struct ttm_buffer_object *bo,
 {
        struct ttm_resource_manager *man =
                ttm_manager_type(bo->bdev, place->mem_type);
+       int ret;
+
+       ret = man->func->alloc(man, bo, place, res_ptr);
+       if (ret)
+               return ret;
 
-       return man->func->alloc(man, bo, place, res_ptr);
+       spin_lock(&bo->bdev->lru_lock);
+       ttm_resource_add_bulk_move(*res_ptr, bo);
+       spin_unlock(&bo->bdev->lru_lock);
+       return 0;
 }
 
 void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource **res)
@@ -221,12 +244,9 @@ void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource **res)
        if (!*res)
                return;
 
-       if (bo->bulk_move) {
-               spin_lock(&bo->bdev->lru_lock);
-               ttm_lru_bulk_move_del(bo->bulk_move, *res);
-               spin_unlock(&bo->bdev->lru_lock);
-       }
-
+       spin_lock(&bo->bdev->lru_lock);
+       ttm_resource_del_bulk_move(*res, bo);
+       spin_unlock(&bo->bdev->lru_lock);
        man = ttm_manager_type(bo->bdev, (*res)->mem_type);
        man->func->free(man, *res);
        *res = NULL;
index 49c0f2a..b8d8563 100644 (file)
@@ -248,6 +248,9 @@ void vc4_bo_add_to_purgeable_pool(struct vc4_bo *bo)
 {
        struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        mutex_lock(&vc4->purgeable.lock);
        list_add_tail(&bo->size_head, &vc4->purgeable.list);
        vc4->purgeable.num++;
@@ -259,6 +262,9 @@ static void vc4_bo_remove_from_purgeable_pool_locked(struct vc4_bo *bo)
 {
        struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        /* list_del_init() is used here because the caller might release
         * the purgeable lock in order to acquire the madv one and update the
         * madv status.
@@ -387,6 +393,9 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_bo *bo;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return ERR_PTR(-ENODEV);
+
        bo = kzalloc(sizeof(*bo), GFP_KERNEL);
        if (!bo)
                return ERR_PTR(-ENOMEM);
@@ -413,6 +422,9 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size,
        struct drm_gem_cma_object *cma_obj;
        struct vc4_bo *bo;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return ERR_PTR(-ENODEV);
+
        if (size == 0)
                return ERR_PTR(-EINVAL);
 
@@ -471,19 +483,20 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size,
        return bo;
 }
 
-int vc4_dumb_create(struct drm_file *file_priv,
-                   struct drm_device *dev,
-                   struct drm_mode_create_dumb *args)
+int vc4_bo_dumb_create(struct drm_file *file_priv,
+                      struct drm_device *dev,
+                      struct drm_mode_create_dumb *args)
 {
-       int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_bo *bo = NULL;
        int ret;
 
-       if (args->pitch < min_pitch)
-               args->pitch = min_pitch;
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
 
-       if (args->size < args->pitch * args->height)
-               args->size = args->pitch * args->height;
+       ret = vc4_dumb_fixup_args(args);
+       if (ret)
+               return ret;
 
        bo = vc4_bo_create(dev, args->size, false, VC4_BO_TYPE_DUMB);
        if (IS_ERR(bo))
@@ -601,8 +614,12 @@ static void vc4_bo_cache_time_work(struct work_struct *work)
 
 int vc4_bo_inc_usecnt(struct vc4_bo *bo)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        /* Fast path: if the BO is already retained by someone, no need to
         * check the madv status.
         */
@@ -637,6 +654,11 @@ int vc4_bo_inc_usecnt(struct vc4_bo *bo)
 
 void vc4_bo_dec_usecnt(struct vc4_bo *bo)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(bo->base.base.dev);
+
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        /* Fast path: if the BO is still retained by someone, no need to test
         * the madv value.
         */
@@ -756,6 +778,9 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
        struct vc4_bo *bo = NULL;
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        ret = vc4_grab_bin_bo(vc4, vc4file);
        if (ret)
                return ret;
@@ -779,9 +804,13 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
 int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data,
                      struct drm_file *file_priv)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_mmap_bo *args = data;
        struct drm_gem_object *gem_obj;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        gem_obj = drm_gem_object_lookup(file_priv, args->handle);
        if (!gem_obj) {
                DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle);
@@ -805,6 +834,9 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data,
        struct vc4_bo *bo = NULL;
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (args->size == 0)
                return -EINVAL;
 
@@ -875,11 +907,15 @@ fail:
 int vc4_set_tiling_ioctl(struct drm_device *dev, void *data,
                         struct drm_file *file_priv)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_set_tiling *args = data;
        struct drm_gem_object *gem_obj;
        struct vc4_bo *bo;
        bool t_format;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (args->flags != 0)
                return -EINVAL;
 
@@ -918,10 +954,14 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data,
 int vc4_get_tiling_ioctl(struct drm_device *dev, void *data,
                         struct drm_file *file_priv)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_get_tiling *args = data;
        struct drm_gem_object *gem_obj;
        struct vc4_bo *bo;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (args->flags != 0 || args->modifier != 0)
                return -EINVAL;
 
@@ -948,6 +988,9 @@ int vc4_bo_cache_init(struct drm_device *dev)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        int i;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        /* Create the initial set of BO labels that the kernel will
         * use.  This lets us avoid a bunch of string reallocation in
         * the kernel's draw and BO allocation paths.
@@ -1007,6 +1050,9 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data,
        struct drm_gem_object *gem_obj;
        int ret = 0, label;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!args->len)
                return -EINVAL;
 
index 59b20c8..9355213 100644 (file)
@@ -256,7 +256,7 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format)
                 * Removing 1 from the FIFO full level however
                 * seems to completely remove that issue.
                 */
-               if (!vc4->hvs->hvs5)
+               if (!vc4->is_vc5)
                        return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX - 1;
 
                return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX;
@@ -389,7 +389,7 @@ static void vc4_crtc_config_pv(struct drm_crtc *crtc, struct drm_encoder *encode
        if (is_dsi)
                CRTC_WRITE(PV_HACT_ACT, mode->hdisplay * pixel_rep);
 
-       if (vc4->hvs->hvs5)
+       if (vc4->is_vc5)
                CRTC_WRITE(PV_MUX_CFG,
                           VC4_SET_FIELD(PV_MUX_CFG_RGB_PIXEL_MUX_MODE_NO_SWAP,
                                         PV_MUX_CFG_RGB_PIXEL_MUX_MODE));
@@ -775,17 +775,18 @@ struct vc4_async_flip_state {
        struct drm_framebuffer *old_fb;
        struct drm_pending_vblank_event *event;
 
-       struct vc4_seqno_cb cb;
+       union {
+               struct dma_fence_cb fence;
+               struct vc4_seqno_cb seqno;
+       } cb;
 };
 
 /* Called when the V3D execution for the BO being flipped to is done, so that
  * we can actually update the plane's address to point to it.
  */
 static void
-vc4_async_page_flip_complete(struct vc4_seqno_cb *cb)
+vc4_async_page_flip_complete(struct vc4_async_flip_state *flip_state)
 {
-       struct vc4_async_flip_state *flip_state =
-               container_of(cb, struct vc4_async_flip_state, cb);
        struct drm_crtc *crtc = flip_state->crtc;
        struct drm_device *dev = crtc->dev;
        struct drm_plane *plane = crtc->primary;
@@ -802,59 +803,96 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb)
        drm_crtc_vblank_put(crtc);
        drm_framebuffer_put(flip_state->fb);
 
-       /* Decrement the BO usecnt in order to keep the inc/dec calls balanced
-        * when the planes are updated through the async update path.
-        * FIXME: we should move to generic async-page-flip when it's
-        * available, so that we can get rid of this hand-made cleanup_fb()
-        * logic.
-        */
-       if (flip_state->old_fb) {
-               struct drm_gem_cma_object *cma_bo;
-               struct vc4_bo *bo;
+       if (flip_state->old_fb)
+               drm_framebuffer_put(flip_state->old_fb);
+
+       kfree(flip_state);
+}
+
+static void vc4_async_page_flip_seqno_complete(struct vc4_seqno_cb *cb)
+{
+       struct vc4_async_flip_state *flip_state =
+               container_of(cb, struct vc4_async_flip_state, cb.seqno);
+       struct vc4_bo *bo = NULL;
 
-               cma_bo = drm_fb_cma_get_gem_obj(flip_state->old_fb, 0);
+       if (flip_state->old_fb) {
+               struct drm_gem_cma_object *cma_bo =
+                       drm_fb_cma_get_gem_obj(flip_state->old_fb, 0);
                bo = to_vc4_bo(&cma_bo->base);
-               vc4_bo_dec_usecnt(bo);
-               drm_framebuffer_put(flip_state->old_fb);
        }
 
-       kfree(flip_state);
+       vc4_async_page_flip_complete(flip_state);
+
+       /*
+        * Decrement the BO usecnt in order to keep the inc/dec
+        * calls balanced when the planes are updated through
+        * the async update path.
+        *
+        * FIXME: we should move to generic async-page-flip when
+        * it's available, so that we can get rid of this
+        * hand-made cleanup_fb() logic.
+        */
+       if (bo)
+               vc4_bo_dec_usecnt(bo);
 }
 
-/* Implements async (non-vblank-synced) page flips.
- *
- * The page flip ioctl needs to return immediately, so we grab the
- * modeset semaphore on the pipe, and queue the address update for
- * when V3D is done with the BO being flipped to.
- */
-static int vc4_async_page_flip(struct drm_crtc *crtc,
-                              struct drm_framebuffer *fb,
-                              struct drm_pending_vblank_event *event,
-                              uint32_t flags)
+static void vc4_async_page_flip_fence_complete(struct dma_fence *fence,
+                                              struct dma_fence_cb *cb)
 {
-       struct drm_device *dev = crtc->dev;
-       struct drm_plane *plane = crtc->primary;
-       int ret = 0;
-       struct vc4_async_flip_state *flip_state;
+       struct vc4_async_flip_state *flip_state =
+               container_of(cb, struct vc4_async_flip_state, cb.fence);
+
+       vc4_async_page_flip_complete(flip_state);
+       dma_fence_put(fence);
+}
+
+static int vc4_async_set_fence_cb(struct drm_device *dev,
+                                 struct vc4_async_flip_state *flip_state)
+{
+       struct drm_framebuffer *fb = flip_state->fb;
        struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
-       struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+       struct dma_fence *fence;
+       int ret;
 
-       /* Increment the BO usecnt here, so that we never end up with an
-        * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the
-        * plane is later updated through the non-async path.
-        * FIXME: we should move to generic async-page-flip when it's
-        * available, so that we can get rid of this hand-made prepare_fb()
-        * logic.
-        */
-       ret = vc4_bo_inc_usecnt(bo);
+       if (!vc4->is_vc5) {
+               struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
+
+               return vc4_queue_seqno_cb(dev, &flip_state->cb.seqno, bo->seqno,
+                                         vc4_async_page_flip_seqno_complete);
+       }
+
+       ret = dma_resv_get_singleton(cma_bo->base.resv, DMA_RESV_USAGE_READ, &fence);
        if (ret)
                return ret;
 
+       /* If there's no fence, complete the page flip immediately */
+       if (!fence) {
+               vc4_async_page_flip_fence_complete(fence, &flip_state->cb.fence);
+               return 0;
+       }
+
+       /* If the fence has already been completed, complete the page flip */
+       if (dma_fence_add_callback(fence, &flip_state->cb.fence,
+                                  vc4_async_page_flip_fence_complete))
+               vc4_async_page_flip_fence_complete(fence, &flip_state->cb.fence);
+
+       return 0;
+}
+
+static int
+vc4_async_page_flip_common(struct drm_crtc *crtc,
+                          struct drm_framebuffer *fb,
+                          struct drm_pending_vblank_event *event,
+                          uint32_t flags)
+{
+       struct drm_device *dev = crtc->dev;
+       struct drm_plane *plane = crtc->primary;
+       struct vc4_async_flip_state *flip_state;
+
        flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL);
-       if (!flip_state) {
-               vc4_bo_dec_usecnt(bo);
+       if (!flip_state)
                return -ENOMEM;
-       }
 
        drm_framebuffer_get(fb);
        flip_state->fb = fb;
@@ -881,23 +919,79 @@ static int vc4_async_page_flip(struct drm_crtc *crtc,
         */
        drm_atomic_set_fb_for_plane(plane->state, fb);
 
-       vc4_queue_seqno_cb(dev, &flip_state->cb, bo->seqno,
-                          vc4_async_page_flip_complete);
+       vc4_async_set_fence_cb(dev, flip_state);
 
        /* Driver takes ownership of state on successful async commit. */
        return 0;
 }
 
+/* Implements async (non-vblank-synced) page flips.
+ *
+ * The page flip ioctl needs to return immediately, so we grab the
+ * modeset semaphore on the pipe, and queue the address update for
+ * when V3D is done with the BO being flipped to.
+ */
+static int vc4_async_page_flip(struct drm_crtc *crtc,
+                              struct drm_framebuffer *fb,
+                              struct drm_pending_vblank_event *event,
+                              uint32_t flags)
+{
+       struct drm_device *dev = crtc->dev;
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
+       struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
+       struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
+       int ret;
+
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
+       /*
+        * Increment the BO usecnt here, so that we never end up with an
+        * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the
+        * plane is later updated through the non-async path.
+        *
+        * FIXME: we should move to generic async-page-flip when
+        * it's available, so that we can get rid of this
+        * hand-made prepare_fb() logic.
+        */
+       ret = vc4_bo_inc_usecnt(bo);
+       if (ret)
+               return ret;
+
+       ret = vc4_async_page_flip_common(crtc, fb, event, flags);
+       if (ret) {
+               vc4_bo_dec_usecnt(bo);
+               return ret;
+       }
+
+       return 0;
+}
+
+static int vc5_async_page_flip(struct drm_crtc *crtc,
+                              struct drm_framebuffer *fb,
+                              struct drm_pending_vblank_event *event,
+                              uint32_t flags)
+{
+       return vc4_async_page_flip_common(crtc, fb, event, flags);
+}
+
 int vc4_page_flip(struct drm_crtc *crtc,
                  struct drm_framebuffer *fb,
                  struct drm_pending_vblank_event *event,
                  uint32_t flags,
                  struct drm_modeset_acquire_ctx *ctx)
 {
-       if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
-               return vc4_async_page_flip(crtc, fb, event, flags);
-       else
+       if (flags & DRM_MODE_PAGE_FLIP_ASYNC) {
+               struct drm_device *dev = crtc->dev;
+               struct vc4_dev *vc4 = to_vc4_dev(dev);
+
+               if (vc4->is_vc5)
+                       return vc5_async_page_flip(crtc, fb, event, flags);
+               else
+                       return vc4_async_page_flip(crtc, fb, event, flags);
+       } else {
                return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx);
+       }
 }
 
 struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc)
@@ -1149,7 +1243,7 @@ int vc4_crtc_init(struct drm_device *drm, struct vc4_crtc *vc4_crtc,
                                  crtc_funcs, NULL);
        drm_crtc_helper_add(crtc, crtc_helper_funcs);
 
-       if (!vc4->hvs->hvs5) {
+       if (!vc4->is_vc5) {
                drm_mode_crtc_set_gamma_size(crtc, ARRAY_SIZE(vc4_crtc->lut_r));
 
                drm_crtc_enable_color_mgmt(crtc, 0, false, crtc->gamma_size);
index 162bc18..0f0f026 100644 (file)
@@ -63,6 +63,32 @@ void __iomem *vc4_ioremap_regs(struct platform_device *pdev, int index)
        return map;
 }
 
+int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args)
+{
+       int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
+
+       if (args->pitch < min_pitch)
+               args->pitch = min_pitch;
+
+       if (args->size < args->pitch * args->height)
+               args->size = args->pitch * args->height;
+
+       return 0;
+}
+
+static int vc5_dumb_create(struct drm_file *file_priv,
+                          struct drm_device *dev,
+                          struct drm_mode_create_dumb *args)
+{
+       int ret;
+
+       ret = vc4_dumb_fixup_args(args);
+       if (ret)
+               return ret;
+
+       return drm_gem_cma_dumb_create_internal(file_priv, dev, args);
+}
+
 static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
                               struct drm_file *file_priv)
 {
@@ -73,6 +99,9 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
        if (args->pad != 0)
                return -EINVAL;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!vc4->v3d)
                return -ENODEV;
 
@@ -116,11 +145,16 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
 
 static int vc4_open(struct drm_device *dev, struct drm_file *file)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_file *vc4file;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        vc4file = kzalloc(sizeof(*vc4file), GFP_KERNEL);
        if (!vc4file)
                return -ENOMEM;
+       vc4file->dev = vc4;
 
        vc4_perfmon_open_file(vc4file);
        file->driver_priv = vc4file;
@@ -132,6 +166,9 @@ static void vc4_close(struct drm_device *dev, struct drm_file *file)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_file *vc4file = file->driver_priv;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        if (vc4file->bin_bo_used)
                vc4_v3d_bin_bo_put(vc4);
 
@@ -160,7 +197,7 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = {
        DRM_IOCTL_DEF_DRV(VC4_PERFMON_GET_VALUES, vc4_perfmon_get_values_ioctl, DRM_RENDER_ALLOW),
 };
 
-static struct drm_driver vc4_drm_driver = {
+static const struct drm_driver vc4_drm_driver = {
        .driver_features = (DRIVER_MODESET |
                            DRIVER_ATOMIC |
                            DRIVER_GEM |
@@ -175,7 +212,7 @@ static struct drm_driver vc4_drm_driver = {
 
        .gem_create_object = vc4_create_object,
 
-       DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(vc4_dumb_create),
+       DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(vc4_bo_dumb_create),
 
        .ioctls = vc4_drm_ioctls,
        .num_ioctls = ARRAY_SIZE(vc4_drm_ioctls),
@@ -189,6 +226,27 @@ static struct drm_driver vc4_drm_driver = {
        .patchlevel = DRIVER_PATCHLEVEL,
 };
 
+static const struct drm_driver vc5_drm_driver = {
+       .driver_features = (DRIVER_MODESET |
+                           DRIVER_ATOMIC |
+                           DRIVER_GEM),
+
+#if defined(CONFIG_DEBUG_FS)
+       .debugfs_init = vc4_debugfs_init,
+#endif
+
+       DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE(vc5_dumb_create),
+
+       .fops = &vc4_drm_fops,
+
+       .name = DRIVER_NAME,
+       .desc = DRIVER_DESC,
+       .date = DRIVER_DATE,
+       .major = DRIVER_MAJOR,
+       .minor = DRIVER_MINOR,
+       .patchlevel = DRIVER_PATCHLEVEL,
+};
+
 static void vc4_match_add_drivers(struct device *dev,
                                  struct component_match **match,
                                  struct platform_driver *const *drivers,
@@ -212,42 +270,49 @@ static void vc4_match_add_drivers(struct device *dev,
 static int vc4_drm_bind(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);
+       const struct drm_driver *driver;
        struct rpi_firmware *firmware = NULL;
        struct drm_device *drm;
        struct vc4_dev *vc4;
        struct device_node *node;
        struct drm_crtc *crtc;
+       bool is_vc5;
        int ret = 0;
 
        dev->coherent_dma_mask = DMA_BIT_MASK(32);
 
-       /* If VC4 V3D is missing, don't advertise render nodes. */
-       node = of_find_matching_node_and_match(NULL, vc4_v3d_dt_match, NULL);
-       if (!node || !of_device_is_available(node))
-               vc4_drm_driver.driver_features &= ~DRIVER_RENDER;
-       of_node_put(node);
+       is_vc5 = of_device_is_compatible(dev->of_node, "brcm,bcm2711-vc5");
+       if (is_vc5)
+               driver = &vc5_drm_driver;
+       else
+               driver = &vc4_drm_driver;
 
-       vc4 = devm_drm_dev_alloc(dev, &vc4_drm_driver, struct vc4_dev, base);
+       vc4 = devm_drm_dev_alloc(dev, driver, struct vc4_dev, base);
        if (IS_ERR(vc4))
                return PTR_ERR(vc4);
+       vc4->is_vc5 = is_vc5;
 
        drm = &vc4->base;
        platform_set_drvdata(pdev, drm);
        INIT_LIST_HEAD(&vc4->debugfs_list);
 
-       mutex_init(&vc4->bin_bo_lock);
+       if (!is_vc5) {
+               mutex_init(&vc4->bin_bo_lock);
 
-       ret = vc4_bo_cache_init(drm);
-       if (ret)
-               return ret;
+               ret = vc4_bo_cache_init(drm);
+               if (ret)
+                       return ret;
+       }
 
        ret = drmm_mode_config_init(drm);
        if (ret)
                return ret;
 
-       ret = vc4_gem_init(drm);
-       if (ret)
-               return ret;
+       if (!is_vc5) {
+               ret = vc4_gem_init(drm);
+               if (ret)
+                       return ret;
+       }
 
        node = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware");
        if (node) {
@@ -258,7 +323,7 @@ static int vc4_drm_bind(struct device *dev)
                        return -EPROBE_DEFER;
        }
 
-       ret = drm_aperture_remove_framebuffers(false, &vc4_drm_driver);
+       ret = drm_aperture_remove_framebuffers(false, driver);
        if (ret)
                return ret;
 
index 15e0c2a..93fd55b 100644 (file)
@@ -48,6 +48,8 @@ enum vc4_kernel_bo_type {
  * done. This way, only events related to a specific job will be counted.
  */
 struct vc4_perfmon {
+       struct vc4_dev *dev;
+
        /* Tracks the number of users of the perfmon, when this counter reaches
         * zero the perfmon is destroyed.
         */
@@ -74,6 +76,8 @@ struct vc4_perfmon {
 struct vc4_dev {
        struct drm_device base;
 
+       bool is_vc5;
+
        unsigned int irq;
 
        struct vc4_hvs *hvs;
@@ -316,6 +320,7 @@ struct vc4_v3d {
 };
 
 struct vc4_hvs {
+       struct vc4_dev *vc4;
        struct platform_device *pdev;
        void __iomem *regs;
        u32 __iomem *dlist;
@@ -333,9 +338,6 @@ struct vc4_hvs {
        struct drm_mm_node mitchell_netravali_filter;
 
        struct debugfs_regset32 regset;
-
-       /* HVS version 5 flag, therefore requires updated dlist structures */
-       bool hvs5;
 };
 
 struct vc4_plane {
@@ -580,6 +582,8 @@ to_vc4_crtc_state(struct drm_crtc_state *crtc_state)
 #define VC4_REG32(reg) { .name = #reg, .offset = reg }
 
 struct vc4_exec_info {
+       struct vc4_dev *dev;
+
        /* Sequence number for this bin/render job. */
        uint64_t seqno;
 
@@ -701,6 +705,8 @@ struct vc4_exec_info {
  * released when the DRM file is closed should be placed here.
  */
 struct vc4_file {
+       struct vc4_dev *dev;
+
        struct {
                struct idr idr;
                struct mutex lock;
@@ -814,9 +820,9 @@ struct vc4_validated_shader_info {
 struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size);
 struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t size,
                             bool from_cache, enum vc4_kernel_bo_type type);
-int vc4_dumb_create(struct drm_file *file_priv,
-                   struct drm_device *dev,
-                   struct drm_mode_create_dumb *args);
+int vc4_bo_dumb_create(struct drm_file *file_priv,
+                      struct drm_device *dev,
+                      struct drm_mode_create_dumb *args);
 int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
                        struct drm_file *file_priv);
 int vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data,
@@ -885,6 +891,7 @@ static inline void vc4_debugfs_add_regset32(struct drm_device *drm,
 
 /* vc4_drv.c */
 void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index);
+int vc4_dumb_fixup_args(struct drm_mode_create_dumb *args);
 
 /* vc4_dpi.c */
 extern struct platform_driver vc4_dpi_driver;
index 9eaf304..fe10d9c 100644 (file)
@@ -76,6 +76,9 @@ vc4_get_hang_state_ioctl(struct drm_device *dev, void *data,
        u32 i;
        int ret = 0;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!vc4->v3d) {
                DRM_DEBUG("VC4_GET_HANG_STATE with no VC4 V3D probed\n");
                return -ENODEV;
@@ -386,6 +389,9 @@ vc4_wait_for_seqno(struct drm_device *dev, uint64_t seqno, uint64_t timeout_ns,
        unsigned long timeout_expire;
        DEFINE_WAIT(wait);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (vc4->finished_seqno >= seqno)
                return 0;
 
@@ -468,6 +474,9 @@ vc4_submit_next_bin_job(struct drm_device *dev)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_exec_info *exec;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
 again:
        exec = vc4_first_bin_job(vc4);
        if (!exec)
@@ -513,6 +522,9 @@ vc4_submit_next_render_job(struct drm_device *dev)
        if (!exec)
                return;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        /* A previous RCL may have written to one of our textures, and
         * our full cache flush at bin time may have occurred before
         * that RCL completed.  Flush the texture cache now, but not
@@ -531,6 +543,9 @@ vc4_move_job_to_render(struct drm_device *dev, struct vc4_exec_info *exec)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        bool was_empty = list_empty(&vc4->render_job_list);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        list_move_tail(&exec->head, &vc4->render_job_list);
        if (was_empty)
                vc4_submit_next_render_job(dev);
@@ -997,6 +1012,9 @@ vc4_job_handle_completed(struct vc4_dev *vc4)
        unsigned long irqflags;
        struct vc4_seqno_cb *cb, *cb_temp;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        spin_lock_irqsave(&vc4->job_lock, irqflags);
        while (!list_empty(&vc4->job_done_list)) {
                struct vc4_exec_info *exec =
@@ -1033,6 +1051,9 @@ int vc4_queue_seqno_cb(struct drm_device *dev,
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        unsigned long irqflags;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        cb->func = func;
        INIT_WORK(&cb->work, vc4_seqno_cb_work);
 
@@ -1083,8 +1104,12 @@ int
 vc4_wait_seqno_ioctl(struct drm_device *dev, void *data,
                     struct drm_file *file_priv)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_wait_seqno *args = data;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        return vc4_wait_for_seqno_ioctl_helper(dev, args->seqno,
                                               &args->timeout_ns);
 }
@@ -1093,11 +1118,15 @@ int
 vc4_wait_bo_ioctl(struct drm_device *dev, void *data,
                  struct drm_file *file_priv)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        int ret;
        struct drm_vc4_wait_bo *args = data;
        struct drm_gem_object *gem_obj;
        struct vc4_bo *bo;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (args->pad != 0)
                return -EINVAL;
 
@@ -1144,6 +1173,9 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
                                  args->shader_rec_size,
                                  args->bo_handle_count);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!vc4->v3d) {
                DRM_DEBUG("VC4_SUBMIT_CL with no VC4 V3D probed\n");
                return -ENODEV;
@@ -1167,6 +1199,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data,
                DRM_ERROR("malloc failure on exec struct\n");
                return -ENOMEM;
        }
+       exec->dev = vc4;
 
        ret = vc4_v3d_pm_get(vc4);
        if (ret) {
@@ -1276,6 +1309,9 @@ int vc4_gem_init(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        vc4->dma_fence_context = dma_fence_context_alloc(1);
 
        INIT_LIST_HEAD(&vc4->bin_job_list);
@@ -1321,11 +1357,15 @@ static void vc4_gem_destroy(struct drm_device *dev, void *unused)
 int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data,
                          struct drm_file *file_priv)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_vc4_gem_madvise *args = data;
        struct drm_gem_object *gem_obj;
        struct vc4_bo *bo;
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        switch (args->madv) {
        case VC4_MADV_DONTNEED:
        case VC4_MADV_WILLNEED:
index 823d812..ce9d166 100644 (file)
@@ -1481,7 +1481,7 @@ vc4_hdmi_encoder_compute_mode_clock(const struct drm_display_mode *mode,
                                    unsigned int bpc,
                                    enum vc4_hdmi_output_format fmt)
 {
-       unsigned long long clock = mode->clock * 1000;
+       unsigned long long clock = mode->clock * 1000ULL;
 
        if (mode->flags & DRM_MODE_FLAG_DBLCLK)
                clock = clock * 2;
index 2a58fc4..ba2c8e5 100644 (file)
@@ -220,10 +220,11 @@ u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo)
 
 int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output)
 {
+       struct vc4_dev *vc4 = hvs->vc4;
        u32 reg;
        int ret;
 
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                return output;
 
        switch (output) {
@@ -273,6 +274,7 @@ int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output)
 static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
                                struct drm_display_mode *mode, bool oneshot)
 {
+       struct vc4_dev *vc4 = hvs->vc4;
        struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
        struct vc4_crtc_state *vc4_crtc_state = to_vc4_crtc_state(crtc->state);
        unsigned int chan = vc4_crtc_state->assigned_channel;
@@ -291,7 +293,7 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
         */
        dispctrl = SCALER_DISPCTRLX_ENABLE;
 
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                dispctrl |= VC4_SET_FIELD(mode->hdisplay,
                                          SCALER_DISPCTRLX_WIDTH) |
                            VC4_SET_FIELD(mode->vdisplay,
@@ -312,7 +314,7 @@ static int vc4_hvs_init_channel(struct vc4_hvs *hvs, struct drm_crtc *crtc,
 
        HVS_WRITE(SCALER_DISPBKGNDX(chan), dispbkgndx |
                  SCALER_DISPBKGND_AUTOHS |
-                 ((!hvs->hvs5) ? SCALER_DISPBKGND_GAMMA : 0) |
+                 ((!vc4->is_vc5) ? SCALER_DISPBKGND_GAMMA : 0) |
                  (interlace ? SCALER_DISPBKGND_INTERLACE : 0));
 
        /* Reload the LUT, since the SRAMs would have been disabled if
@@ -617,11 +619,9 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
        if (!hvs)
                return -ENOMEM;
 
+       hvs->vc4 = vc4;
        hvs->pdev = pdev;
 
-       if (of_device_is_compatible(pdev->dev.of_node, "brcm,bcm2711-hvs"))
-               hvs->hvs5 = true;
-
        hvs->regs = vc4_ioremap_regs(pdev, 0);
        if (IS_ERR(hvs->regs))
                return PTR_ERR(hvs->regs);
@@ -630,7 +630,7 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
        hvs->regset.regs = hvs_regs;
        hvs->regset.nregs = ARRAY_SIZE(hvs_regs);
 
-       if (hvs->hvs5) {
+       if (vc4->is_vc5) {
                hvs->core_clk = devm_clk_get(&pdev->dev, NULL);
                if (IS_ERR(hvs->core_clk)) {
                        dev_err(&pdev->dev, "Couldn't get core clock\n");
@@ -644,7 +644,7 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
                }
        }
 
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                hvs->dlist = hvs->regs + SCALER_DLIST_START;
        else
                hvs->dlist = hvs->regs + SCALER5_DLIST_START;
@@ -665,7 +665,7 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
         * between planes when they don't overlap on the screen, but
         * for now we just allocate globally.
         */
-       if (!hvs->hvs5)
+       if (!vc4->is_vc5)
                /* 48k words of 2x12-bit pixels */
                drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024);
        else
index 4342fb4..2eacfb6 100644 (file)
@@ -265,6 +265,9 @@ vc4_irq_enable(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        if (!vc4->v3d)
                return;
 
@@ -279,6 +282,9 @@ vc4_irq_disable(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        if (!vc4->v3d)
                return;
 
@@ -296,8 +302,12 @@ vc4_irq_disable(struct drm_device *dev)
 
 int vc4_irq_install(struct drm_device *dev, int irq)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (irq == IRQ_NOTCONNECTED)
                return -ENOTCONN;
 
@@ -316,6 +326,9 @@ void vc4_irq_uninstall(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        vc4_irq_disable(dev);
        free_irq(vc4->irq, dev);
 }
@@ -326,6 +339,9 @@ void vc4_irq_reset(struct drm_device *dev)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        unsigned long irqflags;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        /* Acknowledge any stale IRQs. */
        V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
 
index c169bd7..893d831 100644 (file)
@@ -393,7 +393,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
                old_hvs_state->fifo_state[channel].pending_commit = NULL;
        }
 
-       if (vc4->hvs->hvs5) {
+       if (vc4->is_vc5) {
                unsigned long state_rate = max(old_hvs_state->core_clock_rate,
                                               new_hvs_state->core_clock_rate);
                unsigned long core_rate = max_t(unsigned long,
@@ -412,7 +412,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
 
        vc4_ctm_commit(vc4, state);
 
-       if (vc4->hvs->hvs5)
+       if (vc4->is_vc5)
                vc5_hvs_pv_muxing_commit(vc4, state);
        else
                vc4_hvs_pv_muxing_commit(vc4, state);
@@ -430,7 +430,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
 
        drm_atomic_helper_cleanup_planes(dev, state);
 
-       if (vc4->hvs->hvs5) {
+       if (vc4->is_vc5) {
                drm_dbg(dev, "Running the core clock at %lu Hz\n",
                        new_hvs_state->core_clock_rate);
 
@@ -479,8 +479,12 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev,
                                             struct drm_file *file_priv,
                                             const struct drm_mode_fb_cmd2 *mode_cmd)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_mode_fb_cmd2 mode_cmd_local;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return ERR_PTR(-ENODEV);
+
        /* If the user didn't specify a modifier, use the
         * vc4_set_tiling_ioctl() state for the BO.
         */
@@ -997,11 +1001,15 @@ static const struct drm_mode_config_funcs vc4_mode_funcs = {
        .fb_create = vc4_fb_create,
 };
 
+static const struct drm_mode_config_funcs vc5_mode_funcs = {
+       .atomic_check = vc4_atomic_check,
+       .atomic_commit = drm_atomic_helper_commit,
+       .fb_create = drm_gem_fb_create,
+};
+
 int vc4_kms_load(struct drm_device *dev)
 {
        struct vc4_dev *vc4 = to_vc4_dev(dev);
-       bool is_vc5 = of_device_is_compatible(dev->dev->of_node,
-                                             "brcm,bcm2711-vc5");
        int ret;
 
        /*
@@ -1009,7 +1017,7 @@ int vc4_kms_load(struct drm_device *dev)
         * the BCM2711, but the load tracker computations are used for
         * the core clock rate calculation.
         */
-       if (!is_vc5) {
+       if (!vc4->is_vc5) {
                /* Start with the load tracker enabled. Can be
                 * disabled through the debugfs load_tracker file.
                 */
@@ -1025,7 +1033,7 @@ int vc4_kms_load(struct drm_device *dev)
                return ret;
        }
 
-       if (is_vc5) {
+       if (vc4->is_vc5) {
                dev->mode_config.max_width = 7680;
                dev->mode_config.max_height = 7680;
        } else {
@@ -1033,7 +1041,7 @@ int vc4_kms_load(struct drm_device *dev)
                dev->mode_config.max_height = 2048;
        }
 
-       dev->mode_config.funcs = &vc4_mode_funcs;
+       dev->mode_config.funcs = vc4->is_vc5 ? &vc5_mode_funcs : &vc4_mode_funcs;
        dev->mode_config.helper_private = &vc4_mode_config_helpers;
        dev->mode_config.preferred_depth = 24;
        dev->mode_config.async_page_flip = true;
index 18abc06..c7f5adb 100644 (file)
 
 void vc4_perfmon_get(struct vc4_perfmon *perfmon)
 {
+       struct vc4_dev *vc4 = perfmon->dev;
+
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        if (perfmon)
                refcount_inc(&perfmon->refcnt);
 }
 
 void vc4_perfmon_put(struct vc4_perfmon *perfmon)
 {
-       if (perfmon && refcount_dec_and_test(&perfmon->refcnt))
+       struct vc4_dev *vc4;
+
+       if (!perfmon)
+               return;
+
+       vc4 = perfmon->dev;
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
+       if (refcount_dec_and_test(&perfmon->refcnt))
                kfree(perfmon);
 }
 
@@ -32,6 +46,9 @@ void vc4_perfmon_start(struct vc4_dev *vc4, struct vc4_perfmon *perfmon)
        unsigned int i;
        u32 mask;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        if (WARN_ON_ONCE(!perfmon || vc4->active_perfmon))
                return;
 
@@ -49,6 +66,9 @@ void vc4_perfmon_stop(struct vc4_dev *vc4, struct vc4_perfmon *perfmon,
 {
        unsigned int i;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        if (WARN_ON_ONCE(!vc4->active_perfmon ||
                         perfmon != vc4->active_perfmon))
                return;
@@ -64,8 +84,12 @@ void vc4_perfmon_stop(struct vc4_dev *vc4, struct vc4_perfmon *perfmon,
 
 struct vc4_perfmon *vc4_perfmon_find(struct vc4_file *vc4file, int id)
 {
+       struct vc4_dev *vc4 = vc4file->dev;
        struct vc4_perfmon *perfmon;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return NULL;
+
        mutex_lock(&vc4file->perfmon.lock);
        perfmon = idr_find(&vc4file->perfmon.idr, id);
        vc4_perfmon_get(perfmon);
@@ -76,8 +100,14 @@ struct vc4_perfmon *vc4_perfmon_find(struct vc4_file *vc4file, int id)
 
 void vc4_perfmon_open_file(struct vc4_file *vc4file)
 {
+       struct vc4_dev *vc4 = vc4file->dev;
+
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        mutex_init(&vc4file->perfmon.lock);
        idr_init_base(&vc4file->perfmon.idr, VC4_PERFMONID_MIN);
+       vc4file->dev = vc4;
 }
 
 static int vc4_perfmon_idr_del(int id, void *elem, void *data)
@@ -91,6 +121,11 @@ static int vc4_perfmon_idr_del(int id, void *elem, void *data)
 
 void vc4_perfmon_close_file(struct vc4_file *vc4file)
 {
+       struct vc4_dev *vc4 = vc4file->dev;
+
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        mutex_lock(&vc4file->perfmon.lock);
        idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, NULL);
        idr_destroy(&vc4file->perfmon.idr);
@@ -107,6 +142,9 @@ int vc4_perfmon_create_ioctl(struct drm_device *dev, void *data,
        unsigned int i;
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!vc4->v3d) {
                DRM_DEBUG("Creating perfmon no VC4 V3D probed\n");
                return -ENODEV;
@@ -127,6 +165,7 @@ int vc4_perfmon_create_ioctl(struct drm_device *dev, void *data,
                          GFP_KERNEL);
        if (!perfmon)
                return -ENOMEM;
+       perfmon->dev = vc4;
 
        for (i = 0; i < req->ncounters; i++)
                perfmon->events[i] = req->events[i];
@@ -157,6 +196,9 @@ int vc4_perfmon_destroy_ioctl(struct drm_device *dev, void *data,
        struct drm_vc4_perfmon_destroy *req = data;
        struct vc4_perfmon *perfmon;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!vc4->v3d) {
                DRM_DEBUG("Destroying perfmon no VC4 V3D probed\n");
                return -ENODEV;
@@ -182,6 +224,9 @@ int vc4_perfmon_get_values_ioctl(struct drm_device *dev, void *data,
        struct vc4_perfmon *perfmon;
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (!vc4->v3d) {
                DRM_DEBUG("Getting perfmon no VC4 V3D probed\n");
                return -ENODEV;
index b3438f4..1e866dc 100644 (file)
@@ -489,10 +489,10 @@ static u32 vc4_lbm_size(struct drm_plane_state *state)
        }
 
        /* Align it to 64 or 128 (hvs5) bytes */
-       lbm = roundup(lbm, vc4->hvs->hvs5 ? 128 : 64);
+       lbm = roundup(lbm, vc4->is_vc5 ? 128 : 64);
 
        /* Each "word" of the LBM memory contains 2 or 4 (hvs5) pixels */
-       lbm /= vc4->hvs->hvs5 ? 4 : 2;
+       lbm /= vc4->is_vc5 ? 4 : 2;
 
        return lbm;
 }
@@ -608,7 +608,7 @@ static int vc4_plane_allocate_lbm(struct drm_plane_state *state)
                ret = drm_mm_insert_node_generic(&vc4->hvs->lbm_mm,
                                                 &vc4_state->lbm,
                                                 lbm_size,
-                                                vc4->hvs->hvs5 ? 64 : 32,
+                                                vc4->is_vc5 ? 64 : 32,
                                                 0, 0);
                spin_unlock_irqrestore(&vc4->hvs->mm_lock, irqflags);
 
@@ -917,7 +917,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane,
        mix_plane_alpha = state->alpha != DRM_BLEND_ALPHA_OPAQUE &&
                          fb->format->has_alpha;
 
-       if (!vc4->hvs->hvs5) {
+       if (!vc4->is_vc5) {
        /* Control word */
                vc4_dlist_write(vc4_state,
                                SCALER_CTL0_VALID |
@@ -1321,6 +1321,10 @@ static int vc4_plane_atomic_async_check(struct drm_plane *plane,
 
        old_vc4_state = to_vc4_plane_state(plane->state);
        new_vc4_state = to_vc4_plane_state(new_plane_state);
+
+       if (!new_vc4_state->hw_dlist)
+               return -EINVAL;
+
        if (old_vc4_state->dlist_count != new_vc4_state->dlist_count ||
            old_vc4_state->pos0_offset != new_vc4_state->pos0_offset ||
            old_vc4_state->pos2_offset != new_vc4_state->pos2_offset ||
@@ -1385,6 +1389,13 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
        .atomic_async_update = vc4_plane_atomic_async_update,
 };
 
+static const struct drm_plane_helper_funcs vc5_plane_helper_funcs = {
+       .atomic_check = vc4_plane_atomic_check,
+       .atomic_update = vc4_plane_atomic_update,
+       .atomic_async_check = vc4_plane_atomic_async_check,
+       .atomic_async_update = vc4_plane_atomic_async_update,
+};
+
 static bool vc4_format_mod_supported(struct drm_plane *plane,
                                     uint32_t format,
                                     uint64_t modifier)
@@ -1453,14 +1464,13 @@ static const struct drm_plane_funcs vc4_plane_funcs = {
 struct drm_plane *vc4_plane_init(struct drm_device *dev,
                                 enum drm_plane_type type)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct drm_plane *plane = NULL;
        struct vc4_plane *vc4_plane;
        u32 formats[ARRAY_SIZE(hvs_formats)];
        int num_formats = 0;
        int ret = 0;
        unsigned i;
-       bool hvs5 = of_device_is_compatible(dev->dev->of_node,
-                                           "brcm,bcm2711-vc5");
        static const uint64_t modifiers[] = {
                DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED,
                DRM_FORMAT_MOD_BROADCOM_SAND128,
@@ -1476,7 +1486,7 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
                return ERR_PTR(-ENOMEM);
 
        for (i = 0; i < ARRAY_SIZE(hvs_formats); i++) {
-               if (!hvs_formats[i].hvs5_only || hvs5) {
+               if (!hvs_formats[i].hvs5_only || vc4->is_vc5) {
                        formats[num_formats] = hvs_formats[i].drm;
                        num_formats++;
                }
@@ -1490,7 +1500,10 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
        if (ret)
                return ERR_PTR(ret);
 
-       drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
+       if (vc4->is_vc5)
+               drm_plane_helper_add(plane, &vc5_plane_helper_funcs);
+       else
+               drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
 
        drm_plane_create_alpha_property(plane);
        drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
index 3c918ee..f6b7dc3 100644 (file)
@@ -593,11 +593,15 @@ vc4_rcl_render_config_surface_setup(struct vc4_exec_info *exec,
 
 int vc4_get_rcl(struct drm_device *dev, struct vc4_exec_info *exec)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        struct vc4_rcl_setup setup = {0};
        struct drm_vc4_submit_cl *args = exec->args;
        bool has_bin = args->bin_cl_size != 0;
        int ret;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        if (args->min_x_tile > args->max_x_tile ||
            args->min_y_tile > args->max_y_tile) {
                DRM_DEBUG("Bad render tile set (%d,%d)-(%d,%d)\n",
index 7bb3067..cc714dc 100644 (file)
@@ -127,6 +127,9 @@ static int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
 int
 vc4_v3d_pm_get(struct vc4_dev *vc4)
 {
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        mutex_lock(&vc4->power_lock);
        if (vc4->power_refcount++ == 0) {
                int ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
@@ -145,6 +148,9 @@ vc4_v3d_pm_get(struct vc4_dev *vc4)
 void
 vc4_v3d_pm_put(struct vc4_dev *vc4)
 {
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        mutex_lock(&vc4->power_lock);
        if (--vc4->power_refcount == 0) {
                pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev);
@@ -172,6 +178,9 @@ int vc4_v3d_get_bin_slot(struct vc4_dev *vc4)
        uint64_t seqno = 0;
        struct vc4_exec_info *exec;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
 try_again:
        spin_lock_irqsave(&vc4->job_lock, irqflags);
        slot = ffs(~vc4->bin_alloc_used);
@@ -316,6 +325,9 @@ int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used)
 {
        int ret = 0;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        mutex_lock(&vc4->bin_bo_lock);
 
        if (used && *used)
@@ -348,6 +360,9 @@ static void bin_bo_release(struct kref *ref)
 
 void vc4_v3d_bin_bo_put(struct vc4_dev *vc4)
 {
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return;
+
        mutex_lock(&vc4->bin_bo_lock);
        kref_put(&vc4->bin_bo_kref, bin_bo_release);
        mutex_unlock(&vc4->bin_bo_lock);
index eec76af..2feba55 100644 (file)
@@ -105,9 +105,13 @@ size_is_lt(uint32_t width, uint32_t height, int cpp)
 struct drm_gem_cma_object *
 vc4_use_bo(struct vc4_exec_info *exec, uint32_t hindex)
 {
+       struct vc4_dev *vc4 = exec->dev;
        struct drm_gem_cma_object *obj;
        struct vc4_bo *bo;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return NULL;
+
        if (hindex >= exec->bo_count) {
                DRM_DEBUG("BO index %d greater than BO count %d\n",
                          hindex, exec->bo_count);
@@ -160,10 +164,14 @@ vc4_check_tex_size(struct vc4_exec_info *exec, struct drm_gem_cma_object *fbo,
                   uint32_t offset, uint8_t tiling_format,
                   uint32_t width, uint32_t height, uint8_t cpp)
 {
+       struct vc4_dev *vc4 = exec->dev;
        uint32_t aligned_width, aligned_height, stride, size;
        uint32_t utile_w = utile_width(cpp);
        uint32_t utile_h = utile_height(cpp);
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return false;
+
        /* The shaded vertex format stores signed 12.4 fixed point
         * (-2048,2047) offsets from the viewport center, so we should
         * never have a render target larger than 4096.  The texture
@@ -482,10 +490,14 @@ vc4_validate_bin_cl(struct drm_device *dev,
                    void *unvalidated,
                    struct vc4_exec_info *exec)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        uint32_t len = exec->args->bin_cl_size;
        uint32_t dst_offset = 0;
        uint32_t src_offset = 0;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        while (src_offset < len) {
                void *dst_pkt = validated + dst_offset;
                void *src_pkt = unvalidated + src_offset;
@@ -926,9 +938,13 @@ int
 vc4_validate_shader_recs(struct drm_device *dev,
                         struct vc4_exec_info *exec)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(dev);
        uint32_t i;
        int ret = 0;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return -ENODEV;
+
        for (i = 0; i < exec->shader_state_count; i++) {
                ret = validate_gl_shader_rec(dev, exec, &exec->shader_state[i]);
                if (ret)
index 7cf82b0..e315aeb 100644 (file)
@@ -778,6 +778,7 @@ vc4_handle_branch_target(struct vc4_shader_validation_state *validation_state)
 struct vc4_validated_shader_info *
 vc4_validate_shader(struct drm_gem_cma_object *shader_obj)
 {
+       struct vc4_dev *vc4 = to_vc4_dev(shader_obj->base.dev);
        bool found_shader_end = false;
        int shader_end_ip = 0;
        uint32_t last_thread_switch_ip = -3;
@@ -785,6 +786,9 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj)
        struct vc4_validated_shader_info *validated_shader = NULL;
        struct vc4_shader_validation_state validation_state;
 
+       if (WARN_ON_ONCE(vc4->is_vc5))
+               return NULL;
+
        memset(&validation_state, 0, sizeof(validation_state));
        validation_state.shader = shader_obj->vaddr;
        validation_state.max_ip = shader_obj->base.size / sizeof(uint64_t);
index 5a5bf4e..e31554d 100644 (file)
@@ -71,7 +71,7 @@ static int xen_drm_front_gem_object_mmap(struct drm_gem_object *gem_obj,
         * the whole buffer.
         */
        vma->vm_flags &= ~VM_PFNMAP;
-       vma->vm_flags |= VM_MIXEDMAP;
+       vma->vm_flags |= VM_MIXEDMAP | VM_DONTEXPAND;
        vma->vm_pgoff = 0;
 
        /*
index 978ee2a..e0bc731 100644 (file)
@@ -199,7 +199,8 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
        if (!input_device->hid_desc)
                goto cleanup;
 
-       input_device->report_desc_size = desc->desc[0].wDescriptorLength;
+       input_device->report_desc_size = le16_to_cpu(
+                                       desc->desc[0].wDescriptorLength);
        if (input_device->report_desc_size == 0) {
                input_device->dev_info_status = -EINVAL;
                goto cleanup;
@@ -217,7 +218,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
 
        memcpy(input_device->report_desc,
               ((unsigned char *)desc) + desc->bLength,
-              desc->desc[0].wDescriptorLength);
+              le16_to_cpu(desc->desc[0].wDescriptorLength));
 
        /* Send the ack */
        memset(&ack, 0, sizeof(struct mousevsc_prt_msg));
index b60f134..5b12040 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/cpu.h>
 #include <linux/hyperv.h>
 #include <asm/mshyperv.h>
+#include <linux/sched/isolation.h>
 
 #include "hyperv_vmbus.h"
 
@@ -638,6 +639,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
                 */
                if (newchannel->offermsg.offer.sub_channel_index == 0) {
                        mutex_unlock(&vmbus_connection.channel_mutex);
+                       cpus_read_unlock();
                        /*
                         * Don't call free_channel(), because newchannel->kobj
                         * is not initialized yet.
@@ -728,16 +730,20 @@ static void init_vp_index(struct vmbus_channel *channel)
        u32 i, ncpu = num_online_cpus();
        cpumask_var_t available_mask;
        struct cpumask *allocated_mask;
+       const struct cpumask *hk_mask = housekeeping_cpumask(HK_TYPE_MANAGED_IRQ);
        u32 target_cpu;
        int numa_node;
 
        if (!perf_chn ||
-           !alloc_cpumask_var(&available_mask, GFP_KERNEL)) {
+           !alloc_cpumask_var(&available_mask, GFP_KERNEL) ||
+           cpumask_empty(hk_mask)) {
                /*
                 * If the channel is not a performance critical
                 * channel, bind it to VMBUS_CONNECT_CPU.
                 * In case alloc_cpumask_var() fails, bind it to
                 * VMBUS_CONNECT_CPU.
+                * If all the cpus are isolated, bind it to
+                * VMBUS_CONNECT_CPU.
                 */
                channel->target_cpu = VMBUS_CONNECT_CPU;
                if (perf_chn)
@@ -758,17 +764,19 @@ static void init_vp_index(struct vmbus_channel *channel)
                }
                allocated_mask = &hv_context.hv_numa_map[numa_node];
 
-               if (cpumask_equal(allocated_mask, cpumask_of_node(numa_node))) {
+retry:
+               cpumask_xor(available_mask, allocated_mask, cpumask_of_node(numa_node));
+               cpumask_and(available_mask, available_mask, hk_mask);
+
+               if (cpumask_empty(available_mask)) {
                        /*
                         * We have cycled through all the CPUs in the node;
                         * reset the allocated map.
                         */
                        cpumask_clear(allocated_mask);
+                       goto retry;
                }
 
-               cpumask_xor(available_mask, allocated_mask,
-                           cpumask_of_node(numa_node));
-
                target_cpu = cpumask_first(available_mask);
                cpumask_set_cpu(target_cpu, allocated_mask);
 
index c698592..d35b60c 100644 (file)
@@ -394,7 +394,7 @@ kvp_send_key(struct work_struct *dummy)
        in_msg = kvp_transaction.kvp_msg;
 
        /*
-        * The key/value strings sent from the host are encoded in
+        * The key/value strings sent from the host are encoded
         * in utf16; convert it to utf8 strings.
         * The host assures us that the utf16 strings will not exceed
         * the max lengths specified. We will however, reserve room
index 714d549..547ae33 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/clockchips.h>
 #include <linux/cpu.h>
+#include <linux/sched/isolation.h>
 #include <linux/sched/task_stack.h>
 
 #include <linux/delay.h>
@@ -1770,6 +1771,9 @@ static ssize_t target_cpu_store(struct vmbus_channel *channel,
        if (target_cpu >= nr_cpumask_bits)
                return -EINVAL;
 
+       if (!cpumask_test_cpu(target_cpu, housekeeping_cpumask(HK_TYPE_MANAGED_IRQ)))
+               return -EINVAL;
+
        /* No CPUs should come up or down during this. */
        cpus_read_lock();
 
index 57e11b2..3633ab6 100644 (file)
@@ -259,7 +259,7 @@ static const struct ec_board_info board_info[] = {
        },
        {
                .board_names = {
-                       "ROG CROSSHAIR VIII FORMULA"
+                       "ROG CROSSHAIR VIII FORMULA",
                        "ROG CROSSHAIR VIII HERO",
                        "ROG CROSSHAIR VIII HERO (WI-FI)",
                },
index d78f4be..ea070b9 100644 (file)
@@ -1228,10 +1228,15 @@ EXPORT_SYMBOL_GPL(occ_setup);
 
 void occ_shutdown(struct occ *occ)
 {
+       mutex_lock(&occ->lock);
+
        occ_shutdown_sysfs(occ);
 
        if (occ->hwmon)
                hwmon_device_unregister(occ->hwmon);
+       occ->hwmon = NULL;
+
+       mutex_unlock(&occ->lock);
 }
 EXPORT_SYMBOL_GPL(occ_shutdown);
 
index e7d316b..c023b69 100644 (file)
@@ -477,9 +477,6 @@ int i2c_dw_prepare_clk(struct dw_i2c_dev *dev, bool prepare)
 {
        int ret;
 
-       if (IS_ERR(dev->clk))
-               return PTR_ERR(dev->clk);
-
        if (prepare) {
                /* Optional interface clock */
                ret = clk_prepare_enable(dev->pclk);
index 70ade53..ba043b5 100644 (file)
@@ -320,8 +320,17 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
                goto exit_reset;
        }
 
-       dev->clk = devm_clk_get(&pdev->dev, NULL);
-       if (!i2c_dw_prepare_clk(dev, true)) {
+       dev->clk = devm_clk_get_optional(&pdev->dev, NULL);
+       if (IS_ERR(dev->clk)) {
+               ret = PTR_ERR(dev->clk);
+               goto exit_reset;
+       }
+
+       ret = i2c_dw_prepare_clk(dev, true);
+       if (ret)
+               goto exit_reset;
+
+       if (dev->clk) {
                u64 clk_khz;
 
                dev->get_clk_rate_khz = i2c_dw_get_clk_rate_khz;
index bdecb78..8e69853 100644 (file)
@@ -1420,17 +1420,22 @@ static int mtk_i2c_probe(struct platform_device *pdev)
        if (ret < 0) {
                dev_err(&pdev->dev,
                        "Request I2C IRQ %d fail\n", irq);
-               return ret;
+               goto err_bulk_unprepare;
        }
 
        i2c_set_adapdata(&i2c->adap, i2c);
        ret = i2c_add_adapter(&i2c->adap);
        if (ret)
-               return ret;
+               goto err_bulk_unprepare;
 
        platform_set_drvdata(pdev, i2c);
 
        return 0;
+
+err_bulk_unprepare:
+       clk_bulk_unprepare(I2C_MT65XX_CLK_MAX, i2c->clocks);
+
+       return ret;
 }
 
 static int mtk_i2c_remove(struct platform_device *pdev)
index 5960ccd..aede9d5 100644 (file)
@@ -2372,8 +2372,7 @@ static struct platform_driver npcm_i2c_bus_driver = {
 static int __init npcm_i2c_init(void)
 {
        npcm_i2c_debugfs_dir = debugfs_create_dir("npcm_i2c", NULL);
-       platform_driver_register(&npcm_i2c_bus_driver);
-       return 0;
+       return platform_driver_register(&npcm_i2c_bus_driver);
 }
 module_init(npcm_i2c_init);
 
index b9bb94b..424ef47 100644 (file)
@@ -115,6 +115,18 @@ static unsigned int mwait_substates __initdata;
 #define flg2MWAIT(flags) (((flags) >> 24) & 0xFF)
 #define MWAIT2flg(eax) ((eax & 0xFF) << 24)
 
+static __always_inline int __intel_idle(struct cpuidle_device *dev,
+                                       struct cpuidle_driver *drv, int index)
+{
+       struct cpuidle_state *state = &drv->states[index];
+       unsigned long eax = flg2MWAIT(state->flags);
+       unsigned long ecx = 1; /* break on interrupt flag */
+
+       mwait_idle_with_hints(eax, ecx);
+
+       return index;
+}
+
 /**
  * intel_idle - Ask the processor to enter the given idle state.
  * @dev: cpuidle device of the target CPU.
@@ -132,16 +144,19 @@ static unsigned int mwait_substates __initdata;
 static __cpuidle int intel_idle(struct cpuidle_device *dev,
                                struct cpuidle_driver *drv, int index)
 {
-       struct cpuidle_state *state = &drv->states[index];
-       unsigned long eax = flg2MWAIT(state->flags);
-       unsigned long ecx = 1; /* break on interrupt flag */
+       return __intel_idle(dev, drv, index);
+}
 
-       if (state->flags & CPUIDLE_FLAG_IRQ_ENABLE)
-               local_irq_enable();
+static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,
+                                   struct cpuidle_driver *drv, int index)
+{
+       int ret;
 
-       mwait_idle_with_hints(eax, ecx);
+       raw_local_irq_enable();
+       ret = __intel_idle(dev, drv, index);
+       raw_local_irq_disable();
 
-       return index;
+       return ret;
 }
 
 /**
@@ -1801,6 +1816,9 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
                /* Structure copy. */
                drv->states[drv->state_count] = cpuidle_state_table[cstate];
 
+               if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_IRQ_ENABLE)
+                       drv->states[drv->state_count].enter = intel_idle_irq;
+
                if ((disabled_states_mask & BIT(drv->state_count)) ||
                    ((icpu->use_acpi || force_use_acpi) &&
                     intel_idle_off_by_default(mwait_hint) &&
index 4f73bc8..9c9e985 100644 (file)
@@ -1006,11 +1006,12 @@ static int bma180_probe(struct i2c_client *client,
 
                data->trig->ops = &bma180_trigger_ops;
                iio_trigger_set_drvdata(data->trig, indio_dev);
-               indio_dev->trig = iio_trigger_get(data->trig);
 
                ret = iio_trigger_register(data->trig);
                if (ret)
                        goto err_trigger_free;
+
+               indio_dev->trig = iio_trigger_get(data->trig);
        }
 
        ret = iio_triggered_buffer_setup(indio_dev, NULL,
index ac74cdc..748b35c 100644 (file)
@@ -1554,12 +1554,12 @@ static int kxcjk1013_probe(struct i2c_client *client,
 
                data->dready_trig->ops = &kxcjk1013_trigger_ops;
                iio_trigger_set_drvdata(data->dready_trig, indio_dev);
-               indio_dev->trig = data->dready_trig;
-               iio_trigger_get(indio_dev->trig);
                ret = iio_trigger_register(data->dready_trig);
                if (ret)
                        goto err_poweroff;
 
+               indio_dev->trig = iio_trigger_get(data->dready_trig);
+
                data->motion_trig->ops = &kxcjk1013_trigger_ops;
                iio_trigger_set_drvdata(data->motion_trig, indio_dev);
                ret = iio_trigger_register(data->motion_trig);
index 912a447..c7d9ca9 100644 (file)
@@ -1511,10 +1511,14 @@ static int mma8452_reset(struct i2c_client *client)
        int i;
        int ret;
 
-       ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
+       /*
+        * Find on fxls8471, after config reset bit, it reset immediately,
+        * and will not give ACK, so here do not check the return value.
+        * The following code will read the reset register, and check whether
+        * this reset works.
+        */
+       i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
                                        MMA8452_CTRL_REG2_RST);
-       if (ret < 0)
-               return ret;
 
        for (i = 0; i < 10; i++) {
                usleep_range(100, 200);
@@ -1557,11 +1561,13 @@ static int mma8452_probe(struct i2c_client *client,
        mutex_init(&data->lock);
 
        data->chip_info = device_get_match_data(&client->dev);
-       if (!data->chip_info && id) {
-               data->chip_info = &mma_chip_info_table[id->driver_data];
-       } else {
-               dev_err(&client->dev, "unknown device model\n");
-               return -ENODEV;
+       if (!data->chip_info) {
+               if (id) {
+                       data->chip_info = &mma_chip_info_table[id->driver_data];
+               } else {
+                       dev_err(&client->dev, "unknown device model\n");
+                       return -ENODEV;
+               }
        }
 
        ret = iio_read_mount_matrix(&client->dev, &data->orientation);
index b3afbf0..df600d2 100644 (file)
@@ -456,8 +456,6 @@ static int mxc4005_probe(struct i2c_client *client,
 
                data->dready_trig->ops = &mxc4005_trigger_ops;
                iio_trigger_set_drvdata(data->dready_trig, indio_dev);
-               indio_dev->trig = data->dready_trig;
-               iio_trigger_get(indio_dev->trig);
                ret = devm_iio_trigger_register(&client->dev,
                                                data->dready_trig);
                if (ret) {
@@ -465,6 +463,8 @@ static int mxc4005_probe(struct i2c_client *client,
                                "failed to register trigger\n");
                        return ret;
                }
+
+               indio_dev->trig = iio_trigger_get(data->dready_trig);
        }
 
        return devm_iio_device_register(&client->dev, indio_dev);
index a73e3c2..a9e655e 100644 (file)
@@ -322,16 +322,19 @@ static struct adi_axi_adc_client *adi_axi_adc_attach_client(struct device *dev)
 
                if (!try_module_get(cl->dev->driver->owner)) {
                        mutex_unlock(&registered_clients_lock);
+                       of_node_put(cln);
                        return ERR_PTR(-ENODEV);
                }
 
                get_device(cl->dev);
                cl->info = info;
                mutex_unlock(&registered_clients_lock);
+               of_node_put(cln);
                return cl;
        }
 
        mutex_unlock(&registered_clients_lock);
+       of_node_put(cln);
 
        return ERR_PTR(-EPROBE_DEFER);
 }
index 0793d24..9341e0e 100644 (file)
@@ -186,6 +186,7 @@ static int aspeed_adc_set_trim_data(struct iio_dev *indio_dev)
                return -EOPNOTSUPP;
        }
        scu = syscon_node_to_regmap(syscon);
+       of_node_put(syscon);
        if (IS_ERR(scu)) {
                dev_warn(data->dev, "Failed to get syscon regmap\n");
                return -EOPNOTSUPP;
index a4b8be5..580361b 100644 (file)
@@ -196,6 +196,14 @@ static const struct dmi_system_id axp288_adc_ts_bias_override[] = {
                },
                .driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
        },
+       {
+               /* Nuvision Solo 10 Draw */
+               .matches = {
+                 DMI_MATCH(DMI_SYS_VENDOR, "TMAX"),
+                 DMI_MATCH(DMI_PRODUCT_NAME, "TM101W610L"),
+               },
+               .driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
+       },
        {}
 };
 
index 7585144..5b09a93 100644 (file)
@@ -334,11 +334,15 @@ static int rzg2l_adc_parse_properties(struct platform_device *pdev, struct rzg2l
        i = 0;
        device_for_each_child_node(&pdev->dev, fwnode) {
                ret = fwnode_property_read_u32(fwnode, "reg", &channel);
-               if (ret)
+               if (ret) {
+                       fwnode_handle_put(fwnode);
                        return ret;
+               }
 
-               if (channel >= RZG2L_ADC_MAX_CHANNELS)
+               if (channel >= RZG2L_ADC_MAX_CHANNELS) {
+                       fwnode_handle_put(fwnode);
                        return -EINVAL;
+               }
 
                chan_array[i].type = IIO_VOLTAGE;
                chan_array[i].indexed = 1;
index 1426562..3efb8c4 100644 (file)
@@ -64,6 +64,7 @@ struct stm32_adc_priv;
  * @max_clk_rate_hz: maximum analog clock rate (Hz, from datasheet)
  * @has_syscfg: SYSCFG capability flags
  * @num_irqs:  number of interrupt lines
+ * @num_adcs:   maximum number of ADC instances in the common registers
  */
 struct stm32_adc_priv_cfg {
        const struct stm32_adc_common_regs *regs;
@@ -71,6 +72,7 @@ struct stm32_adc_priv_cfg {
        u32 max_clk_rate_hz;
        unsigned int has_syscfg;
        unsigned int num_irqs;
+       unsigned int num_adcs;
 };
 
 /**
@@ -352,7 +354,7 @@ static void stm32_adc_irq_handler(struct irq_desc *desc)
         * before invoking the interrupt handler (e.g. call ISR only for
         * IRQ-enabled ADCs).
         */
-       for (i = 0; i < priv->cfg->num_irqs; i++) {
+       for (i = 0; i < priv->cfg->num_adcs; i++) {
                if ((status & priv->cfg->regs->eoc_msk[i] &&
                     stm32_adc_eoc_enabled(priv, i)) ||
                     (status & priv->cfg->regs->ovr_msk[i]))
@@ -792,6 +794,7 @@ static const struct stm32_adc_priv_cfg stm32f4_adc_priv_cfg = {
        .clk_sel = stm32f4_adc_clk_sel,
        .max_clk_rate_hz = 36000000,
        .num_irqs = 1,
+       .num_adcs = 3,
 };
 
 static const struct stm32_adc_priv_cfg stm32h7_adc_priv_cfg = {
@@ -800,14 +803,16 @@ static const struct stm32_adc_priv_cfg stm32h7_adc_priv_cfg = {
        .max_clk_rate_hz = 36000000,
        .has_syscfg = HAS_VBOOSTER,
        .num_irqs = 1,
+       .num_adcs = 2,
 };
 
 static const struct stm32_adc_priv_cfg stm32mp1_adc_priv_cfg = {
        .regs = &stm32h7_adc_common_regs,
        .clk_sel = stm32h7_adc_clk_sel,
-       .max_clk_rate_hz = 40000000,
+       .max_clk_rate_hz = 36000000,
        .has_syscfg = HAS_VBOOSTER | HAS_ANASWVDD,
        .num_irqs = 2,
+       .num_adcs = 2,
 };
 
 static const struct of_device_id stm32_adc_of_match[] = {
index a68ecbd..11ef873 100644 (file)
@@ -1365,7 +1365,7 @@ static int stm32_adc_read_raw(struct iio_dev *indio_dev,
                else
                        ret = -EINVAL;
 
-               if (mask == IIO_CHAN_INFO_PROCESSED && adc->vrefint.vrefint_cal)
+               if (mask == IIO_CHAN_INFO_PROCESSED)
                        *val = STM32_ADC_VREFINT_VOLTAGE * adc->vrefint.vrefint_cal / *val;
 
                iio_device_release_direct_mode(indio_dev);
@@ -1407,7 +1407,6 @@ static irqreturn_t stm32_adc_threaded_isr(int irq, void *data)
        struct stm32_adc *adc = iio_priv(indio_dev);
        const struct stm32_adc_regspec *regs = adc->cfg->regs;
        u32 status = stm32_adc_readl(adc, regs->isr_eoc.reg);
-       u32 mask = stm32_adc_readl(adc, regs->ier_eoc.reg);
 
        /* Check ovr status right now, as ovr mask should be already disabled */
        if (status & regs->isr_ovr.mask) {
@@ -1422,11 +1421,6 @@ static irqreturn_t stm32_adc_threaded_isr(int irq, void *data)
                return IRQ_HANDLED;
        }
 
-       if (!(status & mask))
-               dev_err_ratelimited(&indio_dev->dev,
-                                   "Unexpected IRQ: IER=0x%08x, ISR=0x%08x\n",
-                                   mask, status);
-
        return IRQ_NONE;
 }
 
@@ -1436,10 +1430,6 @@ static irqreturn_t stm32_adc_isr(int irq, void *data)
        struct stm32_adc *adc = iio_priv(indio_dev);
        const struct stm32_adc_regspec *regs = adc->cfg->regs;
        u32 status = stm32_adc_readl(adc, regs->isr_eoc.reg);
-       u32 mask = stm32_adc_readl(adc, regs->ier_eoc.reg);
-
-       if (!(status & mask))
-               return IRQ_WAKE_THREAD;
 
        if (status & regs->isr_ovr.mask) {
                /*
@@ -1979,10 +1969,10 @@ static int stm32_adc_populate_int_ch(struct iio_dev *indio_dev, const char *ch_n
 
        for (i = 0; i < STM32_ADC_INT_CH_NB; i++) {
                if (!strncmp(stm32_adc_ic[i].name, ch_name, STM32_ADC_CH_SZ)) {
-                       adc->int_ch[i] = chan;
-
-                       if (stm32_adc_ic[i].idx != STM32_ADC_INT_CH_VREFINT)
-                               continue;
+                       if (stm32_adc_ic[i].idx != STM32_ADC_INT_CH_VREFINT) {
+                               adc->int_ch[i] = chan;
+                               break;
+                       }
 
                        /* Get calibration data for vrefint channel */
                        ret = nvmem_cell_read_u16(&indio_dev->dev, "vrefint", &vrefint);
@@ -1990,10 +1980,15 @@ static int stm32_adc_populate_int_ch(struct iio_dev *indio_dev, const char *ch_n
                                return dev_err_probe(indio_dev->dev.parent, ret,
                                                     "nvmem access error\n");
                        }
-                       if (ret == -ENOENT)
-                               dev_dbg(&indio_dev->dev, "vrefint calibration not found\n");
-                       else
-                               adc->vrefint.vrefint_cal = vrefint;
+                       if (ret == -ENOENT) {
+                               dev_dbg(&indio_dev->dev, "vrefint calibration not found. Skip vrefint channel\n");
+                               return ret;
+                       } else if (!vrefint) {
+                               dev_dbg(&indio_dev->dev, "Null vrefint calibration value. Skip vrefint channel\n");
+                               return -ENOENT;
+                       }
+                       adc->int_ch[i] = chan;
+                       adc->vrefint.vrefint_cal = vrefint;
                }
        }
 
@@ -2030,7 +2025,9 @@ static int stm32_adc_generic_chan_init(struct iio_dev *indio_dev,
                        }
                        strncpy(adc->chan_name[val], name, STM32_ADC_CH_SZ);
                        ret = stm32_adc_populate_int_ch(indio_dev, name, val);
-                       if (ret)
+                       if (ret == -ENOENT)
+                               continue;
+                       else if (ret)
                                goto err;
                } else if (ret != -EINVAL) {
                        dev_err(&indio_dev->dev, "Invalid label %d\n", ret);
index 0c2025a..80a0981 100644 (file)
@@ -739,7 +739,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev)
        device_for_each_child_node(dev, node) {
                ret = fwnode_property_read_u32(node, "reg", &channel);
                if (ret)
-                       return ret;
+                       goto err_child_out;
 
                ret = fwnode_property_read_u32(node, "ti,gain", &tmp);
                if (ret) {
@@ -747,7 +747,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev)
                } else {
                        ret = ads131e08_pga_gain_to_field_value(st, tmp);
                        if (ret < 0)
-                               return ret;
+                               goto err_child_out;
 
                        channel_config[i].pga_gain = tmp;
                }
@@ -758,7 +758,7 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev)
                } else {
                        ret = ads131e08_validate_channel_mux(st, tmp);
                        if (ret)
-                               return ret;
+                               goto err_child_out;
 
                        channel_config[i].mux = tmp;
                }
@@ -784,6 +784,10 @@ static int ads131e08_alloc_channels(struct iio_dev *indio_dev)
        st->channel_config = channel_config;
 
        return 0;
+
+err_child_out:
+       fwnode_handle_put(node);
+       return ret;
 }
 
 static void ads131e08_regulator_disable(void *data)
index a55396c..a768770 100644 (file)
@@ -1409,7 +1409,7 @@ static int ams_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
-               return ret;
+               return irq;
 
        ret = devm_request_irq(&pdev->dev, irq, &ams_irq, 0, "ams-irq",
                               indio_dev);
index c6cf709..6949d21 100644 (file)
@@ -277,7 +277,7 @@ static int rescale_configure_channel(struct device *dev,
        chan->ext_info = rescale->ext_info;
        chan->type = rescale->cfg->type;
 
-       if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) ||
+       if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) &&
            iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE)) {
                dev_info(dev, "using raw+scale source channel\n");
        } else if (iio_channel_has_info(schan, IIO_CHAN_INFO_PROCESSED)) {
index 847194f..80ef1aa 100644 (file)
@@ -499,11 +499,11 @@ static int ccs811_probe(struct i2c_client *client,
 
                data->drdy_trig->ops = &ccs811_trigger_ops;
                iio_trigger_set_drvdata(data->drdy_trig, indio_dev);
-               indio_dev->trig = data->drdy_trig;
-               iio_trigger_get(indio_dev->trig);
                ret = iio_trigger_register(data->drdy_trig);
                if (ret)
                        goto err_poweroff;
+
+               indio_dev->trig = iio_trigger_get(data->drdy_trig);
        }
 
        ret = iio_triggered_buffer_setup(indio_dev, NULL,
index a7994f8..1aac566 100644 (file)
@@ -700,8 +700,10 @@ static int admv1014_init(struct admv1014_state *st)
                         ADMV1014_DET_EN_MSK;
 
        enable_reg = FIELD_PREP(ADMV1014_P1DB_COMPENSATION_MSK, st->p1db_comp ? 3 : 0) |
-                    FIELD_PREP(ADMV1014_IF_AMP_PD_MSK, !(st->input_mode)) |
-                    FIELD_PREP(ADMV1014_BB_AMP_PD_MSK, st->input_mode) |
+                    FIELD_PREP(ADMV1014_IF_AMP_PD_MSK,
+                               (st->input_mode == ADMV1014_IF_MODE) ? 0 : 1) |
+                    FIELD_PREP(ADMV1014_BB_AMP_PD_MSK,
+                               (st->input_mode == ADMV1014_IF_MODE) ? 1 : 0) |
                     FIELD_PREP(ADMV1014_DET_EN_MSK, st->det_en);
 
        return __admv1014_spi_update_bits(st, ADMV1014_REG_ENABLE, enable_reg_msk, enable_reg);
index 4f19dc7..5908a96 100644 (file)
@@ -875,6 +875,7 @@ static int mpu3050_power_up(struct mpu3050 *mpu3050)
        ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM,
                                 MPU3050_PWR_MGM_SLEEP, 0);
        if (ret) {
+               regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs);
                dev_err(mpu3050->dev, "error setting power mode\n");
                return ret;
        }
index f29692b..66b3241 100644 (file)
@@ -135,9 +135,12 @@ int hts221_allocate_trigger(struct iio_dev *iio_dev)
 
        iio_trigger_set_drvdata(hw->trig, iio_dev);
        hw->trig->ops = &hts221_trigger_ops;
+
+       err = devm_iio_trigger_register(hw->dev, hw->trig);
+
        iio_dev->trig = iio_trigger_get(hw->trig);
 
-       return devm_iio_trigger_register(hw->dev, hw->trig);
+       return err;
 }
 
 static int hts221_buffer_preenable(struct iio_dev *iio_dev)
index c0f5059..995a9dc 100644 (file)
@@ -17,6 +17,7 @@
 #include "inv_icm42600_buffer.h"
 
 enum inv_icm42600_chip {
+       INV_CHIP_INVALID,
        INV_CHIP_ICM42600,
        INV_CHIP_ICM42602,
        INV_CHIP_ICM42605,
index 86858da..ca85fcc 100644 (file)
@@ -565,7 +565,7 @@ int inv_icm42600_core_probe(struct regmap *regmap, int chip, int irq,
        bool open_drain;
        int ret;
 
-       if (chip < 0 || chip >= INV_CHIP_NB) {
+       if (chip <= INV_CHIP_INVALID || chip >= INV_CHIP_NB) {
                dev_err(dev, "invalid chip = %d\n", chip);
                return -ENODEV;
        }
index 9ff7b0e..b2bc637 100644 (file)
@@ -639,7 +639,7 @@ static int yas532_get_calibration_data(struct yas5xx *yas5xx)
        dev_dbg(yas5xx->dev, "calibration data: %*ph\n", 14, data);
 
        /* Sanity check, is this all zeroes? */
-       if (memchr_inv(data, 0x00, 13)) {
+       if (memchr_inv(data, 0x00, 13) == NULL) {
                if (!(data[13] & BIT(7)))
                        dev_warn(yas5xx->dev, "calibration is blank!\n");
        }
index 70c37f6..63fbcaa 100644 (file)
@@ -885,6 +885,9 @@ sx9324_get_default_reg(struct device *dev, int idx,
                        break;
                ret = device_property_read_u32_array(dev, prop, pin_defs,
                                                     ARRAY_SIZE(pin_defs));
+               if (ret)
+                       break;
+
                for (pin = 0; pin < SX9324_NUM_PINS; pin++)
                        raw |= (pin_defs[pin] << (2 * pin)) &
                               SX9324_REG_AFE_PH0_PIN_MASK(pin);
index 56ca0ad..4c66c3f 100644 (file)
@@ -6,7 +6,7 @@
 # Keep in alphabetical order
 config IIO_RESCALE_KUNIT_TEST
        bool "Test IIO rescale conversion functions"
-       depends on KUNIT=y && !IIO_RESCALE
+       depends on KUNIT=y && IIO_RESCALE=y
        default KUNIT_ALL_TESTS
        help
          If you want to run tests on the iio-rescale code say Y here.
index f15ae0a..880360f 100644 (file)
@@ -4,6 +4,6 @@
 #
 
 # Keep in alphabetical order
-obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o ../afe/iio-rescale.o
+obj-$(CONFIG_IIO_RESCALE_KUNIT_TEST) += iio-test-rescale.o
 obj-$(CONFIG_IIO_TEST_FORMAT) += iio-test-format.o
 CFLAGS_iio-test-format.o += $(DISABLE_STRUCTLEAK_PLUGIN)
index f1a8704..d6c5e96 100644 (file)
@@ -190,6 +190,7 @@ static int iio_sysfs_trigger_remove(int id)
        }
 
        iio_trigger_unregister(t->trig);
+       irq_work_sync(&t->work);
        iio_trigger_free(t->trig);
 
        list_del(&t->l);
index 505a032..9dcf3f5 100644 (file)
@@ -402,6 +402,7 @@ config JOYSTICK_N64
 config JOYSTICK_SENSEHAT
        tristate "Raspberry Pi Sense HAT joystick"
        depends on INPUT && I2C
+       depends on HAS_IOMEM
        select MFD_SIMPLE_MFD_I2C
        help
          Say Y here if you want to enable the driver for the
index cbb1599..4804761 100644 (file)
@@ -85,13 +85,13 @@ static const struct dmi_system_id dmi_use_low_level_irq[] = {
        },
        {
                /*
-                * Lenovo Yoga Tab2 1051L, something messes with the home-button
+                * Lenovo Yoga Tab2 1051F/1051L, something messes with the home-button
                 * IRQ settings, leading to a non working home-button.
                 */
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
                        DMI_MATCH(DMI_PRODUCT_NAME, "60073"),
-                       DMI_MATCH(DMI_PRODUCT_VERSION, "1051L"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "1051"),
                },
        },
        {} /* Terminating entry */
index 59a1450..ca15061 100644 (file)
@@ -942,17 +942,22 @@ static int bcm5974_probe(struct usb_interface *iface,
        if (!dev->tp_data)
                goto err_free_bt_buffer;
 
-       if (dev->bt_urb)
+       if (dev->bt_urb) {
                usb_fill_int_urb(dev->bt_urb, udev,
                                 usb_rcvintpipe(udev, cfg->bt_ep),
                                 dev->bt_data, dev->cfg.bt_datalen,
                                 bcm5974_irq_button, dev, 1);
 
+               dev->bt_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+       }
+
        usb_fill_int_urb(dev->tp_urb, udev,
                         usb_rcvintpipe(udev, cfg->tp_ep),
                         dev->tp_data, dev->cfg.tp_datalen,
                         bcm5974_irq_trackpad, dev, 1);
 
+       dev->tp_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
        /* create bcm5974 device */
        usb_make_path(udev, dev->phys, sizeof(dev->phys));
        strlcat(dev->phys, "/input0", sizeof(dev->phys));
index 8fdb84b..1d42084 100644 (file)
@@ -987,7 +987,7 @@ static const struct of_device_id ipmmu_of_ids[] = {
                .compatible = "renesas,ipmmu-r8a779a0",
                .data = &ipmmu_features_rcar_gen4,
        }, {
-               .compatible = "renesas,rcar-gen4-ipmmu",
+               .compatible = "renesas,rcar-gen4-ipmmu-vmsa",
                .data = &ipmmu_features_rcar_gen4,
        }, {
                /* Terminator */
index 4ab1038..1f23a6b 100644 (file)
@@ -298,7 +298,7 @@ config XTENSA_MX
 
 config XILINX_INTC
        bool "Xilinx Interrupt Controller IP"
-       depends on MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP
+       depends on OF
        select IRQ_DOMAIN
        help
          Support for the Xilinx Interrupt Controller IP core.
index 12dd487..5ac8318 100644 (file)
@@ -1035,6 +1035,7 @@ static void build_fiq_affinity(struct aic_irq_chip *ic, struct device_node *aff)
                        continue;
 
                cpu = of_cpu_node_to_id(cpu_node);
+               of_node_put(cpu_node);
                if (WARN_ON(cpu < 0))
                        continue;
 
@@ -1143,6 +1144,7 @@ static int __init aic_of_ic_init(struct device_node *node, struct device_node *p
                for_each_child_of_node(affs, chld)
                        build_fiq_affinity(irqc, chld);
        }
+       of_node_put(affs);
 
        set_handle_irq(aic_handle_irq);
        set_handle_fiq(aic_handle_fiq);
index b4c1924..38fab02 100644 (file)
@@ -57,6 +57,7 @@ realview_gic_of_init(struct device_node *node, struct device_node *parent)
 
        /* The PB11MPCore GIC needs to be configured in the syscon */
        map = syscon_node_to_regmap(np);
+       of_node_put(np);
        if (!IS_ERR(map)) {
                /* new irq mode with no DCC */
                regmap_write(map, REALVIEW_SYS_LOCK_OFFSET,
index 2be8dea..5c1cf90 100644 (file)
@@ -1932,7 +1932,7 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
 
        gic_data.ppi_descs = kcalloc(gic_data.ppi_nr, sizeof(*gic_data.ppi_descs), GFP_KERNEL);
        if (!gic_data.ppi_descs)
-               return;
+               goto out_put_node;
 
        nr_parts = of_get_child_count(parts_node);
 
@@ -1973,12 +1973,15 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node)
                                continue;
 
                        cpu = of_cpu_node_to_id(cpu_node);
-                       if (WARN_ON(cpu < 0))
+                       if (WARN_ON(cpu < 0)) {
+                               of_node_put(cpu_node);
                                continue;
+                       }
 
                        pr_cont("%pOF[%d] ", cpu_node, cpu);
 
                        cpumask_set_cpu(cpu, &part->mask);
+                       of_node_put(cpu_node);
                }
 
                pr_cont("}\n");
index aed8885..8d05d8b 100644 (file)
 
 #define LIOINTC_ERRATA_IRQ     10
 
+#if defined(CONFIG_MIPS)
+#define liointc_core_id get_ebase_cpunum()
+#else
+#define liointc_core_id get_csr_cpuid()
+#endif
+
 struct liointc_handler_data {
        struct liointc_priv     *priv;
        u32                     parent_int_map;
@@ -57,7 +63,7 @@ static void liointc_chained_handle_irq(struct irq_desc *desc)
        struct liointc_handler_data *handler = irq_desc_get_handler_data(desc);
        struct irq_chip *chip = irq_desc_get_chip(desc);
        struct irq_chip_generic *gc = handler->priv->gc;
-       int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES;
+       int core = liointc_core_id % LIOINTC_NUM_CORES;
        u32 pending;
 
        chained_irq_enter(chip, desc);
index 50a5682..56bf502 100644 (file)
@@ -134,9 +134,9 @@ static int __init map_interrupts(struct device_node *node, struct irq_domain *do
                if (!cpu_ictl)
                        return -EINVAL;
                ret = of_property_read_u32(cpu_ictl, "#interrupt-cells", &tmp);
+               of_node_put(cpu_ictl);
                if (ret || tmp != 1)
                        return -EINVAL;
-               of_node_put(cpu_ictl);
 
                cpu_int = be32_to_cpup(imap + 2);
                if (cpu_int > 7 || cpu_int < 2)
index 89121b3..716b1bb 100644 (file)
@@ -237,6 +237,7 @@ static const struct of_device_id uniphier_aidet_match[] = {
        { .compatible = "socionext,uniphier-ld11-aidet" },
        { .compatible = "socionext,uniphier-ld20-aidet" },
        { .compatible = "socionext,uniphier-pxs3-aidet" },
+       { .compatible = "socionext,uniphier-nx1-aidet" },
        { /* sentinel */ }
 };
 
index d21648a..c954ff9 100644 (file)
@@ -33,6 +33,14 @@ struct dm_kobject_holder {
  * access their members!
  */
 
+/*
+ * For mempools pre-allocation at the table loading time.
+ */
+struct dm_md_mempools {
+       struct bio_set bs;
+       struct bio_set io_bs;
+};
+
 struct mapped_device {
        struct mutex suspend_lock;
 
@@ -110,8 +118,7 @@ struct mapped_device {
        /*
         * io objects are allocated from here.
         */
-       struct bio_set io_bs;
-       struct bio_set bs;
+       struct dm_md_mempools *mempools;
 
        /* kobject and completion */
        struct dm_kobject_holder kobj_holder;
@@ -265,6 +272,7 @@ struct dm_io {
        atomic_t io_count;
        struct mapped_device *md;
 
+       struct bio *split_bio;
        /* The three fields represent mapped part of original bio */
        struct bio *orig_bio;
        unsigned int sector_offset; /* offset to end of orig_bio */
index 1f6bf15..e92c1af 100644 (file)
@@ -1400,7 +1400,7 @@ static void start_worker(struct era *era)
 static void stop_worker(struct era *era)
 {
        atomic_set(&era->suspended, 1);
-       flush_workqueue(era->wq);
+       drain_workqueue(era->wq);
 }
 
 /*----------------------------------------------------------------
@@ -1570,6 +1570,12 @@ static void era_postsuspend(struct dm_target *ti)
        }
 
        stop_worker(era);
+
+       r = metadata_commit(era->md);
+       if (r) {
+               DMERR("%s: metadata_commit failed", __func__);
+               /* FIXME: fail mode */
+       }
 }
 
 static int era_preresume(struct dm_target *ti)
index 06f3289..0c6620e 100644 (file)
@@ -415,8 +415,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
        /*
         * Work out how many "unsigned long"s we need to hold the bitset.
         */
-       bitset_size = dm_round_up(region_count,
-                                 sizeof(*lc->clean_bits) << BYTE_SHIFT);
+       bitset_size = dm_round_up(region_count, BITS_PER_LONG);
        bitset_size >>= BYTE_SHIFT;
 
        lc->bitset_uint32_count = bitset_size / sizeof(*lc->clean_bits);
@@ -616,7 +615,7 @@ static int disk_resume(struct dm_dirty_log *log)
                        log_clear_bit(lc, lc->clean_bits, i);
 
        /* clear any old bits -- device has shrunk */
-       for (i = lc->region_count; i % (sizeof(*lc->clean_bits) << BYTE_SHIFT); i++)
+       for (i = lc->region_count; i % BITS_PER_LONG; i++)
                log_clear_bit(lc, lc->clean_bits, i);
 
        /* copy clean across to sync */
index 5e41fba..9526ccb 100644 (file)
@@ -3725,7 +3725,7 @@ static int raid_message(struct dm_target *ti, unsigned int argc, char **argv,
        if (!strcasecmp(argv[0], "idle") || !strcasecmp(argv[0], "frozen")) {
                if (mddev->sync_thread) {
                        set_bit(MD_RECOVERY_INTR, &mddev->recovery);
-                       md_reap_sync_thread(mddev, false);
+                       md_reap_sync_thread(mddev);
                }
        } else if (decipher_sync_action(mddev, mddev->recovery) != st_idle)
                return -EBUSY;
index 6087cdc..a83b98a 100644 (file)
@@ -319,7 +319,7 @@ static int setup_clone(struct request *clone, struct request *rq,
 {
        int r;
 
-       r = blk_rq_prep_clone(clone, rq, &tio->md->bs, gfp_mask,
+       r = blk_rq_prep_clone(clone, rq, &tio->md->mempools->bs, gfp_mask,
                              dm_rq_bio_constructor, tio);
        if (r)
                return r;
index 0e833a1..bd539af 100644 (file)
@@ -1038,17 +1038,6 @@ static int dm_table_alloc_md_mempools(struct dm_table *t, struct mapped_device *
        return 0;
 }
 
-void dm_table_free_md_mempools(struct dm_table *t)
-{
-       dm_free_md_mempools(t->mempools);
-       t->mempools = NULL;
-}
-
-struct dm_md_mempools *dm_table_get_md_mempools(struct dm_table *t)
-{
-       return t->mempools;
-}
-
 static int setup_indexes(struct dm_table *t)
 {
        int i;
index dfb0a55..2b75f1e 100644 (file)
@@ -136,14 +136,6 @@ static int get_swap_bios(void)
        return latch;
 }
 
-/*
- * For mempools pre-allocation at the table loading time.
- */
-struct dm_md_mempools {
-       struct bio_set bs;
-       struct bio_set io_bs;
-};
-
 struct table_device {
        struct list_head list;
        refcount_t count;
@@ -563,6 +555,10 @@ static void dm_start_io_acct(struct dm_io *io, struct bio *clone)
                unsigned long flags;
                /* Can afford locking given DM_TIO_IS_DUPLICATE_BIO */
                spin_lock_irqsave(&io->lock, flags);
+               if (dm_io_flagged(io, DM_IO_ACCOUNTED)) {
+                       spin_unlock_irqrestore(&io->lock, flags);
+                       return;
+               }
                dm_io_set_flag(io, DM_IO_ACCOUNTED);
                spin_unlock_irqrestore(&io->lock, flags);
        }
@@ -581,7 +577,7 @@ static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio)
        struct dm_target_io *tio;
        struct bio *clone;
 
-       clone = bio_alloc_clone(NULL, bio, GFP_NOIO, &md->io_bs);
+       clone = bio_alloc_clone(NULL, bio, GFP_NOIO, &md->mempools->io_bs);
        /* Set default bdev, but target must bio_set_dev() before issuing IO */
        clone->bi_bdev = md->disk->part0;
 
@@ -598,6 +594,7 @@ static struct dm_io *alloc_io(struct mapped_device *md, struct bio *bio)
        atomic_set(&io->io_count, 2);
        this_cpu_inc(*md->pending_io);
        io->orig_bio = bio;
+       io->split_bio = NULL;
        io->md = md;
        spin_lock_init(&io->lock);
        io->start_time = jiffies;
@@ -628,7 +625,8 @@ static struct bio *alloc_tio(struct clone_info *ci, struct dm_target *ti,
        } else {
                struct mapped_device *md = ci->io->md;
 
-               clone = bio_alloc_clone(NULL, ci->bio, gfp_mask, &md->bs);
+               clone = bio_alloc_clone(NULL, ci->bio, gfp_mask,
+                                       &md->mempools->bs);
                if (!clone)
                        return NULL;
                /* Set default bdev, but target must bio_set_dev() before issuing IO */
@@ -718,18 +716,18 @@ static void dm_put_live_table_fast(struct mapped_device *md) __releases(RCU)
 }
 
 static inline struct dm_table *dm_get_live_table_bio(struct mapped_device *md,
-                                                    int *srcu_idx, struct bio *bio)
+                                                    int *srcu_idx, unsigned bio_opf)
 {
-       if (bio->bi_opf & REQ_NOWAIT)
+       if (bio_opf & REQ_NOWAIT)
                return dm_get_live_table_fast(md);
        else
                return dm_get_live_table(md, srcu_idx);
 }
 
 static inline void dm_put_live_table_bio(struct mapped_device *md, int srcu_idx,
-                                        struct bio *bio)
+                                        unsigned bio_opf)
 {
-       if (bio->bi_opf & REQ_NOWAIT)
+       if (bio_opf & REQ_NOWAIT)
                dm_put_live_table_fast(md);
        else
                dm_put_live_table(md, srcu_idx);
@@ -890,7 +888,7 @@ static void dm_io_complete(struct dm_io *io)
 {
        blk_status_t io_error;
        struct mapped_device *md = io->md;
-       struct bio *bio = io->orig_bio;
+       struct bio *bio = io->split_bio ? io->split_bio : io->orig_bio;
 
        if (io->status == BLK_STS_DM_REQUEUE) {
                unsigned long flags;
@@ -942,9 +940,11 @@ static void dm_io_complete(struct dm_io *io)
                        if (io_error == BLK_STS_AGAIN) {
                                /* io_uring doesn't handle BLK_STS_AGAIN (yet) */
                                queue_io(md, bio);
+                               return;
                        }
                }
-               return;
+               if (io_error == BLK_STS_DM_REQUEUE)
+                       return;
        }
 
        if (bio_is_flush_with_data(bio)) {
@@ -1023,23 +1023,19 @@ static void clone_endio(struct bio *bio)
        struct dm_io *io = tio->io;
        struct mapped_device *md = io->md;
 
-       if (likely(bio->bi_bdev != md->disk->part0)) {
-               struct request_queue *q = bdev_get_queue(bio->bi_bdev);
-
-               if (unlikely(error == BLK_STS_TARGET)) {
-                       if (bio_op(bio) == REQ_OP_DISCARD &&
-                           !bdev_max_discard_sectors(bio->bi_bdev))
-                               disable_discard(md);
-                       else if (bio_op(bio) == REQ_OP_WRITE_ZEROES &&
-                                !q->limits.max_write_zeroes_sectors)
-                               disable_write_zeroes(md);
-               }
-
-               if (static_branch_unlikely(&zoned_enabled) &&
-                   unlikely(blk_queue_is_zoned(q)))
-                       dm_zone_endio(io, bio);
+       if (unlikely(error == BLK_STS_TARGET)) {
+               if (bio_op(bio) == REQ_OP_DISCARD &&
+                   !bdev_max_discard_sectors(bio->bi_bdev))
+                       disable_discard(md);
+               else if (bio_op(bio) == REQ_OP_WRITE_ZEROES &&
+                        !bdev_write_zeroes_sectors(bio->bi_bdev))
+                       disable_write_zeroes(md);
        }
 
+       if (static_branch_unlikely(&zoned_enabled) &&
+           unlikely(blk_queue_is_zoned(bdev_get_queue(bio->bi_bdev))))
+               dm_zone_endio(io, bio);
+
        if (endio) {
                int r = endio(ti, bio, &error);
                switch (r) {
@@ -1620,7 +1616,12 @@ static blk_status_t __split_and_process_bio(struct clone_info *ci)
        ti = dm_table_find_target(ci->map, ci->sector);
        if (unlikely(!ti))
                return BLK_STS_IOERR;
-       else if (unlikely(ci->is_abnormal_io))
+
+       if (unlikely((ci->bio->bi_opf & REQ_NOWAIT) != 0) &&
+           unlikely(!dm_target_supports_nowait(ti->type)))
+               return BLK_STS_NOTSUPP;
+
+       if (unlikely(ci->is_abnormal_io))
                return __process_abnormal_io(ci, ti);
 
        /*
@@ -1693,9 +1694,11 @@ static void dm_split_and_process_bio(struct mapped_device *md,
         * Remainder must be passed to submit_bio_noacct() so it gets handled
         * *after* bios already submitted have been completely processed.
         */
-       bio_trim(bio, io->sectors, ci.sector_count);
-       trace_block_split(bio, bio->bi_iter.bi_sector);
-       bio_inc_remaining(bio);
+       WARN_ON_ONCE(!dm_io_flagged(io, DM_IO_WAS_SPLIT));
+       io->split_bio = bio_split(bio, io->sectors, GFP_NOIO,
+                                 &md->queue->bio_split);
+       bio_chain(io->split_bio, bio);
+       trace_block_split(io->split_bio, bio->bi_iter.bi_sector);
        submit_bio_noacct(bio);
 out:
        /*
@@ -1722,8 +1725,9 @@ static void dm_submit_bio(struct bio *bio)
        struct mapped_device *md = bio->bi_bdev->bd_disk->private_data;
        int srcu_idx;
        struct dm_table *map;
+       unsigned bio_opf = bio->bi_opf;
 
-       map = dm_get_live_table_bio(md, &srcu_idx, bio);
+       map = dm_get_live_table_bio(md, &srcu_idx, bio_opf);
 
        /* If suspended, or map not yet available, queue this IO for later */
        if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) ||
@@ -1739,7 +1743,7 @@ static void dm_submit_bio(struct bio *bio)
 
        dm_split_and_process_bio(md, map, bio);
 out:
-       dm_put_live_table_bio(md, srcu_idx, bio);
+       dm_put_live_table_bio(md, srcu_idx, bio_opf);
 }
 
 static bool dm_poll_dm_io(struct dm_io *io, struct io_comp_batch *iob,
@@ -1876,8 +1880,7 @@ static void cleanup_mapped_device(struct mapped_device *md)
 {
        if (md->wq)
                destroy_workqueue(md->wq);
-       bioset_exit(&md->bs);
-       bioset_exit(&md->io_bs);
+       dm_free_md_mempools(md->mempools);
 
        if (md->dax_dev) {
                dax_remove_host(md->disk);
@@ -2049,48 +2052,6 @@ static void free_dev(struct mapped_device *md)
        kvfree(md);
 }
 
-static int __bind_mempools(struct mapped_device *md, struct dm_table *t)
-{
-       struct dm_md_mempools *p = dm_table_get_md_mempools(t);
-       int ret = 0;
-
-       if (dm_table_bio_based(t)) {
-               /*
-                * The md may already have mempools that need changing.
-                * If so, reload bioset because front_pad may have changed
-                * because a different table was loaded.
-                */
-               bioset_exit(&md->bs);
-               bioset_exit(&md->io_bs);
-
-       } else if (bioset_initialized(&md->bs)) {
-               /*
-                * There's no need to reload with request-based dm
-                * because the size of front_pad doesn't change.
-                * Note for future: If you are to reload bioset,
-                * prep-ed requests in the queue may refer
-                * to bio from the old bioset, so you must walk
-                * through the queue to unprep.
-                */
-               goto out;
-       }
-
-       BUG_ON(!p ||
-              bioset_initialized(&md->bs) ||
-              bioset_initialized(&md->io_bs));
-
-       ret = bioset_init_from_src(&md->bs, &p->bs);
-       if (ret)
-               goto out;
-       ret = bioset_init_from_src(&md->io_bs, &p->io_bs);
-       if (ret)
-               bioset_exit(&md->bs);
-out:
-       /* mempool bind completed, no longer need any mempools in the table */
-       dm_table_free_md_mempools(t);
-       return ret;
-}
-
 /*
  * Bind a table to the device.
  */
@@ -2144,12 +2105,28 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t,
                 * immutable singletons - used to optimize dm_mq_queue_rq.
                 */
                md->immutable_target = dm_table_get_immutable_target(t);
-       }
 
-       ret = __bind_mempools(md, t);
-       if (ret) {
-               old_map = ERR_PTR(ret);
-               goto out;
+               /*
+                * There is no need to reload with request-based dm because the
+                * size of front_pad doesn't change.
+                *
+                * Note for future: If you are to reload bioset, prep-ed
+                * requests in the queue may refer to bio from the old bioset,
+                * so you must walk through the queue to unprep.
+                */
+               if (!md->mempools) {
+                       md->mempools = t->mempools;
+                       t->mempools = NULL;
+               }
+       } else {
+               /*
+                * The md may already have mempools that need changing.
+                * If so, reload bioset because front_pad may have changed
+                * because a different table was loaded.
+                */
+               dm_free_md_mempools(md->mempools);
+               md->mempools = t->mempools;
+               t->mempools = NULL;
        }
 
        ret = dm_table_set_restrictions(t, md->queue, limits);
index 3f89664..a8405ce 100644 (file)
@@ -71,8 +71,6 @@ struct dm_target *dm_table_get_immutable_target(struct dm_table *t);
 struct dm_target *dm_table_get_wildcard_target(struct dm_table *t);
 bool dm_table_bio_based(struct dm_table *t);
 bool dm_table_request_based(struct dm_table *t);
-void dm_table_free_md_mempools(struct dm_table *t);
-struct dm_md_mempools *dm_table_get_md_mempools(struct dm_table *t);
 
 void dm_lock_md_type(struct mapped_device *md);
 void dm_unlock_md_type(struct mapped_device *md);
index 8273ac5..c7ecb0b 100644 (file)
@@ -4831,7 +4831,7 @@ action_store(struct mddev *mddev, const char *page, size_t len)
                                flush_workqueue(md_misc_wq);
                        if (mddev->sync_thread) {
                                set_bit(MD_RECOVERY_INTR, &mddev->recovery);
-                               md_reap_sync_thread(mddev, true);
+                               md_reap_sync_thread(mddev);
                        }
                        mddev_unlock(mddev);
                }
@@ -6197,7 +6197,7 @@ static void __md_stop_writes(struct mddev *mddev)
                flush_workqueue(md_misc_wq);
        if (mddev->sync_thread) {
                set_bit(MD_RECOVERY_INTR, &mddev->recovery);
-               md_reap_sync_thread(mddev, true);
+               md_reap_sync_thread(mddev);
        }
 
        del_timer_sync(&mddev->safemode_timer);
@@ -9303,7 +9303,7 @@ void md_check_recovery(struct mddev *mddev)
                         * ->spare_active and clear saved_raid_disk
                         */
                        set_bit(MD_RECOVERY_INTR, &mddev->recovery);
-                       md_reap_sync_thread(mddev, true);
+                       md_reap_sync_thread(mddev);
                        clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
                        clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
                        clear_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags);
@@ -9338,7 +9338,7 @@ void md_check_recovery(struct mddev *mddev)
                        goto unlock;
                }
                if (mddev->sync_thread) {
-                       md_reap_sync_thread(mddev, true);
+                       md_reap_sync_thread(mddev);
                        goto unlock;
                }
                /* Set RUNNING before clearing NEEDED to avoid
@@ -9411,18 +9411,14 @@ void md_check_recovery(struct mddev *mddev)
 }
 EXPORT_SYMBOL(md_check_recovery);
 
-void md_reap_sync_thread(struct mddev *mddev, bool reconfig_mutex_held)
+void md_reap_sync_thread(struct mddev *mddev)
 {
        struct md_rdev *rdev;
        sector_t old_dev_sectors = mddev->dev_sectors;
        bool is_reshaped = false;
 
-       if (reconfig_mutex_held)
-               mddev_unlock(mddev);
        /* resync has finished, collect result */
        md_unregister_thread(&mddev->sync_thread);
-       if (reconfig_mutex_held)
-               mddev_lock_nointr(mddev);
        if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) &&
            !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
            mddev->degraded != mddev->raid_disks) {
index 5f62c46..cf2cbb1 100644 (file)
@@ -719,7 +719,7 @@ extern struct md_thread *md_register_thread(
 extern void md_unregister_thread(struct md_thread **threadp);
 extern void md_wakeup_thread(struct md_thread *thread);
 extern void md_check_recovery(struct mddev *mddev);
-extern void md_reap_sync_thread(struct mddev *mddev, bool reconfig_mutex_held);
+extern void md_reap_sync_thread(struct mddev *mddev);
 extern int mddev_init_writes_pending(struct mddev *mddev);
 extern bool md_write_start(struct mddev *mddev, struct bio *bi);
 extern void md_write_inc(struct mddev *mddev, struct bio *bi);
index 973e2e0..0a2e480 100644 (file)
@@ -629,9 +629,9 @@ static void ppl_do_flush(struct ppl_io_unit *io)
                if (bdev) {
                        struct bio *bio;
 
-                       bio = bio_alloc_bioset(bdev, 0, GFP_NOIO,
+                       bio = bio_alloc_bioset(bdev, 0,
                                               REQ_OP_WRITE | REQ_PREFLUSH,
-                                              &ppl_conf->flush_bs);
+                                              GFP_NOIO, &ppl_conf->flush_bs);
                        bio->bi_private = io;
                        bio->bi_end_io = ppl_flush_endio;
 
index b7800b3..ac1a411 100644 (file)
@@ -105,6 +105,7 @@ config TI_EMIF
 config OMAP_GPMC
        tristate "Texas Instruments OMAP SoC GPMC driver"
        depends on OF_ADDRESS
+       depends on ARCH_OMAP2PLUS || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
        select GPIOLIB
        help
          This driver is for the General Purpose Memory Controller (GPMC)
index 86a3d34..4c5154e 100644 (file)
@@ -404,13 +404,16 @@ static int mtk_smi_device_link_common(struct device *dev, struct device **com_de
        of_node_put(smi_com_node);
        if (smi_com_pdev) {
                /* smi common is the supplier, Make sure it is ready before */
-               if (!platform_get_drvdata(smi_com_pdev))
+               if (!platform_get_drvdata(smi_com_pdev)) {
+                       put_device(&smi_com_pdev->dev);
                        return -EPROBE_DEFER;
+               }
                smi_com_dev = &smi_com_pdev->dev;
                link = device_link_add(dev, smi_com_dev,
                                       DL_FLAG_PM_RUNTIME | DL_FLAG_STATELESS);
                if (!link) {
                        dev_err(dev, "Unable to link smi-common dev\n");
+                       put_device(&smi_com_pdev->dev);
                        return -ENODEV;
                }
                *com_dev = smi_com_dev;
index 4733e78..c491cd5 100644 (file)
@@ -1187,33 +1187,39 @@ static int of_get_dram_timings(struct exynos5_dmc *dmc)
 
        dmc->timing_row = devm_kmalloc_array(dmc->dev, TIMING_COUNT,
                                             sizeof(u32), GFP_KERNEL);
-       if (!dmc->timing_row)
-               return -ENOMEM;
+       if (!dmc->timing_row) {
+               ret = -ENOMEM;
+               goto put_node;
+       }
 
        dmc->timing_data = devm_kmalloc_array(dmc->dev, TIMING_COUNT,
                                              sizeof(u32), GFP_KERNEL);
-       if (!dmc->timing_data)
-               return -ENOMEM;
+       if (!dmc->timing_data) {
+               ret = -ENOMEM;
+               goto put_node;
+       }
 
        dmc->timing_power = devm_kmalloc_array(dmc->dev, TIMING_COUNT,
                                               sizeof(u32), GFP_KERNEL);
-       if (!dmc->timing_power)
-               return -ENOMEM;
+       if (!dmc->timing_power) {
+               ret = -ENOMEM;
+               goto put_node;
+       }
 
        dmc->timings = of_lpddr3_get_ddr_timings(np_ddr, dmc->dev,
                                                 DDR_TYPE_LPDDR3,
                                                 &dmc->timings_arr_size);
        if (!dmc->timings) {
-               of_node_put(np_ddr);
                dev_warn(dmc->dev, "could not get timings from DT\n");
-               return -EINVAL;
+               ret = -EINVAL;
+               goto put_node;
        }
 
        dmc->min_tck = of_lpddr3_get_min_tck(np_ddr, dmc->dev);
        if (!dmc->min_tck) {
-               of_node_put(np_ddr);
                dev_warn(dmc->dev, "could not get tck from DT\n");
-               return -EINVAL;
+               ret = -EINVAL;
+               goto put_node;
        }
 
        /* Sorted array of OPPs with frequency ascending */
@@ -1227,13 +1233,14 @@ static int of_get_dram_timings(struct exynos5_dmc *dmc)
                                             clk_period_ps);
        }
 
-       of_node_put(np_ddr);
 
        /* Take the highest frequency's timings as 'bypass' */
        dmc->bypass_timing_row = dmc->timing_row[idx - 1];
        dmc->bypass_timing_data = dmc->timing_data[idx - 1];
        dmc->bypass_timing_power = dmc->timing_power[idx - 1];
 
+put_node:
+       of_node_put(np_ddr);
        return ret;
 }
 
index d6cd553..69f9b03 100644 (file)
@@ -232,9 +232,9 @@ static int ssc_probe(struct platform_device *pdev)
        clk_disable_unprepare(ssc->clk);
 
        ssc->irq = platform_get_irq(pdev, 0);
-       if (!ssc->irq) {
+       if (ssc->irq < 0) {
                dev_dbg(&pdev->dev, "could not get irq\n");
-               return -ENXIO;
+               return ssc->irq;
        }
 
        mutex_lock(&user_lock);
index 749cc5a..b1e7603 100644 (file)
@@ -407,6 +407,8 @@ static void rts5261_init_from_hw(struct rtsx_pcr *pcr)
                // default
                setting_reg1 = PCR_SETTING_REG1;
                setting_reg2 = PCR_SETTING_REG2;
+       } else {
+               return;
        }
 
        pci_read_config_dword(pdev, setting_reg2, &lval2);
index 8d169a3..c9c56fd 100644 (file)
@@ -79,6 +79,11 @@ static int at25_ee_read(void *priv, unsigned int offset,
 {
        struct at25_data *at25 = priv;
        char *buf = val;
+       size_t max_chunk = spi_max_transfer_size(at25->spi);
+       size_t num_msgs = DIV_ROUND_UP(count, max_chunk);
+       size_t nr_bytes = 0;
+       unsigned int msg_offset;
+       size_t msg_count;
        u8                      *cp;
        ssize_t                 status;
        struct spi_transfer     t[2];
@@ -92,54 +97,59 @@ static int at25_ee_read(void *priv, unsigned int offset,
        if (unlikely(!count))
                return -EINVAL;
 
-       cp = at25->command;
+       msg_offset = (unsigned int)offset;
+       msg_count = min(count, max_chunk);
+       while (num_msgs) {
+               cp = at25->command;
 
-       instr = AT25_READ;
-       if (at25->chip.flags & EE_INSTR_BIT3_IS_ADDR)
-               if (offset >= BIT(at25->addrlen * 8))
-                       instr |= AT25_INSTR_BIT3;
+               instr = AT25_READ;
+               if (at25->chip.flags & EE_INSTR_BIT3_IS_ADDR)
+                       if (msg_offset >= BIT(at25->addrlen * 8))
+                               instr |= AT25_INSTR_BIT3;
 
-       mutex_lock(&at25->lock);
+               mutex_lock(&at25->lock);
 
-       *cp++ = instr;
-
-       /* 8/16/24-bit address is written MSB first */
-       switch (at25->addrlen) {
-       default:        /* case 3 */
-               *cp++ = offset >> 16;
-               fallthrough;
-       case 2:
-               *cp++ = offset >> 8;
-               fallthrough;
-       case 1:
-       case 0: /* can't happen: for better code generation */
-               *cp++ = offset >> 0;
-       }
+               *cp++ = instr;
 
-       spi_message_init(&m);
-       memset(t, 0, sizeof(t));
+               /* 8/16/24-bit address is written MSB first */
+               switch (at25->addrlen) {
+               default:        /* case 3 */
+                       *cp++ = msg_offset >> 16;
+                       fallthrough;
+               case 2:
+                       *cp++ = msg_offset >> 8;
+                       fallthrough;
+               case 1:
+               case 0: /* can't happen: for better code generation */
+                       *cp++ = msg_offset >> 0;
+               }
 
-       t[0].tx_buf = at25->command;
-       t[0].len = at25->addrlen + 1;
-       spi_message_add_tail(&t[0], &m);
+               spi_message_init(&m);
+               memset(t, 0, sizeof(t));
 
-       t[1].rx_buf = buf;
-       t[1].len = count;
-       spi_message_add_tail(&t[1], &m);
+               t[0].tx_buf = at25->command;
+               t[0].len = at25->addrlen + 1;
+               spi_message_add_tail(&t[0], &m);
 
-       /*
-        * Read it all at once.
-        *
-        * REVISIT that's potentially a problem with large chips, if
-        * other devices on the bus need to be accessed regularly or
-        * this chip is clocked very slowly.
-        */
-       status = spi_sync(at25->spi, &m);
-       dev_dbg(&at25->spi->dev, "read %zu bytes at %d --> %zd\n",
-               count, offset, status);
+               t[1].rx_buf = buf + nr_bytes;
+               t[1].len = msg_count;
+               spi_message_add_tail(&t[1], &m);
 
-       mutex_unlock(&at25->lock);
-       return status;
+               status = spi_sync(at25->spi, &m);
+
+               mutex_unlock(&at25->lock);
+
+               if (status)
+                       return status;
+
+               --num_msgs;
+               msg_offset += msg_count;
+               nr_bytes += msg_count;
+       }
+
+       dev_dbg(&at25->spi->dev, "read %zu bytes at %d\n",
+               count, offset);
+       return 0;
 }
 
 /* Read extra registers as ID or serial number */
@@ -190,6 +200,7 @@ ATTRIBUTE_GROUPS(sernum);
 static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count)
 {
        struct at25_data *at25 = priv;
+       size_t maxsz = spi_max_transfer_size(at25->spi);
        const char *buf = val;
        int                     status = 0;
        unsigned                buf_size;
@@ -253,6 +264,8 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count)
                segment = buf_size - (offset % buf_size);
                if (segment > count)
                        segment = count;
+               if (segment > maxsz)
+                       segment = maxsz;
                memcpy(cp, buf, segment);
                status = spi_write(at25->spi, bounce,
                                segment + at25->addrlen + 1);
index cebcca6..cf2b826 100644 (file)
@@ -1351,7 +1351,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
 
                if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
                    dev->hbm_state != MEI_HBM_CAP_SETUP) {
-                       if (dev->dev_state == MEI_DEV_POWER_DOWN) {
+                       if (dev->dev_state == MEI_DEV_POWER_DOWN ||
+                           dev->dev_state == MEI_DEV_POWERING_DOWN) {
                                dev_dbg(dev->dev, "hbm: capabilities response: on shutdown, ignoring\n");
                                return 0;
                        }
index 64ce3f8..15e8e2b 100644 (file)
 #define MEI_DEV_ID_ADP_P      0x51E0  /* Alder Lake Point P */
 #define MEI_DEV_ID_ADP_N      0x54E0  /* Alder Lake Point N */
 
+#define MEI_DEV_ID_RPL_S      0x7A68  /* Raptor Lake Point S */
+
 /*
  * MEI HW Section
  */
index 9870bf7..befa491 100644 (file)
@@ -1154,6 +1154,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
                        ret = mei_me_d0i3_exit_sync(dev);
                        if (ret)
                                return ret;
+               } else {
+                       hw->pg_state = MEI_PG_OFF;
                }
        }
 
index 33e5882..5435604 100644 (file)
@@ -116,6 +116,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
        {MEI_PCI_DEVICE(MEI_DEV_ID_ADP_P, MEI_ME_PCH15_CFG)},
        {MEI_PCI_DEVICE(MEI_DEV_ID_ADP_N, MEI_ME_PCH15_CFG)},
 
+       {MEI_PCI_DEVICE(MEI_DEV_ID_RPL_S, MEI_ME_PCH15_CFG)},
+
        /* required last entry */
        {0, }
 };
index 1259ca2..f4a1281 100644 (file)
@@ -1499,8 +1499,7 @@ void mmc_blk_cqe_recovery(struct mmc_queue *mq)
        err = mmc_cqe_recovery(host);
        if (err)
                mmc_blk_reset(mq->blkdata, host, MMC_BLK_CQE_RECOVERY);
-       else
-               mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
+       mmc_blk_reset_success(mq->blkdata, MMC_BLK_CQE_RECOVERY);
 
        pr_debug("%s: CQE recovery done\n", mmc_hostname(host));
 }
index 195dc89..9da4489 100644 (file)
@@ -1356,7 +1356,7 @@ static void msdc_data_xfer_next(struct msdc_host *host, struct mmc_request *mrq)
                msdc_request_done(host, mrq);
 }
 
-static bool msdc_data_xfer_done(struct msdc_host *host, u32 events,
+static void msdc_data_xfer_done(struct msdc_host *host, u32 events,
                                struct mmc_request *mrq, struct mmc_data *data)
 {
        struct mmc_command *stop;
@@ -1376,7 +1376,7 @@ static bool msdc_data_xfer_done(struct msdc_host *host, u32 events,
        spin_unlock_irqrestore(&host->lock, flags);
 
        if (done)
-               return true;
+               return;
        stop = data->stop;
 
        if (check_data || (stop && stop->error)) {
@@ -1385,12 +1385,15 @@ static bool msdc_data_xfer_done(struct msdc_host *host, u32 events,
                sdr_set_field(host->base + MSDC_DMA_CTRL, MSDC_DMA_CTRL_STOP,
                                1);
 
+               ret = readl_poll_timeout_atomic(host->base + MSDC_DMA_CTRL, val,
+                                               !(val & MSDC_DMA_CTRL_STOP), 1, 20000);
+               if (ret)
+                       dev_dbg(host->dev, "DMA stop timed out\n");
+
                ret = readl_poll_timeout_atomic(host->base + MSDC_DMA_CFG, val,
                                                !(val & MSDC_DMA_CFG_STS), 1, 20000);
-               if (ret) {
-                       dev_dbg(host->dev, "DMA stop timed out\n");
-                       return false;
-               }
+               if (ret)
+                       dev_dbg(host->dev, "DMA inactive timed out\n");
 
                sdr_clr_bits(host->base + MSDC_INTEN, data_ints_mask);
                dev_dbg(host->dev, "DMA stop\n");
@@ -1415,9 +1418,7 @@ static bool msdc_data_xfer_done(struct msdc_host *host, u32 events,
                }
 
                msdc_data_xfer_next(host, mrq);
-               done = true;
        }
-       return done;
 }
 
 static void msdc_set_buswidth(struct msdc_host *host, u32 width)
@@ -2416,6 +2417,9 @@ static void msdc_cqe_disable(struct mmc_host *mmc, bool recovery)
        if (recovery) {
                sdr_set_field(host->base + MSDC_DMA_CTRL,
                              MSDC_DMA_CTRL_STOP, 1);
+               if (WARN_ON(readl_poll_timeout(host->base + MSDC_DMA_CTRL, val,
+                       !(val & MSDC_DMA_CTRL_STOP), 1, 3000)))
+                       return;
                if (WARN_ON(readl_poll_timeout(host->base + MSDC_DMA_CFG, val,
                        !(val & MSDC_DMA_CFG_STS), 1, 3000)))
                        return;
index 1499a64..f13c08d 100644 (file)
@@ -982,6 +982,9 @@ static int gl9763e_runtime_resume(struct sdhci_pci_chip *chip)
        struct sdhci_host *host = slot->host;
        u16 clock;
 
+       if (host->mmc->ios.power_mode != MMC_POWER_ON)
+               return 0;
+
        clock = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
 
        clock |= SDHCI_CLOCK_PLL_EN;
index 92c20cb..0d4d343 100644 (file)
@@ -152,6 +152,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc)
 
        if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS))
                sdhci_o2_enable_internal_clock(host);
+       else
+               sdhci_o2_wait_card_detect_stable(host);
 
        return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);
 }
index 0b68d05..889e403 100644 (file)
@@ -890,7 +890,7 @@ static int gpmi_nfc_compute_timings(struct gpmi_nand_data *this,
        hw->timing0 = BF_GPMI_TIMING0_ADDRESS_SETUP(addr_setup_cycles) |
                      BF_GPMI_TIMING0_DATA_HOLD(data_hold_cycles) |
                      BF_GPMI_TIMING0_DATA_SETUP(data_setup_cycles);
-       hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(busy_timeout_cycles * 4096);
+       hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(DIV_ROUND_UP(busy_timeout_cycles, 4096));
 
        /*
         * Derive NFC ideal delay from {3}:
index 88c2440..dacc552 100644 (file)
@@ -29,9 +29,6 @@ struct nand_flash_dev nand_flash_ids[] = {
        {"TC58NVG0S3E 1G 3.3V 8-bit",
                { .id = {0x98, 0xd1, 0x90, 0x15, 0x76, 0x14, 0x01, 0x00} },
                  SZ_2K, SZ_128, SZ_128K, 0, 8, 64, NAND_ECC_INFO(1, SZ_512), },
-       {"TC58NVG0S3HTA00 1G 3.3V 8-bit",
-               { .id = {0x98, 0xf1, 0x80, 0x15} },
-                 SZ_2K, SZ_128, SZ_128K, 0, 4, 128, NAND_ECC_INFO(8, SZ_512), },
        {"TC58NVG2S0F 4G 3.3V 8-bit",
                { .id = {0x98, 0xdc, 0x90, 0x26, 0x76, 0x15, 0x01, 0x08} },
                  SZ_4K, SZ_512, SZ_256K, 0, 8, 224, NAND_ECC_INFO(4, SZ_512) },
index ebee5f0..be2719a 100644 (file)
@@ -51,6 +51,7 @@ static char *status_str[] = {
 };
 
 static char *type_str[] = {
+       "", /* Type 0 is not defined */
        "AMT_MSG_DISCOVERY",
        "AMT_MSG_ADVERTISEMENT",
        "AMT_MSG_REQUEST",
@@ -2220,8 +2221,7 @@ static bool amt_advertisement_handler(struct amt_dev *amt, struct sk_buff *skb)
        struct amt_header_advertisement *amta;
        int hdr_size;
 
-       hdr_size = sizeof(*amta) - sizeof(struct amt_header);
-
+       hdr_size = sizeof(*amta) + sizeof(struct udphdr);
        if (!pskb_may_pull(skb, hdr_size))
                return true;
 
@@ -2251,19 +2251,27 @@ static bool amt_multicast_data_handler(struct amt_dev *amt, struct sk_buff *skb)
        struct ethhdr *eth;
        struct iphdr *iph;
 
+       hdr_size = sizeof(*amtmd) + sizeof(struct udphdr);
+       if (!pskb_may_pull(skb, hdr_size))
+               return true;
+
        amtmd = (struct amt_header_mcast_data *)(udp_hdr(skb) + 1);
        if (amtmd->reserved || amtmd->version)
                return true;
 
-       hdr_size = sizeof(*amtmd) + sizeof(struct udphdr);
        if (iptunnel_pull_header(skb, hdr_size, htons(ETH_P_IP), false))
                return true;
+
        skb_reset_network_header(skb);
        skb_push(skb, sizeof(*eth));
        skb_reset_mac_header(skb);
        skb_pull(skb, sizeof(*eth));
        eth = eth_hdr(skb);
+
+       if (!pskb_may_pull(skb, sizeof(*iph)))
+               return true;
        iph = ip_hdr(skb);
+
        if (iph->version == 4) {
                if (!ipv4_is_multicast(iph->daddr))
                        return true;
@@ -2274,6 +2282,9 @@ static bool amt_multicast_data_handler(struct amt_dev *amt, struct sk_buff *skb)
        } else if (iph->version == 6) {
                struct ipv6hdr *ip6h;
 
+               if (!pskb_may_pull(skb, sizeof(*ip6h)))
+                       return true;
+
                ip6h = ipv6_hdr(skb);
                if (!ipv6_addr_is_multicast(&ip6h->daddr))
                        return true;
@@ -2306,8 +2317,7 @@ static bool amt_membership_query_handler(struct amt_dev *amt,
        struct iphdr *iph;
        int hdr_size, len;
 
-       hdr_size = sizeof(*amtmq) - sizeof(struct amt_header);
-
+       hdr_size = sizeof(*amtmq) + sizeof(struct udphdr);
        if (!pskb_may_pull(skb, hdr_size))
                return true;
 
@@ -2315,22 +2325,27 @@ static bool amt_membership_query_handler(struct amt_dev *amt,
        if (amtmq->reserved || amtmq->version)
                return true;
 
-       hdr_size = sizeof(*amtmq) + sizeof(struct udphdr) - sizeof(*eth);
+       hdr_size -= sizeof(*eth);
        if (iptunnel_pull_header(skb, hdr_size, htons(ETH_P_TEB), false))
                return true;
+
        oeth = eth_hdr(skb);
        skb_reset_mac_header(skb);
        skb_pull(skb, sizeof(*eth));
        skb_reset_network_header(skb);
        eth = eth_hdr(skb);
+       if (!pskb_may_pull(skb, sizeof(*iph)))
+               return true;
+
        iph = ip_hdr(skb);
        if (iph->version == 4) {
-               if (!ipv4_is_multicast(iph->daddr))
-                       return true;
                if (!pskb_may_pull(skb, sizeof(*iph) + AMT_IPHDR_OPTS +
                                   sizeof(*ihv3)))
                        return true;
 
+               if (!ipv4_is_multicast(iph->daddr))
+                       return true;
+
                ihv3 = skb_pull(skb, sizeof(*iph) + AMT_IPHDR_OPTS);
                skb_reset_transport_header(skb);
                skb_push(skb, sizeof(*iph) + AMT_IPHDR_OPTS);
@@ -2345,15 +2360,17 @@ static bool amt_membership_query_handler(struct amt_dev *amt,
                ip_eth_mc_map(iph->daddr, eth->h_dest);
 #if IS_ENABLED(CONFIG_IPV6)
        } else if (iph->version == 6) {
-               struct ipv6hdr *ip6h = ipv6_hdr(skb);
                struct mld2_query *mld2q;
+               struct ipv6hdr *ip6h;
 
-               if (!ipv6_addr_is_multicast(&ip6h->daddr))
-                       return true;
                if (!pskb_may_pull(skb, sizeof(*ip6h) + AMT_IP6HDR_OPTS +
                                   sizeof(*mld2q)))
                        return true;
 
+               ip6h = ipv6_hdr(skb);
+               if (!ipv6_addr_is_multicast(&ip6h->daddr))
+                       return true;
+
                mld2q = skb_pull(skb, sizeof(*ip6h) + AMT_IP6HDR_OPTS);
                skb_reset_transport_header(skb);
                skb_push(skb, sizeof(*ip6h) + AMT_IP6HDR_OPTS);
@@ -2389,23 +2406,23 @@ static bool amt_update_handler(struct amt_dev *amt, struct sk_buff *skb)
 {
        struct amt_header_membership_update *amtmu;
        struct amt_tunnel_list *tunnel;
-       struct udphdr *udph;
        struct ethhdr *eth;
        struct iphdr *iph;
-       int len;
+       int len, hdr_size;
 
        iph = ip_hdr(skb);
-       udph = udp_hdr(skb);
 
-       if (__iptunnel_pull_header(skb, sizeof(*udph), skb->protocol,
-                                  false, false))
+       hdr_size = sizeof(*amtmu) + sizeof(struct udphdr);
+       if (!pskb_may_pull(skb, hdr_size))
                return true;
 
-       amtmu = (struct amt_header_membership_update *)skb->data;
+       amtmu = (struct amt_header_membership_update *)(udp_hdr(skb) + 1);
        if (amtmu->reserved || amtmu->version)
                return true;
 
-       skb_pull(skb, sizeof(*amtmu));
+       if (iptunnel_pull_header(skb, hdr_size, skb->protocol, false))
+               return true;
+
        skb_reset_network_header(skb);
 
        list_for_each_entry_rcu(tunnel, &amt->tunnel_list, list) {
@@ -2426,6 +2443,9 @@ static bool amt_update_handler(struct amt_dev *amt, struct sk_buff *skb)
        return true;
 
 report:
+       if (!pskb_may_pull(skb, sizeof(*iph)))
+               return true;
+
        iph = ip_hdr(skb);
        if (iph->version == 4) {
                if (ip_mc_check_igmp(skb)) {
@@ -2679,7 +2699,8 @@ static int amt_rcv(struct sock *sk, struct sk_buff *skb)
        amt = rcu_dereference_sk_user_data(sk);
        if (!amt) {
                err = true;
-               goto drop;
+               kfree_skb(skb);
+               goto out;
        }
 
        skb->dev = amt->dev;
index f85372a..6ba4c83 100644 (file)
@@ -3684,9 +3684,11 @@ re_arm:
                if (!rtnl_trylock())
                        return;
 
-               if (should_notify_peers)
+               if (should_notify_peers) {
+                       bond->send_peer_notif--;
                        call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
                                                 bond->dev);
+               }
                if (should_notify_rtnl) {
                        bond_slave_state_notify(bond);
                        bond_slave_link_notify(bond);
index 8af4def..e531b93 100644 (file)
@@ -2070,8 +2070,10 @@ static int gswip_gphy_fw_list(struct gswip_priv *priv,
        for_each_available_child_of_node(gphy_fw_list_np, gphy_fw_np) {
                err = gswip_gphy_fw_probe(priv, &priv->gphy_fw[i],
                                          gphy_fw_np, i);
-               if (err)
+               if (err) {
+                       of_node_put(gphy_fw_np);
                        goto remove_gphy;
+               }
                i++;
        }
 
index 7b37d45..d94150d 100644 (file)
@@ -50,22 +50,25 @@ static int mv88e6390_serdes_write(struct mv88e6xxx_chip *chip,
 }
 
 static int mv88e6xxx_serdes_pcs_get_state(struct mv88e6xxx_chip *chip,
-                                         u16 ctrl, u16 status, u16 lpa,
+                                         u16 bmsr, u16 lpa, u16 status,
                                          struct phylink_link_state *state)
 {
+       state->link = false;
+
+       /* If the BMSR reports that the link had failed, report this to
+        * phylink.
+        */
+       if (!(bmsr & BMSR_LSTATUS))
+               return 0;
+
        state->link = !!(status & MV88E6390_SGMII_PHY_STATUS_LINK);
+       state->an_complete = !!(bmsr & BMSR_ANEGCOMPLETE);
 
        if (status & MV88E6390_SGMII_PHY_STATUS_SPD_DPL_VALID) {
                /* The Spped and Duplex Resolved register is 1 if AN is enabled
                 * and complete, or if AN is disabled. So with disabled AN we
-                * still get here on link up. But we want to set an_complete
-                * only if AN was enabled, thus we look at BMCR_ANENABLE.
-                * (According to 802.3-2008 section 22.2.4.2.10, we should be
-                *  able to get this same value from BMSR_ANEGCAPABLE, but tests
-                *  show that these Marvell PHYs don't conform to this part of
-                *  the specificaion - BMSR_ANEGCAPABLE is simply always 1.)
+                * still get here on link up.
                 */
-               state->an_complete = !!(ctrl & BMCR_ANENABLE);
                state->duplex = status &
                                MV88E6390_SGMII_PHY_STATUS_DUPLEX_FULL ?
                                                 DUPLEX_FULL : DUPLEX_HALF;
@@ -191,12 +194,12 @@ int mv88e6352_serdes_pcs_config(struct mv88e6xxx_chip *chip, int port,
 int mv88e6352_serdes_pcs_get_state(struct mv88e6xxx_chip *chip, int port,
                                   int lane, struct phylink_link_state *state)
 {
-       u16 lpa, status, ctrl;
+       u16 bmsr, lpa, status;
        int err;
 
-       err = mv88e6352_serdes_read(chip, MII_BMCR, &ctrl);
+       err = mv88e6352_serdes_read(chip, MII_BMSR, &bmsr);
        if (err) {
-               dev_err(chip->dev, "can't read Serdes PHY control: %d\n", err);
+               dev_err(chip->dev, "can't read Serdes PHY BMSR: %d\n", err);
                return err;
        }
 
@@ -212,7 +215,7 @@ int mv88e6352_serdes_pcs_get_state(struct mv88e6xxx_chip *chip, int port,
                return err;
        }
 
-       return mv88e6xxx_serdes_pcs_get_state(chip, ctrl, status, lpa, state);
+       return mv88e6xxx_serdes_pcs_get_state(chip, bmsr, lpa, status, state);
 }
 
 int mv88e6352_serdes_pcs_an_restart(struct mv88e6xxx_chip *chip, int port,
@@ -918,13 +921,13 @@ int mv88e6390_serdes_pcs_config(struct mv88e6xxx_chip *chip, int port,
 static int mv88e6390_serdes_pcs_get_state_sgmii(struct mv88e6xxx_chip *chip,
        int port, int lane, struct phylink_link_state *state)
 {
-       u16 lpa, status, ctrl;
+       u16 bmsr, lpa, status;
        int err;
 
        err = mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS,
-                                   MV88E6390_SGMII_BMCR, &ctrl);
+                                   MV88E6390_SGMII_BMSR, &bmsr);
        if (err) {
-               dev_err(chip->dev, "can't read Serdes PHY control: %d\n", err);
+               dev_err(chip->dev, "can't read Serdes PHY BMSR: %d\n", err);
                return err;
        }
 
@@ -942,7 +945,7 @@ static int mv88e6390_serdes_pcs_get_state_sgmii(struct mv88e6xxx_chip *chip,
                return err;
        }
 
-       return mv88e6xxx_serdes_pcs_get_state(chip, ctrl, status, lpa, state);
+       return mv88e6xxx_serdes_pcs_get_state(chip, bmsr, lpa, status, state);
 }
 
 static int mv88e6390_serdes_pcs_get_state_10g(struct mv88e6xxx_chip *chip,
index 2727d31..1cbb05b 100644 (file)
@@ -2334,6 +2334,7 @@ static int
 qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
 {
        struct qca8k_priv *priv = ds->priv;
+       int ret;
 
        /* We have only have a general MTU setting.
         * DSA always set the CPU port's MTU to the largest MTU of the slave
@@ -2344,8 +2345,27 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
        if (!dsa_is_cpu_port(ds, port))
                return 0;
 
+       /* To change the MAX_FRAME_SIZE the cpu ports must be off or
+        * the switch panics.
+        * Turn off both cpu ports before applying the new value to prevent
+        * this.
+        */
+       if (priv->port_enabled_map & BIT(0))
+               qca8k_port_set_status(priv, 0, 0);
+
+       if (priv->port_enabled_map & BIT(6))
+               qca8k_port_set_status(priv, 6, 0);
+
        /* Include L2 header / FCS length */
-       return qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);
+       ret = qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);
+
+       if (priv->port_enabled_map & BIT(0))
+               qca8k_port_set_status(priv, 0, 1);
+
+       if (priv->port_enabled_map & BIT(6))
+               qca8k_port_set_status(priv, 6, 1);
+
+       return ret;
 }
 
 static int
index 04408e1..ec58d0e 100644 (file)
@@ -15,7 +15,7 @@
 
 #define QCA8K_ETHERNET_MDIO_PRIORITY                   7
 #define QCA8K_ETHERNET_PHY_PRIORITY                    6
-#define QCA8K_ETHERNET_TIMEOUT                         100
+#define QCA8K_ETHERNET_TIMEOUT                         5
 
 #define QCA8K_NUM_PORTS                                        7
 #define QCA8K_NUM_CPU_PORTS                            2
index 3bb42a9..769f672 100644 (file)
@@ -955,35 +955,21 @@ static int rtl8365mb_ext_config_forcemode(struct realtek_priv *priv, int port,
        return 0;
 }
 
-static bool rtl8365mb_phy_mode_supported(struct dsa_switch *ds, int port,
-                                        phy_interface_t interface)
-{
-       int ext_int;
-
-       ext_int = rtl8365mb_extint_port_map[port];
-
-       if (ext_int < 0 &&
-           (interface == PHY_INTERFACE_MODE_NA ||
-            interface == PHY_INTERFACE_MODE_INTERNAL ||
-            interface == PHY_INTERFACE_MODE_GMII))
-               /* Internal PHY */
-               return true;
-       else if ((ext_int >= 1) &&
-                phy_interface_mode_is_rgmii(interface))
-               /* Extension MAC */
-               return true;
-
-       return false;
-}
-
 static void rtl8365mb_phylink_get_caps(struct dsa_switch *ds, int port,
                                       struct phylink_config *config)
 {
-       if (dsa_is_user_port(ds, port))
+       if (dsa_is_user_port(ds, port)) {
                __set_bit(PHY_INTERFACE_MODE_INTERNAL,
                          config->supported_interfaces);
-       else if (dsa_is_cpu_port(ds, port))
+
+               /* GMII is the default interface mode for phylib, so
+                * we have to support it for ports with integrated PHY.
+                */
+               __set_bit(PHY_INTERFACE_MODE_GMII,
+                         config->supported_interfaces);
+       } else if (dsa_is_cpu_port(ds, port)) {
                phy_interface_set_rgmii(config->supported_interfaces);
+       }
 
        config->mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
                                   MAC_10 | MAC_100 | MAC_1000FD;
@@ -996,12 +982,6 @@ static void rtl8365mb_phylink_mac_config(struct dsa_switch *ds, int port,
        struct realtek_priv *priv = ds->priv;
        int ret;
 
-       if (!rtl8365mb_phy_mode_supported(ds, port, state->interface)) {
-               dev_err(priv->dev, "phy mode %s is unsupported on port %d\n",
-                       phy_modes(state->interface), port);
-               return;
-       }
-
        if (mode != MLO_AN_PHY && mode != MLO_AN_FIXED) {
                dev_err(priv->dev,
                        "port %d supports only conventional PHY or fixed-link\n",
index a381626..8c58285 100644 (file)
@@ -163,7 +163,8 @@ static int altera_tse_mdio_create(struct net_device *dev, unsigned int id)
        mdio = mdiobus_alloc();
        if (mdio == NULL) {
                netdev_err(dev, "Error allocating MDIO bus\n");
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto put_node;
        }
 
        mdio->name = ALTERA_TSE_RESOURCE_NAME;
@@ -180,6 +181,7 @@ static int altera_tse_mdio_create(struct net_device *dev, unsigned int id)
                           mdio->id);
                goto out_free_mdio;
        }
+       of_node_put(mdio_node);
 
        if (netif_msg_drv(priv))
                netdev_info(dev, "MDIO bus %s: created\n", mdio->id);
@@ -189,6 +191,8 @@ static int altera_tse_mdio_create(struct net_device *dev, unsigned int id)
 out_free_mdio:
        mdiobus_free(mdio);
        mdio = NULL;
+put_node:
+       of_node_put(mdio_node);
        return ret;
 }
 
index c6f0039..d5f2c69 100644 (file)
@@ -820,7 +820,7 @@ static int au1000_rx(struct net_device *dev)
                                pr_cont("\n");
                        }
                }
-               prxd->buff_stat = (u32)(pDB->dma_addr | RX_DMA_ENABLE);
+               prxd->buff_stat = lower_32_bits(pDB->dma_addr) | RX_DMA_ENABLE;
                aup->rx_head = (aup->rx_head + 1) & (NUM_RX_DMA - 1);
                wmb(); /* drain writebuffer */
 
@@ -996,7 +996,7 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
        ps->tx_packets++;
        ps->tx_bytes += ptxd->len;
 
-       ptxd->buff_stat = pDB->dma_addr | TX_DMA_ENABLE;
+       ptxd->buff_stat = lower_32_bits(pDB->dma_addr) | TX_DMA_ENABLE;
        wmb(); /* drain writebuffer */
        dev_kfree_skb(skb);
        aup->tx_head = (aup->tx_head + 1) & (NUM_TX_DMA - 1);
@@ -1131,9 +1131,9 @@ static int au1000_probe(struct platform_device *pdev)
        /* Allocate the data buffers
         * Snooping works fine with eth on all au1xxx
         */
-       aup->vaddr = (u32)dma_alloc_coherent(&pdev->dev, MAX_BUF_SIZE *
-                                         (NUM_TX_BUFFS + NUM_RX_BUFFS),
-                                         &aup->dma_addr, 0);
+       aup->vaddr = dma_alloc_coherent(&pdev->dev, MAX_BUF_SIZE *
+                                       (NUM_TX_BUFFS + NUM_RX_BUFFS),
+                                       &aup->dma_addr, 0);
        if (!aup->vaddr) {
                dev_err(&pdev->dev, "failed to allocate data buffers\n");
                err = -ENOMEM;
@@ -1234,8 +1234,8 @@ static int au1000_probe(struct platform_device *pdev)
        for (i = 0; i < (NUM_TX_BUFFS+NUM_RX_BUFFS); i++) {
                pDB->pnext = pDBfree;
                pDBfree = pDB;
-               pDB->vaddr = (u32 *)((unsigned)aup->vaddr + MAX_BUF_SIZE*i);
-               pDB->dma_addr = (dma_addr_t)virt_to_bus(pDB->vaddr);
+               pDB->vaddr = aup->vaddr + MAX_BUF_SIZE * i;
+               pDB->dma_addr = aup->dma_addr + MAX_BUF_SIZE * i;
                pDB++;
        }
        aup->pDBfree = pDBfree;
@@ -1246,7 +1246,7 @@ static int au1000_probe(struct platform_device *pdev)
                if (!pDB)
                        goto err_out;
 
-               aup->rx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
+               aup->rx_dma_ring[i]->buff_stat = lower_32_bits(pDB->dma_addr);
                aup->rx_db_inuse[i] = pDB;
        }
 
@@ -1255,7 +1255,7 @@ static int au1000_probe(struct platform_device *pdev)
                if (!pDB)
                        goto err_out;
 
-               aup->tx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
+               aup->tx_dma_ring[i]->buff_stat = lower_32_bits(pDB->dma_addr);
                aup->tx_dma_ring[i]->len = 0;
                aup->tx_db_inuse[i] = pDB;
        }
@@ -1310,7 +1310,7 @@ err_remap2:
        iounmap(aup->mac);
 err_remap1:
        dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
-                       (void *)aup->vaddr, aup->dma_addr);
+                         aup->vaddr, aup->dma_addr);
 err_vaddr:
        free_netdev(dev);
 err_alloc:
@@ -1343,7 +1343,7 @@ static int au1000_remove(struct platform_device *pdev)
                        au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);
 
        dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
-                       (void *)aup->vaddr, aup->dma_addr);
+                         aup->vaddr, aup->dma_addr);
 
        iounmap(aup->macdma);
        iounmap(aup->mac);
index e3a3ed2..2489c2f 100644 (file)
@@ -106,8 +106,8 @@ struct au1000_private {
        struct mac_reg *mac;  /* mac registers                      */
        u32 *enable;     /* address of MAC Enable Register     */
        void __iomem *macdma;   /* base of MAC DMA port */
-       u32 vaddr;                /* virtual address of rx/tx buffers   */
-       dma_addr_t dma_addr;      /* dma address of rx/tx buffers       */
+       void *vaddr;            /* virtual address of rx/tx buffers   */
+       dma_addr_t dma_addr;    /* dma address of rx/tx buffers       */
 
        spinlock_t lock;       /* Serialise access to device */
 
index a359329..4d46780 100644 (file)
@@ -2784,7 +2784,7 @@ void xgbe_print_pkt(struct net_device *netdev, struct sk_buff *skb, bool tx_rx)
 
        netdev_dbg(netdev, "Dst MAC addr: %pM\n", eth->h_dest);
        netdev_dbg(netdev, "Src MAC addr: %pM\n", eth->h_source);
-       netdev_dbg(netdev, "Protocol: %#06hx\n", ntohs(eth->h_proto));
+       netdev_dbg(netdev, "Protocol: %#06x\n", ntohs(eth->h_proto));
 
        for (i = 0; i < skb->len; i += 32) {
                unsigned int len = min(skb->len - i, 32U);
index 4ebd241..4d790a8 100644 (file)
@@ -338,7 +338,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
                 *   the PHY resources listed last
                 */
                phy_memnum = xgbe_resource_count(pdev, IORESOURCE_MEM) - 3;
-               phy_irqnum = xgbe_resource_count(pdev, IORESOURCE_IRQ) - 1;
+               phy_irqnum = platform_irq_count(pdev) - 1;
                dma_irqnum = 1;
                dma_irqend = phy_irqnum;
        } else {
@@ -348,7 +348,7 @@ static int xgbe_platform_probe(struct platform_device *pdev)
                phy_memnum = 0;
                phy_irqnum = 0;
                dma_irqnum = 1;
-               dma_irqend = xgbe_resource_count(pdev, IORESOURCE_IRQ);
+               dma_irqend = platform_irq_count(pdev);
        }
 
        /* Obtain the mmio areas for the device */
index 086739e..9b83d53 100644 (file)
@@ -234,6 +234,7 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac)
        np = of_get_child_by_name(core->dev.of_node, "mdio");
 
        err = of_mdiobus_register(mii_bus, np);
+       of_node_put(np);
        if (err) {
                dev_err(&core->dev, "Registration of mii bus failed\n");
                goto err_free_bus;
index e6f4878..02bd3cf 100644 (file)
@@ -332,7 +332,6 @@ static void bgmac_remove(struct bcma_device *core)
        bcma_mdio_mii_unregister(bgmac->mii_bus);
        bgmac_enet_remove(bgmac);
        bcma_set_drvdata(core, NULL);
-       kfree(bgmac);
 }
 
 static struct bcma_driver bgmac_bcma_driver = {
index 8a3a446..94f80e1 100644 (file)
@@ -769,6 +769,7 @@ struct hnae3_tc_info {
        u8 prio_tc[HNAE3_MAX_USER_PRIO]; /* TC indexed by prio */
        u16 tqp_count[HNAE3_MAX_TC];
        u16 tqp_offset[HNAE3_MAX_TC];
+       u8 max_tc; /* Total number of TCs */
        u8 num_tc; /* Total number of enabled TCs */
        bool mqprio_active;
 };
index 6d20974..4c7988e 100644 (file)
@@ -1129,7 +1129,7 @@ hns3_is_ringparam_changed(struct net_device *ndev,
        if (old_ringparam->tx_desc_num == new_ringparam->tx_desc_num &&
            old_ringparam->rx_desc_num == new_ringparam->rx_desc_num &&
            old_ringparam->rx_buf_len == new_ringparam->rx_buf_len) {
-               netdev_info(ndev, "ringparam not changed\n");
+               netdev_info(ndev, "descriptor number and rx buffer length not changed\n");
                return false;
        }
 
index 1ebad0e..fae7976 100644 (file)
@@ -3268,7 +3268,7 @@ static int hclge_tp_port_init(struct hclge_dev *hdev)
 static int hclge_update_port_info(struct hclge_dev *hdev)
 {
        struct hclge_mac *mac = &hdev->hw.mac;
-       int speed = HCLGE_MAC_SPEED_UNKNOWN;
+       int speed;
        int ret;
 
        /* get the port info from SFP cmd if not copper port */
@@ -3279,10 +3279,13 @@ static int hclge_update_port_info(struct hclge_dev *hdev)
        if (!hdev->support_sfp_query)
                return 0;
 
-       if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2)
+       if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
+               speed = mac->speed;
                ret = hclge_get_sfp_info(hdev, mac);
-       else
+       } else {
+               speed = HCLGE_MAC_SPEED_UNKNOWN;
                ret = hclge_get_sfp_speed(hdev, &speed);
+       }
 
        if (ret == -EOPNOTSUPP) {
                hdev->support_sfp_query = false;
@@ -3294,6 +3297,8 @@ static int hclge_update_port_info(struct hclge_dev *hdev)
        if (hdev->ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V2) {
                if (mac->speed_type == QUERY_ACTIVE_SPEED) {
                        hclge_update_port_capability(hdev, mac);
+                       if (mac->speed != speed)
+                               (void)hclge_tm_port_shaper_cfg(hdev);
                        return 0;
                }
                return hclge_cfg_mac_speed_dup(hdev, mac->speed,
@@ -3376,6 +3381,12 @@ static int hclge_set_vf_link_state(struct hnae3_handle *handle, int vf,
        link_state_old = vport->vf_info.link_state;
        vport->vf_info.link_state = link_state;
 
+       /* return success directly if the VF is unalive, VF will
+        * query link state itself when it starts work.
+        */
+       if (!test_bit(HCLGE_VPORT_STATE_ALIVE, &vport->state))
+               return 0;
+
        ret = hclge_push_vf_link_status(vport);
        if (ret) {
                vport->vf_info.link_state = link_state_old;
@@ -10117,6 +10128,7 @@ static int hclge_modify_port_base_vlan_tag(struct hclge_vport *vport,
        if (ret)
                return ret;
 
+       vport->port_base_vlan_cfg.tbl_sta = false;
        /* remove old VLAN tag */
        if (old_info->vlan_tag == 0)
                ret = hclge_set_vf_vlan_common(hdev, vport->vport_id,
index 1f87a8a..2f33b03 100644 (file)
@@ -282,8 +282,8 @@ static int hclge_tm_pg_to_pri_map_cfg(struct hclge_dev *hdev,
        return hclge_cmd_send(&hdev->hw, &desc, 1);
 }
 
-static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev,
-                                     u16 qs_id, u8 pri)
+static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev, u16 qs_id, u8 pri,
+                                     bool link_vld)
 {
        struct hclge_qs_to_pri_link_cmd *map;
        struct hclge_desc desc;
@@ -294,7 +294,7 @@ static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev,
 
        map->qs_id = cpu_to_le16(qs_id);
        map->priority = pri;
-       map->link_vld = HCLGE_TM_QS_PRI_LINK_VLD_MSK;
+       map->link_vld = link_vld ? HCLGE_TM_QS_PRI_LINK_VLD_MSK : 0;
 
        return hclge_cmd_send(&hdev->hw, &desc, 1);
 }
@@ -420,7 +420,7 @@ static int hclge_tm_pg_shapping_cfg(struct hclge_dev *hdev,
        return hclge_cmd_send(&hdev->hw, &desc, 1);
 }
 
-static int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev)
+int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev)
 {
        struct hclge_port_shapping_cmd *shap_cfg_cmd;
        struct hclge_shaper_ir_para ir_para;
@@ -642,11 +642,13 @@ static void hclge_tm_update_kinfo_rss_size(struct hclge_vport *vport)
         * one tc for VF for simplicity. VF's vport_id is non zero.
         */
        if (vport->vport_id) {
+               kinfo->tc_info.max_tc = 1;
                kinfo->tc_info.num_tc = 1;
                vport->qs_offset = HNAE3_MAX_TC +
                                   vport->vport_id - HCLGE_VF_VPORT_START_NUM;
                vport_max_rss_size = hdev->vf_rss_size_max;
        } else {
+               kinfo->tc_info.max_tc = hdev->tc_max;
                kinfo->tc_info.num_tc =
                        min_t(u16, vport->alloc_tqps, hdev->tm_info.num_tc);
                vport->qs_offset = 0;
@@ -679,7 +681,9 @@ static void hclge_tm_vport_tc_info_update(struct hclge_vport *vport)
        kinfo->num_tqps = hclge_vport_get_tqp_num(vport);
        vport->dwrr = 100;  /* 100 percent as init */
        vport->bw_limit = hdev->tm_info.pg_info[0].bw_limit;
-       hdev->rss_cfg.rss_size = kinfo->rss_size;
+
+       if (vport->vport_id == PF_VPORT_ID)
+               hdev->rss_cfg.rss_size = kinfo->rss_size;
 
        /* when enable mqprio, the tc_info has been updated. */
        if (kinfo->tc_info.mqprio_active)
@@ -714,14 +718,22 @@ static void hclge_tm_vport_info_update(struct hclge_dev *hdev)
 
 static void hclge_tm_tc_info_init(struct hclge_dev *hdev)
 {
-       u8 i;
+       u8 i, tc_sch_mode;
+       u32 bw_limit;
+
+       for (i = 0; i < hdev->tc_max; i++) {
+               if (i < hdev->tm_info.num_tc) {
+                       tc_sch_mode = HCLGE_SCH_MODE_DWRR;
+                       bw_limit = hdev->tm_info.pg_info[0].bw_limit;
+               } else {
+                       tc_sch_mode = HCLGE_SCH_MODE_SP;
+                       bw_limit = 0;
+               }
 
-       for (i = 0; i < hdev->tm_info.num_tc; i++) {
                hdev->tm_info.tc_info[i].tc_id = i;
-               hdev->tm_info.tc_info[i].tc_sch_mode = HCLGE_SCH_MODE_DWRR;
+               hdev->tm_info.tc_info[i].tc_sch_mode = tc_sch_mode;
                hdev->tm_info.tc_info[i].pgid = 0;
-               hdev->tm_info.tc_info[i].bw_limit =
-                       hdev->tm_info.pg_info[0].bw_limit;
+               hdev->tm_info.tc_info[i].bw_limit = bw_limit;
        }
 
        for (i = 0; i < HNAE3_MAX_USER_PRIO; i++)
@@ -926,10 +938,13 @@ static int hclge_tm_pri_q_qs_cfg_tc_base(struct hclge_dev *hdev)
        for (k = 0; k < hdev->num_alloc_vport; k++) {
                struct hnae3_knic_private_info *kinfo = &vport[k].nic.kinfo;
 
-               for (i = 0; i < kinfo->tc_info.num_tc; i++) {
+               for (i = 0; i < kinfo->tc_info.max_tc; i++) {
+                       u8 pri = i < kinfo->tc_info.num_tc ? i : 0;
+                       bool link_vld = i < kinfo->tc_info.num_tc;
+
                        ret = hclge_tm_qs_to_pri_map_cfg(hdev,
                                                         vport[k].qs_offset + i,
-                                                        i);
+                                                        pri, link_vld);
                        if (ret)
                                return ret;
                }
@@ -949,7 +964,7 @@ static int hclge_tm_pri_q_qs_cfg_vnet_base(struct hclge_dev *hdev)
                for (i = 0; i < HNAE3_MAX_TC; i++) {
                        ret = hclge_tm_qs_to_pri_map_cfg(hdev,
                                                         vport[k].qs_offset + i,
-                                                        k);
+                                                        k, true);
                        if (ret)
                                return ret;
                }
@@ -989,33 +1004,39 @@ static int hclge_tm_pri_tc_base_shaper_cfg(struct hclge_dev *hdev)
 {
        u32 max_tm_rate = hdev->ae_dev->dev_specs.max_tm_rate;
        struct hclge_shaper_ir_para ir_para;
-       u32 shaper_para;
+       u32 shaper_para_c, shaper_para_p;
        int ret;
        u32 i;
 
-       for (i = 0; i < hdev->tm_info.num_tc; i++) {
+       for (i = 0; i < hdev->tc_max; i++) {
                u32 rate = hdev->tm_info.tc_info[i].bw_limit;
 
-               ret = hclge_shaper_para_calc(rate, HCLGE_SHAPER_LVL_PRI,
-                                            &ir_para, max_tm_rate);
-               if (ret)
-                       return ret;
+               if (rate) {
+                       ret = hclge_shaper_para_calc(rate, HCLGE_SHAPER_LVL_PRI,
+                                                    &ir_para, max_tm_rate);
+                       if (ret)
+                               return ret;
+
+                       shaper_para_c = hclge_tm_get_shapping_para(0, 0, 0,
+                                                                  HCLGE_SHAPER_BS_U_DEF,
+                                                                  HCLGE_SHAPER_BS_S_DEF);
+                       shaper_para_p = hclge_tm_get_shapping_para(ir_para.ir_b,
+                                                                  ir_para.ir_u,
+                                                                  ir_para.ir_s,
+                                                                  HCLGE_SHAPER_BS_U_DEF,
+                                                                  HCLGE_SHAPER_BS_S_DEF);
+               } else {
+                       shaper_para_c = 0;
+                       shaper_para_p = 0;
+               }
 
-               shaper_para = hclge_tm_get_shapping_para(0, 0, 0,
-                                                        HCLGE_SHAPER_BS_U_DEF,
-                                                        HCLGE_SHAPER_BS_S_DEF);
                ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_C_BUCKET, i,
-                                               shaper_para, rate);
+                                               shaper_para_c, rate);
                if (ret)
                        return ret;
 
-               shaper_para = hclge_tm_get_shapping_para(ir_para.ir_b,
-                                                        ir_para.ir_u,
-                                                        ir_para.ir_s,
-                                                        HCLGE_SHAPER_BS_U_DEF,
-                                                        HCLGE_SHAPER_BS_S_DEF);
                ret = hclge_tm_pri_shapping_cfg(hdev, HCLGE_TM_SHAP_P_BUCKET, i,
-                                               shaper_para, rate);
+                                               shaper_para_p, rate);
                if (ret)
                        return ret;
        }
@@ -1125,7 +1146,7 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
        int ret;
        u32 i, k;
 
-       for (i = 0; i < hdev->tm_info.num_tc; i++) {
+       for (i = 0; i < hdev->tc_max; i++) {
                pg_info =
                        &hdev->tm_info.pg_info[hdev->tm_info.tc_info[i].pgid];
                dwrr = pg_info->tc_dwrr[i];
@@ -1135,9 +1156,15 @@ static int hclge_tm_pri_tc_base_dwrr_cfg(struct hclge_dev *hdev)
                        return ret;
 
                for (k = 0; k < hdev->num_alloc_vport; k++) {
+                       struct hnae3_knic_private_info *kinfo = &vport[k].nic.kinfo;
+
+                       if (i >= kinfo->tc_info.max_tc)
+                               continue;
+
+                       dwrr = i < kinfo->tc_info.num_tc ? vport[k].dwrr : 0;
                        ret = hclge_tm_qs_weight_cfg(
                                hdev, vport[k].qs_offset + i,
-                               vport[k].dwrr);
+                               dwrr);
                        if (ret)
                                return ret;
                }
@@ -1303,6 +1330,7 @@ static int hclge_tm_schd_mode_tc_base_cfg(struct hclge_dev *hdev, u8 pri_id)
 {
        struct hclge_vport *vport = hdev->vport;
        int ret;
+       u8 mode;
        u16 i;
 
        ret = hclge_tm_pri_schd_mode_cfg(hdev, pri_id);
@@ -1310,9 +1338,16 @@ static int hclge_tm_schd_mode_tc_base_cfg(struct hclge_dev *hdev, u8 pri_id)
                return ret;
 
        for (i = 0; i < hdev->num_alloc_vport; i++) {
+               struct hnae3_knic_private_info *kinfo = &vport[i].nic.kinfo;
+
+               if (pri_id >= kinfo->tc_info.max_tc)
+                       continue;
+
+               mode = pri_id < kinfo->tc_info.num_tc ? HCLGE_SCH_MODE_DWRR :
+                      HCLGE_SCH_MODE_SP;
                ret = hclge_tm_qs_schd_mode_cfg(hdev,
                                                vport[i].qs_offset + pri_id,
-                                               HCLGE_SCH_MODE_DWRR);
+                                               mode);
                if (ret)
                        return ret;
        }
@@ -1353,7 +1388,7 @@ static int hclge_tm_lvl34_schd_mode_cfg(struct hclge_dev *hdev)
        u8 i;
 
        if (hdev->tx_sch_mode == HCLGE_FLAG_TC_BASE_SCH_MODE) {
-               for (i = 0; i < hdev->tm_info.num_tc; i++) {
+               for (i = 0; i < hdev->tc_max; i++) {
                        ret = hclge_tm_schd_mode_tc_base_cfg(hdev, i);
                        if (ret)
                                return ret;
index 619cc30..d943943 100644 (file)
@@ -237,6 +237,7 @@ int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr);
 void hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats);
 void hclge_pfc_tx_stats_get(struct hclge_dev *hdev, u64 *stats);
 int hclge_tm_qs_shaper_cfg(struct hclge_vport *vport, int max_tx_rate);
+int hclge_tm_port_shaper_cfg(struct hclge_dev *hdev);
 int hclge_tm_get_qset_num(struct hclge_dev *hdev, u16 *qset_num);
 int hclge_tm_get_pri_num(struct hclge_dev *hdev, u8 *pri_num);
 int hclge_tm_get_qset_map_pri(struct hclge_dev *hdev, u16 qset_id, u8 *priority,
index 60ae8bf..1749d26 100644 (file)
@@ -43,9 +43,7 @@ static bool check_image_valid(struct hinic_devlink_priv *priv, const u8 *buf,
 
        for (i = 0; i < fw_image->fw_info.fw_section_cnt; i++) {
                len += fw_image->fw_section_info[i].fw_section_len;
-               memcpy(&host_image->image_section_info[i],
-                      &fw_image->fw_section_info[i],
-                      sizeof(struct fw_section_info_st));
+               host_image->image_section_info[i] = fw_image->fw_section_info[i];
        }
 
        if (len != fw_image->fw_len ||
index 610f00c..19704f5 100644 (file)
@@ -2586,15 +2586,16 @@ static void i40e_diag_test(struct net_device *netdev,
 
                set_bit(__I40E_TESTING, pf->state);
 
+               if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
+                   test_bit(__I40E_RESET_INTR_RECEIVED, pf->state)) {
+                       dev_warn(&pf->pdev->dev,
+                                "Cannot start offline testing when PF is in reset state.\n");
+                       goto skip_ol_tests;
+               }
+
                if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
                        dev_warn(&pf->pdev->dev,
                                 "Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
-                       data[I40E_ETH_TEST_REG]         = 1;
-                       data[I40E_ETH_TEST_EEPROM]      = 1;
-                       data[I40E_ETH_TEST_INTR]        = 1;
-                       data[I40E_ETH_TEST_LINK]        = 1;
-                       eth_test->flags |= ETH_TEST_FL_FAILED;
-                       clear_bit(__I40E_TESTING, pf->state);
                        goto skip_ol_tests;
                }
 
@@ -2641,9 +2642,17 @@ static void i40e_diag_test(struct net_device *netdev,
                data[I40E_ETH_TEST_INTR] = 0;
        }
 
-skip_ol_tests:
-
        netif_info(pf, drv, netdev, "testing finished\n");
+       return;
+
+skip_ol_tests:
+       data[I40E_ETH_TEST_REG]         = 1;
+       data[I40E_ETH_TEST_EEPROM]      = 1;
+       data[I40E_ETH_TEST_INTR]        = 1;
+       data[I40E_ETH_TEST_LINK]        = 1;
+       eth_test->flags |= ETH_TEST_FL_FAILED;
+       clear_bit(__I40E_TESTING, pf->state);
+       netif_info(pf, drv, netdev, "testing failed\n");
 }
 
 static void i40e_get_wol(struct net_device *netdev,
index 332a608..72576bb 100644 (file)
@@ -8542,6 +8542,11 @@ static int i40e_configure_clsflower(struct i40e_vsi *vsi,
                return -EOPNOTSUPP;
        }
 
+       if (!tc) {
+               dev_err(&pf->pdev->dev, "Unable to add filter because of invalid destination");
+               return -EINVAL;
+       }
+
        if (test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state) ||
            test_bit(__I40E_RESET_INTR_RECEIVED, pf->state))
                return -EBUSY;
index 2606e8f..033ea71 100644 (file)
@@ -2282,7 +2282,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
        }
 
        if (vf->adq_enabled) {
-               for (i = 0; i < I40E_MAX_VF_VSI; i++)
+               for (i = 0; i < vf->num_tc; i++)
                        num_qps_all += vf->ch[i].num_qps;
                if (num_qps_all != qci->num_queue_pairs) {
                        aq_ret = I40E_ERR_PARAM;
index 7dfcf78..f3ecb3b 100644 (file)
@@ -984,7 +984,7 @@ struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
                list_add_tail(&f->list, &adapter->mac_filter_list);
                f->add = true;
                f->is_new_mac = true;
-               f->is_primary = false;
+               f->is_primary = ether_addr_equal(macaddr, adapter->hw.mac.addr);
                adapter->aq_required |= IAVF_FLAG_AQ_ADD_MAC_FILTER;
        } else {
                f->remove = false;
index 1e71b70..70335f6 100644 (file)
@@ -2189,6 +2189,42 @@ ice_setup_autoneg(struct ice_port_info *p, struct ethtool_link_ksettings *ks,
        return err;
 }
 
+/**
+ * ice_set_phy_type_from_speed - set phy_types based on speeds
+ * and advertised modes
+ * @ks: ethtool link ksettings struct
+ * @phy_type_low: pointer to the lower part of phy_type
+ * @phy_type_high: pointer to the higher part of phy_type
+ * @adv_link_speed: targeted link speeds bitmap
+ */
+static void
+ice_set_phy_type_from_speed(const struct ethtool_link_ksettings *ks,
+                           u64 *phy_type_low, u64 *phy_type_high,
+                           u16 adv_link_speed)
+{
+       /* Handle 1000M speed in a special way because ice_update_phy_type
+        * enables all link modes, but having mixed copper and optical
+        * standards is not supported.
+        */
+       adv_link_speed &= ~ICE_AQ_LINK_SPEED_1000MB;
+
+       if (ethtool_link_ksettings_test_link_mode(ks, advertising,
+                                                 1000baseT_Full))
+               *phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_T |
+                                ICE_PHY_TYPE_LOW_1G_SGMII;
+
+       if (ethtool_link_ksettings_test_link_mode(ks, advertising,
+                                                 1000baseKX_Full))
+               *phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_KX;
+
+       if (ethtool_link_ksettings_test_link_mode(ks, advertising,
+                                                 1000baseX_Full))
+               *phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_SX |
+                                ICE_PHY_TYPE_LOW_1000BASE_LX;
+
+       ice_update_phy_type(phy_type_low, phy_type_high, adv_link_speed);
+}
+
 /**
  * ice_set_link_ksettings - Set Speed and Duplex
  * @netdev: network interface device structure
@@ -2320,7 +2356,8 @@ ice_set_link_ksettings(struct net_device *netdev,
                adv_link_speed = curr_link_speed;
 
        /* Convert the advertise link speeds to their corresponded PHY_TYPE */
-       ice_update_phy_type(&phy_type_low, &phy_type_high, adv_link_speed);
+       ice_set_phy_type_from_speed(ks, &phy_type_low, &phy_type_high,
+                                   adv_link_speed);
 
        if (!autoneg_changed && adv_link_speed == curr_link_speed) {
                netdev_info(netdev, "Nothing changed, exiting without setting anything.\n");
@@ -3470,6 +3507,16 @@ static int ice_set_channels(struct net_device *dev, struct ethtool_channels *ch)
        new_rx = ch->combined_count + ch->rx_count;
        new_tx = ch->combined_count + ch->tx_count;
 
+       if (new_rx < vsi->tc_cfg.numtc) {
+               netdev_err(dev, "Cannot set less Rx channels, than Traffic Classes you have (%u)\n",
+                          vsi->tc_cfg.numtc);
+               return -EINVAL;
+       }
+       if (new_tx < vsi->tc_cfg.numtc) {
+               netdev_err(dev, "Cannot set less Tx channels, than Traffic Classes you have (%u)\n",
+                          vsi->tc_cfg.numtc);
+               return -EINVAL;
+       }
        if (new_rx > ice_get_max_rxq(pf)) {
                netdev_err(dev, "Maximum allowed Rx channels is %d\n",
                           ice_get_max_rxq(pf));
index 454e01a..f7f9c97 100644 (file)
@@ -909,7 +909,7 @@ static void ice_set_dflt_vsi_ctx(struct ice_hw *hw, struct ice_vsi_ctx *ctxt)
  * @vsi: the VSI being configured
  * @ctxt: VSI context structure
  */
-static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
+static int ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
 {
        u16 offset = 0, qmap = 0, tx_count = 0, pow = 0;
        u16 num_txq_per_tc, num_rxq_per_tc;
@@ -982,7 +982,18 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
        else
                vsi->num_rxq = num_rxq_per_tc;
 
+       if (vsi->num_rxq > vsi->alloc_rxq) {
+               dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Rx queues (%u), than were allocated (%u)!\n",
+                       vsi->num_rxq, vsi->alloc_rxq);
+               return -EINVAL;
+       }
+
        vsi->num_txq = tx_count;
+       if (vsi->num_txq > vsi->alloc_txq) {
+               dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Tx queues (%u), than were allocated (%u)!\n",
+                       vsi->num_txq, vsi->alloc_txq);
+               return -EINVAL;
+       }
 
        if (vsi->type == ICE_VSI_VF && vsi->num_txq != vsi->num_rxq) {
                dev_dbg(ice_pf_to_dev(vsi->back), "VF VSI should have same number of Tx and Rx queues. Hence making them equal\n");
@@ -1000,6 +1011,8 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)
         */
        ctxt->info.q_mapping[0] = cpu_to_le16(vsi->rxq_map[0]);
        ctxt->info.q_mapping[1] = cpu_to_le16(vsi->num_rxq);
+
+       return 0;
 }
 
 /**
@@ -1187,7 +1200,10 @@ static int ice_vsi_init(struct ice_vsi *vsi, bool init_vsi)
        if (vsi->type == ICE_VSI_CHNL) {
                ice_chnl_vsi_setup_q_map(vsi, ctxt);
        } else {
-               ice_vsi_setup_q_map(vsi, ctxt);
+               ret = ice_vsi_setup_q_map(vsi, ctxt);
+               if (ret)
+                       goto out;
+
                if (!init_vsi) /* means VSI being updated */
                        /* must to indicate which section of VSI context are
                         * being modified
@@ -3464,7 +3480,7 @@ void ice_vsi_cfg_netdev_tc(struct ice_vsi *vsi, u8 ena_tc)
  *
  * Prepares VSI tc_config to have queue configurations based on MQPRIO options.
  */
-static void
+static int
 ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
                           u8 ena_tc)
 {
@@ -3513,7 +3529,18 @@ ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
 
        /* Set actual Tx/Rx queue pairs */
        vsi->num_txq = offset + qcount_tx;
+       if (vsi->num_txq > vsi->alloc_txq) {
+               dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Tx queues (%u), than were allocated (%u)!\n",
+                       vsi->num_txq, vsi->alloc_txq);
+               return -EINVAL;
+       }
+
        vsi->num_rxq = offset + qcount_rx;
+       if (vsi->num_rxq > vsi->alloc_rxq) {
+               dev_err(ice_pf_to_dev(vsi->back), "Trying to use more Rx queues (%u), than were allocated (%u)!\n",
+                       vsi->num_rxq, vsi->alloc_rxq);
+               return -EINVAL;
+       }
 
        /* Setup queue TC[0].qmap for given VSI context */
        ctxt->info.tc_mapping[0] = cpu_to_le16(qmap);
@@ -3531,6 +3558,8 @@ ice_vsi_setup_q_map_mqprio(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt,
        dev_dbg(ice_pf_to_dev(vsi->back), "vsi->num_rxq = %d\n",  vsi->num_rxq);
        dev_dbg(ice_pf_to_dev(vsi->back), "all_numtc %u, all_enatc: 0x%04x, tc_cfg.numtc %u\n",
                vsi->all_numtc, vsi->all_enatc, vsi->tc_cfg.numtc);
+
+       return 0;
 }
 
 /**
@@ -3580,9 +3609,12 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)
 
        if (vsi->type == ICE_VSI_PF &&
            test_bit(ICE_FLAG_TC_MQPRIO, pf->flags))
-               ice_vsi_setup_q_map_mqprio(vsi, ctx, ena_tc);
+               ret = ice_vsi_setup_q_map_mqprio(vsi, ctx, ena_tc);
        else
-               ice_vsi_setup_q_map(vsi, ctx);
+               ret = ice_vsi_setup_q_map(vsi, ctx);
+
+       if (ret)
+               goto out;
 
        /* must to indicate which section of VSI context are being modified */
        ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);
index e1cae25..c1ac2f7 100644 (file)
@@ -5763,25 +5763,38 @@ static netdev_features_t
 ice_fix_features(struct net_device *netdev, netdev_features_t features)
 {
        struct ice_netdev_priv *np = netdev_priv(netdev);
-       netdev_features_t supported_vlan_filtering;
-       netdev_features_t requested_vlan_filtering;
-       struct ice_vsi *vsi = np->vsi;
-
-       requested_vlan_filtering = features & NETIF_VLAN_FILTERING_FEATURES;
-
-       /* make sure supported_vlan_filtering works for both SVM and DVM */
-       supported_vlan_filtering = NETIF_F_HW_VLAN_CTAG_FILTER;
-       if (ice_is_dvm_ena(&vsi->back->hw))
-               supported_vlan_filtering |= NETIF_F_HW_VLAN_STAG_FILTER;
-
-       if (requested_vlan_filtering &&
-           requested_vlan_filtering != supported_vlan_filtering) {
-               if (requested_vlan_filtering & NETIF_F_HW_VLAN_CTAG_FILTER) {
-                       netdev_warn(netdev, "cannot support requested VLAN filtering settings, enabling all supported VLAN filtering settings\n");
-                       features |= supported_vlan_filtering;
+       netdev_features_t req_vlan_fltr, cur_vlan_fltr;
+       bool cur_ctag, cur_stag, req_ctag, req_stag;
+
+       cur_vlan_fltr = netdev->features & NETIF_VLAN_FILTERING_FEATURES;
+       cur_ctag = cur_vlan_fltr & NETIF_F_HW_VLAN_CTAG_FILTER;
+       cur_stag = cur_vlan_fltr & NETIF_F_HW_VLAN_STAG_FILTER;
+
+       req_vlan_fltr = features & NETIF_VLAN_FILTERING_FEATURES;
+       req_ctag = req_vlan_fltr & NETIF_F_HW_VLAN_CTAG_FILTER;
+       req_stag = req_vlan_fltr & NETIF_F_HW_VLAN_STAG_FILTER;
+
+       if (req_vlan_fltr != cur_vlan_fltr) {
+               if (ice_is_dvm_ena(&np->vsi->back->hw)) {
+                       if (req_ctag && req_stag) {
+                               features |= NETIF_VLAN_FILTERING_FEATURES;
+                       } else if (!req_ctag && !req_stag) {
+                               features &= ~NETIF_VLAN_FILTERING_FEATURES;
+                       } else if ((!cur_ctag && req_ctag && !cur_stag) ||
+                                  (!cur_stag && req_stag && !cur_ctag)) {
+                               features |= NETIF_VLAN_FILTERING_FEATURES;
+                               netdev_warn(netdev,  "802.1Q and 802.1ad VLAN filtering must be either both on or both off. VLAN filtering has been enabled for both types.\n");
+                       } else if ((cur_ctag && !req_ctag && cur_stag) ||
+                                  (cur_stag && !req_stag && cur_ctag)) {
+                               features &= ~NETIF_VLAN_FILTERING_FEATURES;
+                               netdev_warn(netdev,  "802.1Q and 802.1ad VLAN filtering must be either both on or both off. VLAN filtering has been disabled for both types.\n");
+                       }
                } else {
-                       netdev_warn(netdev, "cannot support requested VLAN filtering settings, clearing all supported VLAN filtering settings\n");
-                       features &= ~supported_vlan_filtering;
+                       if (req_vlan_fltr & NETIF_F_HW_VLAN_STAG_FILTER)
+                               netdev_warn(netdev, "cannot support requested 802.1ad filtering setting in SVM mode\n");
+
+                       if (req_vlan_fltr & NETIF_F_HW_VLAN_CTAG_FILTER)
+                               features |= NETIF_F_HW_VLAN_CTAG_FILTER;
                }
        }
 
index 662947c..ef9344e 100644 (file)
@@ -2271,7 +2271,7 @@ static int
 ice_ptp_init_tx_e822(struct ice_pf *pf, struct ice_ptp_tx *tx, u8 port)
 {
        tx->quad = port / ICE_PORTS_PER_QUAD;
-       tx->quad_offset = tx->quad * INDEX_PER_PORT;
+       tx->quad_offset = (port % ICE_PORTS_PER_QUAD) * INDEX_PER_PORT;
        tx->len = INDEX_PER_PORT;
 
        return ice_ptp_alloc_tx_tracker(tx);
index afd048d..10e396a 100644 (file)
@@ -49,6 +49,37 @@ struct ice_perout_channel {
  * To allow multiple ports to access the shared register block independently,
  * the blocks are split up so that indexes are assigned to each port based on
  * hardware logical port number.
+ *
+ * The timestamp blocks are handled differently for E810- and E822-based
+ * devices. In E810 devices, each port has its own block of timestamps, while in
+ * E822 there is a need to logically break the block of registers into smaller
+ * chunks based on the port number to avoid collisions.
+ *
+ * Example for port 5 in E810:
+ *  +--------+--------+--------+--------+--------+--------+--------+--------+
+ *  |register|register|register|register|register|register|register|register|
+ *  | block  | block  | block  | block  | block  | block  | block  | block  |
+ *  |  for   |  for   |  for   |  for   |  for   |  for   |  for   |  for   |
+ *  | port 0 | port 1 | port 2 | port 3 | port 4 | port 5 | port 6 | port 7 |
+ *  +--------+--------+--------+--------+--------+--------+--------+--------+
+ *                                               ^^
+ *                                               ||
+ *                                               |---  quad offset is always 0
+ *                                               ---- quad number
+ *
+ * Example for port 5 in E822:
+ * +-----------------------------+-----------------------------+
+ * |  register block for quad 0  |  register block for quad 1  |
+ * |+------+------+------+------+|+------+------+------+------+|
+ * ||port 0|port 1|port 2|port 3|||port 0|port 1|port 2|port 3||
+ * |+------+------+------+------+|+------+------+------+------+|
+ * +-----------------------------+-------^---------------------+
+ *                                ^      |
+ *                                |      --- quad offset*
+ *                                ---- quad number
+ *
+ *   * PHY port 5 is port 1 in quad 1
+ *
  */
 
 /**
index 0a0c55f..b803f2a 100644 (file)
@@ -524,6 +524,7 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
         */
        fltr->rid = rule_added.rid;
        fltr->rule_id = rule_added.rule_id;
+       fltr->dest_id = rule_added.vsi_handle;
 
 exit:
        kfree(list);
@@ -993,7 +994,9 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
                n_proto_key = ntohs(match.key->n_proto);
                n_proto_mask = ntohs(match.mask->n_proto);
 
-               if (n_proto_key == ETH_P_ALL || n_proto_key == 0) {
+               if (n_proto_key == ETH_P_ALL || n_proto_key == 0 ||
+                   fltr->tunnel_type == TNL_GTPU ||
+                   fltr->tunnel_type == TNL_GTPC) {
                        n_proto_key = 0;
                        n_proto_mask = 0;
                } else {
index cd8e6b5..7adf9dd 100644 (file)
@@ -504,6 +504,11 @@ int ice_reset_vf(struct ice_vf *vf, u32 flags)
        }
 
        if (ice_is_vf_disabled(vf)) {
+               vsi = ice_get_vf_vsi(vf);
+               if (WARN_ON(!vsi))
+                       return -EINVAL;
+               ice_vsi_stop_lan_tx_rings(vsi, ICE_NO_RESET, vf->vf_id);
+               ice_vsi_stop_all_rx_rings(vsi);
                dev_dbg(dev, "VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\n",
                        vf->vf_id);
                return 0;
index 1d9b84c..4547bc1 100644 (file)
@@ -1569,35 +1569,27 @@ error_param:
  */
 static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
 {
-       enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;
        struct virtchnl_vsi_queue_config_info *qci =
            (struct virtchnl_vsi_queue_config_info *)msg;
        struct virtchnl_queue_pair_info *qpi;
        struct ice_pf *pf = vf->pf;
        struct ice_vsi *vsi;
-       int i, q_idx;
+       int i = -1, q_idx;
 
-       if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {
-               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+       if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))
                goto error_param;
-       }
 
-       if (!ice_vc_isvalid_vsi_id(vf, qci->vsi_id)) {
-               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+       if (!ice_vc_isvalid_vsi_id(vf, qci->vsi_id))
                goto error_param;
-       }
 
        vsi = ice_get_vf_vsi(vf);
-       if (!vsi) {
-               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+       if (!vsi)
                goto error_param;
-       }
 
        if (qci->num_queue_pairs > ICE_MAX_RSS_QS_PER_VF ||
            qci->num_queue_pairs > min_t(u16, vsi->alloc_txq, vsi->alloc_rxq)) {
                dev_err(ice_pf_to_dev(pf), "VF-%d requesting more than supported number of queues: %d\n",
                        vf->vf_id, min_t(u16, vsi->alloc_txq, vsi->alloc_rxq));
-               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
                goto error_param;
        }
 
@@ -1610,7 +1602,6 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
                    !ice_vc_isvalid_ring_len(qpi->txq.ring_len) ||
                    !ice_vc_isvalid_ring_len(qpi->rxq.ring_len) ||
                    !ice_vc_isvalid_q_id(vf, qci->vsi_id, qpi->txq.queue_id)) {
-                       v_ret = VIRTCHNL_STATUS_ERR_PARAM;
                        goto error_param;
                }
 
@@ -1620,7 +1611,6 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
                 * for selected "vsi"
                 */
                if (q_idx >= vsi->alloc_txq || q_idx >= vsi->alloc_rxq) {
-                       v_ret = VIRTCHNL_STATUS_ERR_PARAM;
                        goto error_param;
                }
 
@@ -1630,14 +1620,13 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
                        vsi->tx_rings[i]->count = qpi->txq.ring_len;
 
                        /* Disable any existing queue first */
-                       if (ice_vf_vsi_dis_single_txq(vf, vsi, q_idx)) {
-                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                       if (ice_vf_vsi_dis_single_txq(vf, vsi, q_idx))
                                goto error_param;
-                       }
 
                        /* Configure a queue with the requested settings */
                        if (ice_vsi_cfg_single_txq(vsi, vsi->tx_rings, q_idx)) {
-                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                               dev_warn(ice_pf_to_dev(pf), "VF-%d failed to configure TX queue %d\n",
+                                        vf->vf_id, i);
                                goto error_param;
                        }
                }
@@ -1651,17 +1640,13 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
 
                        if (qpi->rxq.databuffer_size != 0 &&
                            (qpi->rxq.databuffer_size > ((16 * 1024) - 128) ||
-                            qpi->rxq.databuffer_size < 1024)) {
-                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                            qpi->rxq.databuffer_size < 1024))
                                goto error_param;
-                       }
                        vsi->rx_buf_len = qpi->rxq.databuffer_size;
                        vsi->rx_rings[i]->rx_buf_len = vsi->rx_buf_len;
                        if (qpi->rxq.max_pkt_size > max_frame_size ||
-                           qpi->rxq.max_pkt_size < 64) {
-                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                           qpi->rxq.max_pkt_size < 64)
                                goto error_param;
-                       }
 
                        vsi->max_frame = qpi->rxq.max_pkt_size;
                        /* add space for the port VLAN since the VF driver is
@@ -1672,16 +1657,30 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
                                vsi->max_frame += VLAN_HLEN;
 
                        if (ice_vsi_cfg_single_rxq(vsi, q_idx)) {
-                               v_ret = VIRTCHNL_STATUS_ERR_PARAM;
+                               dev_warn(ice_pf_to_dev(pf), "VF-%d failed to configure RX queue %d\n",
+                                        vf->vf_id, i);
                                goto error_param;
                        }
                }
        }
 
+       /* send the response to the VF */
+       return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES,
+                                    VIRTCHNL_STATUS_SUCCESS, NULL, 0);
 error_param:
+       /* disable whatever we can */
+       for (; i >= 0; i--) {
+               if (ice_vsi_ctrl_one_rx_ring(vsi, false, i, true))
+                       dev_err(ice_pf_to_dev(pf), "VF-%d could not disable RX queue %d\n",
+                               vf->vf_id, i);
+               if (ice_vf_vsi_dis_single_txq(vf, vsi, i))
+                       dev_err(ice_pf_to_dev(pf), "VF-%d could not disable TX queue %d\n",
+                               vf->vf_id, i);
+       }
+
        /* send the response to the VF */
-       return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, v_ret,
-                                    NULL, 0);
+       return ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES,
+                                    VIRTCHNL_STATUS_ERR_PARAM, NULL, 0);
 }
 
 /**
index 68be297..c5f04c4 100644 (file)
@@ -4819,8 +4819,11 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
        while (i != tx_ring->next_to_use) {
                union e1000_adv_tx_desc *eop_desc, *tx_desc;
 
-               /* Free all the Tx ring sk_buffs */
-               dev_kfree_skb_any(tx_buffer->skb);
+               /* Free all the Tx ring sk_buffs or xdp frames */
+               if (tx_buffer->type == IGB_TYPE_SKB)
+                       dev_kfree_skb_any(tx_buffer->skb);
+               else
+                       xdp_return_frame(tx_buffer->xdpf);
 
                /* unmap skb header data */
                dma_unmap_single(tx_ring->dev,
@@ -9898,11 +9901,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
        struct e1000_hw *hw = &adapter->hw;
        u32 dmac_thr;
        u16 hwm;
+       u32 reg;
 
        if (hw->mac.type > e1000_82580) {
                if (adapter->flags & IGB_FLAG_DMAC) {
-                       u32 reg;
-
                        /* force threshold to 0. */
                        wr32(E1000_DMCTXTH, 0);
 
@@ -9935,7 +9937,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
                        /* Disable BMC-to-OS Watchdog Enable */
                        if (hw->mac.type != e1000_i354)
                                reg &= ~E1000_DMACR_DC_BMC2OSW_EN;
-
                        wr32(E1000_DMACR, reg);
 
                        /* no lower threshold to disable
@@ -9952,12 +9953,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
                         */
                        wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE -
                             (IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6);
+               }
 
-                       /* make low power state decision controlled
-                        * by DMA coal
-                        */
+               if (hw->mac.type >= e1000_i210 ||
+                   (adapter->flags & IGB_FLAG_DMAC)) {
                        reg = rd32(E1000_PCIEMISC);
-                       reg &= ~E1000_PCIEMISC_LX_DECISION;
+                       reg |= E1000_PCIEMISC_LX_DECISION;
                        wr32(E1000_PCIEMISC, reg);
                } /* endif adapter->dmac is not disabled */
        } else if (hw->mac.type == e1000_82580) {
index 7f11c0a..d4e63f0 100644 (file)
@@ -1184,9 +1184,9 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
 
        switch (xcast_mode) {
        case IXGBEVF_XCAST_MODE_NONE:
-               disable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
+               disable = IXGBE_VMOLR_ROMPE |
                          IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
-               enable = 0;
+               enable = IXGBE_VMOLR_BAM;
                break;
        case IXGBEVF_XCAST_MODE_MULTI:
                disable = IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
@@ -1208,9 +1208,9 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,
                        return -EPERM;
                }
 
-               disable = 0;
+               disable = IXGBE_VMOLR_VPE;
                enable = IXGBE_VMOLR_BAM | IXGBE_VMOLR_ROMPE |
-                        IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE | IXGBE_VMOLR_VPE;
+                        IXGBE_VMOLR_MPE | IXGBE_VMOLR_UPE;
                break;
        default:
                return -EOPNOTSUPP;
index bc614a4..3f60a80 100644 (file)
@@ -1390,7 +1390,8 @@ static int otx2vf_get_link_ksettings(struct net_device *netdev,
 
 static const struct ethtool_ops otx2vf_ethtool_ops = {
        .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
-                                    ETHTOOL_COALESCE_MAX_FRAMES,
+                                    ETHTOOL_COALESCE_MAX_FRAMES |
+                                    ETHTOOL_COALESCE_USE_ADAPTIVE,
        .supported_ring_params  = ETHTOOL_RING_USE_RX_BUF_LEN |
                                  ETHTOOL_RING_USE_CQE_SIZE,
        .get_link               = otx2_get_link,
index b3b3c07..59c9a10 100644 (file)
@@ -899,6 +899,17 @@ static bool mtk_rx_get_desc(struct mtk_eth *eth, struct mtk_rx_dma_v2 *rxd,
        return true;
 }
 
+static void *mtk_max_lro_buf_alloc(gfp_t gfp_mask)
+{
+       unsigned int size = mtk_max_frag_size(MTK_MAX_LRO_RX_LENGTH);
+       unsigned long data;
+
+       data = __get_free_pages(gfp_mask | __GFP_COMP | __GFP_NOWARN,
+                               get_order(size));
+
+       return (void *)data;
+}
+
 /* the qdma core needs scratch memory to be setup */
 static int mtk_init_fq_dma(struct mtk_eth *eth)
 {
@@ -1467,7 +1478,10 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
                        goto release_desc;
 
                /* alloc new buffer */
-               new_data = napi_alloc_frag(ring->frag_size);
+               if (ring->frag_size <= PAGE_SIZE)
+                       new_data = napi_alloc_frag(ring->frag_size);
+               else
+                       new_data = mtk_max_lro_buf_alloc(GFP_ATOMIC);
                if (unlikely(!new_data)) {
                        netdev->stats.rx_dropped++;
                        goto release_desc;
@@ -1914,7 +1928,10 @@ static int mtk_rx_alloc(struct mtk_eth *eth, int ring_no, int rx_flag)
                return -ENOMEM;
 
        for (i = 0; i < rx_dma_size; i++) {
-               ring->data[i] = netdev_alloc_frag(ring->frag_size);
+               if (ring->frag_size <= PAGE_SIZE)
+                       ring->data[i] = netdev_alloc_frag(ring->frag_size);
+               else
+                       ring->data[i] = mtk_max_lro_buf_alloc(GFP_KERNEL);
                if (!ring->data[i])
                        return -ENOMEM;
        }
index ed5038d..6400a82 100644 (file)
@@ -2110,7 +2110,7 @@ static int mlx4_en_get_module_eeprom(struct net_device *dev,
                        en_err(priv,
                               "mlx4_get_module_info i(%d) offset(%d) bytes_to_read(%d) - FAILED (0x%x)\n",
                               i, offset, ee->len - i, ret);
-                       return 0;
+                       return ret;
                }
 
                i += ret;
index 0eb9d74..50422b5 100644 (file)
@@ -579,17 +579,6 @@ static void *pci_get_other_drvdata(struct device *this, struct device *other)
        return pci_get_drvdata(to_pci_dev(other));
 }
 
-static int next_phys_dev(struct device *dev, const void *data)
-{
-       struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data;
-
-       mdev = pci_get_other_drvdata(this->device, dev);
-       if (!mdev)
-               return 0;
-
-       return _next_phys_dev(mdev, data);
-}
-
 static int next_phys_dev_lag(struct device *dev, const void *data)
 {
        struct mlx5_core_dev *mdev, *this = (struct mlx5_core_dev *)data;
@@ -623,13 +612,6 @@ static struct mlx5_core_dev *mlx5_get_next_dev(struct mlx5_core_dev *dev,
        return pci_get_drvdata(to_pci_dev(next));
 }
 
-/* Must be called with intf_mutex held */
-struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev)
-{
-       lockdep_assert_held(&mlx5_intf_mutex);
-       return mlx5_get_next_dev(dev, &next_phys_dev);
-}
-
 /* Must be called with intf_mutex held */
 struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev)
 {
index eae9aa9..978a2bb 100644 (file)
@@ -675,6 +675,9 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
        if (!tracer->owner)
                return;
 
+       if (unlikely(!tracer->str_db.loaded))
+               goto arm;
+
        block_count = tracer->buff.size / TRACER_BLOCK_SIZE_BYTE;
        start_offset = tracer->buff.consumer_index * TRACER_BLOCK_SIZE_BYTE;
 
@@ -732,6 +735,7 @@ static void mlx5_fw_tracer_handle_traces(struct work_struct *work)
                                                      &tmp_trace_block[TRACES_PER_BLOCK - 1]);
        }
 
+arm:
        mlx5_fw_tracer_arm(dev);
 }
 
@@ -1136,8 +1140,7 @@ static int fw_tracer_event(struct notifier_block *nb, unsigned long action, void
                queue_work(tracer->work_queue, &tracer->ownership_change_work);
                break;
        case MLX5_TRACER_SUBTYPE_TRACES_AVAILABLE:
-               if (likely(tracer->str_db.loaded))
-                       queue_work(tracer->work_queue, &tracer->handle_traces_work);
+               queue_work(tracer->work_queue, &tracer->handle_traces_work);
                break;
        default:
                mlx5_core_dbg(dev, "FWTracer: Event with unrecognized subtype: sub_type %d\n",
index 6836448..3c1edfa 100644 (file)
@@ -565,7 +565,8 @@ static void mlx5e_build_rx_cq_param(struct mlx5_core_dev *mdev,
 static u8 rq_end_pad_mode(struct mlx5_core_dev *mdev, struct mlx5e_params *params)
 {
        bool lro_en = params->packet_merge.type == MLX5E_PACKET_MERGE_LRO;
-       bool ro = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
+       bool ro = pcie_relaxed_ordering_enabled(mdev->pdev) &&
+               MLX5_CAP_GEN(mdev, relaxed_ordering_write);
 
        return ro && lro_en ?
                MLX5_WQ_END_PAD_MODE_NONE : MLX5_WQ_END_PAD_MODE_ALIGN;
index 43a536c..c0f409c 100644 (file)
 
 void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc)
 {
+       bool ro_pci_enable = pcie_relaxed_ordering_enabled(mdev->pdev);
        bool ro_write = MLX5_CAP_GEN(mdev, relaxed_ordering_write);
        bool ro_read = MLX5_CAP_GEN(mdev, relaxed_ordering_read);
 
-       MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_read);
-       MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_write);
+       MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_pci_enable && ro_read);
+       MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_pci_enable && ro_write);
 }
 
 static int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn,
index eb90e79..f797fd9 100644 (file)
@@ -950,6 +950,13 @@ err_event_reg:
        return err;
 }
 
+static void mlx5e_cleanup_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
+{
+       mlx5e_rep_tc_netdevice_event_unregister(rpriv);
+       mlx5e_rep_bond_cleanup(rpriv);
+       mlx5e_rep_tc_cleanup(rpriv);
+}
+
 static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
 {
        struct mlx5e_rep_priv *rpriv = priv->ppriv;
@@ -961,42 +968,36 @@ static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
                return err;
        }
 
-       err = mlx5e_tc_ht_init(&rpriv->tc_ht);
-       if (err)
-               goto err_ht_init;
-
        if (rpriv->rep->vport == MLX5_VPORT_UPLINK) {
                err = mlx5e_init_uplink_rep_tx(rpriv);
                if (err)
                        goto err_init_tx;
        }
 
+       err = mlx5e_tc_ht_init(&rpriv->tc_ht);
+       if (err)
+               goto err_ht_init;
+
        return 0;
 
-err_init_tx:
-       mlx5e_tc_ht_cleanup(&rpriv->tc_ht);
 err_ht_init:
+       if (rpriv->rep->vport == MLX5_VPORT_UPLINK)
+               mlx5e_cleanup_uplink_rep_tx(rpriv);
+err_init_tx:
        mlx5e_destroy_tises(priv);
        return err;
 }
 
-static void mlx5e_cleanup_uplink_rep_tx(struct mlx5e_rep_priv *rpriv)
-{
-       mlx5e_rep_tc_netdevice_event_unregister(rpriv);
-       mlx5e_rep_bond_cleanup(rpriv);
-       mlx5e_rep_tc_cleanup(rpriv);
-}
-
 static void mlx5e_cleanup_rep_tx(struct mlx5e_priv *priv)
 {
        struct mlx5e_rep_priv *rpriv = priv->ppriv;
 
-       mlx5e_destroy_tises(priv);
+       mlx5e_tc_ht_cleanup(&rpriv->tc_ht);
 
        if (rpriv->rep->vport == MLX5_VPORT_UPLINK)
                mlx5e_cleanup_uplink_rep_tx(rpriv);
 
-       mlx5e_tc_ht_cleanup(&rpriv->tc_ht);
+       mlx5e_destroy_tises(priv);
 }
 
 static void mlx5e_rep_enable(struct mlx5e_priv *priv)
index 217cac2..2ce3728 100644 (file)
@@ -2690,9 +2690,6 @@ static int mlx5_esw_offloads_devcom_event(int event,
 
        switch (event) {
        case ESW_OFFLOADS_DEVCOM_PAIR:
-               if (mlx5_get_next_phys_dev(esw->dev) != peer_esw->dev)
-                       break;
-
                if (mlx5_eswitch_vport_match_metadata_enabled(esw) !=
                    mlx5_eswitch_vport_match_metadata_enabled(peer_esw))
                        break;
@@ -2744,6 +2741,9 @@ static void esw_offloads_devcom_init(struct mlx5_eswitch *esw)
        if (!MLX5_CAP_ESW(esw->dev, merged_eswitch))
                return;
 
+       if (!mlx5_is_lag_supported(esw->dev))
+               return;
+
        mlx5_devcom_register_component(devcom,
                                       MLX5_DEVCOM_ESW_OFFLOADS,
                                       mlx5_esw_offloads_devcom_event,
@@ -2761,6 +2761,9 @@ static void esw_offloads_devcom_cleanup(struct mlx5_eswitch *esw)
        if (!MLX5_CAP_ESW(esw->dev, merged_eswitch))
                return;
 
+       if (!mlx5_is_lag_supported(esw->dev))
+               return;
+
        mlx5_devcom_send_event(devcom, MLX5_DEVCOM_ESW_OFFLOADS,
                               ESW_OFFLOADS_DEVCOM_UNPAIR, esw);
 
index fdcf7f5..21e5c70 100644 (file)
@@ -1574,9 +1574,22 @@ static struct mlx5_flow_rule *find_flow_rule(struct fs_fte *fte,
        return NULL;
 }
 
-static bool check_conflicting_actions(u32 action1, u32 action2)
+static bool check_conflicting_actions_vlan(const struct mlx5_fs_vlan *vlan0,
+                                          const struct mlx5_fs_vlan *vlan1)
 {
-       u32 xored_actions = action1 ^ action2;
+       return vlan0->ethtype != vlan1->ethtype ||
+              vlan0->vid != vlan1->vid ||
+              vlan0->prio != vlan1->prio;
+}
+
+static bool check_conflicting_actions(const struct mlx5_flow_act *act1,
+                                     const struct mlx5_flow_act *act2)
+{
+       u32 action1 = act1->action;
+       u32 action2 = act2->action;
+       u32 xored_actions;
+
+       xored_actions = action1 ^ action2;
 
        /* if one rule only wants to count, it's ok */
        if (action1 == MLX5_FLOW_CONTEXT_ACTION_COUNT ||
@@ -1593,6 +1606,22 @@ static bool check_conflicting_actions(u32 action1, u32 action2)
                             MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2))
                return true;
 
+       if (action1 & MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT &&
+           act1->pkt_reformat != act2->pkt_reformat)
+               return true;
+
+       if (action1 & MLX5_FLOW_CONTEXT_ACTION_MOD_HDR &&
+           act1->modify_hdr != act2->modify_hdr)
+               return true;
+
+       if (action1 & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH &&
+           check_conflicting_actions_vlan(&act1->vlan[0], &act2->vlan[0]))
+               return true;
+
+       if (action1 & MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2 &&
+           check_conflicting_actions_vlan(&act1->vlan[1], &act2->vlan[1]))
+               return true;
+
        return false;
 }
 
@@ -1600,7 +1629,7 @@ static int check_conflicting_ftes(struct fs_fte *fte,
                                  const struct mlx5_flow_context *flow_context,
                                  const struct mlx5_flow_act *flow_act)
 {
-       if (check_conflicting_actions(flow_act->action, fte->action.action)) {
+       if (check_conflicting_actions(flow_act, &fte->action)) {
                mlx5_core_warn(get_dev(&fte->node),
                               "Found two FTEs with conflicting actions\n");
                return -EEXIST;
index 552b6e2..2a8fc54 100644 (file)
@@ -783,7 +783,7 @@ static void mlx5_do_bond(struct mlx5_lag *ldev)
 {
        struct mlx5_core_dev *dev0 = ldev->pf[MLX5_LAG_P1].dev;
        struct mlx5_core_dev *dev1 = ldev->pf[MLX5_LAG_P2].dev;
-       struct lag_tracker tracker;
+       struct lag_tracker tracker = { };
        bool do_bond, roce_lag;
        int err;
        int i;
index 72f70fa..c81b173 100644 (file)
@@ -74,6 +74,16 @@ struct mlx5_lag {
        struct lag_mpesw          lag_mpesw;
 };
 
+static inline bool mlx5_is_lag_supported(struct mlx5_core_dev *dev)
+{
+       if (!MLX5_CAP_GEN(dev, vport_group_manager) ||
+           !MLX5_CAP_GEN(dev, lag_master) ||
+           MLX5_CAP_GEN(dev, num_lag_ports) < 2 ||
+           MLX5_CAP_GEN(dev, num_lag_ports) > MLX5_MAX_PORTS)
+               return false;
+       return true;
+}
+
 static inline struct mlx5_lag *
 mlx5_lag_dev(struct mlx5_core_dev *dev)
 {
index 484cb1e..9cc7afe 100644 (file)
@@ -209,7 +209,6 @@ int mlx5_attach_device(struct mlx5_core_dev *dev);
 void mlx5_detach_device(struct mlx5_core_dev *dev);
 int mlx5_register_device(struct mlx5_core_dev *dev);
 void mlx5_unregister_device(struct mlx5_core_dev *dev);
-struct mlx5_core_dev *mlx5_get_next_phys_dev(struct mlx5_core_dev *dev);
 struct mlx5_core_dev *mlx5_get_next_phys_dev_lag(struct mlx5_core_dev *dev);
 void mlx5_dev_list_lock(void);
 void mlx5_dev_list_unlock(void);
index a68d931..15c8d4d 100644 (file)
@@ -8,8 +8,8 @@
 #include "spectrum.h"
 
 enum mlxsw_sp_counter_sub_pool_id {
-       MLXSW_SP_COUNTER_SUB_POOL_FLOW,
        MLXSW_SP_COUNTER_SUB_POOL_RIF,
+       MLXSW_SP_COUNTER_SUB_POOL_FLOW,
 };
 
 int mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp,
index 443a5d6..7c31a46 100644 (file)
@@ -507,6 +507,11 @@ nfp_fl_calc_key_layers_sz(struct nfp_fl_key_ls in_key_ls, uint16_t *map)
                key_size += sizeof(struct nfp_flower_ipv6);
        }
 
+       if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_QINQ) {
+               map[FLOW_PAY_QINQ] = key_size;
+               key_size += sizeof(struct nfp_flower_vlan);
+       }
+
        if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_GRE) {
                map[FLOW_PAY_GRE] = key_size;
                if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_TUN_IPV6)
@@ -515,11 +520,6 @@ nfp_fl_calc_key_layers_sz(struct nfp_fl_key_ls in_key_ls, uint16_t *map)
                        key_size += sizeof(struct nfp_flower_ipv4_gre_tun);
        }
 
-       if (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_QINQ) {
-               map[FLOW_PAY_QINQ] = key_size;
-               key_size += sizeof(struct nfp_flower_vlan);
-       }
-
        if ((in_key_ls.key_layer & NFP_FLOWER_LAYER_VXLAN) ||
            (in_key_ls.key_layer_two & NFP_FLOWER_LAYER2_GENEVE)) {
                map[FLOW_PAY_UDP_TUN] = key_size;
@@ -758,6 +758,17 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry)
                }
        }
 
+       if (NFP_FLOWER_LAYER2_QINQ & key_layer.key_layer_two) {
+               offset = key_map[FLOW_PAY_QINQ];
+               key = kdata + offset;
+               msk = mdata + offset;
+               for (i = 0; i < _CT_TYPE_MAX; i++) {
+                       nfp_flower_compile_vlan((struct nfp_flower_vlan *)key,
+                                               (struct nfp_flower_vlan *)msk,
+                                               rules[i]);
+               }
+       }
+
        if (key_layer.key_layer_two & NFP_FLOWER_LAYER2_GRE) {
                offset = key_map[FLOW_PAY_GRE];
                key = kdata + offset;
@@ -798,17 +809,6 @@ static int nfp_fl_ct_add_offload(struct nfp_fl_nft_tc_merge *m_entry)
                }
        }
 
-       if (NFP_FLOWER_LAYER2_QINQ & key_layer.key_layer_two) {
-               offset = key_map[FLOW_PAY_QINQ];
-               key = kdata + offset;
-               msk = mdata + offset;
-               for (i = 0; i < _CT_TYPE_MAX; i++) {
-                       nfp_flower_compile_vlan((struct nfp_flower_vlan *)key,
-                                               (struct nfp_flower_vlan *)msk,
-                                               rules[i]);
-               }
-       }
-
        if (key_layer.key_layer & NFP_FLOWER_LAYER_VXLAN ||
            key_layer.key_layer_two & NFP_FLOWER_LAYER2_GENEVE) {
                offset = key_map[FLOW_PAY_UDP_TUN];
index 193a167..e014301 100644 (file)
@@ -625,6 +625,14 @@ int nfp_flower_compile_flow_match(struct nfp_app *app,
                msk += sizeof(struct nfp_flower_ipv6);
        }
 
+       if (NFP_FLOWER_LAYER2_QINQ & key_ls->key_layer_two) {
+               nfp_flower_compile_vlan((struct nfp_flower_vlan *)ext,
+                                       (struct nfp_flower_vlan *)msk,
+                                       rule);
+               ext += sizeof(struct nfp_flower_vlan);
+               msk += sizeof(struct nfp_flower_vlan);
+       }
+
        if (key_ls->key_layer_two & NFP_FLOWER_LAYER2_GRE) {
                if (key_ls->key_layer_two & NFP_FLOWER_LAYER2_TUN_IPV6) {
                        struct nfp_flower_ipv6_gre_tun *gre_match;
@@ -660,14 +668,6 @@ int nfp_flower_compile_flow_match(struct nfp_app *app,
                }
        }
 
-       if (NFP_FLOWER_LAYER2_QINQ & key_ls->key_layer_two) {
-               nfp_flower_compile_vlan((struct nfp_flower_vlan *)ext,
-                                       (struct nfp_flower_vlan *)msk,
-                                       rule);
-               ext += sizeof(struct nfp_flower_vlan);
-               msk += sizeof(struct nfp_flower_vlan);
-       }
-
        if (key_ls->key_layer & NFP_FLOWER_LAYER_VXLAN ||
            key_ls->key_layer_two & NFP_FLOWER_LAYER2_GENEVE) {
                if (key_ls->key_layer_two & NFP_FLOWER_LAYER2_TUN_IPV6) {
index 54af309..6eeeb0f 100644 (file)
@@ -15,7 +15,7 @@
 #include "nfp_net_sriov.h"
 
 static int
-nfp_net_sriov_check(struct nfp_app *app, int vf, u16 cap, const char *msg)
+nfp_net_sriov_check(struct nfp_app *app, int vf, u16 cap, const char *msg, bool warn)
 {
        u16 cap_vf;
 
@@ -24,12 +24,14 @@ nfp_net_sriov_check(struct nfp_app *app, int vf, u16 cap, const char *msg)
 
        cap_vf = readw(app->pf->vfcfg_tbl2 + NFP_NET_VF_CFG_MB_CAP);
        if ((cap_vf & cap) != cap) {
-               nfp_warn(app->pf->cpp, "ndo_set_vf_%s not supported\n", msg);
+               if (warn)
+                       nfp_warn(app->pf->cpp, "ndo_set_vf_%s not supported\n", msg);
                return -EOPNOTSUPP;
        }
 
        if (vf < 0 || vf >= app->pf->num_vfs) {
-               nfp_warn(app->pf->cpp, "invalid VF id %d\n", vf);
+               if (warn)
+                       nfp_warn(app->pf->cpp, "invalid VF id %d\n", vf);
                return -EINVAL;
        }
 
@@ -65,7 +67,7 @@ int nfp_app_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
        unsigned int vf_offset;
        int err;
 
-       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_MAC, "mac");
+       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_MAC, "mac", true);
        if (err)
                return err;
 
@@ -101,7 +103,7 @@ int nfp_app_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
        u32 vlan_tag;
        int err;
 
-       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN, "vlan");
+       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN, "vlan", true);
        if (err)
                return err;
 
@@ -115,7 +117,7 @@ int nfp_app_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
        }
 
        /* Check if fw supports or not */
-       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto");
+       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto", true);
        if (err)
                is_proto_sup = false;
 
@@ -149,7 +151,7 @@ int nfp_app_set_vf_rate(struct net_device *netdev, int vf,
        u32 vf_offset, ratevalue;
        int err;
 
-       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate");
+       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate", true);
        if (err)
                return err;
 
@@ -181,7 +183,7 @@ int nfp_app_set_vf_spoofchk(struct net_device *netdev, int vf, bool enable)
        int err;
 
        err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_SPOOF,
-                                 "spoofchk");
+                                 "spoofchk", true);
        if (err)
                return err;
 
@@ -205,7 +207,7 @@ int nfp_app_set_vf_trust(struct net_device *netdev, int vf, bool enable)
        int err;
 
        err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_TRUST,
-                                 "trust");
+                                 "trust", true);
        if (err)
                return err;
 
@@ -230,7 +232,7 @@ int nfp_app_set_vf_link_state(struct net_device *netdev, int vf,
        int err;
 
        err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_LINK_STATE,
-                                 "link_state");
+                                 "link_state", true);
        if (err)
                return err;
 
@@ -265,7 +267,7 @@ int nfp_app_get_vf_config(struct net_device *netdev, int vf,
        u8 flags;
        int err;
 
-       err = nfp_net_sriov_check(app, vf, 0, "");
+       err = nfp_net_sriov_check(app, vf, 0, "", true);
        if (err)
                return err;
 
@@ -285,13 +287,13 @@ int nfp_app_get_vf_config(struct net_device *netdev, int vf,
 
        ivi->vlan = FIELD_GET(NFP_NET_VF_CFG_VLAN_VID, vlan_tag);
        ivi->qos = FIELD_GET(NFP_NET_VF_CFG_VLAN_QOS, vlan_tag);
-       if (!nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto"))
+       if (!nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_VLAN_PROTO, "vlan_proto", false))
                ivi->vlan_proto = htons(FIELD_GET(NFP_NET_VF_CFG_VLAN_PROT, vlan_tag));
        ivi->spoofchk = FIELD_GET(NFP_NET_VF_CFG_CTRL_SPOOF, flags);
        ivi->trusted = FIELD_GET(NFP_NET_VF_CFG_CTRL_TRUST, flags);
        ivi->linkstate = FIELD_GET(NFP_NET_VF_CFG_CTRL_LINK_STATE, flags);
 
-       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate");
+       err = nfp_net_sriov_check(app, vf, NFP_NET_VF_CFG_MB_CAP_RATE, "rate", false);
        if (!err) {
                rate = readl(app->pf->vfcfg_tbl2 + vf_offset +
                             NFP_NET_VF_CFG_RATE);
index f9f8093..38fe77d 100644 (file)
@@ -1072,13 +1072,11 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
 
        ret = stmmac_dvr_probe(&pdev->dev, plat, &res);
        if (ret) {
-               goto err_dvr_probe;
+               goto err_alloc_irq;
        }
 
        return 0;
 
-err_dvr_probe:
-       pci_free_irq_vectors(pdev);
 err_alloc_irq:
        clk_disable_unprepare(plat->stmmac_clk);
        clk_unregister_fixed_rate(plat->stmmac_clk);
index 4225efb..f2e2261 100644 (file)
@@ -547,6 +547,57 @@ static inline void axienet_iow(struct axienet_local *lp, off_t offset,
        iowrite32(value, lp->regs + offset);
 }
 
+/**
+ * axienet_dma_out32 - Memory mapped Axi DMA register write.
+ * @lp:                Pointer to axienet local structure
+ * @reg:       Address offset from the base address of the Axi DMA core
+ * @value:     Value to be written into the Axi DMA register
+ *
+ * This function writes the desired value into the corresponding Axi DMA
+ * register.
+ */
+
+static inline void axienet_dma_out32(struct axienet_local *lp,
+                                    off_t reg, u32 value)
+{
+       iowrite32(value, lp->dma_regs + reg);
+}
+
+#if defined(CONFIG_64BIT) && defined(iowrite64)
+/**
+ * axienet_dma_out64 - Memory mapped Axi DMA register write.
+ * @lp:                Pointer to axienet local structure
+ * @reg:       Address offset from the base address of the Axi DMA core
+ * @value:     Value to be written into the Axi DMA register
+ *
+ * This function writes the desired value into the corresponding Axi DMA
+ * register.
+ */
+static inline void axienet_dma_out64(struct axienet_local *lp,
+                                    off_t reg, u64 value)
+{
+       iowrite64(value, lp->dma_regs + reg);
+}
+
+static inline void axienet_dma_out_addr(struct axienet_local *lp, off_t reg,
+                                       dma_addr_t addr)
+{
+       if (lp->features & XAE_FEATURE_DMA_64BIT)
+               axienet_dma_out64(lp, reg, addr);
+       else
+               axienet_dma_out32(lp, reg, lower_32_bits(addr));
+}
+
+#else /* CONFIG_64BIT */
+
+static inline void axienet_dma_out_addr(struct axienet_local *lp, off_t reg,
+                                dma_addr_t addr)
+{
+       axienet_dma_out32(lp, reg, lower_32_bits(addr));
+}
+
+#endif /* CONFIG_64BIT */
+
 /* Function prototypes visible in xilinx_axienet_mdio.c for other files */
 int axienet_mdio_enable(struct axienet_local *lp);
 void axienet_mdio_disable(struct axienet_local *lp);
index 93c9f30..1760930 100644 (file)
@@ -133,30 +133,6 @@ static inline u32 axienet_dma_in32(struct axienet_local *lp, off_t reg)
        return ioread32(lp->dma_regs + reg);
 }
 
-/**
- * axienet_dma_out32 - Memory mapped Axi DMA register write.
- * @lp:                Pointer to axienet local structure
- * @reg:       Address offset from the base address of the Axi DMA core
- * @value:     Value to be written into the Axi DMA register
- *
- * This function writes the desired value into the corresponding Axi DMA
- * register.
- */
-static inline void axienet_dma_out32(struct axienet_local *lp,
-                                    off_t reg, u32 value)
-{
-       iowrite32(value, lp->dma_regs + reg);
-}
-
-static void axienet_dma_out_addr(struct axienet_local *lp, off_t reg,
-                                dma_addr_t addr)
-{
-       axienet_dma_out32(lp, reg, lower_32_bits(addr));
-
-       if (lp->features & XAE_FEATURE_DMA_64BIT)
-               axienet_dma_out32(lp, reg + 4, upper_32_bits(addr));
-}
-
 static void desc_set_phys_addr(struct axienet_local *lp, dma_addr_t addr,
                               struct axidma_bd *desc)
 {
@@ -2061,6 +2037,11 @@ static int axienet_probe(struct platform_device *pdev)
                        iowrite32(0x0, desc);
                }
        }
+       if (!IS_ENABLED(CONFIG_64BIT) && lp->features & XAE_FEATURE_DMA_64BIT) {
+               dev_err(&pdev->dev, "64-bit addressable DMA is not compatible with 32-bit archecture\n");
+               ret = -EINVAL;
+               goto cleanup_clk;
+       }
 
        ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(addr_width));
        if (ret) {
index 45c3c4a..9fb5675 100644 (file)
@@ -99,6 +99,7 @@ struct sixpack {
 
        unsigned int            rx_count;
        unsigned int            rx_count_cooked;
+       spinlock_t              rxlock;
 
        int                     mtu;            /* Our mtu (to spot changes!) */
        int                     buffsize;       /* Max buffers sizes */
@@ -565,6 +566,7 @@ static int sixpack_open(struct tty_struct *tty)
        sp->dev = dev;
 
        spin_lock_init(&sp->lock);
+       spin_lock_init(&sp->rxlock);
        refcount_set(&sp->refcnt, 1);
        init_completion(&sp->dead);
 
@@ -913,6 +915,7 @@ static void decode_std_command(struct sixpack *sp, unsigned char cmd)
                        sp->led_state = 0x60;
                        /* fill trailing bytes with zeroes */
                        sp->tty->ops->write(sp->tty, &sp->led_state, 1);
+                       spin_lock_bh(&sp->rxlock);
                        rest = sp->rx_count;
                        if (rest != 0)
                                 for (i = rest; i <= 3; i++)
@@ -930,6 +933,7 @@ static void decode_std_command(struct sixpack *sp, unsigned char cmd)
                                sp_bump(sp, 0);
                        }
                        sp->rx_count_cooked = 0;
+                       spin_unlock_bh(&sp->rxlock);
                }
                break;
        case SIXP_TX_URUN: printk(KERN_DEBUG "6pack: TX underrun\n");
@@ -959,8 +963,11 @@ sixpack_decode(struct sixpack *sp, const unsigned char *pre_rbuff, int count)
                        decode_prio_command(sp, inbyte);
                else if ((inbyte & SIXP_STD_CMD_MASK) != 0)
                        decode_std_command(sp, inbyte);
-               else if ((sp->status & SIXP_RX_DCD_MASK) == SIXP_RX_DCD_MASK)
+               else if ((sp->status & SIXP_RX_DCD_MASK) == SIXP_RX_DCD_MASK) {
+                       spin_lock_bh(&sp->rxlock);
                        decode_data(sp, inbyte);
+                       spin_unlock_bh(&sp->rxlock);
+               }
        }
 }
 
index a8db1a1..c7047f5 100644 (file)
@@ -34,6 +34,8 @@
 #define MDIO_AN_VEND_PROV                      0xc400
 #define MDIO_AN_VEND_PROV_1000BASET_FULL       BIT(15)
 #define MDIO_AN_VEND_PROV_1000BASET_HALF       BIT(14)
+#define MDIO_AN_VEND_PROV_5000BASET_FULL       BIT(11)
+#define MDIO_AN_VEND_PROV_2500BASET_FULL       BIT(10)
 #define MDIO_AN_VEND_PROV_DOWNSHIFT_EN         BIT(4)
 #define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK       GENMASK(3, 0)
 #define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT       4
@@ -231,9 +233,20 @@ static int aqr_config_aneg(struct phy_device *phydev)
                              phydev->advertising))
                reg |= MDIO_AN_VEND_PROV_1000BASET_HALF;
 
+       /* Handle the case when the 2.5G and 5G speeds are not advertised */
+       if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+                             phydev->advertising))
+               reg |= MDIO_AN_VEND_PROV_2500BASET_FULL;
+
+       if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
+                             phydev->advertising))
+               reg |= MDIO_AN_VEND_PROV_5000BASET_FULL;
+
        ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV,
                                     MDIO_AN_VEND_PROV_1000BASET_HALF |
-                                    MDIO_AN_VEND_PROV_1000BASET_FULL, reg);
+                                    MDIO_AN_VEND_PROV_1000BASET_FULL |
+                                    MDIO_AN_VEND_PROV_2500BASET_FULL |
+                                    MDIO_AN_VEND_PROV_5000BASET_FULL, reg);
        if (ret < 0)
                return ret;
        if (ret > 0)
index 6a467e7..59fe356 100644 (file)
@@ -2072,6 +2072,8 @@ static struct phy_driver at803x_driver[] = {
        /* ATHEROS AR9331 */
        PHY_ID_MATCH_EXACT(ATH9331_PHY_ID),
        .name                   = "Qualcomm Atheros AR9331 built-in PHY",
+       .probe                  = at803x_probe,
+       .remove                 = at803x_remove,
        .suspend                = at803x_suspend,
        .resume                 = at803x_resume,
        .flags                  = PHY_POLL_CABLE_TEST,
@@ -2087,6 +2089,8 @@ static struct phy_driver at803x_driver[] = {
        /* Qualcomm Atheros QCA9561 */
        PHY_ID_MATCH_EXACT(QCA9561_PHY_ID),
        .name                   = "Qualcomm Atheros QCA9561 built-in PHY",
+       .probe                  = at803x_probe,
+       .remove                 = at803x_remove,
        .suspend                = at803x_suspend,
        .resume                 = at803x_resume,
        .flags                  = PHY_POLL_CABLE_TEST,
@@ -2151,6 +2155,8 @@ static struct phy_driver at803x_driver[] = {
        PHY_ID_MATCH_EXACT(QCA8081_PHY_ID),
        .name                   = "Qualcomm QCA8081",
        .flags                  = PHY_POLL_CABLE_TEST,
+       .probe                  = at803x_probe,
+       .remove                 = at803x_remove,
        .config_intr            = at803x_config_intr,
        .handle_interrupt       = at803x_handle_interrupt,
        .get_tunable            = at803x_get_tunable,
index 8561f2d..13dafe7 100644 (file)
 #define DP83867_DOWNSHIFT_2_COUNT      2
 #define DP83867_DOWNSHIFT_4_COUNT      4
 #define DP83867_DOWNSHIFT_8_COUNT      8
+#define DP83867_SGMII_AUTONEG_EN       BIT(7)
 
 /* CFG3 bits */
 #define DP83867_CFG3_INT_OE                    BIT(7)
@@ -855,6 +856,32 @@ static int dp83867_phy_reset(struct phy_device *phydev)
                         DP83867_PHYCR_FORCE_LINK_GOOD, 0);
 }
 
+static void dp83867_link_change_notify(struct phy_device *phydev)
+{
+       /* There is a limitation in DP83867 PHY device where SGMII AN is
+        * only triggered once after the device is booted up. Even after the
+        * PHY TPI is down and up again, SGMII AN is not triggered and
+        * hence no new in-band message from PHY to MAC side SGMII.
+        * This could cause an issue during power up, when PHY is up prior
+        * to MAC. At this condition, once MAC side SGMII is up, MAC side
+        * SGMII wouldn`t receive new in-band message from TI PHY with
+        * correct link status, speed and duplex info.
+        * Thus, implemented a SW solution here to retrigger SGMII Auto-Neg
+        * whenever there is a link change.
+        */
+       if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+               int val = 0;
+
+               val = phy_clear_bits(phydev, DP83867_CFG2,
+                                    DP83867_SGMII_AUTONEG_EN);
+               if (val < 0)
+                       return;
+
+               phy_set_bits(phydev, DP83867_CFG2,
+                            DP83867_SGMII_AUTONEG_EN);
+       }
+}
+
 static struct phy_driver dp83867_driver[] = {
        {
                .phy_id         = DP83867_PHY_ID,
@@ -879,6 +906,8 @@ static struct phy_driver dp83867_driver[] = {
 
                .suspend        = genphy_suspend,
                .resume         = genphy_resume,
+
+               .link_change_notify = dp83867_link_change_notify,
        },
 };
 module_phy_driver(dp83867_driver);
index 58d6029..8a2dbe8 100644 (file)
@@ -1046,7 +1046,6 @@ int __init mdio_bus_init(void)
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(mdio_bus_init);
 
 #if IS_ENABLED(CONFIG_PHYLIB)
 void mdio_bus_exit(void)
index 1b54684..96d3c40 100644 (file)
@@ -110,7 +110,7 @@ static int smsc_phy_config_init(struct phy_device *phydev)
        struct smsc_phy_priv *priv = phydev->priv;
        int rc;
 
-       if (!priv->energy_enable)
+       if (!priv->energy_enable || phydev->irq != PHY_POLL)
                return 0;
 
        rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
@@ -210,6 +210,8 @@ static int lan95xx_config_aneg_ext(struct phy_device *phydev)
  * response on link pulses to detect presence of plugged Ethernet cable.
  * The Energy Detect Power-Down mode is enabled again in the end of procedure to
  * save approximately 220 mW of power if cable is unplugged.
+ * The workaround is only applicable to poll mode. Energy Detect Power-Down may
+ * not be used in interrupt mode lest link change detection becomes unreliable.
  */
 static int lan87xx_read_status(struct phy_device *phydev)
 {
@@ -217,7 +219,7 @@ static int lan87xx_read_status(struct phy_device *phydev)
 
        int err = genphy_read_status(phydev);
 
-       if (!phydev->link && priv->energy_enable) {
+       if (!phydev->link && priv->energy_enable && phydev->irq == PHY_POLL) {
                /* Disable EDPD to wake up PHY */
                int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
                if (rc < 0)
index 7a8c11a..4704ed6 100644 (file)
@@ -1750,7 +1750,7 @@ static const struct driver_info ax88179_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1763,7 +1763,7 @@ static const struct driver_info ax88178a_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1776,7 +1776,7 @@ static const struct driver_info cypress_GX3_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1789,7 +1789,7 @@ static const struct driver_info dlink_dub1312_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1802,7 +1802,7 @@ static const struct driver_info sitecom_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1815,7 +1815,7 @@ static const struct driver_info samsung_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1828,7 +1828,7 @@ static const struct driver_info lenovo_info = {
        .link_reset = ax88179_link_reset,
        .reset = ax88179_reset,
        .stop = ax88179_stop,
-       .flags = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1841,7 +1841,7 @@ static const struct driver_info belkin_info = {
        .link_reset = ax88179_link_reset,
        .reset  = ax88179_reset,
        .stop   = ax88179_stop,
-       .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags  = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1854,7 +1854,7 @@ static const struct driver_info toshiba_info = {
        .link_reset = ax88179_link_reset,
        .reset  = ax88179_reset,
        .stop = ax88179_stop,
-       .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags  = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1867,7 +1867,7 @@ static const struct driver_info mct_info = {
        .link_reset = ax88179_link_reset,
        .reset  = ax88179_reset,
        .stop   = ax88179_stop,
-       .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags  = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1880,7 +1880,7 @@ static const struct driver_info at_umc2000_info = {
        .link_reset = ax88179_link_reset,
        .reset  = ax88179_reset,
        .stop   = ax88179_stop,
-       .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags  = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1893,7 +1893,7 @@ static const struct driver_info at_umc200_info = {
        .link_reset = ax88179_link_reset,
        .reset  = ax88179_reset,
        .stop   = ax88179_stop,
-       .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags  = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
@@ -1906,7 +1906,7 @@ static const struct driver_info at_umc2000sp_info = {
        .link_reset = ax88179_link_reset,
        .reset  = ax88179_reset,
        .stop   = ax88179_stop,
-       .flags  = FLAG_ETHER | FLAG_FRAMING_AX,
+       .flags  = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
        .rx_fixup = ax88179_rx_fixup,
        .tx_fixup = ax88179_tx_fixup,
 };
index 466da01..2cb833b 100644 (file)
@@ -312,6 +312,7 @@ static bool veth_skb_is_eligible_for_gro(const struct net_device *dev,
 static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct veth_priv *rcv_priv, *priv = netdev_priv(dev);
+       struct netdev_queue *queue = NULL;
        struct veth_rq *rq = NULL;
        struct net_device *rcv;
        int length = skb->len;
@@ -329,6 +330,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
        rxq = skb_get_queue_mapping(skb);
        if (rxq < rcv->real_num_rx_queues) {
                rq = &rcv_priv->rq[rxq];
+               queue = netdev_get_tx_queue(dev, rxq);
 
                /* The napi pointer is available when an XDP program is
                 * attached or when GRO is enabled
@@ -340,6 +342,8 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
 
        skb_tx_timestamp(skb);
        if (likely(veth_forward_skb(rcv, skb, rq, use_napi) == NET_RX_SUCCESS)) {
+               if (queue)
+                       txq_trans_cond_update(queue);
                if (!use_napi)
                        dev_lstats_add(dev, length);
        } else {
index db05b5e..969a679 100644 (file)
@@ -2768,7 +2768,6 @@ static const struct ethtool_ops virtnet_ethtool_ops = {
 static void virtnet_freeze_down(struct virtio_device *vdev)
 {
        struct virtnet_info *vi = vdev->priv;
-       int i;
 
        /* Make sure no work handler is accessing the device */
        flush_work(&vi->config_work);
@@ -2776,14 +2775,8 @@ static void virtnet_freeze_down(struct virtio_device *vdev)
        netif_tx_lock_bh(vi->dev);
        netif_device_detach(vi->dev);
        netif_tx_unlock_bh(vi->dev);
-       cancel_delayed_work_sync(&vi->refill);
-
-       if (netif_running(vi->dev)) {
-               for (i = 0; i < vi->max_queue_pairs; i++) {
-                       napi_disable(&vi->rq[i].napi);
-                       virtnet_napi_tx_disable(&vi->sq[i].napi);
-               }
-       }
+       if (netif_running(vi->dev))
+               virtnet_close(vi->dev);
 }
 
 static int init_vqs(struct virtnet_info *vi);
@@ -2791,7 +2784,7 @@ static int init_vqs(struct virtnet_info *vi);
 static int virtnet_restore_up(struct virtio_device *vdev)
 {
        struct virtnet_info *vi = vdev->priv;
-       int err, i;
+       int err;
 
        err = init_vqs(vi);
        if (err)
@@ -2800,15 +2793,9 @@ static int virtnet_restore_up(struct virtio_device *vdev)
        virtio_device_ready(vdev);
 
        if (netif_running(vi->dev)) {
-               for (i = 0; i < vi->curr_queue_pairs; i++)
-                       if (!try_fill_recv(vi, &vi->rq[i], GFP_KERNEL))
-                               schedule_delayed_work(&vi->refill, 0);
-
-               for (i = 0; i < vi->max_queue_pairs; i++) {
-                       virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi);
-                       virtnet_napi_tx_enable(vi, vi->sq[i].vq,
-                                              &vi->sq[i].napi);
-               }
+               err = virtnet_open(vi->dev);
+               if (err)
+                       return err;
        }
 
        netif_tx_lock_bh(vi->dev);
index a99aedf..ea73094 100644 (file)
@@ -388,13 +388,25 @@ static void nfcmrvl_play_deferred(struct nfcmrvl_usb_drv_data *drv_data)
        int err;
 
        while ((urb = usb_get_from_anchor(&drv_data->deferred))) {
+               usb_anchor_urb(urb, &drv_data->tx_anchor);
+
                err = usb_submit_urb(urb, GFP_ATOMIC);
-               if (err)
+               if (err) {
+                       kfree(urb->setup_packet);
+                       usb_unanchor_urb(urb);
+                       usb_free_urb(urb);
                        break;
+               }
 
                drv_data->tx_in_flight++;
+               usb_free_urb(urb);
+       }
+
+       /* Cleanup the rest deferred urbs. */
+       while ((urb = usb_get_from_anchor(&drv_data->deferred))) {
+               kfree(urb->setup_packet);
+               usb_free_urb(urb);
        }
-       usb_scuttle_anchored_urbs(&drv_data->deferred);
 }
 
 static int nfcmrvl_resume(struct usb_interface *intf)
index 7e213f8..df8d27c 100644 (file)
@@ -300,6 +300,8 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
        int r = 0;
        struct device *dev = &hdev->ndev->dev;
        struct nfc_evt_transaction *transaction;
+       u32 aid_len;
+       u8 params_len;
 
        pr_debug("connectivity gate event: %x\n", event);
 
@@ -308,43 +310,48 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host,
                r = nfc_se_connectivity(hdev->ndev, host);
        break;
        case ST21NFCA_EVT_TRANSACTION:
-               /*
-                * According to specification etsi 102 622
+               /* According to specification etsi 102 622
                 * 11.2.2.4 EVT_TRANSACTION Table 52
                 * Description  Tag     Length
                 * AID          81      5 to 16
                 * PARAMETERS   82      0 to 255
+                *
+                * The key differences are aid storage length is variably sized
+                * in the packet, but fixed in nfc_evt_transaction, and that the aid_len
+                * is u8 in the packet, but u32 in the structure, and the tags in
+                * the packet are not included in nfc_evt_transaction.
+                *
+                * size in bytes: 1          1       5-16 1             1           0-255
+                * offset:        0          1       2    aid_len + 2   aid_len + 3 aid_len + 4
+                * member name:   aid_tag(M) aid_len aid  params_tag(M) params_len  params
+                * example:       0x81       5-16    X    0x82 0-255    X
                 */
-               if (skb->len < NFC_MIN_AID_LENGTH + 2 &&
-                   skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG)
+               if (skb->len < 2 || skb->data[0] != NFC_EVT_TRANSACTION_AID_TAG)
                        return -EPROTO;
 
-               transaction = devm_kzalloc(dev, skb->len - 2, GFP_KERNEL);
-               if (!transaction)
-                       return -ENOMEM;
-
-               transaction->aid_len = skb->data[1];
+               aid_len = skb->data[1];
 
-               /* Checking if the length of the AID is valid */
-               if (transaction->aid_len > sizeof(transaction->aid))
-                       return -EINVAL;
+               if (skb->len < aid_len + 4 || aid_len > sizeof(transaction->aid))
+                       return -EPROTO;
 
-               memcpy(transaction->aid, &skb->data[2],
-                      transaction->aid_len);
+               params_len = skb->data[aid_len + 3];
 
-               /* Check next byte is PARAMETERS tag (82) */
-               if (skb->data[transaction->aid_len + 2] !=
-                   NFC_EVT_TRANSACTION_PARAMS_TAG)
+               /* Verify PARAMETERS tag is (82), and final check that there is enough
+                * space in the packet to read everything.
+                */
+               if ((skb->data[aid_len + 2] != NFC_EVT_TRANSACTION_PARAMS_TAG) ||
+                   (skb->len < aid_len + 4 + params_len))
                        return -EPROTO;
 
-               transaction->params_len = skb->data[transaction->aid_len + 3];
+               transaction = devm_kzalloc(dev, sizeof(*transaction) + params_len, GFP_KERNEL);
+               if (!transaction)
+                       return -ENOMEM;
 
-               /* Total size is allocated (skb->len - 2) minus fixed array members */
-               if (transaction->params_len > ((skb->len - 2) - sizeof(struct nfc_evt_transaction)))
-                       return -EINVAL;
+               transaction->aid_len = aid_len;
+               transaction->params_len = params_len;
 
-               memcpy(transaction->params, skb->data +
-                      transaction->aid_len + 4, transaction->params_len);
+               memcpy(transaction->aid, &skb->data[2], aid_len);
+               memcpy(transaction->params, &skb->data[aid_len + 4], params_len);
 
                r = nfc_se_transaction(hdev->ndev, host, transaction);
        break;
index 24165da..b3d9c29 100644 (file)
@@ -2546,6 +2546,20 @@ static const struct nvme_core_quirk_entry core_quirks[] = {
                .vid = 0x1e0f,
                .mn = "KCD6XVUL6T40",
                .quirks = NVME_QUIRK_NO_APST,
+       },
+       {
+               /*
+                * The external Samsung X5 SSD fails initialization without a
+                * delay before checking if it is ready and has a whole set of
+                * other problems.  To make this even more interesting, it
+                * shares the PCI ID with internal Samsung 970 Evo Plus that
+                * does not need or want these quirks.
+                */
+               .vid = 0x144d,
+               .mn = "Samsung Portable SSD X5",
+               .quirks = NVME_QUIRK_DELAY_BEFORE_CHK_RDY |
+                         NVME_QUIRK_NO_DEEPEST_PS |
+                         NVME_QUIRK_IGNORE_DEV_SUBNQN,
        }
 };
 
@@ -3285,8 +3299,8 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
         * we have no UUID set
         */
        if (uuid_is_null(&ids->uuid)) {
-               printk_ratelimited(KERN_WARNING
-                                  "No UUID available providing old NGUID\n");
+               dev_warn_ratelimited(dev,
+                       "No UUID available providing old NGUID\n");
                return sysfs_emit(buf, "%pU\n", ids->nguid);
        }
        return sysfs_emit(buf, "%pU\n", &ids->uuid);
@@ -3863,6 +3877,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
        if (ret) {
                dev_err(ctrl->device,
                        "globally duplicate IDs for nsid %d\n", nsid);
+               nvme_print_device_info(ctrl);
                return ret;
        }
 
index 9b72b6e..0da94b2 100644 (file)
@@ -503,6 +503,7 @@ struct nvme_ctrl_ops {
        void (*submit_async_event)(struct nvme_ctrl *ctrl);
        void (*delete_ctrl)(struct nvme_ctrl *ctrl);
        int (*get_address)(struct nvme_ctrl *ctrl, char *buf, int size);
+       void (*print_device_info)(struct nvme_ctrl *ctrl);
 };
 
 /*
@@ -548,6 +549,33 @@ static inline struct request *nvme_cid_to_rq(struct blk_mq_tags *tags,
        return blk_mq_tag_to_rq(tags, nvme_tag_from_cid(command_id));
 }
 
+/*
+ * Return the length of the string without the space padding
+ */
+static inline int nvme_strlen(char *s, int len)
+{
+       while (s[len - 1] == ' ')
+               len--;
+       return len;
+}
+
+static inline void nvme_print_device_info(struct nvme_ctrl *ctrl)
+{
+       struct nvme_subsystem *subsys = ctrl->subsys;
+
+       if (ctrl->ops->print_device_info) {
+               ctrl->ops->print_device_info(ctrl);
+               return;
+       }
+
+       dev_err(ctrl->device,
+               "VID:%04x model:%.*s firmware:%.*s\n", subsys->vendor_id,
+               nvme_strlen(subsys->model, sizeof(subsys->model)),
+               subsys->model, nvme_strlen(subsys->firmware_rev,
+                                          sizeof(subsys->firmware_rev)),
+               subsys->firmware_rev);
+}
+
 #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
 void nvme_fault_inject_init(struct nvme_fault_inject *fault_inj,
                            const char *dev_name);
index 48f4f6e..d7b24ee 100644 (file)
@@ -1334,6 +1334,14 @@ static void nvme_warn_reset(struct nvme_dev *dev, u32 csts)
                dev_warn(dev->ctrl.device,
                         "controller is down; will reset: CSTS=0x%x, PCI_STATUS read failed (%d)\n",
                         csts, result);
+
+       if (csts != ~0)
+               return;
+
+       dev_warn(dev->ctrl.device,
+                "Does your device have a faulty power saving mode enabled?\n");
+       dev_warn(dev->ctrl.device,
+                "Try \"nvme_core.default_ps_max_latency_us=0 pcie_aspm=off\" and report a bug\n");
 }
 
 static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
@@ -2976,6 +2984,21 @@ static int nvme_pci_get_address(struct nvme_ctrl *ctrl, char *buf, int size)
        return snprintf(buf, size, "%s\n", dev_name(&pdev->dev));
 }
 
+
+static void nvme_pci_print_device_info(struct nvme_ctrl *ctrl)
+{
+       struct pci_dev *pdev = to_pci_dev(to_nvme_dev(ctrl)->dev);
+       struct nvme_subsystem *subsys = ctrl->subsys;
+
+       dev_err(ctrl->device,
+               "VID:DID %04x:%04x model:%.*s firmware:%.*s\n",
+               pdev->vendor, pdev->device,
+               nvme_strlen(subsys->model, sizeof(subsys->model)),
+               subsys->model, nvme_strlen(subsys->firmware_rev,
+                                          sizeof(subsys->firmware_rev)),
+               subsys->firmware_rev);
+}
+
 static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
        .name                   = "pcie",
        .module                 = THIS_MODULE,
@@ -2987,6 +3010,7 @@ static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
        .free_ctrl              = nvme_pci_free_ctrl,
        .submit_async_event     = nvme_pci_submit_async_event,
        .get_address            = nvme_pci_get_address,
+       .print_device_info      = nvme_pci_print_device_info,
 };
 
 static int nvme_dev_map(struct nvme_dev *dev)
@@ -3421,7 +3445,8 @@ static const struct pci_device_id nvme_id_table[] = {
        { PCI_VDEVICE(REDHAT, 0x0010),  /* Qemu emulated controller */
                .driver_data = NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(0x126f, 0x2263),   /* Silicon Motion unidentified */
-               .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, },
+               .driver_data = NVME_QUIRK_NO_NS_DESC_LIST |
+                               NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(0x1bb1, 0x0100),   /* Seagate Nytro Flash Storage */
                .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY |
                                NVME_QUIRK_NO_NS_DESC_LIST, },
@@ -3437,6 +3462,8 @@ static const struct pci_device_id nvme_id_table[] = {
                .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY |
                                NVME_QUIRK_DISABLE_WRITE_ZEROES|
                                NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+       { PCI_DEVICE(0x1987, 0x5012),   /* Phison E12 */
+               .driver_data = NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(0x1987, 0x5016),   /* Phison E16 */
                .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
        { PCI_DEVICE(0x1b4b, 0x1092),   /* Lexar 256 GB SSD */
@@ -3447,12 +3474,24 @@ static const struct pci_device_id nvme_id_table[] = {
        { PCI_DEVICE(0x1cc1, 0x8201),   /* ADATA SX8200PNP 512GB */
                .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
                                NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+        { PCI_DEVICE(0x1344, 0x5407), /* Micron Technology Inc NVMe SSD */
+               .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN },
        { PCI_DEVICE(0x1c5c, 0x1504),   /* SK Hynix PC400 */
                .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x1c5c, 0x174a),   /* SK Hynix P31 SSD */
+               .driver_data = NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(0x15b7, 0x2001),   /*  Sandisk Skyhawk */
                .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
        { PCI_DEVICE(0x1d97, 0x2263),   /* SPCC */
                .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x144d, 0xa80b),   /* Samsung PM9B1 256G and 512G */
+               .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x144d, 0xa809),   /* Samsung MZALQ256HBJD 256G */
+               .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x1cc4, 0x6303),   /* UMIS RPJTJ512MGE1QDY 512G */
+               .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
+       { PCI_DEVICE(0x1cc4, 0x6302),   /* UMIS RPJTJ256MGE1QDY 256G */
+               .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
        { PCI_DEVICE(0x2646, 0x2262),   /* KINGSTON SKC2000 NVMe SSD */
                .driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
        { PCI_DEVICE(0x2646, 0x2263),   /* KINGSTON A2000 NVMe SSD  */
@@ -3463,6 +3502,10 @@ static const struct pci_device_id nvme_id_table[] = {
                .driver_data = NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(0x1e4B, 0x1202),   /* MAXIO MAP1202 */
                .driver_data = NVME_QUIRK_BOGUS_NID, },
+       { PCI_DEVICE(0x1cc1, 0x5350),   /* ADATA XPG GAMMIX S50 */
+               .driver_data = NVME_QUIRK_BOGUS_NID, },
+       { PCI_DEVICE(0x1e49, 0x0041),   /* ZHITAI TiPro7000 NVMe SSD */
+               .driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
        { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061),
                .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, },
        { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
@@ -3483,10 +3526,6 @@ static const struct pci_device_id nvme_id_table[] = {
                                NVME_QUIRK_128_BYTES_SQES |
                                NVME_QUIRK_SHARED_TAGS |
                                NVME_QUIRK_SKIP_CID_GEN },
-       { PCI_DEVICE(0x144d, 0xa808),   /* Samsung X5 */
-               .driver_data =  NVME_QUIRK_DELAY_BEFORE_CHK_RDY|
-                               NVME_QUIRK_NO_DEEPEST_PS |
-                               NVME_QUIRK_IGNORE_DEV_SUBNQN, },
        { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
        { 0, }
 };
index 72df4b8..09c7829 100644 (file)
@@ -85,7 +85,7 @@ config NVSW_SN2201
        depends on I2C
        depends on REGMAP_I2C
        help
-         This driver provides support for the Nvidia SN2201 platfom.
+         This driver provides support for the Nvidia SN2201 platform.
          The SN2201 is a highly integrated for one rack unit system with
          L3 management switches. It has 48 x 1Gbps RJ45 + 4 x 100G QSFP28
          ports in a compact 1RU form factor. The system also including a
index 0bcdc7c..2923daf 100644 (file)
@@ -326,7 +326,7 @@ static struct resource nvsw_sn2201_lpc_res[] = {
 };
 
 /* SN2201 I2C platform data. */
-struct mlxreg_core_hotplug_platform_data nvsw_sn2201_i2c_data = {
+static struct mlxreg_core_hotplug_platform_data nvsw_sn2201_i2c_data = {
        .irq = NVSW_SN2201_CPLD_SYSIRQ,
 };
 
index d421e14..6b51ad0 100644 (file)
@@ -17,7 +17,7 @@ menuconfig MIPS_PLATFORM_DEVICES
 if MIPS_PLATFORM_DEVICES
 
 config CPU_HWMON
-       tristate "Loongson-3 CPU HWMon Driver"
+       bool "Loongson-3 CPU HWMon Driver"
        depends on MACH_LOONGSON64
        select HWMON
        default y
index 0553428..8dd6723 100644 (file)
@@ -405,11 +405,14 @@ MODULE_DEVICE_TABLE(dmi, dmi_ids);
 static int __init p50_module_init(void)
 {
        struct resource res = DEFINE_RES_IO(P50_GPIO_IO_PORT_BASE, P50_PORT_CMD + 1);
+       int ret;
 
        if (!dmi_first_match(dmi_ids))
                return -ENODEV;
 
-       platform_driver_register(&p50_gpio_driver);
+       ret = platform_driver_register(&p50_gpio_driver);
+       if (ret)
+               return ret;
 
        gpio_pdev = platform_device_register_simple(DRIVER_NAME, PLATFORM_DEVID_NONE, &res, 1);
        if (IS_ERR(gpio_pdev)) {
index 1ef606e..497ad2f 100644 (file)
@@ -140,6 +140,7 @@ static u8 gigabyte_wmi_detect_sensor_usability(struct wmi_device *wdev)
        }}
 
 static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {
+       DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M DS3H-CF"),
        DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B450M S2H V2"),
        DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE AX V2"),
        DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("B550 AORUS ELITE"),
@@ -156,6 +157,7 @@ static const struct dmi_system_id gigabyte_wmi_known_working_platforms[] = {
        DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 GAMING X"),
        DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 I AORUS PRO WIFI"),
        DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("X570 UD"),
+       DMI_EXACT_MATCH_GIGABYTE_BOARD_NAME("Z690M AORUS ELITE AX DDR4"),
        { }
 };
 
index 667f94b..0d8cb22 100644 (file)
@@ -38,6 +38,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
 #define HPWMI_EVENT_GUID "95F24279-4D7B-4334-9387-ACCDC67EF61C"
 #define HPWMI_BIOS_GUID "5FB7F034-2C63-45e9-BE91-3D44E2C707E4"
 #define HP_OMEN_EC_THERMAL_PROFILE_OFFSET 0x95
+#define zero_if_sup(tmp) (zero_insize_support?0:sizeof(tmp)) // use when zero insize is required
 
 /* DMI board names of devices that should use the omen specific path for
  * thermal profiles.
@@ -220,6 +221,7 @@ static struct input_dev *hp_wmi_input_dev;
 static struct platform_device *hp_wmi_platform_dev;
 static struct platform_profile_handler platform_profile_handler;
 static bool platform_profile_support;
+static bool zero_insize_support;
 
 static struct rfkill *wifi_rfkill;
 static struct rfkill *bluetooth_rfkill;
@@ -290,14 +292,16 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command,
        struct bios_return *bios_return;
        union acpi_object *obj = NULL;
        struct bios_args *args = NULL;
-       int mid, actual_outsize, ret;
+       int mid, actual_insize, actual_outsize;
        size_t bios_args_size;
+       int ret;
 
        mid = encode_outsize_for_pvsz(outsize);
        if (WARN_ON(mid < 0))
                return mid;
 
-       bios_args_size = struct_size(args, data, insize);
+       actual_insize = max(insize, 128);
+       bios_args_size = struct_size(args, data, actual_insize);
        args = kmalloc(bios_args_size, GFP_KERNEL);
        if (!args)
                return -ENOMEM;
@@ -374,7 +378,7 @@ static int hp_wmi_read_int(int query)
        int val = 0, ret;
 
        ret = hp_wmi_perform_query(query, HPWMI_READ, &val,
-                                  0, sizeof(val));
+                                  zero_if_sup(val), sizeof(val));
 
        if (ret)
                return ret < 0 ? ret : -EINVAL;
@@ -410,7 +414,8 @@ static int hp_wmi_get_tablet_mode(void)
                return -ENODEV;
 
        ret = hp_wmi_perform_query(HPWMI_SYSTEM_DEVICE_MODE, HPWMI_READ,
-                                  system_device_mode, 0, sizeof(system_device_mode));
+                                  system_device_mode, zero_if_sup(system_device_mode),
+                                  sizeof(system_device_mode));
        if (ret < 0)
                return ret;
 
@@ -497,7 +502,7 @@ static int hp_wmi_fan_speed_max_get(void)
        int val = 0, ret;
 
        ret = hp_wmi_perform_query(HPWMI_FAN_SPEED_MAX_GET_QUERY, HPWMI_GM,
-                                  &val, 0, sizeof(val));
+                                  &val, zero_if_sup(val), sizeof(val));
 
        if (ret)
                return ret < 0 ? ret : -EINVAL;
@@ -509,7 +514,7 @@ static int __init hp_wmi_bios_2008_later(void)
 {
        int state = 0;
        int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, HPWMI_READ, &state,
-                                      0, sizeof(state));
+                                      zero_if_sup(state), sizeof(state));
        if (!ret)
                return 1;
 
@@ -520,7 +525,7 @@ static int __init hp_wmi_bios_2009_later(void)
 {
        u8 state[128];
        int ret = hp_wmi_perform_query(HPWMI_FEATURE2_QUERY, HPWMI_READ, &state,
-                                      0, sizeof(state));
+                                      zero_if_sup(state), sizeof(state));
        if (!ret)
                return 1;
 
@@ -598,7 +603,7 @@ static int hp_wmi_rfkill2_refresh(void)
        int err, i;
 
        err = hp_wmi_perform_query(HPWMI_WIRELESS2_QUERY, HPWMI_READ, &state,
-                                  0, sizeof(state));
+                                  zero_if_sup(state), sizeof(state));
        if (err)
                return err;
 
@@ -1007,7 +1012,7 @@ static int __init hp_wmi_rfkill2_setup(struct platform_device *device)
        int err, i;
 
        err = hp_wmi_perform_query(HPWMI_WIRELESS2_QUERY, HPWMI_READ, &state,
-                                  0, sizeof(state));
+                                  zero_if_sup(state), sizeof(state));
        if (err)
                return err < 0 ? err : -EINVAL;
 
@@ -1483,11 +1488,15 @@ static int __init hp_wmi_init(void)
 {
        int event_capable = wmi_has_guid(HPWMI_EVENT_GUID);
        int bios_capable = wmi_has_guid(HPWMI_BIOS_GUID);
-       int err;
+       int err, tmp = 0;
 
        if (!bios_capable && !event_capable)
                return -ENODEV;
 
+       if (hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, HPWMI_READ, &tmp,
+                                sizeof(tmp), sizeof(tmp)) == HPWMI_RET_INVALID_PARAMETERS)
+               zero_insize_support = true;
+
        if (event_capable) {
                err = hp_wmi_input_setup();
                if (err)
index 216d31e..79cff1f 100644 (file)
@@ -122,6 +122,12 @@ static const struct dmi_system_id dmi_vgbs_allow_list[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x360 Convertible 15-df0xxx"),
                },
        },
+       {
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go"),
+               },
+       },
        { }
 };
 
index edaf22e..40183bd 100644 (file)
@@ -1912,6 +1912,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
        X86_MATCH_INTEL_FAM6_MODEL(ROCKETLAKE,          &tgl_reg_map),
        X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE_L,         &tgl_reg_map),
        X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE,           &adl_reg_map),
+       X86_MATCH_INTEL_FAM6_MODEL(RAPTORLAKE_P,        &tgl_reg_map),
        {}
 };
 
index 34daf9d..ace1239 100644 (file)
@@ -282,7 +282,7 @@ static int pmt_crashlog_probe(struct auxiliary_device *auxdev,
        auxiliary_set_drvdata(auxdev, priv);
 
        for (i = 0; i < intel_vsec_dev->num_resources; i++) {
-               struct intel_pmt_entry *entry = &priv->entry[i].entry;
+               struct intel_pmt_entry *entry = &priv->entry[priv->num_entries].entry;
 
                ret = intel_pmt_dev_create(entry, &pmt_crashlog_ns, intel_vsec_dev, i);
                if (ret < 0)
index 7dff94a..ef6e47d 100644 (file)
@@ -723,19 +723,19 @@ static const struct regulator_desc pms405_pldo600 = {
 
 static const struct regulator_desc mp5496_smpa2 = {
        .linear_ranges = (struct linear_range[]) {
-               REGULATOR_LINEAR_RANGE(725000, 0, 27, 12500),
+               REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500),
        },
        .n_linear_ranges = 1,
-       .n_voltages = 28,
+       .n_voltages = 128,
        .ops = &rpm_mp5496_ops,
 };
 
 static const struct regulator_desc mp5496_ldoa2 = {
        .linear_ranges = (struct linear_range[]) {
-               REGULATOR_LINEAR_RANGE(1800000, 0, 60, 25000),
+               REGULATOR_LINEAR_RANGE(800000, 0, 127, 25000),
        },
        .n_linear_ranges = 1,
-       .n_voltages = 61,
+       .n_voltages = 128,
        .ops = &rpm_mp5496_ops,
 };
 
index d0eab57..00684e1 100644 (file)
@@ -160,8 +160,8 @@ static void ibmvfc_npiv_logout(struct ibmvfc_host *);
 static void ibmvfc_tgt_implicit_logout_and_del(struct ibmvfc_target *);
 static void ibmvfc_tgt_move_login(struct ibmvfc_target *);
 
-static void ibmvfc_release_sub_crqs(struct ibmvfc_host *);
-static void ibmvfc_init_sub_crqs(struct ibmvfc_host *);
+static void ibmvfc_dereg_sub_crqs(struct ibmvfc_host *);
+static void ibmvfc_reg_sub_crqs(struct ibmvfc_host *);
 
 static const char *unknown_error = "unknown error";
 
@@ -917,7 +917,7 @@ static int ibmvfc_reenable_crq_queue(struct ibmvfc_host *vhost)
        struct vio_dev *vdev = to_vio_dev(vhost->dev);
        unsigned long flags;
 
-       ibmvfc_release_sub_crqs(vhost);
+       ibmvfc_dereg_sub_crqs(vhost);
 
        /* Re-enable the CRQ */
        do {
@@ -936,7 +936,7 @@ static int ibmvfc_reenable_crq_queue(struct ibmvfc_host *vhost)
        spin_unlock(vhost->crq.q_lock);
        spin_unlock_irqrestore(vhost->host->host_lock, flags);
 
-       ibmvfc_init_sub_crqs(vhost);
+       ibmvfc_reg_sub_crqs(vhost);
 
        return rc;
 }
@@ -955,7 +955,7 @@ static int ibmvfc_reset_crq(struct ibmvfc_host *vhost)
        struct vio_dev *vdev = to_vio_dev(vhost->dev);
        struct ibmvfc_queue *crq = &vhost->crq;
 
-       ibmvfc_release_sub_crqs(vhost);
+       ibmvfc_dereg_sub_crqs(vhost);
 
        /* Close the CRQ */
        do {
@@ -988,7 +988,7 @@ static int ibmvfc_reset_crq(struct ibmvfc_host *vhost)
        spin_unlock(vhost->crq.q_lock);
        spin_unlock_irqrestore(vhost->host->host_lock, flags);
 
-       ibmvfc_init_sub_crqs(vhost);
+       ibmvfc_reg_sub_crqs(vhost);
 
        return rc;
 }
@@ -5682,6 +5682,8 @@ static int ibmvfc_alloc_queue(struct ibmvfc_host *vhost,
        queue->cur = 0;
        queue->fmt = fmt;
        queue->size = PAGE_SIZE / fmt_size;
+
+       queue->vhost = vhost;
        return 0;
 }
 
@@ -5757,9 +5759,6 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost,
 
        ENTER;
 
-       if (ibmvfc_alloc_queue(vhost, scrq, IBMVFC_SUB_CRQ_FMT))
-               return -ENOMEM;
-
        rc = h_reg_sub_crq(vdev->unit_address, scrq->msg_token, PAGE_SIZE,
                           &scrq->cookie, &scrq->hw_irq);
 
@@ -5790,7 +5789,6 @@ static int ibmvfc_register_scsi_channel(struct ibmvfc_host *vhost,
        }
 
        scrq->hwq_id = index;
-       scrq->vhost = vhost;
 
        LEAVE;
        return 0;
@@ -5800,7 +5798,6 @@ irq_failed:
                rc = plpar_hcall_norets(H_FREE_SUB_CRQ, vdev->unit_address, scrq->cookie);
        } while (rtas_busy_delay(rc));
 reg_failed:
-       ibmvfc_free_queue(vhost, scrq);
        LEAVE;
        return rc;
 }
@@ -5826,12 +5823,50 @@ static void ibmvfc_deregister_scsi_channel(struct ibmvfc_host *vhost, int index)
        if (rc)
                dev_err(dev, "Failed to free sub-crq[%d]: rc=%ld\n", index, rc);
 
-       ibmvfc_free_queue(vhost, scrq);
+       /* Clean out the queue */
+       memset(scrq->msgs.crq, 0, PAGE_SIZE);
+       scrq->cur = 0;
+
+       LEAVE;
+}
+
+static void ibmvfc_reg_sub_crqs(struct ibmvfc_host *vhost)
+{
+       int i, j;
+
+       ENTER;
+       if (!vhost->mq_enabled || !vhost->scsi_scrqs.scrqs)
+               return;
+
+       for (i = 0; i < nr_scsi_hw_queues; i++) {
+               if (ibmvfc_register_scsi_channel(vhost, i)) {
+                       for (j = i; j > 0; j--)
+                               ibmvfc_deregister_scsi_channel(vhost, j - 1);
+                       vhost->do_enquiry = 0;
+                       return;
+               }
+       }
+
+       LEAVE;
+}
+
+static void ibmvfc_dereg_sub_crqs(struct ibmvfc_host *vhost)
+{
+       int i;
+
+       ENTER;
+       if (!vhost->mq_enabled || !vhost->scsi_scrqs.scrqs)
+               return;
+
+       for (i = 0; i < nr_scsi_hw_queues; i++)
+               ibmvfc_deregister_scsi_channel(vhost, i);
+
        LEAVE;
 }
 
 static void ibmvfc_init_sub_crqs(struct ibmvfc_host *vhost)
 {
+       struct ibmvfc_queue *scrq;
        int i, j;
 
        ENTER;
@@ -5847,30 +5882,41 @@ static void ibmvfc_init_sub_crqs(struct ibmvfc_host *vhost)
        }
 
        for (i = 0; i < nr_scsi_hw_queues; i++) {
-               if (ibmvfc_register_scsi_channel(vhost, i)) {
-                       for (j = i; j > 0; j--)
-                               ibmvfc_deregister_scsi_channel(vhost, j - 1);
+               scrq = &vhost->scsi_scrqs.scrqs[i];
+               if (ibmvfc_alloc_queue(vhost, scrq, IBMVFC_SUB_CRQ_FMT)) {
+                       for (j = i; j > 0; j--) {
+                               scrq = &vhost->scsi_scrqs.scrqs[j - 1];
+                               ibmvfc_free_queue(vhost, scrq);
+                       }
                        kfree(vhost->scsi_scrqs.scrqs);
                        vhost->scsi_scrqs.scrqs = NULL;
                        vhost->scsi_scrqs.active_queues = 0;
                        vhost->do_enquiry = 0;
-                       break;
+                       vhost->mq_enabled = 0;
+                       return;
                }
        }
 
+       ibmvfc_reg_sub_crqs(vhost);
+
        LEAVE;
 }
 
 static void ibmvfc_release_sub_crqs(struct ibmvfc_host *vhost)
 {
+       struct ibmvfc_queue *scrq;
        int i;
 
        ENTER;
        if (!vhost->scsi_scrqs.scrqs)
                return;
 
-       for (i = 0; i < nr_scsi_hw_queues; i++)
-               ibmvfc_deregister_scsi_channel(vhost, i);
+       ibmvfc_dereg_sub_crqs(vhost);
+
+       for (i = 0; i < nr_scsi_hw_queues; i++) {
+               scrq = &vhost->scsi_scrqs.scrqs[i];
+               ibmvfc_free_queue(vhost, scrq);
+       }
 
        kfree(vhost->scsi_scrqs.scrqs);
        vhost->scsi_scrqs.scrqs = NULL;
index 3718406..c39a245 100644 (file)
@@ -789,6 +789,7 @@ struct ibmvfc_queue {
        spinlock_t _lock;
        spinlock_t *q_lock;
 
+       struct ibmvfc_host *vhost;
        struct ibmvfc_event_pool evt_pool;
        struct list_head sent;
        struct list_head free;
@@ -797,7 +798,6 @@ struct ibmvfc_queue {
        union ibmvfc_iu cancel_rsp;
 
        /* Sub-CRQ fields */
-       struct ibmvfc_host *vhost;
        unsigned long cookie;
        unsigned long vios_cookie;
        unsigned long hw_irq;
index 256ec6d..9d01a3e 100644 (file)
@@ -9795,7 +9795,7 @@ static int ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
                                        GFP_KERNEL);
 
                if (!ioa_cfg->hrrq[i].host_rrq)  {
-                       while (--i > 0)
+                       while (--i >= 0)
                                dma_free_coherent(&pdev->dev,
                                        sizeof(u32) * ioa_cfg->hrrq[i].size,
                                        ioa_cfg->hrrq[i].host_rrq,
@@ -10068,7 +10068,7 @@ static int ipr_request_other_msi_irqs(struct ipr_ioa_cfg *ioa_cfg,
                        ioa_cfg->vectors_info[i].desc,
                        &ioa_cfg->hrrq[i]);
                if (rc) {
-                       while (--i >= 0)
+                       while (--i > 0)
                                free_irq(pci_irq_vector(pdev, i),
                                        &ioa_cfg->hrrq[i]);
                        return rc;
index b1be0dd..f5d7495 100644 (file)
@@ -420,8 +420,6 @@ int lpfc_sli_issue_iocb_wait(struct lpfc_hba *, uint32_t,
                             uint32_t);
 void lpfc_sli_abort_fcp_cmpl(struct lpfc_hba *, struct lpfc_iocbq *,
                             struct lpfc_iocbq *);
-void lpfc_sli4_abort_fcp_cmpl(struct lpfc_hba *h, struct lpfc_iocbq *i,
-                             struct lpfc_wcqe_complete *w);
 
 void lpfc_sli_free_hbq(struct lpfc_hba *, struct hbq_dmabuf *);
 
@@ -630,7 +628,7 @@ void lpfc_nvmet_invalidate_host(struct lpfc_hba *phba,
                        struct lpfc_nodelist *ndlp);
 void lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba,
                                struct lpfc_iocbq *cmdiocb,
-                               struct lpfc_wcqe_complete *abts_cmpl);
+                               struct lpfc_iocbq *rspiocb);
 void lpfc_create_multixri_pools(struct lpfc_hba *phba);
 void lpfc_create_destroy_pools(struct lpfc_hba *phba);
 void lpfc_move_xri_pvt_to_pbl(struct lpfc_hba *phba, u32 hwqid);
index 9d36b20..13dfe28 100644 (file)
@@ -197,7 +197,7 @@ lpfc_ct_reject_event(struct lpfc_nodelist *ndlp,
        memset(bpl, 0, sizeof(struct ulp_bde64));
        bpl->addrHigh = le32_to_cpu(putPaddrHigh(mp->phys));
        bpl->addrLow = le32_to_cpu(putPaddrLow(mp->phys));
-       bpl->tus.f.bdeFlags = BUFF_TYPE_BLP_64;
+       bpl->tus.f.bdeFlags = BUFF_TYPE_BDE_64;
        bpl->tus.f.bdeSize = (LPFC_CT_PREAMBLE - 4);
        bpl->tus.w = le32_to_cpu(bpl->tus.w);
 
index 07f9a6e..3fababb 100644 (file)
@@ -2998,10 +2998,7 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
                                 ndlp->nlp_DID, ulp_status,
                                 ulp_word4);
 
-               /* Call NLP_EVT_DEVICE_RM if link is down or LOGO is aborted */
                if (lpfc_error_lost_link(ulp_status, ulp_word4)) {
-                       lpfc_disc_state_machine(vport, ndlp, cmdiocb,
-                                               NLP_EVT_DEVICE_RM);
                        skip_recovery = 1;
                        goto out;
                }
@@ -3021,18 +3018,10 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
                spin_unlock_irq(&ndlp->lock);
                lpfc_disc_state_machine(vport, ndlp, cmdiocb,
                                        NLP_EVT_DEVICE_RM);
-               lpfc_els_free_iocb(phba, cmdiocb);
-               lpfc_nlp_put(ndlp);
-
-               /* Presume the node was released. */
-               return;
+               goto out_rsrc_free;
        }
 
 out:
-       /* Driver is done with the IO.  */
-       lpfc_els_free_iocb(phba, cmdiocb);
-       lpfc_nlp_put(ndlp);
-
        /* At this point, the LOGO processing is complete. NOTE: For a
         * pt2pt topology, we are assuming the NPortID will only change
         * on link up processing. For a LOGO / PLOGI initiated by the
@@ -3059,6 +3048,10 @@ out:
                                 ndlp->nlp_DID, ulp_status,
                                 ulp_word4, tmo,
                                 vport->num_disc_nodes);
+
+               lpfc_els_free_iocb(phba, cmdiocb);
+               lpfc_nlp_put(ndlp);
+
                lpfc_disc_start(vport);
                return;
        }
@@ -3075,6 +3068,10 @@ out:
                lpfc_disc_state_machine(vport, ndlp, cmdiocb,
                                        NLP_EVT_DEVICE_RM);
        }
+out_rsrc_free:
+       /* Driver is done with the I/O. */
+       lpfc_els_free_iocb(phba, cmdiocb);
+       lpfc_nlp_put(ndlp);
 }
 
 /**
index 8511369..f024415 100644 (file)
@@ -4487,6 +4487,9 @@ struct wqe_common {
 #define wqe_sup_SHIFT         6
 #define wqe_sup_MASK          0x00000001
 #define wqe_sup_WORD          word11
+#define wqe_ffrq_SHIFT         6
+#define wqe_ffrq_MASK          0x00000001
+#define wqe_ffrq_WORD          word11
 #define wqe_wqec_SHIFT        7
 #define wqe_wqec_MASK         0x00000001
 #define wqe_wqec_WORD         word11
index 93b94c6..750dd1e 100644 (file)
@@ -12188,7 +12188,7 @@ lpfc_sli_enable_msi(struct lpfc_hba *phba)
        rc = pci_enable_msi(phba->pcidev);
        if (!rc)
                lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
-                               "0462 PCI enable MSI mode success.\n");
+                               "0012 PCI enable MSI mode success.\n");
        else {
                lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
                                "0471 PCI enable MSI mode failed (%d)\n", rc);
index 639f866..b86ff9f 100644 (file)
@@ -834,7 +834,8 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
                lpfc_nvmet_invalidate_host(phba, ndlp);
 
        if (ndlp->nlp_DID == Fabric_DID) {
-               if (vport->port_state <= LPFC_FDISC)
+               if (vport->port_state <= LPFC_FDISC ||
+                   vport->fc_flag & FC_PT2PT)
                        goto out;
                lpfc_linkdown_port(vport);
                spin_lock_irq(shost->host_lock);
index 335e906..cd10ee6 100644 (file)
@@ -1065,25 +1065,37 @@ lpfc_nvme_io_cmd_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
                        nCmd->rcv_rsplen = wcqe->parameter;
                        nCmd->status = 0;
 
+                       /* Get the NVME cmd details for this unique error. */
+                       cp = (struct nvme_fc_cmd_iu *)nCmd->cmdaddr;
+                       ep = (struct nvme_fc_ersp_iu *)nCmd->rspaddr;
+
                        /* Check if this is really an ERSP */
                        if (nCmd->rcv_rsplen == LPFC_NVME_ERSP_LEN) {
                                lpfc_ncmd->status = IOSTAT_SUCCESS;
                                lpfc_ncmd->result = 0;
 
                                lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME,
-                                        "6084 NVME Completion ERSP: "
-                                        "xri %x placed x%x\n",
-                                        lpfc_ncmd->cur_iocbq.sli4_xritag,
-                                        wcqe->total_data_placed);
+                                       "6084 NVME FCP_ERR ERSP: "
+                                       "xri %x placed x%x opcode x%x cmd_id "
+                                       "x%x cqe_status x%x\n",
+                                       lpfc_ncmd->cur_iocbq.sli4_xritag,
+                                       wcqe->total_data_placed,
+                                       cp->sqe.common.opcode,
+                                       cp->sqe.common.command_id,
+                                       ep->cqe.status);
                                break;
                        }
                        lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
                                         "6081 NVME Completion Protocol Error: "
                                         "xri %x status x%x result x%x "
-                                        "placed x%x\n",
+                                        "placed x%x opcode x%x cmd_id x%x, "
+                                        "cqe_status x%x\n",
                                         lpfc_ncmd->cur_iocbq.sli4_xritag,
                                         lpfc_ncmd->status, lpfc_ncmd->result,
-                                        wcqe->total_data_placed);
+                                        wcqe->total_data_placed,
+                                        cp->sqe.common.opcode,
+                                        cp->sqe.common.command_id,
+                                        ep->cqe.status);
                        break;
                case IOSTAT_LOCAL_REJECT:
                        /* Let fall through to set command final state. */
@@ -1195,7 +1207,8 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport,
 {
        struct lpfc_hba *phba = vport->phba;
        struct nvmefc_fcp_req *nCmd = lpfc_ncmd->nvmeCmd;
-       struct lpfc_iocbq *pwqeq = &(lpfc_ncmd->cur_iocbq);
+       struct nvme_common_command *sqe;
+       struct lpfc_iocbq *pwqeq = &lpfc_ncmd->cur_iocbq;
        union lpfc_wqe128 *wqe = &pwqeq->wqe;
        uint32_t req_len;
 
@@ -1252,8 +1265,14 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport,
                cstat->control_requests++;
        }
 
-       if (pnode->nlp_nvme_info & NLP_NVME_NSLER)
+       if (pnode->nlp_nvme_info & NLP_NVME_NSLER) {
                bf_set(wqe_erp, &wqe->generic.wqe_com, 1);
+               sqe = &((struct nvme_fc_cmd_iu *)
+                       nCmd->cmdaddr)->sqe.common;
+               if (sqe->opcode == nvme_admin_async_event)
+                       bf_set(wqe_ffrq, &wqe->generic.wqe_com, 1);
+       }
+
        /*
         * Finish initializing those WQE fields that are independent
         * of the nvme_cmnd request_buffer
@@ -1787,7 +1806,7 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
  * lpfc_nvme_abort_fcreq_cmpl - Complete an NVME FCP abort request.
  * @phba: Pointer to HBA context object
  * @cmdiocb: Pointer to command iocb object.
- * @abts_cmpl: Pointer to wcqe complete object.
+ * @rspiocb: Pointer to response iocb object.
  *
  * This is the callback function for any NVME FCP IO that was aborted.
  *
@@ -1796,8 +1815,10 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
  **/
 void
 lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
-                          struct lpfc_wcqe_complete *abts_cmpl)
+                          struct lpfc_iocbq *rspiocb)
 {
+       struct lpfc_wcqe_complete *abts_cmpl = &rspiocb->wcqe_cmpl;
+
        lpfc_printf_log(phba, KERN_INFO, LOG_NVME,
                        "6145 ABORT_XRI_CN completing on rpi x%x "
                        "original iotag x%x, abort cmd iotag x%x "
@@ -1840,6 +1861,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
        struct lpfc_nvme_fcpreq_priv *freqpriv;
        unsigned long flags;
        int ret_val;
+       struct nvme_fc_cmd_iu *cp;
 
        /* Validate pointers. LLDD fault handling with transport does
         * have timing races.
@@ -1963,10 +1985,16 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport,
                return;
        }
 
+       /*
+        * Get Command Id from cmd to plug into response. This
+        * code is not needed in the next NVME Transport drop.
+        */
+       cp = (struct nvme_fc_cmd_iu *)lpfc_nbuf->nvmeCmd->cmdaddr;
        lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_ABTS,
                         "6138 Transport Abort NVME Request Issued for "
-                        "ox_id x%x\n",
-                        nvmereq_wqe->sli4_xritag);
+                        "ox_id x%x nvme opcode x%x nvme cmd_id x%x\n",
+                        nvmereq_wqe->sli4_xritag, cp->sqe.common.opcode,
+                        cp->sqe.common.command_id);
        return;
 
 out_unlock:
index d439682..ba5e401 100644 (file)
@@ -6062,6 +6062,9 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
        int status;
        u32 logit = LOG_FCP;
 
+       if (!rport)
+               return FAILED;
+
        rdata = rport->dd_data;
        if (!rdata || !rdata->pnode) {
                lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
@@ -6140,6 +6143,9 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
        unsigned long flags;
        DECLARE_WAIT_QUEUE_HEAD_ONSTACK(waitq);
 
+       if (!rport)
+               return FAILED;
+
        rdata = rport->dd_data;
        if (!rdata || !rdata->pnode) {
                lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
index 6ed696c..80ac3a0 100644 (file)
@@ -1930,7 +1930,7 @@ lpfc_issue_cmf_sync_wqe(struct lpfc_hba *phba, u32 ms, u64 total)
        sync_buf = __lpfc_sli_get_iocbq(phba);
        if (!sync_buf) {
                lpfc_printf_log(phba, KERN_ERR, LOG_CGN_MGMT,
-                               "6213 No available WQEs for CMF_SYNC_WQE\n");
+                               "6244 No available WQEs for CMF_SYNC_WQE\n");
                ret_val = ENOMEM;
                goto out_unlock;
        }
@@ -3805,7 +3805,7 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
                                                set_job_ulpword4(cmdiocbp,
                                                                 IOERR_ABORT_REQUESTED);
                                                /*
-                                                * For SLI4, irsiocb contains
+                                                * For SLI4, irspiocb contains
                                                 * NO_XRI in sli_xritag, it
                                                 * shall not affect releasing
                                                 * sgl (xri) process.
@@ -3823,7 +3823,7 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
                                        }
                                }
                        }
-                       (cmdiocbp->cmd_cmpl) (phba, cmdiocbp, saveq);
+                       cmdiocbp->cmd_cmpl(phba, cmdiocbp, saveq);
                } else
                        lpfc_sli_release_iocbq(phba, cmdiocbp);
        } else {
@@ -4063,8 +4063,7 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
                                cmdiocbq->cmd_flag &= ~LPFC_DRIVER_ABORTED;
                        if (cmdiocbq->cmd_cmpl) {
                                spin_unlock_irqrestore(&phba->hbalock, iflag);
-                               (cmdiocbq->cmd_cmpl)(phba, cmdiocbq,
-                                                     &rspiocbq);
+                               cmdiocbq->cmd_cmpl(phba, cmdiocbq, &rspiocbq);
                                spin_lock_irqsave(&phba->hbalock, iflag);
                        }
                        break;
@@ -10288,7 +10287,7 @@ __lpfc_sli_issue_iocb_s3(struct lpfc_hba *phba, uint32_t ring_number,
  * @flag: Flag indicating if this command can be put into txq.
  *
  * __lpfc_sli_issue_fcp_io_s3 is wrapper function to invoke lockless func to
- * send  an iocb command to an HBA with SLI-4 interface spec.
+ * send  an iocb command to an HBA with SLI-3 interface spec.
  *
  * This function takes the hbalock before invoking the lockless version.
  * The function will return success after it successfully submit the wqe to
@@ -12740,7 +12739,7 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba *phba,
                cmdiocbq->cmd_cmpl = cmdiocbq->wait_cmd_cmpl;
                cmdiocbq->wait_cmd_cmpl = NULL;
                if (cmdiocbq->cmd_cmpl)
-                       (cmdiocbq->cmd_cmpl)(phba, cmdiocbq, NULL);
+                       cmdiocbq->cmd_cmpl(phba, cmdiocbq, NULL);
                else
                        lpfc_sli_release_iocbq(phba, cmdiocbq);
                return;
@@ -12754,9 +12753,9 @@ lpfc_sli_wake_iocb_wait(struct lpfc_hba *phba,
 
        /* Set the exchange busy flag for task management commands */
        if ((cmdiocbq->cmd_flag & LPFC_IO_FCP) &&
-               !(cmdiocbq->cmd_flag & LPFC_IO_LIBDFC)) {
+           !(cmdiocbq->cmd_flag & LPFC_IO_LIBDFC)) {
                lpfc_cmd = container_of(cmdiocbq, struct lpfc_io_buf,
-                       cur_iocbq);
+                                       cur_iocbq);
                if (rspiocbq && (rspiocbq->cmd_flag & LPFC_EXCHANGE_BUSY))
                        lpfc_cmd->flags |= LPFC_SBUF_XBUSY;
                else
@@ -13896,7 +13895,7 @@ void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *phba)
  * @irspiocbq: Pointer to work-queue completion queue entry.
  *
  * This routine handles an ELS work-queue completion event and construct
- * a pseudo response ELS IODBQ from the SLI4 ELS WCQE for the common
+ * a pseudo response ELS IOCBQ from the SLI4 ELS WCQE for the common
  * discovery engine to handle.
  *
  * Return: Pointer to the receive IOCBQ, NULL otherwise.
@@ -13940,7 +13939,7 @@ lpfc_sli4_els_preprocess_rspiocbq(struct lpfc_hba *phba,
 
        if (bf_get(lpfc_wcqe_c_xb, wcqe)) {
                spin_lock_irqsave(&phba->hbalock, iflags);
-               cmdiocbq->cmd_flag |= LPFC_EXCHANGE_BUSY;
+               irspiocbq->cmd_flag |= LPFC_EXCHANGE_BUSY;
                spin_unlock_irqrestore(&phba->hbalock, iflags);
        }
 
@@ -14799,7 +14798,7 @@ lpfc_sli4_fp_handle_fcp_wcqe(struct lpfc_hba *phba, struct lpfc_queue *cq,
                /* Pass the cmd_iocb and the wcqe to the upper layer */
                memcpy(&cmdiocbq->wcqe_cmpl, wcqe,
                       sizeof(struct lpfc_wcqe_complete));
-               (cmdiocbq->cmd_cmpl)(phba, cmdiocbq, cmdiocbq);
+               cmdiocbq->cmd_cmpl(phba, cmdiocbq, cmdiocbq);
        } else {
                lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
                                "0375 FCP cmdiocb not callback function "
@@ -18956,7 +18955,7 @@ lpfc_sli4_send_seq_to_ulp(struct lpfc_vport *vport,
 
        /* Free iocb created in lpfc_prep_seq */
        list_for_each_entry_safe(curr_iocb, next_iocb,
-               &iocbq->list, list) {
+                                &iocbq->list, list) {
                list_del_init(&curr_iocb->list);
                lpfc_sli_release_iocbq(phba, curr_iocb);
        }
index 4fab79e..2ab6f7d 100644 (file)
@@ -20,7 +20,7 @@
  * included with this package.                                     *
  *******************************************************************/
 
-#define LPFC_DRIVER_VERSION "14.2.0.3"
+#define LPFC_DRIVER_VERSION "14.2.0.4"
 #define LPFC_DRIVER_NAME               "lpfc"
 
 /* Used for SLI 2/3 */
index 37d46ae..9a1ae52 100644 (file)
@@ -5369,6 +5369,7 @@ static int _base_assign_fw_reported_qd(struct MPT3SAS_ADAPTER *ioc)
        Mpi2ConfigReply_t mpi_reply;
        Mpi2SasIOUnitPage1_t *sas_iounit_pg1 = NULL;
        Mpi26PCIeIOUnitPage1_t pcie_iounit_pg1;
+       u16 depth;
        int sz;
        int rc = 0;
 
@@ -5380,7 +5381,7 @@ static int _base_assign_fw_reported_qd(struct MPT3SAS_ADAPTER *ioc)
                goto out;
        /* sas iounit page 1 */
        sz = offsetof(Mpi2SasIOUnitPage1_t, PhyData);
-       sas_iounit_pg1 = kzalloc(sz, GFP_KERNEL);
+       sas_iounit_pg1 = kzalloc(sizeof(Mpi2SasIOUnitPage1_t), GFP_KERNEL);
        if (!sas_iounit_pg1) {
                pr_err("%s: failure at %s:%d/%s()!\n",
                    ioc->name, __FILE__, __LINE__, __func__);
@@ -5393,16 +5394,16 @@ static int _base_assign_fw_reported_qd(struct MPT3SAS_ADAPTER *ioc)
                    ioc->name, __FILE__, __LINE__, __func__);
                goto out;
        }
-       ioc->max_wideport_qd =
-           (le16_to_cpu(sas_iounit_pg1->SASWideMaxQueueDepth)) ?
-           le16_to_cpu(sas_iounit_pg1->SASWideMaxQueueDepth) :
-           MPT3SAS_SAS_QUEUE_DEPTH;
-       ioc->max_narrowport_qd =
-           (le16_to_cpu(sas_iounit_pg1->SASNarrowMaxQueueDepth)) ?
-           le16_to_cpu(sas_iounit_pg1->SASNarrowMaxQueueDepth) :
-           MPT3SAS_SAS_QUEUE_DEPTH;
-       ioc->max_sata_qd = (sas_iounit_pg1->SATAMaxQDepth) ?
-           sas_iounit_pg1->SATAMaxQDepth : MPT3SAS_SATA_QUEUE_DEPTH;
+
+       depth = le16_to_cpu(sas_iounit_pg1->SASWideMaxQueueDepth);
+       ioc->max_wideport_qd = (depth ? depth : MPT3SAS_SAS_QUEUE_DEPTH);
+
+       depth = le16_to_cpu(sas_iounit_pg1->SASNarrowMaxQueueDepth);
+       ioc->max_narrowport_qd = (depth ? depth : MPT3SAS_SAS_QUEUE_DEPTH);
+
+       depth = sas_iounit_pg1->SATAMaxQDepth;
+       ioc->max_sata_qd = (depth ? depth : MPT3SAS_SATA_QUEUE_DEPTH);
+
        /* pcie iounit page 1 */
        rc = mpt3sas_config_get_pcie_iounit_pg1(ioc, &mpi_reply,
            &pcie_iounit_pg1, sizeof(Mpi26PCIeIOUnitPage1_t));
index bfce601..836ddc4 100644 (file)
@@ -4031,7 +4031,7 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance)
        return 0;
 
 out_unwind:
-       while (--i > 0)
+       while (--i >= 0)
                free_irq(pci_irq_vector(pdev, i), &pinstance->hrrq_vector[i]);
        pci_free_irq_vectors(pdev);
        return rc;
index 1f423f7..b8a76b8 100644 (file)
@@ -2826,6 +2826,24 @@ static void zbc_open_zone(struct sdebug_dev_info *devip,
        }
 }
 
+static inline void zbc_set_zone_full(struct sdebug_dev_info *devip,
+                                    struct sdeb_zone_state *zsp)
+{
+       switch (zsp->z_cond) {
+       case ZC2_IMPLICIT_OPEN:
+               devip->nr_imp_open--;
+               break;
+       case ZC3_EXPLICIT_OPEN:
+               devip->nr_exp_open--;
+               break;
+       default:
+               WARN_ONCE(true, "Invalid zone %llu condition %x\n",
+                         zsp->z_start, zsp->z_cond);
+               break;
+       }
+       zsp->z_cond = ZC5_FULL;
+}
+
 static void zbc_inc_wp(struct sdebug_dev_info *devip,
                       unsigned long long lba, unsigned int num)
 {
@@ -2838,7 +2856,7 @@ static void zbc_inc_wp(struct sdebug_dev_info *devip,
        if (zsp->z_type == ZBC_ZTYPE_SWR) {
                zsp->z_wp += num;
                if (zsp->z_wp >= zend)
-                       zsp->z_cond = ZC5_FULL;
+                       zbc_set_zone_full(devip, zsp);
                return;
        }
 
@@ -2857,7 +2875,7 @@ static void zbc_inc_wp(struct sdebug_dev_info *devip,
                        n = num;
                }
                if (zsp->z_wp >= zend)
-                       zsp->z_cond = ZC5_FULL;
+                       zbc_set_zone_full(devip, zsp);
 
                num -= n;
                lba += n;
index 2c0dd64..5d21f07 100644 (file)
@@ -212,7 +212,12 @@ iscsi_create_endpoint(int dd_size)
                return NULL;
 
        mutex_lock(&iscsi_ep_idr_mutex);
-       id = idr_alloc(&iscsi_ep_idr, ep, 0, -1, GFP_NOIO);
+
+       /*
+        * First endpoint id should be 1 to comply with user space
+        * applications (iscsid).
+        */
+       id = idr_alloc(&iscsi_ep_idr, ep, 1, -1, GFP_NOIO);
        if (id < 0) {
                mutex_unlock(&iscsi_ep_idr_mutex);
                printk(KERN_ERR "Could not allocate endpoint ID. Error %d.\n",
index 895b56c..a1a2ac0 100644 (file)
@@ -3072,7 +3072,7 @@ static void sd_read_cpr(struct scsi_disk *sdkp)
                goto out;
 
        /* We must have at least a 64B header and one 32B range descriptor */
-       vpd_len = get_unaligned_be16(&buffer[2]) + 3;
+       vpd_len = get_unaligned_be16(&buffer[2]) + 4;
        if (vpd_len > buf_len || vpd_len < 64 + 32 || (vpd_len & 31)) {
                sd_printk(KERN_ERR, sdkp,
                          "Invalid Concurrent Positioning Ranges VPD page\n");
index ca35309..fe000da 100644 (file)
@@ -1844,7 +1844,7 @@ static struct scsi_host_template scsi_driver = {
        .cmd_per_lun =          2048,
        .this_id =              -1,
        /* Ensure there are no gaps in presented sgls */
-       .virt_boundary_mask =   PAGE_SIZE-1,
+       .virt_boundary_mask =   HV_HYP_PAGE_SIZE - 1,
        .no_write_same =        1,
        .track_queue_depth =    1,
        .change_queue_depth =   storvsc_change_queue_depth,
@@ -1895,6 +1895,7 @@ static int storvsc_probe(struct hv_device *device,
        int target = 0;
        struct storvsc_device *stor_device;
        int max_sub_channels = 0;
+       u32 max_xfer_bytes;
 
        /*
         * We support sub-channels for storage on SCSI and FC controllers.
@@ -1968,12 +1969,28 @@ static int storvsc_probe(struct hv_device *device,
        }
        /* max cmd length */
        host->max_cmd_len = STORVSC_MAX_CMD_LEN;
-
        /*
-        * set the table size based on the info we got
-        * from the host.
+        * Any reasonable Hyper-V configuration should provide
+        * max_transfer_bytes value aligning to HV_HYP_PAGE_SIZE,
+        * protecting it from any weird value.
+        */
+       max_xfer_bytes = round_down(stor_device->max_transfer_bytes, HV_HYP_PAGE_SIZE);
+       /* max_hw_sectors_kb */
+       host->max_sectors = max_xfer_bytes >> 9;
+       /*
+        * There are 2 requirements for Hyper-V storvsc sgl segments,
+        * based on which the below calculation for max segments is
+        * done:
+        *
+        * 1. Except for the first and last sgl segment, all sgl segments
+        *    should be align to HV_HYP_PAGE_SIZE, that also means the
+        *    maximum number of segments in a sgl can be calculated by
+        *    dividing the total max transfer length by HV_HYP_PAGE_SIZE.
+        *
+        * 2. Except for the first and last, each entry in the SGL must
+        *    have an offset that is a multiple of HV_HYP_PAGE_SIZE.
         */
-       host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
+       host->sg_tablesize = (max_xfer_bytes >> HV_HYP_PAGE_SHIFT) + 1;
        /*
         * For non-IDE disks, the host supports multiple channels.
         * Set the number of HW queues we are supporting.
index 51a82f7..9d16cf9 100644 (file)
@@ -331,8 +331,8 @@ struct PVSCSIRingReqDesc {
        u8      tag;
        u8      bus;
        u8      target;
-       u     vcpuHint;
-       u8      unused[59];
+       u16     vcpuHint;
+       u8      unused[58];
 } __packed;
 
 /*
index 3cbb165..70ad0f3 100644 (file)
@@ -783,6 +783,7 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
        }
 
        ret = brcmstb_init_sram(dn);
+       of_node_put(dn);
        if (ret) {
                pr_err("error setting up SRAM for PM\n");
                return ret;
index 7f49385..7ebc287 100644 (file)
@@ -667,7 +667,7 @@ static const struct imx8m_blk_ctrl_domain_data imx8mp_media_blk_ctl_domain_data[
        },
        [IMX8MP_MEDIABLK_PD_LCDIF_2] = {
                .name = "mediablk-lcdif-2",
-               .clk_names = (const char *[]){ "disp1", "apb", "axi", },
+               .clk_names = (const char *[]){ "disp2", "apb", "axi", },
                .num_clks = 3,
                .gpc_name = "lcdif2",
                .rst_mask = BIT(11) | BIT(12) | BIT(24),
index a23d4f6..31d778e 100644 (file)
@@ -69,6 +69,7 @@
 #define CDNS_SPI_BAUD_DIV_SHIFT                3 /* Baud rate divisor shift in CR */
 #define CDNS_SPI_SS_SHIFT              10 /* Slave Select field shift in CR */
 #define CDNS_SPI_SS0                   0x1 /* Slave Select zero */
+#define CDNS_SPI_NOSS                  0x3C /* No Slave select */
 
 /*
  * SPI Interrupt Registers bit Masks
@@ -92,9 +93,6 @@
 #define CDNS_SPI_ER_ENABLE     0x00000001 /* SPI Enable Bit Mask */
 #define CDNS_SPI_ER_DISABLE    0x0 /* SPI Disable Bit Mask */
 
-/* SPI FIFO depth in bytes */
-#define CDNS_SPI_FIFO_DEPTH    128
-
 /* Default number of chip select lines */
 #define CDNS_SPI_DEFAULT_NUM_CS                4
 
  * @rx_bytes:          Number of bytes requested
  * @dev_busy:          Device busy flag
  * @is_decoded_cs:     Flag for decoder property set or not
+ * @tx_fifo_depth:     Depth of the TX FIFO
  */
 struct cdns_spi {
        void __iomem *regs;
@@ -123,6 +122,7 @@ struct cdns_spi {
        int rx_bytes;
        u8 dev_busy;
        u32 is_decoded_cs;
+       unsigned int tx_fifo_depth;
 };
 
 /* Macros for the SPI controller read/write */
@@ -304,7 +304,7 @@ static void cdns_spi_fill_tx_fifo(struct cdns_spi *xspi)
 {
        unsigned long trans_cnt = 0;
 
-       while ((trans_cnt < CDNS_SPI_FIFO_DEPTH) &&
+       while ((trans_cnt < xspi->tx_fifo_depth) &&
               (xspi->tx_bytes > 0)) {
 
                /* When xspi in busy condition, bytes may send failed,
@@ -450,19 +450,42 @@ static int cdns_prepare_transfer_hardware(struct spi_master *master)
  * @master:    Pointer to the spi_master structure which provides
  *             information about the controller.
  *
- * This function disables the SPI master controller.
+ * This function disables the SPI master controller when no slave selected.
  *
  * Return:     0 always
  */
 static int cdns_unprepare_transfer_hardware(struct spi_master *master)
 {
        struct cdns_spi *xspi = spi_master_get_devdata(master);
+       u32 ctrl_reg;
 
-       cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE);
+       /* Disable the SPI if slave is deselected */
+       ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR);
+       ctrl_reg = (ctrl_reg & CDNS_SPI_CR_SSCTRL) >>  CDNS_SPI_SS_SHIFT;
+       if (ctrl_reg == CDNS_SPI_NOSS)
+               cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE);
 
        return 0;
 }
 
+/**
+ * cdns_spi_detect_fifo_depth - Detect the FIFO depth of the hardware
+ * @xspi:      Pointer to the cdns_spi structure
+ *
+ * The depth of the TX FIFO is a synthesis configuration parameter of the SPI
+ * IP. The FIFO threshold register is sized so that its maximum value can be the
+ * FIFO size - 1. This is used to detect the size of the FIFO.
+ */
+static void cdns_spi_detect_fifo_depth(struct cdns_spi *xspi)
+{
+       /* The MSBs will get truncated giving us the size of the FIFO */
+       cdns_spi_write(xspi, CDNS_SPI_THLD, 0xffff);
+       xspi->tx_fifo_depth = cdns_spi_read(xspi, CDNS_SPI_THLD) + 1;
+
+       /* Reset to default */
+       cdns_spi_write(xspi, CDNS_SPI_THLD, 0x1);
+}
+
 /**
  * cdns_spi_probe - Probe method for the SPI driver
  * @pdev:      Pointer to the platform_device structure
@@ -535,6 +558,8 @@ static int cdns_spi_probe(struct platform_device *pdev)
        if (ret < 0)
                xspi->is_decoded_cs = 0;
 
+       cdns_spi_detect_fifo_depth(xspi);
+
        /* SPI controller initializations */
        cdns_spi_init_hw(xspi);
 
index e8de4f5..0c79193 100644 (file)
@@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem,
            op->data.dir != SPI_MEM_DATA_IN)
                return -EINVAL;
 
-       if (ctlr->mem_ops && ctlr->mem_ops->poll_status) {
+       if (ctlr->mem_ops && ctlr->mem_ops->poll_status && !mem->spi->cs_gpiod) {
                ret = spi_mem_access_start(mem);
                if (ret)
                        return ret;
index a08215e..79242dc 100644 (file)
@@ -381,15 +381,18 @@ static int rockchip_spi_prepare_irq(struct rockchip_spi *rs,
        rs->tx_left = rs->tx ? xfer->len / rs->n_bytes : 0;
        rs->rx_left = xfer->len / rs->n_bytes;
 
-       if (rs->cs_inactive)
-               writel_relaxed(INT_RF_FULL | INT_CS_INACTIVE, rs->regs + ROCKCHIP_SPI_IMR);
-       else
-               writel_relaxed(INT_RF_FULL, rs->regs + ROCKCHIP_SPI_IMR);
+       writel_relaxed(0xffffffff, rs->regs + ROCKCHIP_SPI_ICR);
+
        spi_enable_chip(rs, true);
 
        if (rs->tx_left)
                rockchip_spi_pio_writer(rs);
 
+       if (rs->cs_inactive)
+               writel_relaxed(INT_RF_FULL | INT_CS_INACTIVE, rs->regs + ROCKCHIP_SPI_IMR);
+       else
+               writel_relaxed(INT_RF_FULL, rs->regs + ROCKCHIP_SPI_IMR);
+
        /* 1 means the transfer is in progress */
        return 1;
 }
index d1a0dea..d0ba34c 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 config FB_OLPC_DCON
        tristate "One Laptop Per Child Display CONtroller support"
-       depends on OLPC && FB
+       depends on OLPC && FB && BROKEN
        depends on I2C
        depends on GPIO_CS5535 && ACPI
        select BACKLIGHT_CLASS_DEVICE
index 3d8e9de..7135d89 100644 (file)
@@ -178,8 +178,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
 
        pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf;
 
-       res = rtw_alloc_hwxmits(padapter);
-       if (res) {
+       if (rtw_alloc_hwxmits(padapter)) {
                res = _FAIL;
                goto exit;
        }
@@ -1483,19 +1482,10 @@ int rtw_alloc_hwxmits(struct adapter *padapter)
 
        hwxmits = pxmitpriv->hwxmits;
 
-       if (pxmitpriv->hwxmit_entry == 5) {
-               hwxmits[0] .sta_queue = &pxmitpriv->bm_pending;
-               hwxmits[1] .sta_queue = &pxmitpriv->vo_pending;
-               hwxmits[2] .sta_queue = &pxmitpriv->vi_pending;
-               hwxmits[3] .sta_queue = &pxmitpriv->bk_pending;
-               hwxmits[4] .sta_queue = &pxmitpriv->be_pending;
-       } else if (pxmitpriv->hwxmit_entry == 4) {
-               hwxmits[0] .sta_queue = &pxmitpriv->vo_pending;
-               hwxmits[1] .sta_queue = &pxmitpriv->vi_pending;
-               hwxmits[2] .sta_queue = &pxmitpriv->be_pending;
-               hwxmits[3] .sta_queue = &pxmitpriv->bk_pending;
-       } else {
-       }
+       hwxmits[0].sta_queue = &pxmitpriv->vo_pending;
+       hwxmits[1].sta_queue = &pxmitpriv->vi_pending;
+       hwxmits[2].sta_queue = &pxmitpriv->be_pending;
+       hwxmits[3].sta_queue = &pxmitpriv->bk_pending;
 
        return 0;
 }
index 1b09462..8dd280e 100644 (file)
@@ -403,7 +403,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
 
                if (wep_key_len > 0) {
                        wep_key_len = wep_key_len <= 5 ? 5 : 13;
-                       wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, KeyMaterial);
+                       wep_total_len = wep_key_len + sizeof(*pwep);
                        pwep = kzalloc(wep_total_len, GFP_KERNEL);
                        if (!pwep)
                                goto exit;
index ece97e3..30374a8 100644 (file)
@@ -90,7 +90,8 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
                if (wep_key_len > 0) {
                        wep_key_len = wep_key_len <= 5 ? 5 : 13;
                        wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, key_material);
-                       pwep = kzalloc(wep_total_len, GFP_KERNEL);
+                       /* Allocate a full structure to avoid potentially running off the end. */
+                       pwep = kzalloc(sizeof(*pwep), GFP_KERNEL);
                        if (!pwep) {
                                ret = -ENOMEM;
                                goto exit;
@@ -582,7 +583,8 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
                if (wep_key_len > 0) {
                        wep_key_len = wep_key_len <= 5 ? 5 : 13;
                        wep_total_len = wep_key_len + FIELD_OFFSET(struct ndis_802_11_wep, key_material);
-                       pwep = kzalloc(wep_total_len, GFP_KERNEL);
+                       /* Allocate a full structure to avoid potentially running off the end. */
+                       pwep = kzalloc(sizeof(*pwep), GFP_KERNEL);
                        if (!pwep)
                                goto exit;
 
index c7968ae..d02de3f 100644 (file)
@@ -426,7 +426,7 @@ static int goldfish_tty_remove(struct platform_device *pdev)
        tty_unregister_device(goldfish_tty_driver, qtty->console.index);
        iounmap(qtty->base);
        qtty->base = NULL;
-       free_irq(qtty->irq, pdev);
+       free_irq(qtty->irq, qtty);
        tty_port_destroy(&qtty->port);
        goldfish_tty_current_line_count--;
        if (goldfish_tty_current_line_count == 0)
index 137eebd..fd4d24f 100644 (file)
@@ -455,7 +455,7 @@ static void gsm_hex_dump_bytes(const char *fname, const u8 *data,
                return;
        }
 
-       prefix = kasprintf(GFP_KERNEL, "%s: ", fname);
+       prefix = kasprintf(GFP_ATOMIC, "%s: ", fname);
        if (!prefix)
                return;
        print_hex_dump(KERN_INFO, prefix, DUMP_PREFIX_OFFSET, 16, 1, data, len,
index 78b6ded..8f32fe9 100644 (file)
@@ -1517,6 +1517,8 @@ static inline void __stop_tx(struct uart_8250_port *p)
                unsigned char lsr = serial_in(p, UART_LSR);
                u64 stop_delay = 0;
 
+               p->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
+
                if (!(lsr & UART_LSR_THRE))
                        return;
                /*
index 4733a23..f8f9506 100644 (file)
@@ -1306,6 +1306,7 @@ static const struct uart_ops qcom_geni_console_pops = {
        .stop_tx = qcom_geni_serial_stop_tx,
        .start_tx = qcom_geni_serial_start_tx,
        .stop_rx = qcom_geni_serial_stop_rx,
+       .start_rx = qcom_geni_serial_start_rx,
        .set_termios = qcom_geni_serial_set_termios,
        .startup = qcom_geni_serial_startup,
        .request_port = qcom_geni_serial_request_port,
index 9a85b41..338ebad 100644 (file)
@@ -2214,11 +2214,12 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
        /*
         * Nothing to do if the console is not suspending
         * except stop_rx to prevent any asynchronous data
-        * over RX line. Re-start_rx, when required, is
-        * done by set_termios in resume sequence
+        * over RX line. However ensure that we will be
+        * able to Re-start_rx later.
         */
        if (!console_suspend_enabled && uart_console(uport)) {
-               uport->ops->stop_rx(uport);
+               if (uport->ops->start_rx)
+                       uport->ops->stop_rx(uport);
                goto unlock;
        }
 
@@ -2310,6 +2311,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
                if (console_suspend_enabled)
                        uart_change_pm(state, UART_PM_STATE_ON);
                uport->ops->set_termios(uport, &termios, NULL);
+               if (!console_suspend_enabled && uport->ops->start_rx)
+                       uport->ops->start_rx(uport);
                if (console_suspend_enabled)
                        console_start(uport->cons);
        }
index 18e6233..d2b2720 100644 (file)
@@ -581,7 +581,6 @@ void __handle_sysrq(int key, bool check_mask)
 
        rcu_sysrq_start();
        rcu_read_lock();
-       printk_prefer_direct_enter();
        /*
         * Raise the apparent loglevel to maximum so that the sysrq header
         * is shown to provide the user with positive feedback.  We do not
@@ -623,7 +622,6 @@ void __handle_sysrq(int key, bool check_mask)
                pr_cont("\n");
                console_loglevel = orig_log_level;
        }
-       printk_prefer_direct_exit();
        rcu_read_unlock();
        rcu_sysrq_end();
 
index 01fb4ba..ce86d1b 100644 (file)
@@ -748,17 +748,28 @@ static enum utp_ocs ufshcd_get_tr_ocs(struct ufshcd_lrb *lrbp)
 }
 
 /**
- * ufshcd_utrl_clear - Clear a bit in UTRLCLR register
+ * ufshcd_utrl_clear() - Clear requests from the controller request list.
  * @hba: per adapter instance
- * @pos: position of the bit to be cleared
+ * @mask: mask with one bit set for each request to be cleared
  */
-static inline void ufshcd_utrl_clear(struct ufs_hba *hba, u32 pos)
+static inline void ufshcd_utrl_clear(struct ufs_hba *hba, u32 mask)
 {
        if (hba->quirks & UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR)
-               ufshcd_writel(hba, (1 << pos), REG_UTP_TRANSFER_REQ_LIST_CLEAR);
-       else
-               ufshcd_writel(hba, ~(1 << pos),
-                               REG_UTP_TRANSFER_REQ_LIST_CLEAR);
+               mask = ~mask;
+       /*
+        * From the UFSHCI specification: "UTP Transfer Request List CLear
+        * Register (UTRLCLR): This field is bit significant. Each bit
+        * corresponds to a slot in the UTP Transfer Request List, where bit 0
+        * corresponds to request slot 0. A bit in this field is set to ‘0’
+        * by host software to indicate to the host controller that a transfer
+        * request slot is cleared. The host controller
+        * shall free up any resources associated to the request slot
+        * immediately, and shall set the associated bit in UTRLDBR to ‘0’. The
+        * host software indicates no change to request slots by setting the
+        * associated bits in this field to ‘1’. Bits in this field shall only
+        * be set ‘1’ or ‘0’ by host software when UTRLRSR is set to ‘1’."
+        */
+       ufshcd_writel(hba, ~mask, REG_UTP_TRANSFER_REQ_LIST_CLEAR);
 }
 
 /**
@@ -2863,27 +2874,26 @@ static int ufshcd_compose_dev_cmd(struct ufs_hba *hba,
        return ufshcd_compose_devman_upiu(hba, lrbp);
 }
 
-static int
-ufshcd_clear_cmd(struct ufs_hba *hba, int tag)
+/*
+ * Clear all the requests from the controller for which a bit has been set in
+ * @mask and wait until the controller confirms that these requests have been
+ * cleared.
+ */
+static int ufshcd_clear_cmds(struct ufs_hba *hba, u32 mask)
 {
-       int err = 0;
        unsigned long flags;
-       u32 mask = 1 << tag;
 
        /* clear outstanding transaction before retry */
        spin_lock_irqsave(hba->host->host_lock, flags);
-       ufshcd_utrl_clear(hba, tag);
+       ufshcd_utrl_clear(hba, mask);
        spin_unlock_irqrestore(hba->host->host_lock, flags);
 
        /*
         * wait for h/w to clear corresponding bit in door-bell.
         * max. wait is 1 sec.
         */
-       err = ufshcd_wait_for_register(hba,
-                       REG_UTP_TRANSFER_REQ_DOOR_BELL,
-                       mask, ~mask, 1000, 1000);
-
-       return err;
+       return ufshcd_wait_for_register(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL,
+                                       mask, ~mask, 1000, 1000);
 }
 
 static int
@@ -2963,7 +2973,7 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
                err = -ETIMEDOUT;
                dev_dbg(hba->dev, "%s: dev_cmd request timedout, tag %d\n",
                        __func__, lrbp->task_tag);
-               if (!ufshcd_clear_cmd(hba, lrbp->task_tag))
+               if (!ufshcd_clear_cmds(hba, 1U << lrbp->task_tag))
                        /* successfully cleared the command, retry if needed */
                        err = -EAGAIN;
                /*
@@ -6958,14 +6968,14 @@ int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
 }
 
 /**
- * ufshcd_eh_device_reset_handler - device reset handler registered to
- *                                    scsi layer.
+ * ufshcd_eh_device_reset_handler() - Reset a single logical unit.
  * @cmd: SCSI command pointer
  *
  * Returns SUCCESS/FAILED
  */
 static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
 {
+       unsigned long flags, pending_reqs = 0, not_cleared = 0;
        struct Scsi_Host *host;
        struct ufs_hba *hba;
        u32 pos;
@@ -6984,14 +6994,24 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
        }
 
        /* clear the commands that were pending for corresponding LUN */
-       for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
-               if (hba->lrb[pos].lun == lun) {
-                       err = ufshcd_clear_cmd(hba, pos);
-                       if (err)
-                               break;
-                       __ufshcd_transfer_req_compl(hba, 1U << pos);
-               }
+       spin_lock_irqsave(&hba->outstanding_lock, flags);
+       for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs)
+               if (hba->lrb[pos].lun == lun)
+                       __set_bit(pos, &pending_reqs);
+       hba->outstanding_reqs &= ~pending_reqs;
+       spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+
+       if (ufshcd_clear_cmds(hba, pending_reqs) < 0) {
+               spin_lock_irqsave(&hba->outstanding_lock, flags);
+               not_cleared = pending_reqs &
+                       ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
+               hba->outstanding_reqs |= not_cleared;
+               spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+
+               dev_err(hba->dev, "%s: failed to clear requests %#lx\n",
+                       __func__, not_cleared);
        }
+       __ufshcd_transfer_req_compl(hba, pending_reqs & ~not_cleared);
 
 out:
        hba->req_abort_count = 0;
@@ -7088,7 +7108,7 @@ static int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
                goto out;
        }
 
-       err = ufshcd_clear_cmd(hba, tag);
+       err = ufshcd_clear_cmds(hba, 1U << tag);
        if (err)
                dev_err(hba->dev, "%s: Failed clearing cmd at tag %d, err %d\n",
                        __func__, tag, err);
index e45c3d6..794e413 100644 (file)
@@ -1941,13 +1941,16 @@ int cdnsp_queue_bulk_tx(struct cdnsp_device *pdev, struct cdnsp_request *preq)
                }
 
                if (enqd_len + trb_buff_len >= full_len) {
-                       if (need_zero_pkt)
-                               zero_len_trb = !zero_len_trb;
-
-                       field &= ~TRB_CHAIN;
-                       field |= TRB_IOC;
-                       more_trbs_coming = false;
-                       preq->td.last_trb = ring->enqueue;
+                       if (need_zero_pkt && !zero_len_trb) {
+                               zero_len_trb = true;
+                       } else {
+                               zero_len_trb = false;
+                               field &= ~TRB_CHAIN;
+                               field |= TRB_IOC;
+                               more_trbs_coming = false;
+                               need_zero_pkt = false;
+                               preq->td.last_trb = ring->enqueue;
+                       }
                }
 
                /* Only set interrupt on short packet for OUT endpoints. */
@@ -1962,7 +1965,7 @@ int cdnsp_queue_bulk_tx(struct cdnsp_device *pdev, struct cdnsp_request *preq)
                length_field = TRB_LEN(trb_buff_len) | TRB_TD_SIZE(remainder) |
                        TRB_INTR_TARGET(0);
 
-               cdnsp_queue_trb(pdev, ring, more_trbs_coming | zero_len_trb,
+               cdnsp_queue_trb(pdev, ring, more_trbs_coming,
                                lower_32_bits(send_addr),
                                upper_32_bits(send_addr),
                                length_field,
index dc6c96e..3b8bf6d 100644 (file)
@@ -1048,6 +1048,9 @@ isr_setup_status_complete(struct usb_ep *ep, struct usb_request *req)
        struct ci_hdrc *ci = req->context;
        unsigned long flags;
 
+       if (req->status < 0)
+               return;
+
        if (ci->setaddr) {
                hw_usb_set_address(ci, ci->address);
                ci->setaddr = false;
index f63a27d..3f107a0 100644 (file)
@@ -5190,7 +5190,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res) {
                retval = -EINVAL;
-               goto error1;
+               goto error2;
        }
        hcd->rsrc_start = res->start;
        hcd->rsrc_len = resource_size(res);
index e027c04..5734219 100644 (file)
@@ -1644,13 +1644,8 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
         * This device property is for kernel internal use only and
         * is expected to be set by the glue code.
         */
-       if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
-               edev = extcon_get_extcon_dev(name);
-               if (!edev)
-                       return ERR_PTR(-EPROBE_DEFER);
-
-               return edev;
-       }
+       if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
+               return extcon_get_extcon_dev(name);
 
        /*
         * Try to get an extcon device from the USB PHY controller's "port"
index ba51de7..6b01804 100644 (file)
@@ -127,6 +127,7 @@ static const struct property_entry dwc3_pci_intel_phy_charger_detect_properties[
        PROPERTY_ENTRY_STRING("dr_mode", "peripheral"),
        PROPERTY_ENTRY_BOOL("snps,dis_u2_susphy_quirk"),
        PROPERTY_ENTRY_BOOL("linux,phy_charger_detect"),
+       PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
        {}
 };
 
index 00427d1..8716bec 100644 (file)
@@ -2976,6 +2976,7 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep)
        struct dwc3 *dwc = dep->dwc;
        u32 mdwidth;
        int size;
+       int maxpacket;
 
        mdwidth = dwc3_mdwidth(dwc);
 
@@ -2988,21 +2989,24 @@ static int dwc3_gadget_init_in_endpoint(struct dwc3_ep *dep)
        else
                size = DWC31_GTXFIFOSIZ_TXFDEP(size);
 
-       /* FIFO Depth is in MDWDITH bytes. Multiply */
-       size *= mdwidth;
-
        /*
-        * To meet performance requirement, a minimum TxFIFO size of 3x
-        * MaxPacketSize is recommended for endpoints that support burst and a
-        * minimum TxFIFO size of 2x MaxPacketSize for endpoints that don't
-        * support burst. Use those numbers and we can calculate the max packet
-        * limit as below.
+        * maxpacket size is determined as part of the following, after assuming
+        * a mult value of one maxpacket:
+        * DWC3 revision 280A and prior:
+        * fifo_size = mult * (max_packet / mdwidth) + 1;
+        * maxpacket = mdwidth * (fifo_size - 1);
+        *
+        * DWC3 revision 290A and onwards:
+        * fifo_size = mult * ((max_packet + mdwidth)/mdwidth + 1) + 1
+        * maxpacket = mdwidth * ((fifo_size - 1) - 1) - mdwidth;
         */
-       if (dwc->maximum_speed >= USB_SPEED_SUPER)
-               size /= 3;
+       if (DWC3_VER_IS_PRIOR(DWC3, 290A))
+               maxpacket = mdwidth * (size - 1);
        else
-               size /= 2;
+               maxpacket = mdwidth * ((size - 1) - 1) - mdwidth;
 
+       /* Functionally, space for one max packet is sufficient */
+       size = min_t(int, maxpacket, 1024);
        usb_ep_set_maxpacket_limit(&dep->endpoint, size);
 
        dep->endpoint.max_streams = 16;
index 4585ee3..e0fa4b1 100644 (file)
@@ -122,8 +122,6 @@ struct ffs_ep {
        struct usb_endpoint_descriptor  *descs[3];
 
        u8                              num;
-
-       int                             status; /* P: epfile->mutex */
 };
 
 struct ffs_epfile {
@@ -227,6 +225,9 @@ struct ffs_io_data {
        bool use_sg;
 
        struct ffs_data *ffs;
+
+       int status;
+       struct completion done;
 };
 
 struct ffs_desc_helper {
@@ -707,12 +708,15 @@ static const struct file_operations ffs_ep0_operations = {
 
 static void ffs_epfile_io_complete(struct usb_ep *_ep, struct usb_request *req)
 {
+       struct ffs_io_data *io_data = req->context;
+
        ENTER();
-       if (req->context) {
-               struct ffs_ep *ep = _ep->driver_data;
-               ep->status = req->status ? req->status : req->actual;
-               complete(req->context);
-       }
+       if (req->status)
+               io_data->status = req->status;
+       else
+               io_data->status = req->actual;
+
+       complete(&io_data->done);
 }
 
 static ssize_t ffs_copy_to_iter(void *data, int data_len, struct iov_iter *iter)
@@ -1050,7 +1054,6 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
                WARN(1, "%s: data_len == -EINVAL\n", __func__);
                ret = -EINVAL;
        } else if (!io_data->aio) {
-               DECLARE_COMPLETION_ONSTACK(done);
                bool interrupted = false;
 
                req = ep->req;
@@ -1066,7 +1069,8 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
 
                io_data->buf = data;
 
-               req->context  = &done;
+               init_completion(&io_data->done);
+               req->context  = io_data;
                req->complete = ffs_epfile_io_complete;
 
                ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC);
@@ -1075,7 +1079,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
 
                spin_unlock_irq(&epfile->ffs->eps_lock);
 
-               if (wait_for_completion_interruptible(&done)) {
+               if (wait_for_completion_interruptible(&io_data->done)) {
+                       spin_lock_irq(&epfile->ffs->eps_lock);
+                       if (epfile->ep != ep) {
+                               ret = -ESHUTDOWN;
+                               goto error_lock;
+                       }
                        /*
                         * To avoid race condition with ffs_epfile_io_complete,
                         * dequeue the request first then check
@@ -1083,17 +1092,18 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
                         * condition with req->complete callback.
                         */
                        usb_ep_dequeue(ep->ep, req);
-                       wait_for_completion(&done);
-                       interrupted = ep->status < 0;
+                       spin_unlock_irq(&epfile->ffs->eps_lock);
+                       wait_for_completion(&io_data->done);
+                       interrupted = io_data->status < 0;
                }
 
                if (interrupted)
                        ret = -EINTR;
-               else if (io_data->read && ep->status > 0)
-                       ret = __ffs_epfile_read_data(epfile, data, ep->status,
+               else if (io_data->read && io_data->status > 0)
+                       ret = __ffs_epfile_read_data(epfile, data, io_data->status,
                                                     &io_data->data);
                else
-                       ret = ep->status;
+                       ret = io_data->status;
                goto error_mutex;
        } else if (!(req = usb_ep_alloc_request(ep->ep, GFP_ATOMIC))) {
                ret = -ENOMEM;
index 6f5d45e..f51694f 100644 (file)
@@ -775,9 +775,13 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
        dev->qmult = qmult;
        snprintf(net->name, sizeof(net->name), "%s%%d", netname);
 
-       if (get_ether_addr(dev_addr, addr))
+       if (get_ether_addr(dev_addr, addr)) {
+               net->addr_assign_type = NET_ADDR_RANDOM;
                dev_warn(&g->dev,
                        "using random %s ethernet address\n", "self");
+       } else {
+               net->addr_assign_type = NET_ADDR_SET;
+       }
        eth_hw_addr_set(net, addr);
        if (get_ether_addr(host_addr, dev->host_mac))
                dev_warn(&g->dev,
@@ -844,6 +848,10 @@ struct net_device *gether_setup_name_default(const char *netname)
 
        eth_random_addr(dev->dev_mac);
        pr_warn("using random %s ethernet address\n", "self");
+
+       /* by default we always have a random MAC address */
+       net->addr_assign_type = NET_ADDR_RANDOM;
+
        eth_random_addr(dev->host_mac);
        pr_warn("using random %s ethernet address\n", "host");
 
@@ -871,7 +879,6 @@ int gether_register_netdev(struct net_device *net)
        dev = netdev_priv(net);
        g = dev->gadget;
 
-       net->addr_assign_type = NET_ADDR_RANDOM;
        eth_hw_addr_set(net, dev->dev_mac);
 
        status = register_netdev(net);
@@ -912,6 +919,7 @@ int gether_set_dev_addr(struct net_device *net, const char *dev_addr)
        if (get_ether_addr(dev_addr, new_addr))
                return -EINVAL;
        memcpy(dev->dev_mac, new_addr, ETH_ALEN);
+       net->addr_assign_type = NET_ADDR_SET;
        return 0;
 }
 EXPORT_SYMBOL_GPL(gether_set_dev_addr);
index a9bb455..d42bb33 100644 (file)
@@ -424,6 +424,9 @@ static void uvcg_video_pump(struct work_struct *work)
                        uvcg_queue_cancel(queue, 0);
                        break;
                }
+
+               /* Endpoint now owns the request */
+               req = NULL;
                video->req_int_count++;
        }
 
index 2417400..2acece1 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/ctype.h>
 #include <linux/debugfs.h>
 #include <linux/delay.h>
+#include <linux/idr.h>
 #include <linux/kref.h>
 #include <linux/miscdevice.h>
 #include <linux/module.h>
@@ -36,6 +37,9 @@ MODULE_LICENSE("GPL");
 
 /*----------------------------------------------------------------------*/
 
+static DEFINE_IDA(driver_id_numbers);
+#define DRIVER_DRIVER_NAME_LENGTH_MAX  32
+
 #define RAW_EVENT_QUEUE_SIZE   16
 
 struct raw_event_queue {
@@ -161,6 +165,9 @@ struct raw_dev {
        /* Reference to misc device: */
        struct device                   *dev;
 
+       /* Make driver names unique */
+       int                             driver_id_number;
+
        /* Protected by lock: */
        enum dev_state                  state;
        bool                            gadget_registered;
@@ -189,6 +196,7 @@ static struct raw_dev *dev_new(void)
        spin_lock_init(&dev->lock);
        init_completion(&dev->ep0_done);
        raw_event_queue_init(&dev->queue);
+       dev->driver_id_number = -1;
        return dev;
 }
 
@@ -199,6 +207,9 @@ static void dev_free(struct kref *kref)
 
        kfree(dev->udc_name);
        kfree(dev->driver.udc_name);
+       kfree(dev->driver.driver.name);
+       if (dev->driver_id_number >= 0)
+               ida_free(&driver_id_numbers, dev->driver_id_number);
        if (dev->req) {
                if (dev->ep0_urb_queued)
                        usb_ep_dequeue(dev->gadget->ep0, dev->req);
@@ -419,9 +430,11 @@ out_put:
 static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
 {
        int ret = 0;
+       int driver_id_number;
        struct usb_raw_init arg;
        char *udc_driver_name;
        char *udc_device_name;
+       char *driver_driver_name;
        unsigned long flags;
 
        if (copy_from_user(&arg, (void __user *)value, sizeof(arg)))
@@ -440,36 +453,43 @@ static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
                return -EINVAL;
        }
 
+       driver_id_number = ida_alloc(&driver_id_numbers, GFP_KERNEL);
+       if (driver_id_number < 0)
+               return driver_id_number;
+
+       driver_driver_name = kmalloc(DRIVER_DRIVER_NAME_LENGTH_MAX, GFP_KERNEL);
+       if (!driver_driver_name) {
+               ret = -ENOMEM;
+               goto out_free_driver_id_number;
+       }
+       snprintf(driver_driver_name, DRIVER_DRIVER_NAME_LENGTH_MAX,
+                               DRIVER_NAME ".%d", driver_id_number);
+
        udc_driver_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL);
-       if (!udc_driver_name)
-               return -ENOMEM;
+       if (!udc_driver_name) {
+               ret = -ENOMEM;
+               goto out_free_driver_driver_name;
+       }
        ret = strscpy(udc_driver_name, &arg.driver_name[0],
                                UDC_NAME_LENGTH_MAX);
-       if (ret < 0) {
-               kfree(udc_driver_name);
-               return ret;
-       }
+       if (ret < 0)
+               goto out_free_udc_driver_name;
        ret = 0;
 
        udc_device_name = kmalloc(UDC_NAME_LENGTH_MAX, GFP_KERNEL);
        if (!udc_device_name) {
-               kfree(udc_driver_name);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto out_free_udc_driver_name;
        }
        ret = strscpy(udc_device_name, &arg.device_name[0],
                                UDC_NAME_LENGTH_MAX);
-       if (ret < 0) {
-               kfree(udc_driver_name);
-               kfree(udc_device_name);
-               return ret;
-       }
+       if (ret < 0)
+               goto out_free_udc_device_name;
        ret = 0;
 
        spin_lock_irqsave(&dev->lock, flags);
        if (dev->state != STATE_DEV_OPENED) {
                dev_dbg(dev->dev, "fail, device is not opened\n");
-               kfree(udc_driver_name);
-               kfree(udc_device_name);
                ret = -EINVAL;
                goto out_unlock;
        }
@@ -484,14 +504,25 @@ static int raw_ioctl_init(struct raw_dev *dev, unsigned long value)
        dev->driver.suspend = gadget_suspend;
        dev->driver.resume = gadget_resume;
        dev->driver.reset = gadget_reset;
-       dev->driver.driver.name = DRIVER_NAME;
+       dev->driver.driver.name = driver_driver_name;
        dev->driver.udc_name = udc_device_name;
        dev->driver.match_existing_only = 1;
+       dev->driver_id_number = driver_id_number;
 
        dev->state = STATE_DEV_INITIALIZED;
+       spin_unlock_irqrestore(&dev->lock, flags);
+       return ret;
 
 out_unlock:
        spin_unlock_irqrestore(&dev->lock, flags);
+out_free_udc_device_name:
+       kfree(udc_device_name);
+out_free_udc_driver_name:
+       kfree(udc_driver_name);
+out_free_driver_driver_name:
+       kfree(driver_driver_name);
+out_free_driver_id_number:
+       ida_free(&driver_id_numbers, driver_id_number);
        return ret;
 }
 
index 6117ae8..cea10cd 100644 (file)
@@ -3016,6 +3016,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
        }
 
        udc->isp1301_i2c_client = isp1301_get_client(isp1301_node);
+       of_node_put(isp1301_node);
        if (!udc->isp1301_i2c_client) {
                return -EPROBE_DEFER;
        }
index c54f2bc..0fdc014 100644 (file)
@@ -652,7 +652,7 @@ struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
  * It will release and re-aquire the lock while calling ACPI
  * method.
  */
-static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
+void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
                                u16 index, bool on, unsigned long *flags)
        __must_hold(&xhci->lock)
 {
index fac9492..dce6c0e 100644 (file)
@@ -61,6 +61,8 @@
 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI            0x461e
 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI          0x464e
 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI        0x51ed
+#define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI           0xa71e
+#define PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI           0x7ec0
 
 #define PCI_DEVICE_ID_AMD_RENOIR_XHCI                  0x1639
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_4                        0x43b9
@@ -269,7 +271,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
             pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI ||
             pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI ||
             pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_XHCI ||
-            pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI))
+            pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI ||
+            pdev->device == PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_XHCI ||
+            pdev->device == PCI_DEVICE_ID_INTEL_METEOR_LAKE_XHCI))
                xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
 
        if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
index f0ab631..65858f6 100644 (file)
@@ -611,15 +611,37 @@ static int xhci_init(struct usb_hcd *hcd)
 
 static int xhci_run_finished(struct xhci_hcd *xhci)
 {
+       unsigned long   flags;
+       u32             temp;
+
+       /*
+        * Enable interrupts before starting the host (xhci 4.2 and 5.5.2).
+        * Protect the short window before host is running with a lock
+        */
+       spin_lock_irqsave(&xhci->lock, flags);
+
+       xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Enable interrupts");
+       temp = readl(&xhci->op_regs->command);
+       temp |= (CMD_EIE);
+       writel(temp, &xhci->op_regs->command);
+
+       xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Enable primary interrupter");
+       temp = readl(&xhci->ir_set->irq_pending);
+       writel(ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending);
+
        if (xhci_start(xhci)) {
                xhci_halt(xhci);
+               spin_unlock_irqrestore(&xhci->lock, flags);
                return -ENODEV;
        }
+
        xhci->cmd_ring_state = CMD_RING_STATE_RUNNING;
 
        if (xhci->quirks & XHCI_NEC_HOST)
                xhci_ring_cmd_db(xhci);
 
+       spin_unlock_irqrestore(&xhci->lock, flags);
+
        return 0;
 }
 
@@ -668,19 +690,6 @@ int xhci_run(struct usb_hcd *hcd)
        temp |= (xhci->imod_interval / 250) & ER_IRQ_INTERVAL_MASK;
        writel(temp, &xhci->ir_set->irq_control);
 
-       /* Set the HCD state before we enable the irqs */
-       temp = readl(&xhci->op_regs->command);
-       temp |= (CMD_EIE);
-       xhci_dbg_trace(xhci, trace_xhci_dbg_init,
-                       "// Enable interrupts, cmd = 0x%x.", temp);
-       writel(temp, &xhci->op_regs->command);
-
-       temp = readl(&xhci->ir_set->irq_pending);
-       xhci_dbg_trace(xhci, trace_xhci_dbg_init,
-                       "// Enabling event ring interrupter %p by writing 0x%x to irq_pending",
-                       xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp));
-       writel(ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending);
-
        if (xhci->quirks & XHCI_NEC_HOST) {
                struct xhci_command *command;
 
@@ -782,6 +791,8 @@ static void xhci_stop(struct usb_hcd *hcd)
 void xhci_shutdown(struct usb_hcd *hcd)
 {
        struct xhci_hcd *xhci = hcd_to_xhci(hcd);
+       unsigned long flags;
+       int i;
 
        if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
                usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
@@ -797,12 +808,21 @@ void xhci_shutdown(struct usb_hcd *hcd)
                del_timer_sync(&xhci->shared_hcd->rh_timer);
        }
 
-       spin_lock_irq(&xhci->lock);
+       spin_lock_irqsave(&xhci->lock, flags);
        xhci_halt(xhci);
+
+       /* Power off USB2 ports*/
+       for (i = 0; i < xhci->usb2_rhub.num_ports; i++)
+               xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags);
+
+       /* Power off USB3 ports*/
+       for (i = 0; i < xhci->usb3_rhub.num_ports; i++)
+               xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags);
+
        /* Workaround for spurious wakeups at shutdown with HSW */
        if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
                xhci_reset(xhci, XHCI_RESET_SHORT_USEC);
-       spin_unlock_irq(&xhci->lock);
+       spin_unlock_irqrestore(&xhci->lock, flags);
 
        xhci_cleanup_msix(xhci);
 
@@ -1107,7 +1127,6 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 {
        u32                     command, temp = 0;
        struct usb_hcd          *hcd = xhci_to_hcd(xhci);
-       struct usb_hcd          *secondary_hcd;
        int                     retval = 0;
        bool                    comp_timer_running = false;
        bool                    pending_portevent = false;
@@ -1214,23 +1233,19 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
                 * first with the primary HCD, and then with the secondary HCD.
                 * If we don't do the same, the host will never be started.
                 */
-               if (!usb_hcd_is_primary_hcd(hcd))
-                       secondary_hcd = hcd;
-               else
-                       secondary_hcd = xhci->shared_hcd;
-
                xhci_dbg(xhci, "Initialize the xhci_hcd\n");
-               retval = xhci_init(hcd->primary_hcd);
+               retval = xhci_init(hcd);
                if (retval)
                        return retval;
                comp_timer_running = true;
 
                xhci_dbg(xhci, "Start the primary HCD\n");
-               retval = xhci_run(hcd->primary_hcd);
-               if (!retval && secondary_hcd) {
+               retval = xhci_run(hcd);
+               if (!retval && xhci->shared_hcd) {
                        xhci_dbg(xhci, "Start the secondary HCD\n");
-                       retval = xhci_run(secondary_hcd);
+                       retval = xhci_run(xhci->shared_hcd);
                }
+
                hcd->state = HC_STATE_SUSPENDED;
                if (xhci->shared_hcd)
                        xhci->shared_hcd->state = HC_STATE_SUSPENDED;
index 0bd76c9..28aaf03 100644 (file)
@@ -2196,6 +2196,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
 int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
 int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
 struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);
+void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index,
+                        bool on, unsigned long *flags);
 
 void xhci_hc_died(struct xhci_hcd *xhci);
 
index a7b3c15..feba2a8 100644 (file)
@@ -166,6 +166,7 @@ static const struct usb_device_id edgeport_2port_id_table[] = {
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_8S) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_416) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_416B) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_E5805A) },
        { }
 };
 
@@ -204,6 +205,7 @@ static const struct usb_device_id id_table_combined[] = {
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_8S) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_416) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_TI_EDGEPORT_416B) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_E5805A) },
        { }
 };
 
index 52cbc35..9a6f742 100644 (file)
 //
 // Definitions for other product IDs
 #define ION_DEVICE_ID_MT4X56USB                        0x1403  // OEM device
+#define ION_DEVICE_ID_E5805A                   0x1A01  // OEM device (rebranded Edgeport/4)
 
 
 #define        GENERATION_ID_FROM_USB_PRODUCT_ID(ProductId)                            \
index e60425b..de59fa9 100644 (file)
@@ -252,10 +252,12 @@ static void option_instat_callback(struct urb *urb);
 #define QUECTEL_PRODUCT_EG95                   0x0195
 #define QUECTEL_PRODUCT_BG96                   0x0296
 #define QUECTEL_PRODUCT_EP06                   0x0306
+#define QUECTEL_PRODUCT_EM05G                  0x030a
 #define QUECTEL_PRODUCT_EM12                   0x0512
 #define QUECTEL_PRODUCT_RM500Q                 0x0800
 #define QUECTEL_PRODUCT_EC200S_CN              0x6002
 #define QUECTEL_PRODUCT_EC200T                 0x6026
+#define QUECTEL_PRODUCT_RM500K                 0x7001
 
 #define CMOTECH_VENDOR_ID                      0x16d8
 #define CMOTECH_PRODUCT_6001                   0x6001
@@ -432,6 +434,8 @@ static void option_instat_callback(struct urb *urb);
 #define CINTERION_PRODUCT_CLS8                 0x00b0
 #define CINTERION_PRODUCT_MV31_MBIM            0x00b3
 #define CINTERION_PRODUCT_MV31_RMNET           0x00b7
+#define CINTERION_PRODUCT_MV31_2_MBIM          0x00b8
+#define CINTERION_PRODUCT_MV31_2_RMNET         0x00b9
 #define CINTERION_PRODUCT_MV32_WA              0x00f1
 #define CINTERION_PRODUCT_MV32_WB              0x00f2
 
@@ -1132,6 +1136,8 @@ static const struct usb_device_id option_ids[] = {
        { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
          .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
        { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
+       { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
+         .driver_info = RSVD(6) | ZLP },
        { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
          .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
        { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
@@ -1145,6 +1151,7 @@ static const struct usb_device_id option_ids[] = {
          .driver_info = ZLP },
        { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
        { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
+       { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
 
        { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
        { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
@@ -1277,6 +1284,7 @@ static const struct usb_device_id option_ids[] = {
          .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
        { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff),    /* Telit LE910Cx (RNDIS) */
          .driver_info = NCTRL(2) | RSVD(3) },
+       { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x1250, 0xff, 0x00, 0x00) },   /* Telit LE910Cx (rmnet) */
        { USB_DEVICE(TELIT_VENDOR_ID, 0x1260),
          .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
        { USB_DEVICE(TELIT_VENDOR_ID, 0x1261),
@@ -1979,6 +1987,10 @@ static const struct usb_device_id option_ids[] = {
          .driver_info = RSVD(3)},
        { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff),
          .driver_info = RSVD(0)},
+       { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_2_MBIM, 0xff),
+         .driver_info = RSVD(3)},
+       { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_2_RMNET, 0xff),
+         .driver_info = RSVD(0)},
        { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff),
          .driver_info = RSVD(3)},
        { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff),
index 3506c47..40b1ab3 100644 (file)
@@ -436,22 +436,27 @@ static int pl2303_detect_type(struct usb_serial *serial)
                break;
        case 0x200:
                switch (bcdDevice) {
-               case 0x100:
+               case 0x100:     /* GC */
                case 0x105:
+                       return TYPE_HXN;
+               case 0x300:     /* GT / TA */
+                       if (pl2303_supports_hx_status(serial))
+                               return TYPE_TA;
+                       fallthrough;
                case 0x305:
+               case 0x400:     /* GL */
                case 0x405:
+                       return TYPE_HXN;
+               case 0x500:     /* GE / TB */
+                       if (pl2303_supports_hx_status(serial))
+                               return TYPE_TB;
+                       fallthrough;
+               case 0x505:
+               case 0x600:     /* GS */
                case 0x605:
-                       /*
-                        * Assume it's an HXN-type if the device doesn't
-                        * support the old read request value.
-                        */
-                       if (!pl2303_supports_hx_status(serial))
-                               return TYPE_HXN;
-                       break;
-               case 0x300:
-                       return TYPE_TA;
-               case 0x500:
-                       return TYPE_TB;
+               case 0x700:     /* GR */
+               case 0x705:
+                       return TYPE_HXN;
                }
                break;
        }
index 557f392..073fd2e 100644 (file)
@@ -56,7 +56,6 @@ config TYPEC_WCOVE
        tristate "Intel WhiskeyCove PMIC USB Type-C PHY driver"
        depends on ACPI
        depends on MFD_INTEL_PMC_BXT
-       depends on INTEL_SOC_PMIC
        depends on BXT_WC_PMIC_OPREGION
        help
          This driver adds support for USB Type-C on Intel Broxton platforms
index b7a9554..1b6d46b 100644 (file)
@@ -107,7 +107,7 @@ struct mlx5_vdpa_virtqueue {
 
        /* Resources for implementing the notification channel from the device
         * to the driver. fwqp is the firmware end of an RC connection; the
-        * other end is vqqp used by the driver. cq is is where completions are
+        * other end is vqqp used by the driver. cq is where completions are
         * reported.
         */
        struct mlx5_vdpa_cq cq;
@@ -1814,12 +1814,13 @@ static virtio_net_ctrl_ack handle_ctrl_vlan(struct mlx5_vdpa_dev *mvdev, u8 cmd)
 
                id = mlx5vdpa16_to_cpu(mvdev, vlan);
                mac_vlan_del(ndev, ndev->config.mac, id, true);
+               status = VIRTIO_NET_OK;
                break;
        default:
-       break;
-}
+               break;
+       }
 
-return status;
+       return status;
 }
 
 static void mlx5_cvq_kick_handler(struct work_struct *work)
index d503848..776ad74 100644 (file)
@@ -1345,9 +1345,9 @@ static int vduse_create_dev(struct vduse_dev_config *config,
 
        dev->minor = ret;
        dev->msg_timeout = VDUSE_MSG_DEFAULT_TIMEOUT;
-       dev->dev = device_create(vduse_class, NULL,
-                                MKDEV(MAJOR(vduse_major), dev->minor),
-                                dev, "%s", config->name);
+       dev->dev = device_create_with_groups(vduse_class, NULL,
+                               MKDEV(MAJOR(vduse_major), dev->minor),
+                               dev, vduse_dev_groups, "%s", config->name);
        if (IS_ERR(dev->dev)) {
                ret = PTR_ERR(dev->dev);
                goto err_dev;
@@ -1596,7 +1596,6 @@ static int vduse_init(void)
                return PTR_ERR(vduse_class);
 
        vduse_class->devnode = vduse_devnode;
-       vduse_class->dev_groups = vduse_dev_groups;
 
        ret = alloc_chrdev_region(&vduse_major, 0, VDUSE_DEV_MAX, "vduse");
        if (ret)
index 935a1d0..5ad2596 100644 (file)
@@ -499,6 +499,8 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
                ops->set_vq_ready(vdpa, idx, s.num);
                return 0;
        case VHOST_VDPA_GET_VRING_GROUP:
+               if (!ops->get_vq_group)
+                       return -EOPNOTSUPP;
                s.index = idx;
                s.num = ops->get_vq_group(vdpa, idx);
                if (s.num >= vdpa->ngroups)
index 14e2043..eab55ac 100644 (file)
@@ -292,7 +292,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
             int (*copy)(const struct vringh *vrh,
                         void *dst, const void *src, size_t len))
 {
-       int err, count = 0, up_next, desc_max;
+       int err, count = 0, indirect_count = 0, up_next, desc_max;
        struct vring_desc desc, *descs;
        struct vringh_range range = { -1ULL, 0 }, slowrange;
        bool slow = false;
@@ -349,7 +349,12 @@ __vringh_iov(struct vringh *vrh, u16 i,
                        continue;
                }
 
-               if (count++ == vrh->vring.num) {
+               if (up_next == -1)
+                       count++;
+               else
+                       indirect_count++;
+
+               if (count > vrh->vring.num || indirect_count > desc_max) {
                        vringh_bad("Descriptor loop in %p", descs);
                        err = -ELOOP;
                        goto fail;
@@ -411,6 +416,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
                                i = return_from_indirect(vrh, &up_next,
                                                         &descs, &desc_max);
                                slow = false;
+                               indirect_count = 0;
                        } else
                                break;
                }
index fa23bf0..bd4dc97 100644 (file)
@@ -1148,6 +1148,7 @@ int sti_call(const struct sti_struct *sti, unsigned long func,
        return ret;
 }
 
+#if defined(CONFIG_FB_STI)
 /* check if given fb_info is the primary device */
 int fb_is_primary_device(struct fb_info *info)
 {
@@ -1163,6 +1164,7 @@ int fb_is_primary_device(struct fb_info *info)
        return (sti->info == info);
 }
 EXPORT_SYMBOL(fb_is_primary_device);
+#endif
 
 MODULE_AUTHOR("Philipp Rumpf, Helge Deller, Thomas Bogendoerfer");
 MODULE_DESCRIPTION("Core STI driver for HP's NGLE series graphics cards in HP PARISC machines");
index 52f731a..519313b 100644 (file)
@@ -560,8 +560,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, pm_message_t state)
        /* Blank the LCD */
        au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info);
 
-       if (fbdev->lcdclk)
-               clk_disable(fbdev->lcdclk);
+       clk_disable(fbdev->lcdclk);
 
        memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs));
 
@@ -577,8 +576,7 @@ int au1100fb_drv_resume(struct platform_device *dev)
 
        memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs));
 
-       if (fbdev->lcdclk)
-               clk_enable(fbdev->lcdclk);
+       clk_enable(fbdev->lcdclk);
 
        /* Unblank the LCD */
        au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info);
index 3d47c34..51e072c 100644 (file)
@@ -2184,12 +2184,6 @@ static struct pci_driver cirrusfb_pci_driver = {
        .id_table       = cirrusfb_pci_table,
        .probe          = cirrusfb_pci_register,
        .remove         = cirrusfb_pci_unregister,
-#ifdef CONFIG_PM
-#if 0
-       .suspend        = cirrusfb_pci_suspend,
-       .resume         = cirrusfb_pci_resume,
-#endif
-#endif
 };
 #endif /* CONFIG_PCI */
 
index a957996..5647fca 100644 (file)
@@ -472,7 +472,7 @@ static int intelfb_pci_register(struct pci_dev *pdev,
        struct fb_info *info;
        struct intelfb_info *dinfo;
        int i, err, dvo;
-       int aperture_size, stolen_size;
+       int aperture_size, stolen_size = 0;
        struct agp_kern_info gtt_info;
        int agp_memtype;
        const char *s;
@@ -571,7 +571,7 @@ static int intelfb_pci_register(struct pci_dev *pdev,
                return -ENODEV;
        }
 
-       if (intelfbhw_get_memory(pdev, &aperture_size,&stolen_size)) {
+       if (intelfbhw_get_memory(pdev, &aperture_size, &stolen_size)) {
                cleanup(dinfo);
                return -ENODEV;
        }
index 57aff74..2086e06 100644 (file)
@@ -201,13 +201,11 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
        case PCI_DEVICE_ID_INTEL_945GME:
        case PCI_DEVICE_ID_INTEL_965G:
        case PCI_DEVICE_ID_INTEL_965GM:
-               /* 915, 945 and 965 chipsets support a 256MB aperture.
-                  Aperture size is determined by inspected the
-                  base address of the aperture. */
-               if (pci_resource_start(pdev, 2) & 0x08000000)
-                       *aperture_size = MB(128);
-               else
-                       *aperture_size = MB(256);
+               /*
+                * 915, 945 and 965 chipsets support 64MB, 128MB or 256MB
+                * aperture. Determine size from PCI resource length.
+                */
+               *aperture_size = pci_resource_len(pdev, 2);
                break;
        default:
                if ((tmp & INTEL_GMCH_MEM_MASK) == INTEL_GMCH_MEM_64M)
index c90eb8c..66aff6c 100644 (file)
@@ -359,7 +359,7 @@ static void sossi_set_bits_per_cycle(int bpc)
        int bus_pick_count, bus_pick_width;
 
        /*
-        * We set explicitly the the bus_pick_count as well, although
+        * We set explicitly the bus_pick_count as well, although
         * with remapping/reordering disabled it will be calculated by HW
         * as (32 / bus_pick_width).
         */
index 6fbfeb0..170463a 100644 (file)
@@ -143,7 +143,7 @@ int hdmi_phy_configure(struct hdmi_phy_data *phy, unsigned long hfbitclk,
        /*
         * In OMAP5+, the HFBITCLK must be divided by 2 before issuing the
         * HDMI_PHYPWRCMD_LDOON command.
-       */
+        */
        if (phy_feat->bist_ctrl)
                REG_FLD_MOD(phy->base, HDMI_TXPHY_BIST_CONTROL, 1, 11, 11);
 
index 043cc8f..c3cd1e1 100644 (file)
@@ -381,7 +381,7 @@ pxa3xx_gcu_write(struct file *file, const char *buff,
        struct pxa3xx_gcu_batch *buffer;
        struct pxa3xx_gcu_priv *priv = to_pxa3xx_gcu_priv(file);
 
-       int words = count / 4;
+       size_t words = count / 4;
 
        /* Does not need to be atomic. There's a lock in user space,
         * but anyhow, this is just for statistics. */
index 2c19856..f96ce88 100644 (file)
@@ -237,8 +237,7 @@ static int simplefb_clocks_get(struct simplefb_par *par,
                if (IS_ERR(clock)) {
                        if (PTR_ERR(clock) == -EPROBE_DEFER) {
                                while (--i >= 0) {
-                                       if (par->clks[i])
-                                               clk_put(par->clks[i]);
+                                       clk_put(par->clks[i]);
                                }
                                kfree(par->clks);
                                return -EPROBE_DEFER;
index bcacfb6..d119b1d 100644 (file)
@@ -96,7 +96,7 @@ static const struct fb_fix_screeninfo xxxfb_fix = {
 
     /*
      *         Modern graphical hardware not only supports pipelines but some 
-     *  also support multiple monitors where each display can have its  
+     *  also support multiple monitors where each display can have
      *  its own unique data. In this case each display could be  
      *  represented by a separate framebuffer device thus a separate 
      *  struct fb_info. Now the struct xxx_par represents the graphics
@@ -838,9 +838,9 @@ static void xxxfb_remove(struct pci_dev *dev)
  *
  *      See Documentation/driver-api/pm/devices.rst for more information
  */
-static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg)
+static int xxxfb_suspend(struct device *dev)
 {
-       struct fb_info *info = pci_get_drvdata(dev);
+       struct fb_info *info = dev_get_drvdata(dev);
        struct xxxfb_par *par = info->par;
 
        /* suspend here */
@@ -853,9 +853,9 @@ static int xxxfb_suspend(struct pci_dev *dev, pm_message_t msg)
  *
  *      See Documentation/driver-api/pm/devices.rst for more information
  */
-static int xxxfb_resume(struct pci_dev *dev)
+static int xxxfb_resume(struct device *dev)
 {
-       struct fb_info *info = pci_get_drvdata(dev);
+       struct fb_info *info = dev_get_drvdata(dev);
        struct xxxfb_par *par = info->par;
 
        /* resume here */
@@ -873,14 +873,15 @@ static const struct pci_device_id xxxfb_id_table[] = {
        { 0, }
 };
 
+static SIMPLE_DEV_PM_OPS(xxxfb_pm_ops, xxxfb_suspend, xxxfb_resume);
+
 /* For PCI drivers */
 static struct pci_driver xxxfb_driver = {
        .name =         "xxxfb",
        .id_table =     xxxfb_id_table,
        .probe =        xxxfb_probe,
        .remove =       xxxfb_remove,
-       .suspend =      xxxfb_suspend, /* optional but recommended */
-       .resume =       xxxfb_resume,  /* optional but recommended */
+       .driver.pm =    xxxfb_pm_ops, /* optional but recommended */
 };
 
 MODULE_DEVICE_TABLE(pci, xxxfb_id_table);
index b5adf6a..a6dc8b5 100644 (file)
@@ -6,12 +6,6 @@ config VIRTIO
          bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
          or CONFIG_S390_GUEST.
 
-config ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS
-       bool
-       help
-         This option is selected if the architecture may need to enforce
-         VIRTIO_F_ACCESS_PLATFORM
-
 config VIRTIO_PCI_LIB
        tristate
        help
index ef04a96..6bace84 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/module.h>
 #include <linux/idr.h>
 #include <linux/of.h>
+#include <linux/platform-feature.h>
 #include <uapi/linux/virtio_ids.h>
 
 /* Unique numbering for virtio devices. */
@@ -170,12 +171,10 @@ EXPORT_SYMBOL_GPL(virtio_add_status);
 static int virtio_features_ok(struct virtio_device *dev)
 {
        unsigned int status;
-       int ret;
 
        might_sleep();
 
-       ret = arch_has_restricted_virtio_memory_access();
-       if (ret) {
+       if (platform_has(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS)) {
                if (!virtio_has_feature(dev, VIRTIO_F_VERSION_1)) {
                        dev_warn(&dev->dev,
                                 "device must provide VIRTIO_F_VERSION_1\n");
index f9a36bc..c9bec38 100644 (file)
@@ -255,7 +255,7 @@ static void vm_set_status(struct virtio_device *vdev, u8 status)
 
        /*
         * Per memory-barriers.txt, wmb() is not needed to guarantee
-        * that the the cache coherent memory writes have completed
+        * that the cache coherent memory writes have completed
         * before writing to the MMIO region.
         */
        writel(status, vm_dev->base + VIRTIO_MMIO_STATUS);
@@ -701,6 +701,7 @@ static int vm_cmdline_set(const char *device,
        if (!vm_cmdline_parent_registered) {
                err = device_register(&vm_cmdline_parent);
                if (err) {
+                       put_device(&vm_cmdline_parent);
                        pr_err("Failed to register parent device!\n");
                        return err;
                }
index a0fa14f..b790f30 100644 (file)
@@ -469,7 +469,7 @@ void vp_modern_set_status(struct virtio_pci_modern_device *mdev,
 
        /*
         * Per memory-barriers.txt, wmb() is not needed to guarantee
-        * that the the cache coherent memory writes have completed
+        * that the cache coherent memory writes have completed
         * before writing to the MMIO region.
         */
        vp_iowrite8(status, &cfg->device_status);
index b0b2d7a..2fd85be 100644 (file)
@@ -172,3 +172,4 @@ module_platform_driver(gxp_wdt_driver);
 MODULE_AUTHOR("Nick Hawkins <nick.hawkins@hpe.com>");
 MODULE_AUTHOR("Jean-Marie Verdun <verdun@hpe.com>");
 MODULE_DESCRIPTION("Driver for GXP watchdog timer");
+MODULE_LICENSE("GPL");
index 120d32f..bfd5f4f 100644 (file)
@@ -335,4 +335,24 @@ config XEN_UNPOPULATED_ALLOC
          having to balloon out RAM regions in order to obtain physical memory
          space to create such mappings.
 
+config XEN_GRANT_DMA_IOMMU
+       bool
+       select IOMMU_API
+
+config XEN_GRANT_DMA_OPS
+       bool
+       select DMA_OPS
+
+config XEN_VIRTIO
+       bool "Xen virtio support"
+       depends on VIRTIO
+       select XEN_GRANT_DMA_OPS
+       select XEN_GRANT_DMA_IOMMU if OF
+       help
+         Enable virtio support for running as Xen guest. Depending on the
+         guest type this will require special support on the backend side
+         (qemu or kernel, depending on the virtio device types used).
+
+         If in doubt, say n.
+
 endmenu
index 5aae66e..c0503f1 100644 (file)
@@ -39,3 +39,5 @@ xen-gntalloc-y                                := gntalloc.o
 xen-privcmd-y                          := privcmd.o privcmd-buf.o
 obj-$(CONFIG_XEN_FRONT_PGDIR_SHBUF)    += xen-front-pgdir-shbuf.o
 obj-$(CONFIG_XEN_UNPOPULATED_ALLOC)    += unpopulated-alloc.o
+obj-$(CONFIG_XEN_GRANT_DMA_OPS)                += grant-dma-ops.o
+obj-$(CONFIG_XEN_GRANT_DMA_IOMMU)      += grant-dma-iommu.o
index 7b59144..87f1828 100644 (file)
@@ -42,7 +42,7 @@ void xen_setup_features(void)
                if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
                        break;
                for (j = 0; j < 32; j++)
-                       xen_features[i * 32 + j] = !!(fi.submap & 1<<j);
+                       xen_features[i * 32 + j] = !!(fi.submap & 1U << j);
        }
 
        if (xen_pv_domain()) {
index 20d7d05..40ef379 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/mmu_notifier.h>
 #include <linux/types.h>
 #include <xen/interface/event_channel.h>
+#include <xen/grant_table.h>
 
 struct gntdev_dmabuf_priv;
 
@@ -56,6 +57,7 @@ struct gntdev_grant_map {
        struct gnttab_unmap_grant_ref *unmap_ops;
        struct gnttab_map_grant_ref   *kmap_ops;
        struct gnttab_unmap_grant_ref *kunmap_ops;
+       bool *being_removed;
        struct page **pages;
        unsigned long pages_vm_start;
 
@@ -73,6 +75,11 @@ struct gntdev_grant_map {
        /* Needed to avoid allocation in gnttab_dma_free_pages(). */
        xen_pfn_t *frames;
 #endif
+
+       /* Number of live grants */
+       atomic_t live_grants;
+       /* Needed to avoid allocation in __unmap_grant_pages */
+       struct gntab_unmap_queue_data unmap_data;
 };
 
 struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count,
index 59ffea8..4b56c39 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/slab.h>
 #include <linux/highmem.h>
 #include <linux/refcount.h>
+#include <linux/workqueue.h>
 
 #include <xen/xen.h>
 #include <xen/grant_table.h>
@@ -60,10 +61,11 @@ module_param(limit, uint, 0644);
 MODULE_PARM_DESC(limit,
        "Maximum number of grants that may be mapped by one mapping request");
 
+/* True in PV mode, false otherwise */
 static int use_ptemod;
 
-static int unmap_grant_pages(struct gntdev_grant_map *map,
-                            int offset, int pages);
+static void unmap_grant_pages(struct gntdev_grant_map *map,
+                             int offset, int pages);
 
 static struct miscdevice gntdev_miscdev;
 
@@ -120,6 +122,7 @@ static void gntdev_free_map(struct gntdev_grant_map *map)
        kvfree(map->unmap_ops);
        kvfree(map->kmap_ops);
        kvfree(map->kunmap_ops);
+       kvfree(map->being_removed);
        kfree(map);
 }
 
@@ -140,10 +143,13 @@ struct gntdev_grant_map *gntdev_alloc_map(struct gntdev_priv *priv, int count,
        add->unmap_ops = kvmalloc_array(count, sizeof(add->unmap_ops[0]),
                                        GFP_KERNEL);
        add->pages     = kvcalloc(count, sizeof(add->pages[0]), GFP_KERNEL);
+       add->being_removed =
+               kvcalloc(count, sizeof(add->being_removed[0]), GFP_KERNEL);
        if (NULL == add->grants    ||
            NULL == add->map_ops   ||
            NULL == add->unmap_ops ||
-           NULL == add->pages)
+           NULL == add->pages     ||
+           NULL == add->being_removed)
                goto err;
        if (use_ptemod) {
                add->kmap_ops   = kvmalloc_array(count, sizeof(add->kmap_ops[0]),
@@ -250,9 +256,36 @@ void gntdev_put_map(struct gntdev_priv *priv, struct gntdev_grant_map *map)
        if (!refcount_dec_and_test(&map->users))
                return;
 
-       if (map->pages && !use_ptemod)
+       if (map->pages && !use_ptemod) {
+               /*
+                * Increment the reference count.  This ensures that the
+                * subsequent call to unmap_grant_pages() will not wind up
+                * re-entering itself.  It *can* wind up calling
+                * gntdev_put_map() recursively, but such calls will be with a
+                * reference count greater than 1, so they will return before
+                * this code is reached.  The recursion depth is thus limited to
+                * 1.  Do NOT use refcount_inc() here, as it will detect that
+                * the reference count is zero and WARN().
+                */
+               refcount_set(&map->users, 1);
+
+               /*
+                * Unmap the grants.  This may or may not be asynchronous, so it
+                * is possible that the reference count is 1 on return, but it
+                * could also be greater than 1.
+                */
                unmap_grant_pages(map, 0, map->count);
 
+               /* Check if the memory now needs to be freed */
+               if (!refcount_dec_and_test(&map->users))
+                       return;
+
+               /*
+                * All pages have been returned to the hypervisor, so free the
+                * map.
+                */
+       }
+
        if (map->notify.flags & UNMAP_NOTIFY_SEND_EVENT) {
                notify_remote_via_evtchn(map->notify.event);
                evtchn_put(map->notify.event);
@@ -283,6 +316,7 @@ static int find_grant_ptes(pte_t *pte, unsigned long addr, void *data)
 
 int gntdev_map_grant_pages(struct gntdev_grant_map *map)
 {
+       size_t alloced = 0;
        int i, err = 0;
 
        if (!use_ptemod) {
@@ -331,97 +365,116 @@ int gntdev_map_grant_pages(struct gntdev_grant_map *map)
                        map->count);
 
        for (i = 0; i < map->count; i++) {
-               if (map->map_ops[i].status == GNTST_okay)
+               if (map->map_ops[i].status == GNTST_okay) {
                        map->unmap_ops[i].handle = map->map_ops[i].handle;
-               else if (!err)
+                       if (!use_ptemod)
+                               alloced++;
+               } else if (!err)
                        err = -EINVAL;
 
                if (map->flags & GNTMAP_device_map)
                        map->unmap_ops[i].dev_bus_addr = map->map_ops[i].dev_bus_addr;
 
                if (use_ptemod) {
-                       if (map->kmap_ops[i].status == GNTST_okay)
+                       if (map->kmap_ops[i].status == GNTST_okay) {
+                               if (map->map_ops[i].status == GNTST_okay)
+                                       alloced++;
                                map->kunmap_ops[i].handle = map->kmap_ops[i].handle;
-                       else if (!err)
+                       else if (!err)
                                err = -EINVAL;
                }
        }
+       atomic_add(alloced, &map->live_grants);
        return err;
 }
 
-static int __unmap_grant_pages(struct gntdev_grant_map *map, int offset,
-                              int pages)
+static void __unmap_grant_pages_done(int result,
+               struct gntab_unmap_queue_data *data)
 {
-       int i, err = 0;
-       struct gntab_unmap_queue_data unmap_data;
-
-       if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
-               int pgno = (map->notify.addr >> PAGE_SHIFT);
-               if (pgno >= offset && pgno < offset + pages) {
-                       /* No need for kmap, pages are in lowmem */
-                       uint8_t *tmp = pfn_to_kaddr(page_to_pfn(map->pages[pgno]));
-                       tmp[map->notify.addr & (PAGE_SIZE-1)] = 0;
-                       map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE;
-               }
-       }
-
-       unmap_data.unmap_ops = map->unmap_ops + offset;
-       unmap_data.kunmap_ops = use_ptemod ? map->kunmap_ops + offset : NULL;
-       unmap_data.pages = map->pages + offset;
-       unmap_data.count = pages;
-
-       err = gnttab_unmap_refs_sync(&unmap_data);
-       if (err)
-               return err;
+       unsigned int i;
+       struct gntdev_grant_map *map = data->data;
+       unsigned int offset = data->unmap_ops - map->unmap_ops;
 
-       for (i = 0; i < pages; i++) {
-               if (map->unmap_ops[offset+i].status)
-                       err = -EINVAL;
+       for (i = 0; i < data->count; i++) {
+               WARN_ON(map->unmap_ops[offset+i].status);
                pr_debug("unmap handle=%d st=%d\n",
                        map->unmap_ops[offset+i].handle,
                        map->unmap_ops[offset+i].status);
                map->unmap_ops[offset+i].handle = INVALID_GRANT_HANDLE;
                if (use_ptemod) {
-                       if (map->kunmap_ops[offset+i].status)
-                               err = -EINVAL;
+                       WARN_ON(map->kunmap_ops[offset+i].status);
                        pr_debug("kunmap handle=%u st=%d\n",
                                 map->kunmap_ops[offset+i].handle,
                                 map->kunmap_ops[offset+i].status);
                        map->kunmap_ops[offset+i].handle = INVALID_GRANT_HANDLE;
                }
        }
-       return err;
+       /*
+        * Decrease the live-grant counter.  This must happen after the loop to
+        * prevent premature reuse of the grants by gnttab_mmap().
+        */
+       atomic_sub(data->count, &map->live_grants);
+
+       /* Release reference taken by __unmap_grant_pages */
+       gntdev_put_map(NULL, map);
+}
+
+static void __unmap_grant_pages(struct gntdev_grant_map *map, int offset,
+                              int pages)
+{
+       if (map->notify.flags & UNMAP_NOTIFY_CLEAR_BYTE) {
+               int pgno = (map->notify.addr >> PAGE_SHIFT);
+
+               if (pgno >= offset && pgno < offset + pages) {
+                       /* No need for kmap, pages are in lowmem */
+                       uint8_t *tmp = pfn_to_kaddr(page_to_pfn(map->pages[pgno]));
+
+                       tmp[map->notify.addr & (PAGE_SIZE-1)] = 0;
+                       map->notify.flags &= ~UNMAP_NOTIFY_CLEAR_BYTE;
+               }
+       }
+
+       map->unmap_data.unmap_ops = map->unmap_ops + offset;
+       map->unmap_data.kunmap_ops = use_ptemod ? map->kunmap_ops + offset : NULL;
+       map->unmap_data.pages = map->pages + offset;
+       map->unmap_data.count = pages;
+       map->unmap_data.done = __unmap_grant_pages_done;
+       map->unmap_data.data = map;
+       refcount_inc(&map->users); /* to keep map alive during async call below */
+
+       gnttab_unmap_refs_async(&map->unmap_data);
 }
 
-static int unmap_grant_pages(struct gntdev_grant_map *map, int offset,
-                            int pages)
+static void unmap_grant_pages(struct gntdev_grant_map *map, int offset,
+                             int pages)
 {
-       int range, err = 0;
+       int range;
+
+       if (atomic_read(&map->live_grants) == 0)
+               return; /* Nothing to do */
 
        pr_debug("unmap %d+%d [%d+%d]\n", map->index, map->count, offset, pages);
 
        /* It is possible the requested range will have a "hole" where we
         * already unmapped some of the grants. Only unmap valid ranges.
         */
-       while (pages && !err) {
-               while (pages &&
-                      map->unmap_ops[offset].handle == INVALID_GRANT_HANDLE) {
+       while (pages) {
+               while (pages && map->being_removed[offset]) {
                        offset++;
                        pages--;
                }
                range = 0;
                while (range < pages) {
-                       if (map->unmap_ops[offset + range].handle ==
-                           INVALID_GRANT_HANDLE)
+                       if (map->being_removed[offset + range])
                                break;
+                       map->being_removed[offset + range] = true;
                        range++;
                }
-               err = __unmap_grant_pages(map, offset, range);
+               if (range)
+                       __unmap_grant_pages(map, offset, range);
                offset += range;
                pages -= range;
        }
-
-       return err;
 }
 
 /* ------------------------------------------------------------------ */
@@ -473,7 +526,6 @@ static bool gntdev_invalidate(struct mmu_interval_notifier *mn,
        struct gntdev_grant_map *map =
                container_of(mn, struct gntdev_grant_map, notifier);
        unsigned long mstart, mend;
-       int err;
 
        if (!mmu_notifier_range_blockable(range))
                return false;
@@ -494,10 +546,9 @@ static bool gntdev_invalidate(struct mmu_interval_notifier *mn,
                        map->index, map->count,
                        map->vma->vm_start, map->vma->vm_end,
                        range->start, range->end, mstart, mend);
-       err = unmap_grant_pages(map,
+       unmap_grant_pages(map,
                                (mstart - map->vma->vm_start) >> PAGE_SHIFT,
                                (mend - mstart) >> PAGE_SHIFT);
-       WARN_ON(err);
 
        return true;
 }
@@ -985,6 +1036,10 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
                goto unlock_out;
        if (use_ptemod && map->vma)
                goto unlock_out;
+       if (atomic_read(&map->live_grants)) {
+               err = -EAGAIN;
+               goto unlock_out;
+       }
        refcount_inc(&map->users);
 
        vma->vm_ops = &gntdev_vmops;
diff --git a/drivers/xen/grant-dma-iommu.c b/drivers/xen/grant-dma-iommu.c
new file mode 100644 (file)
index 0000000..16b8bc0
--- /dev/null
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Stub IOMMU driver which does nothing.
+ * The main purpose of it being present is to reuse generic IOMMU device tree
+ * bindings by Xen grant DMA-mapping layer.
+ *
+ * Copyright (C) 2022 EPAM Systems Inc.
+ */
+
+#include <linux/iommu.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+struct grant_dma_iommu_device {
+       struct device *dev;
+       struct iommu_device iommu;
+};
+
+/* Nothing is really needed here */
+static const struct iommu_ops grant_dma_iommu_ops;
+
+static const struct of_device_id grant_dma_iommu_of_match[] = {
+       { .compatible = "xen,grant-dma" },
+       { },
+};
+
+static int grant_dma_iommu_probe(struct platform_device *pdev)
+{
+       struct grant_dma_iommu_device *mmu;
+       int ret;
+
+       mmu = devm_kzalloc(&pdev->dev, sizeof(*mmu), GFP_KERNEL);
+       if (!mmu)
+               return -ENOMEM;
+
+       mmu->dev = &pdev->dev;
+
+       ret = iommu_device_register(&mmu->iommu, &grant_dma_iommu_ops, &pdev->dev);
+       if (ret)
+               return ret;
+
+       platform_set_drvdata(pdev, mmu);
+
+       return 0;
+}
+
+static int grant_dma_iommu_remove(struct platform_device *pdev)
+{
+       struct grant_dma_iommu_device *mmu = platform_get_drvdata(pdev);
+
+       platform_set_drvdata(pdev, NULL);
+       iommu_device_unregister(&mmu->iommu);
+
+       return 0;
+}
+
+static struct platform_driver grant_dma_iommu_driver = {
+       .driver = {
+               .name = "grant-dma-iommu",
+               .of_match_table = grant_dma_iommu_of_match,
+       },
+       .probe = grant_dma_iommu_probe,
+       .remove = grant_dma_iommu_remove,
+};
+
+static int __init grant_dma_iommu_init(void)
+{
+       struct device_node *iommu_np;
+
+       iommu_np = of_find_matching_node(NULL, grant_dma_iommu_of_match);
+       if (!iommu_np)
+               return 0;
+
+       of_node_put(iommu_np);
+
+       return platform_driver_register(&grant_dma_iommu_driver);
+}
+subsys_initcall(grant_dma_iommu_init);
diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c
new file mode 100644 (file)
index 0000000..fc01424
--- /dev/null
@@ -0,0 +1,346 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Xen grant DMA-mapping layer - contains special DMA-mapping routines
+ * for providing grant references as DMA addresses to be used by frontends
+ * (e.g. virtio) in Xen guests
+ *
+ * Copyright (c) 2021, Juergen Gross <jgross@suse.com>
+ */
+
+#include <linux/module.h>
+#include <linux/dma-map-ops.h>
+#include <linux/of.h>
+#include <linux/pfn.h>
+#include <linux/xarray.h>
+#include <xen/xen.h>
+#include <xen/xen-ops.h>
+#include <xen/grant_table.h>
+
+struct xen_grant_dma_data {
+       /* The ID of backend domain */
+       domid_t backend_domid;
+       /* Is device behaving sane? */
+       bool broken;
+};
+
+static DEFINE_XARRAY(xen_grant_dma_devices);
+
+#define XEN_GRANT_DMA_ADDR_OFF (1ULL << 63)
+
+static inline dma_addr_t grant_to_dma(grant_ref_t grant)
+{
+       return XEN_GRANT_DMA_ADDR_OFF | ((dma_addr_t)grant << PAGE_SHIFT);
+}
+
+static inline grant_ref_t dma_to_grant(dma_addr_t dma)
+{
+       return (grant_ref_t)((dma & ~XEN_GRANT_DMA_ADDR_OFF) >> PAGE_SHIFT);
+}
+
+static struct xen_grant_dma_data *find_xen_grant_dma_data(struct device *dev)
+{
+       struct xen_grant_dma_data *data;
+
+       xa_lock(&xen_grant_dma_devices);
+       data = xa_load(&xen_grant_dma_devices, (unsigned long)dev);
+       xa_unlock(&xen_grant_dma_devices);
+
+       return data;
+}
+
+/*
+ * DMA ops for Xen frontends (e.g. virtio).
+ *
+ * Used to act as a kind of software IOMMU for Xen guests by using grants as
+ * DMA addresses.
+ * Such a DMA address is formed by using the grant reference as a frame
+ * number and setting the highest address bit (this bit is for the backend
+ * to be able to distinguish it from e.g. a mmio address).
+ */
+static void *xen_grant_dma_alloc(struct device *dev, size_t size,
+                                dma_addr_t *dma_handle, gfp_t gfp,
+                                unsigned long attrs)
+{
+       struct xen_grant_dma_data *data;
+       unsigned int i, n_pages = PFN_UP(size);
+       unsigned long pfn;
+       grant_ref_t grant;
+       void *ret;
+
+       data = find_xen_grant_dma_data(dev);
+       if (!data)
+               return NULL;
+
+       if (unlikely(data->broken))
+               return NULL;
+
+       ret = alloc_pages_exact(n_pages * PAGE_SIZE, gfp);
+       if (!ret)
+               return NULL;
+
+       pfn = virt_to_pfn(ret);
+
+       if (gnttab_alloc_grant_reference_seq(n_pages, &grant)) {
+               free_pages_exact(ret, n_pages * PAGE_SIZE);
+               return NULL;
+       }
+
+       for (i = 0; i < n_pages; i++) {
+               gnttab_grant_foreign_access_ref(grant + i, data->backend_domid,
+                               pfn_to_gfn(pfn + i), 0);
+       }
+
+       *dma_handle = grant_to_dma(grant);
+
+       return ret;
+}
+
+static void xen_grant_dma_free(struct device *dev, size_t size, void *vaddr,
+                              dma_addr_t dma_handle, unsigned long attrs)
+{
+       struct xen_grant_dma_data *data;
+       unsigned int i, n_pages = PFN_UP(size);
+       grant_ref_t grant;
+
+       data = find_xen_grant_dma_data(dev);
+       if (!data)
+               return;
+
+       if (unlikely(data->broken))
+               return;
+
+       grant = dma_to_grant(dma_handle);
+
+       for (i = 0; i < n_pages; i++) {
+               if (unlikely(!gnttab_end_foreign_access_ref(grant + i))) {
+                       dev_alert(dev, "Grant still in use by backend domain, disabled for further use\n");
+                       data->broken = true;
+                       return;
+               }
+       }
+
+       gnttab_free_grant_reference_seq(grant, n_pages);
+
+       free_pages_exact(vaddr, n_pages * PAGE_SIZE);
+}
+
+static struct page *xen_grant_dma_alloc_pages(struct device *dev, size_t size,
+                                             dma_addr_t *dma_handle,
+                                             enum dma_data_direction dir,
+                                             gfp_t gfp)
+{
+       void *vaddr;
+
+       vaddr = xen_grant_dma_alloc(dev, size, dma_handle, gfp, 0);
+       if (!vaddr)
+               return NULL;
+
+       return virt_to_page(vaddr);
+}
+
+static void xen_grant_dma_free_pages(struct device *dev, size_t size,
+                                    struct page *vaddr, dma_addr_t dma_handle,
+                                    enum dma_data_direction dir)
+{
+       xen_grant_dma_free(dev, size, page_to_virt(vaddr), dma_handle, 0);
+}
+
+static dma_addr_t xen_grant_dma_map_page(struct device *dev, struct page *page,
+                                        unsigned long offset, size_t size,
+                                        enum dma_data_direction dir,
+                                        unsigned long attrs)
+{
+       struct xen_grant_dma_data *data;
+       unsigned int i, n_pages = PFN_UP(size);
+       grant_ref_t grant;
+       dma_addr_t dma_handle;
+
+       if (WARN_ON(dir == DMA_NONE))
+               return DMA_MAPPING_ERROR;
+
+       data = find_xen_grant_dma_data(dev);
+       if (!data)
+               return DMA_MAPPING_ERROR;
+
+       if (unlikely(data->broken))
+               return DMA_MAPPING_ERROR;
+
+       if (gnttab_alloc_grant_reference_seq(n_pages, &grant))
+               return DMA_MAPPING_ERROR;
+
+       for (i = 0; i < n_pages; i++) {
+               gnttab_grant_foreign_access_ref(grant + i, data->backend_domid,
+                               xen_page_to_gfn(page) + i, dir == DMA_TO_DEVICE);
+       }
+
+       dma_handle = grant_to_dma(grant) + offset;
+
+       return dma_handle;
+}
+
+static void xen_grant_dma_unmap_page(struct device *dev, dma_addr_t dma_handle,
+                                    size_t size, enum dma_data_direction dir,
+                                    unsigned long attrs)
+{
+       struct xen_grant_dma_data *data;
+       unsigned int i, n_pages = PFN_UP(size);
+       grant_ref_t grant;
+
+       if (WARN_ON(dir == DMA_NONE))
+               return;
+
+       data = find_xen_grant_dma_data(dev);
+       if (!data)
+               return;
+
+       if (unlikely(data->broken))
+               return;
+
+       grant = dma_to_grant(dma_handle);
+
+       for (i = 0; i < n_pages; i++) {
+               if (unlikely(!gnttab_end_foreign_access_ref(grant + i))) {
+                       dev_alert(dev, "Grant still in use by backend domain, disabled for further use\n");
+                       data->broken = true;
+                       return;
+               }
+       }
+
+       gnttab_free_grant_reference_seq(grant, n_pages);
+}
+
+static void xen_grant_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
+                                  int nents, enum dma_data_direction dir,
+                                  unsigned long attrs)
+{
+       struct scatterlist *s;
+       unsigned int i;
+
+       if (WARN_ON(dir == DMA_NONE))
+               return;
+
+       for_each_sg(sg, s, nents, i)
+               xen_grant_dma_unmap_page(dev, s->dma_address, sg_dma_len(s), dir,
+                               attrs);
+}
+
+static int xen_grant_dma_map_sg(struct device *dev, struct scatterlist *sg,
+                               int nents, enum dma_data_direction dir,
+                               unsigned long attrs)
+{
+       struct scatterlist *s;
+       unsigned int i;
+
+       if (WARN_ON(dir == DMA_NONE))
+               return -EINVAL;
+
+       for_each_sg(sg, s, nents, i) {
+               s->dma_address = xen_grant_dma_map_page(dev, sg_page(s), s->offset,
+                               s->length, dir, attrs);
+               if (s->dma_address == DMA_MAPPING_ERROR)
+                       goto out;
+
+               sg_dma_len(s) = s->length;
+       }
+
+       return nents;
+
+out:
+       xen_grant_dma_unmap_sg(dev, sg, i, dir, attrs | DMA_ATTR_SKIP_CPU_SYNC);
+       sg_dma_len(sg) = 0;
+
+       return -EIO;
+}
+
+static int xen_grant_dma_supported(struct device *dev, u64 mask)
+{
+       return mask == DMA_BIT_MASK(64);
+}
+
+static const struct dma_map_ops xen_grant_dma_ops = {
+       .alloc = xen_grant_dma_alloc,
+       .free = xen_grant_dma_free,
+       .alloc_pages = xen_grant_dma_alloc_pages,
+       .free_pages = xen_grant_dma_free_pages,
+       .mmap = dma_common_mmap,
+       .get_sgtable = dma_common_get_sgtable,
+       .map_page = xen_grant_dma_map_page,
+       .unmap_page = xen_grant_dma_unmap_page,
+       .map_sg = xen_grant_dma_map_sg,
+       .unmap_sg = xen_grant_dma_unmap_sg,
+       .dma_supported = xen_grant_dma_supported,
+};
+
+bool xen_is_grant_dma_device(struct device *dev)
+{
+       struct device_node *iommu_np;
+       bool has_iommu;
+
+       /* XXX Handle only DT devices for now */
+       if (!dev->of_node)
+               return false;
+
+       iommu_np = of_parse_phandle(dev->of_node, "iommus", 0);
+       has_iommu = iommu_np && of_device_is_compatible(iommu_np, "xen,grant-dma");
+       of_node_put(iommu_np);
+
+       return has_iommu;
+}
+
+void xen_grant_setup_dma_ops(struct device *dev)
+{
+       struct xen_grant_dma_data *data;
+       struct of_phandle_args iommu_spec;
+
+       data = find_xen_grant_dma_data(dev);
+       if (data) {
+               dev_err(dev, "Xen grant DMA data is already created\n");
+               return;
+       }
+
+       /* XXX ACPI device unsupported for now */
+       if (!dev->of_node)
+               goto err;
+
+       if (of_parse_phandle_with_args(dev->of_node, "iommus", "#iommu-cells",
+                       0, &iommu_spec)) {
+               dev_err(dev, "Cannot parse iommus property\n");
+               goto err;
+       }
+
+       if (!of_device_is_compatible(iommu_spec.np, "xen,grant-dma") ||
+                       iommu_spec.args_count != 1) {
+               dev_err(dev, "Incompatible IOMMU node\n");
+               of_node_put(iommu_spec.np);
+               goto err;
+       }
+
+       of_node_put(iommu_spec.np);
+
+       data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+       if (!data)
+               goto err;
+
+       /*
+        * The endpoint ID here means the ID of the domain where the corresponding
+        * backend is running
+        */
+       data->backend_domid = iommu_spec.args[0];
+
+       if (xa_err(xa_store(&xen_grant_dma_devices, (unsigned long)dev, data,
+                       GFP_KERNEL))) {
+               dev_err(dev, "Cannot store Xen grant DMA data\n");
+               goto err;
+       }
+
+       dev->dma_ops = &xen_grant_dma_ops;
+
+       return;
+
+err:
+       dev_err(dev, "Cannot set up Xen grant DMA ops, retain platform DMA ops\n");
+}
+
+MODULE_DESCRIPTION("Xen grant DMA-mapping layer");
+MODULE_AUTHOR("Juergen Gross <jgross@suse.com>");
+MODULE_LICENSE("GPL");
index 7a18292..738029d 100644 (file)
@@ -33,6 +33,7 @@
 
 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
 
+#include <linux/bitmap.h>
 #include <linux/memblock.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
 
 static grant_ref_t **gnttab_list;
 static unsigned int nr_grant_frames;
+
+/*
+ * Handling of free grants:
+ *
+ * Free grants are in a simple list anchored in gnttab_free_head. They are
+ * linked by grant ref, the last element contains GNTTAB_LIST_END. The number
+ * of free entries is stored in gnttab_free_count.
+ * Additionally there is a bitmap of free entries anchored in
+ * gnttab_free_bitmap. This is being used for simplifying allocation of
+ * multiple consecutive grants, which is needed e.g. for support of virtio.
+ * gnttab_last_free is used to add free entries of new frames at the end of
+ * the free list.
+ * gnttab_free_tail_ptr specifies the variable which references the start
+ * of consecutive free grants ending with gnttab_last_free. This pointer is
+ * updated in a rather defensive way, in order to avoid performance hits in
+ * hot paths.
+ * All those variables are protected by gnttab_list_lock.
+ */
 static int gnttab_free_count;
-static grant_ref_t gnttab_free_head;
+static unsigned int gnttab_size;
+static grant_ref_t gnttab_free_head = GNTTAB_LIST_END;
+static grant_ref_t gnttab_last_free = GNTTAB_LIST_END;
+static grant_ref_t *gnttab_free_tail_ptr;
+static unsigned long *gnttab_free_bitmap;
 static DEFINE_SPINLOCK(gnttab_list_lock);
+
 struct grant_frames xen_auto_xlat_grant_frames;
 static unsigned int xen_gnttab_version;
 module_param_named(version, xen_gnttab_version, uint, 0);
@@ -168,16 +192,116 @@ static int get_free_entries(unsigned count)
 
        ref = head = gnttab_free_head;
        gnttab_free_count -= count;
-       while (count-- > 1)
-               head = gnttab_entry(head);
+       while (count--) {
+               bitmap_clear(gnttab_free_bitmap, head, 1);
+               if (gnttab_free_tail_ptr == __gnttab_entry(head))
+                       gnttab_free_tail_ptr = &gnttab_free_head;
+               if (count)
+                       head = gnttab_entry(head);
+       }
        gnttab_free_head = gnttab_entry(head);
        gnttab_entry(head) = GNTTAB_LIST_END;
 
+       if (!gnttab_free_count) {
+               gnttab_last_free = GNTTAB_LIST_END;
+               gnttab_free_tail_ptr = NULL;
+       }
+
        spin_unlock_irqrestore(&gnttab_list_lock, flags);
 
        return ref;
 }
 
+static int get_seq_entry_count(void)
+{
+       if (gnttab_last_free == GNTTAB_LIST_END || !gnttab_free_tail_ptr ||
+           *gnttab_free_tail_ptr == GNTTAB_LIST_END)
+               return 0;
+
+       return gnttab_last_free - *gnttab_free_tail_ptr + 1;
+}
+
+/* Rebuilds the free grant list and tries to find count consecutive entries. */
+static int get_free_seq(unsigned int count)
+{
+       int ret = -ENOSPC;
+       unsigned int from, to;
+       grant_ref_t *last;
+
+       gnttab_free_tail_ptr = &gnttab_free_head;
+       last = &gnttab_free_head;
+
+       for (from = find_first_bit(gnttab_free_bitmap, gnttab_size);
+            from < gnttab_size;
+            from = find_next_bit(gnttab_free_bitmap, gnttab_size, to + 1)) {
+               to = find_next_zero_bit(gnttab_free_bitmap, gnttab_size,
+                                       from + 1);
+               if (ret < 0 && to - from >= count) {
+                       ret = from;
+                       bitmap_clear(gnttab_free_bitmap, ret, count);
+                       from += count;
+                       gnttab_free_count -= count;
+                       if (from == to)
+                               continue;
+               }
+
+               /*
+                * Recreate the free list in order to have it properly sorted.
+                * This is needed to make sure that the free tail has the maximum
+                * possible size.
+                */
+               while (from < to) {
+                       *last = from;
+                       last = __gnttab_entry(from);
+                       gnttab_last_free = from;
+                       from++;
+               }
+               if (to < gnttab_size)
+                       gnttab_free_tail_ptr = __gnttab_entry(to - 1);
+       }
+
+       *last = GNTTAB_LIST_END;
+       if (gnttab_last_free != gnttab_size - 1)
+               gnttab_free_tail_ptr = NULL;
+
+       return ret;
+}
+
+static int get_free_entries_seq(unsigned int count)
+{
+       unsigned long flags;
+       int ret = 0;
+
+       spin_lock_irqsave(&gnttab_list_lock, flags);
+
+       if (gnttab_free_count < count) {
+               ret = gnttab_expand(count - gnttab_free_count);
+               if (ret < 0)
+                       goto out;
+       }
+
+       if (get_seq_entry_count() < count) {
+               ret = get_free_seq(count);
+               if (ret >= 0)
+                       goto out;
+               ret = gnttab_expand(count - get_seq_entry_count());
+               if (ret < 0)
+                       goto out;
+       }
+
+       ret = *gnttab_free_tail_ptr;
+       *gnttab_free_tail_ptr = gnttab_entry(ret + count - 1);
+       gnttab_free_count -= count;
+       if (!gnttab_free_count)
+               gnttab_free_tail_ptr = NULL;
+       bitmap_clear(gnttab_free_bitmap, ret, count);
+
+ out:
+       spin_unlock_irqrestore(&gnttab_list_lock, flags);
+
+       return ret;
+}
+
 static void do_free_callbacks(void)
 {
        struct gnttab_free_callback *callback, *next;
@@ -204,21 +328,51 @@ static inline void check_free_callbacks(void)
                do_free_callbacks();
 }
 
-static void put_free_entry(grant_ref_t ref)
+static void put_free_entry_locked(grant_ref_t ref)
 {
-       unsigned long flags;
-
        if (unlikely(ref < GNTTAB_NR_RESERVED_ENTRIES))
                return;
 
-       spin_lock_irqsave(&gnttab_list_lock, flags);
        gnttab_entry(ref) = gnttab_free_head;
        gnttab_free_head = ref;
+       if (!gnttab_free_count)
+               gnttab_last_free = ref;
+       if (gnttab_free_tail_ptr == &gnttab_free_head)
+               gnttab_free_tail_ptr = __gnttab_entry(ref);
        gnttab_free_count++;
+       bitmap_set(gnttab_free_bitmap, ref, 1);
+}
+
+static void put_free_entry(grant_ref_t ref)
+{
+       unsigned long flags;
+
+       spin_lock_irqsave(&gnttab_list_lock, flags);
+       put_free_entry_locked(ref);
        check_free_callbacks();
        spin_unlock_irqrestore(&gnttab_list_lock, flags);
 }
 
+static void gnttab_set_free(unsigned int start, unsigned int n)
+{
+       unsigned int i;
+
+       for (i = start; i < start + n - 1; i++)
+               gnttab_entry(i) = i + 1;
+
+       gnttab_entry(i) = GNTTAB_LIST_END;
+       if (!gnttab_free_count) {
+               gnttab_free_head = start;
+               gnttab_free_tail_ptr = &gnttab_free_head;
+       } else {
+               gnttab_entry(gnttab_last_free) = start;
+       }
+       gnttab_free_count += n;
+       gnttab_last_free = i;
+
+       bitmap_set(gnttab_free_bitmap, start, n);
+}
+
 /*
  * Following applies to gnttab_update_entry_v1 and gnttab_update_entry_v2.
  * Introducing a valid entry into the grant table:
@@ -450,23 +604,31 @@ void gnttab_free_grant_references(grant_ref_t head)
 {
        grant_ref_t ref;
        unsigned long flags;
-       int count = 1;
-       if (head == GNTTAB_LIST_END)
-               return;
+
        spin_lock_irqsave(&gnttab_list_lock, flags);
-       ref = head;
-       while (gnttab_entry(ref) != GNTTAB_LIST_END) {
-               ref = gnttab_entry(ref);
-               count++;
+       while (head != GNTTAB_LIST_END) {
+               ref = gnttab_entry(head);
+               put_free_entry_locked(head);
+               head = ref;
        }
-       gnttab_entry(ref) = gnttab_free_head;
-       gnttab_free_head = head;
-       gnttab_free_count += count;
        check_free_callbacks();
        spin_unlock_irqrestore(&gnttab_list_lock, flags);
 }
 EXPORT_SYMBOL_GPL(gnttab_free_grant_references);
 
+void gnttab_free_grant_reference_seq(grant_ref_t head, unsigned int count)
+{
+       unsigned long flags;
+       unsigned int i;
+
+       spin_lock_irqsave(&gnttab_list_lock, flags);
+       for (i = count; i > 0; i--)
+               put_free_entry_locked(head + i - 1);
+       check_free_callbacks();
+       spin_unlock_irqrestore(&gnttab_list_lock, flags);
+}
+EXPORT_SYMBOL_GPL(gnttab_free_grant_reference_seq);
+
 int gnttab_alloc_grant_references(u16 count, grant_ref_t *head)
 {
        int h = get_free_entries(count);
@@ -480,6 +642,24 @@ int gnttab_alloc_grant_references(u16 count, grant_ref_t *head)
 }
 EXPORT_SYMBOL_GPL(gnttab_alloc_grant_references);
 
+int gnttab_alloc_grant_reference_seq(unsigned int count, grant_ref_t *first)
+{
+       int h;
+
+       if (count == 1)
+               h = get_free_entries(1);
+       else
+               h = get_free_entries_seq(count);
+
+       if (h < 0)
+               return -ENOSPC;
+
+       *first = h;
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(gnttab_alloc_grant_reference_seq);
+
 int gnttab_empty_grant_references(const grant_ref_t *private_head)
 {
        return (*private_head == GNTTAB_LIST_END);
@@ -572,16 +752,13 @@ static int grow_gnttab_list(unsigned int more_frames)
                        goto grow_nomem;
        }
 
+       gnttab_set_free(gnttab_size, extra_entries);
 
-       for (i = grefs_per_frame * nr_grant_frames;
-            i < grefs_per_frame * new_nr_grant_frames - 1; i++)
-               gnttab_entry(i) = i + 1;
-
-       gnttab_entry(i) = gnttab_free_head;
-       gnttab_free_head = grefs_per_frame * nr_grant_frames;
-       gnttab_free_count += extra_entries;
+       if (!gnttab_free_tail_ptr)
+               gnttab_free_tail_ptr = __gnttab_entry(gnttab_size);
 
        nr_grant_frames = new_nr_grant_frames;
+       gnttab_size += extra_entries;
 
        check_free_callbacks();
 
@@ -1424,20 +1601,20 @@ static int gnttab_expand(unsigned int req_entries)
 int gnttab_init(void)
 {
        int i;
-       unsigned long max_nr_grant_frames;
+       unsigned long max_nr_grant_frames, max_nr_grefs;
        unsigned int max_nr_glist_frames, nr_glist_frames;
-       unsigned int nr_init_grefs;
        int ret;
 
        gnttab_request_version();
        max_nr_grant_frames = gnttab_max_grant_frames();
+       max_nr_grefs = max_nr_grant_frames *
+                       gnttab_interface->grefs_per_grant_frame;
        nr_grant_frames = 1;
 
        /* Determine the maximum number of frames required for the
         * grant reference free list on the current hypervisor.
         */
-       max_nr_glist_frames = (max_nr_grant_frames *
-                              gnttab_interface->grefs_per_grant_frame / RPP);
+       max_nr_glist_frames = max_nr_grefs / RPP;
 
        gnttab_list = kmalloc_array(max_nr_glist_frames,
                                    sizeof(grant_ref_t *),
@@ -1454,6 +1631,12 @@ int gnttab_init(void)
                }
        }
 
+       gnttab_free_bitmap = bitmap_zalloc(max_nr_grefs, GFP_KERNEL);
+       if (!gnttab_free_bitmap) {
+               ret = -ENOMEM;
+               goto ini_nomem;
+       }
+
        ret = arch_gnttab_init(max_nr_grant_frames,
                               nr_status_frames(max_nr_grant_frames));
        if (ret < 0)
@@ -1464,15 +1647,10 @@ int gnttab_init(void)
                goto ini_nomem;
        }
 
-       nr_init_grefs = nr_grant_frames *
-                       gnttab_interface->grefs_per_grant_frame;
-
-       for (i = GNTTAB_NR_RESERVED_ENTRIES; i < nr_init_grefs - 1; i++)
-               gnttab_entry(i) = i + 1;
+       gnttab_size = nr_grant_frames * gnttab_interface->grefs_per_grant_frame;
 
-       gnttab_entry(nr_init_grefs - 1) = GNTTAB_LIST_END;
-       gnttab_free_count = nr_init_grefs - GNTTAB_NR_RESERVED_ENTRIES;
-       gnttab_free_head  = GNTTAB_NR_RESERVED_ENTRIES;
+       gnttab_set_free(GNTTAB_NR_RESERVED_ENTRIES,
+                       gnttab_size - GNTTAB_NR_RESERVED_ENTRIES);
 
        printk("Grant table initialized\n");
        return 0;
@@ -1481,6 +1659,7 @@ int gnttab_init(void)
        for (i--; i >= 0; i--)
                free_page((unsigned long)gnttab_list[i]);
        kfree(gnttab_list);
+       bitmap_free(gnttab_free_bitmap);
        return ret;
 }
 EXPORT_SYMBOL_GPL(gnttab_init);
index 34742c6..f17c4c0 100644 (file)
@@ -261,7 +261,6 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt,
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages);
 
 struct remap_pfn {
        struct mm_struct *mm;
index 1c8dc69..cebba4e 100644 (file)
@@ -62,12 +62,12 @@ void v9fs_cache_inode_get_cookie(struct inode *inode)
        version = cpu_to_le32(v9inode->qid.version);
        path = cpu_to_le64(v9inode->qid.path);
        v9ses = v9fs_inode2v9ses(inode);
-       v9inode->netfs_ctx.cache =
+       v9inode->netfs.cache =
                fscache_acquire_cookie(v9fs_session_cache(v9ses),
                                       0,
                                       &path, sizeof(path),
                                       &version, sizeof(version),
-                                      i_size_read(&v9inode->vfs_inode));
+                                      i_size_read(&v9inode->netfs.inode));
 
        p9_debug(P9_DEBUG_FSC, "inode %p get cookie %p\n",
                 inode, v9fs_inode_cookie(v9inode));
index 79df61f..baf2b15 100644 (file)
@@ -152,7 +152,7 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
        const unsigned char **wnames, *uname;
        int i, n, l, clone, access;
        struct v9fs_session_info *v9ses;
-       struct p9_fid *fid, *old_fid = NULL;
+       struct p9_fid *fid, *old_fid;
 
        v9ses = v9fs_dentry2v9ses(dentry);
        access = v9ses->flags & V9FS_ACCESS_MASK;
@@ -194,13 +194,12 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
                if (IS_ERR(fid))
                        return fid;
 
+               refcount_inc(&fid->count);
                v9fs_fid_add(dentry->d_sb->s_root, fid);
        }
        /* If we are root ourself just return that */
-       if (dentry->d_sb->s_root == dentry) {
-               refcount_inc(&fid->count);
+       if (dentry->d_sb->s_root == dentry)
                return fid;
-       }
        /*
         * Do a multipath walk with attached root.
         * When walking parent we need to make sure we
@@ -212,6 +211,7 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
                fid = ERR_PTR(n);
                goto err_out;
        }
+       old_fid = fid;
        clone = 1;
        i = 0;
        while (i < n) {
@@ -221,19 +221,15 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
                 * walk to ensure none of the patch component change
                 */
                fid = p9_client_walk(fid, l, &wnames[i], clone);
+               /* non-cloning walk will return the same fid */
+               if (fid != old_fid) {
+                       p9_client_clunk(old_fid);
+                       old_fid = fid;
+               }
                if (IS_ERR(fid)) {
-                       if (old_fid) {
-                               /*
-                                * If we fail, clunk fid which are mapping
-                                * to path component and not the last component
-                                * of the path.
-                                */
-                               p9_client_clunk(old_fid);
-                       }
                        kfree(wnames);
                        goto err_out;
                }
-               old_fid = fid;
                i += l;
                clone = 0;
        }
index e28ddf7..0129de2 100644 (file)
@@ -625,7 +625,7 @@ static void v9fs_inode_init_once(void *foo)
        struct v9fs_inode *v9inode = (struct v9fs_inode *)foo;
 
        memset(&v9inode->qid, 0, sizeof(v9inode->qid));
-       inode_init_once(&v9inode->vfs_inode);
+       inode_init_once(&v9inode->netfs.inode);
 }
 
 /**
index ec0e8df..6acabc2 100644 (file)
@@ -109,11 +109,7 @@ struct v9fs_session_info {
 #define V9FS_INO_INVALID_ATTR 0x01
 
 struct v9fs_inode {
-       struct {
-               /* These must be contiguous */
-               struct inode    vfs_inode;      /* the VFS's inode record */
-               struct netfs_i_context netfs_ctx; /* Netfslib context */
-       };
+       struct netfs_inode netfs; /* Netfslib context and vfs inode */
        struct p9_qid qid;
        unsigned int cache_validity;
        struct p9_fid *writeback_fid;
@@ -122,13 +118,13 @@ struct v9fs_inode {
 
 static inline struct v9fs_inode *V9FS_I(const struct inode *inode)
 {
-       return container_of(inode, struct v9fs_inode, vfs_inode);
+       return container_of(inode, struct v9fs_inode, netfs.inode);
 }
 
 static inline struct fscache_cookie *v9fs_inode_cookie(struct v9fs_inode *v9inode)
 {
 #ifdef CONFIG_9P_FSCACHE
-       return netfs_i_cookie(&v9inode->vfs_inode);
+       return netfs_i_cookie(&v9inode->netfs);
 #else
        return NULL;
 #endif
index 8ce82ff..d0833fa 100644 (file)
@@ -58,21 +58,33 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq)
  */
 static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file)
 {
+       struct inode *inode = file_inode(file);
+       struct v9fs_inode *v9inode = V9FS_I(inode);
        struct p9_fid *fid = file->private_data;
 
+       BUG_ON(!fid);
+
+       /* we might need to read from a fid that was opened write-only
+        * for read-modify-write of page cache, use the writeback fid
+        * for that */
+       if (rreq->origin == NETFS_READ_FOR_WRITE &&
+                       (fid->mode & O_ACCMODE) == O_WRONLY) {
+               fid = v9inode->writeback_fid;
+               BUG_ON(!fid);
+       }
+
        refcount_inc(&fid->count);
        rreq->netfs_priv = fid;
        return 0;
 }
 
 /**
- * v9fs_req_cleanup - Cleanup request initialized by v9fs_init_request
- * @mapping: unused mapping of request to cleanup
- * @priv: private data to cleanup, a fid, guaranted non-null.
+ * v9fs_free_request - Cleanup request initialized by v9fs_init_rreq
+ * @rreq: The I/O request to clean up
  */
-static void v9fs_req_cleanup(struct address_space *mapping, void *priv)
+static void v9fs_free_request(struct netfs_io_request *rreq)
 {
-       struct p9_fid *fid = priv;
+       struct p9_fid *fid = rreq->netfs_priv;
 
        p9_client_clunk(fid);
 }
@@ -94,9 +106,9 @@ static int v9fs_begin_cache_operation(struct netfs_io_request *rreq)
 
 const struct netfs_request_ops v9fs_req_ops = {
        .init_request           = v9fs_init_request,
+       .free_request           = v9fs_free_request,
        .begin_cache_operation  = v9fs_begin_cache_operation,
        .issue_read             = v9fs_issue_read,
-       .cleanup                = v9fs_req_cleanup,
 };
 
 /**
@@ -140,7 +152,7 @@ static void v9fs_write_to_cache_done(void *priv, ssize_t transferred_or_error,
            transferred_or_error != -ENOBUFS) {
                version = cpu_to_le32(v9inode->qid.version);
                fscache_invalidate(v9fs_inode_cookie(v9inode), &version,
-                                  i_size_read(&v9inode->vfs_inode), 0);
+                                  i_size_read(&v9inode->netfs.inode), 0);
        }
 }
 
@@ -274,7 +286,7 @@ static int v9fs_write_begin(struct file *filp, struct address_space *mapping,
         * file.  We need to do this before we get a lock on the page in case
         * there's more than one writer competing for the same cache block.
         */
-       retval = netfs_write_begin(filp, mapping, pos, len, &folio, fsdata);
+       retval = netfs_write_begin(&v9inode->netfs, filp, mapping, pos, len, &folio, fsdata);
        if (retval < 0)
                return retval;
 
index 55367ec..3d82977 100644 (file)
@@ -234,7 +234,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb)
        v9inode->writeback_fid = NULL;
        v9inode->cache_validity = 0;
        mutex_init(&v9inode->v_mutex);
-       return &v9inode->vfs_inode;
+       return &v9inode->netfs.inode;
 }
 
 /**
@@ -252,7 +252,8 @@ void v9fs_free_inode(struct inode *inode)
  */
 static void v9fs_set_netfs_context(struct inode *inode)
 {
-       netfs_i_context_init(inode, &v9fs_req_ops);
+       struct v9fs_inode *v9inode = V9FS_I(inode);
+       netfs_inode_init(&v9inode->netfs, &v9fs_req_ops);
 }
 
 int v9fs_init_inode(struct v9fs_session_info *v9ses,
@@ -1250,15 +1251,15 @@ static const char *v9fs_vfs_get_link(struct dentry *dentry,
                return ERR_PTR(-ECHILD);
 
        v9ses = v9fs_dentry2v9ses(dentry);
-       fid = v9fs_fid_lookup(dentry);
+       if (!v9fs_proto_dotu(v9ses))
+               return ERR_PTR(-EBADF);
+
        p9_debug(P9_DEBUG_VFS, "%pd\n", dentry);
+       fid = v9fs_fid_lookup(dentry);
 
        if (IS_ERR(fid))
                return ERR_CAST(fid);
 
-       if (!v9fs_proto_dotu(v9ses))
-               return ERR_PTR(-EBADF);
-
        st = p9_client_stat(fid);
        p9_client_clunk(fid);
        if (IS_ERR(st))
index d17502a..b6eb116 100644 (file)
@@ -274,6 +274,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
        if (IS_ERR(ofid)) {
                err = PTR_ERR(ofid);
                p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
+               p9_client_clunk(dfid);
                goto out;
        }
 
@@ -285,6 +286,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
        if (err) {
                p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
                         err);
+               p9_client_clunk(dfid);
                goto error;
        }
        err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),
@@ -292,6 +294,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
        if (err < 0) {
                p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
                         err);
+               p9_client_clunk(dfid);
                goto error;
        }
        v9fs_invalidate_inode_attr(dir);
index 1b4d580..a484fa6 100644 (file)
@@ -30,7 +30,7 @@ void afs_invalidate_mmap_work(struct work_struct *work)
 {
        struct afs_vnode *vnode = container_of(work, struct afs_vnode, cb_work);
 
-       unmap_mapping_pages(vnode->vfs_inode.i_mapping, 0, 0, false);
+       unmap_mapping_pages(vnode->netfs.inode.i_mapping, 0, 0, false);
 }
 
 void afs_server_init_callback_work(struct work_struct *work)
index 79f6b74..56ae5cd 100644 (file)
@@ -109,7 +109,7 @@ struct afs_lookup_cookie {
  */
 static void afs_dir_read_cleanup(struct afs_read *req)
 {
-       struct address_space *mapping = req->vnode->vfs_inode.i_mapping;
+       struct address_space *mapping = req->vnode->netfs.inode.i_mapping;
        struct folio *folio;
        pgoff_t last = req->nr_pages - 1;
 
@@ -153,7 +153,7 @@ static bool afs_dir_check_folio(struct afs_vnode *dvnode, struct folio *folio,
                block = kmap_local_folio(folio, offset);
                if (block->hdr.magic != AFS_DIR_MAGIC) {
                        printk("kAFS: %s(%lx): [%llx] bad magic %zx/%zx is %04hx\n",
-                              __func__, dvnode->vfs_inode.i_ino,
+                              __func__, dvnode->netfs.inode.i_ino,
                               pos, offset, size, ntohs(block->hdr.magic));
                        trace_afs_dir_check_failed(dvnode, pos + offset, i_size);
                        kunmap_local(block);
@@ -183,7 +183,7 @@ error:
 static void afs_dir_dump(struct afs_vnode *dvnode, struct afs_read *req)
 {
        union afs_xdr_dir_block *block;
-       struct address_space *mapping = dvnode->vfs_inode.i_mapping;
+       struct address_space *mapping = dvnode->netfs.inode.i_mapping;
        struct folio *folio;
        pgoff_t last = req->nr_pages - 1;
        size_t offset, size;
@@ -217,7 +217,7 @@ static void afs_dir_dump(struct afs_vnode *dvnode, struct afs_read *req)
  */
 static int afs_dir_check(struct afs_vnode *dvnode, struct afs_read *req)
 {
-       struct address_space *mapping = dvnode->vfs_inode.i_mapping;
+       struct address_space *mapping = dvnode->netfs.inode.i_mapping;
        struct folio *folio;
        pgoff_t last = req->nr_pages - 1;
        int ret = 0;
@@ -269,7 +269,7 @@ static int afs_dir_open(struct inode *inode, struct file *file)
 static struct afs_read *afs_read_dir(struct afs_vnode *dvnode, struct key *key)
        __acquires(&dvnode->validate_lock)
 {
-       struct address_space *mapping = dvnode->vfs_inode.i_mapping;
+       struct address_space *mapping = dvnode->netfs.inode.i_mapping;
        struct afs_read *req;
        loff_t i_size;
        int nr_pages, i;
@@ -287,7 +287,7 @@ static struct afs_read *afs_read_dir(struct afs_vnode *dvnode, struct key *key)
        req->cleanup = afs_dir_read_cleanup;
 
 expand:
-       i_size = i_size_read(&dvnode->vfs_inode);
+       i_size = i_size_read(&dvnode->netfs.inode);
        if (i_size < 2048) {
                ret = afs_bad(dvnode, afs_file_error_dir_small);
                goto error;
@@ -305,7 +305,7 @@ expand:
        req->actual_len = i_size; /* May change */
        req->len = nr_pages * PAGE_SIZE; /* We can ask for more than there is */
        req->data_version = dvnode->status.data_version; /* May change */
-       iov_iter_xarray(&req->def_iter, READ, &dvnode->vfs_inode.i_mapping->i_pages,
+       iov_iter_xarray(&req->def_iter, READ, &dvnode->netfs.inode.i_mapping->i_pages,
                        0, i_size);
        req->iter = &req->def_iter;
 
@@ -897,7 +897,7 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry,
 
 out_op:
        if (op->error == 0) {
-               inode = &op->file[1].vnode->vfs_inode;
+               inode = &op->file[1].vnode->netfs.inode;
                op->file[1].vnode = NULL;
        }
 
@@ -1139,7 +1139,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
        afs_stat_v(dir, n_reval);
 
        /* search the directory for this vnode */
-       ret = afs_do_lookup_one(&dir->vfs_inode, dentry, &fid, key, &dir_version);
+       ret = afs_do_lookup_one(&dir->netfs.inode, dentry, &fid, key, &dir_version);
        switch (ret) {
        case 0:
                /* the filename maps to something */
@@ -1170,7 +1170,7 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
                        _debug("%pd: file deleted (uq %u -> %u I:%u)",
                               dentry, fid.unique,
                               vnode->fid.unique,
-                              vnode->vfs_inode.i_generation);
+                              vnode->netfs.inode.i_generation);
                        goto not_found;
                }
                goto out_valid;
@@ -1368,7 +1368,7 @@ static void afs_dir_remove_subdir(struct dentry *dentry)
        if (d_really_is_positive(dentry)) {
                struct afs_vnode *vnode = AFS_FS_I(d_inode(dentry));
 
-               clear_nlink(&vnode->vfs_inode);
+               clear_nlink(&vnode->netfs.inode);
                set_bit(AFS_VNODE_DELETED, &vnode->flags);
                clear_bit(AFS_VNODE_CB_PROMISED, &vnode->flags);
                clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags);
@@ -1487,8 +1487,8 @@ static void afs_dir_remove_link(struct afs_operation *op)
                /* Already done */
        } else if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) {
                write_seqlock(&vnode->cb_lock);
-               drop_nlink(&vnode->vfs_inode);
-               if (vnode->vfs_inode.i_nlink == 0) {
+               drop_nlink(&vnode->netfs.inode);
+               if (vnode->netfs.inode.i_nlink == 0) {
                        set_bit(AFS_VNODE_DELETED, &vnode->flags);
                        __afs_break_callback(vnode, afs_cb_break_for_unlink);
                }
@@ -1504,7 +1504,7 @@ static void afs_dir_remove_link(struct afs_operation *op)
                        op->error = ret;
        }
 
-       _debug("nlink %d [val %d]", vnode->vfs_inode.i_nlink, op->error);
+       _debug("nlink %d [val %d]", vnode->netfs.inode.i_nlink, op->error);
 }
 
 static void afs_unlink_success(struct afs_operation *op)
@@ -1680,8 +1680,8 @@ static void afs_link_success(struct afs_operation *op)
        afs_update_dentry_version(op, dvp, op->dentry);
        if (op->dentry_2->d_parent == op->dentry->d_parent)
                afs_update_dentry_version(op, dvp, op->dentry_2);
-       ihold(&vp->vnode->vfs_inode);
-       d_instantiate(op->dentry, &vp->vnode->vfs_inode);
+       ihold(&vp->vnode->netfs.inode);
+       d_instantiate(op->dentry, &vp->vnode->netfs.inode);
 }
 
 static void afs_link_put(struct afs_operation *op)
index d98e109..0ab7752 100644 (file)
@@ -109,7 +109,7 @@ static void afs_clear_contig_bits(union afs_xdr_dir_block *block,
  */
 static struct folio *afs_dir_get_folio(struct afs_vnode *vnode, pgoff_t index)
 {
-       struct address_space *mapping = vnode->vfs_inode.i_mapping;
+       struct address_space *mapping = vnode->netfs.inode.i_mapping;
        struct folio *folio;
 
        folio = __filemap_get_folio(mapping, index,
@@ -216,7 +216,7 @@ void afs_edit_dir_add(struct afs_vnode *vnode,
 
        _enter(",,{%d,%s},", name->len, name->name);
 
-       i_size = i_size_read(&vnode->vfs_inode);
+       i_size = i_size_read(&vnode->netfs.inode);
        if (i_size > AFS_DIR_BLOCK_SIZE * AFS_DIR_MAX_BLOCKS ||
            (i_size & (AFS_DIR_BLOCK_SIZE - 1))) {
                clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags);
@@ -336,7 +336,7 @@ found_space:
        if (b < AFS_DIR_BLOCKS_WITH_CTR)
                meta->meta.alloc_ctrs[b] -= need_slots;
 
-       inode_inc_iversion_raw(&vnode->vfs_inode);
+       inode_inc_iversion_raw(&vnode->netfs.inode);
        afs_stat_v(vnode, n_dir_cr);
        _debug("Insert %s in %u[%u]", name->name, b, slot);
 
@@ -383,7 +383,7 @@ void afs_edit_dir_remove(struct afs_vnode *vnode,
 
        _enter(",,{%d,%s},", name->len, name->name);
 
-       i_size = i_size_read(&vnode->vfs_inode);
+       i_size = i_size_read(&vnode->netfs.inode);
        if (i_size < AFS_DIR_BLOCK_SIZE ||
            i_size > AFS_DIR_BLOCK_SIZE * AFS_DIR_MAX_BLOCKS ||
            (i_size & (AFS_DIR_BLOCK_SIZE - 1))) {
@@ -463,7 +463,7 @@ found_dirent:
        if (b < AFS_DIR_BLOCKS_WITH_CTR)
                meta->meta.alloc_ctrs[b] += need_slots;
 
-       inode_set_iversion_raw(&vnode->vfs_inode, vnode->status.data_version);
+       inode_set_iversion_raw(&vnode->netfs.inode, vnode->status.data_version);
        afs_stat_v(vnode, n_dir_rm);
        _debug("Remove %s from %u[%u]", name->name, b, slot);
 
index 45cfd50..bb5807e 100644 (file)
@@ -131,7 +131,7 @@ int afs_sillyrename(struct afs_vnode *dvnode, struct afs_vnode *vnode,
                        goto out;
        } while (!d_is_negative(sdentry));
 
-       ihold(&vnode->vfs_inode);
+       ihold(&vnode->netfs.inode);
 
        ret = afs_do_silly_rename(dvnode, vnode, dentry, sdentry, key);
        switch (ret) {
@@ -148,7 +148,7 @@ int afs_sillyrename(struct afs_vnode *dvnode, struct afs_vnode *vnode,
                d_drop(sdentry);
        }
 
-       iput(&vnode->vfs_inode);
+       iput(&vnode->netfs.inode);
        dput(sdentry);
 out:
        _leave(" = %d", ret);
index f120bcb..d7d9402 100644 (file)
@@ -76,7 +76,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root)
        /* there shouldn't be an existing inode */
        BUG_ON(!(inode->i_state & I_NEW));
 
-       netfs_i_context_init(inode, NULL);
+       netfs_inode_init(&vnode->netfs, NULL);
        inode->i_size           = 0;
        inode->i_mode           = S_IFDIR | S_IRUGO | S_IXUGO;
        if (root) {
index a8e8832..42118a4 100644 (file)
@@ -194,7 +194,7 @@ int afs_release(struct inode *inode, struct file *file)
                afs_put_wb_key(af->wb);
 
        if ((file->f_mode & FMODE_WRITE)) {
-               i_size = i_size_read(&vnode->vfs_inode);
+               i_size = i_size_read(&vnode->netfs.inode);
                afs_set_cache_aux(vnode, &aux);
                fscache_unuse_cookie(afs_vnode_cache(vnode), &aux, &i_size);
        } else {
@@ -325,7 +325,7 @@ static void afs_issue_read(struct netfs_io_subrequest *subreq)
        fsreq->iter     = &fsreq->def_iter;
 
        iov_iter_xarray(&fsreq->def_iter, READ,
-                       &fsreq->vnode->vfs_inode.i_mapping->i_pages,
+                       &fsreq->vnode->netfs.inode.i_mapping->i_pages,
                        fsreq->pos, fsreq->len);
 
        afs_fetch_data(fsreq->vnode, fsreq);
@@ -382,17 +382,17 @@ static int afs_check_write_begin(struct file *file, loff_t pos, unsigned len,
        return test_bit(AFS_VNODE_DELETED, &vnode->flags) ? -ESTALE : 0;
 }
 
-static void afs_priv_cleanup(struct address_space *mapping, void *netfs_priv)
+static void afs_free_request(struct netfs_io_request *rreq)
 {
-       key_put(netfs_priv);
+       key_put(rreq->netfs_priv);
 }
 
 const struct netfs_request_ops afs_req_ops = {
        .init_request           = afs_init_request,
+       .free_request           = afs_free_request,
        .begin_cache_operation  = afs_begin_cache_operation,
        .check_write_begin      = afs_check_write_begin,
        .issue_read             = afs_issue_read,
-       .cleanup                = afs_priv_cleanup,
 };
 
 int afs_write_inode(struct inode *inode, struct writeback_control *wbc)
index d222dfb..7a3803c 100644 (file)
@@ -232,14 +232,14 @@ int afs_put_operation(struct afs_operation *op)
        if (op->file[1].modification && op->file[1].vnode != op->file[0].vnode)
                clear_bit(AFS_VNODE_MODIFYING, &op->file[1].vnode->flags);
        if (op->file[0].put_vnode)
-               iput(&op->file[0].vnode->vfs_inode);
+               iput(&op->file[0].vnode->netfs.inode);
        if (op->file[1].put_vnode)
-               iput(&op->file[1].vnode->vfs_inode);
+               iput(&op->file[1].vnode->netfs.inode);
 
        if (op->more_files) {
                for (i = 0; i < op->nr_files - 2; i++)
                        if (op->more_files[i].put_vnode)
-                               iput(&op->more_files[i].vnode->vfs_inode);
+                               iput(&op->more_files[i].vnode->netfs.inode);
                kfree(op->more_files);
        }
 
index 30b0662..64dab70 100644 (file)
@@ -58,7 +58,7 @@ static noinline void dump_vnode(struct afs_vnode *vnode, struct afs_vnode *paren
  */
 static void afs_set_netfs_context(struct afs_vnode *vnode)
 {
-       netfs_i_context_init(&vnode->vfs_inode, &afs_req_ops);
+       netfs_inode_init(&vnode->netfs, &afs_req_ops);
 }
 
 /*
@@ -96,7 +96,7 @@ static int afs_inode_init_from_status(struct afs_operation *op,
        inode->i_flags |= S_NOATIME;
        inode->i_uid = make_kuid(&init_user_ns, status->owner);
        inode->i_gid = make_kgid(&init_user_ns, status->group);
-       set_nlink(&vnode->vfs_inode, status->nlink);
+       set_nlink(&vnode->netfs.inode, status->nlink);
 
        switch (status->type) {
        case AFS_FTYPE_FILE:
@@ -139,7 +139,7 @@ static int afs_inode_init_from_status(struct afs_operation *op,
        afs_set_netfs_context(vnode);
 
        vnode->invalid_before   = status->data_version;
-       inode_set_iversion_raw(&vnode->vfs_inode, status->data_version);
+       inode_set_iversion_raw(&vnode->netfs.inode, status->data_version);
 
        if (!vp->scb.have_cb) {
                /* it's a symlink we just created (the fileserver
@@ -163,7 +163,7 @@ static void afs_apply_status(struct afs_operation *op,
 {
        struct afs_file_status *status = &vp->scb.status;
        struct afs_vnode *vnode = vp->vnode;
-       struct inode *inode = &vnode->vfs_inode;
+       struct inode *inode = &vnode->netfs.inode;
        struct timespec64 t;
        umode_t mode;
        bool data_changed = false;
@@ -246,7 +246,7 @@ static void afs_apply_status(struct afs_operation *op,
                 * idea of what the size should be that's not the same as
                 * what's on the server.
                 */
-               vnode->netfs_ctx.remote_i_size = status->size;
+               vnode->netfs.remote_i_size = status->size;
                if (change_size) {
                        afs_set_i_size(vnode, status->size);
                        inode->i_ctime = t;
@@ -289,7 +289,7 @@ void afs_vnode_commit_status(struct afs_operation *op, struct afs_vnode_param *v
                 */
                if (vp->scb.status.abort_code == VNOVNODE) {
                        set_bit(AFS_VNODE_DELETED, &vnode->flags);
-                       clear_nlink(&vnode->vfs_inode);
+                       clear_nlink(&vnode->netfs.inode);
                        __afs_break_callback(vnode, afs_cb_break_for_deleted);
                        op->flags &= ~AFS_OPERATION_DIR_CONFLICT;
                }
@@ -306,8 +306,8 @@ void afs_vnode_commit_status(struct afs_operation *op, struct afs_vnode_param *v
                if (vp->scb.have_cb)
                        afs_apply_callback(op, vp);
        } else if (vp->op_unlinked && !(op->flags & AFS_OPERATION_DIR_CONFLICT)) {
-               drop_nlink(&vnode->vfs_inode);
-               if (vnode->vfs_inode.i_nlink == 0) {
+               drop_nlink(&vnode->netfs.inode);
+               if (vnode->netfs.inode.i_nlink == 0) {
                        set_bit(AFS_VNODE_DELETED, &vnode->flags);
                        __afs_break_callback(vnode, afs_cb_break_for_deleted);
                }
@@ -326,7 +326,7 @@ static void afs_fetch_status_success(struct afs_operation *op)
        struct afs_vnode *vnode = vp->vnode;
        int ret;
 
-       if (vnode->vfs_inode.i_state & I_NEW) {
+       if (vnode->netfs.inode.i_state & I_NEW) {
                ret = afs_inode_init_from_status(op, vp, vnode);
                op->error = ret;
                if (ret == 0)
@@ -430,7 +430,7 @@ static void afs_get_inode_cache(struct afs_vnode *vnode)
        struct afs_vnode_cache_aux aux;
 
        if (vnode->status.type != AFS_FTYPE_FILE) {
-               vnode->netfs_ctx.cache = NULL;
+               vnode->netfs.cache = NULL;
                return;
        }
 
@@ -457,7 +457,7 @@ static void afs_get_inode_cache(struct afs_vnode *vnode)
 struct inode *afs_iget(struct afs_operation *op, struct afs_vnode_param *vp)
 {
        struct afs_vnode_param *dvp = &op->file[0];
-       struct super_block *sb = dvp->vnode->vfs_inode.i_sb;
+       struct super_block *sb = dvp->vnode->netfs.inode.i_sb;
        struct afs_vnode *vnode;
        struct inode *inode;
        int ret;
@@ -582,10 +582,10 @@ static void afs_zap_data(struct afs_vnode *vnode)
        /* nuke all the non-dirty pages that aren't locked, mapped or being
         * written back in a regular file and completely discard the pages in a
         * directory or symlink */
-       if (S_ISREG(vnode->vfs_inode.i_mode))
-               invalidate_remote_inode(&vnode->vfs_inode);
+       if (S_ISREG(vnode->netfs.inode.i_mode))
+               invalidate_remote_inode(&vnode->netfs.inode);
        else
-               invalidate_inode_pages2(vnode->vfs_inode.i_mapping);
+               invalidate_inode_pages2(vnode->netfs.inode.i_mapping);
 }
 
 /*
@@ -683,8 +683,8 @@ int afs_validate(struct afs_vnode *vnode, struct key *key)
               key_serial(key));
 
        if (unlikely(test_bit(AFS_VNODE_DELETED, &vnode->flags))) {
-               if (vnode->vfs_inode.i_nlink)
-                       clear_nlink(&vnode->vfs_inode);
+               if (vnode->netfs.inode.i_nlink)
+                       clear_nlink(&vnode->netfs.inode);
                goto valid;
        }
 
@@ -745,7 +745,8 @@ int afs_getattr(struct user_namespace *mnt_userns, const struct path *path,
 
        _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation);
 
-       if (!(query_flags & AT_STATX_DONT_SYNC) &&
+       if (vnode->volume &&
+           !(query_flags & AT_STATX_DONT_SYNC) &&
            !test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) {
                key = afs_request_key(vnode->volume->cell);
                if (IS_ERR(key))
@@ -826,7 +827,7 @@ void afs_evict_inode(struct inode *inode)
 static void afs_setattr_success(struct afs_operation *op)
 {
        struct afs_vnode_param *vp = &op->file[0];
-       struct inode *inode = &vp->vnode->vfs_inode;
+       struct inode *inode = &vp->vnode->netfs.inode;
        loff_t old_i_size = i_size_read(inode);
 
        op->setattr.old_i_size = old_i_size;
@@ -843,7 +844,7 @@ static void afs_setattr_success(struct afs_operation *op)
 static void afs_setattr_edit_file(struct afs_operation *op)
 {
        struct afs_vnode_param *vp = &op->file[0];
-       struct inode *inode = &vp->vnode->vfs_inode;
+       struct inode *inode = &vp->vnode->netfs.inode;
 
        if (op->setattr.attr->ia_valid & ATTR_SIZE) {
                loff_t size = op->setattr.attr->ia_size;
@@ -875,7 +876,7 @@ int afs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                ATTR_MTIME | ATTR_MTIME_SET | ATTR_TIMES_SET | ATTR_TOUCH;
        struct afs_operation *op;
        struct afs_vnode *vnode = AFS_FS_I(d_inode(dentry));
-       struct inode *inode = &vnode->vfs_inode;
+       struct inode *inode = &vnode->netfs.inode;
        loff_t i_size;
        int ret;
 
index a309959..a6f25d9 100644 (file)
@@ -619,12 +619,7 @@ enum afs_lock_state {
  * leak from one inode to another.
  */
 struct afs_vnode {
-       struct {
-               /* These must be contiguous */
-               struct inode    vfs_inode;      /* the VFS's inode record */
-               struct netfs_i_context netfs_ctx; /* Netfslib context */
-       };
-
+       struct netfs_inode      netfs;          /* Netfslib context and vfs inode */
        struct afs_volume       *volume;        /* volume on which vnode resides */
        struct afs_fid          fid;            /* the file identifier for this inode */
        struct afs_file_status  status;         /* AFS status info for this file */
@@ -675,7 +670,7 @@ struct afs_vnode {
 static inline struct fscache_cookie *afs_vnode_cache(struct afs_vnode *vnode)
 {
 #ifdef CONFIG_AFS_FSCACHE
-       return netfs_i_cookie(&vnode->vfs_inode);
+       return netfs_i_cookie(&vnode->netfs);
 #else
        return NULL;
 #endif
@@ -685,7 +680,7 @@ static inline void afs_vnode_set_cache(struct afs_vnode *vnode,
                                       struct fscache_cookie *cookie)
 {
 #ifdef CONFIG_AFS_FSCACHE
-       vnode->netfs_ctx.cache = cookie;
+       vnode->netfs.cache = cookie;
 #endif
 }
 
@@ -892,7 +887,7 @@ static inline void afs_invalidate_cache(struct afs_vnode *vnode, unsigned int fl
 
        afs_set_cache_aux(vnode, &aux);
        fscache_invalidate(afs_vnode_cache(vnode), &aux,
-                          i_size_read(&vnode->vfs_inode), flags);
+                          i_size_read(&vnode->netfs.inode), flags);
 }
 
 /*
@@ -1217,7 +1212,7 @@ static inline struct afs_net *afs_i2net(struct inode *inode)
 
 static inline struct afs_net *afs_v2net(struct afs_vnode *vnode)
 {
-       return afs_i2net(&vnode->vfs_inode);
+       return afs_i2net(&vnode->netfs.inode);
 }
 
 static inline struct afs_net *afs_sock2net(struct sock *sk)
@@ -1593,12 +1588,12 @@ extern void yfs_fs_store_opaque_acl2(struct afs_operation *);
  */
 static inline struct afs_vnode *AFS_FS_I(struct inode *inode)
 {
-       return container_of(inode, struct afs_vnode, vfs_inode);
+       return container_of(inode, struct afs_vnode, netfs.inode);
 }
 
 static inline struct inode *AFS_VNODE_TO_I(struct afs_vnode *vnode)
 {
-       return &vnode->vfs_inode;
+       return &vnode->netfs.inode;
 }
 
 /*
@@ -1621,8 +1616,8 @@ static inline void afs_update_dentry_version(struct afs_operation *op,
  */
 static inline void afs_set_i_size(struct afs_vnode *vnode, u64 size)
 {
-       i_size_write(&vnode->vfs_inode, size);
-       vnode->vfs_inode.i_blocks = ((size + 1023) >> 10) << 1;
+       i_size_write(&vnode->netfs.inode, size);
+       vnode->netfs.inode.i_blocks = ((size + 1023) >> 10) << 1;
 }
 
 /*
index 1fea195..95d7130 100644 (file)
@@ -659,7 +659,7 @@ static void afs_i_init_once(void *_vnode)
        struct afs_vnode *vnode = _vnode;
 
        memset(vnode, 0, sizeof(*vnode));
-       inode_init_once(&vnode->vfs_inode);
+       inode_init_once(&vnode->netfs.inode);
        mutex_init(&vnode->io_lock);
        init_rwsem(&vnode->validate_lock);
        spin_lock_init(&vnode->wb_lock);
@@ -700,8 +700,8 @@ static struct inode *afs_alloc_inode(struct super_block *sb)
        init_rwsem(&vnode->rmdir_lock);
        INIT_WORK(&vnode->cb_work, afs_invalidate_mmap_work);
 
-       _leave(" = %p", &vnode->vfs_inode);
-       return &vnode->vfs_inode;
+       _leave(" = %p", &vnode->netfs.inode);
+       return &vnode->netfs.inode;
 }
 
 static void afs_free_inode(struct inode *inode)
index 94a3d24..cc665ce 100644 (file)
@@ -9,8 +9,7 @@
 #include <linux/slab.h>
 #include "internal.h"
 
-unsigned __read_mostly afs_volume_gc_delay = 10;
-unsigned __read_mostly afs_volume_record_life = 60 * 60;
+static unsigned __read_mostly afs_volume_record_life = 60 * 60;
 
 /*
  * Insert a volume into a cell.  If there's an existing volume record, that is
index 2236b21..2c885b2 100644 (file)
@@ -60,7 +60,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
         * file.  We need to do this before we get a lock on the page in case
         * there's more than one writer competing for the same cache block.
         */
-       ret = netfs_write_begin(file, mapping, pos, len, &folio, fsdata);
+       ret = netfs_write_begin(&vnode->netfs, file, mapping, pos, len, &folio, fsdata);
        if (ret < 0)
                return ret;
 
@@ -146,10 +146,10 @@ int afs_write_end(struct file *file, struct address_space *mapping,
 
        write_end_pos = pos + copied;
 
-       i_size = i_size_read(&vnode->vfs_inode);
+       i_size = i_size_read(&vnode->netfs.inode);
        if (write_end_pos > i_size) {
                write_seqlock(&vnode->cb_lock);
-               i_size = i_size_read(&vnode->vfs_inode);
+               i_size = i_size_read(&vnode->netfs.inode);
                if (write_end_pos > i_size)
                        afs_set_i_size(vnode, write_end_pos);
                write_sequnlock(&vnode->cb_lock);
@@ -257,7 +257,7 @@ static void afs_redirty_pages(struct writeback_control *wbc,
  */
 static void afs_pages_written_back(struct afs_vnode *vnode, loff_t start, unsigned int len)
 {
-       struct address_space *mapping = vnode->vfs_inode.i_mapping;
+       struct address_space *mapping = vnode->netfs.inode.i_mapping;
        struct folio *folio;
        pgoff_t end;
 
@@ -354,7 +354,6 @@ static const struct afs_operation_ops afs_store_data_operation = {
 static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos,
                          bool laundering)
 {
-       struct netfs_i_context *ictx = &vnode->netfs_ctx;
        struct afs_operation *op;
        struct afs_wb_key *wbk = NULL;
        loff_t size = iov_iter_count(iter);
@@ -385,9 +384,9 @@ static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t
        op->store.write_iter = iter;
        op->store.pos = pos;
        op->store.size = size;
-       op->store.i_size = max(pos + size, ictx->remote_i_size);
+       op->store.i_size = max(pos + size, vnode->netfs.remote_i_size);
        op->store.laundering = laundering;
-       op->mtime = vnode->vfs_inode.i_mtime;
+       op->mtime = vnode->netfs.inode.i_mtime;
        op->flags |= AFS_OPERATION_UNINTR;
        op->ops = &afs_store_data_operation;
 
@@ -554,7 +553,7 @@ static ssize_t afs_write_back_from_locked_folio(struct address_space *mapping,
        struct iov_iter iter;
        unsigned long priv;
        unsigned int offset, to, len, max_len;
-       loff_t i_size = i_size_read(&vnode->vfs_inode);
+       loff_t i_size = i_size_read(&vnode->netfs.inode);
        bool new_content = test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags);
        bool caching = fscache_cookie_enabled(afs_vnode_cache(vnode));
        long count = wbc->nr_to_write;
@@ -845,7 +844,7 @@ ssize_t afs_file_write(struct kiocb *iocb, struct iov_iter *from)
        _enter("{%llx:%llu},{%zu},",
               vnode->fid.vid, vnode->fid.vnode, count);
 
-       if (IS_SWAPFILE(&vnode->vfs_inode)) {
+       if (IS_SWAPFILE(&vnode->netfs.inode)) {
                printk(KERN_INFO
                       "AFS: Attempt to write to active swap file!\n");
                return -EBUSY;
@@ -958,8 +957,8 @@ void afs_prune_wb_keys(struct afs_vnode *vnode)
        /* Discard unused keys */
        spin_lock(&vnode->wb_lock);
 
-       if (!mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_WRITEBACK) &&
-           !mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_DIRTY)) {
+       if (!mapping_tagged(&vnode->netfs.inode.i_data, PAGECACHE_TAG_WRITEBACK) &&
+           !mapping_tagged(&vnode->netfs.inode.i_data, PAGECACHE_TAG_DIRTY)) {
                list_for_each_entry_safe(wbk, tmp, &vnode->wb_keys, vnode_link) {
                        if (refcount_read(&wbk->usage) == 1)
                                list_move(&wbk->vnode_link, &graveyard);
@@ -1034,6 +1033,6 @@ static void afs_write_to_cache(struct afs_vnode *vnode,
                               bool caching)
 {
        fscache_write_to_cache(afs_vnode_cache(vnode),
-                              vnode->vfs_inode.i_mapping, start, len, i_size,
+                              vnode->netfs.inode.i_mapping, start, len, i_size,
                               afs_write_to_cache_done, vnode, caching);
 }
index 66899b6..dbe996b 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -61,9 +61,15 @@ static bool chgrp_ok(struct user_namespace *mnt_userns,
                     const struct inode *inode, kgid_t gid)
 {
        kgid_t kgid = i_gid_into_mnt(mnt_userns, inode);
-       if (uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode)) &&
-           (in_group_p(gid) || gid_eq(gid, inode->i_gid)))
-               return true;
+       if (uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
+               kgid_t mapped_gid;
+
+               if (gid_eq(gid, inode->i_gid))
+                       return true;
+               mapped_gid = mapped_kgid_fs(mnt_userns, i_user_ns(inode), gid);
+               if (in_group_p(mapped_gid))
+                       return true;
+       }
        if (capable_wrt_inode_uidgid(mnt_userns, inode, CAP_CHOWN))
                return true;
        if (gid_eq(kgid, INVALID_GID) &&
@@ -123,12 +129,20 @@ int setattr_prepare(struct user_namespace *mnt_userns, struct dentry *dentry,
 
        /* Make sure a caller can chmod. */
        if (ia_valid & ATTR_MODE) {
+               kgid_t mapped_gid;
+
                if (!inode_owner_or_capable(mnt_userns, inode))
                        return -EPERM;
+
+               if (ia_valid & ATTR_GID)
+                       mapped_gid = mapped_kgid_fs(mnt_userns,
+                                               i_user_ns(inode), attr->ia_gid);
+               else
+                       mapped_gid = i_gid_into_mnt(mnt_userns, inode);
+
                /* Also check the setgid bit! */
-               if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid :
-                                i_gid_into_mnt(mnt_userns, inode)) &&
-                    !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
+               if (!in_group_p(mapped_gid) &&
+                   !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
                        attr->ia_mode &= ~S_ISGID;
        }
 
index 3ac668a..35e0e86 100644 (file)
@@ -104,6 +104,7 @@ struct btrfs_block_group {
        unsigned int relocating_repair:1;
        unsigned int chunk_item_inserted:1;
        unsigned int zone_is_active:1;
+       unsigned int zoned_data_reloc_ongoing:1;
 
        int disk_cache_state;
 
index 0e49b1a..415bf18 100644 (file)
@@ -1330,6 +1330,8 @@ struct btrfs_replace_extent_info {
         * existing extent into a file range.
         */
        bool is_new_extent;
+       /* Indicate if we should update the inode's mtime and ctime. */
+       bool update_times;
        /* Meaningful only if is_new_extent is true. */
        int qgroup_reserved;
        /*
index 89e94ea..4ba005c 100644 (file)
@@ -4632,6 +4632,17 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
        int ret;
 
        set_bit(BTRFS_FS_CLOSING_START, &fs_info->flags);
+
+       /*
+        * We may have the reclaim task running and relocating a data block group,
+        * in which case it may create delayed iputs. So stop it before we park
+        * the cleaner kthread otherwise we can get new delayed iputs after
+        * parking the cleaner, and that can make the async reclaim task to hang
+        * if it's waiting for delayed iputs to complete, since the cleaner is
+        * parked and can not run delayed iputs - this will make us hang when
+        * trying to stop the async reclaim task.
+        */
+       cancel_work_sync(&fs_info->reclaim_bgs_work);
        /*
         * We don't want the cleaner to start new transactions, add more delayed
         * iputs, etc. while we're closing. We can't use kthread_stop() yet
@@ -4672,8 +4683,6 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
        cancel_work_sync(&fs_info->async_data_reclaim_work);
        cancel_work_sync(&fs_info->preempt_reclaim_work);
 
-       cancel_work_sync(&fs_info->reclaim_bgs_work);
-
        /* Cancel or finish ongoing discard work */
        btrfs_discard_cleanup(fs_info);
 
index 0867c5c..4157ecc 100644 (file)
@@ -3832,7 +3832,7 @@ static int do_allocation_zoned(struct btrfs_block_group *block_group,
               block_group->start == fs_info->data_reloc_bg ||
               fs_info->data_reloc_bg == 0);
 
-       if (block_group->ro) {
+       if (block_group->ro || block_group->zoned_data_reloc_ongoing) {
                ret = 1;
                goto out;
        }
@@ -3894,8 +3894,24 @@ static int do_allocation_zoned(struct btrfs_block_group *block_group,
 out:
        if (ret && ffe_ctl->for_treelog)
                fs_info->treelog_bg = 0;
-       if (ret && ffe_ctl->for_data_reloc)
+       if (ret && ffe_ctl->for_data_reloc &&
+           fs_info->data_reloc_bg == block_group->start) {
+               /*
+                * Do not allow further allocations from this block group.
+                * Compared to increasing the ->ro, setting the
+                * ->zoned_data_reloc_ongoing flag still allows nocow
+                *  writers to come in. See btrfs_inc_nocow_writers().
+                *
+                * We need to disable an allocation to avoid an allocation of
+                * regular (non-relocation data) extent. With mix of relocation
+                * extents and regular extents, we can dispatch WRITE commands
+                * (for relocation extents) and ZONE APPEND commands (for
+                * regular extents) at the same time to the same zone, which
+                * easily break the write pointer.
+                */
+               block_group->zoned_data_reloc_ongoing = 1;
                fs_info->data_reloc_bg = 0;
+       }
        spin_unlock(&fs_info->relocation_bg_lock);
        spin_unlock(&fs_info->treelog_bg_lock);
        spin_unlock(&block_group->lock);
index 8f6b544..04e3634 100644 (file)
@@ -5241,13 +5241,14 @@ int extent_writepages(struct address_space *mapping,
         */
        btrfs_zoned_data_reloc_lock(BTRFS_I(inode));
        ret = extent_write_cache_pages(mapping, wbc, &epd);
-       btrfs_zoned_data_reloc_unlock(BTRFS_I(inode));
        ASSERT(ret <= 0);
        if (ret < 0) {
+               btrfs_zoned_data_reloc_unlock(BTRFS_I(inode));
                end_write_bio(&epd, ret);
                return ret;
        }
        flush_write_bio(&epd);
+       btrfs_zoned_data_reloc_unlock(BTRFS_I(inode));
        return ret;
 }
 
index 1fd827b..9dfde1a 100644 (file)
@@ -2323,25 +2323,62 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
         */
        btrfs_inode_unlock(inode, BTRFS_ILOCK_MMAP);
 
-       if (ret != BTRFS_NO_LOG_SYNC) {
+       if (ret == BTRFS_NO_LOG_SYNC) {
+               ret = btrfs_end_transaction(trans);
+               goto out;
+       }
+
+       /* We successfully logged the inode, attempt to sync the log. */
+       if (!ret) {
+               ret = btrfs_sync_log(trans, root, &ctx);
                if (!ret) {
-                       ret = btrfs_sync_log(trans, root, &ctx);
-                       if (!ret) {
-                               ret = btrfs_end_transaction(trans);
-                               goto out;
-                       }
-               }
-               if (!full_sync) {
-                       ret = btrfs_wait_ordered_range(inode, start, len);
-                       if (ret) {
-                               btrfs_end_transaction(trans);
-                               goto out;
-                       }
+                       ret = btrfs_end_transaction(trans);
+                       goto out;
                }
-               ret = btrfs_commit_transaction(trans);
-       } else {
+       }
+
+       /*
+        * At this point we need to commit the transaction because we had
+        * btrfs_need_log_full_commit() or some other error.
+        *
+        * If we didn't do a full sync we have to stop the trans handle, wait on
+        * the ordered extents, start it again and commit the transaction.  If
+        * we attempt to wait on the ordered extents here we could deadlock with
+        * something like fallocate() that is holding the extent lock trying to
+        * start a transaction while some other thread is trying to commit the
+        * transaction while we (fsync) are currently holding the transaction
+        * open.
+        */
+       if (!full_sync) {
                ret = btrfs_end_transaction(trans);
+               if (ret)
+                       goto out;
+               ret = btrfs_wait_ordered_range(inode, start, len);
+               if (ret)
+                       goto out;
+
+               /*
+                * This is safe to use here because we're only interested in
+                * making sure the transaction that had the ordered extents is
+                * committed.  We aren't waiting on anything past this point,
+                * we're purely getting the transaction and committing it.
+                */
+               trans = btrfs_attach_transaction_barrier(root);
+               if (IS_ERR(trans)) {
+                       ret = PTR_ERR(trans);
+
+                       /*
+                        * We committed the transaction and there's no currently
+                        * running transaction, this means everything we care
+                        * about made it to disk and we are done.
+                        */
+                       if (ret == -ENOENT)
+                               ret = 0;
+                       goto out;
+               }
        }
+
+       ret = btrfs_commit_transaction(trans);
 out:
        ASSERT(list_empty(&ctx.list));
        err = file_check_and_advance_wb_err(file);
@@ -2719,7 +2756,8 @@ int btrfs_replace_file_extents(struct btrfs_inode *inode,
 
        ret = btrfs_block_rsv_migrate(&fs_info->trans_block_rsv, rsv,
                                      min_size, false);
-       BUG_ON(ret);
+       if (WARN_ON(ret))
+               goto out_trans;
        trans->block_rsv = rsv;
 
        cur_offset = start;
@@ -2803,6 +2841,25 @@ int btrfs_replace_file_extents(struct btrfs_inode *inode,
                        extent_info->file_offset += replace_len;
                }
 
+               /*
+                * We are releasing our handle on the transaction, balance the
+                * dirty pages of the btree inode and flush delayed items, and
+                * then get a new transaction handle, which may now point to a
+                * new transaction in case someone else may have committed the
+                * transaction we used to replace/drop file extent items. So
+                * bump the inode's iversion and update mtime and ctime except
+                * if we are called from a dedupe context. This is because a
+                * power failure/crash may happen after the transaction is
+                * committed and before we finish replacing/dropping all the
+                * file extent items we need.
+                */
+               inode_inc_iversion(&inode->vfs_inode);
+
+               if (!extent_info || extent_info->update_times) {
+                       inode->vfs_inode.i_mtime = current_time(&inode->vfs_inode);
+                       inode->vfs_inode.i_ctime = inode->vfs_inode.i_mtime;
+               }
+
                ret = btrfs_update_inode(trans, root, inode);
                if (ret)
                        break;
@@ -2819,7 +2876,8 @@ int btrfs_replace_file_extents(struct btrfs_inode *inode,
 
                ret = btrfs_block_rsv_migrate(&fs_info->trans_block_rsv,
                                              rsv, min_size, false);
-               BUG_ON(ret);    /* shouldn't happen */
+               if (WARN_ON(ret))
+                       break;
                trans->block_rsv = rsv;
 
                cur_offset = drop_args.drop_end;
index 81737ef..05e0c4a 100644 (file)
@@ -3195,6 +3195,8 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
                                                ordered_extent->file_offset,
                                                ordered_extent->file_offset +
                                                logical_len);
+               btrfs_zoned_release_data_reloc_bg(fs_info, ordered_extent->disk_bytenr,
+                                                 ordered_extent->disk_num_bytes);
        } else {
                BUG_ON(root == fs_info->tree_root);
                ret = insert_ordered_extent_file_extent(trans, ordered_extent);
@@ -9897,6 +9899,7 @@ static struct btrfs_trans_handle *insert_prealloc_file_extent(
        extent_info.file_offset = file_offset;
        extent_info.extent_buf = (char *)&stack_fi;
        extent_info.is_new_extent = true;
+       extent_info.update_times = true;
        extent_info.qgroup_reserved = qgroup_released;
        extent_info.insertions = 0;
 
index 313d9d6..33461b4 100644 (file)
@@ -45,7 +45,6 @@ void __btrfs_tree_read_lock(struct extent_buffer *eb, enum btrfs_lock_nesting ne
                start_ns = ktime_get_ns();
 
        down_read_nested(&eb->lock, nest);
-       eb->lock_owner = current->pid;
        trace_btrfs_tree_read_lock(eb, start_ns);
 }
 
@@ -62,7 +61,6 @@ void btrfs_tree_read_lock(struct extent_buffer *eb)
 int btrfs_try_tree_read_lock(struct extent_buffer *eb)
 {
        if (down_read_trylock(&eb->lock)) {
-               eb->lock_owner = current->pid;
                trace_btrfs_try_tree_read_lock(eb);
                return 1;
        }
@@ -90,7 +88,6 @@ int btrfs_try_tree_write_lock(struct extent_buffer *eb)
 void btrfs_tree_read_unlock(struct extent_buffer *eb)
 {
        trace_btrfs_tree_read_unlock(eb);
-       eb->lock_owner = 0;
        up_read(&eb->lock);
 }
 
index c39f8b3..a3549d5 100644 (file)
@@ -344,6 +344,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
        int ret;
        const u64 len = olen_aligned;
        u64 last_dest_end = destoff;
+       u64 prev_extent_end = off;
 
        ret = -ENOMEM;
        buf = kvmalloc(fs_info->nodesize, GFP_KERNEL);
@@ -363,7 +364,6 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
        key.offset = off;
 
        while (1) {
-               u64 next_key_min_offset = key.offset + 1;
                struct btrfs_file_extent_item *extent;
                u64 extent_gen;
                int type;
@@ -431,14 +431,21 @@ process_slot:
                 * The first search might have left us at an extent item that
                 * ends before our target range's start, can happen if we have
                 * holes and NO_HOLES feature enabled.
+                *
+                * Subsequent searches may leave us on a file range we have
+                * processed before - this happens due to a race with ordered
+                * extent completion for a file range that is outside our source
+                * range, but that range was part of a file extent item that
+                * also covered a leading part of our source range.
                 */
-               if (key.offset + datal <= off) {
+               if (key.offset + datal <= prev_extent_end) {
                        path->slots[0]++;
                        goto process_slot;
                } else if (key.offset >= off + len) {
                        break;
                }
-               next_key_min_offset = key.offset + datal;
+
+               prev_extent_end = key.offset + datal;
                size = btrfs_item_size(leaf, slot);
                read_extent_buffer(leaf, buf, btrfs_item_ptr_offset(leaf, slot),
                                   size);
@@ -489,6 +496,7 @@ process_slot:
                        clone_info.file_offset = new_key.offset;
                        clone_info.extent_buf = buf;
                        clone_info.is_new_extent = false;
+                       clone_info.update_times = !no_time_update;
                        ret = btrfs_replace_file_extents(BTRFS_I(inode), path,
                                        drop_start, new_key.offset + datal - 1,
                                        &clone_info, &trans);
@@ -550,7 +558,7 @@ process_slot:
                        break;
 
                btrfs_release_path(path);
-               key.offset = next_key_min_offset;
+               key.offset = prev_extent_end;
 
                if (fatal_signal_pending(current)) {
                        ret = -EINTR;
index b1fdc6a..6627dd7 100644 (file)
@@ -763,6 +763,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                                compress_force = false;
                                no_compress++;
                        } else {
+                               btrfs_err(info, "unrecognized compression value %s",
+                                         args[0].from);
                                ret = -EINVAL;
                                goto out;
                        }
@@ -821,8 +823,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                case Opt_thread_pool:
                        ret = match_int(&args[0], &intarg);
                        if (ret) {
+                               btrfs_err(info, "unrecognized thread_pool value %s",
+                                         args[0].from);
                                goto out;
                        } else if (intarg == 0) {
+                               btrfs_err(info, "invalid value 0 for thread_pool");
                                ret = -EINVAL;
                                goto out;
                        }
@@ -883,8 +888,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                        break;
                case Opt_ratio:
                        ret = match_int(&args[0], &intarg);
-                       if (ret)
+                       if (ret) {
+                               btrfs_err(info, "unrecognized metadata_ratio value %s",
+                                         args[0].from);
                                goto out;
+                       }
                        info->metadata_ratio = intarg;
                        btrfs_info(info, "metadata ratio %u",
                                   info->metadata_ratio);
@@ -901,6 +909,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                                btrfs_set_and_info(info, DISCARD_ASYNC,
                                                   "turning on async discard");
                        } else {
+                               btrfs_err(info, "unrecognized discard mode value %s",
+                                         args[0].from);
                                ret = -EINVAL;
                                goto out;
                        }
@@ -933,6 +943,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                                btrfs_set_and_info(info, FREE_SPACE_TREE,
                                                   "enabling free space tree");
                        } else {
+                               btrfs_err(info, "unrecognized space_cache value %s",
+                                         args[0].from);
                                ret = -EINVAL;
                                goto out;
                        }
@@ -1014,8 +1026,12 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                        break;
                case Opt_check_integrity_print_mask:
                        ret = match_int(&args[0], &intarg);
-                       if (ret)
+                       if (ret) {
+                               btrfs_err(info,
+                               "unrecognized check_integrity_print_mask value %s",
+                                       args[0].from);
                                goto out;
+                       }
                        info->check_integrity_print_mask = intarg;
                        btrfs_info(info, "check_integrity_print_mask 0x%x",
                                   info->check_integrity_print_mask);
@@ -1030,13 +1046,15 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                        goto out;
 #endif
                case Opt_fatal_errors:
-                       if (strcmp(args[0].from, "panic") == 0)
+                       if (strcmp(args[0].from, "panic") == 0) {
                                btrfs_set_opt(info->mount_opt,
                                              PANIC_ON_FATAL_ERROR);
-                       else if (strcmp(args[0].from, "bug") == 0)
+                       } else if (strcmp(args[0].from, "bug") == 0) {
                                btrfs_clear_opt(info->mount_opt,
                                              PANIC_ON_FATAL_ERROR);
-                       else {
+                       } else {
+                               btrfs_err(info, "unrecognized fatal_errors value %s",
+                                         args[0].from);
                                ret = -EINVAL;
                                goto out;
                        }
@@ -1044,8 +1062,12 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                case Opt_commit_interval:
                        intarg = 0;
                        ret = match_int(&args[0], &intarg);
-                       if (ret)
+                       if (ret) {
+                               btrfs_err(info, "unrecognized commit_interval value %s",
+                                         args[0].from);
+                               ret = -EINVAL;
                                goto out;
+                       }
                        if (intarg == 0) {
                                btrfs_info(info,
                                           "using default commit interval %us",
@@ -1059,8 +1081,11 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
                        break;
                case Opt_rescue:
                        ret = parse_rescue_options(info, args[0].from);
-                       if (ret < 0)
+                       if (ret < 0) {
+                               btrfs_err(info, "unrecognized rescue value %s",
+                                         args[0].from);
                                goto out;
+                       }
                        break;
 #ifdef CONFIG_BTRFS_DEBUG
                case Opt_fragment_all:
@@ -1985,6 +2010,14 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
        if (ret)
                goto restore;
 
+       /* V1 cache is not supported for subpage mount. */
+       if (fs_info->sectorsize < PAGE_SIZE && btrfs_test_opt(fs_info, SPACE_CACHE)) {
+               btrfs_warn(fs_info,
+       "v1 space cache is not supported for page size %lu with sectorsize %u",
+                          PAGE_SIZE, fs_info->sectorsize);
+               ret = -EINVAL;
+               goto restore;
+       }
        btrfs_remount_begin(fs_info, old_opts, *flags);
        btrfs_resize_thread_pool(fs_info,
                fs_info->thread_pool_size, old_thread_pool_size);
index 11237a9..79e8c8c 100644 (file)
@@ -2139,3 +2139,30 @@ bool btrfs_zoned_should_reclaim(struct btrfs_fs_info *fs_info)
        factor = div64_u64(used * 100, total);
        return factor >= fs_info->bg_reclaim_threshold;
 }
+
+void btrfs_zoned_release_data_reloc_bg(struct btrfs_fs_info *fs_info, u64 logical,
+                                      u64 length)
+{
+       struct btrfs_block_group *block_group;
+
+       if (!btrfs_is_zoned(fs_info))
+               return;
+
+       block_group = btrfs_lookup_block_group(fs_info, logical);
+       /* It should be called on a previous data relocation block group. */
+       ASSERT(block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA));
+
+       spin_lock(&block_group->lock);
+       if (!block_group->zoned_data_reloc_ongoing)
+               goto out;
+
+       /* All relocation extents are written. */
+       if (block_group->start + block_group->alloc_offset == logical + length) {
+               /* Now, release this block group for further allocations. */
+               block_group->zoned_data_reloc_ongoing = 0;
+       }
+
+out:
+       spin_unlock(&block_group->lock);
+       btrfs_put_block_group(block_group);
+}
index bb1a189..6b2eec9 100644 (file)
@@ -77,6 +77,8 @@ void btrfs_schedule_zone_finish_bg(struct btrfs_block_group *bg,
 void btrfs_clear_data_reloc_bg(struct btrfs_block_group *bg);
 void btrfs_free_zone_cache(struct btrfs_fs_info *fs_info);
 bool btrfs_zoned_should_reclaim(struct btrfs_fs_info *fs_info);
+void btrfs_zoned_release_data_reloc_bg(struct btrfs_fs_info *fs_info, u64 logical,
+                                      u64 length);
 #else /* CONFIG_BLK_DEV_ZONED */
 static inline int btrfs_get_dev_zone(struct btrfs_device *device, u64 pos,
                                     struct blk_zone *zone)
@@ -243,6 +245,9 @@ static inline bool btrfs_zoned_should_reclaim(struct btrfs_fs_info *fs_info)
 {
        return false;
 }
+
+static inline void btrfs_zoned_release_data_reloc_bg(struct btrfs_fs_info *fs_info,
+                                                    u64 logical, u64 length) { }
 #endif
 
 static inline bool btrfs_dev_is_sequential(struct btrfs_device *device, u64 pos)
index e5221be..6dee888 100644 (file)
@@ -394,11 +394,10 @@ static int ceph_init_request(struct netfs_io_request *rreq, struct file *file)
        return 0;
 }
 
-static void ceph_readahead_cleanup(struct address_space *mapping, void *priv)
+static void ceph_netfs_free_request(struct netfs_io_request *rreq)
 {
-       struct inode *inode = mapping->host;
-       struct ceph_inode_info *ci = ceph_inode(inode);
-       int got = (uintptr_t)priv;
+       struct ceph_inode_info *ci = ceph_inode(rreq->inode);
+       int got = (uintptr_t)rreq->netfs_priv;
 
        if (got)
                ceph_put_cap_refs(ci, got);
@@ -406,12 +405,12 @@ static void ceph_readahead_cleanup(struct address_space *mapping, void *priv)
 
 const struct netfs_request_ops ceph_netfs_ops = {
        .init_request           = ceph_init_request,
+       .free_request           = ceph_netfs_free_request,
        .begin_cache_operation  = ceph_begin_cache_operation,
        .issue_read             = ceph_netfs_issue_read,
        .expand_readahead       = ceph_netfs_expand_readahead,
        .clamp_length           = ceph_netfs_clamp_length,
        .check_write_begin      = ceph_netfs_check_write_begin,
-       .cleanup                = ceph_readahead_cleanup,
 };
 
 #ifdef CONFIG_CEPH_FSCACHE
@@ -1322,10 +1321,11 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping,
                            struct page **pagep, void **fsdata)
 {
        struct inode *inode = file_inode(file);
+       struct ceph_inode_info *ci = ceph_inode(inode);
        struct folio *folio = NULL;
        int r;
 
-       r = netfs_write_begin(file, inode->i_mapping, pos, len, &folio, NULL);
+       r = netfs_write_begin(&ci->netfs, file, inode->i_mapping, pos, len, &folio, NULL);
        if (r == 0)
                folio_wait_fscache(folio);
        if (r < 0) {
@@ -1798,7 +1798,7 @@ enum {
 static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
                                s64 pool, struct ceph_string *pool_ns)
 {
-       struct ceph_fs_client *fsc = ceph_inode_to_client(&ci->vfs_inode);
+       struct ceph_fs_client *fsc = ceph_inode_to_client(&ci->netfs.inode);
        struct ceph_mds_client *mdsc = fsc->mdsc;
        struct ceph_osd_request *rd_req = NULL, *wr_req = NULL;
        struct rb_node **p, *parent;
@@ -1913,7 +1913,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
                                     0, false, true);
        err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false);
 
-       wr_req->r_mtime = ci->vfs_inode.i_mtime;
+       wr_req->r_mtime = ci->netfs.inode.i_mtime;
        err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false);
 
        if (!err)
index ddea999..177d8e8 100644 (file)
@@ -29,9 +29,9 @@ void ceph_fscache_register_inode_cookie(struct inode *inode)
        if (!(inode->i_state & I_NEW))
                return;
 
-       WARN_ON_ONCE(ci->netfs_ctx.cache);
+       WARN_ON_ONCE(ci->netfs.cache);
 
-       ci->netfs_ctx.cache =
+       ci->netfs.cache =
                fscache_acquire_cookie(fsc->fscache, 0,
                                       &ci->i_vino, sizeof(ci->i_vino),
                                       &ci->i_version, sizeof(ci->i_version),
index 7255b79..dc502da 100644 (file)
@@ -28,7 +28,7 @@ void ceph_fscache_invalidate(struct inode *inode, bool dio_write);
 
 static inline struct fscache_cookie *ceph_fscache_cookie(struct ceph_inode_info *ci)
 {
-       return netfs_i_cookie(&ci->vfs_inode);
+       return netfs_i_cookie(&ci->netfs);
 }
 
 static inline void ceph_fscache_resize(struct inode *inode, loff_t to)
index bf2e940..38c9303 100644 (file)
@@ -492,7 +492,7 @@ static void __cap_set_timeouts(struct ceph_mds_client *mdsc,
        struct ceph_mount_options *opt = mdsc->fsc->mount_options;
        ci->i_hold_caps_max = round_jiffies(jiffies +
                                            opt->caps_wanted_delay_max * HZ);
-       dout("__cap_set_timeouts %p %lu\n", &ci->vfs_inode,
+       dout("__cap_set_timeouts %p %lu\n", &ci->netfs.inode,
             ci->i_hold_caps_max - jiffies);
 }
 
@@ -507,7 +507,7 @@ static void __cap_set_timeouts(struct ceph_mds_client *mdsc,
 static void __cap_delay_requeue(struct ceph_mds_client *mdsc,
                                struct ceph_inode_info *ci)
 {
-       dout("__cap_delay_requeue %p flags 0x%lx at %lu\n", &ci->vfs_inode,
+       dout("__cap_delay_requeue %p flags 0x%lx at %lu\n", &ci->netfs.inode,
             ci->i_ceph_flags, ci->i_hold_caps_max);
        if (!mdsc->stopping) {
                spin_lock(&mdsc->cap_delay_lock);
@@ -531,7 +531,7 @@ no_change:
 static void __cap_delay_requeue_front(struct ceph_mds_client *mdsc,
                                      struct ceph_inode_info *ci)
 {
-       dout("__cap_delay_requeue_front %p\n", &ci->vfs_inode);
+       dout("__cap_delay_requeue_front %p\n", &ci->netfs.inode);
        spin_lock(&mdsc->cap_delay_lock);
        ci->i_ceph_flags |= CEPH_I_FLUSH;
        if (!list_empty(&ci->i_cap_delay_list))
@@ -548,7 +548,7 @@ static void __cap_delay_requeue_front(struct ceph_mds_client *mdsc,
 static void __cap_delay_cancel(struct ceph_mds_client *mdsc,
                               struct ceph_inode_info *ci)
 {
-       dout("__cap_delay_cancel %p\n", &ci->vfs_inode);
+       dout("__cap_delay_cancel %p\n", &ci->netfs.inode);
        if (list_empty(&ci->i_cap_delay_list))
                return;
        spin_lock(&mdsc->cap_delay_lock);
@@ -568,7 +568,7 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap,
         * Each time we receive FILE_CACHE anew, we increment
         * i_rdcache_gen.
         */
-       if (S_ISREG(ci->vfs_inode.i_mode) &&
+       if (S_ISREG(ci->netfs.inode.i_mode) &&
            (issued & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) &&
            (had & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) == 0) {
                ci->i_rdcache_gen++;
@@ -583,14 +583,14 @@ static void __check_cap_issue(struct ceph_inode_info *ci, struct ceph_cap *cap,
        if ((issued & CEPH_CAP_FILE_SHARED) != (had & CEPH_CAP_FILE_SHARED)) {
                if (issued & CEPH_CAP_FILE_SHARED)
                        atomic_inc(&ci->i_shared_gen);
-               if (S_ISDIR(ci->vfs_inode.i_mode)) {
-                       dout(" marking %p NOT complete\n", &ci->vfs_inode);
+               if (S_ISDIR(ci->netfs.inode.i_mode)) {
+                       dout(" marking %p NOT complete\n", &ci->netfs.inode);
                        __ceph_dir_clear_complete(ci);
                }
        }
 
        /* Wipe saved layout if we're losing DIR_CREATE caps */
-       if (S_ISDIR(ci->vfs_inode.i_mode) && (had & CEPH_CAP_DIR_CREATE) &&
+       if (S_ISDIR(ci->netfs.inode.i_mode) && (had & CEPH_CAP_DIR_CREATE) &&
                !(issued & CEPH_CAP_DIR_CREATE)) {
             ceph_put_string(rcu_dereference_raw(ci->i_cached_layout.pool_ns));
             memset(&ci->i_cached_layout, 0, sizeof(ci->i_cached_layout));
@@ -771,7 +771,7 @@ static int __cap_is_valid(struct ceph_cap *cap)
 
        if (cap->cap_gen < gen || time_after_eq(jiffies, ttl)) {
                dout("__cap_is_valid %p cap %p issued %s "
-                    "but STALE (gen %u vs %u)\n", &cap->ci->vfs_inode,
+                    "but STALE (gen %u vs %u)\n", &cap->ci->netfs.inode,
                     cap, ceph_cap_string(cap->issued), cap->cap_gen, gen);
                return 0;
        }
@@ -797,7 +797,7 @@ int __ceph_caps_issued(struct ceph_inode_info *ci, int *implemented)
                if (!__cap_is_valid(cap))
                        continue;
                dout("__ceph_caps_issued %p cap %p issued %s\n",
-                    &ci->vfs_inode, cap, ceph_cap_string(cap->issued));
+                    &ci->netfs.inode, cap, ceph_cap_string(cap->issued));
                have |= cap->issued;
                if (implemented)
                        *implemented |= cap->implemented;
@@ -844,12 +844,12 @@ static void __touch_cap(struct ceph_cap *cap)
 
        spin_lock(&s->s_cap_lock);
        if (!s->s_cap_iterator) {
-               dout("__touch_cap %p cap %p mds%d\n", &cap->ci->vfs_inode, cap,
+               dout("__touch_cap %p cap %p mds%d\n", &cap->ci->netfs.inode, cap,
                     s->s_mds);
                list_move_tail(&cap->session_caps, &s->s_caps);
        } else {
                dout("__touch_cap %p cap %p mds%d NOP, iterating over caps\n",
-                    &cap->ci->vfs_inode, cap, s->s_mds);
+                    &cap->ci->netfs.inode, cap, s->s_mds);
        }
        spin_unlock(&s->s_cap_lock);
 }
@@ -867,7 +867,7 @@ int __ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, int touch)
 
        if ((have & mask) == mask) {
                dout("__ceph_caps_issued_mask ino 0x%llx snap issued %s"
-                    " (mask %s)\n", ceph_ino(&ci->vfs_inode),
+                    " (mask %s)\n", ceph_ino(&ci->netfs.inode),
                     ceph_cap_string(have),
                     ceph_cap_string(mask));
                return 1;
@@ -879,7 +879,7 @@ int __ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, int touch)
                        continue;
                if ((cap->issued & mask) == mask) {
                        dout("__ceph_caps_issued_mask ino 0x%llx cap %p issued %s"
-                            " (mask %s)\n", ceph_ino(&ci->vfs_inode), cap,
+                            " (mask %s)\n", ceph_ino(&ci->netfs.inode), cap,
                             ceph_cap_string(cap->issued),
                             ceph_cap_string(mask));
                        if (touch)
@@ -891,7 +891,7 @@ int __ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, int touch)
                have |= cap->issued;
                if ((have & mask) == mask) {
                        dout("__ceph_caps_issued_mask ino 0x%llx combo issued %s"
-                            " (mask %s)\n", ceph_ino(&ci->vfs_inode),
+                            " (mask %s)\n", ceph_ino(&ci->netfs.inode),
                             ceph_cap_string(cap->issued),
                             ceph_cap_string(mask));
                        if (touch) {
@@ -919,7 +919,7 @@ int __ceph_caps_issued_mask(struct ceph_inode_info *ci, int mask, int touch)
 int __ceph_caps_issued_mask_metric(struct ceph_inode_info *ci, int mask,
                                   int touch)
 {
-       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->vfs_inode.i_sb);
+       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb);
        int r;
 
        r = __ceph_caps_issued_mask(ci, mask, touch);
@@ -950,7 +950,7 @@ int __ceph_caps_revoking_other(struct ceph_inode_info *ci,
 
 int ceph_caps_revoking(struct ceph_inode_info *ci, int mask)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        int ret;
 
        spin_lock(&ci->i_ceph_lock);
@@ -969,8 +969,8 @@ int __ceph_caps_used(struct ceph_inode_info *ci)
        if (ci->i_rd_ref)
                used |= CEPH_CAP_FILE_RD;
        if (ci->i_rdcache_ref ||
-           (S_ISREG(ci->vfs_inode.i_mode) &&
-            ci->vfs_inode.i_data.nrpages))
+           (S_ISREG(ci->netfs.inode.i_mode) &&
+            ci->netfs.inode.i_data.nrpages))
                used |= CEPH_CAP_FILE_CACHE;
        if (ci->i_wr_ref)
                used |= CEPH_CAP_FILE_WR;
@@ -993,11 +993,11 @@ int __ceph_caps_file_wanted(struct ceph_inode_info *ci)
        const int WR_SHIFT = ffs(CEPH_FILE_MODE_WR);
        const int LAZY_SHIFT = ffs(CEPH_FILE_MODE_LAZY);
        struct ceph_mount_options *opt =
-               ceph_inode_to_client(&ci->vfs_inode)->mount_options;
+               ceph_inode_to_client(&ci->netfs.inode)->mount_options;
        unsigned long used_cutoff = jiffies - opt->caps_wanted_delay_max * HZ;
        unsigned long idle_cutoff = jiffies - opt->caps_wanted_delay_min * HZ;
 
-       if (S_ISDIR(ci->vfs_inode.i_mode)) {
+       if (S_ISDIR(ci->netfs.inode.i_mode)) {
                int want = 0;
 
                /* use used_cutoff here, to keep dir's wanted caps longer */
@@ -1050,7 +1050,7 @@ int __ceph_caps_file_wanted(struct ceph_inode_info *ci)
 int __ceph_caps_wanted(struct ceph_inode_info *ci)
 {
        int w = __ceph_caps_file_wanted(ci) | __ceph_caps_used(ci);
-       if (S_ISDIR(ci->vfs_inode.i_mode)) {
+       if (S_ISDIR(ci->netfs.inode.i_mode)) {
                /* we want EXCL if holding caps of dir ops */
                if (w & CEPH_CAP_ANY_DIR_OPS)
                        w |= CEPH_CAP_FILE_EXCL;
@@ -1116,9 +1116,9 @@ void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release)
 
        lockdep_assert_held(&ci->i_ceph_lock);
 
-       dout("__ceph_remove_cap %p from %p\n", cap, &ci->vfs_inode);
+       dout("__ceph_remove_cap %p from %p\n", cap, &ci->netfs.inode);
 
-       mdsc = ceph_inode_to_client(&ci->vfs_inode)->mdsc;
+       mdsc = ceph_inode_to_client(&ci->netfs.inode)->mdsc;
 
        /* remove from inode's cap rbtree, and clear auth cap */
        rb_erase(&cap->ci_node, &ci->i_caps);
@@ -1169,7 +1169,7 @@ void __ceph_remove_cap(struct ceph_cap *cap, bool queue_release)
                 * keep i_snap_realm.
                 */
                if (ci->i_wr_ref == 0 && ci->i_snap_realm)
-                       ceph_change_snap_realm(&ci->vfs_inode, NULL);
+                       ceph_change_snap_realm(&ci->netfs.inode, NULL);
 
                __cap_delay_cancel(mdsc, ci);
        }
@@ -1188,11 +1188,11 @@ void ceph_remove_cap(struct ceph_cap *cap, bool queue_release)
 
        lockdep_assert_held(&ci->i_ceph_lock);
 
-       fsc = ceph_inode_to_client(&ci->vfs_inode);
+       fsc = ceph_inode_to_client(&ci->netfs.inode);
        WARN_ON_ONCE(ci->i_auth_cap == cap &&
                     !list_empty(&ci->i_dirty_item) &&
                     !fsc->blocklisted &&
-                    !ceph_inode_is_shutdown(&ci->vfs_inode));
+                    !ceph_inode_is_shutdown(&ci->netfs.inode));
 
        __ceph_remove_cap(cap, queue_release);
 }
@@ -1343,7 +1343,7 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap,
                       int flushing, u64 flush_tid, u64 oldest_flush_tid)
 {
        struct ceph_inode_info *ci = cap->ci;
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        int held, revoking;
 
        lockdep_assert_held(&ci->i_ceph_lock);
@@ -1440,7 +1440,7 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap,
 static void __send_cap(struct cap_msg_args *arg, struct ceph_inode_info *ci)
 {
        struct ceph_msg *msg;
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
 
        msg = ceph_msg_new(CEPH_MSG_CLIENT_CAPS, CAP_MSG_SIZE, GFP_NOFS, false);
        if (!msg) {
@@ -1528,7 +1528,7 @@ static void __ceph_flush_snaps(struct ceph_inode_info *ci,
                __releases(ci->i_ceph_lock)
                __acquires(ci->i_ceph_lock)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_mds_client *mdsc = session->s_mdsc;
        struct ceph_cap_snap *capsnap;
        u64 oldest_flush_tid = 0;
@@ -1622,7 +1622,7 @@ static void __ceph_flush_snaps(struct ceph_inode_info *ci,
 void ceph_flush_snaps(struct ceph_inode_info *ci,
                      struct ceph_mds_session **psession)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc;
        struct ceph_mds_session *session = NULL;
        int mds;
@@ -1682,8 +1682,8 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask,
                           struct ceph_cap_flush **pcf)
 {
        struct ceph_mds_client *mdsc =
-               ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc;
-       struct inode *inode = &ci->vfs_inode;
+               ceph_sb_to_client(ci->netfs.inode.i_sb)->mdsc;
+       struct inode *inode = &ci->netfs.inode;
        int was = ci->i_dirty_caps;
        int dirty = 0;
 
@@ -1696,7 +1696,7 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask,
                return 0;
        }
 
-       dout("__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->vfs_inode,
+       dout("__mark_dirty_caps %p %s dirty %s -> %s\n", &ci->netfs.inode,
             ceph_cap_string(mask), ceph_cap_string(was),
             ceph_cap_string(was | mask));
        ci->i_dirty_caps |= mask;
@@ -1712,7 +1712,7 @@ int __ceph_mark_dirty_caps(struct ceph_inode_info *ci, int mask,
                                ci->i_snap_realm->cached_context);
                }
                dout(" inode %p now dirty snapc %p auth cap %p\n",
-                    &ci->vfs_inode, ci->i_head_snapc, ci->i_auth_cap);
+                    &ci->netfs.inode, ci->i_head_snapc, ci->i_auth_cap);
                BUG_ON(!list_empty(&ci->i_dirty_item));
                spin_lock(&mdsc->cap_dirty_lock);
                list_add(&ci->i_dirty_item, &session->s_cap_dirty);
@@ -1875,7 +1875,7 @@ static int try_nonblocking_invalidate(struct inode *inode)
 
 bool __ceph_should_report_size(struct ceph_inode_info *ci)
 {
-       loff_t size = i_size_read(&ci->vfs_inode);
+       loff_t size = i_size_read(&ci->netfs.inode);
        /* mds will adjust max size according to the reported size */
        if (ci->i_flushing_caps & CEPH_CAP_FILE_WR)
                return false;
@@ -1900,7 +1900,7 @@ bool __ceph_should_report_size(struct ceph_inode_info *ci)
 void ceph_check_caps(struct ceph_inode_info *ci, int flags,
                     struct ceph_mds_session *session)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
        struct ceph_cap *cap;
        u64 flush_tid, oldest_flush_tid;
@@ -2467,7 +2467,7 @@ static void __kick_flushing_caps(struct ceph_mds_client *mdsc,
        __releases(ci->i_ceph_lock)
        __acquires(ci->i_ceph_lock)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_cap *cap;
        struct ceph_cap_flush *cf;
        int ret;
@@ -2560,7 +2560,7 @@ void ceph_early_kick_flushing_caps(struct ceph_mds_client *mdsc,
                cap = ci->i_auth_cap;
                if (!(cap && cap->session == session)) {
                        pr_err("%p auth cap %p not mds%d ???\n",
-                               &ci->vfs_inode, cap, session->s_mds);
+                               &ci->netfs.inode, cap, session->s_mds);
                        spin_unlock(&ci->i_ceph_lock);
                        continue;
                }
@@ -2610,7 +2610,7 @@ void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc,
                cap = ci->i_auth_cap;
                if (!(cap && cap->session == session)) {
                        pr_err("%p auth cap %p not mds%d ???\n",
-                               &ci->vfs_inode, cap, session->s_mds);
+                               &ci->netfs.inode, cap, session->s_mds);
                        spin_unlock(&ci->i_ceph_lock);
                        continue;
                }
@@ -2630,7 +2630,7 @@ void ceph_kick_flushing_inode_caps(struct ceph_mds_session *session,
 
        lockdep_assert_held(&ci->i_ceph_lock);
 
-       dout("%s %p flushing %s\n", __func__, &ci->vfs_inode,
+       dout("%s %p flushing %s\n", __func__, &ci->netfs.inode,
             ceph_cap_string(ci->i_flushing_caps));
 
        if (!list_empty(&ci->i_cap_flush_list)) {
@@ -2673,10 +2673,10 @@ void ceph_take_cap_refs(struct ceph_inode_info *ci, int got,
        }
        if (got & CEPH_CAP_FILE_BUFFER) {
                if (ci->i_wb_ref == 0)
-                       ihold(&ci->vfs_inode);
+                       ihold(&ci->netfs.inode);
                ci->i_wb_ref++;
                dout("%s %p wb %d -> %d (?)\n", __func__,
-                    &ci->vfs_inode, ci->i_wb_ref-1, ci->i_wb_ref);
+                    &ci->netfs.inode, ci->i_wb_ref-1, ci->i_wb_ref);
        }
 }
 
@@ -3004,7 +3004,7 @@ int ceph_get_caps(struct file *filp, int need, int want, loff_t endoff, int *got
                        return ret;
                }
 
-               if (S_ISREG(ci->vfs_inode.i_mode) &&
+               if (S_ISREG(ci->netfs.inode.i_mode) &&
                    ci->i_inline_version != CEPH_INLINE_NONE &&
                    (_got & (CEPH_CAP_FILE_CACHE|CEPH_CAP_FILE_LAZYIO)) &&
                    i_size_read(inode) > 0) {
@@ -3094,7 +3094,7 @@ enum put_cap_refs_mode {
 static void __ceph_put_cap_refs(struct ceph_inode_info *ci, int had,
                                enum put_cap_refs_mode mode)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        int last = 0, put = 0, flushsnaps = 0, wake = 0;
        bool check_flushsnaps = false;
 
@@ -3202,7 +3202,7 @@ void ceph_put_cap_refs_no_check_caps(struct ceph_inode_info *ci, int had)
 void ceph_put_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,
                                struct ceph_snap_context *snapc)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_cap_snap *capsnap = NULL, *iter;
        int put = 0;
        bool last = false;
@@ -3698,7 +3698,7 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
                                     session->s_mds,
                                     &list_first_entry(&session->s_cap_flushing,
                                                struct ceph_inode_info,
-                                               i_flushing_item)->vfs_inode);
+                                               i_flushing_item)->netfs.inode);
                        }
                }
                mdsc->num_cap_flushing--;
@@ -4345,7 +4345,7 @@ unsigned long ceph_check_delayed_caps(struct ceph_mds_client *mdsc)
                        break;
                list_del_init(&ci->i_cap_delay_list);
 
-               inode = igrab(&ci->vfs_inode);
+               inode = igrab(&ci->netfs.inode);
                if (inode) {
                        spin_unlock(&mdsc->cap_delay_lock);
                        dout("check_delayed_caps on %p\n", inode);
@@ -4373,7 +4373,7 @@ static void flush_dirty_session_caps(struct ceph_mds_session *s)
        while (!list_empty(&s->s_cap_dirty)) {
                ci = list_first_entry(&s->s_cap_dirty, struct ceph_inode_info,
                                      i_dirty_item);
-               inode = &ci->vfs_inode;
+               inode = &ci->netfs.inode;
                ihold(inode);
                dout("flush_dirty_caps %llx.%llx\n", ceph_vinop(inode));
                spin_unlock(&mdsc->cap_dirty_lock);
@@ -4407,7 +4407,7 @@ void __ceph_touch_fmode(struct ceph_inode_info *ci,
 
 void ceph_get_fmode(struct ceph_inode_info *ci, int fmode, int count)
 {
-       struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(ci->vfs_inode.i_sb);
+       struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(ci->netfs.inode.i_sb);
        int bits = (fmode << 1) | 1;
        bool already_opened = false;
        int i;
@@ -4441,7 +4441,7 @@ void ceph_get_fmode(struct ceph_inode_info *ci, int fmode, int count)
  */
 void ceph_put_fmode(struct ceph_inode_info *ci, int fmode, int count)
 {
-       struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(ci->vfs_inode.i_sb);
+       struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(ci->netfs.inode.i_sb);
        int bits = (fmode << 1) | 1;
        bool is_closed = true;
        int i;
@@ -4656,7 +4656,7 @@ int ceph_purge_inode_cap(struct inode *inode, struct ceph_cap *cap, bool *invali
        lockdep_assert_held(&ci->i_ceph_lock);
 
        dout("removing cap %p, ci is %p, inode is %p\n",
-            cap, ci, &ci->vfs_inode);
+            cap, ci, &ci->netfs.inode);
 
        is_auth = (cap == ci->i_auth_cap);
        __ceph_remove_cap(cap, false);
index 8c8226c..da59e83 100644 (file)
@@ -205,7 +205,7 @@ static int ceph_init_file_info(struct inode *inode, struct file *file,
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
        struct ceph_mount_options *opt =
-               ceph_inode_to_client(&ci->vfs_inode)->mount_options;
+               ceph_inode_to_client(&ci->netfs.inode)->mount_options;
        struct ceph_file_info *fi;
        int ret;
 
index b7e9cac..56c53ab 100644 (file)
@@ -176,7 +176,7 @@ static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci,
        rb_insert_color(&frag->node, &ci->i_fragtree);
 
        dout("get_or_create_frag added %llx.%llx frag %x\n",
-            ceph_vinop(&ci->vfs_inode), f);
+            ceph_vinop(&ci->netfs.inode), f);
        return frag;
 }
 
@@ -457,10 +457,10 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
        if (!ci)
                return NULL;
 
-       dout("alloc_inode %p\n", &ci->vfs_inode);
+       dout("alloc_inode %p\n", &ci->netfs.inode);
 
        /* Set parameters for the netfs library */
-       netfs_i_context_init(&ci->vfs_inode, &ceph_netfs_ops);
+       netfs_inode_init(&ci->netfs, &ceph_netfs_ops);
 
        spin_lock_init(&ci->i_ceph_lock);
 
@@ -547,7 +547,7 @@ struct inode *ceph_alloc_inode(struct super_block *sb)
        INIT_WORK(&ci->i_work, ceph_inode_work);
        ci->i_work_mask = 0;
        memset(&ci->i_btime, '\0', sizeof(ci->i_btime));
-       return &ci->vfs_inode;
+       return &ci->netfs.inode;
 }
 
 void ceph_free_inode(struct inode *inode)
@@ -1978,7 +1978,7 @@ static void ceph_inode_work(struct work_struct *work)
 {
        struct ceph_inode_info *ci = container_of(work, struct ceph_inode_info,
                                                 i_work);
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
 
        if (test_and_clear_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask)) {
                dout("writeback %p\n", inode);
index f5d110d..33f517d 100644 (file)
@@ -1564,7 +1564,7 @@ int ceph_iterate_session_caps(struct ceph_mds_session *session,
        p = session->s_caps.next;
        while (p != &session->s_caps) {
                cap = list_entry(p, struct ceph_cap, session_caps);
-               inode = igrab(&cap->ci->vfs_inode);
+               inode = igrab(&cap->ci->netfs.inode);
                if (!inode) {
                        p = p->next;
                        continue;
@@ -1622,7 +1622,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
        int iputs;
 
        dout("removing cap %p, ci is %p, inode is %p\n",
-            cap, ci, &ci->vfs_inode);
+            cap, ci, &ci->netfs.inode);
        spin_lock(&ci->i_ceph_lock);
        iputs = ceph_purge_inode_cap(inode, cap, &invalidate);
        spin_unlock(&ci->i_ceph_lock);
index 322ee5a..864cdaa 100644 (file)
@@ -521,7 +521,7 @@ static bool has_new_snaps(struct ceph_snap_context *o,
 static void ceph_queue_cap_snap(struct ceph_inode_info *ci,
                                struct ceph_cap_snap **pcapsnap)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_snap_context *old_snapc, *new_snapc;
        struct ceph_cap_snap *capsnap = *pcapsnap;
        struct ceph_buffer *old_blob = NULL;
@@ -652,7 +652,7 @@ update_snapc:
 int __ceph_finish_cap_snap(struct ceph_inode_info *ci,
                            struct ceph_cap_snap *capsnap)
 {
-       struct inode *inode = &ci->vfs_inode;
+       struct inode *inode = &ci->netfs.inode;
        struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
 
        BUG_ON(capsnap->writing);
@@ -712,7 +712,7 @@ static void queue_realm_cap_snaps(struct ceph_snap_realm *realm)
 
        spin_lock(&realm->inodes_with_caps_lock);
        list_for_each_entry(ci, &realm->inodes_with_caps, i_snap_realm_item) {
-               struct inode *inode = igrab(&ci->vfs_inode);
+               struct inode *inode = igrab(&ci->netfs.inode);
                if (!inode)
                        continue;
                spin_unlock(&realm->inodes_with_caps_lock);
@@ -904,7 +904,7 @@ static void flush_snaps(struct ceph_mds_client *mdsc)
        while (!list_empty(&mdsc->snap_flush_list)) {
                ci = list_first_entry(&mdsc->snap_flush_list,
                                struct ceph_inode_info, i_snap_flush_item);
-               inode = &ci->vfs_inode;
+               inode = &ci->netfs.inode;
                ihold(inode);
                spin_unlock(&mdsc->snap_flush_lock);
                ceph_flush_snaps(ci, &session);
index b73b4f7..4014080 100644 (file)
@@ -876,7 +876,7 @@ mempool_t *ceph_wb_pagevec_pool;
 static void ceph_inode_init_once(void *foo)
 {
        struct ceph_inode_info *ci = foo;
-       inode_init_once(&ci->vfs_inode);
+       inode_init_once(&ci->netfs.inode);
 }
 
 static int __init init_caches(void)
index dd7dac0..f59dac6 100644 (file)
@@ -316,11 +316,7 @@ struct ceph_inode_xattrs_info {
  * Ceph inode.
  */
 struct ceph_inode_info {
-       struct {
-               /* These must be contiguous */
-               struct inode vfs_inode;
-               struct netfs_i_context netfs_ctx; /* Netfslib context */
-       };
+       struct netfs_inode netfs; /* Netfslib context and vfs inode */
        struct ceph_vino i_vino;   /* ceph ino + snap */
 
        spinlock_t i_ceph_lock;
@@ -436,7 +432,7 @@ struct ceph_inode_info {
 static inline struct ceph_inode_info *
 ceph_inode(const struct inode *inode)
 {
-       return container_of(inode, struct ceph_inode_info, vfs_inode);
+       return container_of(inode, struct ceph_inode_info, netfs.inode);
 }
 
 static inline struct ceph_fs_client *
@@ -1316,7 +1312,7 @@ static inline void __ceph_update_quota(struct ceph_inode_info *ci,
        has_quota = __ceph_has_quota(ci, QUOTA_GET_ANY);
 
        if (had_quota != has_quota)
-               ceph_adjust_quota_realms_count(&ci->vfs_inode, has_quota);
+               ceph_adjust_quota_realms_count(&ci->netfs.inode, has_quota);
 }
 
 extern void ceph_handle_quota(struct ceph_mds_client *mdsc,
index 8c2dc2c..f141f52 100644 (file)
@@ -57,7 +57,7 @@ static bool ceph_vxattrcb_layout_exists(struct ceph_inode_info *ci)
 static ssize_t ceph_vxattrcb_layout(struct ceph_inode_info *ci, char *val,
                                    size_t size)
 {
-       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->vfs_inode.i_sb);
+       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb);
        struct ceph_osd_client *osdc = &fsc->client->osdc;
        struct ceph_string *pool_ns;
        s64 pool = ci->i_layout.pool_id;
@@ -69,7 +69,7 @@ static ssize_t ceph_vxattrcb_layout(struct ceph_inode_info *ci, char *val,
 
        pool_ns = ceph_try_get_string(ci->i_layout.pool_ns);
 
-       dout("ceph_vxattrcb_layout %p\n", &ci->vfs_inode);
+       dout("ceph_vxattrcb_layout %p\n", &ci->netfs.inode);
        down_read(&osdc->lock);
        pool_name = ceph_pg_pool_name_by_id(osdc->osdmap, pool);
        if (pool_name) {
@@ -161,7 +161,7 @@ static ssize_t ceph_vxattrcb_layout_pool(struct ceph_inode_info *ci,
                                         char *val, size_t size)
 {
        ssize_t ret;
-       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->vfs_inode.i_sb);
+       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb);
        struct ceph_osd_client *osdc = &fsc->client->osdc;
        s64 pool = ci->i_layout.pool_id;
        const char *pool_name;
@@ -313,7 +313,7 @@ static ssize_t ceph_vxattrcb_snap_btime(struct ceph_inode_info *ci, char *val,
 static ssize_t ceph_vxattrcb_cluster_fsid(struct ceph_inode_info *ci,
                                          char *val, size_t size)
 {
-       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->vfs_inode.i_sb);
+       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb);
 
        return ceph_fmt_xattr(val, size, "%pU", &fsc->client->fsid);
 }
@@ -321,7 +321,7 @@ static ssize_t ceph_vxattrcb_cluster_fsid(struct ceph_inode_info *ci,
 static ssize_t ceph_vxattrcb_client_id(struct ceph_inode_info *ci,
                                       char *val, size_t size)
 {
-       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->vfs_inode.i_sb);
+       struct ceph_fs_client *fsc = ceph_sb_to_client(ci->netfs.inode.i_sb);
 
        return ceph_fmt_xattr(val, size, "client%lld",
                              ceph_client_gid(fsc->client));
@@ -629,7 +629,7 @@ static int __set_xattr(struct ceph_inode_info *ci,
        }
 
        dout("__set_xattr_val added %llx.%llx xattr %p %.*s=%.*s\n",
-            ceph_vinop(&ci->vfs_inode), xattr, name_len, name, val_len, val);
+            ceph_vinop(&ci->netfs.inode), xattr, name_len, name, val_len, val);
 
        return 0;
 }
@@ -871,7 +871,7 @@ struct ceph_buffer *__ceph_build_xattrs_blob(struct ceph_inode_info *ci)
        struct ceph_buffer *old_blob = NULL;
        void *dest;
 
-       dout("__build_xattrs_blob %p\n", &ci->vfs_inode);
+       dout("__build_xattrs_blob %p\n", &ci->netfs.inode);
        if (ci->i_xattrs.dirty) {
                int need = __get_required_blob_size(ci, 0, 0);
 
index 1dd995e..2cfbac8 100644 (file)
@@ -162,6 +162,8 @@ cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
                seq_printf(m, "\t\tIPv4: %pI4\n", &ipv4->sin_addr);
        else if (iface->sockaddr.ss_family == AF_INET6)
                seq_printf(m, "\t\tIPv6: %pI6\n", &ipv6->sin6_addr);
+       if (!iface->is_active)
+               seq_puts(m, "\t\t[for-cleanup]\n");
 }
 
 static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
@@ -221,6 +223,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
        struct TCP_Server_Info *server;
        struct cifs_ses *ses;
        struct cifs_tcon *tcon;
+       struct cifs_server_iface *iface;
        int c, i, j;
 
        seq_puts(m,
@@ -456,11 +459,10 @@ skip_rdma:
                        if (ses->iface_count)
                                seq_printf(m, "\n\n\tServer interfaces: %zu",
                                           ses->iface_count);
-                       for (j = 0; j < ses->iface_count; j++) {
-                               struct cifs_server_iface *iface;
-
-                               iface = &ses->iface_list[j];
-                               seq_printf(m, "\n\t%d)", j+1);
+                       j = 0;
+                       list_for_each_entry(iface, &ses->iface_list,
+                                                iface_head) {
+                               seq_printf(m, "\n\t%d)", ++j);
                                cifs_dump_iface(m, iface);
                                if (is_ses_using_iface(ses, iface))
                                        seq_puts(m, "\t\t[CONNECTED]\n");
index 12c8728..8f2e003 100644 (file)
@@ -377,7 +377,7 @@ cifs_alloc_inode(struct super_block *sb)
        cifs_inode->flags = 0;
        spin_lock_init(&cifs_inode->writers_lock);
        cifs_inode->writers = 0;
-       cifs_inode->vfs_inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */
+       cifs_inode->netfs.inode.i_blkbits = 14;  /* 2**14 = CIFS_MAX_MSGSIZE */
        cifs_inode->server_eof = 0;
        cifs_inode->uniqueid = 0;
        cifs_inode->createtime = 0;
@@ -389,12 +389,12 @@ cifs_alloc_inode(struct super_block *sb)
         * Can not set i_flags here - they get immediately overwritten to zero
         * by the VFS.
         */
-       /* cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME; */
+       /* cifs_inode->netfs.inode.i_flags = S_NOATIME | S_NOCMTIME; */
        INIT_LIST_HEAD(&cifs_inode->openFileList);
        INIT_LIST_HEAD(&cifs_inode->llist);
        INIT_LIST_HEAD(&cifs_inode->deferred_closes);
        spin_lock_init(&cifs_inode->deferred_lock);
-       return &cifs_inode->vfs_inode;
+       return &cifs_inode->netfs.inode;
 }
 
 static void
@@ -1086,7 +1086,7 @@ struct file_system_type cifs_fs_type = {
 };
 MODULE_ALIAS_FS("cifs");
 
-static struct file_system_type smb3_fs_type = {
+struct file_system_type smb3_fs_type = {
        .owner = THIS_MODULE,
        .name = "smb3",
        .init_fs_context = smb3_init_fs_context,
@@ -1418,7 +1418,7 @@ cifs_init_once(void *inode)
 {
        struct cifsInodeInfo *cifsi = inode;
 
-       inode_init_once(&cifsi->vfs_inode);
+       inode_init_once(&cifsi->netfs.inode);
        init_rwsem(&cifsi->lock_sem);
 }
 
index dd7e070..b17be47 100644 (file)
@@ -38,7 +38,7 @@ static inline unsigned long cifs_get_time(struct dentry *dentry)
        return (unsigned long) dentry->d_fsdata;
 }
 
-extern struct file_system_type cifs_fs_type;
+extern struct file_system_type cifs_fs_type, smb3_fs_type;
 extern const struct address_space_operations cifs_addr_ops;
 extern const struct address_space_operations cifs_addr_ops_smallbuf;
 
index f873379..a643c84 100644 (file)
@@ -80,6 +80,9 @@
 #define SMB_DNS_RESOLVE_INTERVAL_MIN     120
 #define SMB_DNS_RESOLVE_INTERVAL_DEFAULT 600
 
+/* smb multichannel query server interfaces interval in seconds */
+#define SMB_INTERFACE_POLL_INTERVAL    600
+
 /* maximum number of PDUs in one compound */
 #define MAX_COMPOUND 5
 
@@ -933,15 +936,67 @@ static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net)
 #endif
 
 struct cifs_server_iface {
+       struct list_head iface_head;
+       struct kref refcount;
        size_t speed;
        unsigned int rdma_capable : 1;
        unsigned int rss_capable : 1;
+       unsigned int is_active : 1; /* unset if non existent */
        struct sockaddr_storage sockaddr;
 };
 
+/* release iface when last ref is dropped */
+static inline void
+release_iface(struct kref *ref)
+{
+       struct cifs_server_iface *iface = container_of(ref,
+                                                      struct cifs_server_iface,
+                                                      refcount);
+       list_del_init(&iface->iface_head);
+       kfree(iface);
+}
+
+/*
+ * compare two interfaces a and b
+ * return 0 if everything matches.
+ * return 1 if a has higher link speed, or rdma capable, or rss capable
+ * return -1 otherwise.
+ */
+static inline int
+iface_cmp(struct cifs_server_iface *a, struct cifs_server_iface *b)
+{
+       int cmp_ret = 0;
+
+       WARN_ON(!a || !b);
+       if (a->speed == b->speed) {
+               if (a->rdma_capable == b->rdma_capable) {
+                       if (a->rss_capable == b->rss_capable) {
+                               cmp_ret = memcmp(&a->sockaddr, &b->sockaddr,
+                                                sizeof(a->sockaddr));
+                               if (!cmp_ret)
+                                       return 0;
+                               else if (cmp_ret > 0)
+                                       return 1;
+                               else
+                                       return -1;
+                       } else if (a->rss_capable > b->rss_capable)
+                               return 1;
+                       else
+                               return -1;
+               } else if (a->rdma_capable > b->rdma_capable)
+                       return 1;
+               else
+                       return -1;
+       } else if (a->speed > b->speed)
+               return 1;
+       else
+               return -1;
+}
+
 struct cifs_chan {
        unsigned int in_reconnect : 1; /* if session setup in progress for this channel */
        struct TCP_Server_Info *server;
+       struct cifs_server_iface *iface; /* interface in use */
        __u8 signkey[SMB3_SIGN_KEY_SIZE];
 };
 
@@ -993,7 +1048,7 @@ struct cifs_ses {
         */
        spinlock_t iface_lock;
        /* ========= begin: protected by iface_lock ======== */
-       struct cifs_server_iface *iface_list;
+       struct list_head iface_list;
        size_t iface_count;
        unsigned long iface_last_update; /* jiffies */
        /* ========= end: protected by iface_lock ======== */
@@ -1203,6 +1258,7 @@ struct cifs_tcon {
 #ifdef CONFIG_CIFS_DFS_UPCALL
        struct list_head ulist; /* cache update list */
 #endif
+       struct delayed_work     query_interfaces; /* query interfaces workqueue job */
 };
 
 /*
@@ -1479,20 +1535,16 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file);
 #define CIFS_CACHE_RW_FLG      (CIFS_CACHE_READ_FLG | CIFS_CACHE_WRITE_FLG)
 #define CIFS_CACHE_RHW_FLG     (CIFS_CACHE_RW_FLG | CIFS_CACHE_HANDLE_FLG)
 
-#define CIFS_CACHE_READ(cinode) ((cinode->oplock & CIFS_CACHE_READ_FLG) || (CIFS_SB(cinode->vfs_inode.i_sb)->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE))
+#define CIFS_CACHE_READ(cinode) ((cinode->oplock & CIFS_CACHE_READ_FLG) || (CIFS_SB(cinode->netfs.inode.i_sb)->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE))
 #define CIFS_CACHE_HANDLE(cinode) (cinode->oplock & CIFS_CACHE_HANDLE_FLG)
-#define CIFS_CACHE_WRITE(cinode) ((cinode->oplock & CIFS_CACHE_WRITE_FLG) || (CIFS_SB(cinode->vfs_inode.i_sb)->mnt_cifs_flags & CIFS_MOUNT_RW_CACHE))
+#define CIFS_CACHE_WRITE(cinode) ((cinode->oplock & CIFS_CACHE_WRITE_FLG) || (CIFS_SB(cinode->netfs.inode.i_sb)->mnt_cifs_flags & CIFS_MOUNT_RW_CACHE))
 
 /*
  * One of these for each file inode
  */
 
 struct cifsInodeInfo {
-       struct {
-               /* These must be contiguous */
-               struct inode    vfs_inode;      /* the VFS's inode record */
-               struct netfs_i_context netfs_ctx; /* Netfslib context */
-       };
+       struct netfs_inode netfs; /* Netfslib context and vfs inode */
        bool can_cache_brlcks;
        struct list_head llist; /* locks helb by this inode */
        /*
@@ -1531,7 +1583,7 @@ struct cifsInodeInfo {
 static inline struct cifsInodeInfo *
 CIFS_I(struct inode *inode)
 {
-       return container_of(inode, struct cifsInodeInfo, vfs_inode);
+       return container_of(inode, struct cifsInodeInfo, netfs.inode);
 }
 
 static inline struct cifs_sb_info *
index 3b7366e..d59aebe 100644 (file)
@@ -636,6 +636,13 @@ cifs_chan_clear_need_reconnect(struct cifs_ses *ses,
 bool
 cifs_chan_needs_reconnect(struct cifs_ses *ses,
                          struct TCP_Server_Info *server);
+bool
+cifs_chan_is_iface_active(struct cifs_ses *ses,
+                         struct TCP_Server_Info *server);
+int
+cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server);
+int
+SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon);
 
 void extract_unc_hostname(const char *unc, const char **h, size_t *len);
 int copy_path_name(char *dst, const char *src);
index d46702f..fa29c9a 100644 (file)
@@ -97,6 +97,10 @@ static int reconn_set_ipaddr_from_hostname(struct TCP_Server_Info *server)
        if (!server->hostname)
                return -EINVAL;
 
+       /* if server hostname isn't populated, there's nothing to do here */
+       if (server->hostname[0] == '\0')
+               return 0;
+
        len = strlen(server->hostname) + 3;
 
        unc = kmalloc(len, GFP_KERNEL);
@@ -141,6 +145,25 @@ requeue_resolve:
        return rc;
 }
 
+static void smb2_query_server_interfaces(struct work_struct *work)
+{
+       int rc;
+       struct cifs_tcon *tcon = container_of(work,
+                                       struct cifs_tcon,
+                                       query_interfaces.work);
+
+       /*
+        * query server network interfaces, in case they change
+        */
+       rc = SMB3_request_interfaces(0, tcon);
+       if (rc) {
+               cifs_dbg(FYI, "%s: failed to query server interfaces: %d\n",
+                               __func__, rc);
+       }
+
+       queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
+                          (SMB_INTERFACE_POLL_INTERVAL * HZ));
+}
 
 static void cifs_resolve_server(struct work_struct *work)
 {
@@ -213,7 +236,7 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
                                      bool mark_smb_session)
 {
        struct TCP_Server_Info *pserver;
-       struct cifs_ses *ses;
+       struct cifs_ses *ses, *nses;
        struct cifs_tcon *tcon;
 
        /*
@@ -227,7 +250,20 @@ cifs_mark_tcp_ses_conns_for_reconnect(struct TCP_Server_Info *server,
 
 
        spin_lock(&cifs_tcp_ses_lock);
-       list_for_each_entry(ses, &pserver->smb_ses_list, smb_ses_list) {
+       list_for_each_entry_safe(ses, nses, &pserver->smb_ses_list, smb_ses_list) {
+               /* check if iface is still active */
+               if (!cifs_chan_is_iface_active(ses, server)) {
+                       /*
+                        * HACK: drop the lock before calling
+                        * cifs_chan_update_iface to avoid deadlock
+                        */
+                       ses->ses_count++;
+                       spin_unlock(&cifs_tcp_ses_lock);
+                       cifs_chan_update_iface(ses, server);
+                       spin_lock(&cifs_tcp_ses_lock);
+                       ses->ses_count--;
+               }
+
                spin_lock(&ses->chan_lock);
                if (!mark_smb_session && cifs_chan_needs_reconnect(ses, server))
                        goto next_session;
@@ -1890,9 +1926,11 @@ void cifs_put_smb_ses(struct cifs_ses *ses)
                int i;
 
                for (i = 1; i < chan_count; i++) {
-                       spin_unlock(&ses->chan_lock);
+                       if (ses->chans[i].iface) {
+                               kref_put(&ses->chans[i].iface->refcount, release_iface);
+                               ses->chans[i].iface = NULL;
+                       }
                        cifs_put_tcp_session(ses->chans[i].server, 0);
-                       spin_lock(&ses->chan_lock);
                        ses->chans[i].server = NULL;
                }
        }
@@ -2266,6 +2304,9 @@ cifs_put_tcon(struct cifs_tcon *tcon)
        list_del_init(&tcon->tcon_list);
        spin_unlock(&cifs_tcp_ses_lock);
 
+       /* cancel polling of interfaces */
+       cancel_delayed_work_sync(&tcon->query_interfaces);
+
        if (tcon->use_witness) {
                int rc;
 
@@ -2503,6 +2544,12 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb3_fs_context *ctx)
        tcon->local_lease = ctx->local_lease;
        INIT_LIST_HEAD(&tcon->pending_opens);
 
+       /* schedule query interfaces poll */
+       INIT_DELAYED_WORK(&tcon->query_interfaces,
+                         smb2_query_server_interfaces);
+       queue_delayed_work(cifsiod_wq, &tcon->query_interfaces,
+                          (SMB_INTERFACE_POLL_INTERVAL * HZ));
+
        spin_lock(&cifs_tcp_ses_lock);
        list_add(&tcon->tcon_list, &ses->tcon_list);
        spin_unlock(&cifs_tcp_ses_lock);
@@ -3978,10 +4025,16 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
                   struct nls_table *nls_info)
 {
        int rc = -ENOSYS;
+       struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
+       struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
        bool is_binding = false;
 
-
        spin_lock(&cifs_tcp_ses_lock);
+       if (server->dstaddr.ss_family == AF_INET6)
+               scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI6", &addr6->sin6_addr);
+       else
+               scnprintf(ses->ip_addr, sizeof(ses->ip_addr), "%pI4", &addr->sin_addr);
+
        if (ses->ses_status != SES_GOOD &&
            ses->ses_status != SES_NEW &&
            ses->ses_status != SES_NEED_RECON) {
index 1618e05..e64cda7 100644 (file)
@@ -2004,7 +2004,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
                                        bool fsuid_only)
 {
        struct cifsFileInfo *open_file = NULL;
-       struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_inode->vfs_inode.i_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_inode->netfs.inode.i_sb);
 
        /* only filter by fsuid on multiuser mounts */
        if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER))
@@ -2060,7 +2060,7 @@ cifs_get_writable_file(struct cifsInodeInfo *cifs_inode, int flags,
                return rc;
        }
 
-       cifs_sb = CIFS_SB(cifs_inode->vfs_inode.i_sb);
+       cifs_sb = CIFS_SB(cifs_inode->netfs.inode.i_sb);
 
        /* only filter by fsuid on multiuser mounts */
        if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER))
@@ -4669,14 +4669,14 @@ bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
                /* This inode is open for write at least once */
                struct cifs_sb_info *cifs_sb;
 
-               cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
+               cifs_sb = CIFS_SB(cifsInode->netfs.inode.i_sb);
                if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
                        /* since no page cache to corrupt on directio
                        we can change size safely */
                        return true;
                }
 
-               if (i_size_read(&cifsInode->vfs_inode) < end_of_file)
+               if (i_size_read(&cifsInode->netfs.inode) < end_of_file)
                        return true;
 
                return false;
index a638b29..23ef56f 100644 (file)
@@ -101,13 +101,13 @@ void cifs_fscache_get_inode_cookie(struct inode *inode)
        struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
        struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
 
-       cifs_fscache_fill_coherency(&cifsi->vfs_inode, &cd);
+       cifs_fscache_fill_coherency(&cifsi->netfs.inode, &cd);
 
-       cifsi->netfs_ctx.cache =
+       cifsi->netfs.cache =
                fscache_acquire_cookie(tcon->fscache, 0,
                                       &cifsi->uniqueid, sizeof(cifsi->uniqueid),
                                       &cd, sizeof(cd),
-                                      i_size_read(&cifsi->vfs_inode));
+                                      i_size_read(&cifsi->netfs.inode));
 }
 
 void cifs_fscache_unuse_inode_cookie(struct inode *inode, bool update)
@@ -131,7 +131,7 @@ void cifs_fscache_release_inode_cookie(struct inode *inode)
        if (cookie) {
                cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cookie);
                fscache_relinquish_cookie(cookie, false);
-               cifsi->netfs_ctx.cache = NULL;
+               cifsi->netfs.cache = NULL;
        }
 }
 
index 52355c0..aa3b941 100644 (file)
@@ -52,16 +52,16 @@ void cifs_fscache_fill_coherency(struct inode *inode,
        struct cifsInodeInfo *cifsi = CIFS_I(inode);
 
        memset(cd, 0, sizeof(*cd));
-       cd->last_write_time_sec   = cpu_to_le64(cifsi->vfs_inode.i_mtime.tv_sec);
-       cd->last_write_time_nsec  = cpu_to_le32(cifsi->vfs_inode.i_mtime.tv_nsec);
-       cd->last_change_time_sec  = cpu_to_le64(cifsi->vfs_inode.i_ctime.tv_sec);
-       cd->last_change_time_nsec = cpu_to_le32(cifsi->vfs_inode.i_ctime.tv_nsec);
+       cd->last_write_time_sec   = cpu_to_le64(cifsi->netfs.inode.i_mtime.tv_sec);
+       cd->last_write_time_nsec  = cpu_to_le32(cifsi->netfs.inode.i_mtime.tv_nsec);
+       cd->last_change_time_sec  = cpu_to_le64(cifsi->netfs.inode.i_ctime.tv_sec);
+       cd->last_change_time_nsec = cpu_to_le32(cifsi->netfs.inode.i_ctime.tv_nsec);
 }
 
 
 static inline struct fscache_cookie *cifs_inode_cookie(struct inode *inode)
 {
-       return netfs_i_cookie(inode);
+       return netfs_i_cookie(&CIFS_I(inode)->netfs);
 }
 
 static inline void cifs_invalidate_cache(struct inode *inode, unsigned int flags)
index 2f9e7d2..81da81e 100644 (file)
@@ -115,7 +115,7 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr)
                 __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);
+       cifs_fscache_fill_coherency(&cifs_i->netfs.inode, &cd);
        fscache_invalidate(cifs_inode_cookie(inode), &cd, i_size_read(inode), 0);
 }
 
@@ -2499,7 +2499,7 @@ int cifs_fiemap(struct inode *inode, struct fiemap_extent_info *fei, u64 start,
                u64 len)
 {
        struct cifsInodeInfo *cifs_i = CIFS_I(inode);
-       struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_i->vfs_inode.i_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_SB(cifs_i->netfs.inode.i_sb);
        struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
        struct TCP_Server_Info *server = tcon->ses->server;
        struct cifsFileInfo *cfile;
index 35962a1..0e84e6f 100644 (file)
@@ -75,6 +75,7 @@ sesInfoAlloc(void)
                INIT_LIST_HEAD(&ret_buf->tcon_list);
                mutex_init(&ret_buf->session_mutex);
                spin_lock_init(&ret_buf->iface_lock);
+               INIT_LIST_HEAD(&ret_buf->iface_list);
                spin_lock_init(&ret_buf->chan_lock);
        }
        return ret_buf;
@@ -83,6 +84,8 @@ sesInfoAlloc(void)
 void
 sesInfoFree(struct cifs_ses *buf_to_free)
 {
+       struct cifs_server_iface *iface = NULL, *niface = NULL;
+
        if (buf_to_free == NULL) {
                cifs_dbg(FYI, "Null buffer passed to sesInfoFree\n");
                return;
@@ -96,7 +99,11 @@ sesInfoFree(struct cifs_ses *buf_to_free)
        kfree(buf_to_free->user_name);
        kfree(buf_to_free->domainName);
        kfree_sensitive(buf_to_free->auth_key.response);
-       kfree(buf_to_free->iface_list);
+       spin_lock(&buf_to_free->iface_lock);
+       list_for_each_entry_safe(iface, niface, &buf_to_free->iface_list,
+                                iface_head)
+               kref_put(&iface->refcount, release_iface);
+       spin_unlock(&buf_to_free->iface_lock);
        kfree_sensitive(buf_to_free);
 }
 
@@ -537,11 +544,11 @@ void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock)
        if (oplock == OPLOCK_EXCLUSIVE) {
                cinode->oplock = CIFS_CACHE_WRITE_FLG | CIFS_CACHE_READ_FLG;
                cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
-                        &cinode->vfs_inode);
+                        &cinode->netfs.inode);
        } else if (oplock == OPLOCK_READ) {
                cinode->oplock = CIFS_CACHE_READ_FLG;
                cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
-                        &cinode->vfs_inode);
+                        &cinode->netfs.inode);
        } else
                cinode->oplock = 0;
 }
@@ -1211,18 +1218,23 @@ static struct super_block *__cifs_get_super(void (*f)(struct super_block *, void
                .data = data,
                .sb = NULL,
        };
+       struct file_system_type **fs_type = (struct file_system_type *[]) {
+               &cifs_fs_type, &smb3_fs_type, NULL,
+       };
 
-       iterate_supers_type(&cifs_fs_type, f, &sd);
-
-       if (!sd.sb)
-               return ERR_PTR(-EINVAL);
-       /*
-        * Grab an active reference in order to prevent automounts (DFS links)
-        * of expiring and then freeing up our cifs superblock pointer while
-        * we're doing failover.
-        */
-       cifs_sb_active(sd.sb);
-       return sd.sb;
+       for (; *fs_type; fs_type++) {
+               iterate_supers_type(*fs_type, f, &sd);
+               if (sd.sb) {
+                       /*
+                        * Grab an active reference in order to prevent automounts (DFS links)
+                        * of expiring and then freeing up our cifs superblock pointer while
+                        * we're doing failover.
+                        */
+                       cifs_sb_active(sd.sb);
+                       return sd.sb;
+               }
+       }
+       return ERR_PTR(-EINVAL);
 }
 
 static void __cifs_put_super(struct super_block *sb)
index 3b7915a..b85718f 100644 (file)
@@ -58,7 +58,7 @@ bool is_ses_using_iface(struct cifs_ses *ses, struct cifs_server_iface *iface)
 
        spin_lock(&ses->chan_lock);
        for (i = 0; i < ses->chan_count; i++) {
-               if (is_server_using_iface(ses->chans[i].server, iface)) {
+               if (ses->chans[i].iface == iface) {
                        spin_unlock(&ses->chan_lock);
                        return true;
                }
@@ -81,6 +81,9 @@ cifs_ses_get_chan_index(struct cifs_ses *ses,
        }
 
        /* If we didn't find the channel, it is likely a bug */
+       if (server)
+               cifs_dbg(VFS, "unable to get chan index for server: 0x%llx",
+                        server->conn_id);
        WARN_ON(1);
        return 0;
 }
@@ -143,16 +146,24 @@ cifs_chan_needs_reconnect(struct cifs_ses *ses,
        return CIFS_CHAN_NEEDS_RECONNECT(ses, chan_index);
 }
 
+bool
+cifs_chan_is_iface_active(struct cifs_ses *ses,
+                         struct TCP_Server_Info *server)
+{
+       unsigned int chan_index = cifs_ses_get_chan_index(ses, server);
+
+       return ses->chans[chan_index].iface &&
+               ses->chans[chan_index].iface->is_active;
+}
+
 /* returns number of channels added */
 int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
 {
        int old_chan_count, new_chan_count;
        int left;
-       int i = 0;
        int rc = 0;
        int tries = 0;
-       struct cifs_server_iface *ifaces = NULL;
-       size_t iface_count;
+       struct cifs_server_iface *iface = NULL, *niface = NULL;
 
        spin_lock(&ses->chan_lock);
 
@@ -181,33 +192,17 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
        }
        spin_unlock(&ses->chan_lock);
 
-       /*
-        * Make a copy of the iface list at the time and use that
-        * instead so as to not hold the iface spinlock for opening
-        * channels
-        */
-       spin_lock(&ses->iface_lock);
-       iface_count = ses->iface_count;
-       if (iface_count <= 0) {
-               spin_unlock(&ses->iface_lock);
-               cifs_dbg(VFS, "no iface list available to open channels\n");
-               return 0;
-       }
-       ifaces = kmemdup(ses->iface_list, iface_count*sizeof(*ifaces),
-                        GFP_ATOMIC);
-       if (!ifaces) {
-               spin_unlock(&ses->iface_lock);
-               return 0;
-       }
-       spin_unlock(&ses->iface_lock);
-
        /*
         * Keep connecting to same, fastest, iface for all channels as
         * long as its RSS. Try next fastest one if not RSS or channel
         * creation fails.
         */
+       spin_lock(&ses->iface_lock);
+       iface = list_first_entry(&ses->iface_list, struct cifs_server_iface,
+                                iface_head);
+       spin_unlock(&ses->iface_lock);
+
        while (left > 0) {
-               struct cifs_server_iface *iface;
 
                tries++;
                if (tries > 3*ses->chan_max) {
@@ -216,30 +211,127 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
                        break;
                }
 
-               iface = &ifaces[i];
-               if (is_ses_using_iface(ses, iface) && !iface->rss_capable) {
-                       i = (i+1) % iface_count;
-                       continue;
+               spin_lock(&ses->iface_lock);
+               if (!ses->iface_count) {
+                       spin_unlock(&ses->iface_lock);
+                       break;
                }
 
-               rc = cifs_ses_add_channel(cifs_sb, ses, iface);
-               if (rc) {
-                       cifs_dbg(FYI, "failed to open extra channel on iface#%d rc=%d\n",
-                                i, rc);
-                       i = (i+1) % iface_count;
-                       continue;
+               list_for_each_entry_safe_from(iface, niface, &ses->iface_list,
+                                   iface_head) {
+                       /* skip ifaces that are unusable */
+                       if (!iface->is_active ||
+                           (is_ses_using_iface(ses, iface) &&
+                            !iface->rss_capable)) {
+                               continue;
+                       }
+
+                       /* take ref before unlock */
+                       kref_get(&iface->refcount);
+
+                       spin_unlock(&ses->iface_lock);
+                       rc = cifs_ses_add_channel(cifs_sb, ses, iface);
+                       spin_lock(&ses->iface_lock);
+
+                       if (rc) {
+                               cifs_dbg(VFS, "failed to open extra channel on iface:%pIS rc=%d\n",
+                                        &iface->sockaddr,
+                                        rc);
+                               kref_put(&iface->refcount, release_iface);
+                               continue;
+                       }
+
+                       cifs_dbg(FYI, "successfully opened new channel on iface:%pIS\n",
+                                &iface->sockaddr);
+                       break;
                }
+               spin_unlock(&ses->iface_lock);
 
-               cifs_dbg(FYI, "successfully opened new channel on iface#%d\n",
-                        i);
                left--;
                new_chan_count++;
        }
 
-       kfree(ifaces);
        return new_chan_count - old_chan_count;
 }
 
+/*
+ * update the iface for the channel if necessary.
+ * will return 0 when iface is updated, 1 if removed, 2 otherwise
+ * Must be called with chan_lock held.
+ */
+int
+cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
+{
+       unsigned int chan_index;
+       struct cifs_server_iface *iface = NULL;
+       struct cifs_server_iface *old_iface = NULL;
+       int rc = 0;
+
+       spin_lock(&ses->chan_lock);
+       chan_index = cifs_ses_get_chan_index(ses, server);
+       if (!chan_index) {
+               spin_unlock(&ses->chan_lock);
+               return 0;
+       }
+
+       if (ses->chans[chan_index].iface) {
+               old_iface = ses->chans[chan_index].iface;
+               if (old_iface->is_active) {
+                       spin_unlock(&ses->chan_lock);
+                       return 1;
+               }
+       }
+       spin_unlock(&ses->chan_lock);
+
+       spin_lock(&ses->iface_lock);
+       /* then look for a new one */
+       list_for_each_entry(iface, &ses->iface_list, iface_head) {
+               if (!iface->is_active ||
+                   (is_ses_using_iface(ses, iface) &&
+                    !iface->rss_capable)) {
+                       continue;
+               }
+               kref_get(&iface->refcount);
+       }
+
+       if (!list_entry_is_head(iface, &ses->iface_list, iface_head)) {
+               rc = 1;
+               iface = NULL;
+               cifs_dbg(FYI, "unable to find a suitable iface\n");
+       }
+
+       /* now drop the ref to the current iface */
+       if (old_iface && iface) {
+               kref_put(&old_iface->refcount, release_iface);
+               cifs_dbg(FYI, "replacing iface: %pIS with %pIS\n",
+                        &old_iface->sockaddr,
+                        &iface->sockaddr);
+       } else if (old_iface) {
+               kref_put(&old_iface->refcount, release_iface);
+               cifs_dbg(FYI, "releasing ref to iface: %pIS\n",
+                        &old_iface->sockaddr);
+       } else {
+               WARN_ON(!iface);
+               cifs_dbg(FYI, "adding new iface: %pIS\n", &iface->sockaddr);
+       }
+       spin_unlock(&ses->iface_lock);
+
+       spin_lock(&ses->chan_lock);
+       chan_index = cifs_ses_get_chan_index(ses, server);
+       ses->chans[chan_index].iface = iface;
+
+       /* No iface is found. if secondary chan, drop connection */
+       if (!iface && CIFS_SERVER_IS_CHAN(server))
+               ses->chans[chan_index].server = NULL;
+
+       spin_unlock(&ses->chan_lock);
+
+       if (!iface && CIFS_SERVER_IS_CHAN(server))
+               cifs_put_tcp_session(server, false);
+
+       return rc;
+}
+
 /*
  * If server is a channel of ses, return the corresponding enclosing
  * cifs_chan otherwise return NULL.
@@ -301,7 +393,10 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
        /* Auth */
        ctx.domainauto = ses->domainAuto;
        ctx.domainname = ses->domainName;
-       ctx.server_hostname = ses->server->hostname;
+
+       /* no hostname for extra channels */
+       ctx.server_hostname = "";
+
        ctx.username = ses->user_name;
        ctx.password = ses->password;
        ctx.sectype = ses->sectype;
@@ -349,6 +444,7 @@ cifs_ses_add_channel(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses,
                spin_unlock(&ses->chan_lock);
                goto out;
        }
+       chan->iface = iface;
        ses->chan_count++;
        atomic_set(&ses->chan_seq, 0);
 
index 98a76fa..8802995 100644 (file)
@@ -512,73 +512,41 @@ smb3_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx)
 static int
 parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
                        size_t buf_len,
-                       struct cifs_server_iface **iface_list,
-                       size_t *iface_count)
+                       struct cifs_ses *ses)
 {
        struct network_interface_info_ioctl_rsp *p;
        struct sockaddr_in *addr4;
        struct sockaddr_in6 *addr6;
        struct iface_info_ipv4 *p4;
        struct iface_info_ipv6 *p6;
-       struct cifs_server_iface *info;
+       struct cifs_server_iface *info = NULL, *iface = NULL, *niface = NULL;
+       struct cifs_server_iface tmp_iface;
        ssize_t bytes_left;
        size_t next = 0;
        int nb_iface = 0;
-       int rc = 0;
-
-       *iface_list = NULL;
-       *iface_count = 0;
-
-       /*
-        * Fist pass: count and sanity check
-        */
+       int rc = 0, ret = 0;
 
        bytes_left = buf_len;
        p = buf;
-       while (bytes_left >= sizeof(*p)) {
-               nb_iface++;
-               next = le32_to_cpu(p->Next);
-               if (!next) {
-                       bytes_left -= sizeof(*p);
-                       break;
-               }
-               p = (struct network_interface_info_ioctl_rsp *)((u8 *)p+next);
-               bytes_left -= next;
-       }
-
-       if (!nb_iface) {
-               cifs_dbg(VFS, "%s: malformed interface info\n", __func__);
-               rc = -EINVAL;
-               goto out;
-       }
-
-       /* Azure rounds the buffer size up 8, to a 16 byte boundary */
-       if ((bytes_left > 8) || p->Next)
-               cifs_dbg(VFS, "%s: incomplete interface info\n", __func__);
-
 
+       spin_lock(&ses->iface_lock);
        /*
-        * Second pass: extract info to internal structure
+        * Go through iface_list and do kref_put to remove
+        * any unused ifaces. ifaces in use will be removed
+        * when the last user calls a kref_put on it
         */
-
-       *iface_list = kcalloc(nb_iface, sizeof(**iface_list), GFP_KERNEL);
-       if (!*iface_list) {
-               rc = -ENOMEM;
-               goto out;
+       list_for_each_entry_safe(iface, niface, &ses->iface_list,
+                                iface_head) {
+               iface->is_active = 0;
+               kref_put(&iface->refcount, release_iface);
        }
+       spin_unlock(&ses->iface_lock);
 
-       info = *iface_list;
-       bytes_left = buf_len;
-       p = buf;
        while (bytes_left >= sizeof(*p)) {
-               info->speed = le64_to_cpu(p->LinkSpeed);
-               info->rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE) ? 1 : 0;
-               info->rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE) ? 1 : 0;
-
-               cifs_dbg(FYI, "%s: adding iface %zu\n", __func__, *iface_count);
-               cifs_dbg(FYI, "%s: speed %zu bps\n", __func__, info->speed);
-               cifs_dbg(FYI, "%s: capabilities 0x%08x\n", __func__,
-                        le32_to_cpu(p->Capability));
+               memset(&tmp_iface, 0, sizeof(tmp_iface));
+               tmp_iface.speed = le64_to_cpu(p->LinkSpeed);
+               tmp_iface.rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE) ? 1 : 0;
+               tmp_iface.rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE) ? 1 : 0;
 
                switch (p->Family) {
                /*
@@ -587,7 +555,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
                 * conversion explicit in case either one changes.
                 */
                case INTERNETWORK:
-                       addr4 = (struct sockaddr_in *)&info->sockaddr;
+                       addr4 = (struct sockaddr_in *)&tmp_iface.sockaddr;
                        p4 = (struct iface_info_ipv4 *)p->Buffer;
                        addr4->sin_family = AF_INET;
                        memcpy(&addr4->sin_addr, &p4->IPv4Address, 4);
@@ -599,7 +567,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
                                 &addr4->sin_addr);
                        break;
                case INTERNETWORKV6:
-                       addr6 = (struct sockaddr_in6 *)&info->sockaddr;
+                       addr6 = (struct sockaddr_in6 *)&tmp_iface.sockaddr;
                        p6 = (struct iface_info_ipv6 *)p->Buffer;
                        addr6->sin6_family = AF_INET6;
                        memcpy(&addr6->sin6_addr, &p6->IPv6Address, 16);
@@ -619,46 +587,96 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
                        goto next_iface;
                }
 
-               (*iface_count)++;
-               info++;
+               /*
+                * The iface_list is assumed to be sorted by speed.
+                * Check if the new interface exists in that list.
+                * NEVER change iface. it could be in use.
+                * Add a new one instead
+                */
+               spin_lock(&ses->iface_lock);
+               iface = niface = NULL;
+               list_for_each_entry_safe(iface, niface, &ses->iface_list,
+                                        iface_head) {
+                       ret = iface_cmp(iface, &tmp_iface);
+                       if (!ret) {
+                               /* just get a ref so that it doesn't get picked/freed */
+                               iface->is_active = 1;
+                               kref_get(&iface->refcount);
+                               spin_unlock(&ses->iface_lock);
+                               goto next_iface;
+                       } else if (ret < 0) {
+                               /* all remaining ifaces are slower */
+                               kref_get(&iface->refcount);
+                               break;
+                       }
+               }
+               spin_unlock(&ses->iface_lock);
+
+               /* no match. insert the entry in the list */
+               info = kmalloc(sizeof(struct cifs_server_iface),
+                              GFP_KERNEL);
+               if (!info) {
+                       rc = -ENOMEM;
+                       goto out;
+               }
+               memcpy(info, &tmp_iface, sizeof(tmp_iface));
+
+               /* add this new entry to the list */
+               kref_init(&info->refcount);
+               info->is_active = 1;
+
+               cifs_dbg(FYI, "%s: adding iface %zu\n", __func__, ses->iface_count);
+               cifs_dbg(FYI, "%s: speed %zu bps\n", __func__, info->speed);
+               cifs_dbg(FYI, "%s: capabilities 0x%08x\n", __func__,
+                        le32_to_cpu(p->Capability));
+
+               spin_lock(&ses->iface_lock);
+               if (!list_entry_is_head(iface, &ses->iface_list, iface_head)) {
+                       list_add_tail(&info->iface_head, &iface->iface_head);
+                       kref_put(&iface->refcount, release_iface);
+               } else
+                       list_add_tail(&info->iface_head, &ses->iface_list);
+               spin_unlock(&ses->iface_lock);
+
+               ses->iface_count++;
+               ses->iface_last_update = jiffies;
 next_iface:
+               nb_iface++;
                next = le32_to_cpu(p->Next);
-               if (!next)
+               if (!next) {
+                       bytes_left -= sizeof(*p);
                        break;
+               }
                p = (struct network_interface_info_ioctl_rsp *)((u8 *)p+next);
                bytes_left -= next;
        }
 
-       if (!*iface_count) {
+       if (!nb_iface) {
+               cifs_dbg(VFS, "%s: malformed interface info\n", __func__);
                rc = -EINVAL;
                goto out;
        }
 
-out:
-       if (rc) {
-               kfree(*iface_list);
-               *iface_count = 0;
-               *iface_list = NULL;
-       }
-       return rc;
-}
+       /* Azure rounds the buffer size up 8, to a 16 byte boundary */
+       if ((bytes_left > 8) || p->Next)
+               cifs_dbg(VFS, "%s: incomplete interface info\n", __func__);
 
-static int compare_iface(const void *ia, const void *ib)
-{
-       const struct cifs_server_iface *a = (struct cifs_server_iface *)ia;
-       const struct cifs_server_iface *b = (struct cifs_server_iface *)ib;
 
-       return a->speed == b->speed ? 0 : (a->speed > b->speed ? -1 : 1);
+       if (!ses->iface_count) {
+               rc = -EINVAL;
+               goto out;
+       }
+
+out:
+       return rc;
 }
 
-static int
+int
 SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
 {
        int rc;
        unsigned int ret_data_len = 0;
        struct network_interface_info_ioctl_rsp *out_buf = NULL;
-       struct cifs_server_iface *iface_list;
-       size_t iface_count;
        struct cifs_ses *ses = tcon->ses;
 
        rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
@@ -674,21 +692,10 @@ SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
                goto out;
        }
 
-       rc = parse_server_interfaces(out_buf, ret_data_len,
-                                    &iface_list, &iface_count);
+       rc = parse_server_interfaces(out_buf, ret_data_len, ses);
        if (rc)
                goto out;
 
-       /* sort interfaces from fastest to slowest */
-       sort(iface_list, iface_count, sizeof(*iface_list), compare_iface, NULL);
-
-       spin_lock(&ses->iface_lock);
-       kfree(ses->iface_list);
-       ses->iface_list = iface_list;
-       ses->iface_count = iface_count;
-       ses->iface_last_update = jiffies;
-       spin_unlock(&ses->iface_lock);
-
 out:
        kfree(out_buf);
        return rc;
@@ -4260,15 +4267,15 @@ smb2_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock,
        if (oplock == SMB2_OPLOCK_LEVEL_BATCH) {
                cinode->oplock = CIFS_CACHE_RHW_FLG;
                cifs_dbg(FYI, "Batch Oplock granted on inode %p\n",
-                        &cinode->vfs_inode);
+                        &cinode->netfs.inode);
        } else if (oplock == SMB2_OPLOCK_LEVEL_EXCLUSIVE) {
                cinode->oplock = CIFS_CACHE_RW_FLG;
                cifs_dbg(FYI, "Exclusive Oplock granted on inode %p\n",
-                        &cinode->vfs_inode);
+                        &cinode->netfs.inode);
        } else if (oplock == SMB2_OPLOCK_LEVEL_II) {
                cinode->oplock = CIFS_CACHE_READ_FLG;
                cifs_dbg(FYI, "Level II Oplock granted on inode %p\n",
-                        &cinode->vfs_inode);
+                        &cinode->netfs.inode);
        } else
                cinode->oplock = 0;
 }
@@ -4307,7 +4314,7 @@ smb21_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock,
 
        cinode->oplock = new_oplock;
        cifs_dbg(FYI, "%s Lease granted on inode %p\n", message,
-                &cinode->vfs_inode);
+                &cinode->netfs.inode);
 }
 
 static void
index 0e8c852..12b4ddd 100644 (file)
@@ -288,6 +288,9 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon,
                        mutex_unlock(&ses->session_mutex);
                        rc = -EHOSTDOWN;
                        goto failed;
+               } else if (rc) {
+                       mutex_unlock(&ses->session_mutex);
+                       goto out;
                }
        } else {
                mutex_unlock(&ses->session_mutex);
@@ -540,6 +543,7 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
                      struct TCP_Server_Info *server, unsigned int *total_len)
 {
        char *pneg_ctxt;
+       char *hostname = NULL;
        unsigned int ctxt_len, neg_context_count;
 
        if (*total_len > 200) {
@@ -567,16 +571,24 @@ assemble_neg_contexts(struct smb2_negotiate_req *req,
        *total_len += ctxt_len;
        pneg_ctxt += ctxt_len;
 
-       ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
-                                       server->hostname);
-       *total_len += ctxt_len;
-       pneg_ctxt += ctxt_len;
-
        build_posix_ctxt((struct smb2_posix_neg_context *)pneg_ctxt);
        *total_len += sizeof(struct smb2_posix_neg_context);
        pneg_ctxt += sizeof(struct smb2_posix_neg_context);
 
-       neg_context_count = 4;
+       /*
+        * secondary channels don't have the hostname field populated
+        * use the hostname field in the primary channel instead
+        */
+       hostname = CIFS_SERVER_IS_CHAN(server) ?
+               server->primary_server->hostname : server->hostname;
+       if (hostname && (hostname[0] != 0)) {
+               ctxt_len = build_netname_ctxt((struct smb2_netname_neg_context *)pneg_ctxt,
+                                             hostname);
+               *total_len += ctxt_len;
+               pneg_ctxt += ctxt_len;
+               neg_context_count = 4;
+       } else /* second channels do not have a hostname */
+               neg_context_count = 3;
 
        if (server->compress_algorithm) {
                build_compression_ctxt((struct smb2_compression_capabilities_context *)
@@ -5151,6 +5163,8 @@ SMB2_set_eof(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
        data = &info;
        size = sizeof(struct smb2_file_eof_info);
 
+       trace_smb3_set_eof(xid, persistent_fid, tcon->tid, tcon->ses->Suid, le64_to_cpu(*eof));
+
        return send_set_info(xid, tcon, persistent_fid, volatile_fid,
                        pid, FILE_END_OF_FILE_INFORMATION, SMB2_O_INFO_FILE,
                        0, 1, &data, &size);
index 2be5e0c..6b88dc2 100644 (file)
@@ -121,6 +121,44 @@ DEFINE_SMB3_RW_DONE_EVENT(query_dir_done);
 DEFINE_SMB3_RW_DONE_EVENT(zero_done);
 DEFINE_SMB3_RW_DONE_EVENT(falloc_done);
 
+/* For logging successful set EOF (truncate) */
+DECLARE_EVENT_CLASS(smb3_eof_class,
+       TP_PROTO(unsigned int xid,
+               __u64   fid,
+               __u32   tid,
+               __u64   sesid,
+               __u64   offset),
+       TP_ARGS(xid, fid, tid, sesid, offset),
+       TP_STRUCT__entry(
+               __field(unsigned int, xid)
+               __field(__u64, fid)
+               __field(__u32, tid)
+               __field(__u64, sesid)
+               __field(__u64, offset)
+       ),
+       TP_fast_assign(
+               __entry->xid = xid;
+               __entry->fid = fid;
+               __entry->tid = tid;
+               __entry->sesid = sesid;
+               __entry->offset = offset;
+       ),
+       TP_printk("xid=%u sid=0x%llx tid=0x%x fid=0x%llx offset=0x%llx",
+               __entry->xid, __entry->sesid, __entry->tid, __entry->fid,
+               __entry->offset)
+)
+
+#define DEFINE_SMB3_EOF_EVENT(name)         \
+DEFINE_EVENT(smb3_eof_class, smb3_##name,   \
+       TP_PROTO(unsigned int xid,              \
+               __u64   fid,                    \
+               __u32   tid,                    \
+               __u64   sesid,                  \
+               __u64   offset),                \
+       TP_ARGS(xid, fid, tid, sesid, offset))
+
+DEFINE_SMB3_EOF_EVENT(set_eof);
+
 /*
  * For handle based calls other than read and write, and get/set info
  */
index 76acc37..c6eaf7e 100644 (file)
@@ -1198,7 +1198,9 @@ static int __exfat_rename(struct inode *old_parent_inode,
                return -ENOENT;
        }
 
-       exfat_chain_dup(&olddir, &ei->dir);
+       exfat_chain_set(&olddir, EXFAT_I(old_parent_inode)->start_clu,
+               EXFAT_B_TO_CLU_ROUND_UP(i_size_read(old_parent_inode), sbi),
+               EXFAT_I(old_parent_inode)->flags);
        dentry = ei->entry;
 
        ep = exfat_get_dentry(sb, &olddir, dentry, &old_bh);
index 2c2f179..43de293 100644 (file)
@@ -672,17 +672,14 @@ int ext2_empty_dir (struct inode * inode)
        void *page_addr = NULL;
        struct page *page = NULL;
        unsigned long i, npages = dir_pages(inode);
-       int dir_has_error = 0;
 
        for (i = 0; i < npages; i++) {
                char *kaddr;
                ext2_dirent * de;
-               page = ext2_get_page(inode, i, dir_has_error, &page_addr);
+               page = ext2_get_page(inode, i, 0, &page_addr);
 
-               if (IS_ERR(page)) {
-                       dir_has_error = 1;
-                       continue;
-               }
+               if (IS_ERR(page))
+                       goto not_empty;
 
                kaddr = page_addr;
                de = (ext2_dirent *)kaddr;
index 360ce36..e6b9322 100644 (file)
@@ -1549,7 +1549,7 @@ static int __ext2_write_inode(struct inode *inode, int do_sync)
        if (IS_ERR(raw_inode))
                return -EIO;
 
-       /* For fields not not tracking in the in-memory inode,
+       /* For fields not tracking in the in-memory inode,
         * initialise them to zero for new inodes. */
        if (ei->i_state & EXT2_STATE_NEW)
                memset(raw_inode, 0, EXT2_SB(sb)->s_inode_size);
index 3dce7d0..84c0eb5 100644 (file)
@@ -829,7 +829,7 @@ int ext4_get_block_unwritten(struct inode *inode, sector_t iblock,
        ext4_debug("ext4_get_block_unwritten: inode %lu, create flag %d\n",
                   inode->i_ino, create);
        return _ext4_get_block(inode, iblock, bh_result,
-                              EXT4_GET_BLOCKS_IO_CREATE_EXT);
+                              EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT);
 }
 
 /* Maximum number of blocks we map for direct IO at once. */
index 9f12f29..9e06334 100644 (file)
@@ -4104,6 +4104,15 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
        size = size >> bsbits;
        start = start_off >> bsbits;
 
+       /*
+        * For tiny groups (smaller than 8MB) the chosen allocation
+        * alignment may be larger than group size. Make sure the
+        * alignment does not move allocation to a different group which
+        * makes mballoc fail assertions later.
+        */
+       start = max(start, rounddown(ac->ac_o_ex.fe_logical,
+                       (ext4_lblk_t)EXT4_BLOCKS_PER_GROUP(ac->ac_sb)));
+
        /* don't cover already allocated blocks in selected range */
        if (ar->pleft && start <= ar->lleft) {
                size -= ar->lleft + 1 - start;
@@ -4176,7 +4185,22 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
        }
        rcu_read_unlock();
 
-       if (start + size <= ac->ac_o_ex.fe_logical &&
+       /*
+        * In this function "start" and "size" are normalized for better
+        * alignment and length such that we could preallocate more blocks.
+        * This normalization is done such that original request of
+        * ac->ac_o_ex.fe_logical & fe_len should always lie within "start" and
+        * "size" boundaries.
+        * (Note fe_len can be relaxed since FS block allocation API does not
+        * provide gurantee on number of contiguous blocks allocation since that
+        * depends upon free space left, etc).
+        * In case of inode pa, later we use the allocated blocks
+        * [pa_start + fe_logical - pa_lstart, fe_len/size] from the preallocated
+        * range of goal/best blocks [start, size] to put it at the
+        * ac_o_ex.fe_logical extent of this inode.
+        * (See ext4_mb_use_inode_pa() for more details)
+        */
+       if (start + size <= ac->ac_o_ex.fe_logical ||
                        start > ac->ac_o_ex.fe_logical) {
                ext4_msg(ac->ac_sb, KERN_ERR,
                         "start %lu, size %lu, fe_logical %lu",
index 7a5353a..42f5905 100644 (file)
@@ -438,7 +438,7 @@ int ext4_ext_migrate(struct inode *inode)
 
        /*
         * Worst case we can touch the allocation bitmaps and a block
-        * group descriptor block.  We do need need to worry about
+        * group descriptor block.  We do need to worry about
         * credits for modifying the quota inode.
         */
        handle = ext4_journal_start(inode, EXT4_HT_MIGRATE,
index 47d0ca4..db4ba99 100644 (file)
@@ -1929,7 +1929,8 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
                        struct dx_hash_info *hinfo)
 {
        unsigned blocksize = dir->i_sb->s_blocksize;
-       unsigned count, continued;
+       unsigned continued;
+       int count;
        struct buffer_head *bh2;
        ext4_lblk_t newblock;
        u32 hash2;
index 14695e2..97fa7b4 100644 (file)
@@ -465,7 +465,7 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
        /*
         * In the first loop we prepare and mark buffers to submit. We have to
         * mark all buffers in the page before submitting so that
-        * end_page_writeback() cannot be called from ext4_bio_end_io() when IO
+        * end_page_writeback() cannot be called from ext4_end_bio() when IO
         * on the first buffer finishes and we are still working on submitting
         * the second buffer.
         */
index 90a941d..8b70a47 100644 (file)
@@ -53,6 +53,16 @@ int ext4_resize_begin(struct super_block *sb)
        if (!capable(CAP_SYS_RESOURCE))
                return -EPERM;
 
+       /*
+        * If the reserved GDT blocks is non-zero, the resize_inode feature
+        * should always be set.
+        */
+       if (EXT4_SB(sb)->s_es->s_reserved_gdt_blocks &&
+           !ext4_has_feature_resize_inode(sb)) {
+               ext4_error(sb, "resize_inode disabled but reserved GDT blocks non-zero");
+               return -EFSCORRUPTED;
+       }
+
        /*
         * If we are not using the primary superblock/GDT copy don't resize,
          * because the user tools have no way of handling this.  Probably a
index 450c918..845f2f8 100644 (file)
@@ -87,7 +87,7 @@ static struct inode *ext4_get_journal_inode(struct super_block *sb,
 static int ext4_validate_options(struct fs_context *fc);
 static int ext4_check_opt_consistency(struct fs_context *fc,
                                      struct super_block *sb);
-static int ext4_apply_options(struct fs_context *fc, struct super_block *sb);
+static void ext4_apply_options(struct fs_context *fc, struct super_block *sb);
 static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param);
 static int ext4_get_tree(struct fs_context *fc);
 static int ext4_reconfigure(struct fs_context *fc);
@@ -1870,31 +1870,12 @@ ext4_sb_read_encoding(const struct ext4_super_block *es)
 }
 #endif
 
-static int ext4_set_test_dummy_encryption(struct super_block *sb, char *arg)
-{
-#ifdef CONFIG_FS_ENCRYPTION
-       struct ext4_sb_info *sbi = EXT4_SB(sb);
-       int err;
-
-       err = fscrypt_set_test_dummy_encryption(sb, arg,
-                                               &sbi->s_dummy_enc_policy);
-       if (err) {
-               ext4_msg(sb, KERN_WARNING,
-                        "Error while setting test dummy encryption [%d]", err);
-               return err;
-       }
-       ext4_msg(sb, KERN_WARNING, "Test dummy encryption mode enabled");
-#endif
-       return 0;
-}
-
 #define EXT4_SPEC_JQUOTA                       (1 <<  0)
 #define EXT4_SPEC_JQFMT                                (1 <<  1)
 #define EXT4_SPEC_DATAJ                                (1 <<  2)
 #define EXT4_SPEC_SB_BLOCK                     (1 <<  3)
 #define EXT4_SPEC_JOURNAL_DEV                  (1 <<  4)
 #define EXT4_SPEC_JOURNAL_IOPRIO               (1 <<  5)
-#define EXT4_SPEC_DUMMY_ENCRYPTION             (1 <<  6)
 #define EXT4_SPEC_s_want_extra_isize           (1 <<  7)
 #define EXT4_SPEC_s_max_batch_time             (1 <<  8)
 #define EXT4_SPEC_s_min_batch_time             (1 <<  9)
@@ -1911,7 +1892,7 @@ static int ext4_set_test_dummy_encryption(struct super_block *sb, char *arg)
 
 struct ext4_fs_context {
        char            *s_qf_names[EXT4_MAXQUOTAS];
-       char            *test_dummy_enc_arg;
+       struct fscrypt_dummy_policy dummy_enc_policy;
        int             s_jquota_fmt;   /* Format of quota to use */
 #ifdef CONFIG_EXT4_DEBUG
        int s_fc_debug_max_replay;
@@ -1953,7 +1934,7 @@ static void ext4_fc_free(struct fs_context *fc)
        for (i = 0; i < EXT4_MAXQUOTAS; i++)
                kfree(ctx->s_qf_names[i]);
 
-       kfree(ctx->test_dummy_enc_arg);
+       fscrypt_free_dummy_policy(&ctx->dummy_enc_policy);
        kfree(ctx);
 }
 
@@ -2029,6 +2010,29 @@ static int unnote_qf_name(struct fs_context *fc, int qtype)
 }
 #endif
 
+static int ext4_parse_test_dummy_encryption(const struct fs_parameter *param,
+                                           struct ext4_fs_context *ctx)
+{
+       int err;
+
+       if (!IS_ENABLED(CONFIG_FS_ENCRYPTION)) {
+               ext4_msg(NULL, KERN_WARNING,
+                        "test_dummy_encryption option not supported");
+               return -EINVAL;
+       }
+       err = fscrypt_parse_test_dummy_encryption(param,
+                                                 &ctx->dummy_enc_policy);
+       if (err == -EINVAL) {
+               ext4_msg(NULL, KERN_WARNING,
+                        "Value of option \"%s\" is unrecognized", param->key);
+       } else if (err == -EEXIST) {
+               ext4_msg(NULL, KERN_WARNING,
+                        "Conflicting test_dummy_encryption options");
+               return -EINVAL;
+       }
+       return err;
+}
+
 #define EXT4_SET_CTX(name)                                             \
 static inline void ctx_set_##name(struct ext4_fs_context *ctx,         \
                                  unsigned long flag)                   \
@@ -2291,29 +2295,7 @@ static int ext4_parse_param(struct fs_context *fc, struct fs_parameter *param)
                ctx->spec |= EXT4_SPEC_JOURNAL_IOPRIO;
                return 0;
        case Opt_test_dummy_encryption:
-#ifdef CONFIG_FS_ENCRYPTION
-               if (param->type == fs_value_is_flag) {
-                       ctx->spec |= EXT4_SPEC_DUMMY_ENCRYPTION;
-                       ctx->test_dummy_enc_arg = NULL;
-                       return 0;
-               }
-               if (*param->string &&
-                   !(!strcmp(param->string, "v1") ||
-                     !strcmp(param->string, "v2"))) {
-                       ext4_msg(NULL, KERN_WARNING,
-                                "Value of option \"%s\" is unrecognized",
-                                param->key);
-                       return -EINVAL;
-               }
-               ctx->spec |= EXT4_SPEC_DUMMY_ENCRYPTION;
-               ctx->test_dummy_enc_arg = kmemdup_nul(param->string, param->size,
-                                                     GFP_KERNEL);
-               return 0;
-#else
-               ext4_msg(NULL, KERN_WARNING,
-                        "test_dummy_encryption option not supported");
-               return -EINVAL;
-#endif
+               return ext4_parse_test_dummy_encryption(param, ctx);
        case Opt_dax:
        case Opt_dax_type:
 #ifdef CONFIG_FS_DAX
@@ -2504,7 +2486,8 @@ parse_failed:
        if (s_ctx->spec & EXT4_SPEC_JOURNAL_IOPRIO)
                m_ctx->journal_ioprio = s_ctx->journal_ioprio;
 
-       ret = ext4_apply_options(fc, sb);
+       ext4_apply_options(fc, sb);
+       ret = 0;
 
 out_free:
        if (fc) {
@@ -2673,11 +2656,11 @@ err_jquota_specified:
 static int ext4_check_test_dummy_encryption(const struct fs_context *fc,
                                            struct super_block *sb)
 {
-#ifdef CONFIG_FS_ENCRYPTION
        const struct ext4_fs_context *ctx = fc->fs_private;
        const struct ext4_sb_info *sbi = EXT4_SB(sb);
+       int err;
 
-       if (!(ctx->spec & EXT4_SPEC_DUMMY_ENCRYPTION))
+       if (!fscrypt_is_dummy_policy_set(&ctx->dummy_enc_policy))
                return 0;
 
        if (!ext4_has_feature_encrypt(sb)) {
@@ -2691,14 +2674,46 @@ static int ext4_check_test_dummy_encryption(const struct fs_context *fc,
         * needed to allow it to be set or changed during remount.  We do allow
         * it to be specified during remount, but only if there is no change.
         */
-       if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
-           !sbi->s_dummy_enc_policy.policy) {
+       if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) {
+               if (fscrypt_dummy_policies_equal(&sbi->s_dummy_enc_policy,
+                                                &ctx->dummy_enc_policy))
+                       return 0;
                ext4_msg(NULL, KERN_WARNING,
-                        "Can't set test_dummy_encryption on remount");
+                        "Can't set or change test_dummy_encryption on remount");
                return -EINVAL;
        }
-#endif /* CONFIG_FS_ENCRYPTION */
-       return 0;
+       /* Also make sure s_mount_opts didn't contain a conflicting value. */
+       if (fscrypt_is_dummy_policy_set(&sbi->s_dummy_enc_policy)) {
+               if (fscrypt_dummy_policies_equal(&sbi->s_dummy_enc_policy,
+                                                &ctx->dummy_enc_policy))
+                       return 0;
+               ext4_msg(NULL, KERN_WARNING,
+                        "Conflicting test_dummy_encryption options");
+               return -EINVAL;
+       }
+       /*
+        * fscrypt_add_test_dummy_key() technically changes the super_block, so
+        * technically it should be delayed until ext4_apply_options() like the
+        * other changes.  But since we never get here for remounts (see above),
+        * and this is the last chance to report errors, we do it here.
+        */
+       err = fscrypt_add_test_dummy_key(sb, &ctx->dummy_enc_policy);
+       if (err)
+               ext4_msg(NULL, KERN_WARNING,
+                        "Error adding test dummy encryption key [%d]", err);
+       return err;
+}
+
+static void ext4_apply_test_dummy_encryption(struct ext4_fs_context *ctx,
+                                            struct super_block *sb)
+{
+       if (!fscrypt_is_dummy_policy_set(&ctx->dummy_enc_policy) ||
+           /* if already set, it was already verified to be the same */
+           fscrypt_is_dummy_policy_set(&EXT4_SB(sb)->s_dummy_enc_policy))
+               return;
+       EXT4_SB(sb)->s_dummy_enc_policy = ctx->dummy_enc_policy;
+       memset(&ctx->dummy_enc_policy, 0, sizeof(ctx->dummy_enc_policy));
+       ext4_msg(sb, KERN_WARNING, "Test dummy encryption mode enabled");
 }
 
 static int ext4_check_opt_consistency(struct fs_context *fc,
@@ -2785,11 +2800,10 @@ fail_dax_change_remount:
        return ext4_check_quota_consistency(fc, sb);
 }
 
-static int ext4_apply_options(struct fs_context *fc, struct super_block *sb)
+static void ext4_apply_options(struct fs_context *fc, struct super_block *sb)
 {
        struct ext4_fs_context *ctx = fc->fs_private;
        struct ext4_sb_info *sbi = fc->s_fs_info;
-       int ret = 0;
 
        sbi->s_mount_opt &= ~ctx->mask_s_mount_opt;
        sbi->s_mount_opt |= ctx->vals_s_mount_opt;
@@ -2825,11 +2839,7 @@ static int ext4_apply_options(struct fs_context *fc, struct super_block *sb)
 #endif
 
        ext4_apply_quota_options(fc, sb);
-
-       if (ctx->spec & EXT4_SPEC_DUMMY_ENCRYPTION)
-               ret = ext4_set_test_dummy_encryption(sb, ctx->test_dummy_enc_arg);
-
-       return ret;
+       ext4_apply_test_dummy_encryption(ctx, sb);
 }
 
 
@@ -4552,9 +4562,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
        if (err < 0)
                goto failed_mount;
 
-       err = ext4_apply_options(fc, sb);
-       if (err < 0)
-               goto failed_mount;
+       ext4_apply_options(fc, sb);
 
 #if IS_ENABLED(CONFIG_UNICODE)
        if (ext4_has_feature_casefold(sb) && !sb->s_encoding) {
@@ -5302,14 +5310,6 @@ no_journal:
                err = percpu_counter_init(&sbi->s_freeinodes_counter, freei,
                                          GFP_KERNEL);
        }
-       /*
-        * Update the checksum after updating free space/inode
-        * counters.  Otherwise the superblock can have an incorrect
-        * checksum in the buffer cache until it is written out and
-        * e2fsprogs programs trying to open a file system immediately
-        * after it is mounted can fail.
-        */
-       ext4_superblock_csum_set(sb);
        if (!err)
                err = percpu_counter_init(&sbi->s_dirs_counter,
                                          ext4_count_dirs(sb), GFP_KERNEL);
@@ -5367,6 +5367,14 @@ no_journal:
        EXT4_SB(sb)->s_mount_state |= EXT4_ORPHAN_FS;
        ext4_orphan_cleanup(sb, es);
        EXT4_SB(sb)->s_mount_state &= ~EXT4_ORPHAN_FS;
+       /*
+        * Update the checksum after updating free space/inode counters and
+        * ext4_orphan_cleanup. Otherwise the superblock can have an incorrect
+        * checksum in the buffer cache until it is written out and
+        * e2fsprogs programs trying to open a file system immediately
+        * after it is mounted can fail.
+        */
+       ext4_superblock_csum_set(sb);
        if (needs_recovery) {
                ext4_msg(sb, KERN_INFO, "recovery complete");
                err = ext4_mark_recovery_complete(sb, es);
@@ -5898,7 +5906,6 @@ static void ext4_update_super(struct super_block *sb)
 static int ext4_commit_super(struct super_block *sb)
 {
        struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
-       int error = 0;
 
        if (!sbh)
                return -EINVAL;
@@ -5907,6 +5914,13 @@ static int ext4_commit_super(struct super_block *sb)
 
        ext4_update_super(sb);
 
+       lock_buffer(sbh);
+       /* Buffer got discarded which means block device got invalidated */
+       if (!buffer_mapped(sbh)) {
+               unlock_buffer(sbh);
+               return -EIO;
+       }
+
        if (buffer_write_io_error(sbh) || !buffer_uptodate(sbh)) {
                /*
                 * Oh, dear.  A previous attempt to write the
@@ -5921,17 +5935,21 @@ static int ext4_commit_super(struct super_block *sb)
                clear_buffer_write_io_error(sbh);
                set_buffer_uptodate(sbh);
        }
-       BUFFER_TRACE(sbh, "marking dirty");
-       mark_buffer_dirty(sbh);
-       error = __sync_dirty_buffer(sbh,
-               REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0));
+       get_bh(sbh);
+       /* Clear potential dirty bit if it was journalled update */
+       clear_buffer_dirty(sbh);
+       sbh->b_end_io = end_buffer_write_sync;
+       submit_bh(REQ_OP_WRITE,
+                 REQ_SYNC | (test_opt(sb, BARRIER) ? REQ_FUA : 0), sbh);
+       wait_on_buffer(sbh);
        if (buffer_write_io_error(sbh)) {
                ext4_msg(sb, KERN_ERR, "I/O error while writing "
                       "superblock");
                clear_buffer_write_io_error(sbh);
                set_buffer_uptodate(sbh);
+               return -EIO;
        }
-       return error;
+       return 0;
 }
 
 /*
index 0423253..564e28a 100644 (file)
@@ -1895,11 +1895,10 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
 
                        unlock_buffer(bs->bh);
                        ea_bdebug(bs->bh, "cloning");
-                       s->base = kmalloc(bs->bh->b_size, GFP_NOFS);
+                       s->base = kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS);
                        error = -ENOMEM;
                        if (s->base == NULL)
                                goto cleanup;
-                       memcpy(s->base, BHDR(bs->bh), bs->bh->b_size);
                        s->first = ENTRY(header(s->base)+1);
                        header(s->base)->h_refcount = cpu_to_le32(1);
                        s->here = ENTRY(s->base + offset);
index be599f3..d84c5f6 100644 (file)
@@ -91,8 +91,9 @@ static inline void __record_iostat_latency(struct f2fs_sb_info *sbi)
        unsigned int cnt;
        struct f2fs_iostat_latency iostat_lat[MAX_IO_TYPE][NR_PAGE_TYPE];
        struct iostat_lat_info *io_lat = sbi->iostat_io_lat;
+       unsigned long flags;
 
-       spin_lock_bh(&sbi->iostat_lat_lock);
+       spin_lock_irqsave(&sbi->iostat_lat_lock, flags);
        for (idx = 0; idx < MAX_IO_TYPE; idx++) {
                for (io = 0; io < NR_PAGE_TYPE; io++) {
                        cnt = io_lat->bio_cnt[idx][io];
@@ -106,7 +107,7 @@ static inline void __record_iostat_latency(struct f2fs_sb_info *sbi)
                        io_lat->bio_cnt[idx][io] = 0;
                }
        }
-       spin_unlock_bh(&sbi->iostat_lat_lock);
+       spin_unlock_irqrestore(&sbi->iostat_lat_lock, flags);
 
        trace_f2fs_iostat_latency(sbi, iostat_lat);
 }
@@ -115,14 +116,15 @@ static inline void f2fs_record_iostat(struct f2fs_sb_info *sbi)
 {
        unsigned long long iostat_diff[NR_IO_TYPE];
        int i;
+       unsigned long flags;
 
        if (time_is_after_jiffies(sbi->iostat_next_period))
                return;
 
        /* Need double check under the lock */
-       spin_lock_bh(&sbi->iostat_lock);
+       spin_lock_irqsave(&sbi->iostat_lock, flags);
        if (time_is_after_jiffies(sbi->iostat_next_period)) {
-               spin_unlock_bh(&sbi->iostat_lock);
+               spin_unlock_irqrestore(&sbi->iostat_lock, flags);
                return;
        }
        sbi->iostat_next_period = jiffies +
@@ -133,7 +135,7 @@ static inline void f2fs_record_iostat(struct f2fs_sb_info *sbi)
                                sbi->prev_rw_iostat[i];
                sbi->prev_rw_iostat[i] = sbi->rw_iostat[i];
        }
-       spin_unlock_bh(&sbi->iostat_lock);
+       spin_unlock_irqrestore(&sbi->iostat_lock, flags);
 
        trace_f2fs_iostat(sbi, iostat_diff);
 
@@ -145,25 +147,27 @@ void f2fs_reset_iostat(struct f2fs_sb_info *sbi)
        struct iostat_lat_info *io_lat = sbi->iostat_io_lat;
        int i;
 
-       spin_lock_bh(&sbi->iostat_lock);
+       spin_lock_irq(&sbi->iostat_lock);
        for (i = 0; i < NR_IO_TYPE; i++) {
                sbi->rw_iostat[i] = 0;
                sbi->prev_rw_iostat[i] = 0;
        }
-       spin_unlock_bh(&sbi->iostat_lock);
+       spin_unlock_irq(&sbi->iostat_lock);
 
-       spin_lock_bh(&sbi->iostat_lat_lock);
+       spin_lock_irq(&sbi->iostat_lat_lock);
        memset(io_lat, 0, sizeof(struct iostat_lat_info));
-       spin_unlock_bh(&sbi->iostat_lat_lock);
+       spin_unlock_irq(&sbi->iostat_lat_lock);
 }
 
 void f2fs_update_iostat(struct f2fs_sb_info *sbi,
                        enum iostat_type type, unsigned long long io_bytes)
 {
+       unsigned long flags;
+
        if (!sbi->iostat_enable)
                return;
 
-       spin_lock_bh(&sbi->iostat_lock);
+       spin_lock_irqsave(&sbi->iostat_lock, flags);
        sbi->rw_iostat[type] += io_bytes;
 
        if (type == APP_BUFFERED_IO || type == APP_DIRECT_IO)
@@ -172,7 +176,7 @@ void f2fs_update_iostat(struct f2fs_sb_info *sbi,
        if (type == APP_BUFFERED_READ_IO || type == APP_DIRECT_READ_IO)
                sbi->rw_iostat[APP_READ_IO] += io_bytes;
 
-       spin_unlock_bh(&sbi->iostat_lock);
+       spin_unlock_irqrestore(&sbi->iostat_lock, flags);
 
        f2fs_record_iostat(sbi);
 }
@@ -185,6 +189,7 @@ static inline void __update_iostat_latency(struct bio_iostat_ctx *iostat_ctx,
        struct f2fs_sb_info *sbi = iostat_ctx->sbi;
        struct iostat_lat_info *io_lat = sbi->iostat_io_lat;
        int idx;
+       unsigned long flags;
 
        if (!sbi->iostat_enable)
                return;
@@ -202,12 +207,12 @@ static inline void __update_iostat_latency(struct bio_iostat_ctx *iostat_ctx,
                        idx = WRITE_ASYNC_IO;
        }
 
-       spin_lock_bh(&sbi->iostat_lat_lock);
+       spin_lock_irqsave(&sbi->iostat_lat_lock, flags);
        io_lat->sum_lat[idx][iotype] += ts_diff;
        io_lat->bio_cnt[idx][iotype]++;
        if (ts_diff > io_lat->peak_lat[idx][iotype])
                io_lat->peak_lat[idx][iotype] = ts_diff;
-       spin_unlock_bh(&sbi->iostat_lat_lock);
+       spin_unlock_irqrestore(&sbi->iostat_lat_lock, flags);
 }
 
 void iostat_update_and_unbind_ctx(struct bio *bio, int rw)
index c549acb..bf00d50 100644 (file)
@@ -89,8 +89,6 @@ static struct inode *f2fs_new_inode(struct user_namespace *mnt_userns,
        if (test_opt(sbi, INLINE_XATTR))
                set_inode_flag(inode, FI_INLINE_XATTR);
 
-       if (test_opt(sbi, INLINE_DATA) && f2fs_may_inline_data(inode))
-               set_inode_flag(inode, FI_INLINE_DATA);
        if (f2fs_may_inline_dentry(inode))
                set_inode_flag(inode, FI_INLINE_DENTRY);
 
@@ -107,10 +105,6 @@ static struct inode *f2fs_new_inode(struct user_namespace *mnt_userns,
 
        f2fs_init_extent_tree(inode, NULL);
 
-       stat_inc_inline_xattr(inode);
-       stat_inc_inline_inode(inode);
-       stat_inc_inline_dir(inode);
-
        F2FS_I(inode)->i_flags =
                f2fs_mask_flags(mode, F2FS_I(dir)->i_flags & F2FS_FL_INHERITED);
 
@@ -127,6 +121,14 @@ static struct inode *f2fs_new_inode(struct user_namespace *mnt_userns,
                        set_compress_context(inode);
        }
 
+       /* Should enable inline_data after compression set */
+       if (test_opt(sbi, INLINE_DATA) && f2fs_may_inline_data(inode))
+               set_inode_flag(inode, FI_INLINE_DATA);
+
+       stat_inc_inline_xattr(inode);
+       stat_inc_inline_inode(inode);
+       stat_inc_inline_dir(inode);
+
        f2fs_set_inode_flags(inode);
 
        trace_f2fs_new_inode(inode, 0);
@@ -325,6 +327,9 @@ static void set_compress_inode(struct f2fs_sb_info *sbi, struct inode *inode,
                if (!is_extension_exist(name, ext[i], false))
                        continue;
 
+               /* Do not use inline_data with compression */
+               stat_dec_inline_inode(inode);
+               clear_inode_flag(inode, FI_INLINE_DATA);
                set_compress_context(inode);
                return;
        }
index 836c79a..cf6f7fc 100644 (file)
@@ -1450,7 +1450,9 @@ page_hit:
 out_err:
        ClearPageUptodate(page);
 out_put_err:
-       f2fs_handle_page_eio(sbi, page->index, NODE);
+       /* ENOENT comes from read_node_page which is not an error. */
+       if (err != -ENOENT)
+               f2fs_handle_page_eio(sbi, page->index, NODE);
        f2fs_put_page(page, 1);
        return ERR_PTR(err);
 }
index a21d8f1..0522136 100644 (file)
@@ -120,6 +120,7 @@ static bool inode_io_list_move_locked(struct inode *inode,
                                      struct list_head *head)
 {
        assert_spin_locked(&wb->list_lock);
+       assert_spin_locked(&inode->i_lock);
 
        list_move(&inode->i_io_list, head);
 
@@ -1365,9 +1366,9 @@ static int move_expired_inodes(struct list_head *delaying_queue,
                inode = wb_inode(delaying_queue->prev);
                if (inode_dirtied_after(inode, dirtied_before))
                        break;
+               spin_lock(&inode->i_lock);
                list_move(&inode->i_io_list, &tmp);
                moved++;
-               spin_lock(&inode->i_lock);
                inode->i_state |= I_SYNC_QUEUED;
                spin_unlock(&inode->i_lock);
                if (sb_is_blkdev_sb(inode->i_sb))
@@ -1383,7 +1384,12 @@ static int move_expired_inodes(struct list_head *delaying_queue,
                goto out;
        }
 
-       /* Move inodes from one superblock together */
+       /*
+        * Although inode's i_io_list is moved from 'tmp' to 'dispatch_queue',
+        * we don't take inode->i_lock here because it is just a pointless overhead.
+        * Inode is already marked as I_SYNC_QUEUED so writeback list handling is
+        * fully under our control.
+        */
        while (!list_empty(&tmp)) {
                sb = wb_inode(tmp.prev)->i_sb;
                list_for_each_prev_safe(pos, node, &tmp) {
@@ -1826,8 +1832,8 @@ static long writeback_sb_inodes(struct super_block *sb,
                         * We'll have another go at writing back this inode
                         * when we completed a full scan of b_io.
                         */
-                       spin_unlock(&inode->i_lock);
                        requeue_io(inode, wb);
+                       spin_unlock(&inode->i_lock);
                        trace_writeback_sb_inodes_requeue(inode);
                        continue;
                }
@@ -2358,6 +2364,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
 {
        struct super_block *sb = inode->i_sb;
        int dirtytime = 0;
+       struct bdi_writeback *wb = NULL;
 
        trace_writeback_mark_inode_dirty(inode, flags);
 
@@ -2409,6 +2416,17 @@ void __mark_inode_dirty(struct inode *inode, int flags)
                        inode->i_state &= ~I_DIRTY_TIME;
                inode->i_state |= flags;
 
+               /*
+                * Grab inode's wb early because it requires dropping i_lock and we
+                * need to make sure following checks happen atomically with dirty
+                * list handling so that we don't move inodes under flush worker's
+                * hands.
+                */
+               if (!was_dirty) {
+                       wb = locked_inode_to_wb_and_lock_list(inode);
+                       spin_lock(&inode->i_lock);
+               }
+
                /*
                 * If the inode is queued for writeback by flush worker, just
                 * update its dirty state. Once the flush worker is done with
@@ -2416,7 +2434,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
                 * list, based upon its state.
                 */
                if (inode->i_state & I_SYNC_QUEUED)
-                       goto out_unlock_inode;
+                       goto out_unlock;
 
                /*
                 * Only add valid (hashed) inodes to the superblock's
@@ -2424,22 +2442,19 @@ void __mark_inode_dirty(struct inode *inode, int flags)
                 */
                if (!S_ISBLK(inode->i_mode)) {
                        if (inode_unhashed(inode))
-                               goto out_unlock_inode;
+                               goto out_unlock;
                }
                if (inode->i_state & I_FREEING)
-                       goto out_unlock_inode;
+                       goto out_unlock;
 
                /*
                 * If the inode was already on b_dirty/b_io/b_more_io, don't
                 * reposition it (that would break b_dirty time-ordering).
                 */
                if (!was_dirty) {
-                       struct bdi_writeback *wb;
                        struct list_head *dirty_list;
                        bool wakeup_bdi = false;
 
-                       wb = locked_inode_to_wb_and_lock_list(inode);
-
                        inode->dirtied_when = jiffies;
                        if (dirtytime)
                                inode->dirtied_time_when = jiffies;
@@ -2453,6 +2468,7 @@ void __mark_inode_dirty(struct inode *inode, int flags)
                                                               dirty_list);
 
                        spin_unlock(&wb->list_lock);
+                       spin_unlock(&inode->i_lock);
                        trace_writeback_dirty_inode_enqueue(inode);
 
                        /*
@@ -2467,6 +2483,9 @@ void __mark_inode_dirty(struct inode *inode, int flags)
                        return;
                }
        }
+out_unlock:
+       if (wb)
+               spin_unlock(&wb->list_lock);
 out_unlock_inode:
        spin_unlock(&inode->i_lock);
 }
index 6240804..02eb723 100644 (file)
@@ -600,41 +600,79 @@ static void hugetlb_vmtruncate(struct inode *inode, loff_t offset)
        remove_inode_hugepages(inode, offset, LLONG_MAX);
 }
 
+static void hugetlbfs_zero_partial_page(struct hstate *h,
+                                       struct address_space *mapping,
+                                       loff_t start,
+                                       loff_t end)
+{
+       pgoff_t idx = start >> huge_page_shift(h);
+       struct folio *folio;
+
+       folio = filemap_lock_folio(mapping, idx);
+       if (!folio)
+               return;
+
+       start = start & ~huge_page_mask(h);
+       end = end & ~huge_page_mask(h);
+       if (!end)
+               end = huge_page_size(h);
+
+       folio_zero_segment(folio, (size_t)start, (size_t)end);
+
+       folio_unlock(folio);
+       folio_put(folio);
+}
+
 static long hugetlbfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
 {
+       struct hugetlbfs_inode_info *info = HUGETLBFS_I(inode);
+       struct address_space *mapping = inode->i_mapping;
        struct hstate *h = hstate_inode(inode);
        loff_t hpage_size = huge_page_size(h);
        loff_t hole_start, hole_end;
 
        /*
-        * For hole punch round up the beginning offset of the hole and
-        * round down the end.
+        * hole_start and hole_end indicate the full pages within the hole.
         */
        hole_start = round_up(offset, hpage_size);
        hole_end = round_down(offset + len, hpage_size);
 
-       if (hole_end > hole_start) {
-               struct address_space *mapping = inode->i_mapping;
-               struct hugetlbfs_inode_info *info = HUGETLBFS_I(inode);
+       inode_lock(inode);
 
-               inode_lock(inode);
+       /* protected by i_rwsem */
+       if (info->seals & (F_SEAL_WRITE | F_SEAL_FUTURE_WRITE)) {
+               inode_unlock(inode);
+               return -EPERM;
+       }
 
-               /* protected by i_rwsem */
-               if (info->seals & (F_SEAL_WRITE | F_SEAL_FUTURE_WRITE)) {
-                       inode_unlock(inode);
-                       return -EPERM;
-               }
+       i_mmap_lock_write(mapping);
+
+       /* If range starts before first full page, zero partial page. */
+       if (offset < hole_start)
+               hugetlbfs_zero_partial_page(h, mapping,
+                               offset, min(offset + len, hole_start));
 
-               i_mmap_lock_write(mapping);
+       /* Unmap users of full pages in the hole. */
+       if (hole_end > hole_start) {
                if (!RB_EMPTY_ROOT(&mapping->i_mmap.rb_root))
                        hugetlb_vmdelete_list(&mapping->i_mmap,
                                              hole_start >> PAGE_SHIFT,
                                              hole_end >> PAGE_SHIFT, 0);
-               i_mmap_unlock_write(mapping);
-               remove_inode_hugepages(inode, hole_start, hole_end);
-               inode_unlock(inode);
        }
 
+       /* If range extends beyond last full page, zero partial page. */
+       if ((offset + len) > hole_end && (offset + len) > hole_start)
+               hugetlbfs_zero_partial_page(h, mapping,
+                               hole_end, offset + len);
+
+       i_mmap_unlock_write(mapping);
+
+       /* Remove full pages from the file. */
+       if (hole_end > hole_start)
+               remove_inode_hugepages(inode, hole_start, hole_end);
+
+       inode_unlock(inode);
+
        return 0;
 }
 
index 9d9b422..bd4da9c 100644 (file)
@@ -27,7 +27,7 @@
  * Inode locking rules:
  *
  * inode->i_lock protects:
- *   inode->i_state, inode->i_hash, __iget()
+ *   inode->i_state, inode->i_hash, __iget(), inode->i_io_list
  * Inode LRU list locks protect:
  *   inode->i_sb->s_inode_lru, inode->i_lru
  * inode->i_sb->s_inode_list_lock protects:
index 3aab418..5ff2cdb 100644 (file)
@@ -298,8 +298,8 @@ struct io_buffer_list {
        /* below is for ring provided buffers */
        __u16 buf_nr_pages;
        __u16 nr_entries;
-       __u32 head;
-       __u32 mask;
+       __u16 head;
+       __u16 mask;
 };
 
 struct io_buffer {
@@ -576,7 +576,6 @@ struct io_close {
        struct file                     *file;
        int                             fd;
        u32                             file_slot;
-       u32                             flags;
 };
 
 struct io_timeout_data {
@@ -784,12 +783,6 @@ struct io_msg {
        u32 len;
 };
 
-struct io_nop {
-       struct file                     *file;
-       u64                             extra1;
-       u64                             extra2;
-};
-
 struct io_async_connect {
        struct sockaddr_storage         address;
 };
@@ -851,6 +844,7 @@ enum {
        REQ_F_SINGLE_POLL_BIT,
        REQ_F_DOUBLE_POLL_BIT,
        REQ_F_PARTIAL_IO_BIT,
+       REQ_F_CQE32_INIT_BIT,
        REQ_F_APOLL_MULTISHOT_BIT,
        /* keep async read/write and isreg together and in order */
        REQ_F_SUPPORT_NOWAIT_BIT,
@@ -920,6 +914,8 @@ enum {
        REQ_F_PARTIAL_IO        = BIT(REQ_F_PARTIAL_IO_BIT),
        /* fast poll multishot mode */
        REQ_F_APOLL_MULTISHOT   = BIT(REQ_F_APOLL_MULTISHOT_BIT),
+       /* ->extra1 and ->extra2 are initialised */
+       REQ_F_CQE32_INIT        = BIT(REQ_F_CQE32_INIT_BIT),
 };
 
 struct async_poll {
@@ -994,7 +990,6 @@ struct io_kiocb {
                struct io_msg           msg;
                struct io_xattr         xattr;
                struct io_socket        sock;
-               struct io_nop           nop;
                struct io_uring_cmd     uring_cmd;
        };
 
@@ -1121,7 +1116,6 @@ static const struct io_op_def io_op_defs[] = {
        [IORING_OP_NOP] = {
                .audit_skip             = 1,
                .iopoll                 = 1,
-               .buffer_select          = 1,
        },
        [IORING_OP_READV] = {
                .needs_file             = 1,
@@ -1729,9 +1723,16 @@ static void io_kbuf_recycle(struct io_kiocb *req, unsigned issue_flags)
 
        if (!(req->flags & (REQ_F_BUFFER_SELECTED|REQ_F_BUFFER_RING)))
                return;
-       /* don't recycle if we already did IO to this buffer */
-       if (req->flags & REQ_F_PARTIAL_IO)
+       /*
+        * For legacy provided buffer mode, don't recycle if we already did
+        * IO to this buffer. For ring-mapped provided buffer mode, we should
+        * increment ring->head to explicitly monopolize the buffer to avoid
+        * multiple use.
+        */
+       if ((req->flags & REQ_F_BUFFER_SELECTED) &&
+           (req->flags & REQ_F_PARTIAL_IO))
                return;
+
        /*
         * We don't need to recycle for REQ_F_BUFFER_RING, we can just clear
         * the flag and hence ensure that bl->head doesn't get incremented.
@@ -1739,8 +1740,13 @@ static void io_kbuf_recycle(struct io_kiocb *req, unsigned issue_flags)
         */
        if (req->flags & REQ_F_BUFFER_RING) {
                if (req->buf_list) {
-                       req->buf_index = req->buf_list->bgid;
-                       req->flags &= ~REQ_F_BUFFER_RING;
+                       if (req->flags & REQ_F_PARTIAL_IO) {
+                               req->buf_list->head++;
+                               req->buf_list = NULL;
+                       } else {
+                               req->buf_index = req->buf_list->bgid;
+                               req->flags &= ~REQ_F_BUFFER_RING;
+                       }
                }
                return;
        }
@@ -1969,7 +1975,7 @@ static inline void io_req_track_inflight(struct io_kiocb *req)
 {
        if (!(req->flags & REQ_F_INFLIGHT)) {
                req->flags |= REQ_F_INFLIGHT;
-               atomic_inc(&current->io_uring->inflight_tracked);
+               atomic_inc(&req->task->io_uring->inflight_tracked);
        }
 }
 
@@ -2441,94 +2447,66 @@ static bool io_cqring_event_overflow(struct io_ring_ctx *ctx, u64 user_data,
        return true;
 }
 
-static inline bool __io_fill_cqe(struct io_ring_ctx *ctx, u64 user_data,
-                                s32 res, u32 cflags)
+static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
+                                    struct io_kiocb *req)
 {
        struct io_uring_cqe *cqe;
 
-       /*
-        * If we can't get a cq entry, userspace overflowed the
-        * submission (by quite a lot). Increment the overflow count in
-        * the ring.
-        */
-       cqe = io_get_cqe(ctx);
-       if (likely(cqe)) {
-               WRITE_ONCE(cqe->user_data, user_data);
-               WRITE_ONCE(cqe->res, res);
-               WRITE_ONCE(cqe->flags, cflags);
-               return true;
-       }
-       return io_cqring_event_overflow(ctx, user_data, res, cflags, 0, 0);
-}
+       if (!(ctx->flags & IORING_SETUP_CQE32)) {
+               trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
+                                       req->cqe.res, req->cqe.flags, 0, 0);
 
-static inline bool __io_fill_cqe_req_filled(struct io_ring_ctx *ctx,
-                                           struct io_kiocb *req)
-{
-       struct io_uring_cqe *cqe;
+               /*
+                * If we can't get a cq entry, userspace overflowed the
+                * submission (by quite a lot). Increment the overflow count in
+                * the ring.
+                */
+               cqe = io_get_cqe(ctx);
+               if (likely(cqe)) {
+                       memcpy(cqe, &req->cqe, sizeof(*cqe));
+                       return true;
+               }
 
-       trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
-                               req->cqe.res, req->cqe.flags, 0, 0);
+               return io_cqring_event_overflow(ctx, req->cqe.user_data,
+                                               req->cqe.res, req->cqe.flags,
+                                               0, 0);
+       } else {
+               u64 extra1 = 0, extra2 = 0;
 
-       /*
-        * If we can't get a cq entry, userspace overflowed the
-        * submission (by quite a lot). Increment the overflow count in
-        * the ring.
-        */
-       cqe = io_get_cqe(ctx);
-       if (likely(cqe)) {
-               memcpy(cqe, &req->cqe, sizeof(*cqe));
-               return true;
-       }
-       return io_cqring_event_overflow(ctx, req->cqe.user_data,
-                                       req->cqe.res, req->cqe.flags, 0, 0);
-}
+               if (req->flags & REQ_F_CQE32_INIT) {
+                       extra1 = req->extra1;
+                       extra2 = req->extra2;
+               }
 
-static inline bool __io_fill_cqe32_req_filled(struct io_ring_ctx *ctx,
-                                             struct io_kiocb *req)
-{
-       struct io_uring_cqe *cqe;
-       u64 extra1 = req->extra1;
-       u64 extra2 = req->extra2;
+               trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
+                                       req->cqe.res, req->cqe.flags, extra1, extra2);
 
-       trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
-                               req->cqe.res, req->cqe.flags, extra1, extra2);
+               /*
+                * If we can't get a cq entry, userspace overflowed the
+                * submission (by quite a lot). Increment the overflow count in
+                * the ring.
+                */
+               cqe = io_get_cqe(ctx);
+               if (likely(cqe)) {
+                       memcpy(cqe, &req->cqe, sizeof(struct io_uring_cqe));
+                       WRITE_ONCE(cqe->big_cqe[0], extra1);
+                       WRITE_ONCE(cqe->big_cqe[1], extra2);
+                       return true;
+               }
 
-       /*
-        * If we can't get a cq entry, userspace overflowed the
-        * submission (by quite a lot). Increment the overflow count in
-        * the ring.
-        */
-       cqe = io_get_cqe(ctx);
-       if (likely(cqe)) {
-               memcpy(cqe, &req->cqe, sizeof(struct io_uring_cqe));
-               cqe->big_cqe[0] = extra1;
-               cqe->big_cqe[1] = extra2;
-               return true;
+               return io_cqring_event_overflow(ctx, req->cqe.user_data,
+                               req->cqe.res, req->cqe.flags,
+                               extra1, extra2);
        }
-
-       return io_cqring_event_overflow(ctx, req->cqe.user_data, req->cqe.res,
-                                       req->cqe.flags, extra1, extra2);
 }
 
-static inline bool __io_fill_cqe_req(struct io_kiocb *req, s32 res, u32 cflags)
-{
-       trace_io_uring_complete(req->ctx, req, req->cqe.user_data, res, cflags, 0, 0);
-       return __io_fill_cqe(req->ctx, req->cqe.user_data, res, cflags);
-}
-
-static inline void __io_fill_cqe32_req(struct io_kiocb *req, s32 res, u32 cflags,
-                               u64 extra1, u64 extra2)
+static noinline bool io_fill_cqe_aux(struct io_ring_ctx *ctx, u64 user_data,
+                                    s32 res, u32 cflags)
 {
-       struct io_ring_ctx *ctx = req->ctx;
        struct io_uring_cqe *cqe;
 
-       if (WARN_ON_ONCE(!(ctx->flags & IORING_SETUP_CQE32)))
-               return;
-       if (req->flags & REQ_F_CQE_SKIP)
-               return;
-
-       trace_io_uring_complete(ctx, req, req->cqe.user_data, res, cflags,
-                               extra1, extra2);
+       ctx->cq_extra++;
+       trace_io_uring_complete(ctx, NULL, user_data, res, cflags, 0, 0);
 
        /*
         * If we can't get a cq entry, userspace overflowed the
@@ -2537,23 +2515,17 @@ static inline void __io_fill_cqe32_req(struct io_kiocb *req, s32 res, u32 cflags
         */
        cqe = io_get_cqe(ctx);
        if (likely(cqe)) {
-               WRITE_ONCE(cqe->user_data, req->cqe.user_data);
+               WRITE_ONCE(cqe->user_data, user_data);
                WRITE_ONCE(cqe->res, res);
                WRITE_ONCE(cqe->flags, cflags);
-               WRITE_ONCE(cqe->big_cqe[0], extra1);
-               WRITE_ONCE(cqe->big_cqe[1], extra2);
-               return;
-       }
 
-       io_cqring_event_overflow(ctx, req->cqe.user_data, res, cflags, extra1, extra2);
-}
-
-static noinline bool io_fill_cqe_aux(struct io_ring_ctx *ctx, u64 user_data,
-                                    s32 res, u32 cflags)
-{
-       ctx->cq_extra++;
-       trace_io_uring_complete(ctx, NULL, user_data, res, cflags, 0, 0);
-       return __io_fill_cqe(ctx, user_data, res, cflags);
+               if (ctx->flags & IORING_SETUP_CQE32) {
+                       WRITE_ONCE(cqe->big_cqe[0], 0);
+                       WRITE_ONCE(cqe->big_cqe[1], 0);
+               }
+               return true;
+       }
+       return io_cqring_event_overflow(ctx, user_data, res, cflags, 0, 0);
 }
 
 static void __io_req_complete_put(struct io_kiocb *req)
@@ -2590,16 +2562,11 @@ static void __io_req_complete_put(struct io_kiocb *req)
 static void __io_req_complete_post(struct io_kiocb *req, s32 res,
                                   u32 cflags)
 {
-       if (!(req->flags & REQ_F_CQE_SKIP))
-               __io_fill_cqe_req(req, res, cflags);
-       __io_req_complete_put(req);
-}
-
-static void __io_req_complete_post32(struct io_kiocb *req, s32 res,
-                                  u32 cflags, u64 extra1, u64 extra2)
-{
-       if (!(req->flags & REQ_F_CQE_SKIP))
-               __io_fill_cqe32_req(req, res, cflags, extra1, extra2);
+       if (!(req->flags & REQ_F_CQE_SKIP)) {
+               req->cqe.res = res;
+               req->cqe.flags = cflags;
+               __io_fill_cqe_req(req->ctx, req);
+       }
        __io_req_complete_put(req);
 }
 
@@ -2614,18 +2581,6 @@ static void io_req_complete_post(struct io_kiocb *req, s32 res, u32 cflags)
        io_cqring_ev_posted(ctx);
 }
 
-static void io_req_complete_post32(struct io_kiocb *req, s32 res,
-                                  u32 cflags, u64 extra1, u64 extra2)
-{
-       struct io_ring_ctx *ctx = req->ctx;
-
-       spin_lock(&ctx->completion_lock);
-       __io_req_complete_post32(req, res, cflags, extra1, extra2);
-       io_commit_cqring(ctx);
-       spin_unlock(&ctx->completion_lock);
-       io_cqring_ev_posted(ctx);
-}
-
 static inline void io_req_complete_state(struct io_kiocb *req, s32 res,
                                         u32 cflags)
 {
@@ -2643,19 +2598,6 @@ static inline void __io_req_complete(struct io_kiocb *req, unsigned issue_flags,
                io_req_complete_post(req, res, cflags);
 }
 
-static inline void __io_req_complete32(struct io_kiocb *req,
-                                      unsigned int issue_flags, s32 res,
-                                      u32 cflags, u64 extra1, u64 extra2)
-{
-       if (issue_flags & IO_URING_F_COMPLETE_DEFER) {
-               io_req_complete_state(req, res, cflags);
-               req->extra1 = extra1;
-               req->extra2 = extra2;
-       } else {
-               io_req_complete_post32(req, res, cflags, extra1, extra2);
-       }
-}
-
 static inline void io_req_complete(struct io_kiocb *req, s32 res)
 {
        if (res < 0)
@@ -3202,12 +3144,8 @@ static void __io_submit_flush_completions(struct io_ring_ctx *ctx)
                        struct io_kiocb *req = container_of(node, struct io_kiocb,
                                                    comp_list);
 
-                       if (!(req->flags & REQ_F_CQE_SKIP)) {
-                               if (!(ctx->flags & IORING_SETUP_CQE32))
-                                       __io_fill_cqe_req_filled(ctx, req);
-                               else
-                                       __io_fill_cqe32_req_filled(ctx, req);
-                       }
+                       if (!(req->flags & REQ_F_CQE_SKIP))
+                               __io_fill_cqe_req(ctx, req);
                }
 
                io_commit_cqring(ctx);
@@ -3326,7 +3264,9 @@ static int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
                nr_events++;
                if (unlikely(req->flags & REQ_F_CQE_SKIP))
                        continue;
-               __io_fill_cqe_req(req, req->cqe.res, io_put_kbuf(req, 0));
+
+               req->cqe.flags = io_put_kbuf(req, 0);
+               __io_fill_cqe_req(req->ctx, req);
        }
 
        if (unlikely(!nr_events))
@@ -3497,7 +3437,7 @@ static bool __io_complete_rw_common(struct io_kiocb *req, long res)
        if (unlikely(res != req->cqe.res)) {
                if ((res == -EAGAIN || res == -EOPNOTSUPP) &&
                    io_rw_should_reissue(req)) {
-                       req->flags |= REQ_F_REISSUE;
+                       req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
                        return true;
                }
                req_set_fail(req);
@@ -3547,7 +3487,7 @@ static void io_complete_rw_iopoll(struct kiocb *kiocb, long res)
                kiocb_end_write(req);
        if (unlikely(res != req->cqe.res)) {
                if (res == -EAGAIN && io_rw_should_reissue(req)) {
-                       req->flags |= REQ_F_REISSUE;
+                       req->flags |= REQ_F_REISSUE | REQ_F_PARTIAL_IO;
                        return;
                }
                req->cqe.res = res;
@@ -3677,6 +3617,20 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe)
        int ret;
 
        kiocb->ki_pos = READ_ONCE(sqe->off);
+       /* used for fixed read/write too - just read unconditionally */
+       req->buf_index = READ_ONCE(sqe->buf_index);
+
+       if (req->opcode == IORING_OP_READ_FIXED ||
+           req->opcode == IORING_OP_WRITE_FIXED) {
+               struct io_ring_ctx *ctx = req->ctx;
+               u16 index;
+
+               if (unlikely(req->buf_index >= ctx->nr_user_bufs))
+                       return -EFAULT;
+               index = array_index_nospec(req->buf_index, ctx->nr_user_bufs);
+               req->imu = ctx->user_bufs[index];
+               io_req_set_rsrc_node(req, ctx, 0);
+       }
 
        ioprio = READ_ONCE(sqe->ioprio);
        if (ioprio) {
@@ -3689,12 +3643,9 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe)
                kiocb->ki_ioprio = get_current_ioprio();
        }
 
-       req->imu = NULL;
        req->rw.addr = READ_ONCE(sqe->addr);
        req->rw.len = READ_ONCE(sqe->len);
        req->rw.flags = READ_ONCE(sqe->rw_flags);
-       /* used for fixed read/write too - just read unconditionally */
-       req->buf_index = READ_ONCE(sqe->buf_index);
        return 0;
 }
 
@@ -3826,20 +3777,9 @@ static int __io_import_fixed(struct io_kiocb *req, int rw, struct iov_iter *iter
 static int io_import_fixed(struct io_kiocb *req, int rw, struct iov_iter *iter,
                           unsigned int issue_flags)
 {
-       struct io_mapped_ubuf *imu = req->imu;
-       u16 index, buf_index = req->buf_index;
-
-       if (likely(!imu)) {
-               struct io_ring_ctx *ctx = req->ctx;
-
-               if (unlikely(buf_index >= ctx->nr_user_bufs))
-                       return -EFAULT;
-               io_req_set_rsrc_node(req, ctx, issue_flags);
-               index = array_index_nospec(buf_index, ctx->nr_user_bufs);
-               imu = READ_ONCE(ctx->user_bufs[index]);
-               req->imu = imu;
-       }
-       return __io_import_fixed(req, rw, iter, imu);
+       if (WARN_ON_ONCE(!req->imu))
+               return -EFAULT;
+       return __io_import_fixed(req, rw, iter, req->imu);
 }
 
 static int io_buffer_add_list(struct io_ring_ctx *ctx,
@@ -3876,19 +3816,17 @@ static void __user *io_ring_buffer_select(struct io_kiocb *req, size_t *len,
 {
        struct io_uring_buf_ring *br = bl->buf_ring;
        struct io_uring_buf *buf;
-       __u32 head = bl->head;
+       __u16 head = bl->head;
 
-       if (unlikely(smp_load_acquire(&br->tail) == head)) {
-               io_ring_submit_unlock(req->ctx, issue_flags);
+       if (unlikely(smp_load_acquire(&br->tail) == head))
                return NULL;
-       }
 
        head &= bl->mask;
        if (head < IO_BUFFER_LIST_BUF_PER_PAGE) {
                buf = &br->bufs[head];
        } else {
                int off = head & (IO_BUFFER_LIST_BUF_PER_PAGE - 1);
-               int index = head / IO_BUFFER_LIST_BUF_PER_PAGE - 1;
+               int index = head / IO_BUFFER_LIST_BUF_PER_PAGE;
                buf = page_address(bl->buf_pages[index]);
                buf += off;
        }
@@ -3898,7 +3836,7 @@ static void __user *io_ring_buffer_select(struct io_kiocb *req, size_t *len,
        req->buf_list = bl;
        req->buf_index = buf->bid;
 
-       if (issue_flags & IO_URING_F_UNLOCKED) {
+       if (issue_flags & IO_URING_F_UNLOCKED || !file_can_poll(req->file)) {
                /*
                 * If we came in unlocked, we have no choice but to consume the
                 * buffer here. This does mean it'll be pinned until the IO
@@ -5079,10 +5017,18 @@ void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd,
 
        req->uring_cmd.task_work_cb = task_work_cb;
        req->io_task_work.func = io_uring_cmd_work;
-       io_req_task_prio_work_add(req);
+       io_req_task_work_add(req);
 }
 EXPORT_SYMBOL_GPL(io_uring_cmd_complete_in_task);
 
+static inline void io_req_set_cqe32_extra(struct io_kiocb *req,
+                                         u64 extra1, u64 extra2)
+{
+       req->extra1 = extra1;
+       req->extra2 = extra2;
+       req->flags |= REQ_F_CQE32_INIT;
+}
+
 /*
  * Called by consumers of io_uring_cmd, if they originally returned
  * -EIOCBQUEUED upon receiving the command.
@@ -5093,10 +5039,10 @@ void io_uring_cmd_done(struct io_uring_cmd *ioucmd, ssize_t ret, ssize_t res2)
 
        if (ret < 0)
                req_set_fail(req);
+
        if (req->ctx->flags & IORING_SETUP_CQE32)
-               __io_req_complete32(req, 0, ret, 0, res2, 0);
-       else
-               io_req_complete(req, ret);
+               io_req_set_cqe32_extra(req, res2, 0);
+       io_req_complete(req, ret);
 }
 EXPORT_SYMBOL_GPL(io_uring_cmd_done);
 
@@ -5258,14 +5204,6 @@ done:
 
 static int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 {
-       /*
-        * If the ring is setup with CQE32, relay back addr/addr
-        */
-       if (req->ctx->flags & IORING_SETUP_CQE32) {
-               req->nop.extra1 = READ_ONCE(sqe->addr);
-               req->nop.extra2 = READ_ONCE(sqe->addr2);
-       }
-
        return 0;
 }
 
@@ -5274,23 +5212,7 @@ static int io_nop_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
  */
 static int io_nop(struct io_kiocb *req, unsigned int issue_flags)
 {
-       unsigned int cflags;
-       void __user *buf;
-
-       if (req->flags & REQ_F_BUFFER_SELECT) {
-               size_t len = 1;
-
-               buf = io_buffer_select(req, &len, issue_flags);
-               if (!buf)
-                       return -ENOBUFS;
-       }
-
-       cflags = io_put_kbuf(req, issue_flags);
-       if (!(req->ctx->flags & IORING_SETUP_CQE32))
-               __io_req_complete(req, issue_flags, 0, cflags);
-       else
-               __io_req_complete32(req, issue_flags, 0, cflags,
-                                   req->nop.extra1, req->nop.extra2);
+       __io_req_complete(req, issue_flags, 0, 0);
        return 0;
 }
 
@@ -5988,18 +5910,14 @@ static int io_statx(struct io_kiocb *req, unsigned int issue_flags)
 
 static int io_close_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 {
-       if (sqe->off || sqe->addr || sqe->len || sqe->buf_index)
+       if (sqe->off || sqe->addr || sqe->len || sqe->rw_flags || sqe->buf_index)
                return -EINVAL;
        if (req->flags & REQ_F_FIXED_FILE)
                return -EBADF;
 
        req->close.fd = READ_ONCE(sqe->fd);
        req->close.file_slot = READ_ONCE(sqe->file_index);
-       req->close.flags = READ_ONCE(sqe->close_flags);
-       if (req->close.flags & ~IORING_CLOSE_FD_AND_FILE_SLOT)
-               return -EINVAL;
-       if (!(req->close.flags & IORING_CLOSE_FD_AND_FILE_SLOT) &&
-           req->close.file_slot && req->close.fd)
+       if (req->close.file_slot && req->close.fd)
                return -EINVAL;
 
        return 0;
@@ -6015,8 +5933,7 @@ static int io_close(struct io_kiocb *req, unsigned int issue_flags)
 
        if (req->close.file_slot) {
                ret = io_close_fixed(req, issue_flags);
-               if (ret || !(req->close.flags & IORING_CLOSE_FD_AND_FILE_SLOT))
-                       goto err;
+               goto err;
        }
 
        spin_lock(&files->file_lock);
@@ -6160,8 +6077,6 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 
        if (unlikely(sqe->file_index))
                return -EINVAL;
-       if (unlikely(sqe->addr2 || sqe->file_index))
-               return -EINVAL;
 
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
        sr->len = READ_ONCE(sqe->len);
@@ -6398,8 +6313,6 @@ static int io_recvmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 
        if (unlikely(sqe->file_index))
                return -EINVAL;
-       if (unlikely(sqe->addr2 || sqe->file_index))
-               return -EINVAL;
 
        sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr));
        sr->len = READ_ONCE(sqe->len);
@@ -7037,7 +6950,8 @@ static void io_apoll_task_func(struct io_kiocb *req, bool *locked)
                io_req_complete_failed(req, ret);
 }
 
-static void __io_poll_execute(struct io_kiocb *req, int mask, __poll_t events)
+static void __io_poll_execute(struct io_kiocb *req, int mask,
+                             __poll_t __maybe_unused events)
 {
        req->cqe.res = mask;
        /*
@@ -7046,7 +6960,6 @@ static void __io_poll_execute(struct io_kiocb *req, int mask, __poll_t events)
         * CPU. We want to avoid pulling in req->apoll->events for that
         * case.
         */
-       req->apoll_events = events;
        if (req->opcode == IORING_OP_POLL_ADD)
                req->io_task_work.func = io_poll_task_func;
        else
@@ -7197,6 +7110,8 @@ static int __io_arm_poll_handler(struct io_kiocb *req,
        io_init_poll_iocb(poll, mask, io_poll_wake);
        poll->file = req->file;
 
+       req->apoll_events = poll->events;
+
        ipt->pt._key = mask;
        ipt->req = req;
        ipt->error = 0;
@@ -7227,8 +7142,11 @@ static int __io_arm_poll_handler(struct io_kiocb *req,
 
        if (mask) {
                /* can't multishot if failed, just queue the event we've got */
-               if (unlikely(ipt->error || !ipt->nr_entries))
+               if (unlikely(ipt->error || !ipt->nr_entries)) {
                        poll->events |= EPOLLONESHOT;
+                       req->apoll_events |= EPOLLONESHOT;
+                       ipt->error = 0;
+               }
                __io_poll_execute(req, mask, poll->events);
                return 0;
        }
@@ -7290,6 +7208,7 @@ static int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags)
                mask |= EPOLLEXCLUSIVE;
        if (req->flags & REQ_F_POLLED) {
                apoll = req->apoll;
+               kfree(apoll->double_poll);
        } else if (!(issue_flags & IO_URING_F_UNLOCKED) &&
                   !list_empty(&ctx->apoll_cache)) {
                apoll = list_first_entry(&ctx->apoll_cache, struct async_poll,
@@ -7475,7 +7394,7 @@ static int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe
                return -EINVAL;
 
        io_req_set_refcount(req);
-       req->apoll_events = poll->events = io_poll_parse_events(sqe, flags);
+       poll->events = io_poll_parse_events(sqe, flags);
        return 0;
 }
 
@@ -7488,6 +7407,8 @@ static int io_poll_add(struct io_kiocb *req, unsigned int issue_flags)
        ipt.pt._qproc = io_poll_queue_proc;
 
        ret = __io_arm_poll_handler(req, &req->poll, &ipt, poll->events);
+       if (!ret && ipt.error)
+               req_set_fail(req);
        ret = ret ?: ipt.error;
        if (ret)
                __io_req_complete(req, issue_flags, ret, 0);
@@ -8063,8 +7984,8 @@ static int io_files_update_with_index_alloc(struct io_kiocb *req,
                if (ret < 0)
                        break;
                if (copy_to_user(&fds[done], &ret, sizeof(ret))) {
-                       ret = -EFAULT;
                        __io_close_fixed(req, issue_flags, ret);
+                       ret = -EFAULT;
                        break;
                }
        }
@@ -8773,6 +8694,7 @@ static void io_queue_async(struct io_kiocb *req, int ret)
                 * Queued up for async execution, worker will release
                 * submit reference when the iocb is actually submitted.
                 */
+               io_kbuf_recycle(req, 0);
                io_queue_iowq(req, NULL);
                break;
        case IO_APOLL_OK:
@@ -9788,11 +9710,19 @@ static void __io_sqe_files_unregister(struct io_ring_ctx *ctx)
 
 static int io_sqe_files_unregister(struct io_ring_ctx *ctx)
 {
+       unsigned nr = ctx->nr_user_files;
        int ret;
 
        if (!ctx->file_data)
                return -ENXIO;
+
+       /*
+        * Quiesce may unlock ->uring_lock, and while it's not held
+        * prevent new requests using the table.
+        */
+       ctx->nr_user_files = 0;
        ret = io_rsrc_ref_quiesce(ctx->file_data, ctx);
+       ctx->nr_user_files = nr;
        if (!ret)
                __io_sqe_files_unregister(ctx);
        return ret;
@@ -10690,12 +10620,19 @@ static void __io_sqe_buffers_unregister(struct io_ring_ctx *ctx)
 
 static int io_sqe_buffers_unregister(struct io_ring_ctx *ctx)
 {
+       unsigned nr = ctx->nr_user_bufs;
        int ret;
 
        if (!ctx->buf_data)
                return -ENXIO;
 
+       /*
+        * Quiesce may unlock ->uring_lock, and while it's not held
+        * prevent new requests using the table.
+        */
+       ctx->nr_user_bufs = 0;
        ret = io_rsrc_ref_quiesce(ctx->buf_data, ctx);
+       ctx->nr_user_bufs = nr;
        if (!ret)
                __io_sqe_buffers_unregister(ctx);
        return ret;
@@ -13002,6 +12939,10 @@ static int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
        if (!is_power_of_2(reg.ring_entries))
                return -EINVAL;
 
+       /* cannot disambiguate full vs empty due to head/tail size */
+       if (reg.ring_entries >= 65536)
+               return -EINVAL;
+
        if (unlikely(reg.bgid < BGID_ARRAY && !ctx->io_bl)) {
                int ret = io_init_bl_list(ctx);
                if (ret)
index e49bb09..e9c308a 100644 (file)
@@ -2114,7 +2114,7 @@ out:
 /**
  * jbd2_journal_try_to_free_buffers() - try to free page buffers.
  * @journal: journal for operation
- * @page: to try and free
+ * @folio: Folio to detach data from.
  *
  * For all the buffers on this page,
  * if they are fully written out ordered data, move them onto BUF_CLEAN
index 8742d22..42f892c 100644 (file)
@@ -155,7 +155,7 @@ static void netfs_rreq_expand(struct netfs_io_request *rreq,
 void netfs_readahead(struct readahead_control *ractl)
 {
        struct netfs_io_request *rreq;
-       struct netfs_i_context *ctx = netfs_i_context(ractl->mapping->host);
+       struct netfs_inode *ctx = netfs_inode(ractl->mapping->host);
        int ret;
 
        _enter("%lx,%x", readahead_index(ractl), readahead_count(ractl));
@@ -215,7 +215,7 @@ int netfs_read_folio(struct file *file, struct folio *folio)
 {
        struct address_space *mapping = folio_file_mapping(folio);
        struct netfs_io_request *rreq;
-       struct netfs_i_context *ctx = netfs_i_context(mapping->host);
+       struct netfs_inode *ctx = netfs_inode(mapping->host);
        int ret;
 
        _enter("%lx", folio_index(folio));
@@ -297,6 +297,7 @@ zero_out:
 
 /**
  * netfs_write_begin - Helper to prepare for writing
+ * @ctx: The netfs context
  * @file: The file to read from
  * @mapping: The mapping to read from
  * @pos: File position at which the write will begin
@@ -326,12 +327,12 @@ zero_out:
  *
  * This is usable whether or not caching is enabled.
  */
-int netfs_write_begin(struct file *file, struct address_space *mapping,
+int netfs_write_begin(struct netfs_inode *ctx,
+                     struct file *file, struct address_space *mapping,
                      loff_t pos, unsigned int len, struct folio **_folio,
                      void **_fsdata)
 {
        struct netfs_io_request *rreq;
-       struct netfs_i_context *ctx = netfs_i_context(file_inode(file ));
        struct folio *folio;
        unsigned int fgp_flags = FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE;
        pgoff_t index = pos >> PAGE_SHIFT;
index b7b0e3d..43fac1b 100644 (file)
@@ -91,7 +91,7 @@ static inline void netfs_stat_d(atomic_t *stat)
 /*
  * Miscellaneous functions.
  */
-static inline bool netfs_is_cache_enabled(struct netfs_i_context *ctx)
+static inline bool netfs_is_cache_enabled(struct netfs_inode *ctx)
 {
 #if IS_ENABLED(CONFIG_FSCACHE)
        struct fscache_cookie *cookie = ctx->cache;
index e86107b..e17cdf5 100644 (file)
@@ -18,7 +18,7 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping,
 {
        static atomic_t debug_ids;
        struct inode *inode = file ? file_inode(file) : mapping->host;
-       struct netfs_i_context *ctx = netfs_i_context(inode);
+       struct netfs_inode *ctx = netfs_inode(inode);
        struct netfs_io_request *rreq;
        int ret;
 
@@ -75,10 +75,10 @@ static void netfs_free_request(struct work_struct *work)
        struct netfs_io_request *rreq =
                container_of(work, struct netfs_io_request, work);
 
-       netfs_clear_subrequests(rreq, false);
-       if (rreq->netfs_priv)
-               rreq->netfs_ops->cleanup(rreq->mapping, rreq->netfs_priv);
        trace_netfs_rreq(rreq, netfs_rreq_trace_free);
+       netfs_clear_subrequests(rreq, false);
+       if (rreq->netfs_ops->free_request)
+               rreq->netfs_ops->free_request(rreq);
        if (rreq->cache_resources.ops)
                rreq->cache_resources.ops->end_operation(&rreq->cache_resources);
        kfree(rreq);
index c852028..c1eda73 100644 (file)
@@ -288,6 +288,7 @@ static u32 initiate_file_draining(struct nfs_client *clp,
                rv = NFS4_OK;
                break;
        case -ENOENT:
+               set_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags);
                /* Embrace your forgetfulness! */
                rv = NFS4ERR_NOMATCHING_LAYOUT;
 
index a8ecdd5..0c4e8dd 100644 (file)
@@ -2124,6 +2124,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
                }
                goto out;
        }
+       file->f_mode |= FMODE_CAN_ODIRECT;
 
        err = nfs_finish_open(ctx, ctx->dentry, file, open_flags);
        trace_nfs_atomic_open_exit(dir, ctx, open_flags, err);
index 03d3a27..e88f6b1 100644 (file)
@@ -93,6 +93,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)
        nfs_file_set_open_context(filp, ctx);
        nfs_fscache_open_file(inode, filp);
        err = 0;
+       filp->f_mode |= FMODE_CAN_ODIRECT;
 
 out_put_ctx:
        put_nfs_open_context(ctx);
index 68a87be..41a9b6b 100644 (file)
@@ -469,6 +469,7 @@ pnfs_mark_layout_stateid_invalid(struct pnfs_layout_hdr *lo,
                pnfs_clear_lseg_state(lseg, lseg_list);
        pnfs_clear_layoutreturn_info(lo);
        pnfs_free_returned_lsegs(lo, lseg_list, &range, 0);
+       set_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags);
        if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags) &&
            !test_and_set_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags))
                pnfs_clear_layoutreturn_waitbit(lo);
@@ -1917,8 +1918,9 @@ static void nfs_layoutget_begin(struct pnfs_layout_hdr *lo)
 
 static void nfs_layoutget_end(struct pnfs_layout_hdr *lo)
 {
-       if (atomic_dec_and_test(&lo->plh_outstanding))
-               wake_up_var(&lo->plh_outstanding);
+       if (atomic_dec_and_test(&lo->plh_outstanding) &&
+           test_and_clear_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags))
+               wake_up_bit(&lo->plh_flags, NFS_LAYOUT_DRAIN);
 }
 
 static bool pnfs_is_first_layoutget(struct pnfs_layout_hdr *lo)
@@ -2025,11 +2027,11 @@ lookup_again:
         * If the layout segment list is empty, but there are outstanding
         * layoutget calls, then they might be subject to a layoutrecall.
         */
-       if ((list_empty(&lo->plh_segs) || !pnfs_layout_is_valid(lo)) &&
+       if (test_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags) &&
            atomic_read(&lo->plh_outstanding) != 0) {
                spin_unlock(&ino->i_lock);
-               lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding,
-                                       !atomic_read(&lo->plh_outstanding)));
+               lseg = ERR_PTR(wait_on_bit(&lo->plh_flags, NFS_LAYOUT_DRAIN,
+                                          TASK_KILLABLE));
                if (IS_ERR(lseg))
                        goto out_put_layout_hdr;
                pnfs_put_layout_hdr(lo);
@@ -2152,6 +2154,12 @@ lookup_again:
                case -ERECALLCONFLICT:
                case -EAGAIN:
                        break;
+               case -ENODATA:
+                       /* The server returned NFS4ERR_LAYOUTUNAVAILABLE */
+                       pnfs_layout_set_fail_bit(
+                               lo, pnfs_iomode_to_fail_bit(iomode));
+                       lseg = NULL;
+                       goto out_put_layout_hdr;
                default:
                        if (!nfs_error_is_fatal(PTR_ERR(lseg))) {
                                pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode));
@@ -2407,7 +2415,8 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
                goto out_forget;
        }
 
-       if (!pnfs_layout_is_valid(lo) && !pnfs_is_first_layoutget(lo))
+       if (test_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags) &&
+           !pnfs_is_first_layoutget(lo))
                goto out_forget;
 
        if (nfs4_stateid_match_other(&lo->plh_stateid, &res->stateid)) {
index 07f1148..f331f06 100644 (file)
@@ -105,6 +105,7 @@ enum {
        NFS_LAYOUT_FIRST_LAYOUTGET,     /* Serialize first layoutget */
        NFS_LAYOUT_INODE_FREEING,       /* The inode is being freed */
        NFS_LAYOUT_HASHED,              /* The layout visible */
+       NFS_LAYOUT_DRAIN,
 };
 
 enum layoutdriver_policy_flags {
index f172412..9cb2d59 100644 (file)
@@ -309,11 +309,12 @@ nfsd_file_put(struct nfsd_file *nf)
        if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags) == 0) {
                nfsd_file_flush(nf);
                nfsd_file_put_noref(nf);
-       } else {
+       } else if (nf->nf_file) {
                nfsd_file_put_noref(nf);
-               if (nf->nf_file)
-                       nfsd_file_schedule_laundrette();
-       }
+               nfsd_file_schedule_laundrette();
+       } else
+               nfsd_file_put_noref(nf);
+
        if (atomic_long_read(&nfsd_filecache_count) >= NFSD_FILE_LRU_LIMIT)
                nfsd_file_gc();
 }
index a74aef9..09d1307 100644 (file)
@@ -79,6 +79,7 @@
 #include <linux/capability.h>
 #include <linux/quotaops.h>
 #include <linux/blkdev.h>
+#include <linux/sched/mm.h>
 #include "../internal.h" /* ugh */
 
 #include <linux/uaccess.h>
@@ -425,9 +426,11 @@ EXPORT_SYMBOL(mark_info_dirty);
 int dquot_acquire(struct dquot *dquot)
 {
        int ret = 0, ret2 = 0;
+       unsigned int memalloc;
        struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
        mutex_lock(&dquot->dq_lock);
+       memalloc = memalloc_nofs_save();
        if (!test_bit(DQ_READ_B, &dquot->dq_flags)) {
                ret = dqopt->ops[dquot->dq_id.type]->read_dqblk(dquot);
                if (ret < 0)
@@ -458,6 +461,7 @@ int dquot_acquire(struct dquot *dquot)
        smp_mb__before_atomic();
        set_bit(DQ_ACTIVE_B, &dquot->dq_flags);
 out_iolock:
+       memalloc_nofs_restore(memalloc);
        mutex_unlock(&dquot->dq_lock);
        return ret;
 }
@@ -469,9 +473,11 @@ EXPORT_SYMBOL(dquot_acquire);
 int dquot_commit(struct dquot *dquot)
 {
        int ret = 0;
+       unsigned int memalloc;
        struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
        mutex_lock(&dquot->dq_lock);
+       memalloc = memalloc_nofs_save();
        if (!clear_dquot_dirty(dquot))
                goto out_lock;
        /* Inactive dquot can be only if there was error during read/init
@@ -481,6 +487,7 @@ int dquot_commit(struct dquot *dquot)
        else
                ret = -EIO;
 out_lock:
+       memalloc_nofs_restore(memalloc);
        mutex_unlock(&dquot->dq_lock);
        return ret;
 }
@@ -492,9 +499,11 @@ EXPORT_SYMBOL(dquot_commit);
 int dquot_release(struct dquot *dquot)
 {
        int ret = 0, ret2 = 0;
+       unsigned int memalloc;
        struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
        mutex_lock(&dquot->dq_lock);
+       memalloc = memalloc_nofs_save();
        /* Check whether we are not racing with some other dqget() */
        if (dquot_is_busy(dquot))
                goto out_dqlock;
@@ -510,6 +519,7 @@ int dquot_release(struct dquot *dquot)
        }
        clear_bit(DQ_ACTIVE_B, &dquot->dq_flags);
 out_dqlock:
+       memalloc_nofs_restore(memalloc);
        mutex_unlock(&dquot->dq_lock);
        return ret;
 }
index de72527..81d26ab 100644 (file)
@@ -553,7 +553,7 @@ struct dentry *tracefs_create_dir(const char *name, struct dentry *parent)
  *
  * Only one instances directory is allowed.
  *
- * The instances directory is special as it allows for mkdir and rmdir to
+ * The instances directory is special as it allows for mkdir and rmdir
  * to be done by userspace. When a mkdir or rmdir is performed, the inode
  * locks are released and the methods passed in (@mkdir and @rmdir) are
  * called without locks and with the name of the directory being created
index 836ab1b..1824f61 100644 (file)
@@ -997,9 +997,11 @@ xfs_attr_set(
        /*
         * We have no control over the attribute names that userspace passes us
         * to remove, so we have to allow the name lookup prior to attribute
-        * removal to fail as well.
+        * removal to fail as well.  Preserve the logged flag, since we need
+        * to pass that through to the logging code.
         */
-       args->op_flags = XFS_DA_OP_OKNOENT;
+       args->op_flags = XFS_DA_OP_OKNOENT |
+                                       (args->op_flags & XFS_DA_OP_LOGGED);
 
        if (args->value) {
                XFS_STATS_INC(mp, xs_attr_set);
@@ -1439,12 +1441,11 @@ static int
 xfs_attr_node_try_addname(
        struct xfs_attr_intent          *attr)
 {
-       struct xfs_da_args              *args = attr->xattri_da_args;
        struct xfs_da_state             *state = attr->xattri_da_state;
        struct xfs_da_state_blk         *blk;
        int                             error;
 
-       trace_xfs_attr_node_addname(args);
+       trace_xfs_attr_node_addname(state->args);
 
        blk = &state->path.blk[state->path.active-1];
        ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
index e329da3..b4a2fc7 100644 (file)
@@ -28,16 +28,6 @@ struct xfs_attr_list_context;
  */
 #define        ATTR_MAX_VALUELEN       (64*1024)       /* max length of a value */
 
-static inline bool xfs_has_larp(struct xfs_mount *mp)
-{
-#ifdef DEBUG
-       /* Logged xattrs require a V5 super for log_incompat */
-       return xfs_has_crc(mp) && xfs_globals.larp;
-#else
-       return false;
-#endif
-}
-
 /*
  * Kernel-internal version of the attrlist cursor.
  */
@@ -624,7 +614,7 @@ static inline enum xfs_delattr_state
 xfs_attr_init_replace_state(struct xfs_da_args *args)
 {
        args->op_flags |= XFS_DA_OP_ADDNAME | XFS_DA_OP_REPLACE;
-       if (xfs_has_larp(args->dp->i_mount))
+       if (args->op_flags & XFS_DA_OP_LOGGED)
                return xfs_attr_init_remove_state(args);
        return xfs_attr_init_add_state(args);
 }
index 15a9904..37e7c33 100644 (file)
@@ -1530,7 +1530,7 @@ xfs_attr3_leaf_add_work(
        if (tmp)
                entry->flags |= XFS_ATTR_LOCAL;
        if (args->op_flags & XFS_DA_OP_REPLACE) {
-               if (!xfs_has_larp(mp))
+               if (!(args->op_flags & XFS_DA_OP_LOGGED))
                        entry->flags |= XFS_ATTR_INCOMPLETE;
                if ((args->blkno2 == args->blkno) &&
                    (args->index2 <= args->index)) {
index d33b768..ffa3df5 100644 (file)
@@ -92,6 +92,7 @@ typedef struct xfs_da_args {
 #define XFS_DA_OP_NOTIME       (1u << 5) /* don't update inode timestamps */
 #define XFS_DA_OP_REMOVE       (1u << 6) /* this is a remove operation */
 #define XFS_DA_OP_RECOVERY     (1u << 7) /* Log recovery operation */
+#define XFS_DA_OP_LOGGED       (1u << 8) /* Use intent items to track op */
 
 #define XFS_DA_OP_FLAGS \
        { XFS_DA_OP_JUSTCHECK,  "JUSTCHECK" }, \
@@ -101,7 +102,8 @@ typedef struct xfs_da_args {
        { XFS_DA_OP_CILOOKUP,   "CILOOKUP" }, \
        { XFS_DA_OP_NOTIME,     "NOTIME" }, \
        { XFS_DA_OP_REMOVE,     "REMOVE" }, \
-       { XFS_DA_OP_RECOVERY,   "RECOVERY" }
+       { XFS_DA_OP_RECOVERY,   "RECOVERY" }, \
+       { XFS_DA_OP_LOGGED,     "LOGGED" }
 
 /*
  * Storage for holding state during Btree searches and split/join ops.
index 4a28c2d..135d441 100644 (file)
@@ -413,18 +413,20 @@ xfs_attr_create_intent(
        struct xfs_mount                *mp = tp->t_mountp;
        struct xfs_attri_log_item       *attrip;
        struct xfs_attr_intent          *attr;
+       struct xfs_da_args              *args;
 
        ASSERT(count == 1);
 
-       if (!xfs_sb_version_haslogxattrs(&mp->m_sb))
-               return NULL;
-
        /*
         * Each attr item only performs one attribute operation at a time, so
         * this is a list of one
         */
        attr = list_first_entry_or_null(items, struct xfs_attr_intent,
                        xattri_list);
+       args = attr->xattri_da_args;
+
+       if (!(args->op_flags & XFS_DA_OP_LOGGED))
+               return NULL;
 
        /*
         * Create a buffer to store the attribute name and value.  This buffer
@@ -432,8 +434,6 @@ xfs_attr_create_intent(
         * and the lower level xattr log items.
         */
        if (!attr->xattri_nameval) {
-               struct xfs_da_args      *args = attr->xattri_da_args;
-
                /*
                 * Transfer our reference to the name/value buffer to the
                 * deferred work state structure.
@@ -617,7 +617,10 @@ xfs_attri_item_recover(
        args->namelen = nv->name.i_len;
        args->hashval = xfs_da_hashname(args->name, args->namelen);
        args->attr_filter = attrp->alfi_attr_filter & XFS_ATTRI_FILTER_MASK;
-       args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT;
+       args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT |
+                        XFS_DA_OP_LOGGED;
+
+       ASSERT(xfs_sb_version_haslogxattrs(&mp->m_sb));
 
        switch (attr->xattri_op_flags) {
        case XFS_ATTRI_OP_FLAGS_SET:
index 5a364a7..0d67ff8 100644 (file)
@@ -1096,7 +1096,8 @@ xfs_flags2diflags2(
 {
        uint64_t                di_flags2 =
                (ip->i_diflags2 & (XFS_DIFLAG2_REFLINK |
-                                  XFS_DIFLAG2_BIGTIME));
+                                  XFS_DIFLAG2_BIGTIME |
+                                  XFS_DIFLAG2_NREXT64));
 
        if (xflags & FS_XFLAG_DAX)
                di_flags2 |= XFS_DIFLAG2_DAX;
index 35e13e1..c325a28 100644 (file)
@@ -68,6 +68,18 @@ xfs_attr_rele_log_assist(
        xlog_drop_incompat_feat(mp->m_log);
 }
 
+static inline bool
+xfs_attr_want_log_assist(
+       struct xfs_mount        *mp)
+{
+#ifdef DEBUG
+       /* Logged xattrs require a V5 super for log_incompat */
+       return xfs_has_crc(mp) && xfs_globals.larp;
+#else
+       return false;
+#endif
+}
+
 /*
  * Set or remove an xattr, having grabbed the appropriate logging resources
  * prior to calling libxfs.
@@ -80,11 +92,14 @@ xfs_attr_change(
        bool                    use_logging = false;
        int                     error;
 
-       if (xfs_has_larp(mp)) {
+       ASSERT(!(args->op_flags & XFS_DA_OP_LOGGED));
+
+       if (xfs_attr_want_log_assist(mp)) {
                error = xfs_attr_grab_log_assist(mp);
                if (error)
                        return error;
 
+               args->op_flags |= XFS_DA_OP_LOGGED;
                use_logging = true;
        }
 
index bcb21ae..0532997 100644 (file)
@@ -110,15 +110,51 @@ static inline void zonefs_i_size_write(struct inode *inode, loff_t isize)
        }
 }
 
-static int zonefs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
-                             unsigned int flags, struct iomap *iomap,
-                             struct iomap *srcmap)
+static int zonefs_read_iomap_begin(struct inode *inode, loff_t offset,
+                                  loff_t length, unsigned int flags,
+                                  struct iomap *iomap, struct iomap *srcmap)
 {
        struct zonefs_inode_info *zi = ZONEFS_I(inode);
        struct super_block *sb = inode->i_sb;
        loff_t isize;
 
-       /* All I/Os should always be within the file maximum size */
+       /*
+        * All blocks are always mapped below EOF. If reading past EOF,
+        * act as if there is a hole up to the file maximum size.
+        */
+       mutex_lock(&zi->i_truncate_mutex);
+       iomap->bdev = inode->i_sb->s_bdev;
+       iomap->offset = ALIGN_DOWN(offset, sb->s_blocksize);
+       isize = i_size_read(inode);
+       if (iomap->offset >= isize) {
+               iomap->type = IOMAP_HOLE;
+               iomap->addr = IOMAP_NULL_ADDR;
+               iomap->length = length;
+       } else {
+               iomap->type = IOMAP_MAPPED;
+               iomap->addr = (zi->i_zsector << SECTOR_SHIFT) + iomap->offset;
+               iomap->length = isize - iomap->offset;
+       }
+       mutex_unlock(&zi->i_truncate_mutex);
+
+       trace_zonefs_iomap_begin(inode, iomap);
+
+       return 0;
+}
+
+static const struct iomap_ops zonefs_read_iomap_ops = {
+       .iomap_begin    = zonefs_read_iomap_begin,
+};
+
+static int zonefs_write_iomap_begin(struct inode *inode, loff_t offset,
+                                   loff_t length, unsigned int flags,
+                                   struct iomap *iomap, struct iomap *srcmap)
+{
+       struct zonefs_inode_info *zi = ZONEFS_I(inode);
+       struct super_block *sb = inode->i_sb;
+       loff_t isize;
+
+       /* All write I/Os should always be within the file maximum size */
        if (WARN_ON_ONCE(offset + length > zi->i_max_size))
                return -EIO;
 
@@ -128,7 +164,7 @@ static int zonefs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
         * operation.
         */
        if (WARN_ON_ONCE(zi->i_ztype == ZONEFS_ZTYPE_SEQ &&
-                        (flags & IOMAP_WRITE) && !(flags & IOMAP_DIRECT)))
+                        !(flags & IOMAP_DIRECT)))
                return -EIO;
 
        /*
@@ -137,47 +173,44 @@ static int zonefs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
         * write pointer) and unwriten beyond.
         */
        mutex_lock(&zi->i_truncate_mutex);
+       iomap->bdev = inode->i_sb->s_bdev;
+       iomap->offset = ALIGN_DOWN(offset, sb->s_blocksize);
+       iomap->addr = (zi->i_zsector << SECTOR_SHIFT) + iomap->offset;
        isize = i_size_read(inode);
-       if (offset >= isize)
+       if (iomap->offset >= isize) {
                iomap->type = IOMAP_UNWRITTEN;
-       else
+               iomap->length = zi->i_max_size - iomap->offset;
+       } else {
                iomap->type = IOMAP_MAPPED;
-       if (flags & IOMAP_WRITE)
-               length = zi->i_max_size - offset;
-       else
-               length = min(length, isize - offset);
+               iomap->length = isize - iomap->offset;
+       }
        mutex_unlock(&zi->i_truncate_mutex);
 
-       iomap->offset = ALIGN_DOWN(offset, sb->s_blocksize);
-       iomap->length = ALIGN(offset + length, sb->s_blocksize) - iomap->offset;
-       iomap->bdev = inode->i_sb->s_bdev;
-       iomap->addr = (zi->i_zsector << SECTOR_SHIFT) + iomap->offset;
-
        trace_zonefs_iomap_begin(inode, iomap);
 
        return 0;
 }
 
-static const struct iomap_ops zonefs_iomap_ops = {
-       .iomap_begin    = zonefs_iomap_begin,
+static const struct iomap_ops zonefs_write_iomap_ops = {
+       .iomap_begin    = zonefs_write_iomap_begin,
 };
 
 static int zonefs_read_folio(struct file *unused, struct folio *folio)
 {
-       return iomap_read_folio(folio, &zonefs_iomap_ops);
+       return iomap_read_folio(folio, &zonefs_read_iomap_ops);
 }
 
 static void zonefs_readahead(struct readahead_control *rac)
 {
-       iomap_readahead(rac, &zonefs_iomap_ops);
+       iomap_readahead(rac, &zonefs_read_iomap_ops);
 }
 
 /*
  * Map blocks for page writeback. This is used only on conventional zone files,
  * which implies that the page range can only be within the fixed inode size.
  */
-static int zonefs_map_blocks(struct iomap_writepage_ctx *wpc,
-                            struct inode *inode, loff_t offset)
+static int zonefs_write_map_blocks(struct iomap_writepage_ctx *wpc,
+                                  struct inode *inode, loff_t offset)
 {
        struct zonefs_inode_info *zi = ZONEFS_I(inode);
 
@@ -191,12 +224,12 @@ static int zonefs_map_blocks(struct iomap_writepage_ctx *wpc,
            offset < wpc->iomap.offset + wpc->iomap.length)
                return 0;
 
-       return zonefs_iomap_begin(inode, offset, zi->i_max_size - offset,
-                                 IOMAP_WRITE, &wpc->iomap, NULL);
+       return zonefs_write_iomap_begin(inode, offset, zi->i_max_size - offset,
+                                       IOMAP_WRITE, &wpc->iomap, NULL);
 }
 
 static const struct iomap_writeback_ops zonefs_writeback_ops = {
-       .map_blocks             = zonefs_map_blocks,
+       .map_blocks             = zonefs_write_map_blocks,
 };
 
 static int zonefs_writepage(struct page *page, struct writeback_control *wbc)
@@ -226,7 +259,8 @@ static int zonefs_swap_activate(struct swap_info_struct *sis,
                return -EINVAL;
        }
 
-       return iomap_swapfile_activate(sis, swap_file, span, &zonefs_iomap_ops);
+       return iomap_swapfile_activate(sis, swap_file, span,
+                                      &zonefs_read_iomap_ops);
 }
 
 static const struct address_space_operations zonefs_file_aops = {
@@ -647,7 +681,7 @@ static vm_fault_t zonefs_filemap_page_mkwrite(struct vm_fault *vmf)
 
        /* Serialize against truncates */
        filemap_invalidate_lock_shared(inode->i_mapping);
-       ret = iomap_page_mkwrite(vmf, &zonefs_iomap_ops);
+       ret = iomap_page_mkwrite(vmf, &zonefs_write_iomap_ops);
        filemap_invalidate_unlock_shared(inode->i_mapping);
 
        sb_end_pagefault(inode->i_sb);
@@ -899,7 +933,7 @@ static ssize_t zonefs_file_dio_write(struct kiocb *iocb, struct iov_iter *from)
        if (append)
                ret = zonefs_file_dio_append(iocb, from);
        else
-               ret = iomap_dio_rw(iocb, from, &zonefs_iomap_ops,
+               ret = iomap_dio_rw(iocb, from, &zonefs_write_iomap_ops,
                                   &zonefs_write_dio_ops, 0, NULL, 0);
        if (zi->i_ztype == ZONEFS_ZTYPE_SEQ &&
            (ret > 0 || ret == -EIOCBQUEUED)) {
@@ -948,7 +982,7 @@ static ssize_t zonefs_file_buffered_write(struct kiocb *iocb,
        if (ret <= 0)
                goto inode_unlock;
 
-       ret = iomap_file_buffered_write(iocb, from, &zonefs_iomap_ops);
+       ret = iomap_file_buffered_write(iocb, from, &zonefs_write_iomap_ops);
        if (ret > 0)
                iocb->ki_pos += ret;
        else if (ret == -EIO)
@@ -1041,7 +1075,7 @@ static ssize_t zonefs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
                        goto inode_unlock;
                }
                file_accessed(iocb->ki_filp);
-               ret = iomap_dio_rw(iocb, to, &zonefs_iomap_ops,
+               ret = iomap_dio_rw(iocb, to, &zonefs_read_iomap_ops,
                                   &zonefs_read_dio_ops, 0, NULL, 0);
        } else {
                ret = generic_file_read_iter(iocb, to);
@@ -1085,7 +1119,8 @@ static int zonefs_seq_file_write_open(struct inode *inode)
 
                if (sbi->s_mount_opts & ZONEFS_MNTOPT_EXPLICIT_OPEN) {
 
-                       if (wro > sbi->s_max_wro_seq_files) {
+                       if (sbi->s_max_wro_seq_files
+                           && wro > sbi->s_max_wro_seq_files) {
                                atomic_dec(&sbi->s_wro_seq_files);
                                ret = -EBUSY;
                                goto unlock;
@@ -1760,12 +1795,6 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent)
 
        atomic_set(&sbi->s_wro_seq_files, 0);
        sbi->s_max_wro_seq_files = bdev_max_open_zones(sb->s_bdev);
-       if (!sbi->s_max_wro_seq_files &&
-           sbi->s_mount_opts & ZONEFS_MNTOPT_EXPLICIT_OPEN) {
-               zonefs_info(sb, "No open zones limit. Ignoring explicit_open mount option\n");
-               sbi->s_mount_opts &= ~ZONEFS_MNTOPT_EXPLICIT_OPEN;
-       }
-
        atomic_set(&sbi->s_active_seq_files, 0);
        sbi->s_max_active_seq_files = bdev_max_active_zones(sb->s_bdev);
 
@@ -1790,6 +1819,14 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent)
        zonefs_info(sb, "Mounting %u zones",
                    blkdev_nr_zones(sb->s_bdev->bd_disk));
 
+       if (!sbi->s_max_wro_seq_files &&
+           !sbi->s_max_active_seq_files &&
+           sbi->s_mount_opts & ZONEFS_MNTOPT_EXPLICIT_OPEN) {
+               zonefs_info(sb,
+                       "No open and active zone limits. Ignoring explicit_open mount option\n");
+               sbi->s_mount_opts &= ~ZONEFS_MNTOPT_EXPLICIT_OPEN;
+       }
+
        /* Create root directory inode */
        ret = -ENOMEM;
        inode = new_inode(sb);
index 302506b..8e47d48 100644 (file)
@@ -44,6 +44,7 @@ mandatory-y += msi.h
 mandatory-y += pci.h
 mandatory-y += percpu.h
 mandatory-y += pgalloc.h
+mandatory-y += platform-feature.h
 mandatory-y += preempt.h
 mandatory-y += rwonce.h
 mandatory-y += sections.h
diff --git a/include/asm-generic/platform-feature.h b/include/asm-generic/platform-feature.h
new file mode 100644 (file)
index 0000000..4b0af3d
--- /dev/null
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_GENERIC_PLATFORM_FEATURE_H
+#define _ASM_GENERIC_PLATFORM_FEATURE_H
+
+/* Number of arch specific feature flags. */
+#define PLATFORM_ARCH_FEAT_N   0
+
+#endif /* _ASM_GENERIC_PLATFORM_FEATURE_H */
index 0777725..10b1990 100644 (file)
@@ -1022,6 +1022,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
        for ((__i) = 0; \
             (__i) < (__state)->num_private_objs && \
                     ((obj) = (__state)->private_objs[__i].ptr, \
+                     (void)(obj) /* Only to avoid unused-but-set-variable warning */, \
                      (new_obj_state) = (__state)->private_objs[__i].new_state, 1); \
             (__i)++)
 
index 4416536..ca89a48 100644 (file)
@@ -311,12 +311,12 @@ ttm_resource_manager_cleanup(struct ttm_resource_manager *man)
 }
 
 void ttm_lru_bulk_move_init(struct ttm_lru_bulk_move *bulk);
-void ttm_lru_bulk_move_add(struct ttm_lru_bulk_move *bulk,
-                          struct ttm_resource *res);
-void ttm_lru_bulk_move_del(struct ttm_lru_bulk_move *bulk,
-                          struct ttm_resource *res);
 void ttm_lru_bulk_move_tail(struct ttm_lru_bulk_move *bulk);
 
+void ttm_resource_add_bulk_move(struct ttm_resource *res,
+                               struct ttm_buffer_object *bo);
+void ttm_resource_del_bulk_move(struct ttm_resource *res,
+                               struct ttm_buffer_object *bo);
 void ttm_resource_move_to_lru_tail(struct ttm_resource *res);
 
 void ttm_resource_init(struct ttm_buffer_object *bo,
index 1f87016..8256e74 100644 (file)
 #define CLK_GOUT_PERI_USI0             43
 #define CLK_GOUT_PERI_USI1             44
 #define CLK_GOUT_PERI_USI2             45
-#define TOP_NR_CLK                     46
+#define CLK_MOUT_FSYS_BUS              46
+#define CLK_MOUT_FSYS_MMC_CARD         47
+#define CLK_MOUT_FSYS_MMC_EMBD         48
+#define CLK_MOUT_FSYS_MMC_SDIO         49
+#define CLK_MOUT_FSYS_USB30DRD         50
+#define CLK_DOUT_FSYS_BUS              51
+#define CLK_DOUT_FSYS_MMC_CARD         52
+#define CLK_DOUT_FSYS_MMC_EMBD         53
+#define CLK_DOUT_FSYS_MMC_SDIO         54
+#define CLK_DOUT_FSYS_USB30DRD         55
+#define CLK_GOUT_FSYS_BUS              56
+#define CLK_GOUT_FSYS_MMC_CARD         57
+#define CLK_GOUT_FSYS_MMC_EMBD         58
+#define CLK_GOUT_FSYS_MMC_SDIO         59
+#define CLK_GOUT_FSYS_USB30DRD         60
+#define TOP_NR_CLK                     61
 
 /* CMU_CORE */
-#define CLK_MOUT_CORE_BUS_USER         1
-#define CLK_MOUT_CORE_CCI_USER         2
-#define CLK_MOUT_CORE_G3D_USER         3
-#define CLK_MOUT_CORE_GIC              4
-#define CLK_DOUT_CORE_BUSP             5
-#define CLK_GOUT_CCI_ACLK              6
-#define CLK_GOUT_GIC400_CLK            7
-#define CORE_NR_CLK                    8
+#define CLK_MOUT_CORE_BUS_USER                 1
+#define CLK_MOUT_CORE_CCI_USER                 2
+#define CLK_MOUT_CORE_G3D_USER                 3
+#define CLK_MOUT_CORE_GIC                      4
+#define CLK_DOUT_CORE_BUSP                     5
+#define CLK_GOUT_CCI_ACLK                      6
+#define CLK_GOUT_GIC400_CLK                    7
+#define CLK_GOUT_TREX_D_CORE_ACLK              8
+#define CLK_GOUT_TREX_D_CORE_GCLK              9
+#define CLK_GOUT_TREX_D_CORE_PCLK              10
+#define CLK_GOUT_TREX_P_CORE_ACLK_P_CORE       11
+#define CLK_GOUT_TREX_P_CORE_CCLK_P_CORE       12
+#define CLK_GOUT_TREX_P_CORE_PCLK              13
+#define CLK_GOUT_TREX_P_CORE_PCLK_P_CORE       14
+#define CORE_NR_CLK                            15
 
 /* CMU_PERI */
 #define CLK_MOUT_PERI_BUS_USER         1
 #define CLK_GOUT_WDT1_PCLK             43
 #define PERI_NR_CLK                    44
 
+/* CMU_FSYS */
+#define CLK_MOUT_FSYS_BUS_USER         1
+#define CLK_MOUT_FSYS_MMC_CARD_USER    2
+#define CLK_MOUT_FSYS_MMC_EMBD_USER    3
+#define CLK_MOUT_FSYS_MMC_SDIO_USER    4
+#define CLK_MOUT_FSYS_USB30DRD_USER    4
+#define CLK_GOUT_MMC_CARD_ACLK         5
+#define CLK_GOUT_MMC_CARD_SDCLKIN      6
+#define CLK_GOUT_MMC_EMBD_ACLK         7
+#define CLK_GOUT_MMC_EMBD_SDCLKIN      8
+#define CLK_GOUT_MMC_SDIO_ACLK         9
+#define CLK_GOUT_MMC_SDIO_SDCLKIN      10
+#define FSYS_NR_CLK                    11
+
 #endif /* _DT_BINDINGS_CLOCK_EXYNOS_7885_H */
diff --git a/include/dt-bindings/clock/qcom,dispcc-sm8350.h b/include/dt-bindings/clock/qcom,dispcc-sm8350.h
new file mode 120000 (symlink)
index 0000000..0312b45
--- /dev/null
@@ -0,0 +1 @@
+qcom,dispcc-sm8250.h
\ No newline at end of file
index 8e2bec1..55f8322 100644 (file)
 #define GCC_PCIE1_AXI_MASTER_STICKY_ARES       130
 #define GCC_PCIE0_AXI_SLAVE_STICKY_ARES                131
 
+#define USB0_GDSC                              0
+#define USB1_GDSC                              1
+
 #endif
diff --git a/include/dt-bindings/clock/qcom,gpucc-sm8350.h b/include/dt-bindings/clock/qcom,gpucc-sm8350.h
new file mode 100644 (file)
index 0000000..2ca857f
--- /dev/null
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2022, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8350_H
+#define _DT_BINDINGS_CLK_QCOM_GPU_CC_SM8350_H
+
+/* GPU_CC clocks */
+#define GPU_CC_AHB_CLK                 0
+#define GPU_CC_CB_CLK                  1
+#define GPU_CC_CRC_AHB_CLK             2
+#define GPU_CC_CX_APB_CLK              3
+#define GPU_CC_CX_GMU_CLK              4
+#define GPU_CC_CX_QDSS_AT_CLK          5
+#define GPU_CC_CX_QDSS_TRIG_CLK                6
+#define GPU_CC_CX_QDSS_TSCTR_CLK       7
+#define GPU_CC_CX_SNOC_DVM_CLK         8
+#define GPU_CC_CXO_AON_CLK             9
+#define GPU_CC_CXO_CLK                 10
+#define GPU_CC_FREQ_MEASURE_CLK                11
+#define GPU_CC_GMU_CLK_SRC             12
+#define GPU_CC_GX_GMU_CLK              13
+#define GPU_CC_GX_QDSS_TSCTR_CLK       14
+#define GPU_CC_GX_VSENSE_CLK           15
+#define GPU_CC_HLOS1_VOTE_GPU_SMMU_CLK 16
+#define GPU_CC_HUB_AHB_DIV_CLK_SRC     17
+#define GPU_CC_HUB_AON_CLK             18
+#define GPU_CC_HUB_CLK_SRC             19
+#define GPU_CC_HUB_CX_INT_CLK          20
+#define GPU_CC_HUB_CX_INT_DIV_CLK_SRC  21
+#define GPU_CC_MND1X_0_GFX3D_CLK       22
+#define GPU_CC_MND1X_1_GFX3D_CLK       23
+#define GPU_CC_PLL0                    24
+#define GPU_CC_PLL1                    25
+#define GPU_CC_SLEEP_CLK               26
+
+/* GPU_CC resets */
+#define GPUCC_GPU_CC_ACD_BCR           0
+#define GPUCC_GPU_CC_CB_BCR            1
+#define GPUCC_GPU_CC_CX_BCR            2
+#define GPUCC_GPU_CC_FAST_HUB_BCR      3
+#define GPUCC_GPU_CC_GFX3D_AON_BCR     4
+#define GPUCC_GPU_CC_GMU_BCR           5
+#define GPUCC_GPU_CC_GX_BCR            6
+#define GPUCC_GPU_CC_XO_BCR            7
+
+/* GPU_CC GDSCRs */
+#define GPU_CX_GDSC                    0
+#define GPU_GX_GDSC                    1
+
+#endif
diff --git a/include/dt-bindings/clock/qcom,sm8450-camcc.h b/include/dt-bindings/clock/qcom,sm8450-camcc.h
new file mode 100644 (file)
index 0000000..7ff67ac
--- /dev/null
@@ -0,0 +1,159 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_CAM_CC_SM8450_H
+#define _DT_BINDINGS_CLK_QCOM_CAM_CC_SM8450_H
+
+/* CAM_CC clocks */
+#define CAM_CC_BPS_AHB_CLK                                     0
+#define CAM_CC_BPS_CLK                                         1
+#define CAM_CC_BPS_CLK_SRC                                     2
+#define CAM_CC_BPS_FAST_AHB_CLK                                        3
+#define CAM_CC_CAMNOC_AXI_CLK                                  4
+#define CAM_CC_CAMNOC_AXI_CLK_SRC                              5
+#define CAM_CC_CAMNOC_DCD_XO_CLK                               6
+#define CAM_CC_CCI_0_CLK                                       7
+#define CAM_CC_CCI_0_CLK_SRC                                   8
+#define CAM_CC_CCI_1_CLK                                       9
+#define CAM_CC_CCI_1_CLK_SRC                                   10
+#define CAM_CC_CORE_AHB_CLK                                    11
+#define CAM_CC_CPAS_AHB_CLK                                    12
+#define CAM_CC_CPAS_BPS_CLK                                    13
+#define CAM_CC_CPAS_FAST_AHB_CLK                               14
+#define CAM_CC_CPAS_IFE_0_CLK                                  15
+#define CAM_CC_CPAS_IFE_1_CLK                                  16
+#define CAM_CC_CPAS_IFE_2_CLK                                  17
+#define CAM_CC_CPAS_IFE_LITE_CLK                               18
+#define CAM_CC_CPAS_IPE_NPS_CLK                                        19
+#define CAM_CC_CPAS_SBI_CLK                                    20
+#define CAM_CC_CPAS_SFE_0_CLK                                  21
+#define CAM_CC_CPAS_SFE_1_CLK                                  22
+#define CAM_CC_CPHY_RX_CLK_SRC                                 23
+#define CAM_CC_CSI0PHYTIMER_CLK                                        24
+#define CAM_CC_CSI0PHYTIMER_CLK_SRC                            25
+#define CAM_CC_CSI1PHYTIMER_CLK                                        26
+#define CAM_CC_CSI1PHYTIMER_CLK_SRC                            27
+#define CAM_CC_CSI2PHYTIMER_CLK                                        28
+#define CAM_CC_CSI2PHYTIMER_CLK_SRC                            29
+#define CAM_CC_CSI3PHYTIMER_CLK                                        30
+#define CAM_CC_CSI3PHYTIMER_CLK_SRC                            31
+#define CAM_CC_CSI4PHYTIMER_CLK                                        32
+#define CAM_CC_CSI4PHYTIMER_CLK_SRC                            33
+#define CAM_CC_CSI5PHYTIMER_CLK                                        34
+#define CAM_CC_CSI5PHYTIMER_CLK_SRC                            35
+#define CAM_CC_CSID_CLK                                                36
+#define CAM_CC_CSID_CLK_SRC                                    37
+#define CAM_CC_CSID_CSIPHY_RX_CLK                              38
+#define CAM_CC_CSIPHY0_CLK                                     39
+#define CAM_CC_CSIPHY1_CLK                                     40
+#define CAM_CC_CSIPHY2_CLK                                     41
+#define CAM_CC_CSIPHY3_CLK                                     42
+#define CAM_CC_CSIPHY4_CLK                                     43
+#define CAM_CC_CSIPHY5_CLK                                     44
+#define CAM_CC_FAST_AHB_CLK_SRC                                        45
+#define CAM_CC_GDSC_CLK                                                46
+#define CAM_CC_ICP_AHB_CLK                                     47
+#define CAM_CC_ICP_CLK                                         48
+#define CAM_CC_ICP_CLK_SRC                                     49
+#define CAM_CC_IFE_0_CLK                                       50
+#define CAM_CC_IFE_0_CLK_SRC                                   51
+#define CAM_CC_IFE_0_DSP_CLK                                   52
+#define CAM_CC_IFE_0_FAST_AHB_CLK                              53
+#define CAM_CC_IFE_1_CLK                                       54
+#define CAM_CC_IFE_1_CLK_SRC                                   55
+#define CAM_CC_IFE_1_DSP_CLK                                   56
+#define CAM_CC_IFE_1_FAST_AHB_CLK                              57
+#define CAM_CC_IFE_2_CLK                                       58
+#define CAM_CC_IFE_2_CLK_SRC                                   59
+#define CAM_CC_IFE_2_DSP_CLK                                   60
+#define CAM_CC_IFE_2_FAST_AHB_CLK                              61
+#define CAM_CC_IFE_LITE_AHB_CLK                                        62
+#define CAM_CC_IFE_LITE_CLK                                    63
+#define CAM_CC_IFE_LITE_CLK_SRC                                        64
+#define CAM_CC_IFE_LITE_CPHY_RX_CLK                            65
+#define CAM_CC_IFE_LITE_CSID_CLK                               66
+#define CAM_CC_IFE_LITE_CSID_CLK_SRC                           67
+#define CAM_CC_IPE_NPS_AHB_CLK                                 68
+#define CAM_CC_IPE_NPS_CLK                                     69
+#define CAM_CC_IPE_NPS_CLK_SRC                                 70
+#define CAM_CC_IPE_NPS_FAST_AHB_CLK                            71
+#define CAM_CC_IPE_PPS_CLK                                     72
+#define CAM_CC_IPE_PPS_FAST_AHB_CLK                            73
+#define CAM_CC_JPEG_CLK                                                74
+#define CAM_CC_JPEG_CLK_SRC                                    75
+#define CAM_CC_MCLK0_CLK                                       76
+#define CAM_CC_MCLK0_CLK_SRC                                   77
+#define CAM_CC_MCLK1_CLK                                       78
+#define CAM_CC_MCLK1_CLK_SRC                                   79
+#define CAM_CC_MCLK2_CLK                                       80
+#define CAM_CC_MCLK2_CLK_SRC                                   81
+#define CAM_CC_MCLK3_CLK                                       82
+#define CAM_CC_MCLK3_CLK_SRC                                   83
+#define CAM_CC_MCLK4_CLK                                       84
+#define CAM_CC_MCLK4_CLK_SRC                                   85
+#define CAM_CC_MCLK5_CLK                                       86
+#define CAM_CC_MCLK5_CLK_SRC                                   87
+#define CAM_CC_MCLK6_CLK                                       88
+#define CAM_CC_MCLK6_CLK_SRC                                   89
+#define CAM_CC_MCLK7_CLK                                       90
+#define CAM_CC_MCLK7_CLK_SRC                                   91
+#define CAM_CC_PLL0                                            92
+#define CAM_CC_PLL0_OUT_EVEN                                   93
+#define CAM_CC_PLL0_OUT_ODD                                    94
+#define CAM_CC_PLL1                                            95
+#define CAM_CC_PLL1_OUT_EVEN                                   96
+#define CAM_CC_PLL2                                            97
+#define CAM_CC_PLL3                                            98
+#define CAM_CC_PLL3_OUT_EVEN                                   99
+#define CAM_CC_PLL4                                            100
+#define CAM_CC_PLL4_OUT_EVEN                                   101
+#define CAM_CC_PLL5                                            102
+#define CAM_CC_PLL5_OUT_EVEN                                   103
+#define CAM_CC_PLL6                                            104
+#define CAM_CC_PLL6_OUT_EVEN                                   105
+#define CAM_CC_PLL7                                            106
+#define CAM_CC_PLL7_OUT_EVEN                                   107
+#define CAM_CC_PLL8                                            108
+#define CAM_CC_PLL8_OUT_EVEN                                   109
+#define CAM_CC_QDSS_DEBUG_CLK                                  110
+#define CAM_CC_QDSS_DEBUG_CLK_SRC                              111
+#define CAM_CC_QDSS_DEBUG_XO_CLK                               112
+#define CAM_CC_SBI_AHB_CLK                                     113
+#define CAM_CC_SBI_CLK                                         114
+#define CAM_CC_SFE_0_CLK                                       115
+#define CAM_CC_SFE_0_CLK_SRC                                   116
+#define CAM_CC_SFE_0_FAST_AHB_CLK                              117
+#define CAM_CC_SFE_1_CLK                                       118
+#define CAM_CC_SFE_1_CLK_SRC                                   119
+#define CAM_CC_SFE_1_FAST_AHB_CLK                              120
+#define CAM_CC_SLEEP_CLK                                       121
+#define CAM_CC_SLEEP_CLK_SRC                                   122
+#define CAM_CC_SLOW_AHB_CLK_SRC                                        123
+#define CAM_CC_XO_CLK_SRC                                      124
+
+/* CAM_CC resets */
+#define CAM_CC_BPS_BCR                                         0
+#define CAM_CC_ICP_BCR                                         1
+#define CAM_CC_IFE_0_BCR                                       2
+#define CAM_CC_IFE_1_BCR                                       3
+#define CAM_CC_IFE_2_BCR                                       4
+#define CAM_CC_IPE_0_BCR                                       5
+#define CAM_CC_QDSS_DEBUG_BCR                                  6
+#define CAM_CC_SBI_BCR                                         7
+#define CAM_CC_SFE_0_BCR                                       8
+#define CAM_CC_SFE_1_BCR                                       9
+
+/* CAM_CC GDSCRs */
+#define BPS_GDSC               0
+#define IPE_0_GDSC             1
+#define SBI_GDSC               2
+#define IFE_0_GDSC             3
+#define IFE_1_GDSC             4
+#define IFE_2_GDSC             5
+#define SFE_0_GDSC             6
+#define SFE_1_GDSC             7
+#define TITAN_TOP_GDSC         8
+
+#endif
index bd4c308..173364a 100644 (file)
@@ -38,6 +38,8 @@
  * throughput and memory controller power.
  */
 #define TEGRA234_CLK_EMC                       31U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_HOST1X */
+#define TEGRA234_CLK_HOST1X                     46U
 /** @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_UARTA                     155U
 /** @brief output of gate CLK_ENB_PEX1_CORE_6 */
 #define TEGRA234_CLK_PEX1_C6_CORE              161U
+/** @brief output of mux controlled by CLK_RST_CONTROLLER_CLK_SOURCE_VIC */
+#define TEGRA234_CLK_VIC                        167U
 /** @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_PEX1_C5_CORE              225U
 /** @brief PLL controlled by CLK_RST_CONTROLLER_PLLC4_BASE */
 #define TEGRA234_CLK_PLLC4                     237U
+/** @brief RX clock recovered from MGBE0 lane input */
+#define TEGRA234_CLK_MGBE0_RX_INPUT            248U
+/** @brief RX clock recovered from MGBE1 lane input */
+#define TEGRA234_CLK_MGBE1_RX_INPUT            249U
+/** @brief RX clock recovered from MGBE2 lane input */
+#define TEGRA234_CLK_MGBE2_RX_INPUT            250U
+/** @brief RX clock recovered from MGBE3 lane input */
+#define TEGRA234_CLK_MGBE3_RX_INPUT            251U
 /** @brief 32K input clock provided by PMIC */
 #define TEGRA234_CLK_CLK_32K                   289U
+/** @brief Monitored branch of MBGE0 RX input clock */
+#define TEGRA234_CLK_MGBE0_RX_INPUT_M          357U
+/** @brief Monitored branch of MBGE1 RX input clock */
+#define TEGRA234_CLK_MGBE1_RX_INPUT_M          358U
+/** @brief Monitored branch of MBGE2 RX input clock */
+#define TEGRA234_CLK_MGBE2_RX_INPUT_M          359U
+/** @brief Monitored branch of MBGE3 RX input clock */
+#define TEGRA234_CLK_MGBE3_RX_INPUT_M          360U
+/** @brief Monitored branch of MGBE0 RX PCS mux output */
+#define TEGRA234_CLK_MGBE0_RX_PCS_M            361U
+/** @brief Monitored branch of MGBE1 RX PCS mux output */
+#define TEGRA234_CLK_MGBE1_RX_PCS_M            362U
+/** @brief Monitored branch of MGBE2 RX PCS mux output */
+#define TEGRA234_CLK_MGBE2_RX_PCS_M            363U
+/** @brief Monitored branch of MGBE3 RX PCS mux output */
+#define TEGRA234_CLK_MGBE3_RX_PCS_M            364U
+/** @brief RX PCS clock recovered from MGBE0 lane input */
+#define TEGRA234_CLK_MGBE0_RX_PCS_INPUT                369U
+/** @brief RX PCS clock recovered from MGBE1 lane input */
+#define TEGRA234_CLK_MGBE1_RX_PCS_INPUT                370U
+/** @brief RX PCS clock recovered from MGBE2 lane input */
+#define TEGRA234_CLK_MGBE2_RX_PCS_INPUT                371U
+/** @brief RX PCS clock recovered from MGBE3 lane input */
+#define TEGRA234_CLK_MGBE3_RX_PCS_INPUT                372U
+/** @brief output of mux controlled by GBE_UPHY_MGBE0_RX_PCS_CLK_SRC_SEL */
+#define TEGRA234_CLK_MGBE0_RX_PCS              373U
+/** @brief GBE_UPHY_MGBE0_TX_CLK divider gated output */
+#define TEGRA234_CLK_MGBE0_TX                  374U
+/** @brief GBE_UPHY_MGBE0_TX_PCS_CLK divider gated output */
+#define TEGRA234_CLK_MGBE0_TX_PCS              375U
+/** @brief GBE_UPHY_MGBE0_MAC_CLK divider output */
+#define TEGRA234_CLK_MGBE0_MAC_DIVIDER         376U
+/** @brief GBE_UPHY_MGBE0_MAC_CLK gate output */
+#define TEGRA234_CLK_MGBE0_MAC                 377U
+/** @brief GBE_UPHY_MGBE0_MACSEC_CLK gate output */
+#define TEGRA234_CLK_MGBE0_MACSEC              378U
+/** @brief GBE_UPHY_MGBE0_EEE_PCS_CLK gate output */
+#define TEGRA234_CLK_MGBE0_EEE_PCS             379U
+/** @brief GBE_UPHY_MGBE0_APP_CLK gate output */
+#define TEGRA234_CLK_MGBE0_APP                 380U
+/** @brief GBE_UPHY_MGBE0_PTP_REF_CLK divider gated output */
+#define TEGRA234_CLK_MGBE0_PTP_REF             381U
+/** @brief output of mux controlled by GBE_UPHY_MGBE1_RX_PCS_CLK_SRC_SEL */
+#define TEGRA234_CLK_MGBE1_RX_PCS              382U
+/** @brief GBE_UPHY_MGBE1_TX_CLK divider gated output */
+#define TEGRA234_CLK_MGBE1_TX                  383U
+/** @brief GBE_UPHY_MGBE1_TX_PCS_CLK divider gated output */
+#define TEGRA234_CLK_MGBE1_TX_PCS              384U
+/** @brief GBE_UPHY_MGBE1_MAC_CLK divider output */
+#define TEGRA234_CLK_MGBE1_MAC_DIVIDER         385U
+/** @brief GBE_UPHY_MGBE1_MAC_CLK gate output */
+#define TEGRA234_CLK_MGBE1_MAC                 386U
+/** @brief GBE_UPHY_MGBE1_EEE_PCS_CLK gate output */
+#define TEGRA234_CLK_MGBE1_EEE_PCS             388U
+/** @brief GBE_UPHY_MGBE1_APP_CLK gate output */
+#define TEGRA234_CLK_MGBE1_APP                 389U
+/** @brief GBE_UPHY_MGBE1_PTP_REF_CLK divider gated output */
+#define TEGRA234_CLK_MGBE1_PTP_REF             390U
+/** @brief output of mux controlled by GBE_UPHY_MGBE2_RX_PCS_CLK_SRC_SEL */
+#define TEGRA234_CLK_MGBE2_RX_PCS              391U
+/** @brief GBE_UPHY_MGBE2_TX_CLK divider gated output */
+#define TEGRA234_CLK_MGBE2_TX                  392U
+/** @brief GBE_UPHY_MGBE2_TX_PCS_CLK divider gated output */
+#define TEGRA234_CLK_MGBE2_TX_PCS              393U
+/** @brief GBE_UPHY_MGBE2_MAC_CLK divider output */
+#define TEGRA234_CLK_MGBE2_MAC_DIVIDER         394U
+/** @brief GBE_UPHY_MGBE2_MAC_CLK gate output */
+#define TEGRA234_CLK_MGBE2_MAC                 395U
+/** @brief GBE_UPHY_MGBE2_EEE_PCS_CLK gate output */
+#define TEGRA234_CLK_MGBE2_EEE_PCS             397U
+/** @brief GBE_UPHY_MGBE2_APP_CLK gate output */
+#define TEGRA234_CLK_MGBE2_APP                 398U
+/** @brief GBE_UPHY_MGBE2_PTP_REF_CLK divider gated output */
+#define TEGRA234_CLK_MGBE2_PTP_REF             399U
+/** @brief output of mux controlled by GBE_UPHY_MGBE3_RX_PCS_CLK_SRC_SEL */
+#define TEGRA234_CLK_MGBE3_RX_PCS              400U
+/** @brief GBE_UPHY_MGBE3_TX_CLK divider gated output */
+#define TEGRA234_CLK_MGBE3_TX                  401U
+/** @brief GBE_UPHY_MGBE3_TX_PCS_CLK divider gated output */
+#define TEGRA234_CLK_MGBE3_TX_PCS              402U
+/** @brief GBE_UPHY_MGBE3_MAC_CLK divider output */
+#define TEGRA234_CLK_MGBE3_MAC_DIVIDER         403U
+/** @brief GBE_UPHY_MGBE3_MAC_CLK gate output */
+#define TEGRA234_CLK_MGBE3_MAC                 404U
+/** @brief GBE_UPHY_MGBE3_MACSEC_CLK gate output */
+#define TEGRA234_CLK_MGBE3_MACSEC              405U
+/** @brief GBE_UPHY_MGBE3_EEE_PCS_CLK gate output */
+#define TEGRA234_CLK_MGBE3_EEE_PCS             406U
+/** @brief GBE_UPHY_MGBE3_APP_CLK gate output */
+#define TEGRA234_CLK_MGBE3_APP                 407U
+/** @brief GBE_UPHY_MGBE3_PTP_REF_CLK divider gated output */
+#define TEGRA234_CLK_MGBE3_PTP_REF             408U
 /** @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 9296d0b..fbfa3fe 100644 (file)
@@ -30,6 +30,7 @@
 #define IPCC_CLIENT_PCIE1              14
 #define IPCC_CLIENT_PCIE2              15
 #define IPCC_CLIENT_SPSS               16
+#define IPCC_CLIENT_NSP1               18
 #define IPCC_CLIENT_TME                        23
 #define IPCC_CLIENT_WPSS               24
 
index e3b0e9d..62987b4 100644 (file)
 /* NISO0 stream IDs */
 #define TEGRA234_SID_APE       0x02
 #define TEGRA234_SID_HDA       0x03
+#define TEGRA234_SID_GPCDMA    0x04
+#define TEGRA234_SID_MGBE      0x06
 #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
+#define TEGRA234_SID_MGBE_VF1  0x49
+#define TEGRA234_SID_MGBE_VF2  0x4a
+#define TEGRA234_SID_MGBE_VF3  0x4b
 
 /* NISO1 stream IDs */
 #define TEGRA234_SID_SDMMC4    0x02
@@ -26,6 +31,8 @@
 #define TEGRA234_SID_PCIE8     0x09
 #define TEGRA234_SID_PCIE10    0x0b
 #define TEGRA234_SID_BPMP      0x10
+#define TEGRA234_SID_HOST1X    0x27
+#define TEGRA234_SID_VIC       0x34
 
 /*
  * memory client IDs
@@ -33,6 +40,7 @@
 
 /* High-definition audio (HDA) read clients */
 #define TEGRA234_MEMORY_CLIENT_HDAR 0x15
+#define TEGRA234_MEMORY_CLIENT_HOST1XDMAR 0x16
 /* PCIE6 read clients */
 #define TEGRA234_MEMORY_CLIENT_PCIE6AR 0x28
 /* PCIE6 write clients */
 #define TEGRA234_MEMORY_CLIENT_PCIE10AR1 0x48
 /* PCIE7r1 read clients */
 #define TEGRA234_MEMORY_CLIENT_PCIE7AR1 0x49
+/* MGBE0 read client */
+#define TEGRA234_MEMORY_CLIENT_MGBEARD 0x58
+/* MGBEB read client */
+#define TEGRA234_MEMORY_CLIENT_MGBEBRD 0x59
+/* MGBEC read client */
+#define TEGRA234_MEMORY_CLIENT_MGBECRD 0x5a
+/* MGBED read client */
+#define TEGRA234_MEMORY_CLIENT_MGBEDRD 0x5b
+/* MGBE0 write client */
+#define TEGRA234_MEMORY_CLIENT_MGBEAWR 0x5c
+/* MGBEB write client */
+#define TEGRA234_MEMORY_CLIENT_MGBEBWR 0x5f
+/* MGBEC write client */
+#define TEGRA234_MEMORY_CLIENT_MGBECWR 0x61
 /* sdmmcd memory read client */
 #define TEGRA234_MEMORY_CLIENT_SDMMCRAB 0x63
+/* MGBED write client */
+#define TEGRA234_MEMORY_CLIENT_MGBEDWR 0x65
 /* sdmmcd memory write client */
 #define TEGRA234_MEMORY_CLIENT_SDMMCWAB 0x67
+#define TEGRA234_MEMORY_CLIENT_VICSRD 0x6c
+#define TEGRA234_MEMORY_CLIENT_VICSWR 0x6d
 /* BPMP read client */
 #define TEGRA234_MEMORY_CLIENT_BPMPR 0x93
 /* BPMP write client */
diff --git a/include/dt-bindings/net/pcs-rzn1-miic.h b/include/dt-bindings/net/pcs-rzn1-miic.h
new file mode 100644 (file)
index 0000000..784782e
--- /dev/null
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (C) 2022 Schneider-Electric
+ *
+ * Clément Léger <clement.leger@bootlin.com>
+ */
+
+#ifndef _DT_BINDINGS_PCS_RZN1_MIIC
+#define _DT_BINDINGS_PCS_RZN1_MIIC
+
+/*
+ * Reefer to the datasheet [1] section 8.2.1, Internal Connection of Ethernet
+ * Ports to check the available combination
+ *
+ * [1] REN_r01uh0750ej0140-rzn1-introduction_MAT_20210228.pdf
+ */
+
+#define MIIC_GMAC1_PORT                        0
+#define MIIC_GMAC2_PORT                        1
+#define MIIC_RTOS_PORT                 2
+#define MIIC_SERCOS_PORTA              3
+#define MIIC_SERCOS_PORTB              4
+#define MIIC_ETHERCAT_PORTA            5
+#define MIIC_ETHERCAT_PORTB            6
+#define MIIC_ETHERCAT_PORTC            7
+#define MIIC_SWITCH_PORTA              8
+#define MIIC_SWITCH_PORTB              9
+#define MIIC_SWITCH_PORTC              10
+#define MIIC_SWITCH_PORTD              11
+#define MIIC_HSR_PORTA                 12
+#define MIIC_HSR_PORTB                 13
+
+#endif
index f610eee..ae9286c 100644 (file)
@@ -18,5 +18,7 @@
 #define TEGRA234_POWER_DOMAIN_MGBEA    17U
 #define TEGRA234_POWER_DOMAIN_MGBEB    18U
 #define TEGRA234_POWER_DOMAIN_MGBEC    19U
+#define TEGRA234_POWER_DOMAIN_MGBED    20U
+#define TEGRA234_POWER_DOMAIN_VIC      29U
 
 #endif
index 547ca3b..d48d22b 100644 (file)
@@ -15,6 +15,7 @@
 #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_GPCDMA                  18U
 #define TEGRA234_RESET_HDA                     20U
 #define TEGRA234_RESET_HDACODEC                        21U
 #define TEGRA234_RESET_I2C1                    24U
 #define TEGRA234_RESET_I2C7                    33U
 #define TEGRA234_RESET_I2C8                    34U
 #define TEGRA234_RESET_I2C9                    35U
+#define TEGRA234_RESET_MGBE0_PCS               45U
+#define TEGRA234_RESET_MGBE0_MAC               46U
+#define TEGRA234_RESET_MGBE1_PCS               49U
+#define TEGRA234_RESET_MGBE1_MAC               50U
+#define TEGRA234_RESET_MGBE2_PCS               53U
+#define TEGRA234_RESET_MGBE2_MAC               54U
 #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_QSPI0                   76U
 #define TEGRA234_RESET_QSPI1                   77U
 #define TEGRA234_RESET_SDMMC4                  85U
+#define TEGRA234_RESET_MGBE3_PCS               87U
+#define TEGRA234_RESET_MGBE3_MAC               88U
 #define TEGRA234_RESET_UARTA                   100U
+#define TEGRA234_RESET_VIC                      113U
 #define TEGRA234_RESET_PEX0_CORE_0             116U
 #define TEGRA234_RESET_PEX0_CORE_1             117U
 #define TEGRA234_RESET_PEX0_CORE_2             118U
diff --git a/include/dt-bindings/soc/samsung,boot-mode.h b/include/dt-bindings/soc/samsung,boot-mode.h
new file mode 100644 (file)
index 0000000..47ef1cd
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Author: Chanho Park <chanho61.park@samsung.com>
+ *
+ * Device Tree bindings for Samsung Boot Mode.
+ */
+
+#ifndef __DT_BINDINGS_SAMSUNG_BOOT_MODE_H
+#define __DT_BINDINGS_SAMSUNG_BOOT_MODE_H
+
+/* Boot mode definitions for Exynos Auto v9 SoC */
+
+#define EXYNOSAUTOV9_BOOT_FASTBOOT     0xfa
+#define EXYNOSAUTOV9_BOOT_BOOTLOADER   0xfc
+#define EXYNOSAUTOV9_BOOT_RECOVERY     0xff
+
+#endif /* __DT_BINDINGS_SAMSUNG_BOOT_MODE_H */
index 6c5d496..69a13e1 100644 (file)
@@ -84,6 +84,9 @@ extern struct key *find_asymmetric_key(struct key *keyring,
                                       const struct asymmetric_key_id *id_2,
                                       bool partial);
 
+int x509_load_certificate_list(const u8 cert_list[], const unsigned long list_size,
+                              const struct key *keyring);
+
 /*
  * The payload is at the discretion of the subtype.
  */
index 2bd073f..d452071 100644 (file)
@@ -119,6 +119,8 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
 
 extern struct backing_dev_info noop_backing_dev_info;
 
+int bdi_init(struct backing_dev_info *bdi);
+
 /**
  * writeback_in_progress - determine whether there is writeback in progress
  * @wb: bdi_writeback of interest
index 1cf3738..992ee98 100644 (file)
@@ -403,7 +403,6 @@ enum {
 extern int bioset_init(struct bio_set *, unsigned int, unsigned int, int flags);
 extern void bioset_exit(struct bio_set *);
 extern int biovec_init_pool(mempool_t *pool, int pool_entries);
-extern int bioset_init_from_src(struct bio_set *bs, struct bio_set *src);
 
 struct bio *bio_alloc_bioset(struct block_device *bdev, unsigned short nr_vecs,
                             unsigned int opf, gfp_t gfp_mask,
index 608d577..2f7b434 100644 (file)
@@ -342,7 +342,6 @@ static inline int blkdev_zone_mgmt_ioctl(struct block_device *bdev,
  */
 struct blk_independent_access_range {
        struct kobject          kobj;
-       struct request_queue    *queue;
        sector_t                sector;
        sector_t                nr_sectors;
 };
@@ -482,7 +481,6 @@ struct request_queue {
 #endif /* CONFIG_BLK_DEV_ZONED */
 
        int                     node;
-       struct mutex            debugfs_mutex;
 #ifdef CONFIG_BLK_DEV_IO_TRACE
        struct blk_trace __rcu  *blk_trace;
 #endif
@@ -526,11 +524,12 @@ struct request_queue {
        struct bio_set          bio_split;
 
        struct dentry           *debugfs_dir;
-
-#ifdef CONFIG_BLK_DEBUG_FS
        struct dentry           *sched_debugfs_dir;
        struct dentry           *rqos_debugfs_dir;
-#endif
+       /*
+        * Serializes all debugfs metadata operations using the above dentries.
+        */
+       struct mutex            debugfs_mutex;
 
        bool                    mq_sysfs_init_done;
 
@@ -575,6 +574,7 @@ struct request_queue {
 #define QUEUE_FLAG_RQ_ALLOC_TIME 27    /* record rq->alloc_time_ns */
 #define QUEUE_FLAG_HCTX_ACTIVE 28      /* at least one blk-mq hctx is active */
 #define QUEUE_FLAG_NOWAIT       29     /* device supports NOWAIT */
+#define QUEUE_FLAG_SQ_SCHED     30     /* single queue style io dispatch */
 
 #define QUEUE_FLAG_MQ_DEFAULT  ((1 << QUEUE_FLAG_IO_STAT) |            \
                                 (1 << QUEUE_FLAG_SAME_COMP) |          \
@@ -616,6 +616,7 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
 #define blk_queue_pm_only(q)   atomic_read(&(q)->pm_only)
 #define blk_queue_registered(q)        test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
 #define blk_queue_nowait(q)    test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
+#define blk_queue_sq_sched(q)  test_bit(QUEUE_FLAG_SQ_SCHED, &(q)->queue_flags)
 
 extern void blk_set_pm_only(struct request_queue *q);
 extern void blk_clear_pm_only(struct request_queue *q);
@@ -1006,8 +1007,6 @@ void disk_set_independent_access_ranges(struct gendisk *disk,
  */
 /* Supports zoned block devices sequential write constraint */
 #define ELEVATOR_F_ZBD_SEQ_WRITE       (1U << 0)
-/* Supports scheduling on multiple hardware queues */
-#define ELEVATOR_F_MQ_AWARE            (1U << 1)
 
 extern void blk_queue_required_elevator_features(struct request_queue *q,
                                                 unsigned int features);
index 1436530..8c1686e 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <linux/atomic.h>
 #include <linux/types.h>
-#include <linux/mutex.h>
 
 struct vc_data;
 struct console_font_op;
@@ -154,22 +153,6 @@ struct console {
        uint    ospeed;
        u64     seq;
        unsigned long dropped;
-       struct task_struct *thread;
-       bool    blocked;
-
-       /*
-        * The per-console lock is used by printing kthreads to synchronize
-        * this console with callers of console_lock(). This is necessary in
-        * order to allow printing kthreads to run in parallel to each other,
-        * while each safely accessing the @blocked field and synchronizing
-        * against direct printing via console_lock/console_unlock.
-        *
-        * Note: For synchronizing against direct printing via
-        *       console_trylock/console_unlock, see the static global
-        *       variable @console_kthreads_active.
-        */
-       struct mutex lock;
-
        void    *data;
        struct   console *next;
 };
index 54dc2f9..2c74773 100644 (file)
@@ -65,6 +65,9 @@ extern ssize_t cpu_show_tsx_async_abort(struct device *dev,
 extern ssize_t cpu_show_itlb_multihit(struct device *dev,
                                      struct device_attribute *attr, char *buf);
 extern ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr, char *buf);
+extern ssize_t cpu_show_mmio_stale_data(struct device *dev,
+                                       struct device_attribute *attr,
+                                       char *buf);
 
 extern __printf(4, 5)
 struct device *cpu_device_create(struct device *parent, void *drvdata,
index a436705..2f991a4 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Implements the standard CRC ITU-T V.41:
  *   Width 16
- *   Poly  0x1021 (x^16 + x^12 + x^15 + 1)
+ *   Poly  0x1021 (x^16 + x^12 + x^5 + 1)
  *   Init  0
  */
 
index b1e0f1f..54c3c65 100644 (file)
@@ -167,21 +167,24 @@ struct gpio_irq_chip {
         */
        irq_flow_handler_t parent_handler;
 
-       /**
-        * @parent_handler_data:
-        *
-        * If @per_parent_data is false, @parent_handler_data is a single
-        * pointer used as the data associated with every parent interrupt.
-        *
-        * @parent_handler_data_array:
-        *
-        * If @per_parent_data is true, @parent_handler_data_array is
-        * an array of @num_parents pointers, and is used to associate
-        * different data for each parent. This cannot be NULL if
-        * @per_parent_data is true.
-        */
        union {
+               /**
+                * @parent_handler_data:
+                *
+                * If @per_parent_data is false, @parent_handler_data is a
+                * single pointer used as the data associated with every
+                * parent interrupt.
+                */
                void *parent_handler_data;
+
+               /**
+                * @parent_handler_data_array:
+                *
+                * If @per_parent_data is true, @parent_handler_data_array is
+                * an array of @num_parents pointers, and is used to associate
+                * different data for each parent. This cannot be NULL if
+                * @per_parent_data is true.
+                */
                void **parent_handler_data_array;
        };
 
index 732de90..0f2a59c 100644 (file)
@@ -822,7 +822,6 @@ struct ata_port {
        struct ata_queued_cmd   qcmd[ATA_MAX_QUEUE + 1];
        u64                     qc_active;
        int                     nr_active_links; /* #links with active qcs */
-       unsigned int            sas_last_tag;   /* track next tag hw expects */
 
        struct ata_link         link;           /* host default link */
        struct ata_link         *slave_link;    /* see ata_slave_link_init() */
index bc8f326..cf3d0d6 100644 (file)
@@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page)
        if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE)
                return false;
 #endif
-       return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page)));
+       return !is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page));
 }
 #else
 static inline bool is_pinnable_page(struct page *page)
@@ -3232,6 +3232,7 @@ enum mf_flags {
        MF_MUST_KILL = 1 << 2,
        MF_SOFT_OFFLINE = 1 << 3,
        MF_UNPOISON = 1 << 4,
+       MF_SW_SIMULATED = 1 << 5,
 };
 extern int memory_failure(unsigned long pfn, int flags);
 extern void memory_failure_queue(unsigned long pfn, int flags);
index b34ff2c..c29ab4c 100644 (file)
@@ -227,6 +227,7 @@ struct page {
  * struct folio - Represents a contiguous set of bytes.
  * @flags: Identical to the page flags.
  * @lru: Least Recently Used list; tracks how recently this folio was used.
+ * @mlock_count: Number of times this folio has been pinned by mlock().
  * @mapping: The file this page belongs to, or refers to the anon_vma for
  *    anonymous memory.
  * @index: Offset within the file, in units of pages.  For anonymous memory,
@@ -255,10 +256,14 @@ struct folio {
                        unsigned long flags;
                        union {
                                struct list_head lru;
+       /* private: avoid cluttering the output */
                                struct {
                                        void *__filler;
+       /* public: */
                                        unsigned int mlock_count;
+       /* private: */
                                };
+       /* public: */
                        };
                        struct address_space *mapping;
                        pgoff_t index;
index 77fa6a6..1773e5d 100644 (file)
@@ -119,9 +119,10 @@ typedef void (*netfs_io_terminated_t)(void *priv, ssize_t transferred_or_error,
                                      bool was_async);
 
 /*
- * Per-inode description.  This must be directly after the inode struct.
+ * Per-inode context.  This wraps the VFS inode.
  */
-struct netfs_i_context {
+struct netfs_inode {
+       struct inode            inode;          /* The VFS inode */
        const struct netfs_request_ops *ops;
 #if IS_ENABLED(CONFIG_FSCACHE)
        struct fscache_cookie   *cache;
@@ -205,7 +206,9 @@ struct netfs_io_request {
  */
 struct netfs_request_ops {
        int (*init_request)(struct netfs_io_request *rreq, struct file *file);
+       void (*free_request)(struct netfs_io_request *rreq);
        int (*begin_cache_operation)(struct netfs_io_request *rreq);
+
        void (*expand_readahead)(struct netfs_io_request *rreq);
        bool (*clamp_length)(struct netfs_io_subrequest *subreq);
        void (*issue_read)(struct netfs_io_subrequest *subreq);
@@ -213,7 +216,6 @@ struct netfs_request_ops {
        int (*check_write_begin)(struct file *file, loff_t pos, unsigned len,
                                 struct folio *folio, void **_fsdata);
        void (*done)(struct netfs_io_request *rreq);
-       void (*cleanup)(struct address_space *mapping, void *netfs_priv);
 };
 
 /*
@@ -256,7 +258,7 @@ struct netfs_cache_ops {
         * boundary as appropriate.
         */
        enum netfs_io_source (*prepare_read)(struct netfs_io_subrequest *subreq,
-                                              loff_t i_size);
+                                            loff_t i_size);
 
        /* Prepare a write operation, working out what part of the write we can
         * actually do.
@@ -276,7 +278,8 @@ struct netfs_cache_ops {
 struct readahead_control;
 extern void netfs_readahead(struct readahead_control *);
 int netfs_read_folio(struct file *, struct folio *);
-extern int netfs_write_begin(struct file *, struct address_space *,
+extern int netfs_write_begin(struct netfs_inode *,
+                            struct file *, struct address_space *,
                             loff_t, unsigned int, struct folio **,
                             void **);
 
@@ -288,71 +291,56 @@ extern void netfs_put_subrequest(struct netfs_io_subrequest *subreq,
 extern void netfs_stats_show(struct seq_file *);
 
 /**
- * netfs_i_context - Get the netfs inode context from the inode
+ * netfs_inode - Get the netfs inode context from the inode
  * @inode: The inode to query
  *
  * Get the netfs lib inode context from the network filesystem's inode.  The
  * context struct is expected to directly follow on from the VFS inode struct.
  */
-static inline struct netfs_i_context *netfs_i_context(struct inode *inode)
-{
-       return (void *)inode + sizeof(*inode);
-}
-
-/**
- * netfs_inode - Get the netfs inode from the inode context
- * @ctx: The context to query
- *
- * Get the netfs inode from the netfs library's inode context.  The VFS inode
- * is expected to directly precede the context struct.
- */
-static inline struct inode *netfs_inode(struct netfs_i_context *ctx)
+static inline struct netfs_inode *netfs_inode(struct inode *inode)
 {
-       return (void *)ctx - sizeof(struct inode);
+       return container_of(inode, struct netfs_inode, inode);
 }
 
 /**
- * netfs_i_context_init - Initialise a netfs lib context
- * @inode: The inode with which the context is associated
+ * netfs_inode_init - Initialise a netfslib inode context
+ * @ctx: The netfs inode to initialise
  * @ops: The netfs's operations list
  *
  * Initialise the netfs library context struct.  This is expected to follow on
  * directly from the VFS inode struct.
  */
-static inline void netfs_i_context_init(struct inode *inode,
-                                       const struct netfs_request_ops *ops)
+static inline void netfs_inode_init(struct netfs_inode *ctx,
+                                   const struct netfs_request_ops *ops)
 {
-       struct netfs_i_context *ctx = netfs_i_context(inode);
-
-       memset(ctx, 0, sizeof(*ctx));
        ctx->ops = ops;
-       ctx->remote_i_size = i_size_read(inode);
+       ctx->remote_i_size = i_size_read(&ctx->inode);
+#if IS_ENABLED(CONFIG_FSCACHE)
+       ctx->cache = NULL;
+#endif
 }
 
 /**
  * netfs_resize_file - Note that a file got resized
- * @inode: The inode being resized
+ * @ctx: The netfs inode being resized
  * @new_i_size: The new file size
  *
  * Inform the netfs lib that a file got resized so that it can adjust its state.
  */
-static inline void netfs_resize_file(struct inode *inode, loff_t new_i_size)
+static inline void netfs_resize_file(struct netfs_inode *ctx, loff_t new_i_size)
 {
-       struct netfs_i_context *ctx = netfs_i_context(inode);
-
        ctx->remote_i_size = new_i_size;
 }
 
 /**
  * netfs_i_cookie - Get the cache cookie from the inode
- * @inode: The inode to query
+ * @ctx: The netfs inode to query
  *
  * Get the caching cookie (if enabled) from the network filesystem's inode.
  */
-static inline struct fscache_cookie *netfs_i_cookie(struct inode *inode)
+static inline struct fscache_cookie *netfs_i_cookie(struct netfs_inode *ctx)
 {
 #if IS_ENABLED(CONFIG_FSCACHE)
-       struct netfs_i_context *ctx = netfs_i_context(inode);
        return ctx->cache;
 #else
        return NULL;
index 29ec3e3..e393400 100644 (file)
@@ -233,8 +233,8 @@ enum {
 };
 
 enum {
-       NVME_CAP_CRMS_CRIMS     = 1ULL << 59,
-       NVME_CAP_CRMS_CRWMS     = 1ULL << 60,
+       NVME_CAP_CRMS_CRWMS     = 1ULL << 59,
+       NVME_CAP_CRMS_CRIMS     = 1ULL << 60,
 };
 
 struct nvme_id_power_state {
index 6491fa8..15b940e 100644 (file)
@@ -143,6 +143,12 @@ struct unwind_hint {
        .popsection
 .endm
 
+.macro STACK_FRAME_NON_STANDARD_FP func:req
+#ifdef CONFIG_FRAME_POINTER
+       STACK_FRAME_NON_STANDARD \func
+#endif
+.endm
+
 .macro ANNOTATE_NOENDBR
 .Lhere_\@:
        .pushsection .discard.noendbr
diff --git a/include/linux/platform-feature.h b/include/linux/platform-feature.h
new file mode 100644 (file)
index 0000000..b2f48be
--- /dev/null
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _PLATFORM_FEATURE_H
+#define _PLATFORM_FEATURE_H
+
+#include <linux/bitops.h>
+#include <asm/platform-feature.h>
+
+/* The platform features are starting with the architecture specific ones. */
+
+/* Used to enable platform specific DMA handling for virtio devices. */
+#define PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS  (0 + PLATFORM_ARCH_FEAT_N)
+
+#define PLATFORM_FEAT_N                                (1 + PLATFORM_ARCH_FEAT_N)
+
+void platform_set(unsigned int feature);
+void platform_clear(unsigned int feature);
+bool platform_has(unsigned int feature);
+
+#endif /* _PLATFORM_FEATURE_H */
index 10ec29b..cf7d666 100644 (file)
@@ -169,9 +169,6 @@ extern void __printk_safe_exit(void);
 #define printk_deferred_enter __printk_safe_enter
 #define printk_deferred_exit __printk_safe_exit
 
-extern void printk_prefer_direct_enter(void);
-extern void printk_prefer_direct_exit(void);
-
 extern bool pr_flush(int timeout_ms, bool reset_on_progress);
 
 /*
@@ -224,14 +221,6 @@ static inline void printk_deferred_exit(void)
 {
 }
 
-static inline void printk_prefer_direct_enter(void)
-{
-}
-
-static inline void printk_prefer_direct_exit(void)
-{
-}
-
 static inline bool pr_flush(int timeout_ms, bool reset_on_progress)
 {
        return true;
index fae0c84..20e389a 100644 (file)
@@ -13,7 +13,7 @@
 struct notifier_block;
 
 void add_device_randomness(const void *buf, size_t len);
-void add_bootloader_randomness(const void *buf, size_t len);
+void __init add_bootloader_randomness(const void *buf, size_t len);
 void add_input_randomness(unsigned int type, unsigned int code,
                          unsigned int value) __latent_entropy;
 void add_interrupt_randomness(int irq) __latent_entropy;
@@ -74,7 +74,6 @@ static inline unsigned long get_random_canary(void)
 
 int __init random_init(const char *command_line);
 bool rng_is_initialized(void);
-bool rng_has_arch_random(void);
 int wait_for_random_bytes(void);
 
 /* Calls wait_for_random_bytes() and then calls get_random_bytes(buf, nbytes).
index c21c7f8..0022666 100644 (file)
@@ -23,12 +23,16 @@ struct ratelimit_state {
        unsigned long   flags;
 };
 
-#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) {                \
-               .lock           = __RAW_SPIN_LOCK_UNLOCKED(name.lock),  \
-               .interval       = interval_init,                        \
-               .burst          = burst_init,                           \
+#define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \
+               .lock           = __RAW_SPIN_LOCK_UNLOCKED(name.lock),            \
+               .interval       = interval_init,                                  \
+               .burst          = burst_init,                                     \
+               .flags          = flags_init,                                     \
        }
 
+#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) \
+       RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, 0)
+
 #define RATELIMIT_STATE_INIT_DISABLED                                  \
        RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST)
 
index 1c58646..704111f 100644 (file)
@@ -13,8 +13,9 @@
 #include <linux/notifier.h>
 #include <linux/types.h>
 
-#define SCMI_MAX_STR_SIZE      64
-#define SCMI_MAX_NUM_RATES     16
+#define SCMI_MAX_STR_SIZE              64
+#define SCMI_SHORT_NAME_MAX_SIZE       16
+#define SCMI_MAX_NUM_RATES             16
 
 /**
  * struct scmi_revision_info - version information structure
@@ -36,8 +37,8 @@ struct scmi_revision_info {
        u8 num_protocols;
        u8 num_agents;
        u32 impl_ver;
-       char vendor_id[SCMI_MAX_STR_SIZE];
-       char sub_vendor_id[SCMI_MAX_STR_SIZE];
+       char vendor_id[SCMI_SHORT_NAME_MAX_SIZE];
+       char sub_vendor_id[SCMI_SHORT_NAME_MAX_SIZE];
 };
 
 struct scmi_clock_info {
index cbd5070..657a0fc 100644 (file)
@@ -45,6 +45,7 @@ struct uart_ops {
        void            (*unthrottle)(struct uart_port *);
        void            (*send_xchar)(struct uart_port *, char ch);
        void            (*stop_rx)(struct uart_port *);
+       void            (*start_rx)(struct uart_port *);
        void            (*enable_ms)(struct uart_port *);
        void            (*break_ctl)(struct uart_port *, int ctl);
        int             (*startup)(struct uart_port *);
index 4417f66..5860f32 100644 (file)
@@ -243,7 +243,7 @@ extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf,
 extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
 extern int xdr_reserve_space_vec(struct xdr_stream *xdr, struct kvec *vec,
                size_t nbytes);
-extern void xdr_commit_encode(struct xdr_stream *xdr);
+extern void __xdr_commit_encode(struct xdr_stream *xdr);
 extern void xdr_truncate_encode(struct xdr_stream *xdr, size_t len);
 extern int xdr_restrict_buflen(struct xdr_stream *xdr, int newbuflen);
 extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages,
@@ -306,6 +306,20 @@ xdr_reset_scratch_buffer(struct xdr_stream *xdr)
        xdr_set_scratch_buffer(xdr, NULL, 0);
 }
 
+/**
+ * xdr_commit_encode - Ensure all data is written to xdr->buf
+ * @xdr: pointer to xdr_stream
+ *
+ * Handle encoding across page boundaries by giving the caller a
+ * temporary location to write to, then later copying the data into
+ * place. __xdr_commit_encode() does that copying.
+ */
+static inline void xdr_commit_encode(struct xdr_stream *xdr)
+{
+       if (unlikely(xdr->scratch.iov_len))
+               __xdr_commit_encode(xdr);
+}
+
 /**
  * xdr_stream_remaining - Return the number of bytes remaining in the stream
  * @xdr: pointer to struct xdr_stream
index 4700a88..7b4a13d 100644 (file)
@@ -178,7 +178,8 @@ struct vdpa_map_file {
  *                             for the device
  *                             @vdev: vdpa device
  *                             Returns virtqueue algin requirement
- * @get_vq_group:              Get the group id for a specific virtqueue
+ * @get_vq_group:              Get the group id for a specific
+ *                             virtqueue (optional)
  *                             @vdev: vdpa device
  *                             @idx: virtqueue index
  *                             Returns u32: group id for this virtqueue
@@ -243,7 +244,7 @@ struct vdpa_map_file {
  *                             Returns the iova range supported by
  *                             the device.
  * @set_group_asid:            Set address space identifier for a
- *                             virtqueue group
+ *                             virtqueue group (optional)
  *                             @vdev: vdpa device
  *                             @group: virtqueue group
  *                             @asid: address space id for this group
index 9a36051..49c7c32 100644 (file)
@@ -604,13 +604,4 @@ static inline void virtio_cwrite64(struct virtio_device *vdev,
                _r;                                                     \
        })
 
-#ifdef CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS
-int arch_has_restricted_virtio_memory_access(void);
-#else
-static inline int arch_has_restricted_virtio_memory_access(void)
-{
-       return 0;
-}
-#endif /* CONFIG_ARCH_HAS_RESTRICTED_VIRTIO_MEMORY_ACCESS */
-
 #endif /* _LINUX_VIRTIO_CONFIG_H */
diff --git a/include/linux/visorbus.h b/include/linux/visorbus.h
deleted file mode 100644 (file)
index 0d8bd67..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2010 - 2013 UNISYS CORPORATION
- * All rights reserved.
- */
-
-/*
- *  This header file is to be included by other kernel mode components that
- *  implement a particular kind of visor_device.  Each of these other kernel
- *  mode components is called a visor device driver.  Refer to visortemplate
- *  for a minimal sample visor device driver.
- *
- *  There should be nothing in this file that is private to the visorbus
- *  bus implementation itself.
- */
-
-#ifndef __VISORBUS_H__
-#define __VISORBUS_H__
-
-#include <linux/device.h>
-
-#define VISOR_CHANNEL_SIGNATURE ('L' << 24 | 'N' << 16 | 'C' << 8 | 'E')
-
-/*
- * enum channel_serverstate
- * @CHANNELSRV_UNINITIALIZED: Channel is in an undefined state.
- * @CHANNELSRV_READY:        Channel has been initialized by server.
- */
-enum channel_serverstate {
-       CHANNELSRV_UNINITIALIZED = 0,
-       CHANNELSRV_READY = 1
-};
-
-/*
- * enum channel_clientstate
- * @CHANNELCLI_DETACHED:
- * @CHANNELCLI_DISABLED:  Client can see channel but is NOT allowed to use it
- *                       unless given TBD* explicit request
- *                       (should actually be < DETACHED).
- * @CHANNELCLI_ATTACHING: Legacy EFI client request for EFI server to attach.
- * @CHANNELCLI_ATTACHED:  Idle, but client may want to use channel any time.
- * @CHANNELCLI_BUSY:     Client either wants to use or is using channel.
- * @CHANNELCLI_OWNED:    "No worries" state - client can access channel
- *                       anytime.
- */
-enum channel_clientstate {
-       CHANNELCLI_DETACHED = 0,
-       CHANNELCLI_DISABLED = 1,
-       CHANNELCLI_ATTACHING = 2,
-       CHANNELCLI_ATTACHED = 3,
-       CHANNELCLI_BUSY = 4,
-       CHANNELCLI_OWNED = 5
-};
-
-/*
- * Values for VISOR_CHANNEL_PROTOCOL.Features: This define exists so that
- * a guest can look at the FeatureFlags in the io channel, and configure the
- * driver to use interrupts or not based on this setting. All feature bits for
- * all channels should be defined here. The io channel feature bits are defined
- * below.
- */
-#define VISOR_DRIVER_ENABLES_INTS (0x1ULL << 1)
-#define VISOR_CHANNEL_IS_POLLING (0x1ULL << 3)
-#define VISOR_IOVM_OK_DRIVER_DISABLING_INTS (0x1ULL << 4)
-#define VISOR_DRIVER_DISABLES_INTS (0x1ULL << 5)
-#define VISOR_DRIVER_ENHANCED_RCVBUF_CHECKING (0x1ULL << 6)
-
-/*
- * struct channel_header - Common Channel Header
- * @signature:        Signature.
- * @legacy_state:      DEPRECATED - being replaced by.
- * @header_size:       sizeof(struct channel_header).
- * @size:             Total size of this channel in bytes.
- * @features:         Flags to modify behavior.
- * @chtype:           Channel type: data, bus, control, etc..
- * @partition_handle:  ID of guest partition.
- * @handle:           Device number of this channel in client.
- * @ch_space_offset:   Offset in bytes to channel specific area.
- * @version_id:               Struct channel_header Version ID.
- * @partition_index:   Index of guest partition.
- * @zone_uuid:        Guid of Channel's zone.
- * @cli_str_offset:    Offset from channel header to null-terminated
- *                    ClientString (0 if ClientString not present).
- * @cli_state_boot:    CHANNEL_CLIENTSTATE of pre-boot EFI client of this
- *                    channel.
- * @cmd_state_cli:     CHANNEL_COMMANDSTATE (overloaded in Windows drivers, see
- *                    ServerStateUp, ServerStateDown, etc).
- * @cli_state_os:      CHANNEL_CLIENTSTATE of Guest OS client of this channel.
- * @ch_characteristic: CHANNEL_CHARACTERISTIC_<xxx>.
- * @cmd_state_srv:     CHANNEL_COMMANDSTATE (overloaded in Windows drivers, see
- *                    ServerStateUp, ServerStateDown, etc).
- * @srv_state:        CHANNEL_SERVERSTATE.
- * @cli_error_boot:    Bits to indicate err states for boot clients, so err
- *                    messages can be throttled.
- * @cli_error_os:      Bits to indicate err states for OS clients, so err
- *                    messages can be throttled.
- * @filler:           Pad out to 128 byte cacheline.
- * @recover_channel:   Please add all new single-byte values below here.
- */
-struct channel_header {
-       u64 signature;
-       u32 legacy_state;
-       /* SrvState, CliStateBoot, and CliStateOS below */
-       u32 header_size;
-       u64 size;
-       u64 features;
-       guid_t chtype;
-       u64 partition_handle;
-       u64 handle;
-       u64 ch_space_offset;
-       u32 version_id;
-       u32 partition_index;
-       guid_t zone_guid;
-       u32 cli_str_offset;
-       u32 cli_state_boot;
-       u32 cmd_state_cli;
-       u32 cli_state_os;
-       u32 ch_characteristic;
-       u32 cmd_state_srv;
-       u32 srv_state;
-       u8 cli_error_boot;
-       u8 cli_error_os;
-       u8 filler[1];
-       u8 recover_channel;
-} __packed;
-
-#define VISOR_CHANNEL_ENABLE_INTS (0x1ULL << 0)
-
-/*
- * struct signal_queue_header - Subheader for the Signal Type variation of the
- *                              Common Channel.
- * @version:         SIGNAL_QUEUE_HEADER Version ID.
- * @chtype:          Queue type: storage, network.
- * @size:            Total size of this queue in bytes.
- * @sig_base_offset:  Offset to signal queue area.
- * @features:        Flags to modify behavior.
- * @num_sent:        Total # of signals placed in this queue.
- * @num_overflows:    Total # of inserts failed due to full queue.
- * @signal_size:      Total size of a signal for this queue.
- * @max_slots:        Max # of slots in queue, 1 slot is always empty.
- * @max_signals:      Max # of signals in queue (MaxSignalSlots-1).
- * @head:            Queue head signal #.
- * @num_received:     Total # of signals removed from this queue.
- * @tail:            Queue tail signal.
- * @reserved1:       Reserved field.
- * @reserved2:       Reserved field.
- * @client_queue:
- * @num_irq_received: Total # of Interrupts received. This is incremented by the
- *                   ISR in the guest windows driver.
- * @num_empty:       Number of times that visor_signal_remove is called and
- *                   returned Empty Status.
- * @errorflags:              Error bits set during SignalReinit to denote trouble with
- *                   client's fields.
- * @filler:          Pad out to 64 byte cacheline.
- */
-struct signal_queue_header {
-       /* 1st cache line */
-       u32 version;
-       u32 chtype;
-       u64 size;
-       u64 sig_base_offset;
-       u64 features;
-       u64 num_sent;
-       u64 num_overflows;
-       u32 signal_size;
-       u32 max_slots;
-       u32 max_signals;
-       u32 head;
-       /* 2nd cache line */
-       u64 num_received;
-       u32 tail;
-       u32 reserved1;
-       u64 reserved2;
-       u64 client_queue;
-       u64 num_irq_received;
-       u64 num_empty;
-       u32 errorflags;
-       u8 filler[12];
-} __packed;
-
-/* VISORCHANNEL Guids */
-/* {414815ed-c58c-11da-95a9-00e08161165f} */
-#define VISOR_VHBA_CHANNEL_GUID \
-       GUID_INIT(0x414815ed, 0xc58c, 0x11da, \
-                 0x95, 0xa9, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f)
-#define VISOR_VHBA_CHANNEL_GUID_STR \
-       "414815ed-c58c-11da-95a9-00e08161165f"
-struct visorchipset_state {
-       u32 created:1;
-       u32 attached:1;
-       u32 configured:1;
-       u32 running:1;
-       /* Remaining bits in this 32-bit word are reserved. */
-};
-
-/**
- * struct visor_device - A device type for things "plugged" into the visorbus
- *                       bus
- * @visorchannel:              Points to the channel that the device is
- *                             associated with.
- * @channel_type_guid:         Identifies the channel type to the bus driver.
- * @device:                    Device struct meant for use by the bus driver
- *                             only.
- * @list_all:                  Used by the bus driver to enumerate devices.
- * @timer:                     Timer fired periodically to do interrupt-type
- *                             activity.
- * @being_removed:             Indicates that the device is being removed from
- *                             the bus. Private bus driver use only.
- * @visordriver_callback_lock: Used by the bus driver to lock when adding and
- *                             removing devices.
- * @pausing:                   Indicates that a change towards a paused state.
- *                             is in progress. Only modified by the bus driver.
- * @resuming:                  Indicates that a change towards a running state
- *                             is in progress. Only modified by the bus driver.
- * @chipset_bus_no:            Private field used by the bus driver.
- * @chipset_dev_no:            Private field used the bus driver.
- * @state:                     Used to indicate the current state of the
- *                             device.
- * @inst:                      Unique GUID for this instance of the device.
- * @name:                      Name of the device.
- * @pending_msg_hdr:           For private use by bus driver to respond to
- *                             hypervisor requests.
- * @vbus_hdr_info:             A pointer to header info. Private use by bus
- *                             driver.
- * @partition_guid:            Indicates client partion id. This should be the
- *                             same across all visor_devices in the current
- *                             guest. Private use by bus driver only.
- */
-struct visor_device {
-       struct visorchannel *visorchannel;
-       guid_t channel_type_guid;
-       /* These fields are for private use by the bus driver only. */
-       struct device device;
-       struct list_head list_all;
-       struct timer_list timer;
-       bool timer_active;
-       bool being_removed;
-       struct mutex visordriver_callback_lock; /* synchronize probe/remove */
-       bool pausing;
-       bool resuming;
-       u32 chipset_bus_no;
-       u32 chipset_dev_no;
-       struct visorchipset_state state;
-       guid_t inst;
-       u8 *name;
-       struct controlvm_message_header *pending_msg_hdr;
-       void *vbus_hdr_info;
-       guid_t partition_guid;
-       struct dentry *debugfs_dir;
-       struct dentry *debugfs_bus_info;
-};
-
-#define to_visor_device(x) container_of(x, struct visor_device, device)
-
-typedef void (*visorbus_state_complete_func) (struct visor_device *dev,
-                                             int status);
-
-/*
- * This struct describes a specific visor channel, by providing its GUID, name,
- * and sizes.
- */
-struct visor_channeltype_descriptor {
-       const guid_t guid;
-       const char *name;
-       u64 min_bytes;
-       u32 version;
-};
-
-/**
- * struct visor_driver - Information provided by each visor driver when it
- *                       registers with the visorbus driver
- * @name:              Name of the visor driver.
- * @owner:             The module owner.
- * @channel_types:     Types of channels handled by this driver, ending with
- *                     a zero GUID. Our specialized BUS.match() method knows
- *                     about this list, and uses it to determine whether this
- *                     driver will in fact handle a new device that it has
- *                     detected.
- * @probe:             Called when a new device comes online, by our probe()
- *                     function specified by driver.probe() (triggered
- *                     ultimately by some call to driver_register(),
- *                     bus_add_driver(), or driver_attach()).
- * @remove:            Called when a new device is removed, by our remove()
- *                     function specified by driver.remove() (triggered
- *                     ultimately by some call to device_release_driver()).
- * @channel_interrupt: Called periodically, whenever there is a possiblity
- *                     that "something interesting" may have happened to the
- *                     channel.
- * @pause:             Called to initiate a change of the device's state.  If
- *                     the return valu`e is < 0, there was an error and the
- *                     state transition will NOT occur.  If the return value
- *                     is >= 0, then the state transition was INITIATED
- *                     successfully, and complete_func() will be called (or
- *                     was just called) with the final status when either the
- *                     state transition fails or completes successfully.
- * @resume:            Behaves similar to pause.
- * @driver:            Private reference to the device driver. For use by bus
- *                     driver only.
- */
-struct visor_driver {
-       const char *name;
-       struct module *owner;
-       struct visor_channeltype_descriptor *channel_types;
-       int (*probe)(struct visor_device *dev);
-       void (*remove)(struct visor_device *dev);
-       void (*channel_interrupt)(struct visor_device *dev);
-       int (*pause)(struct visor_device *dev,
-                    visorbus_state_complete_func complete_func);
-       int (*resume)(struct visor_device *dev,
-                     visorbus_state_complete_func complete_func);
-
-       /* These fields are for private use by the bus driver only. */
-       struct device_driver driver;
-};
-
-#define to_visor_driver(x) (container_of(x, struct visor_driver, driver))
-
-int visor_check_channel(struct channel_header *ch, struct device *dev,
-                       const guid_t *expected_uuid, char *chname,
-                       u64 expected_min_bytes, u32 expected_version,
-                       u64 expected_signature);
-
-int visorbus_register_visor_driver(struct visor_driver *drv);
-void visorbus_unregister_visor_driver(struct visor_driver *drv);
-int visorbus_read_channel(struct visor_device *dev,
-                         unsigned long offset, void *dest,
-                         unsigned long nbytes);
-int visorbus_write_channel(struct visor_device *dev,
-                          unsigned long offset, void *src,
-                          unsigned long nbytes);
-int visorbus_enable_channel_interrupts(struct visor_device *dev);
-void visorbus_disable_channel_interrupts(struct visor_device *dev);
-
-int visorchannel_signalremove(struct visorchannel *channel, u32 queue,
-                             void *msg);
-int visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
-                             void *msg);
-bool visorchannel_signalempty(struct visorchannel *channel, u32 queue);
-const guid_t *visorchannel_get_guid(struct visorchannel *channel);
-
-#define BUS_ROOT_DEVICE UINT_MAX
-struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
-                                              struct visor_device *from);
-#endif
index b159c27..096d48a 100644 (file)
@@ -215,6 +215,7 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size,
 void free_vm_area(struct vm_struct *area);
 extern struct vm_struct *remove_vm_area(const void *addr);
 extern struct vm_struct *find_vm_area(const void *addr);
+struct vmap_area *find_vmap_area(unsigned long addr);
 
 static inline bool is_vm_area_hugepages(const void *addr)
 {
index 7fee9b6..62e75dd 100644 (file)
@@ -406,7 +406,7 @@ alloc_workqueue(const char *fmt, unsigned int flags, int max_active, ...);
  * alloc_ordered_workqueue - allocate an ordered workqueue
  * @fmt: printf format for the name of the workqueue
  * @flags: WQ_* flags (only WQ_FREEZABLE and WQ_MEM_RECLAIM are meaningful)
- * @args...: args for @fmt
+ * @args: args for @fmt
  *
  * Allocate an ordered workqueue.  An ordered workqueue executes at
  * most one work item at any given time in the queued order.  They are
@@ -445,7 +445,7 @@ extern bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
                        struct delayed_work *dwork, unsigned long delay);
 extern bool queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork);
 
-extern void flush_workqueue(struct workqueue_struct *wq);
+extern void __flush_workqueue(struct workqueue_struct *wq);
 extern void drain_workqueue(struct workqueue_struct *wq);
 
 extern int schedule_on_each_cpu(work_func_t func);
@@ -563,15 +563,23 @@ static inline bool schedule_work(struct work_struct *work)
        return queue_work(system_wq, work);
 }
 
+/*
+ * Detect attempt to flush system-wide workqueues at compile time when possible.
+ *
+ * See https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp
+ * for reasons and steps for converting system-wide workqueues into local workqueues.
+ */
+extern void __warn_flushing_systemwide_wq(void)
+       __compiletime_warning("Please avoid flushing system-wide workqueues.");
+
 /**
  * flush_scheduled_work - ensure that any scheduled work has run to completion.
  *
  * Forces execution of the kernel-global workqueue and blocks until its
  * completion.
  *
- * Think twice before calling this function!  It's very easy to get into
- * trouble if you don't take great care.  Either of the following situations
- * will lead to deadlock:
+ * It's very easy to get into trouble if you don't take great care.
+ * Either of the following situations will lead to deadlock:
  *
  *     One of the work items currently on the workqueue needs to acquire
  *     a lock held by your code or its caller.
@@ -586,11 +594,51 @@ static inline bool schedule_work(struct work_struct *work)
  * need to know that a particular work item isn't queued and isn't running.
  * In such cases you should use cancel_delayed_work_sync() or
  * cancel_work_sync() instead.
+ *
+ * Please stop calling this function! A conversion to stop flushing system-wide
+ * workqueues is in progress. This function will be removed after all in-tree
+ * users stopped calling this function.
  */
-static inline void flush_scheduled_work(void)
-{
-       flush_workqueue(system_wq);
-}
+/*
+ * The background of commit 771c035372a036f8 ("deprecate the
+ * '__deprecated' attribute warnings entirely and for good") is that,
+ * since Linus builds all modules between every single pull he does,
+ * the standard kernel build needs to be _clean_ in order to be able to
+ * notice when new problems happen. Therefore, don't emit warning while
+ * there are in-tree users.
+ */
+#define flush_scheduled_work()                                         \
+({                                                                     \
+       if (0)                                                          \
+               __warn_flushing_systemwide_wq();                        \
+       __flush_workqueue(system_wq);                                   \
+})
+
+/*
+ * Although there is no longer in-tree caller, for now just emit warning
+ * in order to give out-of-tree callers time to update.
+ */
+#define flush_workqueue(wq)                                            \
+({                                                                     \
+       struct workqueue_struct *_wq = (wq);                            \
+                                                                       \
+       if ((__builtin_constant_p(_wq == system_wq) &&                  \
+            _wq == system_wq) ||                                       \
+           (__builtin_constant_p(_wq == system_highpri_wq) &&          \
+            _wq == system_highpri_wq) ||                               \
+           (__builtin_constant_p(_wq == system_long_wq) &&             \
+            _wq == system_long_wq) ||                                  \
+           (__builtin_constant_p(_wq == system_unbound_wq) &&          \
+            _wq == system_unbound_wq) ||                               \
+           (__builtin_constant_p(_wq == system_freezable_wq) &&        \
+            _wq == system_freezable_wq) ||                             \
+           (__builtin_constant_p(_wq == system_power_efficient_wq) &&  \
+            _wq == system_power_efficient_wq) ||                       \
+           (__builtin_constant_p(_wq == system_freezable_power_efficient_wq) && \
+            _wq == system_freezable_power_efficient_wq))               \
+               __warn_flushing_systemwide_wq();                        \
+       __flush_workqueue(_wq);                                         \
+})
 
 /**
  * schedule_delayed_work_on - queue work in global workqueue on CPU after delay
index 72feab5..c29e11b 100644 (file)
@@ -1508,6 +1508,7 @@ void *xas_find_marked(struct xa_state *, unsigned long max, xa_mark_t);
 void xas_init_marks(const struct xa_state *);
 
 bool xas_nomem(struct xa_state *, gfp_t);
+void xas_destroy(struct xa_state *);
 void xas_pause(struct xa_state *);
 
 void xas_create_range(struct xa_state *);
index 021778a..6484095 100644 (file)
@@ -612,5 +612,6 @@ int flow_indr_dev_setup_offload(struct net_device *dev, struct Qdisc *sch,
                                enum tc_setup_type type, void *data,
                                struct flow_block_offload *bo,
                                void (*cleanup)(struct flow_block_cb *block_cb));
+bool flow_indr_dev_exists(void);
 
 #endif /* _NET_FLOW_OFFLOAD_H */
index 077cd73..85cd695 100644 (file)
@@ -25,7 +25,6 @@
 #undef INET_CSK_CLEAR_TIMERS
 
 struct inet_bind_bucket;
-struct inet_bind2_bucket;
 struct tcp_congestion_ops;
 
 /*
@@ -58,7 +57,6 @@ struct inet_connection_sock_af_ops {
  *
  * @icsk_accept_queue:    FIFO of established children
  * @icsk_bind_hash:       Bind node
- * @icsk_bind2_hash:      Bind node in the bhash2 table
  * @icsk_timeout:         Timeout
  * @icsk_retransmit_timer: Resend (no ack)
  * @icsk_rto:             Retransmit timeout
@@ -85,7 +83,6 @@ struct inet_connection_sock {
        struct inet_sock          icsk_inet;
        struct request_sock_queue icsk_accept_queue;
        struct inet_bind_bucket   *icsk_bind_hash;
-       struct inet_bind2_bucket  *icsk_bind2_hash;
        unsigned long             icsk_timeout;
        struct timer_list         icsk_retransmit_timer;
        struct timer_list         icsk_delack_timer;
index a0887b7..ebfa3df 100644 (file)
@@ -90,32 +90,11 @@ struct inet_bind_bucket {
        struct hlist_head       owners;
 };
 
-struct inet_bind2_bucket {
-       possible_net_t          ib_net;
-       int                     l3mdev;
-       unsigned short          port;
-       union {
-#if IS_ENABLED(CONFIG_IPV6)
-               struct in6_addr         v6_rcv_saddr;
-#endif
-               __be32                  rcv_saddr;
-       };
-       /* Node in the inet2_bind_hashbucket chain */
-       struct hlist_node       node;
-       /* List of sockets hashed to this bucket */
-       struct hlist_head       owners;
-};
-
 static inline struct net *ib_net(struct inet_bind_bucket *ib)
 {
        return read_pnet(&ib->ib_net);
 }
 
-static inline struct net *ib2_net(struct inet_bind2_bucket *ib)
-{
-       return read_pnet(&ib->ib_net);
-}
-
 #define inet_bind_bucket_for_each(tb, head) \
        hlist_for_each_entry(tb, head, node)
 
@@ -124,15 +103,6 @@ struct inet_bind_hashbucket {
        struct hlist_head       chain;
 };
 
-/* This is synchronized using the inet_bind_hashbucket's spinlock.
- * Instead of having separate spinlocks, the inet_bind2_hashbucket can share
- * the inet_bind_hashbucket's given that in every case where the bhash2 table
- * is useful, a lookup in the bhash table also occurs.
- */
-struct inet_bind2_hashbucket {
-       struct hlist_head       chain;
-};
-
 /* Sockets can be hashed in established or listening table.
  * We must use different 'nulls' end-of-chain value for all hash buckets :
  * A socket might transition from ESTABLISH to LISTEN state without
@@ -164,12 +134,6 @@ struct inet_hashinfo {
         */
        struct kmem_cache               *bind_bucket_cachep;
        struct inet_bind_hashbucket     *bhash;
-       /* The 2nd binding table hashed by port and address.
-        * This is used primarily for expediting the resolution of bind
-        * conflicts.
-        */
-       struct kmem_cache               *bind2_bucket_cachep;
-       struct inet_bind2_hashbucket    *bhash2;
        unsigned int                    bhash_size;
 
        /* The 2nd listener table hashed by local port and address */
@@ -229,36 +193,6 @@ inet_bind_bucket_create(struct kmem_cache *cachep, struct net *net,
 void inet_bind_bucket_destroy(struct kmem_cache *cachep,
                              struct inet_bind_bucket *tb);
 
-static inline bool check_bind_bucket_match(struct inet_bind_bucket *tb,
-                                          struct net *net,
-                                          const unsigned short port,
-                                          int l3mdev)
-{
-       return net_eq(ib_net(tb), net) && tb->port == port &&
-               tb->l3mdev == l3mdev;
-}
-
-struct inet_bind2_bucket *
-inet_bind2_bucket_create(struct kmem_cache *cachep, struct net *net,
-                        struct inet_bind2_hashbucket *head,
-                        const unsigned short port, int l3mdev,
-                        const struct sock *sk);
-
-void inet_bind2_bucket_destroy(struct kmem_cache *cachep,
-                              struct inet_bind2_bucket *tb);
-
-struct inet_bind2_bucket *
-inet_bind2_bucket_find(struct inet_hashinfo *hinfo, struct net *net,
-                      const unsigned short port, int l3mdev,
-                      struct sock *sk,
-                      struct inet_bind2_hashbucket **head);
-
-bool check_bind2_bucket_match_nulladdr(struct inet_bind2_bucket *tb,
-                                      struct net *net,
-                                      const unsigned short port,
-                                      int l3mdev,
-                                      const struct sock *sk);
-
 static inline u32 inet_bhashfn(const struct net *net, const __u16 lport,
                               const u32 bhash_size)
 {
@@ -266,7 +200,7 @@ static inline u32 inet_bhashfn(const struct net *net, const __u16 lport,
 }
 
 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
-                   struct inet_bind2_bucket *tb2, const unsigned short snum);
+                   const unsigned short snum);
 
 /* Caller must disable local BH processing. */
 int __inet_inherit_port(const struct sock *sk, struct sock *child);
index c1b5dcd..daead5f 100644 (file)
@@ -253,6 +253,11 @@ struct inet_sock {
 #define IP_CMSG_CHECKSUM       BIT(7)
 #define IP_CMSG_RECVFRAGSIZE   BIT(8)
 
+static inline bool sk_is_inet(struct sock *sk)
+{
+       return sk->sk_family == AF_INET || sk->sk_family == AF_INET6;
+}
+
 /**
  * sk_to_full_sk - Access to a full socket
  * @sk: pointer to a socket
index 5b38bf1..de9dcc5 100644 (file)
@@ -1063,7 +1063,7 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr);
 int ip6_append_data(struct sock *sk,
                    int getfrag(void *from, char *to, int offset, int len,
                                int odd, struct sk_buff *skb),
-                   void *from, int length, int transhdrlen,
+                   void *from, size_t length, int transhdrlen,
                    struct ipcm6_cookie *ipc6, struct flowi6 *fl6,
                    struct rt6_info *rt, unsigned int flags);
 
@@ -1079,7 +1079,7 @@ struct sk_buff *__ip6_make_skb(struct sock *sk, struct sk_buff_head *queue,
 struct sk_buff *ip6_make_skb(struct sock *sk,
                             int getfrag(void *from, char *to, int offset,
                                         int len, int odd, struct sk_buff *skb),
-                            void *from, int length, int transhdrlen,
+                            void *from, size_t length, int transhdrlen,
                             struct ipcm6_cookie *ipc6,
                             struct rt6_info *rt, unsigned int flags,
                             struct inet_cork_full *cork);
index 20af9d3..279ae0f 100644 (file)
@@ -1090,7 +1090,6 @@ struct nft_stats {
 
 struct nft_hook {
        struct list_head        list;
-       bool                    inactive;
        struct nf_hook_ops      ops;
        struct rcu_head         rcu;
 };
index 7971478..3568b6a 100644 (file)
@@ -92,7 +92,7 @@ int nft_flow_rule_offload_commit(struct net *net);
        NFT_OFFLOAD_MATCH(__key, __base, __field, __len, __reg)         \
        memset(&(__reg)->mask, 0xff, (__reg)->len);
 
-int nft_chain_offload_priority(struct nft_base_chain *basechain);
+bool nft_chain_offload_support(const struct nft_base_chain *basechain);
 
 int nft_offload_init(void);
 void nft_offload_exit(void);
index c585ef6..72ca97c 100644 (file)
@@ -348,7 +348,6 @@ struct sk_filter;
   *    @sk_txtime_report_errors: set report errors mode for SO_TXTIME
   *    @sk_txtime_unused: unused txtime flags
   *    @ns_tracker: tracker for netns reference
-  *    @sk_bind2_node: bind node in the bhash2 table
   */
 struct sock {
        /*
@@ -538,7 +537,6 @@ struct sock {
 #endif
        struct rcu_head         sk_rcu;
        netns_tracker           ns_tracker;
-       struct hlist_node       sk_bind2_node;
 };
 
 enum sk_pacing {
@@ -819,16 +817,6 @@ static inline void sk_add_bind_node(struct sock *sk,
        hlist_add_head(&sk->sk_bind_node, list);
 }
 
-static inline void __sk_del_bind2_node(struct sock *sk)
-{
-       __hlist_del(&sk->sk_bind2_node);
-}
-
-static inline void sk_add_bind2_node(struct sock *sk, struct hlist_head *list)
-{
-       hlist_add_head(&sk->sk_bind2_node, list);
-}
-
 #define sk_for_each(__sk, list) \
        hlist_for_each_entry(__sk, list, sk_node)
 #define sk_for_each_rcu(__sk, list) \
@@ -846,8 +834,6 @@ static inline void sk_add_bind2_node(struct sock *sk, struct hlist_head *list)
        hlist_for_each_entry_safe(__sk, tmp, list, sk_node)
 #define sk_for_each_bound(__sk, list) \
        hlist_for_each_entry(__sk, list, sk_bind_node)
-#define sk_for_each_bound_bhash2(__sk, list) \
-       hlist_for_each_entry(__sk, list, sk_bind2_node)
 
 /**
  * sk_for_each_entry_offset_rcu - iterate over a list at a given struct offset
index 66fcc5a..aa2f951 100644 (file)
@@ -158,6 +158,8 @@ TRACE_EVENT(io_uring_queue_async_work,
                __field(  unsigned int,                 flags           )
                __field(  struct io_wq_work *,          work            )
                __field(  int,                          rw              )
+
+               __string( op_str, io_uring_get_opcode(opcode)   )
        ),
 
        TP_fast_assign(
@@ -168,11 +170,13 @@ TRACE_EVENT(io_uring_queue_async_work,
                __entry->opcode         = opcode;
                __entry->work           = work;
                __entry->rw             = rw;
+
+               __assign_str(op_str, io_uring_get_opcode(opcode));
        ),
 
        TP_printk("ring %p, request %p, user_data 0x%llx, opcode %s, flags 0x%x, %s queue, work %p",
                __entry->ctx, __entry->req, __entry->user_data,
-               io_uring_get_opcode(__entry->opcode),
+               __get_str(op_str),
                __entry->flags, __entry->rw ? "hashed" : "normal", __entry->work)
 );
 
@@ -198,6 +202,8 @@ TRACE_EVENT(io_uring_defer,
                __field(  void *,               req     )
                __field(  unsigned long long,   data    )
                __field(  u8,                   opcode  )
+
+               __string( op_str, io_uring_get_opcode(opcode) )
        ),
 
        TP_fast_assign(
@@ -205,11 +211,13 @@ TRACE_EVENT(io_uring_defer,
                __entry->req    = req;
                __entry->data   = user_data;
                __entry->opcode = opcode;
+
+               __assign_str(op_str, io_uring_get_opcode(opcode));
        ),
 
        TP_printk("ring %p, request %p, user_data 0x%llx, opcode %s",
                __entry->ctx, __entry->req, __entry->data,
-               io_uring_get_opcode(__entry->opcode))
+               __get_str(op_str))
 );
 
 /**
@@ -298,6 +306,8 @@ TRACE_EVENT(io_uring_fail_link,
                __field(  unsigned long long,   user_data       )
                __field(  u8,                   opcode          )
                __field(  void *,               link            )
+
+               __string( op_str, io_uring_get_opcode(opcode) )
        ),
 
        TP_fast_assign(
@@ -306,11 +316,13 @@ TRACE_EVENT(io_uring_fail_link,
                __entry->user_data      = user_data;
                __entry->opcode         = opcode;
                __entry->link           = link;
+
+               __assign_str(op_str, io_uring_get_opcode(opcode));
        ),
 
        TP_printk("ring %p, request %p, user_data 0x%llx, opcode %s, link %p",
                __entry->ctx, __entry->req, __entry->user_data,
-               io_uring_get_opcode(__entry->opcode), __entry->link)
+               __get_str(op_str), __entry->link)
 );
 
 /**
@@ -390,6 +402,8 @@ TRACE_EVENT(io_uring_submit_sqe,
                __field(  u32,                  flags           )
                __field(  bool,                 force_nonblock  )
                __field(  bool,                 sq_thread       )
+
+               __string( op_str, io_uring_get_opcode(opcode) )
        ),
 
        TP_fast_assign(
@@ -400,11 +414,13 @@ TRACE_EVENT(io_uring_submit_sqe,
                __entry->flags          = flags;
                __entry->force_nonblock = force_nonblock;
                __entry->sq_thread      = sq_thread;
+
+               __assign_str(op_str, io_uring_get_opcode(opcode));
        ),
 
        TP_printk("ring %p, req %p, user_data 0x%llx, opcode %s, flags 0x%x, "
                  "non block %d, sq_thread %d", __entry->ctx, __entry->req,
-                 __entry->user_data, io_uring_get_opcode(__entry->opcode),
+                 __entry->user_data, __get_str(op_str),
                  __entry->flags, __entry->force_nonblock, __entry->sq_thread)
 );
 
@@ -435,6 +451,8 @@ TRACE_EVENT(io_uring_poll_arm,
                __field(  u8,                   opcode          )
                __field(  int,                  mask            )
                __field(  int,                  events          )
+
+               __string( op_str, io_uring_get_opcode(opcode) )
        ),
 
        TP_fast_assign(
@@ -444,11 +462,13 @@ TRACE_EVENT(io_uring_poll_arm,
                __entry->opcode         = opcode;
                __entry->mask           = mask;
                __entry->events         = events;
+
+               __assign_str(op_str, io_uring_get_opcode(opcode));
        ),
 
        TP_printk("ring %p, req %p, user_data 0x%llx, opcode %s, mask 0x%x, events 0x%x",
                  __entry->ctx, __entry->req, __entry->user_data,
-                 io_uring_get_opcode(__entry->opcode),
+                 __get_str(op_str),
                  __entry->mask, __entry->events)
 );
 
@@ -474,6 +494,8 @@ TRACE_EVENT(io_uring_task_add,
                __field(  unsigned long long,   user_data       )
                __field(  u8,                   opcode          )
                __field(  int,                  mask            )
+
+               __string( op_str, io_uring_get_opcode(opcode) )
        ),
 
        TP_fast_assign(
@@ -482,11 +504,13 @@ TRACE_EVENT(io_uring_task_add,
                __entry->user_data      = user_data;
                __entry->opcode         = opcode;
                __entry->mask           = mask;
+
+               __assign_str(op_str, io_uring_get_opcode(opcode));
        ),
 
        TP_printk("ring %p, req %p, user_data 0x%llx, opcode %s, mask %x",
                __entry->ctx, __entry->req, __entry->user_data,
-               io_uring_get_opcode(__entry->opcode),
+               __get_str(op_str),
                __entry->mask)
 );
 
@@ -523,6 +547,8 @@ TRACE_EVENT(io_uring_req_failed,
                __field( u64,                   pad1            )
                __field( u64,                   addr3           )
                __field( int,                   error           )
+
+               __string( op_str, io_uring_get_opcode(sqe->opcode) )
        ),
 
        TP_fast_assign(
@@ -542,6 +568,8 @@ TRACE_EVENT(io_uring_req_failed,
                __entry->pad1           = sqe->__pad2[0];
                __entry->addr3          = sqe->addr3;
                __entry->error          = error;
+
+               __assign_str(op_str, io_uring_get_opcode(sqe->opcode));
        ),
 
        TP_printk("ring %p, req %p, user_data 0x%llx, "
@@ -550,7 +578,7 @@ TRACE_EVENT(io_uring_req_failed,
                  "personality=%d, file_index=%d, pad=0x%llx, addr3=%llx, "
                  "error=%d",
                  __entry->ctx, __entry->req, __entry->user_data,
-                 io_uring_get_opcode(__entry->opcode),
+                 __get_str(op_str),
                  __entry->flags, __entry->ioprio,
                  (unsigned long long)__entry->off,
                  (unsigned long long) __entry->addr, __entry->len,
index d4e631a..6025dd8 100644 (file)
@@ -288,6 +288,7 @@ DECLARE_EVENT_CLASS(ata_qc_complete_template,
                __entry->hob_feature    = qc->result_tf.hob_feature;
                __entry->nsect          = qc->result_tf.nsect;
                __entry->hob_nsect      = qc->result_tf.hob_nsect;
+               __entry->flags          = qc->flags;
        ),
 
        TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s status=%s " \
index 6154a2e..262d520 100644 (file)
@@ -22,7 +22,7 @@ struct pool_workqueue;
  */
 TRACE_EVENT(workqueue_queue_work,
 
-       TP_PROTO(unsigned int req_cpu, struct pool_workqueue *pwq,
+       TP_PROTO(int req_cpu, struct pool_workqueue *pwq,
                 struct work_struct *work),
 
        TP_ARGS(req_cpu, pwq, work),
@@ -31,8 +31,8 @@ TRACE_EVENT(workqueue_queue_work,
                __field( void *,        work    )
                __field( void *,        function)
                __string( workqueue,    pwq->wq->name)
-               __field( unsigned int,  req_cpu )
-               __field( unsigned int,  cpu     )
+               __field( int,   req_cpu )
+               __field( int,   cpu     )
        ),
 
        TP_fast_assign(
@@ -43,7 +43,7 @@ TRACE_EVENT(workqueue_queue_work,
                __entry->cpu            = pwq->pool->cpu;
        ),
 
-       TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%u cpu=%u",
+       TP_printk("work struct=%p function=%ps workqueue=%s req_cpu=%d cpu=%d",
                  __entry->work, __entry->function, __get_str(workqueue),
                  __entry->req_cpu, __entry->cpu)
 );
index 776e027..53e7dae 100644 (file)
@@ -47,7 +47,6 @@ struct io_uring_sqe {
                __u32           unlink_flags;
                __u32           hardlink_flags;
                __u32           xattr_flags;
-               __u32           close_flags;
        };
        __u64   user_data;      /* data to be passed back at completion time */
        /* pack this to avoid bogus arm OABI complaints */
@@ -259,11 +258,6 @@ enum io_uring_op {
  */
 #define IORING_ACCEPT_MULTISHOT        (1U << 0)
 
-/*
- * close flags, store in sqe->close_flags
- */
-#define IORING_CLOSE_FD_AND_FILE_SLOT  (1U << 0)
-
 /*
  * IO completion data structure (Completion Queue Entry)
  */
index ac39328..bb8f808 100644 (file)
@@ -39,7 +39,7 @@
 /* TLS socket options */
 #define TLS_TX                 1       /* Set transmit parameters */
 #define TLS_RX                 2       /* Set receive parameters */
-#define TLS_TX_ZEROCOPY_SENDFILE       3       /* transmit zerocopy sendfile */
+#define TLS_TX_ZEROCOPY_RO     3       /* TX zerocopy (only sendfile now) */
 
 /* Supported versions */
 #define TLS_VERSION_MINOR(ver) ((ver) & 0xFF)
@@ -161,7 +161,7 @@ enum {
        TLS_INFO_CIPHER,
        TLS_INFO_TXCONF,
        TLS_INFO_RXCONF,
-       TLS_INFO_ZC_SENDFILE,
+       TLS_INFO_ZC_RO_TX,
        __TLS_INFO_MAX,
 };
 #define TLS_INFO_MAX (__TLS_INFO_MAX - 1)
diff --git a/include/xen/arm/xen-ops.h b/include/xen/arm/xen-ops.h
new file mode 100644 (file)
index 0000000..b0766a6
--- /dev/null
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_ARM_XEN_OPS_H
+#define _ASM_ARM_XEN_OPS_H
+
+#include <xen/swiotlb-xen.h>
+#include <xen/xen-ops.h>
+
+static inline void xen_setup_dma_ops(struct device *dev)
+{
+#ifdef CONFIG_XEN
+       if (xen_is_grant_dma_device(dev))
+               xen_grant_setup_dma_ops(dev);
+       else if (xen_swiotlb_detect())
+               dev->dma_ops = &xen_swiotlb_dma_ops;
+#endif
+}
+
+#endif /* _ASM_ARM_XEN_OPS_H */
index 527c990..e279be3 100644 (file)
@@ -127,10 +127,14 @@ int gnttab_try_end_foreign_access(grant_ref_t ref);
  */
 int gnttab_alloc_grant_references(u16 count, grant_ref_t *pprivate_head);
 
+int gnttab_alloc_grant_reference_seq(unsigned int count, grant_ref_t *first);
+
 void gnttab_free_grant_reference(grant_ref_t ref);
 
 void gnttab_free_grant_references(grant_ref_t head);
 
+void gnttab_free_grant_reference_seq(grant_ref_t head, unsigned int count);
+
 int gnttab_empty_grant_references(const grant_ref_t *pprivate_head);
 
 int gnttab_claim_grant_reference(grant_ref_t *pprivate_head);
index c7c1b46..8054696 100644 (file)
@@ -214,4 +214,17 @@ static inline void xen_preemptible_hcall_end(void) { }
 
 #endif /* CONFIG_XEN_PV && !CONFIG_PREEMPTION */
 
+#ifdef CONFIG_XEN_GRANT_DMA_OPS
+void xen_grant_setup_dma_ops(struct device *dev);
+bool xen_is_grant_dma_device(struct device *dev);
+#else
+static inline void xen_grant_setup_dma_ops(struct device *dev)
+{
+}
+static inline bool xen_is_grant_dma_device(struct device *dev)
+{
+       return false;
+}
+#endif /* CONFIG_XEN_GRANT_DMA_OPS */
+
 #endif /* INCLUDE_XEN_OPS_H */
index a99bab8..0780a81 100644 (file)
@@ -52,6 +52,14 @@ bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
 extern u64 xen_saved_max_mem_size;
 #endif
 
+#include <linux/platform-feature.h>
+
+static inline void xen_set_restricted_virtio_memory_access(void)
+{
+       if (IS_ENABLED(CONFIG_XEN_VIRTIO) && xen_domain())
+               platform_set(PLATFORM_VIRTIO_RESTRICTED_MEM_ACCESS);
+}
+
 #ifdef CONFIG_XEN_UNPOPULATED_ALLOC
 int xen_alloc_unpopulated_pages(unsigned int nr_pages, struct page **pages);
 void xen_free_unpopulated_pages(unsigned int nr_pages, struct page **pages);
index c984afc..c7900e8 100644 (file)
@@ -885,6 +885,15 @@ config CC_IMPLICIT_FALLTHROUGH
        default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)
        default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
 
+# Currently, disable gcc-12 array-bounds globally.
+# We may want to target only particular configurations some day.
+config GCC12_NO_ARRAY_BOUNDS
+       def_bool y
+
+config CC_NO_ARRAY_BOUNDS
+       bool
+       default y if CC_IS_GCC && GCC_VERSION >= 120000 && GCC_VERSION < 130000 && GCC12_NO_ARRAY_BOUNDS
+
 #
 # For architectures that know their GCC __int128 support is sound
 #
index 318789c..a7e1f49 100644 (file)
@@ -7,7 +7,7 @@ obj-y     = fork.o exec_domain.o panic.o \
            cpu.o exit.o softirq.o resource.o \
            sysctl.o capability.o ptrace.o user.o \
            signal.o sys.o umh.o workqueue.o pid.o task_work.o \
-           extable.o params.o \
+           extable.o params.o platform-feature.o \
            kthread.o sys_ni.o nsproxy.o \
            notifier.o ksysfs.o cred.o reboot.o \
            async.o range.o smpboot.o ucount.o regset.o
index f3a2abd..3a8c9d7 100644 (file)
@@ -1014,10 +1014,10 @@ static void audit_reset_context(struct audit_context *ctx)
        ctx->target_comm[0] = '\0';
        unroll_tree_refs(ctx, NULL, 0);
        WARN_ON(!list_empty(&ctx->killed_trees));
-       ctx->type = 0;
        audit_free_module(ctx);
        ctx->fds[0] = -1;
        audit_proctitle_free(ctx);
+       ctx->type = 0; /* reset last for audit_free_*() */
 }
 
 static inline struct audit_context *audit_alloc_context(enum audit_state state)
index 7bccaa4..eb12d4f 100644 (file)
@@ -4815,6 +4815,7 @@ static int btf_check_type_tags(struct btf_verifier_env *env,
        n = btf_nr_types(btf);
        for (i = start_id; i < n; i++) {
                const struct btf_type *t;
+               int chain_limit = 32;
                u32 cur_id = i;
 
                t = btf_type_by_id(btf, i);
@@ -4827,6 +4828,10 @@ static int btf_check_type_tags(struct btf_verifier_env *env,
 
                in_tags = btf_type_is_type_tag(t);
                while (btf_type_is_modifier(t)) {
+                       if (!chain_limit--) {
+                               btf_verifier_log(env, "Max chain length or cycle detected");
+                               return -ELOOP;
+                       }
                        if (btf_type_is_type_tag(t)) {
                                if (!in_tags) {
                                        btf_verifier_log(env, "Type tags don't precede modifiers");
@@ -6054,6 +6059,7 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
                                    struct bpf_reg_state *regs,
                                    bool ptr_to_mem_ok)
 {
+       enum bpf_prog_type prog_type = resolve_prog_type(env->prog);
        struct bpf_verifier_log *log = &env->log;
        u32 i, nargs, ref_id, ref_obj_id = 0;
        bool is_kfunc = btf_is_kernel(btf);
@@ -6171,7 +6177,7 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
                                return -EINVAL;
                        }
                        /* rest of the arguments can be anything, like normal kfunc */
-               } else if (btf_get_prog_ctx_type(log, btf, t, env->prog->type, i)) {
+               } else if (btf_get_prog_ctx_type(log, btf, t, prog_type, i)) {
                        /* If function expects ctx type in BTF check that caller
                         * is passing PTR_TO_CTX.
                         */
index 9594cfd..08102d1 100644 (file)
@@ -281,6 +281,8 @@ static inline cfi_check_fn find_module_check_fn(unsigned long ptr)
 static inline cfi_check_fn find_check_fn(unsigned long ptr)
 {
        cfi_check_fn fn = NULL;
+       unsigned long flags;
+       bool rcu_idle;
 
        if (is_kernel_text(ptr))
                return __cfi_check;
@@ -290,13 +292,21 @@ static inline cfi_check_fn find_check_fn(unsigned long ptr)
         * the shadow and __module_address use RCU, so we need to wake it
         * up if necessary.
         */
-       RCU_NONIDLE({
-               if (IS_ENABLED(CONFIG_CFI_CLANG_SHADOW))
-                       fn = find_shadow_check_fn(ptr);
+       rcu_idle = !rcu_is_watching();
+       if (rcu_idle) {
+               local_irq_save(flags);
+               rcu_irq_enter();
+       }
+
+       if (IS_ENABLED(CONFIG_CFI_CLANG_SHADOW))
+               fn = find_shadow_check_fn(ptr);
+       if (!fn)
+               fn = find_module_check_fn(ptr);
 
-               if (!fn)
-                       fn = find_module_check_fn(ptr);
-       });
+       if (rcu_idle) {
+               rcu_irq_exit();
+               local_irq_restore(flags);
+       }
 
        return fn;
 }
index ac74063..2caafd1 100644 (file)
@@ -564,7 +564,7 @@ static void add_dma_entry(struct dma_debug_entry *entry, unsigned long attrs)
 
        rc = active_cacheline_insert(entry);
        if (rc == -ENOMEM) {
-               pr_err("cacheline tracking ENOMEM, dma-debug disabled\n");
+               pr_err_once("cacheline tracking ENOMEM, dma-debug disabled\n");
                global_disable = true;
        } else if (rc == -EEXIST && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) {
                err_printk(entry->dev, entry,
index e978f36..8d0b68a 100644 (file)
@@ -357,7 +357,7 @@ void dma_direct_free(struct device *dev, size_t size,
        } else {
                if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_CLEAR_UNCACHED))
                        arch_dma_clear_uncached(cpu_addr, size);
-               if (dma_set_encrypted(dev, cpu_addr, 1 << page_order))
+               if (dma_set_encrypted(dev, cpu_addr, size))
                        return;
        }
 
@@ -392,7 +392,6 @@ void dma_direct_free_pages(struct device *dev, size_t size,
                struct page *page, dma_addr_t dma_addr,
                enum dma_data_direction dir)
 {
-       unsigned int page_order = get_order(size);
        void *vaddr = page_address(page);
 
        /* If cpu_addr is not from an atomic pool, dma_free_from_pool() fails */
@@ -400,7 +399,7 @@ void dma_direct_free_pages(struct device *dev, size_t size,
            dma_free_from_pool(dev, vaddr, size))
                return;
 
-       if (dma_set_encrypted(dev, vaddr, 1 << page_order))
+       if (dma_set_encrypted(dev, vaddr, size))
                return;
        __dma_direct_free_pages(dev, page, size);
 }
index dfa1de8..cb50f8d 100644 (file)
@@ -192,7 +192,7 @@ void __init swiotlb_update_mem_attributes(void)
 }
 
 static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
-                                   unsigned long nslabs, bool late_alloc)
+               unsigned long nslabs, unsigned int flags, bool late_alloc)
 {
        void *vaddr = phys_to_virt(start);
        unsigned long bytes = nslabs << IO_TLB_SHIFT, i;
@@ -203,8 +203,7 @@ static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
        mem->index = 0;
        mem->late_alloc = late_alloc;
 
-       if (swiotlb_force_bounce)
-               mem->force_bounce = true;
+       mem->force_bounce = swiotlb_force_bounce || (flags & SWIOTLB_FORCE);
 
        spin_lock_init(&mem->lock);
        for (i = 0; i < mem->nslabs; i++) {
@@ -275,8 +274,7 @@ retry:
                panic("%s: Failed to allocate %zu bytes align=0x%lx\n",
                      __func__, alloc_size, PAGE_SIZE);
 
-       swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, false);
-       mem->force_bounce = flags & SWIOTLB_FORCE;
+       swiotlb_init_io_tlb_mem(mem, __pa(tlb), nslabs, flags, false);
 
        if (flags & SWIOTLB_VERBOSE)
                swiotlb_print_info();
@@ -348,7 +346,7 @@ retry:
 
        set_memory_decrypted((unsigned long)vstart,
                             (nslabs << IO_TLB_SHIFT) >> PAGE_SHIFT);
-       swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, true);
+       swiotlb_init_io_tlb_mem(mem, virt_to_phys(vstart), nslabs, 0, true);
 
        swiotlb_print_info();
        return 0;
@@ -835,8 +833,8 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
 
                set_memory_decrypted((unsigned long)phys_to_virt(rmem->base),
                                     rmem->size >> PAGE_SHIFT);
-               swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, false);
-               mem->force_bounce = true;
+               swiotlb_init_io_tlb_mem(mem, rmem->base, nslabs, SWIOTLB_FORCE,
+                               false);
                mem->for_alloc = true;
 
                rmem->priv = mem;
index 9d09f48..2e0f75b 100644 (file)
@@ -9,12 +9,6 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work)
                int ret;
 
                if (ti_work & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) {
-                       clear_notify_signal();
-                       if (task_work_pending(current))
-                               task_work_run();
-               }
-
-               if (ti_work & _TIF_SIGPENDING) {
                        kvm_handle_signal_exit(vcpu);
                        return -EINTR;
                }
index 80bfea5..cff3ae8 100644 (file)
@@ -127,8 +127,6 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
         * complain:
         */
        if (sysctl_hung_task_warnings) {
-               printk_prefer_direct_enter();
-
                if (sysctl_hung_task_warnings > 0)
                        sysctl_hung_task_warnings--;
                pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n",
@@ -144,8 +142,6 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
 
                if (sysctl_hung_task_all_cpu_backtrace)
                        hung_task_show_all_bt = true;
-
-               printk_prefer_direct_exit();
        }
 
        touch_nmi_watchdog();
@@ -208,17 +204,12 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
        }
  unlock:
        rcu_read_unlock();
-       if (hung_task_show_lock) {
-               printk_prefer_direct_enter();
+       if (hung_task_show_lock)
                debug_show_all_locks();
-               printk_prefer_direct_exit();
-       }
 
        if (hung_task_show_all_bt) {
                hung_task_show_all_bt = false;
-               printk_prefer_direct_enter();
                trigger_all_cpu_backtrace();
-               printk_prefer_direct_exit();
        }
 
        if (hung_task_call_panic)
index e6b8e56..886789d 100644 (file)
@@ -1006,8 +1006,10 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
                if (desc->irq_data.chip != &no_irq_chip)
                        mask_ack_irq(desc);
                irq_state_set_disabled(desc);
-               if (is_chained)
+               if (is_chained) {
                        desc->action = NULL;
+                       WARN_ON(irq_chip_pm_put(irq_desc_get_irq_data(desc)));
+               }
                desc->depth = 1;
        }
        desc->handle_irq = handle;
@@ -1033,6 +1035,7 @@ __irq_do_set_handler(struct irq_desc *desc, irq_flow_handler_t handle,
                irq_settings_set_norequest(desc);
                irq_settings_set_nothread(desc);
                desc->action = &chained_action;
+               WARN_ON(irq_chip_pm_get(irq_desc_get_irq_data(desc)));
                irq_activate_and_startup(desc, IRQ_RESEND);
        }
 }
index 544fd40..3c67791 100644 (file)
@@ -340,7 +340,7 @@ static int kthread(void *_create)
 
        self = to_kthread(current);
 
-       /* If user was SIGKILLed, I release the structure. */
+       /* Release the structure when caller killed by a fatal signal. */
        done = xchg(&create->done, NULL);
        if (!done) {
                kfree(create);
@@ -398,7 +398,7 @@ static void create_kthread(struct kthread_create_info *create)
        /* We want our own signal handler (we take no signals by default). */
        pid = kernel_thread(kthread, create, CLONE_FS | CLONE_FILES | SIGCHLD);
        if (pid < 0) {
-               /* If user was SIGKILLed, I release the structure. */
+               /* Release the structure when caller killed by a fatal signal. */
                struct completion *done = xchg(&create->done, NULL);
 
                if (!done) {
@@ -440,9 +440,9 @@ struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data),
         */
        if (unlikely(wait_for_completion_killable(&done))) {
                /*
-                * If I was SIGKILLed before kthreadd (or new kernel thread)
-                * calls complete(), leave the cleanup of this structure to
-                * that thread.
+                * If I was killed by a fatal signal before kthreadd (or new
+                * kernel thread) calls complete(), leave the cleanup of this
+                * structure to that thread.
                 */
                if (xchg(&create->done, NULL))
                        return ERR_PTR(-EINTR);
@@ -876,7 +876,7 @@ fail_task:
  *
  * Returns a pointer to the allocated worker on success, ERR_PTR(-ENOMEM)
  * when the needed structures could not get allocated, and ERR_PTR(-EINTR)
- * when the worker was SIGKILLed.
+ * when the caller was killed by a fatal signal.
  */
 struct kthread_worker *
 kthread_create_worker(unsigned int flags, const char namefmt[], ...)
@@ -925,7 +925,7 @@ EXPORT_SYMBOL(kthread_create_worker);
  * Return:
  * The pointer to the allocated worker on success, ERR_PTR(-ENOMEM)
  * when the needed structures could not get allocated, and ERR_PTR(-EINTR)
- * when the worker was SIGKILLed.
+ * when the caller was killed by a fatal signal.
  */
 struct kthread_worker *
 kthread_create_worker_on_cpu(int cpu, unsigned int flags,
index 81e8728..f06b91c 100644 (file)
@@ -5432,7 +5432,7 @@ static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock)
                         * be guessable and still allows some pin nesting in
                         * our u32 pin_count.
                         */
-                       cookie.val = 1 + (prandom_u32() >> 16);
+                       cookie.val = 1 + (sched_clock() & 0xffff);
                        hlock->pin_count += cookie.val;
                        return cookie;
                }
index a3c758d..a3308af 100644 (file)
@@ -603,8 +603,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 {
        disable_trace_on_warning();
 
-       printk_prefer_direct_enter();
-
        if (file)
                pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
                        raw_smp_processor_id(), current->pid, file, line,
@@ -634,8 +632,6 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 
        /* Just a warning, don't kill lockdep. */
        add_taint(taint, LOCKDEP_STILL_OK);
-
-       printk_prefer_direct_exit();
 }
 
 #ifndef __WARN_FLAGS
diff --git a/kernel/platform-feature.c b/kernel/platform-feature.c
new file mode 100644 (file)
index 0000000..cb6a6c3
--- /dev/null
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/bitops.h>
+#include <linux/cache.h>
+#include <linux/export.h>
+#include <linux/platform-feature.h>
+
+#define PLATFORM_FEAT_ARRAY_SZ  BITS_TO_LONGS(PLATFORM_FEAT_N)
+static unsigned long __read_mostly platform_features[PLATFORM_FEAT_ARRAY_SZ];
+
+void platform_set(unsigned int feature)
+{
+       set_bit(feature, platform_features);
+}
+EXPORT_SYMBOL_GPL(platform_set);
+
+void platform_clear(unsigned int feature)
+{
+       clear_bit(feature, platform_features);
+}
+EXPORT_SYMBOL_GPL(platform_clear);
+
+bool platform_has(unsigned int feature)
+{
+       return test_bit(feature, platform_features);
+}
+EXPORT_SYMBOL_GPL(platform_has);
index 20a66bf..89c71fc 100644 (file)
@@ -665,7 +665,7 @@ static void power_down(void)
                hibernation_platform_enter();
                fallthrough;
        case HIBERNATION_SHUTDOWN:
-               if (pm_power_off)
+               if (kernel_can_power_off())
                        kernel_power_off();
                break;
        }
index ea3dd55..b49c6ff 100644 (file)
@@ -223,33 +223,6 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
 /* Number of registered extended console drivers. */
 static int nr_ext_console_drivers;
 
-/*
- * Used to synchronize printing kthreads against direct printing via
- * console_trylock/console_unlock.
- *
- * Values:
- * -1 = console kthreads atomically blocked (via global trylock)
- *  0 = no kthread printing, console not locked (via trylock)
- * >0 = kthread(s) actively printing
- *
- * Note: For synchronizing against direct printing via
- *       console_lock/console_unlock, see the @lock variable in
- *       struct console.
- */
-static atomic_t console_kthreads_active = ATOMIC_INIT(0);
-
-#define console_kthreads_atomic_tryblock() \
-       (atomic_cmpxchg(&console_kthreads_active, 0, -1) == 0)
-#define console_kthreads_atomic_unblock() \
-       atomic_cmpxchg(&console_kthreads_active, -1, 0)
-#define console_kthreads_atomically_blocked() \
-       (atomic_read(&console_kthreads_active) == -1)
-
-#define console_kthread_printing_tryenter() \
-       atomic_inc_unless_negative(&console_kthreads_active)
-#define console_kthread_printing_exit() \
-       atomic_dec(&console_kthreads_active)
-
 /*
  * Helper macros to handle lockdep when locking/unlocking console_sem. We use
  * macros instead of functions so that _RET_IP_ contains useful information.
@@ -298,49 +271,14 @@ static bool panic_in_progress(void)
 }
 
 /*
- * Tracks whether kthread printers are all blocked. A value of true implies
- * that the console is locked via console_lock() or the console is suspended.
- * Writing to this variable requires holding @console_sem.
+ * This is used for debugging the mess that is the VT code by
+ * keeping track if we have the console semaphore held. It's
+ * definitely not the perfect debug tool (we don't know if _WE_
+ * hold it and are racing, but it helps tracking those weird code
+ * paths in the console code where we end up in places I want
+ * locked without the console semaphore held).
  */
-static bool console_kthreads_blocked;
-
-/*
- * Block all kthread printers from a schedulable context.
- *
- * Requires holding @console_sem.
- */
-static void console_kthreads_block(void)
-{
-       struct console *con;
-
-       for_each_console(con) {
-               mutex_lock(&con->lock);
-               con->blocked = true;
-               mutex_unlock(&con->lock);
-       }
-
-       console_kthreads_blocked = true;
-}
-
-/*
- * Unblock all kthread printers from a schedulable context.
- *
- * Requires holding @console_sem.
- */
-static void console_kthreads_unblock(void)
-{
-       struct console *con;
-
-       for_each_console(con) {
-               mutex_lock(&con->lock);
-               con->blocked = false;
-               mutex_unlock(&con->lock);
-       }
-
-       console_kthreads_blocked = false;
-}
-
-static int console_suspended;
+static int console_locked, console_suspended;
 
 /*
  *     Array of consoles built from command line options (console=)
@@ -423,75 +361,7 @@ static int console_msg_format = MSG_FORMAT_DEFAULT;
 /* syslog_lock protects syslog_* variables and write access to clear_seq. */
 static DEFINE_MUTEX(syslog_lock);
 
-/*
- * A flag to signify if printk_activate_kthreads() has already started the
- * kthread printers. If true, any later registered consoles must start their
- * own kthread directly. The flag is write protected by the console_lock.
- */
-static bool printk_kthreads_available;
-
 #ifdef CONFIG_PRINTK
-static atomic_t printk_prefer_direct = ATOMIC_INIT(0);
-
-/**
- * printk_prefer_direct_enter - cause printk() calls to attempt direct
- *                              printing to all enabled consoles
- *
- * Since it is not possible to call into the console printing code from any
- * context, there is no guarantee that direct printing will occur.
- *
- * This globally effects all printk() callers.
- *
- * Context: Any context.
- */
-void printk_prefer_direct_enter(void)
-{
-       atomic_inc(&printk_prefer_direct);
-}
-
-/**
- * printk_prefer_direct_exit - restore printk() behavior
- *
- * Context: Any context.
- */
-void printk_prefer_direct_exit(void)
-{
-       WARN_ON(atomic_dec_if_positive(&printk_prefer_direct) < 0);
-}
-
-/*
- * Calling printk() always wakes kthread printers so that they can
- * flush the new message to their respective consoles. Also, if direct
- * printing is allowed, printk() tries to flush the messages directly.
- *
- * Direct printing is allowed in situations when the kthreads
- * are not available or the system is in a problematic state.
- *
- * See the implementation about possible races.
- */
-static inline bool allow_direct_printing(void)
-{
-       /*
-        * Checking kthread availability is a possible race because the
-        * kthread printers can become permanently disabled during runtime.
-        * However, doing that requires holding the console_lock, so any
-        * pending messages will be direct printed by console_unlock().
-        */
-       if (!printk_kthreads_available)
-               return true;
-
-       /*
-        * Prefer direct printing when the system is in a problematic state.
-        * The context that sets this state will always see the updated value.
-        * The other contexts do not care. Anyway, direct printing is just a
-        * best effort. The direct output is only possible when console_lock
-        * is not already taken and no kthread printers are actively printing.
-        */
-       return (system_state > SYSTEM_RUNNING ||
-               oops_in_progress ||
-               atomic_read(&printk_prefer_direct));
-}
-
 DECLARE_WAIT_QUEUE_HEAD(log_wait);
 /* All 3 protected by @syslog_lock. */
 /* the next printk record to read by syslog(READ) or /proc/kmsg */
@@ -2382,10 +2252,10 @@ asmlinkage int vprintk_emit(int facility, int level,
        printed_len = vprintk_store(facility, level, dev_info, fmt, args);
 
        /* If called from the scheduler, we can not call up(). */
-       if (!in_sched && allow_direct_printing()) {
+       if (!in_sched) {
                /*
                 * The caller may be holding system-critical or
-                * timing-sensitive locks. Disable preemption during direct
+                * timing-sensitive locks. Disable preemption during
                 * printing of all remaining records to all consoles so that
                 * this context can return as soon as possible. Hopefully
                 * another printk() caller will take over the printing.
@@ -2428,8 +2298,6 @@ EXPORT_SYMBOL(_printk);
 
 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress);
 
-static void printk_start_kthread(struct console *con);
-
 #else /* CONFIG_PRINTK */
 
 #define CONSOLE_LOG_MAX                0
@@ -2463,8 +2331,6 @@ static void call_console_driver(struct console *con, const char *text, size_t le
 }
 static bool suppress_message_printing(int level) { return false; }
 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) { return true; }
-static void printk_start_kthread(struct console *con) { }
-static bool allow_direct_printing(void) { return true; }
 
 #endif /* CONFIG_PRINTK */
 
@@ -2683,14 +2549,6 @@ static int console_cpu_notify(unsigned int cpu)
                /* If trylock fails, someone else is doing the printing */
                if (console_trylock())
                        console_unlock();
-               else {
-                       /*
-                        * If a new CPU comes online, the conditions for
-                        * printer_should_wake() may have changed for some
-                        * kthread printer with !CON_ANYTIME.
-                        */
-                       wake_up_klogd();
-               }
        }
        return 0;
 }
@@ -2710,7 +2568,7 @@ void console_lock(void)
        down_console_sem();
        if (console_suspended)
                return;
-       console_kthreads_block();
+       console_locked = 1;
        console_may_schedule = 1;
 }
 EXPORT_SYMBOL(console_lock);
@@ -2731,30 +2589,15 @@ int console_trylock(void)
                up_console_sem();
                return 0;
        }
-       if (!console_kthreads_atomic_tryblock()) {
-               up_console_sem();
-               return 0;
-       }
+       console_locked = 1;
        console_may_schedule = 0;
        return 1;
 }
 EXPORT_SYMBOL(console_trylock);
 
-/*
- * This is used to help to make sure that certain paths within the VT code are
- * running with the console lock held. It is definitely not the perfect debug
- * tool (it is not known if the VT code is the task holding the console lock),
- * but it helps tracking those weird code paths in the console code such as
- * when the console is suspended: where the console is not locked but no
- * console printing may occur.
- *
- * Note: This returns true when the console is suspended but is not locked.
- *       This is intentional because the VT code must consider that situation
- *       the same as if the console was locked.
- */
 int is_console_locked(void)
 {
-       return (console_kthreads_blocked || atomic_read(&console_kthreads_active));
+       return console_locked;
 }
 EXPORT_SYMBOL(is_console_locked);
 
@@ -2777,9 +2620,18 @@ static bool abandon_console_lock_in_panic(void)
        return atomic_read(&panic_cpu) != raw_smp_processor_id();
 }
 
-static inline bool __console_is_usable(short flags)
+/*
+ * Check if the given console is currently capable and allowed to print
+ * records.
+ *
+ * Requires the console_lock.
+ */
+static inline bool console_is_usable(struct console *con)
 {
-       if (!(flags & CON_ENABLED))
+       if (!(con->flags & CON_ENABLED))
+               return false;
+
+       if (!con->write)
                return false;
 
        /*
@@ -2788,43 +2640,15 @@ static inline bool __console_is_usable(short flags)
         * cope (CON_ANYTIME) don't call them until this CPU is officially up.
         */
        if (!cpu_online(raw_smp_processor_id()) &&
-           !(flags & CON_ANYTIME))
+           !(con->flags & CON_ANYTIME))
                return false;
 
        return true;
 }
 
-/*
- * Check if the given console is currently capable and allowed to print
- * records.
- *
- * Requires holding the console_lock.
- */
-static inline bool console_is_usable(struct console *con)
-{
-       if (!con->write)
-               return false;
-
-       return __console_is_usable(con->flags);
-}
-
 static void __console_unlock(void)
 {
-       /*
-        * Depending on whether console_lock() or console_trylock() was used,
-        * appropriately allow the kthread printers to continue.
-        */
-       if (console_kthreads_blocked)
-               console_kthreads_unblock();
-       else
-               console_kthreads_atomic_unblock();
-
-       /*
-        * New records may have arrived while the console was locked.
-        * Wake the kthread printers to print them.
-        */
-       wake_up_klogd();
-
+       console_locked = 0;
        up_console_sem();
 }
 
@@ -2842,19 +2666,17 @@ static void __console_unlock(void)
  *
  * @handover will be set to true if a printk waiter has taken over the
  * console_lock, in which case the caller is no longer holding the
- * console_lock. Otherwise it is set to false. A NULL pointer may be provided
- * to disable allowing the console_lock to be taken over by a printk waiter.
+ * console_lock. Otherwise it is set to false.
  *
  * Returns false if the given console has no next record to print, otherwise
  * true.
  *
- * Requires the console_lock if @handover is non-NULL.
- * Requires con->lock otherwise.
+ * Requires the console_lock.
  */
-static bool __console_emit_next_record(struct console *con, char *text, char *ext_text,
-                                      char *dropped_text, bool *handover)
+static bool console_emit_next_record(struct console *con, char *text, char *ext_text,
+                                    char *dropped_text, bool *handover)
 {
-       static atomic_t panic_console_dropped = ATOMIC_INIT(0);
+       static int panic_console_dropped;
        struct printk_info info;
        struct printk_record r;
        unsigned long flags;
@@ -2863,8 +2685,7 @@ static bool __console_emit_next_record(struct console *con, char *text, char *ex
 
        prb_rec_init_rd(&r, &info, text, CONSOLE_LOG_MAX);
 
-       if (handover)
-               *handover = false;
+       *handover = false;
 
        if (!prb_read_valid(prb, con->seq, &r))
                return false;
@@ -2872,8 +2693,7 @@ static bool __console_emit_next_record(struct console *con, char *text, char *ex
        if (con->seq != r.info->seq) {
                con->dropped += r.info->seq - con->seq;
                con->seq = r.info->seq;
-               if (panic_in_progress() &&
-                   atomic_fetch_inc_relaxed(&panic_console_dropped) > 10) {
+               if (panic_in_progress() && panic_console_dropped++ > 10) {
                        suppress_panic_printk = 1;
                        pr_warn_once("Too many dropped messages. Suppress messages on non-panic CPUs to prevent livelock.\n");
                }
@@ -2895,61 +2715,31 @@ static bool __console_emit_next_record(struct console *con, char *text, char *ex
                len = record_print_text(&r, console_msg_format & MSG_FORMAT_SYSLOG, printk_time);
        }
 
-       if (handover) {
-               /*
-                * While actively printing out messages, if another printk()
-                * were to occur on another CPU, it may wait for this one to
-                * finish. This task can not be preempted if there is a
-                * waiter waiting to take over.
-                *
-                * Interrupts are disabled because the hand over to a waiter
-                * must not be interrupted until the hand over is completed
-                * (@console_waiter is cleared).
-                */
-               printk_safe_enter_irqsave(flags);
-               console_lock_spinning_enable();
-
-               /* don't trace irqsoff print latency */
-               stop_critical_timings();
-       }
+       /*
+        * While actively printing out messages, if another printk()
+        * were to occur on another CPU, it may wait for this one to
+        * finish. This task can not be preempted if there is a
+        * waiter waiting to take over.
+        *
+        * Interrupts are disabled because the hand over to a waiter
+        * must not be interrupted until the hand over is completed
+        * (@console_waiter is cleared).
+        */
+       printk_safe_enter_irqsave(flags);
+       console_lock_spinning_enable();
 
+       stop_critical_timings();        /* don't trace print latency */
        call_console_driver(con, write_text, len, dropped_text);
+       start_critical_timings();
 
        con->seq++;
 
-       if (handover) {
-               start_critical_timings();
-               *handover = console_lock_spinning_disable_and_check();
-               printk_safe_exit_irqrestore(flags);
-       }
+       *handover = console_lock_spinning_disable_and_check();
+       printk_safe_exit_irqrestore(flags);
 skip:
        return true;
 }
 
-/*
- * Print a record for a given console, but allow another printk() caller to
- * take over the console_lock and continue printing.
- *
- * Requires the console_lock, but depending on @handover after the call, the
- * caller may no longer have the console_lock.
- *
- * See __console_emit_next_record() for argument and return details.
- */
-static bool console_emit_next_record_transferable(struct console *con, char *text, char *ext_text,
-                                                 char *dropped_text, bool *handover)
-{
-       /*
-        * Handovers are only supported if threaded printers are atomically
-        * blocked. The context taking over the console_lock may be atomic.
-        */
-       if (!console_kthreads_atomically_blocked()) {
-               *handover = false;
-               handover = NULL;
-       }
-
-       return __console_emit_next_record(con, text, ext_text, dropped_text, handover);
-}
-
 /*
  * Print out all remaining records to all consoles.
  *
@@ -2968,8 +2758,8 @@ static bool console_emit_next_record_transferable(struct console *con, char *tex
  * were flushed to all usable consoles. A returned false informs the caller
  * that everything was not flushed (either there were no usable consoles or
  * another context has taken over printing or it is a panic situation and this
- * is not the panic CPU or direct printing is not preferred). Regardless the
- * reason, the caller should assume it is not useful to immediately try again.
+ * is not the panic CPU). Regardless the reason, the caller should assume it
+ * is not useful to immediately try again.
  *
  * Requires the console_lock.
  */
@@ -2986,10 +2776,6 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove
        *handover = false;
 
        do {
-               /* Let the kthread printers do the work if they can. */
-               if (!allow_direct_printing())
-                       return false;
-
                any_progress = false;
 
                for_each_console(con) {
@@ -3001,11 +2787,13 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove
 
                        if (con->flags & CON_EXTENDED) {
                                /* Extended consoles do not print "dropped messages". */
-                               progress = console_emit_next_record_transferable(con, &text[0],
-                                                               &ext_text[0], NULL, handover);
+                               progress = console_emit_next_record(con, &text[0],
+                                                                   &ext_text[0], NULL,
+                                                                   handover);
                        } else {
-                               progress = console_emit_next_record_transferable(con, &text[0],
-                                                               NULL, &dropped_text[0], handover);
+                               progress = console_emit_next_record(con, &text[0],
+                                                                   NULL, &dropped_text[0],
+                                                                   handover);
                        }
                        if (*handover)
                                return false;
@@ -3120,13 +2908,10 @@ void console_unblank(void)
        if (oops_in_progress) {
                if (down_trylock_console_sem() != 0)
                        return;
-               if (!console_kthreads_atomic_tryblock()) {
-                       up_console_sem();
-                       return;
-               }
        } else
                console_lock();
 
+       console_locked = 1;
        console_may_schedule = 0;
        for_each_console(c)
                if ((c->flags & CON_ENABLED) && c->unblank)
@@ -3405,10 +3190,6 @@ void register_console(struct console *newcon)
                nr_ext_console_drivers++;
 
        newcon->dropped = 0;
-       newcon->thread = NULL;
-       newcon->blocked = true;
-       mutex_init(&newcon->lock);
-
        if (newcon->flags & CON_PRINTBUFFER) {
                /* Get a consistent copy of @syslog_seq. */
                mutex_lock(&syslog_lock);
@@ -3418,10 +3199,6 @@ void register_console(struct console *newcon)
                /* Begin with next message. */
                newcon->seq = prb_next_seq(prb);
        }
-
-       if (printk_kthreads_available)
-               printk_start_kthread(newcon);
-
        console_unlock();
        console_sysfs_notify();
 
@@ -3448,7 +3225,6 @@ EXPORT_SYMBOL(register_console);
 
 int unregister_console(struct console *console)
 {
-       struct task_struct *thd;
        struct console *con;
        int res;
 
@@ -3489,20 +3265,7 @@ int unregister_console(struct console *console)
                console_drivers->flags |= CON_CONSDEV;
 
        console->flags &= ~CON_ENABLED;
-
-       /*
-        * console->thread can only be cleared under the console lock. But
-        * stopping the thread must be done without the console lock. The
-        * task that clears @thread is the task that stops the kthread.
-        */
-       thd = console->thread;
-       console->thread = NULL;
-
        console_unlock();
-
-       if (thd)
-               kthread_stop(thd);
-
        console_sysfs_notify();
 
        if (console->exit)
@@ -3598,20 +3361,6 @@ static int __init printk_late_init(void)
 }
 late_initcall(printk_late_init);
 
-static int __init printk_activate_kthreads(void)
-{
-       struct console *con;
-
-       console_lock();
-       printk_kthreads_available = true;
-       for_each_console(con)
-               printk_start_kthread(con);
-       console_unlock();
-
-       return 0;
-}
-early_initcall(printk_activate_kthreads);
-
 #if defined CONFIG_PRINTK
 /* If @con is specified, only wait for that console. Otherwise wait for all. */
 static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress)
@@ -3686,206 +3435,11 @@ bool pr_flush(int timeout_ms, bool reset_on_progress)
 }
 EXPORT_SYMBOL(pr_flush);
 
-static void __printk_fallback_preferred_direct(void)
-{
-       printk_prefer_direct_enter();
-       pr_err("falling back to preferred direct printing\n");
-       printk_kthreads_available = false;
-}
-
-/*
- * Enter preferred direct printing, but never exit. Mark console threads as
- * unavailable. The system is then forever in preferred direct printing and
- * any printing threads will exit.
- *
- * Must *not* be called under console_lock. Use
- * __printk_fallback_preferred_direct() if already holding console_lock.
- */
-static void printk_fallback_preferred_direct(void)
-{
-       console_lock();
-       __printk_fallback_preferred_direct();
-       console_unlock();
-}
-
-/*
- * Print a record for a given console, not allowing another printk() caller
- * to take over. This is appropriate for contexts that do not have the
- * console_lock.
- *
- * See __console_emit_next_record() for argument and return details.
- */
-static bool console_emit_next_record(struct console *con, char *text, char *ext_text,
-                                    char *dropped_text)
-{
-       return __console_emit_next_record(con, text, ext_text, dropped_text, NULL);
-}
-
-static bool printer_should_wake(struct console *con, u64 seq)
-{
-       short flags;
-
-       if (kthread_should_stop() || !printk_kthreads_available)
-               return true;
-
-       if (con->blocked ||
-           console_kthreads_atomically_blocked()) {
-               return false;
-       }
-
-       /*
-        * This is an unsafe read from con->flags, but a false positive is
-        * not a problem. Worst case it would allow the printer to wake up
-        * although it is disabled. But the printer will notice that when
-        * attempting to print and instead go back to sleep.
-        */
-       flags = data_race(READ_ONCE(con->flags));
-
-       if (!__console_is_usable(flags))
-               return false;
-
-       return prb_read_valid(prb, seq, NULL);
-}
-
-static int printk_kthread_func(void *data)
-{
-       struct console *con = data;
-       char *dropped_text = NULL;
-       char *ext_text = NULL;
-       u64 seq = 0;
-       char *text;
-       int error;
-
-       text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL);
-       if (!text) {
-               con_printk(KERN_ERR, con, "failed to allocate text buffer\n");
-               printk_fallback_preferred_direct();
-               goto out;
-       }
-
-       if (con->flags & CON_EXTENDED) {
-               ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL);
-               if (!ext_text) {
-                       con_printk(KERN_ERR, con, "failed to allocate ext_text buffer\n");
-                       printk_fallback_preferred_direct();
-                       goto out;
-               }
-       } else {
-               dropped_text = kmalloc(DROPPED_TEXT_MAX, GFP_KERNEL);
-               if (!dropped_text) {
-                       con_printk(KERN_ERR, con, "failed to allocate dropped_text buffer\n");
-                       printk_fallback_preferred_direct();
-                       goto out;
-               }
-       }
-
-       con_printk(KERN_INFO, con, "printing thread started\n");
-
-       for (;;) {
-               /*
-                * Guarantee this task is visible on the waitqueue before
-                * checking the wake condition.
-                *
-                * The full memory barrier within set_current_state() of
-                * prepare_to_wait_event() pairs with the full memory barrier
-                * within wq_has_sleeper().
-                *
-                * This pairs with __wake_up_klogd:A.
-                */
-               error = wait_event_interruptible(log_wait,
-                               printer_should_wake(con, seq)); /* LMM(printk_kthread_func:A) */
-
-               if (kthread_should_stop() || !printk_kthreads_available)
-                       break;
-
-               if (error)
-                       continue;
-
-               error = mutex_lock_interruptible(&con->lock);
-               if (error)
-                       continue;
-
-               if (con->blocked ||
-                   !console_kthread_printing_tryenter()) {
-                       /* Another context has locked the console_lock. */
-                       mutex_unlock(&con->lock);
-                       continue;
-               }
-
-               /*
-                * Although this context has not locked the console_lock, it
-                * is known that the console_lock is not locked and it is not
-                * possible for any other context to lock the console_lock.
-                * Therefore it is safe to read con->flags.
-                */
-
-               if (!__console_is_usable(con->flags)) {
-                       console_kthread_printing_exit();
-                       mutex_unlock(&con->lock);
-                       continue;
-               }
-
-               /*
-                * Even though the printk kthread is always preemptible, it is
-                * still not allowed to call cond_resched() from within
-                * console drivers. The task may become non-preemptible in the
-                * console driver call chain. For example, vt_console_print()
-                * takes a spinlock and then can call into fbcon_redraw(),
-                * which can conditionally invoke cond_resched().
-                */
-               console_may_schedule = 0;
-               console_emit_next_record(con, text, ext_text, dropped_text);
-
-               seq = con->seq;
-
-               console_kthread_printing_exit();
-
-               mutex_unlock(&con->lock);
-       }
-
-       con_printk(KERN_INFO, con, "printing thread stopped\n");
-out:
-       kfree(dropped_text);
-       kfree(ext_text);
-       kfree(text);
-
-       console_lock();
-       /*
-        * If this kthread is being stopped by another task, con->thread will
-        * already be NULL. That is fine. The important thing is that it is
-        * NULL after the kthread exits.
-        */
-       con->thread = NULL;
-       console_unlock();
-
-       return 0;
-}
-
-/* Must be called under console_lock. */
-static void printk_start_kthread(struct console *con)
-{
-       /*
-        * Do not start a kthread if there is no write() callback. The
-        * kthreads assume the write() callback exists.
-        */
-       if (!con->write)
-               return;
-
-       con->thread = kthread_run(printk_kthread_func, con,
-                                 "pr/%s%d", con->name, con->index);
-       if (IS_ERR(con->thread)) {
-               con->thread = NULL;
-               con_printk(KERN_ERR, con, "unable to start printing thread\n");
-               __printk_fallback_preferred_direct();
-               return;
-       }
-}
-
 /*
  * Delayed printk version, for scheduler-internal messages:
  */
-#define PRINTK_PENDING_WAKEUP          0x01
-#define PRINTK_PENDING_DIRECT_OUTPUT   0x02
+#define PRINTK_PENDING_WAKEUP  0x01
+#define PRINTK_PENDING_OUTPUT  0x02
 
 static DEFINE_PER_CPU(int, printk_pending);
 
@@ -3893,14 +3447,10 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work)
 {
        int pending = this_cpu_xchg(printk_pending, 0);
 
-       if (pending & PRINTK_PENDING_DIRECT_OUTPUT) {
-               printk_prefer_direct_enter();
-
+       if (pending & PRINTK_PENDING_OUTPUT) {
                /* If trylock fails, someone else is doing the printing */
                if (console_trylock())
                        console_unlock();
-
-               printk_prefer_direct_exit();
        }
 
        if (pending & PRINTK_PENDING_WAKEUP)
@@ -3925,11 +3475,10 @@ static void __wake_up_klogd(int val)
         * prepare_to_wait_event(), which is called after ___wait_event() adds
         * the waiter but before it has checked the wait condition.
         *
-        * This pairs with devkmsg_read:A, syslog_print:A, and
-        * printk_kthread_func:A.
+        * This pairs with devkmsg_read:A and syslog_print:A.
         */
        if (wq_has_sleeper(&log_wait) || /* LMM(__wake_up_klogd:A) */
-           (val & PRINTK_PENDING_DIRECT_OUTPUT)) {
+           (val & PRINTK_PENDING_OUTPUT)) {
                this_cpu_or(printk_pending, val);
                irq_work_queue(this_cpu_ptr(&wake_up_klogd_work));
        }
@@ -3947,17 +3496,7 @@ void defer_console_output(void)
         * New messages may have been added directly to the ringbuffer
         * using vprintk_store(), so wake any waiters as well.
         */
-       int val = PRINTK_PENDING_WAKEUP;
-
-       /*
-        * Make sure that some context will print the messages when direct
-        * printing is allowed. This happens in situations when the kthreads
-        * may not be as reliable or perhaps unusable.
-        */
-       if (allow_direct_printing())
-               val |= PRINTK_PENDING_DIRECT_OUTPUT;
-
-       __wake_up_klogd(val);
+       __wake_up_klogd(PRINTK_PENDING_WAKEUP | PRINTK_PENDING_OUTPUT);
 }
 
 void printk_trigger_flush(void)
index 4995c07..a001e1e 100644 (file)
@@ -647,7 +647,6 @@ static void print_cpu_stall(unsigned long gps)
         * See Documentation/RCU/stallwarn.rst for info on how to debug
         * RCU CPU stall warnings.
         */
-       printk_prefer_direct_enter();
        trace_rcu_stall_warning(rcu_state.name, TPS("SelfDetected"));
        pr_err("INFO: %s self-detected stall on CPU\n", rcu_state.name);
        raw_spin_lock_irqsave_rcu_node(rdp->mynode, flags);
@@ -685,7 +684,6 @@ static void print_cpu_stall(unsigned long gps)
         */
        set_tsk_need_resched(current);
        set_preempt_need_resched();
-       printk_prefer_direct_exit();
 }
 
 static void check_cpu_stall(struct rcu_data *rdp)
index a091145..3c35445 100644 (file)
@@ -315,6 +315,43 @@ static int sys_off_notify(struct notifier_block *nb,
        return handler->sys_off_cb(&data);
 }
 
+static struct sys_off_handler platform_sys_off_handler;
+
+static struct sys_off_handler *alloc_sys_off_handler(int priority)
+{
+       struct sys_off_handler *handler;
+       gfp_t flags;
+
+       /*
+        * Platforms like m68k can't allocate sys_off handler dynamically
+        * at the early boot time because memory allocator isn't available yet.
+        */
+       if (priority == SYS_OFF_PRIO_PLATFORM) {
+               handler = &platform_sys_off_handler;
+               if (handler->cb_data)
+                       return ERR_PTR(-EBUSY);
+       } else {
+               if (system_state > SYSTEM_RUNNING)
+                       flags = GFP_ATOMIC;
+               else
+                       flags = GFP_KERNEL;
+
+               handler = kzalloc(sizeof(*handler), flags);
+               if (!handler)
+                       return ERR_PTR(-ENOMEM);
+       }
+
+       return handler;
+}
+
+static void free_sys_off_handler(struct sys_off_handler *handler)
+{
+       if (handler == &platform_sys_off_handler)
+               memset(handler, 0, sizeof(*handler));
+       else
+               kfree(handler);
+}
+
 /**
  *     register_sys_off_handler - Register sys-off handler
  *     @mode: Sys-off mode
@@ -345,9 +382,9 @@ register_sys_off_handler(enum sys_off_mode mode,
        struct sys_off_handler *handler;
        int err;
 
-       handler = kzalloc(sizeof(*handler), GFP_KERNEL);
-       if (!handler)
-               return ERR_PTR(-ENOMEM);
+       handler = alloc_sys_off_handler(priority);
+       if (IS_ERR(handler))
+               return handler;
 
        switch (mode) {
        case SYS_OFF_MODE_POWER_OFF_PREPARE:
@@ -364,7 +401,7 @@ register_sys_off_handler(enum sys_off_mode mode,
                break;
 
        default:
-               kfree(handler);
+               free_sys_off_handler(handler);
                return ERR_PTR(-EINVAL);
        }
 
@@ -391,7 +428,7 @@ register_sys_off_handler(enum sys_off_mode mode,
        }
 
        if (err) {
-               kfree(handler);
+               free_sys_off_handler(handler);
                return ERR_PTR(err);
        }
 
@@ -409,7 +446,7 @@ void unregister_sys_off_handler(struct sys_off_handler *handler)
 {
        int err;
 
-       if (!handler)
+       if (IS_ERR_OR_NULL(handler))
                return;
 
        if (handler->blocking)
@@ -422,7 +459,7 @@ void unregister_sys_off_handler(struct sys_off_handler *handler)
        /* sanity check, shall never happen */
        WARN_ON(err);
 
-       kfree(handler);
+       free_sys_off_handler(handler);
 }
 EXPORT_SYMBOL_GPL(unregister_sys_off_handler);
 
@@ -584,7 +621,23 @@ static void do_kernel_power_off_prepare(void)
  */
 void do_kernel_power_off(void)
 {
+       struct sys_off_handler *sys_off = NULL;
+
+       /*
+        * Register sys-off handlers for legacy PM callback. This allows
+        * legacy PM callbacks temporary co-exist with the new sys-off API.
+        *
+        * TODO: Remove legacy handlers once all legacy PM users will be
+        *       switched to the sys-off based APIs.
+        */
+       if (pm_power_off)
+               sys_off = register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
+                                                  SYS_OFF_PRIO_DEFAULT,
+                                                  legacy_pm_power_off, NULL);
+
        atomic_notifier_call_chain(&power_off_handler_list, 0, NULL);
+
+       unregister_sys_off_handler(sys_off);
 }
 
 /**
@@ -595,7 +648,8 @@ void do_kernel_power_off(void)
  */
 bool kernel_can_power_off(void)
 {
-       return !atomic_notifier_call_chain_is_empty(&power_off_handler_list);
+       return !atomic_notifier_call_chain_is_empty(&power_off_handler_list) ||
+               pm_power_off;
 }
 EXPORT_SYMBOL_GPL(kernel_can_power_off);
 
@@ -630,7 +684,6 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
                void __user *, arg)
 {
        struct pid_namespace *pid_ns = task_active_pid_ns(current);
-       struct sys_off_handler *sys_off = NULL;
        char buffer[256];
        int ret = 0;
 
@@ -655,21 +708,6 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
        if (ret)
                return ret;
 
-       /*
-        * Register sys-off handlers for legacy PM callback. This allows
-        * legacy PM callbacks temporary co-exist with the new sys-off API.
-        *
-        * TODO: Remove legacy handlers once all legacy PM users will be
-        *       switched to the sys-off based APIs.
-        */
-       if (pm_power_off) {
-               sys_off = register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
-                                                  SYS_OFF_PRIO_DEFAULT,
-                                                  legacy_pm_power_off, NULL);
-               if (IS_ERR(sys_off))
-                       return PTR_ERR(sys_off);
-       }
-
        /* Instead of trying to make the power_off code look like
         * halt when pm_power_off is not set do it the easy way.
         */
@@ -727,7 +765,6 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
                break;
        }
        mutex_unlock(&system_transition_mutex);
-       unregister_sys_off_handler(sys_off);
        return ret;
 }
 
@@ -782,11 +819,9 @@ static int __orderly_reboot(void)
        ret = run_cmd(reboot_cmd);
 
        if (ret) {
-               printk_prefer_direct_enter();
                pr_warn("Failed to start orderly reboot: forcing the issue\n");
                emergency_sync();
                kernel_restart(NULL);
-               printk_prefer_direct_exit();
        }
 
        return ret;
@@ -799,7 +834,6 @@ static int __orderly_poweroff(bool force)
        ret = run_cmd(poweroff_cmd);
 
        if (ret && force) {
-               printk_prefer_direct_enter();
                pr_warn("Failed to start orderly shutdown: forcing the issue\n");
 
                /*
@@ -809,7 +843,6 @@ static int __orderly_poweroff(bool force)
                 */
                emergency_sync();
                kernel_power_off();
-               printk_prefer_direct_exit();
        }
 
        return ret;
@@ -867,8 +900,6 @@ EXPORT_SYMBOL_GPL(orderly_reboot);
  */
 static void hw_failure_emergency_poweroff_func(struct work_struct *work)
 {
-       printk_prefer_direct_enter();
-
        /*
         * We have reached here after the emergency shutdown waiting period has
         * expired. This means orderly_poweroff has not been able to shut off
@@ -885,8 +916,6 @@ static void hw_failure_emergency_poweroff_func(struct work_struct *work)
         */
        pr_emerg("Hardware protection shutdown failed. Trying emergency restart\n");
        emergency_restart();
-
-       printk_prefer_direct_exit();
 }
 
 static DECLARE_DELAYED_WORK(hw_failure_emergency_poweroff_work,
@@ -925,13 +954,11 @@ void hw_protection_shutdown(const char *reason, int ms_until_forced)
 {
        static atomic_t allow_proceed = ATOMIC_INIT(1);
 
-       printk_prefer_direct_enter();
-
        pr_emerg("HARDWARE PROTECTION shutdown (%s)\n", reason);
 
        /* Shutdown should be initiated only once. */
        if (!atomic_dec_and_test(&allow_proceed))
-               goto out;
+               return;
 
        /*
         * Queue a backup emergency shutdown in the event of
@@ -939,8 +966,6 @@ void hw_protection_shutdown(const char *reason, int ms_until_forced)
         */
        hw_failure_emergency_poweroff(ms_until_forced);
        orderly_poweroff(true);
-out:
-       printk_prefer_direct_exit();
 }
 EXPORT_SYMBOL_GPL(hw_protection_shutdown);
 
index bfa7452..da0bf6f 100644 (file)
@@ -4798,25 +4798,55 @@ static void do_balance_callbacks(struct rq *rq, struct callback_head *head)
 
 static void balance_push(struct rq *rq);
 
+/*
+ * balance_push_callback is a right abuse of the callback interface and plays
+ * by significantly different rules.
+ *
+ * Where the normal balance_callback's purpose is to be ran in the same context
+ * that queued it (only later, when it's safe to drop rq->lock again),
+ * balance_push_callback is specifically targeted at __schedule().
+ *
+ * This abuse is tolerated because it places all the unlikely/odd cases behind
+ * a single test, namely: rq->balance_callback == NULL.
+ */
 struct callback_head balance_push_callback = {
        .next = NULL,
        .func = (void (*)(struct callback_head *))balance_push,
 };
 
-static inline struct callback_head *splice_balance_callbacks(struct rq *rq)
+static inline struct callback_head *
+__splice_balance_callbacks(struct rq *rq, bool split)
 {
        struct callback_head *head = rq->balance_callback;
 
+       if (likely(!head))
+               return NULL;
+
        lockdep_assert_rq_held(rq);
-       if (head)
+       /*
+        * Must not take balance_push_callback off the list when
+        * splice_balance_callbacks() and balance_callbacks() are not
+        * in the same rq->lock section.
+        *
+        * In that case it would be possible for __schedule() to interleave
+        * and observe the list empty.
+        */
+       if (split && head == &balance_push_callback)
+               head = NULL;
+       else
                rq->balance_callback = NULL;
 
        return head;
 }
 
+static inline struct callback_head *splice_balance_callbacks(struct rq *rq)
+{
+       return __splice_balance_callbacks(rq, true);
+}
+
 static void __balance_callbacks(struct rq *rq)
 {
-       do_balance_callbacks(rq, splice_balance_callbacks(rq));
+       do_balance_callbacks(rq, __splice_balance_callbacks(rq, false));
 }
 
 static inline void balance_callbacks(struct rq *rq, struct callback_head *head)
index 0125961..47b89a0 100644 (file)
@@ -1693,6 +1693,11 @@ queue_balance_callback(struct rq *rq,
 {
        lockdep_assert_rq_held(rq);
 
+       /*
+        * Don't (re)queue an already queued item; nor queue anything when
+        * balance_push() is active, see the comment with
+        * balance_push_callback.
+        */
        if (unlikely(head->next || rq->balance_callback == &balance_push_callback))
                return;
 
index 10a32b0..fe04c6f 100644 (file)
@@ -770,14 +770,11 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
  **/
 void blk_trace_shutdown(struct request_queue *q)
 {
-       mutex_lock(&q->debugfs_mutex);
        if (rcu_dereference_protected(q->blk_trace,
                                      lockdep_is_held(&q->debugfs_mutex))) {
                __blk_trace_startstop(q, 0);
                __blk_trace_remove(q);
        }
-
-       mutex_unlock(&q->debugfs_mutex);
 }
 
 #ifdef CONFIG_BLK_CGROUP
index 10b157a..88589d7 100644 (file)
@@ -2263,11 +2263,11 @@ static int copy_user_syms(struct user_syms *us, unsigned long __user *usyms, u32
        int err = -ENOMEM;
        unsigned int i;
 
-       syms = kvmalloc(cnt * sizeof(*syms), GFP_KERNEL);
+       syms = kvmalloc_array(cnt, sizeof(*syms), GFP_KERNEL);
        if (!syms)
                goto error;
 
-       buf = kvmalloc(cnt * KSYM_NAME_LEN, GFP_KERNEL);
+       buf = kvmalloc_array(cnt, KSYM_NAME_LEN, GFP_KERNEL);
        if (!buf)
                goto error;
 
@@ -2423,7 +2423,7 @@ kprobe_multi_link_handler(struct fprobe *fp, unsigned long entry_ip,
        kprobe_multi_link_prog_run(link, entry_ip, regs);
 }
 
-static int symbols_cmp(const void *a, const void *b)
+static int symbols_cmp_r(const void *a, const void *b, const void *priv)
 {
        const char **str_a = (const char **) a;
        const char **str_b = (const char **) b;
@@ -2431,6 +2431,28 @@ static int symbols_cmp(const void *a, const void *b)
        return strcmp(*str_a, *str_b);
 }
 
+struct multi_symbols_sort {
+       const char **funcs;
+       u64 *cookies;
+};
+
+static void symbols_swap_r(void *a, void *b, int size, const void *priv)
+{
+       const struct multi_symbols_sort *data = priv;
+       const char **name_a = a, **name_b = b;
+
+       swap(*name_a, *name_b);
+
+       /* If defined, swap also related cookies. */
+       if (data->cookies) {
+               u64 *cookie_a, *cookie_b;
+
+               cookie_a = data->cookies + (name_a - data->funcs);
+               cookie_b = data->cookies + (name_b - data->funcs);
+               swap(*cookie_a, *cookie_b);
+       }
+}
+
 int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
 {
        struct bpf_kprobe_multi_link *link = NULL;
@@ -2464,42 +2486,50 @@ int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *pr
                return -EINVAL;
 
        size = cnt * sizeof(*addrs);
-       addrs = kvmalloc(size, GFP_KERNEL);
+       addrs = kvmalloc_array(cnt, sizeof(*addrs), GFP_KERNEL);
        if (!addrs)
                return -ENOMEM;
 
+       ucookies = u64_to_user_ptr(attr->link_create.kprobe_multi.cookies);
+       if (ucookies) {
+               cookies = kvmalloc_array(cnt, sizeof(*addrs), GFP_KERNEL);
+               if (!cookies) {
+                       err = -ENOMEM;
+                       goto error;
+               }
+               if (copy_from_user(cookies, ucookies, size)) {
+                       err = -EFAULT;
+                       goto error;
+               }
+       }
+
        if (uaddrs) {
                if (copy_from_user(addrs, uaddrs, size)) {
                        err = -EFAULT;
                        goto error;
                }
        } else {
+               struct multi_symbols_sort data = {
+                       .cookies = cookies,
+               };
                struct user_syms us;
 
                err = copy_user_syms(&us, usyms, cnt);
                if (err)
                        goto error;
 
-               sort(us.syms, cnt, sizeof(*us.syms), symbols_cmp, NULL);
+               if (cookies)
+                       data.funcs = us.syms;
+
+               sort_r(us.syms, cnt, sizeof(*us.syms), symbols_cmp_r,
+                      symbols_swap_r, &data);
+
                err = ftrace_lookup_symbols(us.syms, cnt, addrs);
                free_user_syms(&us);
                if (err)
                        goto error;
        }
 
-       ucookies = u64_to_user_ptr(attr->link_create.kprobe_multi.cookies);
-       if (ucookies) {
-               cookies = kvmalloc(size, GFP_KERNEL);
-               if (!cookies) {
-                       err = -ENOMEM;
-                       goto error;
-               }
-               if (copy_from_user(cookies, ucookies, size)) {
-                       err = -EFAULT;
-                       goto error;
-               }
-       }
-
        link = kzalloc(sizeof(*link), GFP_KERNEL);
        if (!link) {
                err = -ENOMEM;
index e750fe1..601ccf1 100644 (file)
@@ -8029,15 +8029,23 @@ static int kallsyms_callback(void *data, const char *name,
                             struct module *mod, unsigned long addr)
 {
        struct kallsyms_data *args = data;
+       const char **sym;
+       int idx;
 
-       if (!bsearch(&name, args->syms, args->cnt, sizeof(*args->syms), symbols_cmp))
+       sym = bsearch(&name, args->syms, args->cnt, sizeof(*args->syms), symbols_cmp);
+       if (!sym)
+               return 0;
+
+       idx = sym - args->syms;
+       if (args->addrs[idx])
                return 0;
 
        addr = ftrace_location(addr);
        if (!addr)
                return 0;
 
-       args->addrs[args->found++] = addr;
+       args->addrs[idx] = addr;
+       args->found++;
        return args->found == args->cnt ? 1 : 0;
 }
 
@@ -8062,6 +8070,7 @@ int ftrace_lookup_symbols(const char **sorted_syms, size_t cnt, unsigned long *a
        struct kallsyms_data args;
        int err;
 
+       memset(addrs, 0, sizeof(*addrs) * cnt);
        args.addrs = addrs;
        args.syms = sorted_syms;
        args.cnt = cnt;
index b568337..c69d822 100644 (file)
@@ -154,6 +154,15 @@ struct rethook_node *rethook_try_get(struct rethook *rh)
        if (unlikely(!handler))
                return NULL;
 
+       /*
+        * This expects the caller will set up a rethook on a function entry.
+        * When the function returns, the rethook will eventually be reclaimed
+        * or released in the rethook_recycle() with call_rcu().
+        * This means the caller must be run in the RCU-availabe context.
+        */
+       if (unlikely(!rcu_is_watching()))
+               return NULL;
+
        fn = freelist_try_get(&rh->pool);
        if (!fn)
                return NULL;
index 2c95992..a8cfac0 100644 (file)
@@ -6424,9 +6424,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)
                synchronize_rcu();
                free_snapshot(tr);
        }
-#endif
 
-#ifdef CONFIG_TRACER_MAX_TRACE
        if (t->use_max_tr && !had_max_tr) {
                ret = tracing_alloc_snapshot_instance(tr);
                if (ret < 0)
index 9350733..a245ea6 100644 (file)
@@ -1718,8 +1718,17 @@ static int
 kretprobe_dispatcher(struct kretprobe_instance *ri, struct pt_regs *regs)
 {
        struct kretprobe *rp = get_kretprobe(ri);
-       struct trace_kprobe *tk = container_of(rp, struct trace_kprobe, rp);
+       struct trace_kprobe *tk;
+
+       /*
+        * There is a small chance that get_kretprobe(ri) returns NULL when
+        * the kretprobe is unregister on another CPU between kretprobe's
+        * trampoline_handler and this function.
+        */
+       if (unlikely(!rp))
+               return 0;
 
+       tk = container_of(rp, struct trace_kprobe, rp);
        raw_cpu_inc(*tk->nhit);
 
        if (trace_probe_test_flag(&tk->tp, TP_FLAG_TRACE))
index 9711589..c3dc4f8 100644 (file)
@@ -546,7 +546,6 @@ static int __trace_uprobe_create(int argc, const char **argv)
        bool is_return = false;
        int i, ret;
 
-       ret = 0;
        ref_ctr_offset = 0;
 
        switch (argv[0][0]) {
index 20a7a55..ecb0e83 100644 (file)
@@ -424,8 +424,6 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
                /* Start period for the next softlockup warning. */
                update_report_ts();
 
-               printk_prefer_direct_enter();
-
                pr_emerg("BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n",
                        smp_processor_id(), duration,
                        current->comm, task_pid_nr(current));
@@ -444,8 +442,6 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
                add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK);
                if (softlockup_panic)
                        panic("softlockup: hung tasks");
-
-               printk_prefer_direct_exit();
        }
 
        return HRTIMER_RESTART;
index 701f35f..247bf0b 100644 (file)
@@ -135,8 +135,6 @@ static void watchdog_overflow_callback(struct perf_event *event,
                if (__this_cpu_read(hard_watchdog_warn) == true)
                        return;
 
-               printk_prefer_direct_enter();
-
                pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n",
                         this_cpu);
                print_modules();
@@ -157,8 +155,6 @@ static void watchdog_overflow_callback(struct perf_event *event,
                if (hardlockup_panic)
                        nmi_panic(regs, "Hard LOCKUP");
 
-               printk_prefer_direct_exit();
-
                __this_cpu_write(hard_watchdog_warn, true);
                return;
        }
index 4056f2a..1ea50f6 100644 (file)
@@ -2788,13 +2788,13 @@ static bool flush_workqueue_prep_pwqs(struct workqueue_struct *wq,
 }
 
 /**
- * flush_workqueue - ensure that any scheduled work has run to completion.
+ * __flush_workqueue - ensure that any scheduled work has run to completion.
  * @wq: workqueue to flush
  *
  * This function sleeps until all work items which were queued on entry
  * have finished execution, but it is not livelocked by new incoming ones.
  */
-void flush_workqueue(struct workqueue_struct *wq)
+void __flush_workqueue(struct workqueue_struct *wq)
 {
        struct wq_flusher this_flusher = {
                .list = LIST_HEAD_INIT(this_flusher.list),
@@ -2943,7 +2943,7 @@ void flush_workqueue(struct workqueue_struct *wq)
 out_unlock:
        mutex_unlock(&wq->mutex);
 }
-EXPORT_SYMBOL(flush_workqueue);
+EXPORT_SYMBOL(__flush_workqueue);
 
 /**
  * drain_workqueue - drain a workqueue
@@ -2971,7 +2971,7 @@ void drain_workqueue(struct workqueue_struct *wq)
                wq->flags |= __WQ_DRAINING;
        mutex_unlock(&wq->mutex);
 reflush:
-       flush_workqueue(wq);
+       __flush_workqueue(wq);
 
        mutex_lock(&wq->mutex);
 
@@ -6111,3 +6111,11 @@ void __init workqueue_init(void)
        wq_online = true;
        wq_watchdog_init();
 }
+
+/*
+ * Despite the naming, this is a no-op function which is here only for avoiding
+ * link error. Since compile-time warning may fail to catch, we will need to
+ * emit run-time warning from __flush_workqueue().
+ */
+void __warn_flushing_systemwide_wq(void) { }
+EXPORT_SYMBOL(__warn_flushing_systemwide_wq);
index 6a84363..eaaad4d 100644 (file)
@@ -120,6 +120,9 @@ config INDIRECT_IOMEM_FALLBACK
 
 source "lib/crypto/Kconfig"
 
+config LIB_MEMNEQ
+       bool
+
 config CRC_CCITT
        tristate "CRC-CCITT functions"
        help
index c4fe15d..a9f7eb0 100644 (file)
@@ -94,7 +94,7 @@ config UBSAN_UNREACHABLE
        bool "Perform checking for unreachable code"
        # objtool already handles unreachable checking and gets angry about
        # seeing UBSan instrumentation located in unreachable places.
-       depends on !(OBJTOOL && (STACK_VALIDATION || UNWINDER_ORC || X86_SMAP))
+       depends on !(OBJTOOL && (STACK_VALIDATION || UNWINDER_ORC || HAVE_UACCESS_VALIDATION))
        depends on $(cc-option,-fsanitize=unreachable)
        help
          This option enables -fsanitize=unreachable which checks for control
index ea54294..f99bf61 100644 (file)
@@ -251,6 +251,7 @@ obj-$(CONFIG_DIMLIB) += dim/
 obj-$(CONFIG_SIGNATURE) += digsig.o
 
 lib-$(CONFIG_CLZ_TAB) += clz_tab.o
+lib-$(CONFIG_LIB_MEMNEQ) += memneq.o
 
 obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
 obj-$(CONFIG_GENERIC_STRNLEN_USER) += strnlen_user.o
index 1974b35..1d26a16 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/module.h>
 #include <linux/crc-itu-t.h>
 
-/** CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^15 + 1) */
+/* CRC table for the CRC ITU-T V.41 0x1021 (x^16 + x^12 + x^5 + 1) */
 const u16 crc_itu_t_table[256] = {
        0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
        0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
index 9856e29..2082af4 100644 (file)
@@ -71,6 +71,7 @@ config CRYPTO_LIB_CURVE25519
        tristate "Curve25519 scalar multiplication library"
        depends on CRYPTO_ARCH_HAVE_LIB_CURVE25519 || !CRYPTO_ARCH_HAVE_LIB_CURVE25519
        select CRYPTO_LIB_CURVE25519_GENERIC if CRYPTO_ARCH_HAVE_LIB_CURVE25519=n
+       select LIB_MEMNEQ
        help
          Enable the Curve25519 library interface. This interface may be
          fulfilled by either the generic implementation or an arch-specific
index 6dd5330..0b64695 100644 (file)
@@ -1434,7 +1434,7 @@ static ssize_t iter_xarray_get_pages(struct iov_iter *i,
 {
        unsigned nr, offset;
        pgoff_t index, count;
-       size_t size = maxsize, actual;
+       size_t size = maxsize;
        loff_t pos;
 
        if (!size || !maxpages)
@@ -1461,13 +1461,7 @@ static ssize_t iter_xarray_get_pages(struct iov_iter *i,
        if (nr == 0)
                return 0;
 
-       actual = PAGE_SIZE * nr;
-       actual -= offset;
-       if (nr == count && size > 0) {
-               unsigned last_offset = (nr > 1) ? 0 : offset;
-               actual -= PAGE_SIZE - (last_offset + size);
-       }
-       return actual;
+       return min_t(size_t, nr * PAGE_SIZE - offset, maxsize);
 }
 
 /* must be done on non-empty ITER_IOVEC one */
@@ -1602,7 +1596,7 @@ static ssize_t iter_xarray_get_pages_alloc(struct iov_iter *i,
        struct page **p;
        unsigned nr, offset;
        pgoff_t index, count;
-       size_t size = maxsize, actual;
+       size_t size = maxsize;
        loff_t pos;
 
        if (!size)
@@ -1631,13 +1625,7 @@ static ssize_t iter_xarray_get_pages_alloc(struct iov_iter *i,
        if (nr == 0)
                return 0;
 
-       actual = PAGE_SIZE * nr;
-       actual -= offset;
-       if (nr == count && size > 0) {
-               unsigned last_offset = (nr > 1) ? 0 : offset;
-               actual -= PAGE_SIZE - (last_offset + size);
-       }
-       return actual;
+       return min_t(size_t, nr * PAGE_SIZE - offset, maxsize);
 }
 
 ssize_t iov_iter_get_pages_alloc(struct iov_iter *i,
diff --git a/lib/memneq.c b/lib/memneq.c
new file mode 100644 (file)
index 0000000..fb11608
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * Constant-time equality testing of memory regions.
+ *
+ * Authors:
+ *
+ *   James Yonan <james@openvpn.net>
+ *   Daniel Borkmann <dborkman@redhat.com>
+ *
+ * This file is provided under a dual BSD/GPLv2 license.  When using or
+ * redistributing this file, you may do so under either license.
+ *
+ * GPL LICENSE SUMMARY
+ *
+ * Copyright(c) 2013 OpenVPN Technologies, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ * The full GNU General Public License is included in this distribution
+ * in the file called LICENSE.GPL.
+ *
+ * BSD LICENSE
+ *
+ * Copyright(c) 2013 OpenVPN Technologies, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of OpenVPN Technologies nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <crypto/algapi.h>
+#include <asm/unaligned.h>
+
+#ifndef __HAVE_ARCH_CRYPTO_MEMNEQ
+
+/* Generic path for arbitrary size */
+static inline unsigned long
+__crypto_memneq_generic(const void *a, const void *b, size_t size)
+{
+       unsigned long neq = 0;
+
+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
+       while (size >= sizeof(unsigned long)) {
+               neq |= get_unaligned((unsigned long *)a) ^
+                      get_unaligned((unsigned long *)b);
+               OPTIMIZER_HIDE_VAR(neq);
+               a += sizeof(unsigned long);
+               b += sizeof(unsigned long);
+               size -= sizeof(unsigned long);
+       }
+#endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
+       while (size > 0) {
+               neq |= *(unsigned char *)a ^ *(unsigned char *)b;
+               OPTIMIZER_HIDE_VAR(neq);
+               a += 1;
+               b += 1;
+               size -= 1;
+       }
+       return neq;
+}
+
+/* Loop-free fast-path for frequently used 16-byte size */
+static inline unsigned long __crypto_memneq_16(const void *a, const void *b)
+{
+       unsigned long neq = 0;
+
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+       if (sizeof(unsigned long) == 8) {
+               neq |= get_unaligned((unsigned long *)a) ^
+                      get_unaligned((unsigned long *)b);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= get_unaligned((unsigned long *)(a + 8)) ^
+                      get_unaligned((unsigned long *)(b + 8));
+               OPTIMIZER_HIDE_VAR(neq);
+       } else if (sizeof(unsigned int) == 4) {
+               neq |= get_unaligned((unsigned int *)a) ^
+                      get_unaligned((unsigned int *)b);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= get_unaligned((unsigned int *)(a + 4)) ^
+                      get_unaligned((unsigned int *)(b + 4));
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= get_unaligned((unsigned int *)(a + 8)) ^
+                      get_unaligned((unsigned int *)(b + 8));
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= get_unaligned((unsigned int *)(a + 12)) ^
+                      get_unaligned((unsigned int *)(b + 12));
+               OPTIMIZER_HIDE_VAR(neq);
+       } else
+#endif /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
+       {
+               neq |= *(unsigned char *)(a)    ^ *(unsigned char *)(b);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+1)  ^ *(unsigned char *)(b+1);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+2)  ^ *(unsigned char *)(b+2);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+3)  ^ *(unsigned char *)(b+3);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+4)  ^ *(unsigned char *)(b+4);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+5)  ^ *(unsigned char *)(b+5);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+6)  ^ *(unsigned char *)(b+6);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+7)  ^ *(unsigned char *)(b+7);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+8)  ^ *(unsigned char *)(b+8);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+9)  ^ *(unsigned char *)(b+9);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+10) ^ *(unsigned char *)(b+10);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+11) ^ *(unsigned char *)(b+11);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+12) ^ *(unsigned char *)(b+12);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+13) ^ *(unsigned char *)(b+13);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+14) ^ *(unsigned char *)(b+14);
+               OPTIMIZER_HIDE_VAR(neq);
+               neq |= *(unsigned char *)(a+15) ^ *(unsigned char *)(b+15);
+               OPTIMIZER_HIDE_VAR(neq);
+       }
+
+       return neq;
+}
+
+/* Compare two areas of memory without leaking timing information,
+ * and with special optimizations for common sizes.  Users should
+ * not call this function directly, but should instead use
+ * crypto_memneq defined in crypto/algapi.h.
+ */
+noinline unsigned long __crypto_memneq(const void *a, const void *b,
+                                      size_t size)
+{
+       switch (size) {
+       case 16:
+               return __crypto_memneq_16(a, b);
+       default:
+               return __crypto_memneq_generic(a, b, size);
+       }
+}
+EXPORT_SYMBOL(__crypto_memneq);
+
+#endif /* __HAVE_ARCH_CRYPTO_MEMNEQ */
index fb77f7b..3c1853a 100644 (file)
@@ -769,8 +769,7 @@ static inline int __ptr_to_hashval(const void *ptr, unsigned long *hashval_out)
                static DECLARE_WORK(enable_ptr_key_work, enable_ptr_key_workfn);
                unsigned long flags;
 
-               if (!system_unbound_wq ||
-                   (!rng_is_initialized() && !rng_has_arch_random()) ||
+               if (!system_unbound_wq || !rng_is_initialized() ||
                    !spin_trylock_irqsave(&filling, flags))
                        return -EAGAIN;
 
index 54e646e..ea9ce1f 100644 (file)
@@ -264,9 +264,10 @@ static void xa_node_free(struct xa_node *node)
  * xas_destroy() - Free any resources allocated during the XArray operation.
  * @xas: XArray operation state.
  *
- * This function is now internal-only.
+ * Most users will not need to call this function; it is called for you
+ * by xas_nomem().
  */
-static void xas_destroy(struct xa_state *xas)
+void xas_destroy(struct xa_state *xas)
 {
        struct xa_node *next, *node = xas->xa_alloc;
 
index ff60bd7..95550b8 100644 (file)
@@ -231,20 +231,13 @@ static __init int bdi_class_init(void)
 }
 postcore_initcall(bdi_class_init);
 
-static int bdi_init(struct backing_dev_info *bdi);
-
 static int __init default_bdi_init(void)
 {
-       int err;
-
        bdi_wq = alloc_workqueue("writeback", WQ_MEM_RECLAIM | WQ_UNBOUND |
                                 WQ_SYSFS, 0);
        if (!bdi_wq)
                return -ENOMEM;
-
-       err = bdi_init(&noop_backing_dev_info);
-
-       return err;
+       return 0;
 }
 subsys_initcall(default_bdi_init);
 
@@ -781,7 +774,7 @@ static void cgwb_remove_from_bdi_list(struct bdi_writeback *wb)
 
 #endif /* CONFIG_CGROUP_WRITEBACK */
 
-static int bdi_init(struct backing_dev_info *bdi)
+int bdi_init(struct backing_dev_info *bdi)
 {
        int ret;
 
index 8efbfb2..4b07c29 100644 (file)
@@ -374,6 +374,8 @@ static void damon_reclaim_timer_fn(struct work_struct *work)
 }
 static DECLARE_DELAYED_WORK(damon_reclaim_timer, damon_reclaim_timer_fn);
 
+static bool damon_reclaim_initialized;
+
 static int enabled_store(const char *val,
                const struct kernel_param *kp)
 {
@@ -382,6 +384,10 @@ static int enabled_store(const char *val,
        if (rc < 0)
                return rc;
 
+       /* system_wq might not initialized yet */
+       if (!damon_reclaim_initialized)
+               return rc;
+
        if (enabled)
                schedule_delayed_work(&damon_reclaim_timer, 0);
 
@@ -449,6 +455,8 @@ static int __init damon_reclaim_init(void)
        damon_add_target(ctx, target);
 
        schedule_delayed_work(&damon_reclaim_timer, 0);
+
+       damon_reclaim_initialized = true;
        return 0;
 }
 
index 9daeaab..ffdfbc8 100644 (file)
@@ -2385,6 +2385,8 @@ static void filemap_get_read_batch(struct address_space *mapping,
                        continue;
                if (xas.xa_index > max || xa_is_value(folio))
                        break;
+               if (xa_is_sibling(folio))
+                       break;
                if (!folio_try_get_rcu(folio))
                        goto retry;
 
@@ -2629,6 +2631,13 @@ err:
        return err;
 }
 
+static inline bool pos_same_folio(loff_t pos1, loff_t pos2, struct folio *folio)
+{
+       unsigned int shift = folio_shift(folio);
+
+       return (pos1 >> shift == pos2 >> shift);
+}
+
 /**
  * filemap_read - Read data from the page cache.
  * @iocb: The iocb to read.
@@ -2700,11 +2709,11 @@ ssize_t filemap_read(struct kiocb *iocb, struct iov_iter *iter,
                writably_mapped = mapping_writably_mapped(mapping);
 
                /*
-                * When a sequential read accesses a page several times, only
+                * When a read accesses the same folio several times, only
                 * mark it as accessed the first time.
                 */
-               if (iocb->ki_pos >> PAGE_SHIFT !=
-                   ra->prev_pos >> PAGE_SHIFT)
+               if (!pos_same_folio(iocb->ki_pos, ra->prev_pos - 1,
+                                                       fbatch.folios[0]))
                        folio_mark_accessed(fbatch.folios[0]);
 
                for (i = 0; i < folio_batch_count(&fbatch); i++) {
@@ -2991,11 +3000,12 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
        struct address_space *mapping = file->f_mapping;
        DEFINE_READAHEAD(ractl, file, ra, mapping, vmf->pgoff);
        struct file *fpin = NULL;
+       unsigned long vm_flags = vmf->vma->vm_flags;
        unsigned int mmap_miss;
 
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
        /* Use the readahead code, even if readahead is disabled */
-       if (vmf->vma->vm_flags & VM_HUGEPAGE) {
+       if (vm_flags & VM_HUGEPAGE) {
                fpin = maybe_unlock_mmap_for_io(vmf, fpin);
                ractl._index &= ~((unsigned long)HPAGE_PMD_NR - 1);
                ra->size = HPAGE_PMD_NR;
@@ -3003,7 +3013,7 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
                 * Fetch two PMD folios, so we get the chance to actually
                 * readahead, unless we've been told not to.
                 */
-               if (!(vmf->vma->vm_flags & VM_RAND_READ))
+               if (!(vm_flags & VM_RAND_READ))
                        ra->size *= 2;
                ra->async_size = HPAGE_PMD_NR;
                page_cache_ra_order(&ractl, ra, HPAGE_PMD_ORDER);
@@ -3012,12 +3022,12 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf)
 #endif
 
        /* If we don't want any read-ahead, don't bother */
-       if (vmf->vma->vm_flags & VM_RAND_READ)
+       if (vm_flags & VM_RAND_READ)
                return fpin;
        if (!ra->ra_pages)
                return fpin;
 
-       if (vmf->vma->vm_flags & VM_SEQ_READ) {
+       if (vm_flags & VM_SEQ_READ) {
                fpin = maybe_unlock_mmap_for_io(vmf, fpin);
                page_cache_sync_ra(&ractl, ra->ra_pages);
                return fpin;
index a77c78a..834f288 100644 (file)
@@ -2377,6 +2377,7 @@ static void __split_huge_page_tail(struct page *head, int tail,
                        page_tail);
        page_tail->mapping = head->mapping;
        page_tail->index = head->index + tail;
+       page_tail->private = 0;
 
        /* Page flags must be visible before we make the page non-compound. */
        smp_wmb();
@@ -2672,8 +2673,7 @@ out_unlock:
        if (mapping)
                i_mmap_unlock_read(mapping);
 out:
-       /* Free any memory we didn't use */
-       xas_nomem(&xas, 0);
+       xas_destroy(&xas);
        count_vm_event(!ret ? THP_SPLIT_PAGE : THP_SPLIT_PAGE_FAILED);
        return ret;
 }
index 5c0cddd..65e242b 100644 (file)
@@ -48,7 +48,7 @@ static int hwpoison_inject(void *data, u64 val)
 
 inject:
        pr_info("Injecting memory failure at pfn %#lx\n", pfn);
-       err = memory_failure(pfn, 0);
+       err = memory_failure(pfn, MF_SW_SIMULATED);
        return (err == -EOPNOTSUPP) ? 0 : err;
 }
 
index 4e7cd4c..4b5e5a3 100644 (file)
@@ -360,6 +360,9 @@ static void *kfence_guarded_alloc(struct kmem_cache *cache, size_t size, gfp_t g
        unsigned long flags;
        struct slab *slab;
        void *addr;
+       const bool random_right_allocate = prandom_u32_max(2);
+       const bool random_fault = CONFIG_KFENCE_STRESS_TEST_FAULTS &&
+                                 !prandom_u32_max(CONFIG_KFENCE_STRESS_TEST_FAULTS);
 
        /* Try to obtain a free object. */
        raw_spin_lock_irqsave(&kfence_freelist_lock, flags);
@@ -404,7 +407,7 @@ static void *kfence_guarded_alloc(struct kmem_cache *cache, size_t size, gfp_t g
         * is that the out-of-bounds accesses detected are deterministic for
         * such allocations.
         */
-       if (prandom_u32_max(2)) {
+       if (random_right_allocate) {
                /* Allocate on the "right" side, re-calculate address. */
                meta->addr += PAGE_SIZE - size;
                meta->addr = ALIGN_DOWN(meta->addr, cache->align);
@@ -444,7 +447,7 @@ static void *kfence_guarded_alloc(struct kmem_cache *cache, size_t size, gfp_t g
        if (cache->ctor)
                cache->ctor(addr);
 
-       if (CONFIG_KFENCE_STRESS_TEST_FAULTS && !prandom_u32_max(CONFIG_KFENCE_STRESS_TEST_FAULTS))
+       if (random_fault)
                kfence_protect(meta->addr); /* Random "faults" by protecting the object. */
 
        atomic_long_inc(&counters[KFENCE_COUNTER_ALLOCATED]);
index d7b4f26..0316bbc 100644 (file)
@@ -1112,7 +1112,7 @@ static int madvise_inject_error(int behavior,
                } else {
                        pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n",
                                 pfn, start);
-                       ret = memory_failure(pfn, MF_COUNT_INCREASED);
+                       ret = memory_failure(pfn, MF_COUNT_INCREASED | MF_SW_SIMULATED);
                        if (ret == -EOPNOTSUPP)
                                ret = 0;
                }
index abec50f..618c366 100644 (file)
@@ -4859,7 +4859,7 @@ static int mem_cgroup_slab_show(struct seq_file *m, void *p)
 {
        /*
         * Deprecated.
-        * Please, take a look at tools/cgroup/slabinfo.py .
+        * Please, take a look at tools/cgroup/memcg_slabinfo.py .
         */
        return 0;
 }
index b85661c..da39ec8 100644 (file)
@@ -69,6 +69,8 @@ int sysctl_memory_failure_recovery __read_mostly = 1;
 
 atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0);
 
+static bool hw_memory_failure __read_mostly = false;
+
 static bool __page_handle_poison(struct page *page)
 {
        int ret;
@@ -1768,6 +1770,9 @@ int memory_failure(unsigned long pfn, int flags)
 
        mutex_lock(&mf_mutex);
 
+       if (!(flags & MF_SW_SIMULATED))
+               hw_memory_failure = true;
+
        p = pfn_to_online_page(pfn);
        if (!p) {
                res = arch_memory_failure(pfn, flags);
@@ -2103,6 +2108,13 @@ int unpoison_memory(unsigned long pfn)
 
        mutex_lock(&mf_mutex);
 
+       if (hw_memory_failure) {
+               unpoison_pr_info("Unpoison: Disabled after HW memory failure %#lx\n",
+                                pfn, &unpoison_rs);
+               ret = -EOPNOTSUPP;
+               goto unlock_mutex;
+       }
+
        if (!PageHWPoison(p)) {
                unpoison_pr_info("Unpoison: Page was already unpoisoned %#lx\n",
                                 pfn, &unpoison_rs);
index e51588e..6c1ea61 100644 (file)
@@ -1106,6 +1106,7 @@ static int unmap_and_move(new_page_t get_new_page,
        if (!newpage)
                return -ENOMEM;
 
+       newpage->private = 0;
        rc = __unmap_and_move(page, newpage, force, mode);
        if (rc == MIGRATEPAGE_SUCCESS)
                set_page_owner_migrate_reason(newpage, reason);
index d200d41..9d73dc3 100644 (file)
@@ -286,6 +286,8 @@ __first_valid_page(unsigned long pfn, unsigned long nr_pages)
  * @flags:                     isolation flags
  * @gfp_flags:                 GFP flags used for migrating pages
  * @isolate_before:    isolate the pageblock before the boundary_pfn
+ * @skip_isolation:    the flag to skip the pageblock isolation in second
+ *                     isolate_single_pageblock()
  *
  * Free and in-use pages can be as big as MAX_ORDER-1 and contain more than one
  * pageblock. When not all pageblocks within a page are isolated at the same
index 415c39d..fdcd28c 100644 (file)
@@ -164,12 +164,14 @@ static void read_pages(struct readahead_control *rac)
                while ((folio = readahead_folio(rac)) != NULL) {
                        unsigned long nr = folio_nr_pages(folio);
 
+                       folio_get(folio);
                        rac->ra->size -= nr;
                        if (rac->ra->async_size >= nr) {
                                rac->ra->async_size -= nr;
                                filemap_remove_folio(folio);
                        }
                        folio_unlock(folio);
+                       folio_put(folio);
                }
        } else {
                while ((folio = readahead_folio(rac)) != NULL)
@@ -508,6 +510,7 @@ void page_cache_ra_order(struct readahead_control *ractl,
                        new_order--;
        }
 
+       filemap_invalidate_lock_shared(mapping);
        while (index <= limit) {
                unsigned int order = new_order;
 
@@ -534,6 +537,7 @@ void page_cache_ra_order(struct readahead_control *ractl,
        }
 
        read_pages(ractl);
+       filemap_invalidate_unlock_shared(mapping);
 
        /*
         * If there were already pages in the page cache, then we may have
index e553502..b1281b8 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -726,25 +726,48 @@ static struct track *get_track(struct kmem_cache *s, void *object,
        return kasan_reset_tag(p + alloc);
 }
 
-static void noinline set_track(struct kmem_cache *s, void *object,
-                       enum track_item alloc, unsigned long addr)
-{
-       struct track *p = get_track(s, object, alloc);
-
 #ifdef CONFIG_STACKDEPOT
+static noinline depot_stack_handle_t set_track_prepare(void)
+{
+       depot_stack_handle_t handle;
        unsigned long entries[TRACK_ADDRS_COUNT];
        unsigned int nr_entries;
 
        nr_entries = stack_trace_save(entries, ARRAY_SIZE(entries), 3);
-       p->handle = stack_depot_save(entries, nr_entries, GFP_NOWAIT);
+       handle = stack_depot_save(entries, nr_entries, GFP_NOWAIT);
+
+       return handle;
+}
+#else
+static inline depot_stack_handle_t set_track_prepare(void)
+{
+       return 0;
+}
 #endif
 
+static void set_track_update(struct kmem_cache *s, void *object,
+                            enum track_item alloc, unsigned long addr,
+                            depot_stack_handle_t handle)
+{
+       struct track *p = get_track(s, object, alloc);
+
+#ifdef CONFIG_STACKDEPOT
+       p->handle = handle;
+#endif
        p->addr = addr;
        p->cpu = smp_processor_id();
        p->pid = current->pid;
        p->when = jiffies;
 }
 
+static __always_inline void set_track(struct kmem_cache *s, void *object,
+                                     enum track_item alloc, unsigned long addr)
+{
+       depot_stack_handle_t handle = set_track_prepare();
+
+       set_track_update(s, object, alloc, addr, handle);
+}
+
 static void init_tracking(struct kmem_cache *s, void *object)
 {
        struct track *p;
@@ -1373,6 +1396,10 @@ static noinline int free_debug_processing(
        int cnt = 0;
        unsigned long flags, flags2;
        int ret = 0;
+       depot_stack_handle_t handle = 0;
+
+       if (s->flags & SLAB_STORE_USER)
+               handle = set_track_prepare();
 
        spin_lock_irqsave(&n->list_lock, flags);
        slab_lock(slab, &flags2);
@@ -1391,7 +1418,7 @@ next_object:
        }
 
        if (s->flags & SLAB_STORE_USER)
-               set_track(s, object, TRACK_FREE, addr);
+               set_track_update(s, object, TRACK_FREE, addr, handle);
        trace(s, slab, object, 0);
        /* Freepointer not overwritten by init_object(), SLAB_POISON moved it */
        init_object(s, object, SLUB_RED_INACTIVE);
@@ -2936,6 +2963,7 @@ redo:
 
        if (!freelist) {
                c->slab = NULL;
+               c->tid = next_tid(c->tid);
                local_unlock_irqrestore(&s->cpu_slab->lock, flags);
                stat(s, DEACTIVATE_BYPASS);
                goto new_slab;
@@ -2968,6 +2996,7 @@ deactivate_slab:
        freelist = c->freelist;
        c->slab = NULL;
        c->freelist = NULL;
+       c->tid = next_tid(c->tid);
        local_unlock_irqrestore(&s->cpu_slab->lock, flags);
        deactivate_slab(s, slab, freelist);
 
index f3922a9..034bb24 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -881,7 +881,7 @@ void lru_cache_disable(void)
         * lru_disable_count = 0 will have exited the critical
         * section when synchronize_rcu() returns.
         */
-       synchronize_rcu();
+       synchronize_rcu_expedited();
 #ifdef CONFIG_SMP
        __lru_add_drain_all(true);
 #else
index baeacc7..4e1da70 100644 (file)
@@ -161,29 +161,27 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n,
 static inline void check_heap_object(const void *ptr, unsigned long n,
                                     bool to_user)
 {
+       uintptr_t addr = (uintptr_t)ptr;
+       unsigned long offset;
        struct folio *folio;
 
        if (is_kmap_addr(ptr)) {
-               unsigned long page_end = (unsigned long)ptr | (PAGE_SIZE - 1);
-
-               if ((unsigned long)ptr + n - 1 > page_end)
-                       usercopy_abort("kmap", NULL, to_user,
-                                       offset_in_page(ptr), n);
+               offset = offset_in_page(ptr);
+               if (n > PAGE_SIZE - offset)
+                       usercopy_abort("kmap", NULL, to_user, offset, n);
                return;
        }
 
        if (is_vmalloc_addr(ptr)) {
-               struct vm_struct *area = find_vm_area(ptr);
-               unsigned long offset;
+               struct vmap_area *area = find_vmap_area(addr);
 
-               if (!area) {
+               if (!area)
                        usercopy_abort("vmalloc", "no area", to_user, 0, n);
-                       return;
-               }
 
-               offset = ptr - area->addr;
-               if (offset + n > get_vm_area_size(area))
+               if (n > area->va_end - addr) {
+                       offset = addr - area->va_start;
                        usercopy_abort("vmalloc", NULL, to_user, offset, n);
+               }
                return;
        }
 
@@ -196,8 +194,8 @@ static inline void check_heap_object(const void *ptr, unsigned long n,
                /* Check slab allocator for flags and size. */
                __check_heap_object(ptr, n, folio_slab(folio), to_user);
        } else if (folio_test_large(folio)) {
-               unsigned long offset = ptr - folio_address(folio);
-               if (offset + n > folio_size(folio))
+               offset = ptr - folio_address(folio);
+               if (n > folio_size(folio) - offset)
                        usercopy_abort("page alloc", NULL, to_user, offset, n);
        }
 }
index 07db424..effd1ff 100644 (file)
@@ -1798,7 +1798,7 @@ static void free_unmap_vmap_area(struct vmap_area *va)
        free_vmap_area_noflush(va);
 }
 
-static struct vmap_area *find_vmap_area(unsigned long addr)
+struct vmap_area *find_vmap_area(unsigned long addr)
 {
        struct vmap_area *va;
 
index 95393bb..4c7030e 100644 (file)
@@ -1661,9 +1661,12 @@ static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
                        int flags)
 {
        struct sock *sk = sock->sk;
-       struct sk_buff *skb;
+       struct sk_buff *skb, *last;
+       struct sk_buff_head *sk_queue;
        int copied;
        int err = 0;
+       int off = 0;
+       long timeo;
 
        lock_sock(sk);
        /*
@@ -1675,10 +1678,29 @@ static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
                goto out;
        }
 
-       /* Now we can treat all alike */
-       skb = skb_recv_datagram(sk, flags, &err);
-       if (skb == NULL)
-               goto out;
+       /*  We need support for non-blocking reads. */
+       sk_queue = &sk->sk_receive_queue;
+       skb = __skb_try_recv_datagram(sk, sk_queue, flags, &off, &err, &last);
+       /* If no packet is available, release_sock(sk) and try again. */
+       if (!skb) {
+               if (err != -EAGAIN)
+                       goto out;
+               release_sock(sk);
+               timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
+               while (timeo && !__skb_wait_for_more_packets(sk, sk_queue, &err,
+                                                            &timeo, last)) {
+                       skb = __skb_try_recv_datagram(sk, sk_queue, flags, &off,
+                                                     &err, &last);
+                       if (skb)
+                               break;
+
+                       if (err != -EAGAIN)
+                               goto done;
+               }
+               if (!skb)
+                       goto done;
+               lock_sock(sk);
+       }
 
        if (!sk_to_ax25(sk)->pidincl)
                skb_pull(skb, 1);               /* Remove PID */
@@ -1725,6 +1747,7 @@ static int ax25_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
 out:
        release_sock(sk);
 
+done:
        return err;
 }
 
index 08ce317..8e6f229 100644 (file)
@@ -397,16 +397,18 @@ static void list_netdevice(struct net_device *dev)
 /* Device list removal
  * caller must respect a RCU grace period before freeing/reusing dev
  */
-static void unlist_netdevice(struct net_device *dev)
+static void unlist_netdevice(struct net_device *dev, bool lock)
 {
        ASSERT_RTNL();
 
        /* Unlink dev from the device chain */
-       write_lock(&dev_base_lock);
+       if (lock)
+               write_lock(&dev_base_lock);
        list_del_rcu(&dev->dev_list);
        netdev_name_node_del(dev->name_node);
        hlist_del_rcu(&dev->index_hlist);
-       write_unlock(&dev_base_lock);
+       if (lock)
+               write_unlock(&dev_base_lock);
 
        dev_base_seq_inc(dev_net(dev));
 }
@@ -10043,11 +10045,11 @@ int register_netdevice(struct net_device *dev)
                goto err_uninit;
 
        ret = netdev_register_kobject(dev);
-       if (ret) {
-               dev->reg_state = NETREG_UNREGISTERED;
+       write_lock(&dev_base_lock);
+       dev->reg_state = ret ? NETREG_UNREGISTERED : NETREG_REGISTERED;
+       write_unlock(&dev_base_lock);
+       if (ret)
                goto err_uninit;
-       }
-       dev->reg_state = NETREG_REGISTERED;
 
        __netdev_update_features(dev);
 
@@ -10329,7 +10331,9 @@ void netdev_run_todo(void)
                        continue;
                }
 
+               write_lock(&dev_base_lock);
                dev->reg_state = NETREG_UNREGISTERED;
+               write_unlock(&dev_base_lock);
                linkwatch_forget_dev(dev);
        }
 
@@ -10810,9 +10814,10 @@ void unregister_netdevice_many(struct list_head *head)
 
        list_for_each_entry(dev, head, unreg_list) {
                /* And unlink it from device chain. */
-               unlist_netdevice(dev);
-
+               write_lock(&dev_base_lock);
+               unlist_netdevice(dev, false);
                dev->reg_state = NETREG_UNREGISTERING;
+               write_unlock(&dev_base_lock);
        }
        flush_all_backlogs();
 
@@ -10959,7 +10964,7 @@ int __dev_change_net_namespace(struct net_device *dev, struct net *net,
        dev_close(dev);
 
        /* And unlink it from device chain */
-       unlist_netdevice(dev);
+       unlist_netdevice(dev, true);
 
        synchronize_net();
 
index 5af58eb..5d16d66 100644 (file)
@@ -6516,10 +6516,21 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
                                           ifindex, proto, netns_id, flags);
 
        if (sk) {
-               sk = sk_to_full_sk(sk);
-               if (!sk_fullsock(sk)) {
+               struct sock *sk2 = sk_to_full_sk(sk);
+
+               /* sk_to_full_sk() may return (sk)->rsk_listener, so make sure the original sk
+                * sock refcnt is decremented to prevent a request_sock leak.
+                */
+               if (!sk_fullsock(sk2))
+                       sk2 = NULL;
+               if (sk2 != sk) {
                        sock_gen_put(sk);
-                       return NULL;
+                       /* Ensure there is no need to bump sk2 refcnt */
+                       if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) {
+                               WARN_ONCE(1, "Found non-RCU, unreferenced socket!");
+                               return NULL;
+                       }
+                       sk = sk2;
                }
        }
 
@@ -6553,10 +6564,21 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
                                         flags);
 
        if (sk) {
-               sk = sk_to_full_sk(sk);
-               if (!sk_fullsock(sk)) {
+               struct sock *sk2 = sk_to_full_sk(sk);
+
+               /* sk_to_full_sk() may return (sk)->rsk_listener, so make sure the original sk
+                * sock refcnt is decremented to prevent a request_sock leak.
+                */
+               if (!sk_fullsock(sk2))
+                       sk2 = NULL;
+               if (sk2 != sk) {
                        sock_gen_put(sk);
-                       return NULL;
+                       /* Ensure there is no need to bump sk2 refcnt */
+                       if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) {
+                               WARN_ONCE(1, "Found non-RCU, unreferenced socket!");
+                               return NULL;
+                       }
+                       sk = sk2;
                }
        }
 
index 73f68d4..929f637 100644 (file)
@@ -595,3 +595,9 @@ int flow_indr_dev_setup_offload(struct net_device *dev,     struct Qdisc *sch,
        return (bo && list_empty(&bo->cb_list)) ? -EOPNOTSUPP : count;
 }
 EXPORT_SYMBOL(flow_indr_dev_setup_offload);
+
+bool flow_indr_dev_exists(void)
+{
+       return !list_empty(&flow_block_indr_dev_list);
+}
+EXPORT_SYMBOL(flow_indr_dev_exists);
index e319e24..a364256 100644 (file)
@@ -33,6 +33,7 @@ static const char fmt_dec[] = "%d\n";
 static const char fmt_ulong[] = "%lu\n";
 static const char fmt_u64[] = "%llu\n";
 
+/* Caller holds RTNL or dev_base_lock */
 static inline int dev_isalive(const struct net_device *dev)
 {
        return dev->reg_state <= NETREG_REGISTERED;
index 22b983a..b0fcd02 100644 (file)
@@ -699,6 +699,11 @@ struct sk_psock *sk_psock_init(struct sock *sk, int node)
 
        write_lock_bh(&sk->sk_callback_lock);
 
+       if (sk_is_inet(sk) && inet_csk_has_ulp(sk)) {
+               psock = ERR_PTR(-EINVAL);
+               goto out;
+       }
+
        if (sk->sk_user_data) {
                psock = ERR_PTR(-EBUSY);
                goto out;
index 2e78458..eb8e128 100644 (file)
@@ -1120,12 +1120,6 @@ static int __init dccp_init(void)
                                  SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, NULL);
        if (!dccp_hashinfo.bind_bucket_cachep)
                goto out_free_hashinfo2;
-       dccp_hashinfo.bind2_bucket_cachep =
-               kmem_cache_create("dccp_bind2_bucket",
-                                 sizeof(struct inet_bind2_bucket), 0,
-                                 SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, NULL);
-       if (!dccp_hashinfo.bind2_bucket_cachep)
-               goto out_free_bind_bucket_cachep;
 
        /*
         * Size and allocate the main established and bind bucket
@@ -1156,7 +1150,7 @@ static int __init dccp_init(void)
 
        if (!dccp_hashinfo.ehash) {
                DCCP_CRIT("Failed to allocate DCCP established hash table");
-               goto out_free_bind2_bucket_cachep;
+               goto out_free_bind_bucket_cachep;
        }
 
        for (i = 0; i <= dccp_hashinfo.ehash_mask; i++)
@@ -1182,23 +1176,14 @@ static int __init dccp_init(void)
                goto out_free_dccp_locks;
        }
 
-       dccp_hashinfo.bhash2 = (struct inet_bind2_hashbucket *)
-               __get_free_pages(GFP_ATOMIC | __GFP_NOWARN, bhash_order);
-
-       if (!dccp_hashinfo.bhash2) {
-               DCCP_CRIT("Failed to allocate DCCP bind2 hash table");
-               goto out_free_dccp_bhash;
-       }
-
        for (i = 0; i < dccp_hashinfo.bhash_size; i++) {
                spin_lock_init(&dccp_hashinfo.bhash[i].lock);
                INIT_HLIST_HEAD(&dccp_hashinfo.bhash[i].chain);
-               INIT_HLIST_HEAD(&dccp_hashinfo.bhash2[i].chain);
        }
 
        rc = dccp_mib_init();
        if (rc)
-               goto out_free_dccp_bhash2;
+               goto out_free_dccp_bhash;
 
        rc = dccp_ackvec_init();
        if (rc)
@@ -1222,38 +1207,30 @@ out_ackvec_exit:
        dccp_ackvec_exit();
 out_free_dccp_mib:
        dccp_mib_exit();
-out_free_dccp_bhash2:
-       free_pages((unsigned long)dccp_hashinfo.bhash2, bhash_order);
 out_free_dccp_bhash:
        free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order);
 out_free_dccp_locks:
        inet_ehash_locks_free(&dccp_hashinfo);
 out_free_dccp_ehash:
        free_pages((unsigned long)dccp_hashinfo.ehash, ehash_order);
-out_free_bind2_bucket_cachep:
-       kmem_cache_destroy(dccp_hashinfo.bind2_bucket_cachep);
 out_free_bind_bucket_cachep:
        kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep);
 out_free_hashinfo2:
        inet_hashinfo2_free_mod(&dccp_hashinfo);
 out_fail:
        dccp_hashinfo.bhash = NULL;
-       dccp_hashinfo.bhash2 = NULL;
        dccp_hashinfo.ehash = NULL;
        dccp_hashinfo.bind_bucket_cachep = NULL;
-       dccp_hashinfo.bind2_bucket_cachep = NULL;
        return rc;
 }
 
 static void __exit dccp_fini(void)
 {
-       int bhash_order = get_order(dccp_hashinfo.bhash_size *
-                                   sizeof(struct inet_bind_hashbucket));
-
        ccid_cleanup_builtins();
        dccp_mib_exit();
-       free_pages((unsigned long)dccp_hashinfo.bhash, bhash_order);
-       free_pages((unsigned long)dccp_hashinfo.bhash2, bhash_order);
+       free_pages((unsigned long)dccp_hashinfo.bhash,
+                  get_order(dccp_hashinfo.bhash_size *
+                            sizeof(struct inet_bind_hashbucket)));
        free_pages((unsigned long)dccp_hashinfo.ehash,
                   get_order((dccp_hashinfo.ehash_mask + 1) *
                             sizeof(struct inet_ehash_bucket)));
index 7e6b37a..1c94bb8 100644 (file)
@@ -36,7 +36,7 @@ static int fallback_set_params(struct eeprom_req_info *request,
        if (request->page)
                offset = request->page * ETH_MODULE_EEPROM_PAGE_LEN + offset;
 
-       if (modinfo->type == ETH_MODULE_SFF_8079 &&
+       if (modinfo->type == ETH_MODULE_SFF_8472 &&
            request->i2c_address == 0x51)
                offset += ETH_MODULE_EEPROM_PAGE_LEN * 2;
 
index c0b7e6c..53f5f95 100644 (file)
@@ -117,32 +117,6 @@ bool inet_rcv_saddr_any(const struct sock *sk)
        return !sk->sk_rcv_saddr;
 }
 
-static bool use_bhash2_on_bind(const struct sock *sk)
-{
-#if IS_ENABLED(CONFIG_IPV6)
-       int addr_type;
-
-       if (sk->sk_family == AF_INET6) {
-               addr_type = ipv6_addr_type(&sk->sk_v6_rcv_saddr);
-               return addr_type != IPV6_ADDR_ANY &&
-                       addr_type != IPV6_ADDR_MAPPED;
-       }
-#endif
-       return sk->sk_rcv_saddr != htonl(INADDR_ANY);
-}
-
-static u32 get_bhash2_nulladdr_hash(const struct sock *sk, struct net *net,
-                                   int port)
-{
-#if IS_ENABLED(CONFIG_IPV6)
-       struct in6_addr nulladdr = {};
-
-       if (sk->sk_family == AF_INET6)
-               return ipv6_portaddr_hash(net, &nulladdr, port);
-#endif
-       return ipv4_portaddr_hash(net, 0, port);
-}
-
 void inet_get_local_port_range(struct net *net, int *low, int *high)
 {
        unsigned int seq;
@@ -156,71 +130,16 @@ void inet_get_local_port_range(struct net *net, int *low, int *high)
 }
 EXPORT_SYMBOL(inet_get_local_port_range);
 
-static bool bind_conflict_exist(const struct sock *sk, struct sock *sk2,
-                               kuid_t sk_uid, bool relax,
-                               bool reuseport_cb_ok, bool reuseport_ok)
-{
-       int bound_dev_if2;
-
-       if (sk == sk2)
-               return false;
-
-       bound_dev_if2 = READ_ONCE(sk2->sk_bound_dev_if);
-
-       if (!sk->sk_bound_dev_if || !bound_dev_if2 ||
-           sk->sk_bound_dev_if == bound_dev_if2) {
-               if (sk->sk_reuse && sk2->sk_reuse &&
-                   sk2->sk_state != TCP_LISTEN) {
-                       if (!relax || (!reuseport_ok && sk->sk_reuseport &&
-                                      sk2->sk_reuseport && reuseport_cb_ok &&
-                                      (sk2->sk_state == TCP_TIME_WAIT ||
-                                       uid_eq(sk_uid, sock_i_uid(sk2)))))
-                               return true;
-               } else if (!reuseport_ok || !sk->sk_reuseport ||
-                          !sk2->sk_reuseport || !reuseport_cb_ok ||
-                          (sk2->sk_state != TCP_TIME_WAIT &&
-                           !uid_eq(sk_uid, sock_i_uid(sk2)))) {
-                       return true;
-               }
-       }
-       return false;
-}
-
-static bool check_bhash2_conflict(const struct sock *sk,
-                                 struct inet_bind2_bucket *tb2, kuid_t sk_uid,
-                                 bool relax, bool reuseport_cb_ok,
-                                 bool reuseport_ok)
-{
-       struct sock *sk2;
-
-       sk_for_each_bound_bhash2(sk2, &tb2->owners) {
-               if (sk->sk_family == AF_INET && ipv6_only_sock(sk2))
-                       continue;
-
-               if (bind_conflict_exist(sk, sk2, sk_uid, relax,
-                                       reuseport_cb_ok, reuseport_ok))
-                       return true;
-       }
-       return false;
-}
-
-/* This should be called only when the corresponding inet_bind_bucket spinlock
- * is held
- */
-static int inet_csk_bind_conflict(const struct sock *sk, int port,
-                                 struct inet_bind_bucket *tb,
-                                 struct inet_bind2_bucket *tb2, /* may be null */
+static int inet_csk_bind_conflict(const struct sock *sk,
+                                 const struct inet_bind_bucket *tb,
                                  bool relax, bool reuseport_ok)
 {
-       struct inet_hashinfo *hinfo = sk->sk_prot->h.hashinfo;
-       kuid_t uid = sock_i_uid((struct sock *)sk);
-       struct sock_reuseport *reuseport_cb;
-       struct inet_bind2_hashbucket *head2;
-       bool reuseport_cb_ok;
        struct sock *sk2;
-       struct net *net;
-       int l3mdev;
-       u32 hash;
+       bool reuseport_cb_ok;
+       bool reuse = sk->sk_reuse;
+       bool reuseport = !!sk->sk_reuseport;
+       struct sock_reuseport *reuseport_cb;
+       kuid_t uid = sock_i_uid((struct sock *)sk);
 
        rcu_read_lock();
        reuseport_cb = rcu_dereference(sk->sk_reuseport_cb);
@@ -231,42 +150,40 @@ static int inet_csk_bind_conflict(const struct sock *sk, int port,
        /*
         * Unlike other sk lookup places we do not check
         * for sk_net here, since _all_ the socks listed
-        * in tb->owners and tb2->owners list belong
-        * to the same net
+        * in tb->owners list belong to the same net - the
+        * one this bucket belongs to.
         */
 
-       if (!use_bhash2_on_bind(sk)) {
-               sk_for_each_bound(sk2, &tb->owners)
-                       if (bind_conflict_exist(sk, sk2, uid, relax,
-                                               reuseport_cb_ok, reuseport_ok) &&
-                           inet_rcv_saddr_equal(sk, sk2, true))
-                               return true;
+       sk_for_each_bound(sk2, &tb->owners) {
+               int bound_dev_if2;
 
-               return false;
+               if (sk == sk2)
+                       continue;
+               bound_dev_if2 = READ_ONCE(sk2->sk_bound_dev_if);
+               if ((!sk->sk_bound_dev_if ||
+                    !bound_dev_if2 ||
+                    sk->sk_bound_dev_if == bound_dev_if2)) {
+                       if (reuse && sk2->sk_reuse &&
+                           sk2->sk_state != TCP_LISTEN) {
+                               if ((!relax ||
+                                    (!reuseport_ok &&
+                                     reuseport && sk2->sk_reuseport &&
+                                     reuseport_cb_ok &&
+                                     (sk2->sk_state == TCP_TIME_WAIT ||
+                                      uid_eq(uid, sock_i_uid(sk2))))) &&
+                                   inet_rcv_saddr_equal(sk, sk2, true))
+                                       break;
+                       } else if (!reuseport_ok ||
+                                  !reuseport || !sk2->sk_reuseport ||
+                                  !reuseport_cb_ok ||
+                                  (sk2->sk_state != TCP_TIME_WAIT &&
+                                   !uid_eq(uid, sock_i_uid(sk2)))) {
+                               if (inet_rcv_saddr_equal(sk, sk2, true))
+                                       break;
+                       }
+               }
        }
-
-       if (tb2 && check_bhash2_conflict(sk, tb2, uid, relax, reuseport_cb_ok,
-                                        reuseport_ok))
-               return true;
-
-       net = sock_net(sk);
-
-       /* check there's no conflict with an existing IPV6_ADDR_ANY (if ipv6) or
-        * INADDR_ANY (if ipv4) socket.
-        */
-       hash = get_bhash2_nulladdr_hash(sk, net, port);
-       head2 = &hinfo->bhash2[hash & (hinfo->bhash_size - 1)];
-
-       l3mdev = inet_sk_bound_l3mdev(sk);
-       inet_bind_bucket_for_each(tb2, &head2->chain)
-               if (check_bind2_bucket_match_nulladdr(tb2, net, port, l3mdev, sk))
-                       break;
-
-       if (tb2 && check_bhash2_conflict(sk, tb2, uid, relax, reuseport_cb_ok,
-                                        reuseport_ok))
-               return true;
-
-       return false;
+       return sk2 != NULL;
 }
 
 /*
@@ -274,20 +191,16 @@ static int inet_csk_bind_conflict(const struct sock *sk, int port,
  * inet_bind_hashbucket lock held.
  */
 static struct inet_bind_hashbucket *
-inet_csk_find_open_port(struct sock *sk, struct inet_bind_bucket **tb_ret,
-                       struct inet_bind2_bucket **tb2_ret,
-                       struct inet_bind2_hashbucket **head2_ret, int *port_ret)
+inet_csk_find_open_port(struct sock *sk, struct inet_bind_bucket **tb_ret, int *port_ret)
 {
        struct inet_hashinfo *hinfo = sk->sk_prot->h.hashinfo;
-       struct inet_bind2_hashbucket *head2;
+       int port = 0;
        struct inet_bind_hashbucket *head;
        struct net *net = sock_net(sk);
+       bool relax = false;
        int i, low, high, attempt_half;
-       struct inet_bind2_bucket *tb2;
        struct inet_bind_bucket *tb;
        u32 remaining, offset;
-       bool relax = false;
-       int port = 0;
        int l3mdev;
 
        l3mdev = inet_sk_bound_l3mdev(sk);
@@ -326,12 +239,10 @@ other_parity_scan:
                head = &hinfo->bhash[inet_bhashfn(net, port,
                                                  hinfo->bhash_size)];
                spin_lock_bh(&head->lock);
-               tb2 = inet_bind2_bucket_find(hinfo, net, port, l3mdev, sk,
-                                            &head2);
                inet_bind_bucket_for_each(tb, &head->chain)
-                       if (check_bind_bucket_match(tb, net, port, l3mdev)) {
-                               if (!inet_csk_bind_conflict(sk, port, tb, tb2,
-                                                           relax, false))
+                       if (net_eq(ib_net(tb), net) && tb->l3mdev == l3mdev &&
+                           tb->port == port) {
+                               if (!inet_csk_bind_conflict(sk, tb, relax, false))
                                        goto success;
                                goto next_port;
                        }
@@ -361,8 +272,6 @@ next_port:
 success:
        *port_ret = port;
        *tb_ret = tb;
-       *tb2_ret = tb2;
-       *head2_ret = head2;
        return head;
 }
 
@@ -458,81 +367,54 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
 {
        bool reuse = sk->sk_reuse && sk->sk_state != TCP_LISTEN;
        struct inet_hashinfo *hinfo = sk->sk_prot->h.hashinfo;
-       bool bhash_created = false, bhash2_created = false;
-       struct inet_bind2_bucket *tb2 = NULL;
-       struct inet_bind2_hashbucket *head2;
-       struct inet_bind_bucket *tb = NULL;
+       int ret = 1, port = snum;
        struct inet_bind_hashbucket *head;
        struct net *net = sock_net(sk);
-       int ret = 1, port = snum;
-       bool found_port = false;
+       struct inet_bind_bucket *tb = NULL;
        int l3mdev;
 
        l3mdev = inet_sk_bound_l3mdev(sk);
 
        if (!port) {
-               head = inet_csk_find_open_port(sk, &tb, &tb2, &head2, &port);
+               head = inet_csk_find_open_port(sk, &tb, &port);
                if (!head)
                        return ret;
-               if (tb && tb2)
-                       goto success;
-               found_port = true;
-       } else {
-               head = &hinfo->bhash[inet_bhashfn(net, port,
-                                                 hinfo->bhash_size)];
-               spin_lock_bh(&head->lock);
-               inet_bind_bucket_for_each(tb, &head->chain)
-                       if (check_bind_bucket_match(tb, net, port, l3mdev))
-                               break;
-
-               tb2 = inet_bind2_bucket_find(hinfo, net, port, l3mdev, sk,
-                                            &head2);
-       }
-
-       if (!tb) {
-               tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep, net,
-                                            head, port, l3mdev);
                if (!tb)
-                       goto fail_unlock;
-               bhash_created = true;
-       }
-
-       if (!tb2) {
-               tb2 = inet_bind2_bucket_create(hinfo->bind2_bucket_cachep,
-                                              net, head2, port, l3mdev, sk);
-               if (!tb2)
-                       goto fail_unlock;
-               bhash2_created = true;
+                       goto tb_not_found;
+               goto success;
        }
-
-       /* If we had to find an open port, we already checked for conflicts */
-       if (!found_port && !hlist_empty(&tb->owners)) {
+       head = &hinfo->bhash[inet_bhashfn(net, port,
+                                         hinfo->bhash_size)];
+       spin_lock_bh(&head->lock);
+       inet_bind_bucket_for_each(tb, &head->chain)
+               if (net_eq(ib_net(tb), net) && tb->l3mdev == l3mdev &&
+                   tb->port == port)
+                       goto tb_found;
+tb_not_found:
+       tb = inet_bind_bucket_create(hinfo->bind_bucket_cachep,
+                                    net, head, port, l3mdev);
+       if (!tb)
+               goto fail_unlock;
+tb_found:
+       if (!hlist_empty(&tb->owners)) {
                if (sk->sk_reuse == SK_FORCE_REUSE)
                        goto success;
 
                if ((tb->fastreuse > 0 && reuse) ||
                    sk_reuseport_match(tb, sk))
                        goto success;
-               if (inet_csk_bind_conflict(sk, port, tb, tb2, true, true))
+               if (inet_csk_bind_conflict(sk, tb, true, true))
                        goto fail_unlock;
        }
 success:
        inet_csk_update_fastreuse(tb, sk);
 
        if (!inet_csk(sk)->icsk_bind_hash)
-               inet_bind_hash(sk, tb, tb2, port);
+               inet_bind_hash(sk, tb, port);
        WARN_ON(inet_csk(sk)->icsk_bind_hash != tb);
-       WARN_ON(inet_csk(sk)->icsk_bind2_hash != tb2);
        ret = 0;
 
 fail_unlock:
-       if (ret) {
-               if (bhash_created)
-                       inet_bind_bucket_destroy(hinfo->bind_bucket_cachep, tb);
-               if (bhash2_created)
-                       inet_bind2_bucket_destroy(hinfo->bind2_bucket_cachep,
-                                                 tb2);
-       }
        spin_unlock_bh(&head->lock);
        return ret;
 }
@@ -1079,7 +961,6 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
 
                inet_sk_set_state(newsk, TCP_SYN_RECV);
                newicsk->icsk_bind_hash = NULL;
-               newicsk->icsk_bind2_hash = NULL;
 
                inet_sk(newsk)->inet_dport = inet_rsk(req)->ir_rmt_port;
                inet_sk(newsk)->inet_num = inet_rsk(req)->ir_num;
index e8de5e6..b9d995b 100644 (file)
@@ -81,41 +81,6 @@ struct inet_bind_bucket *inet_bind_bucket_create(struct kmem_cache *cachep,
        return tb;
 }
 
-struct inet_bind2_bucket *inet_bind2_bucket_create(struct kmem_cache *cachep,
-                                                  struct net *net,
-                                                  struct inet_bind2_hashbucket *head,
-                                                  const unsigned short port,
-                                                  int l3mdev,
-                                                  const struct sock *sk)
-{
-       struct inet_bind2_bucket *tb = kmem_cache_alloc(cachep, GFP_ATOMIC);
-
-       if (tb) {
-               write_pnet(&tb->ib_net, net);
-               tb->l3mdev    = l3mdev;
-               tb->port      = port;
-#if IS_ENABLED(CONFIG_IPV6)
-               if (sk->sk_family == AF_INET6)
-                       tb->v6_rcv_saddr = sk->sk_v6_rcv_saddr;
-               else
-#endif
-                       tb->rcv_saddr = sk->sk_rcv_saddr;
-               INIT_HLIST_HEAD(&tb->owners);
-               hlist_add_head(&tb->node, &head->chain);
-       }
-       return tb;
-}
-
-static bool bind2_bucket_addr_match(struct inet_bind2_bucket *tb2, struct sock *sk)
-{
-#if IS_ENABLED(CONFIG_IPV6)
-       if (sk->sk_family == AF_INET6)
-               return ipv6_addr_equal(&tb2->v6_rcv_saddr,
-                                      &sk->sk_v6_rcv_saddr);
-#endif
-       return tb2->rcv_saddr == sk->sk_rcv_saddr;
-}
-
 /*
  * Caller must hold hashbucket lock for this tb with local BH disabled
  */
@@ -127,25 +92,12 @@ void inet_bind_bucket_destroy(struct kmem_cache *cachep, struct inet_bind_bucket
        }
 }
 
-/* Caller must hold the lock for the corresponding hashbucket in the bhash table
- * with local BH disabled
- */
-void inet_bind2_bucket_destroy(struct kmem_cache *cachep, struct inet_bind2_bucket *tb)
-{
-       if (hlist_empty(&tb->owners)) {
-               __hlist_del(&tb->node);
-               kmem_cache_free(cachep, tb);
-       }
-}
-
 void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
-                   struct inet_bind2_bucket *tb2, const unsigned short snum)
+                   const unsigned short snum)
 {
        inet_sk(sk)->inet_num = snum;
        sk_add_bind_node(sk, &tb->owners);
        inet_csk(sk)->icsk_bind_hash = tb;
-       sk_add_bind2_node(sk, &tb2->owners);
-       inet_csk(sk)->icsk_bind2_hash = tb2;
 }
 
 /*
@@ -157,7 +109,6 @@ static void __inet_put_port(struct sock *sk)
        const int bhash = inet_bhashfn(sock_net(sk), inet_sk(sk)->inet_num,
                        hashinfo->bhash_size);
        struct inet_bind_hashbucket *head = &hashinfo->bhash[bhash];
-       struct inet_bind2_bucket *tb2;
        struct inet_bind_bucket *tb;
 
        spin_lock(&head->lock);
@@ -166,13 +117,6 @@ static void __inet_put_port(struct sock *sk)
        inet_csk(sk)->icsk_bind_hash = NULL;
        inet_sk(sk)->inet_num = 0;
        inet_bind_bucket_destroy(hashinfo->bind_bucket_cachep, tb);
-
-       if (inet_csk(sk)->icsk_bind2_hash) {
-               tb2 = inet_csk(sk)->icsk_bind2_hash;
-               __sk_del_bind2_node(sk);
-               inet_csk(sk)->icsk_bind2_hash = NULL;
-               inet_bind2_bucket_destroy(hashinfo->bind2_bucket_cachep, tb2);
-       }
        spin_unlock(&head->lock);
 }
 
@@ -189,19 +133,14 @@ int __inet_inherit_port(const struct sock *sk, struct sock *child)
        struct inet_hashinfo *table = sk->sk_prot->h.hashinfo;
        unsigned short port = inet_sk(child)->inet_num;
        const int bhash = inet_bhashfn(sock_net(sk), port,
-                                      table->bhash_size);
+                       table->bhash_size);
        struct inet_bind_hashbucket *head = &table->bhash[bhash];
-       struct inet_bind2_hashbucket *head_bhash2;
-       bool created_inet_bind_bucket = false;
-       struct net *net = sock_net(sk);
-       struct inet_bind2_bucket *tb2;
        struct inet_bind_bucket *tb;
        int l3mdev;
 
        spin_lock(&head->lock);
        tb = inet_csk(sk)->icsk_bind_hash;
-       tb2 = inet_csk(sk)->icsk_bind2_hash;
-       if (unlikely(!tb || !tb2)) {
+       if (unlikely(!tb)) {
                spin_unlock(&head->lock);
                return -ENOENT;
        }
@@ -214,45 +153,25 @@ int __inet_inherit_port(const struct sock *sk, struct sock *child)
                 * as that of the child socket. We have to look up or
                 * create a new bind bucket for the child here. */
                inet_bind_bucket_for_each(tb, &head->chain) {
-                       if (check_bind_bucket_match(tb, net, port, l3mdev))
+                       if (net_eq(ib_net(tb), sock_net(sk)) &&
+                           tb->l3mdev == l3mdev && tb->port == port)
                                break;
                }
                if (!tb) {
                        tb = inet_bind_bucket_create(table->bind_bucket_cachep,
-                                                    net, head, port, l3mdev);
+                                                    sock_net(sk), head, port,
+                                                    l3mdev);
                        if (!tb) {
                                spin_unlock(&head->lock);
                                return -ENOMEM;
                        }
-                       created_inet_bind_bucket = true;
                }
                inet_csk_update_fastreuse(tb, child);
-
-               goto bhash2_find;
-       } else if (!bind2_bucket_addr_match(tb2, child)) {
-               l3mdev = inet_sk_bound_l3mdev(sk);
-
-bhash2_find:
-               tb2 = inet_bind2_bucket_find(table, net, port, l3mdev, child,
-                                            &head_bhash2);
-               if (!tb2) {
-                       tb2 = inet_bind2_bucket_create(table->bind2_bucket_cachep,
-                                                      net, head_bhash2, port,
-                                                      l3mdev, child);
-                       if (!tb2)
-                               goto error;
-               }
        }
-       inet_bind_hash(child, tb, tb2, port);
+       inet_bind_hash(child, tb, port);
        spin_unlock(&head->lock);
 
        return 0;
-
-error:
-       if (created_inet_bind_bucket)
-               inet_bind_bucket_destroy(table->bind_bucket_cachep, tb);
-       spin_unlock(&head->lock);
-       return -ENOMEM;
 }
 EXPORT_SYMBOL_GPL(__inet_inherit_port);
 
@@ -756,76 +675,6 @@ void inet_unhash(struct sock *sk)
 }
 EXPORT_SYMBOL_GPL(inet_unhash);
 
-static bool check_bind2_bucket_match(struct inet_bind2_bucket *tb,
-                                    struct net *net, unsigned short port,
-                                    int l3mdev, struct sock *sk)
-{
-#if IS_ENABLED(CONFIG_IPV6)
-       if (sk->sk_family == AF_INET6)
-               return net_eq(ib2_net(tb), net) && tb->port == port &&
-                       tb->l3mdev == l3mdev &&
-                       ipv6_addr_equal(&tb->v6_rcv_saddr, &sk->sk_v6_rcv_saddr);
-       else
-#endif
-               return net_eq(ib2_net(tb), net) && tb->port == port &&
-                       tb->l3mdev == l3mdev && tb->rcv_saddr == sk->sk_rcv_saddr;
-}
-
-bool check_bind2_bucket_match_nulladdr(struct inet_bind2_bucket *tb,
-                                      struct net *net, const unsigned short port,
-                                      int l3mdev, const struct sock *sk)
-{
-#if IS_ENABLED(CONFIG_IPV6)
-       struct in6_addr nulladdr = {};
-
-       if (sk->sk_family == AF_INET6)
-               return net_eq(ib2_net(tb), net) && tb->port == port &&
-                       tb->l3mdev == l3mdev &&
-                       ipv6_addr_equal(&tb->v6_rcv_saddr, &nulladdr);
-       else
-#endif
-               return net_eq(ib2_net(tb), net) && tb->port == port &&
-                       tb->l3mdev == l3mdev && tb->rcv_saddr == 0;
-}
-
-static struct inet_bind2_hashbucket *
-inet_bhashfn_portaddr(struct inet_hashinfo *hinfo, const struct sock *sk,
-                     const struct net *net, unsigned short port)
-{
-       u32 hash;
-
-#if IS_ENABLED(CONFIG_IPV6)
-       if (sk->sk_family == AF_INET6)
-               hash = ipv6_portaddr_hash(net, &sk->sk_v6_rcv_saddr, port);
-       else
-#endif
-               hash = ipv4_portaddr_hash(net, sk->sk_rcv_saddr, port);
-       return &hinfo->bhash2[hash & (hinfo->bhash_size - 1)];
-}
-
-/* This should only be called when the spinlock for the socket's corresponding
- * bind_hashbucket is held
- */
-struct inet_bind2_bucket *
-inet_bind2_bucket_find(struct inet_hashinfo *hinfo, struct net *net,
-                      const unsigned short port, int l3mdev, struct sock *sk,
-                      struct inet_bind2_hashbucket **head)
-{
-       struct inet_bind2_bucket *bhash2 = NULL;
-       struct inet_bind2_hashbucket *h;
-
-       h = inet_bhashfn_portaddr(hinfo, sk, net, port);
-       inet_bind_bucket_for_each(bhash2, &h->chain) {
-               if (check_bind2_bucket_match(bhash2, net, port, l3mdev, sk))
-                       break;
-       }
-
-       if (head)
-               *head = h;
-
-       return bhash2;
-}
-
 /* RFC 6056 3.3.4.  Algorithm 4: Double-Hash Port Selection Algorithm
  * Note that we use 32bit integers (vs RFC 'short integers')
  * because 2^16 is not a multiple of num_ephemeral and this
@@ -846,13 +695,10 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
 {
        struct inet_hashinfo *hinfo = death_row->hashinfo;
        struct inet_timewait_sock *tw = NULL;
-       struct inet_bind2_hashbucket *head2;
        struct inet_bind_hashbucket *head;
        int port = inet_sk(sk)->inet_num;
        struct net *net = sock_net(sk);
-       struct inet_bind2_bucket *tb2;
        struct inet_bind_bucket *tb;
-       bool tb_created = false;
        u32 remaining, offset;
        int ret, i, low, high;
        int l3mdev;
@@ -909,7 +755,8 @@ other_parity_scan:
                 * the established check is already unique enough.
                 */
                inet_bind_bucket_for_each(tb, &head->chain) {
-                       if (check_bind_bucket_match(tb, net, port, l3mdev)) {
+                       if (net_eq(ib_net(tb), net) && tb->l3mdev == l3mdev &&
+                           tb->port == port) {
                                if (tb->fastreuse >= 0 ||
                                    tb->fastreuseport >= 0)
                                        goto next_port;
@@ -927,7 +774,6 @@ other_parity_scan:
                        spin_unlock_bh(&head->lock);
                        return -ENOMEM;
                }
-               tb_created = true;
                tb->fastreuse = -1;
                tb->fastreuseport = -1;
                goto ok;
@@ -943,17 +789,6 @@ next_port:
        return -EADDRNOTAVAIL;
 
 ok:
-       /* Find the corresponding tb2 bucket since we need to
-        * add the socket to the bhash2 table as well
-        */
-       tb2 = inet_bind2_bucket_find(hinfo, net, port, l3mdev, sk, &head2);
-       if (!tb2) {
-               tb2 = inet_bind2_bucket_create(hinfo->bind2_bucket_cachep, net,
-                                              head2, port, l3mdev, sk);
-               if (!tb2)
-                       goto error;
-       }
-
        /* Here we want to add a little bit of randomness to the next source
         * port that will be chosen. We use a max() with a random here so that
         * on low contention the randomness is maximal and on high contention
@@ -963,7 +798,7 @@ ok:
        WRITE_ONCE(table_perturb[index], READ_ONCE(table_perturb[index]) + i + 2);
 
        /* Head lock still held and bh's disabled */
-       inet_bind_hash(sk, tb, tb2, port);
+       inet_bind_hash(sk, tb, port);
        if (sk_unhashed(sk)) {
                inet_sk(sk)->inet_sport = htons(port);
                inet_ehash_nolisten(sk, (struct sock *)tw, NULL);
@@ -975,12 +810,6 @@ ok:
                inet_twsk_deschedule_put(tw);
        local_bh_enable();
        return 0;
-
-error:
-       if (tb_created)
-               inet_bind_bucket_destroy(hinfo->bind_bucket_cachep, tb);
-       spin_unlock_bh(&head->lock);
-       return -ENOMEM;
 }
 
 /*
@@ -1026,10 +855,12 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
        init_hashinfo_lhash2(h);
 
        /* this one is used for source ports of outgoing connections */
-       table_perturb = kmalloc_array(INET_TABLE_PERTURB_SIZE,
-                                     sizeof(*table_perturb), GFP_KERNEL);
-       if (!table_perturb)
-               panic("TCP: failed to alloc table_perturb");
+       table_perturb = alloc_large_system_hash("Table-perturb",
+                                               sizeof(*table_perturb),
+                                               INET_TABLE_PERTURB_SIZE,
+                                               0, 0, NULL, NULL,
+                                               INET_TABLE_PERTURB_SIZE,
+                                               INET_TABLE_PERTURB_SIZE);
 }
 
 int inet_hashinfo2_init_mod(struct inet_hashinfo *h)
index 7e474a8..5c58e21 100644 (file)
@@ -524,7 +524,6 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev)
        int tunnel_hlen;
        int version;
        int nhoff;
-       int thoff;
 
        tun_info = skb_tunnel_info(skb);
        if (unlikely(!tun_info || !(tun_info->mode & IP_TUNNEL_INFO_TX) ||
@@ -558,10 +557,16 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev)
            (ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff))
                truncate = true;
 
-       thoff = skb_transport_header(skb) - skb_mac_header(skb);
-       if (skb->protocol == htons(ETH_P_IPV6) &&
-           (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff))
-               truncate = true;
+       if (skb->protocol == htons(ETH_P_IPV6)) {
+               int thoff;
+
+               if (skb_transport_header_was_set(skb))
+                       thoff = skb_transport_header(skb) - skb_mac_header(skb);
+               else
+                       thoff = nhoff + sizeof(struct ipv6hdr);
+               if (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff)
+                       truncate = true;
+       }
 
        if (version == 1) {
                erspan_build_header(skb, ntohl(tunnel_id_to_key32(key->tun_id)),
@@ -629,21 +634,20 @@ static netdev_tx_t ipgre_xmit(struct sk_buff *skb,
        }
 
        if (dev->header_ops) {
-               const int pull_len = tunnel->hlen + sizeof(struct iphdr);
-
                if (skb_cow_head(skb, 0))
                        goto free_skb;
 
                tnl_params = (const struct iphdr *)skb->data;
 
-               if (pull_len > skb_transport_offset(skb))
-                       goto free_skb;
-
                /* Pull skb since ip_tunnel_xmit() needs skb->data pointing
                 * to gre header.
                 */
-               skb_pull(skb, pull_len);
+               skb_pull(skb, tunnel->hlen + sizeof(struct iphdr));
                skb_reset_mac_header(skb);
+
+               if (skb->ip_summed == CHECKSUM_PARTIAL &&
+                   skb_checksum_start(skb) < skb->data)
+                       goto free_skb;
        } else {
                if (skb_cow_head(skb, dev->needed_headroom))
                        goto free_skb;
index 1a43ca7..3c6101d 100644 (file)
@@ -319,12 +319,16 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
                pr_debug("ping_check_bind_addr(sk=%p,addr=%pI4,port=%d)\n",
                         sk, &addr->sin_addr.s_addr, ntohs(addr->sin_port));
 
+               if (addr->sin_addr.s_addr == htonl(INADDR_ANY))
+                       return 0;
+
                tb_id = l3mdev_fib_table_by_index(net, sk->sk_bound_dev_if) ? : tb_id;
                chk_addr_ret = inet_addr_type_table(net, addr->sin_addr.s_addr, tb_id);
 
-               if (!inet_addr_valid_or_nonlocal(net, inet_sk(sk),
-                                                addr->sin_addr.s_addr,
-                                                chk_addr_ret))
+               if (chk_addr_ret == RTN_MULTICAST ||
+                   chk_addr_ret == RTN_BROADCAST ||
+                   (chk_addr_ret != RTN_LOCAL &&
+                    !inet_can_nonlocal_bind(net, isk)))
                        return -EADDRNOTAVAIL;
 
 #if IS_ENABLED(CONFIG_IPV6)
index 9984d23..028513d 100644 (file)
@@ -4604,12 +4604,6 @@ void __init tcp_init(void)
                                  SLAB_HWCACHE_ALIGN | SLAB_PANIC |
                                  SLAB_ACCOUNT,
                                  NULL);
-       tcp_hashinfo.bind2_bucket_cachep =
-               kmem_cache_create("tcp_bind2_bucket",
-                                 sizeof(struct inet_bind2_bucket), 0,
-                                 SLAB_HWCACHE_ALIGN | SLAB_PANIC |
-                                 SLAB_ACCOUNT,
-                                 NULL);
 
        /* Size and allocate the main established and bind bucket
         * hash tables.
@@ -4632,9 +4626,8 @@ void __init tcp_init(void)
        if (inet_ehash_locks_alloc(&tcp_hashinfo))
                panic("TCP: failed to alloc ehash_locks");
        tcp_hashinfo.bhash =
-               alloc_large_system_hash("TCP bind bhash tables",
-                                       sizeof(struct inet_bind_hashbucket) +
-                                       sizeof(struct inet_bind2_hashbucket),
+               alloc_large_system_hash("TCP bind",
+                                       sizeof(struct inet_bind_hashbucket),
                                        tcp_hashinfo.ehash_mask + 1,
                                        17, /* one slot per 128 KB of memory */
                                        0,
@@ -4643,12 +4636,9 @@ void __init tcp_init(void)
                                        0,
                                        64 * 1024);
        tcp_hashinfo.bhash_size = 1U << tcp_hashinfo.bhash_size;
-       tcp_hashinfo.bhash2 =
-               (struct inet_bind2_hashbucket *)(tcp_hashinfo.bhash + tcp_hashinfo.bhash_size);
        for (i = 0; i < tcp_hashinfo.bhash_size; i++) {
                spin_lock_init(&tcp_hashinfo.bhash[i].lock);
                INIT_HLIST_HEAD(&tcp_hashinfo.bhash[i].chain);
-               INIT_HLIST_HEAD(&tcp_hashinfo.bhash2[i].chain);
        }
 
 
index be3947e..0d3f68b 100644 (file)
@@ -611,9 +611,6 @@ int tcp_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore)
                return 0;
        }
 
-       if (inet_csk_has_ulp(sk))
-               return -EINVAL;
-
        if (sk->sk_family == AF_INET6) {
                if (tcp_bpf_assert_proto_ops(psock->sk_proto))
                        return -EINVAL;
index 2fe5860..b146ce8 100644 (file)
@@ -304,4 +304,3 @@ void __init xfrm4_protocol_init(void)
 {
        xfrm_input_register_afinfo(&xfrm4_input_afinfo);
 }
-EXPORT_SYMBOL(xfrm4_protocol_init);
index 4e37f7c..a9051df 100644 (file)
@@ -939,7 +939,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
        __be16 proto;
        __u32 mtu;
        int nhoff;
-       int thoff;
 
        if (!pskb_inet_may_pull(skb))
                goto tx_err;
@@ -960,10 +959,16 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
            (ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff))
                truncate = true;
 
-       thoff = skb_transport_header(skb) - skb_mac_header(skb);
-       if (skb->protocol == htons(ETH_P_IPV6) &&
-           (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff))
-               truncate = true;
+       if (skb->protocol == htons(ETH_P_IPV6)) {
+               int thoff;
+
+               if (skb_transport_header_was_set(skb))
+                       thoff = skb_transport_header(skb) - skb_mac_header(skb);
+               else
+                       thoff = nhoff + sizeof(struct ipv6hdr);
+               if (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff)
+                       truncate = true;
+       }
 
        if (skb_cow_head(skb, dev->needed_headroom ?: t->hlen))
                goto tx_err;
index 4081b12..77e3f59 100644 (file)
@@ -1450,7 +1450,7 @@ static int __ip6_append_data(struct sock *sk,
                             struct page_frag *pfrag,
                             int getfrag(void *from, char *to, int offset,
                                         int len, int odd, struct sk_buff *skb),
-                            void *from, int length, int transhdrlen,
+                            void *from, size_t length, int transhdrlen,
                             unsigned int flags, struct ipcm6_cookie *ipc6)
 {
        struct sk_buff *skb, *skb_prev = NULL;
@@ -1798,7 +1798,7 @@ error:
 int ip6_append_data(struct sock *sk,
                    int getfrag(void *from, char *to, int offset, int len,
                                int odd, struct sk_buff *skb),
-                   void *from, int length, int transhdrlen,
+                   void *from, size_t length, int transhdrlen,
                    struct ipcm6_cookie *ipc6, struct flowi6 *fl6,
                    struct rt6_info *rt, unsigned int flags)
 {
@@ -1995,7 +1995,7 @@ EXPORT_SYMBOL_GPL(ip6_flush_pending_frames);
 struct sk_buff *ip6_make_skb(struct sock *sk,
                             int getfrag(void *from, char *to, int offset,
                                         int len, int odd, struct sk_buff *skb),
-                            void *from, int length, int transhdrlen,
+                            void *from, size_t length, int transhdrlen,
                             struct ipcm6_cookie *ipc6, struct rt6_info *rt,
                             unsigned int flags, struct inet_cork_full *cork)
 {
index 29bc4e7..6de0118 100644 (file)
@@ -399,7 +399,6 @@ int __init seg6_hmac_init(void)
 {
        return seg6_hmac_init_algo();
 }
-EXPORT_SYMBOL(seg6_hmac_init);
 
 int __net_init seg6_hmac_net_init(struct net *net)
 {
index 9fbe243..98a3428 100644 (file)
@@ -218,6 +218,7 @@ seg6_lookup_any_nexthop(struct sk_buff *skb, struct in6_addr *nhaddr,
        struct flowi6 fl6;
        int dev_flags = 0;
 
+       memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_iif = skb->dev->ifindex;
        fl6.daddr = nhaddr ? *nhaddr : hdr->daddr;
        fl6.saddr = hdr->saddr;
index c6ff8bf..9dbd801 100644 (file)
@@ -504,14 +504,15 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
        struct ipcm6_cookie ipc6;
        int addr_len = msg->msg_namelen;
        int transhdrlen = 4; /* zero session-id */
-       int ulen = len + transhdrlen;
+       int ulen;
        int err;
 
        /* Rough check on arithmetic overflow,
         * better check is made in ip6_append_data().
         */
-       if (len > INT_MAX)
+       if (len > INT_MAX - transhdrlen)
                return -EMSGSIZE;
+       ulen = len + transhdrlen;
 
        /* Mirror BSD error message compatibility */
        if (msg->msg_flags & MSG_OOB)
index 7873bd1..a8e2425 100644 (file)
 #include <net/netfilter/nf_tables_offload.h>
 #include <net/netfilter/nf_dup_netdev.h>
 
-static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev)
+#define NF_RECURSION_LIMIT     2
+
+static DEFINE_PER_CPU(u8, nf_dup_skb_recursion);
+
+static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev,
+                               enum nf_dev_hooks hook)
 {
-       if (skb_mac_header_was_set(skb))
+       if (__this_cpu_read(nf_dup_skb_recursion) > NF_RECURSION_LIMIT)
+               goto err;
+
+       if (hook == NF_NETDEV_INGRESS && skb_mac_header_was_set(skb)) {
+               if (skb_cow_head(skb, skb->mac_len))
+                       goto err;
+
                skb_push(skb, skb->mac_len);
+       }
 
        skb->dev = dev;
        skb_clear_tstamp(skb);
+       __this_cpu_inc(nf_dup_skb_recursion);
        dev_queue_xmit(skb);
+       __this_cpu_dec(nf_dup_skb_recursion);
+       return;
+err:
+       kfree_skb(skb);
 }
 
 void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif)
@@ -33,7 +50,7 @@ void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif)
                return;
        }
 
-       nf_do_netdev_egress(pkt->skb, dev);
+       nf_do_netdev_egress(pkt->skb, dev, nft_hook(pkt));
 }
 EXPORT_SYMBOL_GPL(nf_fwd_netdev_egress);
 
@@ -48,7 +65,7 @@ void nf_dup_netdev_egress(const struct nft_pktinfo *pkt, int oif)
 
        skb = skb_clone(pkt->skb, GFP_ATOMIC);
        if (skb)
-               nf_do_netdev_egress(skb, dev);
+               nf_do_netdev_egress(skb, dev, nft_hook(pkt));
 }
 EXPORT_SYMBOL_GPL(nf_dup_netdev_egress);
 
index 746be13..51144fc 100644 (file)
@@ -544,6 +544,7 @@ static int nft_trans_flowtable_add(struct nft_ctx *ctx, int msg_type,
        if (msg_type == NFT_MSG_NEWFLOWTABLE)
                nft_activate_next(ctx->net, flowtable);
 
+       INIT_LIST_HEAD(&nft_trans_flowtable_hooks(trans));
        nft_trans_flowtable(trans) = flowtable;
        nft_trans_commit_list_add_tail(ctx->net, trans);
 
@@ -1914,7 +1915,6 @@ static struct nft_hook *nft_netdev_hook_alloc(struct net *net,
                goto err_hook_dev;
        }
        hook->ops.dev = dev;
-       hook->inactive = false;
 
        return hook;
 
@@ -2166,7 +2166,7 @@ static int nft_basechain_init(struct nft_base_chain *basechain, u8 family,
        chain->flags |= NFT_CHAIN_BASE | flags;
        basechain->policy = NF_ACCEPT;
        if (chain->flags & NFT_CHAIN_HW_OFFLOAD &&
-           nft_chain_offload_priority(basechain) < 0)
+           !nft_chain_offload_support(basechain))
                return -EOPNOTSUPP;
 
        flow_block_init(&basechain->flow_block);
@@ -7332,7 +7332,7 @@ static void __nft_unregister_flowtable_net_hooks(struct net *net,
                nf_unregister_net_hook(net, &hook->ops);
                if (release_netdev) {
                        list_del(&hook->list);
-                       kfree_rcu(hook);
+                       kfree_rcu(hook, rcu);
                }
        }
 }
@@ -7433,11 +7433,15 @@ static int nft_flowtable_update(struct nft_ctx *ctx, const struct nlmsghdr *nlh,
 
        if (nla[NFTA_FLOWTABLE_FLAGS]) {
                flags = ntohl(nla_get_be32(nla[NFTA_FLOWTABLE_FLAGS]));
-               if (flags & ~NFT_FLOWTABLE_MASK)
-                       return -EOPNOTSUPP;
+               if (flags & ~NFT_FLOWTABLE_MASK) {
+                       err = -EOPNOTSUPP;
+                       goto err_flowtable_update_hook;
+               }
                if ((flowtable->data.flags & NFT_FLOWTABLE_HW_OFFLOAD) ^
-                   (flags & NFT_FLOWTABLE_HW_OFFLOAD))
-                       return -EOPNOTSUPP;
+                   (flags & NFT_FLOWTABLE_HW_OFFLOAD)) {
+                       err = -EOPNOTSUPP;
+                       goto err_flowtable_update_hook;
+               }
        } else {
                flags = flowtable->data.flags;
        }
@@ -7618,6 +7622,7 @@ static int nft_delflowtable_hook(struct nft_ctx *ctx,
 {
        const struct nlattr * const *nla = ctx->nla;
        struct nft_flowtable_hook flowtable_hook;
+       LIST_HEAD(flowtable_del_list);
        struct nft_hook *this, *hook;
        struct nft_trans *trans;
        int err;
@@ -7633,7 +7638,7 @@ static int nft_delflowtable_hook(struct nft_ctx *ctx,
                        err = -ENOENT;
                        goto err_flowtable_del_hook;
                }
-               hook->inactive = true;
+               list_move(&hook->list, &flowtable_del_list);
        }
 
        trans = nft_trans_alloc(ctx, NFT_MSG_DELFLOWTABLE,
@@ -7646,6 +7651,7 @@ static int nft_delflowtable_hook(struct nft_ctx *ctx,
        nft_trans_flowtable(trans) = flowtable;
        nft_trans_flowtable_update(trans) = true;
        INIT_LIST_HEAD(&nft_trans_flowtable_hooks(trans));
+       list_splice(&flowtable_del_list, &nft_trans_flowtable_hooks(trans));
        nft_flowtable_hook_release(&flowtable_hook);
 
        nft_trans_commit_list_add_tail(ctx->net, trans);
@@ -7653,13 +7659,7 @@ static int nft_delflowtable_hook(struct nft_ctx *ctx,
        return 0;
 
 err_flowtable_del_hook:
-       list_for_each_entry(this, &flowtable_hook.list, list) {
-               hook = nft_hook_list_find(&flowtable->hook_list, this);
-               if (!hook)
-                       break;
-
-               hook->inactive = false;
-       }
+       list_splice(&flowtable_del_list, &flowtable->hook_list);
        nft_flowtable_hook_release(&flowtable_hook);
 
        return err;
@@ -8329,6 +8329,9 @@ static void nft_commit_release(struct nft_trans *trans)
                nf_tables_chain_destroy(&trans->ctx);
                break;
        case NFT_MSG_DELRULE:
+               if (trans->ctx.chain->flags & NFT_CHAIN_HW_OFFLOAD)
+                       nft_flow_rule_destroy(nft_trans_flow_rule(trans));
+
                nf_tables_rule_destroy(&trans->ctx, nft_trans_rule(trans));
                break;
        case NFT_MSG_DELSET:
@@ -8563,17 +8566,6 @@ void nft_chain_del(struct nft_chain *chain)
        list_del_rcu(&chain->list);
 }
 
-static void nft_flowtable_hooks_del(struct nft_flowtable *flowtable,
-                                   struct list_head *hook_list)
-{
-       struct nft_hook *hook, *next;
-
-       list_for_each_entry_safe(hook, next, &flowtable->hook_list, list) {
-               if (hook->inactive)
-                       list_move(&hook->list, hook_list);
-       }
-}
-
 static void nf_tables_module_autoload_cleanup(struct net *net)
 {
        struct nftables_pernet *nft_net = nft_pernet(net);
@@ -8828,6 +8820,9 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
                        nf_tables_rule_notify(&trans->ctx,
                                              nft_trans_rule(trans),
                                              NFT_MSG_NEWRULE);
+                       if (trans->ctx.chain->flags & NFT_CHAIN_HW_OFFLOAD)
+                               nft_flow_rule_destroy(nft_trans_flow_rule(trans));
+
                        nft_trans_destroy(trans);
                        break;
                case NFT_MSG_DELRULE:
@@ -8918,8 +8913,6 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
                        break;
                case NFT_MSG_DELFLOWTABLE:
                        if (nft_trans_flowtable_update(trans)) {
-                               nft_flowtable_hooks_del(nft_trans_flowtable(trans),
-                                                       &nft_trans_flowtable_hooks(trans));
                                nf_tables_flowtable_notify(&trans->ctx,
                                                           nft_trans_flowtable(trans),
                                                           &nft_trans_flowtable_hooks(trans),
@@ -9000,7 +8993,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
        struct nftables_pernet *nft_net = nft_pernet(net);
        struct nft_trans *trans, *next;
        struct nft_trans_elem *te;
-       struct nft_hook *hook;
 
        if (action == NFNL_ABORT_VALIDATE &&
            nf_tables_validate(net) < 0)
@@ -9131,8 +9123,8 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
                        break;
                case NFT_MSG_DELFLOWTABLE:
                        if (nft_trans_flowtable_update(trans)) {
-                               list_for_each_entry(hook, &nft_trans_flowtable(trans)->hook_list, list)
-                                       hook->inactive = false;
+                               list_splice(&nft_trans_flowtable_hooks(trans),
+                                           &nft_trans_flowtable(trans)->hook_list);
                        } else {
                                trans->ctx.table->use++;
                                nft_clear(trans->ctx.net, nft_trans_flowtable(trans));
index 2d36952..910ef88 100644 (file)
@@ -208,7 +208,7 @@ static int nft_setup_cb_call(enum tc_setup_type type, void *type_data,
        return 0;
 }
 
-int nft_chain_offload_priority(struct nft_base_chain *basechain)
+static int nft_chain_offload_priority(const struct nft_base_chain *basechain)
 {
        if (basechain->ops.priority <= 0 ||
            basechain->ops.priority > USHRT_MAX)
@@ -217,6 +217,27 @@ int nft_chain_offload_priority(struct nft_base_chain *basechain)
        return 0;
 }
 
+bool nft_chain_offload_support(const struct nft_base_chain *basechain)
+{
+       struct net_device *dev;
+       struct nft_hook *hook;
+
+       if (nft_chain_offload_priority(basechain) < 0)
+               return false;
+
+       list_for_each_entry(hook, &basechain->hook_list, list) {
+               if (hook->ops.pf != NFPROTO_NETDEV ||
+                   hook->ops.hooknum != NF_NETDEV_INGRESS)
+                       return false;
+
+               dev = hook->ops.dev;
+               if (!dev->netdev_ops->ndo_setup_tc && !flow_indr_dev_exists())
+                       return false;
+       }
+
+       return true;
+}
+
 static void nft_flow_cls_offload_setup(struct flow_cls_offload *cls_flow,
                                       const struct nft_base_chain *basechain,
                                       const struct nft_rule *rule,
index af15102..f466af4 100644 (file)
@@ -614,7 +614,7 @@ static void __net_exit cttimeout_net_exit(struct net *net)
 
        nf_ct_untimeout(net, NULL);
 
-       list_for_each_entry_safe(cur, tmp, &pernet->nfct_timeout_freelist, head) {
+       list_for_each_entry_safe(cur, tmp, &pernet->nfct_timeout_freelist, free_head) {
                list_del(&cur->free_head);
 
                if (refcount_dec_and_test(&cur->refcnt))
index ac48592..55d2d49 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/in.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
+#include <linux/random.h>
 #include <linux/smp.h>
 #include <linux/static_key.h>
 #include <net/dst.h>
@@ -32,8 +33,6 @@
 #define NFT_META_SECS_PER_DAY          86400
 #define NFT_META_DAYS_PER_WEEK         7
 
-static DEFINE_PER_CPU(struct rnd_state, nft_prandom_state);
-
 static u8 nft_meta_weekday(void)
 {
        time64_t secs = ktime_get_real_seconds();
@@ -271,13 +270,6 @@ static bool nft_meta_get_eval_ifname(enum nft_meta_keys key, u32 *dest,
        return true;
 }
 
-static noinline u32 nft_prandom_u32(void)
-{
-       struct rnd_state *state = this_cpu_ptr(&nft_prandom_state);
-
-       return prandom_u32_state(state);
-}
-
 #ifdef CONFIG_IP_ROUTE_CLASSID
 static noinline bool
 nft_meta_get_eval_rtclassid(const struct sk_buff *skb, u32 *dest)
@@ -389,7 +381,7 @@ void nft_meta_get_eval(const struct nft_expr *expr,
                break;
 #endif
        case NFT_META_PRANDOM:
-               *dest = nft_prandom_u32();
+               *dest = get_random_u32();
                break;
 #ifdef CONFIG_XFRM
        case NFT_META_SECPATH:
@@ -518,7 +510,6 @@ int nft_meta_get_init(const struct nft_ctx *ctx,
                len = IFNAMSIZ;
                break;
        case NFT_META_PRANDOM:
-               prandom_init_once(&nft_prandom_state);
                len = sizeof(u32);
                break;
 #ifdef CONFIG_XFRM
index 4394df4..e5fd699 100644 (file)
@@ -335,7 +335,8 @@ static void nft_nat_inet_eval(const struct nft_expr *expr,
 {
        const struct nft_nat *priv = nft_expr_priv(expr);
 
-       if (priv->family == nft_pf(pkt))
+       if (priv->family == nft_pf(pkt) ||
+           priv->family == NFPROTO_INET)
                nft_nat_eval(expr, regs, pkt);
 }
 
index 81b40c6..45d3dc9 100644 (file)
@@ -9,12 +9,11 @@
 #include <linux/netlink.h>
 #include <linux/netfilter.h>
 #include <linux/netfilter/nf_tables.h>
+#include <linux/random.h>
 #include <linux/static_key.h>
 #include <net/netfilter/nf_tables.h>
 #include <net/netfilter/nf_tables_core.h>
 
-static DEFINE_PER_CPU(struct rnd_state, nft_numgen_prandom_state);
-
 struct nft_ng_inc {
        u8                      dreg;
        u32                     modulus;
@@ -135,12 +134,9 @@ struct nft_ng_random {
        u32                     offset;
 };
 
-static u32 nft_ng_random_gen(struct nft_ng_random *priv)
+static u32 nft_ng_random_gen(const struct nft_ng_random *priv)
 {
-       struct rnd_state *state = this_cpu_ptr(&nft_numgen_prandom_state);
-
-       return reciprocal_scale(prandom_u32_state(state), priv->modulus) +
-              priv->offset;
+       return reciprocal_scale(get_random_u32(), priv->modulus) + priv->offset;
 }
 
 static void nft_ng_random_eval(const struct nft_expr *expr,
@@ -168,8 +164,6 @@ static int nft_ng_random_init(const struct nft_ctx *ctx,
        if (priv->offset + priv->modulus - 1 < priv->offset)
                return -EOVERFLOW;
 
-       prandom_init_once(&nft_numgen_prandom_state);
-
        return nft_parse_register_store(ctx, tb[NFTA_NG_DREG], &priv->dreg,
                                        NULL, NFT_DATA_VALUE, sizeof(u32));
 }
index 1b5d730..868db46 100644 (file)
@@ -373,6 +373,7 @@ static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh,
        update_ip_l4_checksum(skb, nh, *addr, new_addr);
        csum_replace4(&nh->check, *addr, new_addr);
        skb_clear_hash(skb);
+       ovs_ct_clear(skb, NULL);
        *addr = new_addr;
 }
 
@@ -420,6 +421,7 @@ static void set_ipv6_addr(struct sk_buff *skb, u8 l4_proto,
                update_ipv6_checksum(skb, l4_proto, addr, new_addr);
 
        skb_clear_hash(skb);
+       ovs_ct_clear(skb, NULL);
        memcpy(addr, new_addr, sizeof(__be32[4]));
 }
 
@@ -660,6 +662,7 @@ static int set_nsh(struct sk_buff *skb, struct sw_flow_key *flow_key,
 static void set_tp_port(struct sk_buff *skb, __be16 *port,
                        __be16 new_port, __sum16 *check)
 {
+       ovs_ct_clear(skb, NULL);
        inet_proto_csum_replace2(check, skb, *port, new_port, false);
        *port = new_port;
 }
@@ -699,6 +702,7 @@ static int set_udp(struct sk_buff *skb, struct sw_flow_key *flow_key,
                uh->dest = dst;
                flow_key->tp.src = src;
                flow_key->tp.dst = dst;
+               ovs_ct_clear(skb, NULL);
        }
 
        skb_clear_hash(skb);
@@ -761,6 +765,8 @@ static int set_sctp(struct sk_buff *skb, struct sw_flow_key *flow_key,
        sh->checksum = old_csum ^ old_correct_csum ^ new_csum;
 
        skb_clear_hash(skb);
+       ovs_ct_clear(skb, NULL);
+
        flow_key->tp.src = sh->source;
        flow_key->tp.dst = sh->dest;
 
index 4a947c1..4e70df9 100644 (file)
@@ -1342,7 +1342,9 @@ int ovs_ct_clear(struct sk_buff *skb, struct sw_flow_key *key)
 
        nf_ct_put(ct);
        nf_ct_set(skb, NULL, IP_CT_UNTRACKED);
-       ovs_ct_fill_key(skb, key, false);
+
+       if (key)
+               ovs_ct_fill_key(skb, key, false);
 
        return 0;
 }
index 372bf54..e20d1a9 100644 (file)
@@ -407,7 +407,7 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
        if (flags & IP6_FH_F_FRAG) {
                if (frag_off) {
                        key->ip.frag = OVS_FRAG_TYPE_LATER;
-                       key->ip.proto = nexthdr;
+                       key->ip.proto = NEXTHDR_FRAGMENT;
                        return 0;
                }
                key->ip.frag = OVS_FRAG_TYPE_FIRST;
index ed4ccef..5449ed1 100644 (file)
@@ -1146,9 +1146,9 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
        struct tc_netem_rate rate;
        struct tc_netem_slot slot;
 
-       qopt.latency = min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->latency),
+       qopt.latency = min_t(psched_time_t, PSCHED_NS2TICKS(q->latency),
                             UINT_MAX);
-       qopt.jitter = min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->jitter),
+       qopt.jitter = min_t(psched_time_t, PSCHED_NS2TICKS(q->jitter),
                            UINT_MAX);
        qopt.limit = q->limit;
        qopt.loss = q->loss;
index e2c6eca..b6781ad 100644 (file)
@@ -651,6 +651,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
        new->cl_discrtry = clnt->cl_discrtry;
        new->cl_chatty = clnt->cl_chatty;
        new->cl_principal = clnt->cl_principal;
+       new->cl_max_connect = clnt->cl_max_connect;
        return new;
 
 out_err:
index df194cc..f87a2d8 100644 (file)
@@ -919,7 +919,7 @@ void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p,
 EXPORT_SYMBOL_GPL(xdr_init_encode);
 
 /**
- * xdr_commit_encode - Ensure all data is written to buffer
+ * __xdr_commit_encode - Ensure all data is written to buffer
  * @xdr: pointer to xdr_stream
  *
  * We handle encoding across page boundaries by giving the caller a
@@ -931,26 +931,29 @@ EXPORT_SYMBOL_GPL(xdr_init_encode);
  * required at the end of encoding, or any other time when the xdr_buf
  * data might be read.
  */
-inline void xdr_commit_encode(struct xdr_stream *xdr)
+void __xdr_commit_encode(struct xdr_stream *xdr)
 {
-       int shift = xdr->scratch.iov_len;
+       size_t shift = xdr->scratch.iov_len;
        void *page;
 
-       if (shift == 0)
-               return;
        page = page_address(*xdr->page_ptr);
        memcpy(xdr->scratch.iov_base, page, shift);
        memmove(page, page + shift, (void *)xdr->p - page);
        xdr_reset_scratch_buffer(xdr);
 }
-EXPORT_SYMBOL_GPL(xdr_commit_encode);
+EXPORT_SYMBOL_GPL(__xdr_commit_encode);
 
-static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
-               size_t nbytes)
+/*
+ * The buffer space to be reserved crosses the boundary between
+ * xdr->buf->head and xdr->buf->pages, or between two pages
+ * in xdr->buf->pages.
+ */
+static noinline __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
+                                                  size_t nbytes)
 {
-       __be32 *p;
        int space_left;
        int frag1bytes, frag2bytes;
+       void *p;
 
        if (nbytes > PAGE_SIZE)
                goto out_overflow; /* Bigger buffers require special handling */
@@ -964,6 +967,7 @@ static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
                xdr->buf->page_len += frag1bytes;
        xdr->page_ptr++;
        xdr->iov = NULL;
+
        /*
         * If the last encode didn't end exactly on a page boundary, the
         * next one will straddle boundaries.  Encode into the next
@@ -972,14 +976,19 @@ static __be32 *xdr_get_next_encode_buffer(struct xdr_stream *xdr,
         * space at the end of the previous buffer:
         */
        xdr_set_scratch_buffer(xdr, xdr->p, frag1bytes);
-       p = page_address(*xdr->page_ptr);
+
        /*
-        * Note this is where the next encode will start after we've
-        * shifted this one back:
+        * xdr->p is where the next encode will start after
+        * xdr_commit_encode() has shifted this one back:
         */
-       xdr->p = (void *)p + frag2bytes;
+       p = page_address(*xdr->page_ptr);
+       xdr->p = p + frag2bytes;
        space_left = xdr->buf->buflen - xdr->buf->len;
-       xdr->end = (void *)p + min_t(int, space_left, PAGE_SIZE);
+       if (space_left - nbytes >= PAGE_SIZE)
+               xdr->end = p + PAGE_SIZE;
+       else
+               xdr->end = p + space_left - frag1bytes;
+
        xdr->buf->page_len += frag2bytes;
        xdr->buf->len += nbytes;
        return p;
index 5f0155f..11cf7c6 100644 (file)
@@ -478,10 +478,10 @@ svc_rdma_build_writes(struct svc_rdma_write_info *info,
                unsigned int write_len;
                u64 offset;
 
-               seg = &info->wi_chunk->ch_segments[info->wi_seg_no];
-               if (!seg)
+               if (info->wi_seg_no >= info->wi_chunk->ch_segcount)
                        goto out_overflow;
 
+               seg = &info->wi_chunk->ch_segments[info->wi_seg_no];
                write_len = min(remaining, seg->rs_length - info->wi_seg_off);
                if (!write_len)
                        goto out_overflow;
index 3f4542e..434e70e 100644 (file)
@@ -109,10 +109,9 @@ static void __net_exit tipc_exit_net(struct net *net)
        struct tipc_net *tn = tipc_net(net);
 
        tipc_detach_loopback(net);
+       tipc_net_stop(net);
        /* Make sure the tipc_net_finalize_work() finished */
        cancel_work_sync(&tn->work);
-       tipc_net_stop(net);
-
        tipc_bcast_stop(net);
        tipc_nametbl_stop(net);
        tipc_sk_rht_destroy(net);
index b91ddc1..2ffede4 100644 (file)
@@ -544,7 +544,7 @@ static int do_tls_getsockopt(struct sock *sk, int optname,
                rc = do_tls_getsockopt_conf(sk, optval, optlen,
                                            optname == TLS_TX);
                break;
-       case TLS_TX_ZEROCOPY_SENDFILE:
+       case TLS_TX_ZEROCOPY_RO:
                rc = do_tls_getsockopt_tx_zc(sk, optval, optlen);
                break;
        default:
@@ -731,7 +731,7 @@ static int do_tls_setsockopt(struct sock *sk, int optname, sockptr_t optval,
                                            optname == TLS_TX);
                release_sock(sk);
                break;
-       case TLS_TX_ZEROCOPY_SENDFILE:
+       case TLS_TX_ZEROCOPY_RO:
                lock_sock(sk);
                rc = do_tls_setsockopt_tx_zc(sk, optval, optlen);
                release_sock(sk);
@@ -921,6 +921,8 @@ static void tls_update(struct sock *sk, struct proto *p,
 {
        struct tls_context *ctx;
 
+       WARN_ON_ONCE(sk->sk_prot == p);
+
        ctx = tls_get_ctx(sk);
        if (likely(ctx)) {
                ctx->sk_write_space = write_space;
@@ -970,7 +972,7 @@ static int tls_get_info(const struct sock *sk, struct sk_buff *skb)
                goto nla_failure;
 
        if (ctx->tx_conf == TLS_HW && ctx->zerocopy_sendfile) {
-               err = nla_put_flag(skb, TLS_INFO_ZC_SENDFILE);
+               err = nla_put_flag(skb, TLS_INFO_ZC_RO_TX);
                if (err)
                        goto nla_failure;
        }
@@ -994,7 +996,7 @@ static size_t tls_get_info_size(const struct sock *sk)
                nla_total_size(sizeof(u16)) +   /* TLS_INFO_CIPHER */
                nla_total_size(sizeof(u16)) +   /* TLS_INFO_RXCONF */
                nla_total_size(sizeof(u16)) +   /* TLS_INFO_TXCONF */
-               nla_total_size(0) +             /* TLS_INFO_ZC_SENDFILE */
+               nla_total_size(0) +             /* TLS_INFO_ZC_RO_TX */
                0;
 
        return size;
index 654dcef..2206e6f 100644 (file)
@@ -490,7 +490,7 @@ static int unix_dgram_peer_wake_me(struct sock *sk, struct sock *other)
         * -ECONNREFUSED. Otherwise, if we haven't queued any skbs
         * to other and its full, we will hang waiting for POLLOUT.
         */
-       if (unix_recvq_full(other) && !sock_flag(other, SOCK_DEAD))
+       if (unix_recvq_full_lockless(other) && !sock_flag(other, SOCK_DEAD))
                return 1;
 
        if (connected)
index e0a4526..0900238 100644 (file)
@@ -373,7 +373,8 @@ u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max_entries)
                goto out;
        }
 
-       nb_pkts = xskq_cons_peek_desc_batch(xs->tx, pool, max_entries);
+       max_entries = xskq_cons_nb_entries(xs->tx, max_entries);
+       nb_pkts = xskq_cons_read_desc_batch(xs->tx, pool, max_entries);
        if (!nb_pkts) {
                xs->tx->queue_empty_descs++;
                goto out;
@@ -389,7 +390,7 @@ u32 xsk_tx_peek_release_desc_batch(struct xsk_buff_pool *pool, u32 max_entries)
        if (!nb_pkts)
                goto out;
 
-       xskq_cons_release_n(xs->tx, nb_pkts);
+       xskq_cons_release_n(xs->tx, max_entries);
        __xskq_cons_release(xs->tx);
        xs->sk.sk_write_space(&xs->sk);
 
@@ -537,12 +538,6 @@ static int xsk_generic_xmit(struct sock *sk)
                        goto out;
                }
 
-               skb = xsk_build_skb(xs, &desc);
-               if (IS_ERR(skb)) {
-                       err = PTR_ERR(skb);
-                       goto out;
-               }
-
                /* This is the backpressure mechanism for the Tx path.
                 * Reserve space in the completion queue and only proceed
                 * if there is space in it. This avoids having to implement
@@ -551,11 +546,19 @@ static int xsk_generic_xmit(struct sock *sk)
                spin_lock_irqsave(&xs->pool->cq_lock, flags);
                if (xskq_prod_reserve(xs->pool->cq)) {
                        spin_unlock_irqrestore(&xs->pool->cq_lock, flags);
-                       kfree_skb(skb);
                        goto out;
                }
                spin_unlock_irqrestore(&xs->pool->cq_lock, flags);
 
+               skb = xsk_build_skb(xs, &desc);
+               if (IS_ERR(skb)) {
+                       err = PTR_ERR(skb);
+                       spin_lock_irqsave(&xs->pool->cq_lock, flags);
+                       xskq_prod_cancel(xs->pool->cq);
+                       spin_unlock_irqrestore(&xs->pool->cq_lock, flags);
+                       goto out;
+               }
+
                err = __dev_direct_xmit(skb, xs->queue_id);
                if  (err == NETDEV_TX_BUSY) {
                        /* Tell user-space to retry the send */
index a794410..fb20bf7 100644 (file)
@@ -282,14 +282,6 @@ static inline bool xskq_cons_peek_desc(struct xsk_queue *q,
        return xskq_cons_read_desc(q, desc, pool);
 }
 
-static inline u32 xskq_cons_peek_desc_batch(struct xsk_queue *q, struct xsk_buff_pool *pool,
-                                           u32 max)
-{
-       u32 entries = xskq_cons_nb_entries(q, max);
-
-       return xskq_cons_read_desc_batch(q, pool, entries);
-}
-
 /* To improve performance in the xskq_cons_release functions, only update local state here.
  * Reflect this to global state when we get new entries from the ring in
  * xskq_cons_get_entries() and whenever Rx or Tx processing are completed in the NAPI loop.
index 24d3cf1..01ee6c8 100644 (file)
@@ -21,6 +21,7 @@
 #define BACKTRACE_DEPTH 16
 #define MAX_SYMBOL_LEN 4096
 struct fprobe sample_probe;
+static unsigned long nhit;
 
 static char symbol[MAX_SYMBOL_LEN] = "kernel_clone";
 module_param_string(symbol, symbol, sizeof(symbol), 0644);
@@ -28,6 +29,8 @@ static char nosymbol[MAX_SYMBOL_LEN] = "";
 module_param_string(nosymbol, nosymbol, sizeof(nosymbol), 0644);
 static bool stackdump = true;
 module_param(stackdump, bool, 0644);
+static bool use_trace = false;
+module_param(use_trace, bool, 0644);
 
 static void show_backtrace(void)
 {
@@ -40,7 +43,15 @@ static void show_backtrace(void)
 
 static void sample_entry_handler(struct fprobe *fp, unsigned long ip, struct pt_regs *regs)
 {
-       pr_info("Enter <%pS> ip = 0x%p\n", (void *)ip, (void *)ip);
+       if (use_trace)
+               /*
+                * This is just an example, no kernel code should call
+                * trace_printk() except when actively debugging.
+                */
+               trace_printk("Enter <%pS> ip = 0x%p\n", (void *)ip, (void *)ip);
+       else
+               pr_info("Enter <%pS> ip = 0x%p\n", (void *)ip, (void *)ip);
+       nhit++;
        if (stackdump)
                show_backtrace();
 }
@@ -49,8 +60,17 @@ static void sample_exit_handler(struct fprobe *fp, unsigned long ip, struct pt_r
 {
        unsigned long rip = instruction_pointer(regs);
 
-       pr_info("Return from <%pS> ip = 0x%p to rip = 0x%p (%pS)\n",
-               (void *)ip, (void *)ip, (void *)rip, (void *)rip);
+       if (use_trace)
+               /*
+                * This is just an example, no kernel code should call
+                * trace_printk() except when actively debugging.
+                */
+               trace_printk("Return from <%pS> ip = 0x%p to rip = 0x%p (%pS)\n",
+                       (void *)ip, (void *)ip, (void *)rip, (void *)rip);
+       else
+               pr_info("Return from <%pS> ip = 0x%p to rip = 0x%p (%pS)\n",
+                       (void *)ip, (void *)ip, (void *)rip, (void *)rip);
+       nhit++;
        if (stackdump)
                show_backtrace();
 }
@@ -112,7 +132,8 @@ static void __exit fprobe_exit(void)
 {
        unregister_fprobe(&sample_probe);
 
-       pr_info("fprobe at %s unregistered\n", symbol);
+       pr_info("fprobe at %s unregistered. %ld times hit, %ld times missed\n",
+               symbol, nhit, sample_probe.nmissed);
 }
 
 module_init(fprobe_init)
index 1f01ac6..cac070a 100644 (file)
@@ -251,8 +251,8 @@ $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE
 
 # To make this rule robust against "Argument list too long" error,
 # ensure to add $(obj)/ prefix by a shell command.
-cmd_mod = echo $(call real-search, $*.o, .o, -objs -y -m) | \
-       $(AWK) -v RS='( |\n)' '!x[$$0]++ { print("$(obj)/"$$0) }' > $@
+cmd_mod = printf '%s\n' $(call real-search, $*.o, .o, -objs -y -m) | \
+       $(AWK) '!x[$$0]++ { print("$(obj)/"$$0) }' > $@
 
 $(obj)/%.mod: FORCE
        $(call if_changed,mod)
index da745e2..6ccc2f4 100755 (executable)
@@ -8,11 +8,31 @@
 
 set -e
 
+# catch errors from ${NM}
+set -o pipefail
+
+# Run the last element of a pipeline in the current shell.
+# Without this, the while-loop would be executed in a subshell, and
+# the changes made to 'symbol_types' and 'export_symbols' would be lost.
+shopt -s lastpipe
+
 declare -A symbol_types
 declare -a export_symbols
 
 exit_code=0
 
+# If there is no symbol in the object, ${NM} (both GNU nm and llvm-nm) shows
+# 'no symbols' diagnostic (but exits with 0). It is harmless and hidden by
+# '2>/dev/null'. However, it suppresses real error messages as well. Add a
+# hand-crafted error message here.
+#
+# TODO:
+# Use --quiet instead of 2>/dev/null when we upgrade the minimum version of
+# binutils to 2.37, llvm to 13.0.0.
+# Then, the following line will be really simple:
+#   ${NM} --quiet ${1} |
+
+{ ${NM} ${1} 2>/dev/null || { echo "${0}: ${NM} failed" >&2; false; } } |
 while read value type name
 do
        # Skip the line if the number of fields is less than 3.
@@ -37,21 +57,7 @@ do
        if [[ ${name} == __ksymtab_* ]]; then
                export_symbols+=(${name#__ksymtab_})
        fi
-
-       # If there is no symbol in the object, ${NM} (both GNU nm and llvm-nm)
-       # shows 'no symbols' diagnostic (but exits with 0). It is harmless and
-       # hidden by '2>/dev/null'. However, it suppresses real error messages
-       # as well. Add a hand-crafted error message here.
-       #
-       # Use --quiet instead of 2>/dev/null when we upgrade the minimum version
-       # of binutils to 2.37, llvm to 13.0.0.
-       #
-       # Then, the following line will be really simple:
-       #   done < <(${NM} --quiet ${1})
-done < <(${NM} ${1} 2>/dev/null || { echo "${0}: ${NM} failed" >&2; false; } )
-
-# Catch error in the process substitution
-wait $!
+done
 
 for name in "${export_symbols[@]}"
 do
index 0e6268d..94ed98d 100755 (executable)
@@ -95,17 +95,25 @@ __faddr2line() {
        local print_warnings=$4
 
        local sym_name=${func_addr%+*}
-       local offset=${func_addr#*+}
-       offset=${offset%/*}
+       local func_offset=${func_addr#*+}
+       func_offset=${func_offset%/*}
        local user_size=
+       local file_type
+       local is_vmlinux=0
        [[ $func_addr =~ "/" ]] && user_size=${func_addr#*/}
 
-       if [[ -z $sym_name ]] || [[ -z $offset ]] || [[ $sym_name = $func_addr ]]; then
+       if [[ -z $sym_name ]] || [[ -z $func_offset ]] || [[ $sym_name = $func_addr ]]; then
                warn "bad func+offset $func_addr"
                DONE=1
                return
        fi
 
+       # vmlinux uses absolute addresses in the section table rather than
+       # section offsets.
+       local file_type=$(${READELF} --file-header $objfile |
+               ${AWK} '$1 == "Type:" { print $2; exit }')
+       [[ $file_type = "EXEC" ]] && is_vmlinux=1
+
        # Go through each of the object's symbols which match the func name.
        # In rare cases there might be duplicates, in which case we print all
        # matches.
@@ -114,9 +122,11 @@ __faddr2line() {
                local sym_addr=0x${fields[1]}
                local sym_elf_size=${fields[2]}
                local sym_sec=${fields[6]}
+               local sec_size
+               local sec_name
 
                # Get the section size:
-               local sec_size=$(${READELF} --section-headers --wide $objfile |
+               sec_size=$(${READELF} --section-headers --wide $objfile |
                        sed 's/\[ /\[/' |
                        ${AWK} -v sec=$sym_sec '$1 == "[" sec "]" { print "0x" $6; exit }')
 
@@ -126,6 +136,17 @@ __faddr2line() {
                        return
                fi
 
+               # Get the section name:
+               sec_name=$(${READELF} --section-headers --wide $objfile |
+                       sed 's/\[ /\[/' |
+                       ${AWK} -v sec=$sym_sec '$1 == "[" sec "]" { print $2; exit }')
+
+               if [[ -z $sec_name ]]; then
+                       warn "bad section name: section: $sym_sec"
+                       DONE=1
+                       return
+               fi
+
                # Calculate the symbol size.
                #
                # Unfortunately we can't use the ELF size, because kallsyms
@@ -174,10 +195,10 @@ __faddr2line() {
 
                sym_size=0x$(printf %x $sym_size)
 
-               # Calculate the section address from user-supplied offset:
-               local addr=$(($sym_addr + $offset))
+               # Calculate the address from user-supplied offset:
+               local addr=$(($sym_addr + $func_offset))
                if [[ -z $addr ]] || [[ $addr = 0 ]]; then
-                       warn "bad address: $sym_addr + $offset"
+                       warn "bad address: $sym_addr + $func_offset"
                        DONE=1
                        return
                fi
@@ -191,9 +212,9 @@ __faddr2line() {
                fi
 
                # Make sure the provided offset is within the symbol's range:
-               if [[ $offset -gt $sym_size ]]; then
+               if [[ $func_offset -gt $sym_size ]]; then
                        [[ $print_warnings = 1 ]] &&
-                               echo "skipping $sym_name address at $addr due to size mismatch ($offset > $sym_size)"
+                               echo "skipping $sym_name address at $addr due to size mismatch ($func_offset > $sym_size)"
                        continue
                fi
 
@@ -202,11 +223,13 @@ __faddr2line() {
                [[ $FIRST = 0 ]] && echo
                FIRST=0
 
-               echo "$sym_name+$offset/$sym_size:"
+               echo "$sym_name+$func_offset/$sym_size:"
 
                # Pass section address to addr2line and strip absolute paths
                # from the output:
-               local output=$(${ADDR2LINE} -fpie $objfile $addr | sed "s; $dir_prefix\(\./\)*; ;")
+               local args="--functions --pretty-print --inlines --exe=$objfile"
+               [[ $is_vmlinux = 0 ]] && args="$args --section=$sec_name"
+               local output=$(${ADDR2LINE} $args $addr | sed "s; $dir_prefix\(\./\)*; ;")
                [[ -z $output ]] && continue
 
                # Default output (non --list):
index 90e1565..8843ab3 100644 (file)
@@ -24,9 +24,9 @@ class LxConfigDump(gdb.Command):
             filename = arg
 
         try:
-            py_config_ptr = gdb.parse_and_eval("kernel_config_data + 8")
-            py_config_size = gdb.parse_and_eval(
-                    "sizeof(kernel_config_data) - 1 - 8 * 2")
+            py_config_ptr = gdb.parse_and_eval("&kernel_config_data")
+            py_config_ptr_end = gdb.parse_and_eval("&kernel_config_data_end")
+            py_config_size = py_config_ptr_end - py_config_ptr
         except gdb.error as e:
             raise gdb.GdbError("Can't find config, enable CONFIG_IKCONFIG?")
 
index faacf70..653fadb 100755 (executable)
@@ -56,4 +56,7 @@ EOT
 # point addresses.
 sed -e 's/^\.//' |
 sort -u |
+# Ignore __this_module. It's not an exported symbol, and will be resolved
+# when the final .ko's are linked.
+grep -v '^__this_module$' |
 sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
index 29d5a84..620dc8c 100644 (file)
@@ -980,7 +980,7 @@ static const struct sectioncheck sectioncheck[] = {
 },
 /* Do not export init/exit functions or data */
 {
-       .fromsec = { "__ksymtab*", NULL },
+       .fromsec = { "___ksymtab*", NULL },
        .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
        .mismatch = EXPORT_TO_INIT_EXIT,
        .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
index 04c4b96..f1718cc 100644 (file)
@@ -34,9 +34,8 @@ generate_deps() {
        local mod=${1%.ko:}
        shift
        local namespaces="$*"
-       local mod_source_files="`cat $mod.mod | sed -n 1p                      \
-                                             | sed -e 's/\.o/\.c/g'           \
-                                             | sed "s|[^ ]* *|${src_prefix}&|g"`"
+       local mod_source_files=$(sed "s|^\(.*\)\.o$|${src_prefix}\1.c|" $mod.mod)
+
        for ns in $namespaces; do
                echo "Adding namespace $ns to module $mod.ko."
                generate_deps_for_ns $ns "$mod_source_files"
index fbd34b8..7434e9e 100644 (file)
 #include <openssl/err.h>
 #include <openssl/engine.h>
 
+/*
+ * OpenSSL 3.0 deprecates the OpenSSL's ENGINE API.
+ *
+ * Remove this if/when that API is no longer used
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 /*
  * Use CMS if we have openssl-1.0.0 or newer available - otherwise we have to
  * assume that it's not available and its header file is missing and that we
index 0165da3..2b2c8eb 100644 (file)
@@ -283,8 +283,8 @@ int tpm2_seal_trusted(struct tpm_chip *chip,
        /* key properties */
        flags = 0;
        flags |= options->policydigest_len ? 0 : TPM2_OA_USER_WITH_AUTH;
-       flags |= payload->migratable ? (TPM2_OA_FIXED_TPM |
-                                       TPM2_OA_FIXED_PARENT) : 0;
+       flags |= payload->migratable ? 0 : (TPM2_OA_FIXED_TPM |
+                                           TPM2_OA_FIXED_PARENT);
        tpm_buf_append_u32(&buf, flags);
 
        /* policy */
index beceb89..1bbd533 100644 (file)
@@ -2600,8 +2600,9 @@ static int selinux_sb_eat_lsm_opts(char *options, void **mnt_opts)
                                }
                        }
                        rc = selinux_add_opt(token, arg, mnt_opts);
+                       kfree(arg);
+                       arg = NULL;
                        if (unlikely(rc)) {
-                               kfree(arg);
                                goto free_opt;
                        }
                } else {
@@ -2792,17 +2793,13 @@ static int selinux_fs_context_parse_param(struct fs_context *fc,
                                          struct fs_parameter *param)
 {
        struct fs_parse_result result;
-       int opt, rc;
+       int opt;
 
        opt = fs_parse(fc, selinux_fs_parameters, param, &result);
        if (opt < 0)
                return opt;
 
-       rc = selinux_add_opt(opt, param->string, &fc->security);
-       if (!rc)
-               param->string = NULL;
-
-       return rc;
+       return selinux_add_opt(opt, param->string, &fc->security);
 }
 
 /* inode security operations */
index 15dc716..8cfdaee 100644 (file)
@@ -431,33 +431,17 @@ static const struct snd_malloc_ops snd_dma_iram_ops = {
  */
 static void *snd_dma_dev_alloc(struct snd_dma_buffer *dmab, size_t size)
 {
-       void *p;
-
-       p = dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
-#ifdef CONFIG_X86
-       if (p && dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
-               set_memory_wc((unsigned long)p, PAGE_ALIGN(size) >> PAGE_SHIFT);
-#endif
-       return p;
+       return dma_alloc_coherent(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
 }
 
 static void snd_dma_dev_free(struct snd_dma_buffer *dmab)
 {
-#ifdef CONFIG_X86
-       if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
-               set_memory_wb((unsigned long)dmab->area,
-                             PAGE_ALIGN(dmab->bytes) >> PAGE_SHIFT);
-#endif
        dma_free_coherent(dmab->dev.dev, dmab->bytes, dmab->area, dmab->addr);
 }
 
 static int snd_dma_dev_mmap(struct snd_dma_buffer *dmab,
                            struct vm_area_struct *area)
 {
-#ifdef CONFIG_X86
-       if (dmab->dev.type == SNDRV_DMA_TYPE_DEV_WC)
-               area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
-#endif
        return dma_mmap_coherent(dmab->dev.dev, area,
                                 dmab->area, dmab->addr, dmab->bytes);
 }
@@ -471,10 +455,6 @@ static const struct snd_malloc_ops snd_dma_dev_ops = {
 /*
  * Write-combined pages
  */
-#ifdef CONFIG_X86
-/* On x86, share the same ops as the standard dev ops */
-#define snd_dma_wc_ops snd_dma_dev_ops
-#else /* CONFIG_X86 */
 static void *snd_dma_wc_alloc(struct snd_dma_buffer *dmab, size_t size)
 {
        return dma_alloc_wc(dmab->dev.dev, size, &dmab->addr, DEFAULT_GFP);
@@ -497,7 +477,6 @@ static const struct snd_malloc_ops snd_dma_wc_ops = {
        .free = snd_dma_wc_free,
        .mmap = snd_dma_wc_mmap,
 };
-#endif /* CONFIG_X86 */
 
 #ifdef CONFIG_SND_DMA_SGBUF
 static void *snd_dma_sg_fallback_alloc(struct snd_dma_buffer *dmab, size_t size);
index 3e9e9ac..b7e5032 100644 (file)
@@ -660,6 +660,7 @@ static const struct hda_vendor_id hda_vendor_ids[] = {
        { 0x14f1, "Conexant" },
        { 0x17e8, "Chrontel" },
        { 0x1854, "LG" },
+       { 0x19e5, "Huawei" },
        { 0x1aec, "Wolfson Microelectronics" },
        { 0x1af4, "QEMU" },
        { 0x434d, "C-Media" },
index 3f35972..161a971 100644 (file)
@@ -119,21 +119,18 @@ static int i915_component_master_match(struct device *dev, int subcomponent,
 /* check whether Intel graphics is present and reachable */
 static int i915_gfx_present(struct pci_dev *hdac_pci)
 {
-       unsigned int class = PCI_BASE_CLASS_DISPLAY << 16;
        struct pci_dev *display_dev = NULL;
-       bool match = false;
 
-       do {
-               display_dev = pci_get_class(class, display_dev);
-
-               if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL &&
+       for_each_pci_dev(display_dev) {
+               if (display_dev->vendor == PCI_VENDOR_ID_INTEL &&
+                   (display_dev->class >> 16) == PCI_BASE_CLASS_DISPLAY &&
                    connectivity_check(display_dev, hdac_pci)) {
                        pci_dev_put(display_dev);
-                       match = true;
+                       return true;
                }
-       } while (!match && display_dev);
+       }
 
-       return match;
+       return false;
 }
 
 /**
index a8fe017..ec9cbb2 100644 (file)
@@ -196,6 +196,12 @@ static const struct config_entry config_table[] = {
                                        DMI_MATCH(DMI_SYS_VENDOR, "Google"),
                                }
                        },
+                       {
+                               .ident = "UP-WHL",
+                               .matches = {
+                                       DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
+                               }
+                       },
                        {}
                }
        },
@@ -358,6 +364,12 @@ static const struct config_entry config_table[] = {
                                        DMI_MATCH(DMI_SYS_VENDOR, "Google"),
                                }
                        },
+                       {
+                               .ident = "UPX-TGL",
+                               .matches = {
+                                       DMI_MATCH(DMI_SYS_VENDOR, "AAEON"),
+                               }
+                       },
                        {}
                }
        },
index 4063da3..9db5ccd 100644 (file)
@@ -55,8 +55,8 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
 
                /* find max number of channels based on format_configuration */
                if (fmt_configs->fmt_count) {
-                       dev_dbg(dev, "%s: found %d format definitions\n",
-                               __func__, fmt_configs->fmt_count);
+                       dev_dbg(dev, "found %d format definitions\n",
+                               fmt_configs->fmt_count);
 
                        for (i = 0; i < fmt_configs->fmt_count; i++) {
                                struct wav_fmt_ext *fmt_ext;
@@ -66,9 +66,9 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
                                if (fmt_ext->fmt.channels > max_ch)
                                        max_ch = fmt_ext->fmt.channels;
                        }
-                       dev_dbg(dev, "%s: max channels found %d\n", __func__, max_ch);
+                       dev_dbg(dev, "max channels found %d\n", max_ch);
                } else {
-                       dev_dbg(dev, "%s: No format information found\n", __func__);
+                       dev_dbg(dev, "No format information found\n");
                }
 
                if (cfg->device_config.config_type != NHLT_CONFIG_TYPE_MIC_ARRAY) {
@@ -95,17 +95,16 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
                        }
 
                        if (dmic_geo > 0) {
-                               dev_dbg(dev, "%s: Array with %d dmics\n", __func__, dmic_geo);
+                               dev_dbg(dev, "Array with %d dmics\n", dmic_geo);
                        }
                        if (max_ch > dmic_geo) {
-                               dev_dbg(dev, "%s: max channels %d exceed dmic number %d\n",
-                                       __func__, max_ch, dmic_geo);
+                               dev_dbg(dev, "max channels %d exceed dmic number %d\n",
+                                       max_ch, dmic_geo);
                        }
                }
        }
 
-       dev_dbg(dev, "%s: dmic number %d max_ch %d\n",
-               __func__, dmic_geo, max_ch);
+       dev_dbg(dev, "dmic number %d max_ch %d\n", dmic_geo, max_ch);
 
        return dmic_geo;
 }
index cd1db94..7c6b1fe 100644 (file)
@@ -819,7 +819,7 @@ static void set_pin_targets(struct hda_codec *codec,
                snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val);
 }
 
-static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
+void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth)
 {
        const char *modelname = codec->fixup_name;
 
@@ -829,7 +829,7 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
                if (++depth > 10)
                        break;
                if (fix->chained_before)
-                       apply_fixup(codec, fix->chain_id, action, depth + 1);
+                       __snd_hda_apply_fixup(codec, fix->chain_id, action, depth + 1);
 
                switch (fix->type) {
                case HDA_FIXUP_PINS:
@@ -870,6 +870,7 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
                id = fix->chain_id;
        }
 }
+EXPORT_SYMBOL_GPL(__snd_hda_apply_fixup);
 
 /**
  * snd_hda_apply_fixup - Apply the fixup chain with the given action
@@ -879,7 +880,7 @@ static void apply_fixup(struct hda_codec *codec, int id, int action, int depth)
 void snd_hda_apply_fixup(struct hda_codec *codec, int action)
 {
        if (codec->fixup_list)
-               apply_fixup(codec, codec->fixup_id, action, 0);
+               __snd_hda_apply_fixup(codec, codec->fixup_id, action, 0);
 }
 EXPORT_SYMBOL_GPL(snd_hda_apply_fixup);
 
index 0a83eb6..a77165b 100644 (file)
@@ -2525,6 +2525,9 @@ static const struct pci_device_id azx_ids[] = {
          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
        { PCI_DEVICE(0x8086, 0x51cf),
          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
+       /* Meteorlake-P */
+       { PCI_DEVICE(0x8086, 0x7e28),
+         .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
        /* Broxton-P(Apollolake) */
        { PCI_DEVICE(0x8086, 0x5a98),
          .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON },
index aca5926..682dca2 100644 (file)
@@ -348,6 +348,7 @@ void snd_hda_apply_verbs(struct hda_codec *codec);
 void snd_hda_apply_pincfgs(struct hda_codec *codec,
                           const struct hda_pintbl *cfg);
 void snd_hda_apply_fixup(struct hda_codec *codec, int action);
+void __snd_hda_apply_fixup(struct hda_codec *codec, int id, int action, int depth);
 void snd_hda_pick_fixup(struct hda_codec *codec,
                        const struct hda_model_fixup *models,
                        const struct snd_pci_quirk *quirk,
index aa360a0..3e541a4 100644 (file)
@@ -1052,6 +1052,13 @@ static int patch_conexant_auto(struct hda_codec *codec)
                snd_hda_pick_fixup(codec, cxt5051_fixup_models,
                                   cxt5051_fixups, cxt_fixups);
                break;
+       case 0x14f15098:
+               codec->pin_amp_workaround = 1;
+               spec->gen.mixer_nid = 0x22;
+               spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
+               snd_hda_pick_fixup(codec, cxt5066_fixup_models,
+                                  cxt5066_fixups, cxt_fixups);
+               break;
        case 0x14f150f2:
                codec->power_save_node = 1;
                fallthrough;
@@ -1072,11 +1079,11 @@ static int patch_conexant_auto(struct hda_codec *codec)
        if (err < 0)
                goto error;
 
-       err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
+       err = cx_auto_parse_beep(codec);
        if (err < 0)
                goto error;
 
-       err = cx_auto_parse_beep(codec);
+       err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
        if (err < 0)
                goto error;
 
index 31fe417..6c209cd 100644 (file)
@@ -4554,6 +4554,7 @@ HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI",    patch_i915_icl_hdmi),
 HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI",        patch_i915_icl_hdmi),
 HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi),
 HDA_CODEC_ENTRY(0x8086281f, "Raptorlake-P HDMI",       patch_i915_adlp_hdmi),
+HDA_CODEC_ENTRY(0x8086281d, "Meteorlake HDMI", patch_i915_adlp_hdmi),
 HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi),
 HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI",        patch_i915_byt_hdmi),
 HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI",   patch_i915_byt_hdmi),
index f3ad454..cee69fa 100644 (file)
@@ -443,6 +443,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
        case 0x10ec0245:
        case 0x10ec0255:
        case 0x10ec0256:
+       case 0x19e58326:
        case 0x10ec0257:
        case 0x10ec0282:
        case 0x10ec0283:
@@ -580,6 +581,7 @@ static void alc_shutup_pins(struct hda_codec *codec)
        switch (codec->core.vendor_id) {
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
        case 0x10ec0283:
        case 0x10ec0286:
        case 0x10ec0288:
@@ -2632,6 +2634,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
        SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
        SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
+       SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
        SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
        SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
        SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
@@ -3247,6 +3250,7 @@ static void alc_disable_headset_jack_key(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_write_coef_idx(codec, 0x48, 0x0);
                alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
                break;
@@ -3275,6 +3279,7 @@ static void alc_enable_headset_jack_key(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_write_coef_idx(codec, 0x48, 0xd011);
                alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
                break;
@@ -4910,6 +4915,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_process_coef_fw(codec, coef0256);
                break;
        case 0x10ec0234:
@@ -5025,6 +5031,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_write_coef_idx(codec, 0x45, 0xc489);
                snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
                alc_process_coef_fw(codec, coef0256);
@@ -5175,6 +5182,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_write_coef_idx(codec, 0x1b, 0x0e4b);
                alc_write_coef_idx(codec, 0x45, 0xc089);
                msleep(50);
@@ -5274,6 +5282,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_process_coef_fw(codec, coef0256);
                break;
        case 0x10ec0234:
@@ -5388,6 +5397,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_process_coef_fw(codec, coef0256);
                break;
        case 0x10ec0234:
@@ -5489,6 +5499,7 @@ static void alc_determine_headset_type(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_write_coef_idx(codec, 0x1b, 0x0e4b);
                alc_write_coef_idx(codec, 0x06, 0x6104);
                alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
@@ -5783,6 +5794,7 @@ static void alc255_set_default_jack_type(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_process_coef_fw(codec, alc256fw);
                break;
        }
@@ -6385,6 +6397,7 @@ static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
        case 0x10ec0236:
        case 0x10ec0255:
        case 0x10ec0256:
+       case 0x19e58326:
                alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
                alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
                break;
@@ -6992,6 +7005,7 @@ enum {
        ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS,
        ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE,
        ALC287_FIXUP_YOGA7_14ITL_SPEAKERS,
+       ALC298_FIXUP_LENOVO_C940_DUET7,
        ALC287_FIXUP_13S_GEN2_SPEAKERS,
        ALC256_FIXUP_SET_COEF_DEFAULTS,
        ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
@@ -7010,6 +7024,23 @@ enum {
        ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE,
 };
 
+/* A special fixup for Lenovo C940 and Yoga Duet 7;
+ * both have the very same PCI SSID, and we need to apply different fixups
+ * depending on the codec ID
+ */
+static void alc298_fixup_lenovo_c940_duet7(struct hda_codec *codec,
+                                          const struct hda_fixup *fix,
+                                          int action)
+{
+       int id;
+
+       if (codec->core.vendor_id == 0x10ec0298)
+               id = ALC298_FIXUP_LENOVO_SPK_VOLUME; /* C940 */
+       else
+               id = ALC287_FIXUP_YOGA7_14ITL_SPEAKERS; /* Duet 7 */
+       __snd_hda_apply_fixup(codec, id, action, 0);
+}
+
 static const struct hda_fixup alc269_fixups[] = {
        [ALC269_FIXUP_GPIO2] = {
                .type = HDA_FIXUP_FUNC,
@@ -8709,6 +8740,10 @@ static const struct hda_fixup alc269_fixups[] = {
                .chained = true,
                .chain_id = ALC269_FIXUP_HEADSET_MODE,
        },
+       [ALC298_FIXUP_LENOVO_C940_DUET7] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = alc298_fixup_lenovo_c940_duet7,
+       },
        [ALC287_FIXUP_13S_GEN2_SPEAKERS] = {
                .type = HDA_FIXUP_VERBS,
                .v.verbs = (const struct hda_verb[]) {
@@ -9010,6 +9045,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
                      ALC285_FIXUP_HP_GPIO_AMP_INIT),
        SND_PCI_QUIRK(0x103c, 0x8783, "HP ZBook Fury 15 G7 Mobile Workstation",
                      ALC285_FIXUP_HP_GPIO_AMP_INIT),
+       SND_PCI_QUIRK(0x103c, 0x8787, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
        SND_PCI_QUIRK(0x103c, 0x8788, "HP OMEN 15", ALC285_FIXUP_HP_MUTE_LED),
        SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED),
        SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED),
@@ -9059,6 +9095,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED),
        SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED),
        SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF),
+       SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
        SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
        SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
        SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -9174,6 +9211,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1558, 0x70f3, "Clevo NH77DPQ", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1558, 0x70f4, "Clevo NH77EPY", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1558, 0x70f6, "Clevo NH77DPQ-Y", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1558, 0x7716, "Clevo NS50PU", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1558, 0x8228, "Clevo NR40BU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1558, 0x8520, "Clevo NH50D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1558, 0x8521, "Clevo NH77D[CD]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
@@ -9258,8 +9296,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
        SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
        SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
+       SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
        SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
-       SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME),
+       SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940 / Yoga Duet 7", ALC298_FIXUP_LENOVO_C940_DUET7),
        SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS),
        SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS),
        SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS),
@@ -10095,6 +10134,7 @@ static int patch_alc269(struct hda_codec *codec)
        case 0x10ec0230:
        case 0x10ec0236:
        case 0x10ec0256:
+       case 0x19e58326:
                spec->codec_variant = ALC269_TYPE_ALC256;
                spec->shutup = alc256_shutup;
                spec->init_hook = alc256_init;
@@ -10722,6 +10762,7 @@ enum {
        ALC668_FIXUP_MIC_DET_COEF,
        ALC897_FIXUP_LENOVO_HEADSET_MIC,
        ALC897_FIXUP_HEADSET_MIC_PIN,
+       ALC897_FIXUP_HP_HSMIC_VERB,
 };
 
 static const struct hda_fixup alc662_fixups[] = {
@@ -11141,6 +11182,13 @@ static const struct hda_fixup alc662_fixups[] = {
                .chained = true,
                .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
        },
+       [ALC897_FIXUP_HP_HSMIC_VERB] = {
+               .type = HDA_FIXUP_PINS,
+               .v.pins = (const struct hda_pintbl[]) {
+                       { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
+                       { }
+               },
+       },
 };
 
 static const struct snd_pci_quirk alc662_fixup_tbl[] = {
@@ -11166,6 +11214,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
        SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
        SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
+       SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
        SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
        SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
        SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
@@ -11545,6 +11594,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
        HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
        HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
        HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
+       HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
        {} /* terminator */
 };
 MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
index a05304f..aea7fae 100644 (file)
@@ -518,11 +518,11 @@ static int via_parse_auto_config(struct hda_codec *codec)
        if (err < 0)
                return err;
 
-       err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
+       err = auto_parse_beep(codec);
        if (err < 0)
                return err;
 
-       err = auto_parse_beep(codec);
+       err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
        if (err < 0)
                return err;
 
index 920190d..dfe85dc 100644 (file)
@@ -444,7 +444,8 @@ static bool cs35l36_volatile_reg(struct device *dev, unsigned int reg)
        }
 }
 
-static DECLARE_TLV_DB_SCALE(dig_vol_tlv, -10200, 25, 0);
+static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
+                                 TLV_DB_MINMAX_ITEM(-10200, 1200));
 static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
 
 static const char * const cs35l36_pcm_sftramp_text[] =  {
index aff6185..0e93318 100644 (file)
@@ -143,7 +143,7 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = {
                        0, 0xA0, 96, adc_att_tlv),
        SOC_DOUBLE_R_SX_TLV("PGA Volume",
                        CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
-                       0, 0x1A, 30, pga_tlv),
+                       0, 0x19, 30, pga_tlv),
        SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),
        SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
        SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),
index 9b182b5..10e6964 100644 (file)
@@ -137,7 +137,9 @@ static DECLARE_TLV_DB_SCALE(mic_tlv, 1600, 100, 0);
 
 static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);
 
-static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0);
+static DECLARE_TLV_DB_SCALE(pass_tlv, -6000, 50, 0);
+
+static DECLARE_TLV_DB_SCALE(mix_tlv, -5150, 50, 0);
 
 static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0);
 
@@ -351,7 +353,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
                              CS42L52_SPKB_VOL, 0, 0x40, 0xC0, hl_tlv),
 
        SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL,
-                             CS42L52_PASSTHRUB_VOL, 0, 0x88, 0x90, pga_tlv),
+                             CS42L52_PASSTHRUB_VOL, 0, 0x88, 0x90, pass_tlv),
 
        SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),
 
@@ -364,7 +366,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = {
                              CS42L52_ADCB_VOL, 0, 0xA0, 0x78, ipd_tlv),
        SOC_DOUBLE_R_SX_TLV("ADC Mixer Volume",
                             CS42L52_ADCA_MIXER_VOL, CS42L52_ADCB_MIXER_VOL,
-                               0, 0x19, 0x7F, ipd_tlv),
+                               0, 0x19, 0x7F, mix_tlv),
 
        SOC_DOUBLE("ADC Switch", CS42L52_ADC_MISC_CTL, 0, 1, 1, 0),
 
index dc23007..510c942 100644 (file)
@@ -391,9 +391,9 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = {
        SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1),
 
        SOC_DOUBLE_R_SX_TLV("Headphone Volume", CS42L56_HPA_VOLUME,
-                             CS42L56_HPB_VOLUME, 0, 0x84, 0x48, hl_tlv),
+                             CS42L56_HPB_VOLUME, 0, 0x44, 0x48, hl_tlv),
        SOC_DOUBLE_R_SX_TLV("LineOut Volume", CS42L56_LOA_VOLUME,
-                             CS42L56_LOB_VOLUME, 0, 0x84, 0x48, hl_tlv),
+                             CS42L56_LOB_VOLUME, 0, 0x44, 0x48, hl_tlv),
 
        SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL,
                        0, 0x00, 1, tone_tlv),
index 7035452..360ca2f 100644 (file)
@@ -348,22 +348,22 @@ static const struct snd_kcontrol_new cs53l30_snd_controls[] = {
        SOC_ENUM("ADC2 NG Delay", adc2_ng_delay_enum),
 
        SOC_SINGLE_SX_TLV("ADC1A PGA Volume",
-                   CS53L30_ADC1A_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
+                   CS53L30_ADC1A_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
        SOC_SINGLE_SX_TLV("ADC1B PGA Volume",
-                   CS53L30_ADC1B_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
+                   CS53L30_ADC1B_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
        SOC_SINGLE_SX_TLV("ADC2A PGA Volume",
-                   CS53L30_ADC2A_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
+                   CS53L30_ADC2A_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
        SOC_SINGLE_SX_TLV("ADC2B PGA Volume",
-                   CS53L30_ADC2B_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
+                   CS53L30_ADC2B_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
 
        SOC_SINGLE_SX_TLV("ADC1A Digital Volume",
-                   CS53L30_ADC1A_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
+                   CS53L30_ADC1A_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
        SOC_SINGLE_SX_TLV("ADC1B Digital Volume",
-                   CS53L30_ADC1B_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
+                   CS53L30_ADC1B_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
        SOC_SINGLE_SX_TLV("ADC2A Digital Volume",
-                   CS53L30_ADC2A_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
+                   CS53L30_ADC2A_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
        SOC_SINGLE_SX_TLV("ADC2B Digital Volume",
-                   CS53L30_ADC2B_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
+                   CS53L30_ADC2B_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
 };
 
 static const struct snd_soc_dapm_widget cs53l30_dapm_widgets[] = {
index 3f00ead..dd53dfd 100644 (file)
@@ -161,13 +161,16 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
        if (deemph > 1)
                return -EINVAL;
 
+       if (es8328->deemph == deemph)
+               return 0;
+
        ret = es8328_set_deemph(component);
        if (ret < 0)
                return ret;
 
        es8328->deemph = deemph;
 
-       return 0;
+       return 1;
 }
 
 
index 66bbd8f..08f6c56 100644 (file)
@@ -740,6 +740,8 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
                pll_param->pll_int, pll_param->pll_frac,
                pll_param->mclk_scaler, pll_param->pre_factor);
 
+       snd_soc_component_update_bits(component,
+               NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_OFF);
        snd_soc_component_update_bits(component,
                NAU8822_REG_PLL_N, NAU8822_PLLMCLK_DIV2 | NAU8822_PLLN_MASK,
                (pll_param->pre_factor ? NAU8822_PLLMCLK_DIV2 : 0) |
@@ -757,6 +759,8 @@ static int nau8822_set_pll(struct snd_soc_dai *dai, int pll_id, int source,
                pll_param->mclk_scaler << NAU8822_MCLKSEL_SFT);
        snd_soc_component_update_bits(component,
                NAU8822_REG_CLOCKING, NAU8822_CLKM_MASK, NAU8822_CLKM_PLL);
+       snd_soc_component_update_bits(component,
+               NAU8822_REG_POWER_MANAGEMENT_1, NAU8822_PLL_EN_MASK, NAU8822_PLL_ON);
 
        return 0;
 }
index 489191f..b45d42c 100644 (file)
@@ -90,6 +90,9 @@
 #define NAU8822_REFIMP_3K                      0x3
 #define NAU8822_IOBUF_EN                       (0x1 << 2)
 #define NAU8822_ABIAS_EN                       (0x1 << 3)
+#define NAU8822_PLL_EN_MASK                    (0x1 << 5)
+#define NAU8822_PLL_ON                         (0x1 << 5)
+#define NAU8822_PLL_OFF                                (0x0 << 5)
 
 /* NAU8822_REG_AUDIO_INTERFACE (0x4) */
 #define NAU8822_AIFMT_MASK                     (0x3 << 3)
index 34cd5a2..5cca893 100644 (file)
@@ -3868,6 +3868,7 @@ static int wm8962_runtime_suspend(struct device *dev)
 #endif
 
 static const struct dev_pm_ops wm8962_pm = {
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
        SET_RUNTIME_PM_OPS(wm8962_runtime_suspend, wm8962_runtime_resume, NULL)
 };
 
index 7973a75..6d7fd88 100644 (file)
@@ -333,7 +333,7 @@ int wm_adsp_fw_put(struct snd_kcontrol *kcontrol,
        struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
        struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
        struct wm_adsp *dsp = snd_soc_component_get_drvdata(component);
-       int ret = 0;
+       int ret = 1;
 
        if (ucontrol->value.enumerated.item[0] == dsp[e->shift_l].fw)
                return 0;
index fa950dd..e765da9 100644 (file)
@@ -1293,6 +1293,7 @@ static const struct of_device_id fsl_sai_ids[] = {
        { .compatible = "fsl,imx8mm-sai", .data = &fsl_sai_imx8mm_data },
        { .compatible = "fsl,imx8mp-sai", .data = &fsl_sai_imx8mp_data },
        { .compatible = "fsl,imx8ulp-sai", .data = &fsl_sai_imx8ulp_data },
+       { .compatible = "fsl,imx8mn-sai", .data = &fsl_sai_imx8mp_data },
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, fsl_sai_ids);
index e71d74e..f4192df 100644 (file)
@@ -54,22 +54,29 @@ static struct snd_soc_dai_link_component cs35l41_components[] = {
        },
 };
 
+/*
+ * Mapping between ACPI instance id and speaker position.
+ *
+ * Four speakers:
+ *         0: Tweeter left, 1: Woofer left
+ *         2: Tweeter right, 3: Woofer right
+ */
 static struct snd_soc_codec_conf cs35l41_codec_conf[] = {
        {
                .dlc = COMP_CODEC_CONF(CS35L41_DEV0_NAME),
-               .name_prefix = "WL",
+               .name_prefix = "TL",
        },
        {
                .dlc = COMP_CODEC_CONF(CS35L41_DEV1_NAME),
-               .name_prefix = "WR",
+               .name_prefix = "WL",
        },
        {
                .dlc = COMP_CODEC_CONF(CS35L41_DEV2_NAME),
-               .name_prefix = "TL",
+               .name_prefix = "TR",
        },
        {
                .dlc = COMP_CODEC_CONF(CS35L41_DEV3_NAME),
-               .name_prefix = "TR",
+               .name_prefix = "WR",
        },
 };
 
@@ -101,6 +108,21 @@ static int cs35l41_init(struct snd_soc_pcm_runtime *rtd)
        return ret;
 }
 
+/*
+ * Channel map:
+ *
+ * TL/WL: ASPRX1 on slot 0, ASPRX2 on slot 1 (default)
+ * TR/WR: ASPRX1 on slot 1, ASPRX2 on slot 0
+ */
+static const struct {
+       unsigned int rx[2];
+} cs35l41_channel_map[] = {
+       {.rx = {0, 1}}, /* TL */
+       {.rx = {0, 1}}, /* WL */
+       {.rx = {1, 0}}, /* TR */
+       {.rx = {1, 0}}, /* WR */
+};
+
 static int cs35l41_hw_params(struct snd_pcm_substream *substream,
                             struct snd_pcm_hw_params *params)
 {
@@ -134,6 +156,16 @@ static int cs35l41_hw_params(struct snd_pcm_substream *substream,
                                ret);
                        return ret;
                }
+
+               /* setup channel map */
+               ret = snd_soc_dai_set_channel_map(codec_dai, 0, NULL,
+                                                 ARRAY_SIZE(cs35l41_channel_map[i].rx),
+                                                 (unsigned int *)cs35l41_channel_map[i].rx);
+               if (ret < 0) {
+                       dev_err(codec_dai->dev, "fail to set channel map, ret %d\n",
+                               ret);
+                       return ret;
+               }
        }
 
        return 0;
index f03a7ae..b41ab7a 100644 (file)
@@ -898,7 +898,7 @@ static int lpass_platform_cdc_dma_mmap(struct snd_pcm_substream *substream,
        struct snd_pcm_runtime *runtime = substream->runtime;
        unsigned long size, offset;
 
-       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+       vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
        size = vma->vm_end - vma->vm_start;
        offset = vma->vm_pgoff << PAGE_SHIFT;
        return io_remap_pfn_range(vma, vma->vm_start,
index 8d74063..2897609 100644 (file)
@@ -318,7 +318,7 @@ sink_prepare:
                        p->walking = false;
                        if (ret < 0) {
                                /* unprepare the source widget */
-                               if (!widget_ops[widget->id].ipc_unprepare && swidget->prepared) {
+                               if (widget_ops[widget->id].ipc_unprepare && swidget->prepared) {
                                        widget_ops[widget->id].ipc_unprepare(swidget);
                                        swidget->prepared = false;
                                }
index 03490a4..6bdfa52 100644 (file)
@@ -150,7 +150,7 @@ static ssize_t sof_msg_inject_dfs_write(struct file *file, const char __user *bu
 {
        struct sof_client_dev *cdev = file->private_data;
        struct sof_msg_inject_priv *priv = cdev->data;
-       size_t size;
+       ssize_t size;
        int ret;
 
        if (*ppos)
@@ -158,8 +158,10 @@ static ssize_t sof_msg_inject_dfs_write(struct file *file, const char __user *bu
 
        size = simple_write_to_buffer(priv->tx_buffer, priv->max_msg_size,
                                      ppos, buffer, count);
+       if (size < 0)
+               return size;
        if (size != count)
-               return size > 0 ? -EFAULT : size;
+               return -EFAULT;
 
        memset(priv->rx_buffer, 0, priv->max_msg_size);
 
@@ -179,7 +181,7 @@ static ssize_t sof_msg_inject_ipc4_dfs_write(struct file *file,
        struct sof_client_dev *cdev = file->private_data;
        struct sof_msg_inject_priv *priv = cdev->data;
        struct sof_ipc4_msg *ipc4_msg = priv->tx_buffer;
-       size_t size;
+       ssize_t size;
        int ret;
 
        if (*ppos)
@@ -192,18 +194,20 @@ static ssize_t sof_msg_inject_ipc4_dfs_write(struct file *file,
        size = simple_write_to_buffer(&ipc4_msg->header_u64,
                                      sizeof(ipc4_msg->header_u64),
                                      ppos, buffer, count);
+       if (size < 0)
+               return size;
        if (size != sizeof(ipc4_msg->header_u64))
-               return size > 0 ? -EFAULT : size;
+               return -EFAULT;
 
        count -= size;
-       if (!count) {
-               /* Copy the payload */
-               size = simple_write_to_buffer(ipc4_msg->data_ptr,
-                                             priv->max_msg_size, ppos, buffer,
-                                             count);
-               if (size != count)
-                       return size > 0 ? -EFAULT : size;
-       }
+       /* Copy the payload */
+       size = simple_write_to_buffer(ipc4_msg->data_ptr,
+                                     priv->max_msg_size, ppos, buffer,
+                                     count);
+       if (size < 0)
+               return size;
+       if (size != count)
+               return -EFAULT;
 
        ipc4_msg->data_size = count;
 
index b7b6f38..6eb7d93 100644 (file)
@@ -637,10 +637,10 @@ static int snd_get_meter_comp_index(struct snd_us16x08_meter_store *store)
                }
        } else {
                /* skip channels with no compressor active */
-               while (!store->comp_store->val[
+               while (store->comp_index <= SND_US16X08_MAX_CHANNELS
+                       && !store->comp_store->val[
                        COMP_STORE_IDX(SND_US16X08_ID_COMP_SWITCH)]
-                       [store->comp_index - 1]
-                       && store->comp_index <= SND_US16X08_MAX_CHANNELS) {
+                       [store->comp_index - 1]) {
                        store->comp_index++;
                }
                ret = store->comp_index++;
index b470404..e692ae0 100644 (file)
@@ -291,6 +291,9 @@ int snd_usb_audioformat_set_sync_ep(struct snd_usb_audio *chip,
        bool is_playback;
        int err;
 
+       if (fmt->sync_ep)
+               return 0; /* already set up */
+
        alts = snd_usb_get_host_interface(chip, fmt->iface, fmt->altsetting);
        if (!alts)
                return 0;
@@ -304,7 +307,7 @@ int snd_usb_audioformat_set_sync_ep(struct snd_usb_audio *chip,
         * Generic sync EP handling
         */
 
-       if (altsd->bNumEndpoints < 2)
+       if (fmt->ep_idx > 0 || altsd->bNumEndpoints < 2)
                return 0;
 
        is_playback = !(get_endpoint(alts, 0)->bEndpointAddress & USB_DIR_IN);
index 78eb41b..4f56e17 100644 (file)
@@ -2658,7 +2658,12 @@ YAMAHA_DEVICE(0x7010, "UB99"),
                                        .nr_rates = 2,
                                        .rate_table = (unsigned int[]) {
                                                44100, 48000
-                                       }
+                                       },
+                                       .sync_ep = 0x82,
+                                       .sync_iface = 0,
+                                       .sync_altsetting = 1,
+                                       .sync_ep_idx = 1,
+                                       .implicit_fb = 1,
                                }
                        },
                        {
index 0d828e3..ab95fb3 100644 (file)
@@ -33,6 +33,8 @@
 #include <drm/intel_lpe_audio.h>
 #include "intel_hdmi_audio.h"
 
+#define INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS  5000
+
 #define for_each_pipe(card_ctx, pipe) \
        for ((pipe) = 0; (pipe) < (card_ctx)->num_pipes; (pipe)++)
 #define for_each_port(card_ctx, port) \
@@ -1066,7 +1068,9 @@ static int had_pcm_open(struct snd_pcm_substream *substream)
        intelhaddata = snd_pcm_substream_chip(substream);
        runtime = substream->runtime;
 
-       pm_runtime_get_sync(intelhaddata->dev);
+       retval = pm_runtime_resume_and_get(intelhaddata->dev);
+       if (retval < 0)
+               return retval;
 
        /* set the runtime hw parameter with local snd_pcm_hardware struct */
        runtime->hw = had_pcm_hardware;
@@ -1534,8 +1538,12 @@ static void had_audio_wq(struct work_struct *work)
                container_of(work, struct snd_intelhad, hdmi_audio_wq);
        struct intel_hdmi_lpe_audio_pdata *pdata = ctx->dev->platform_data;
        struct intel_hdmi_lpe_audio_port_pdata *ppdata = &pdata->port[ctx->port];
+       int ret;
+
+       ret = pm_runtime_resume_and_get(ctx->dev);
+       if (ret < 0)
+               return;
 
-       pm_runtime_get_sync(ctx->dev);
        mutex_lock(&ctx->mutex);
        if (ppdata->pipe < 0) {
                dev_dbg(ctx->dev, "%s: Event: HAD_NOTIFY_HOT_UNPLUG : port = %d\n",
@@ -1802,8 +1810,11 @@ static int __hdmi_lpe_audio_probe(struct platform_device *pdev)
        pdata->notify_audio_lpe = notify_audio_lpe;
        spin_unlock_irq(&pdata->lpe_audio_slock);
 
+       pm_runtime_set_autosuspend_delay(&pdev->dev, INTEL_HDMI_AUDIO_SUSPEND_DELAY_MS);
        pm_runtime_use_autosuspend(&pdev->dev);
+       pm_runtime_enable(&pdev->dev);
        pm_runtime_mark_last_busy(&pdev->dev);
+       pm_runtime_idle(&pdev->dev);
 
        dev_dbg(&pdev->dev, "%s: handle pending notification\n", __func__);
        for_each_port(card_ctx, port) {
index e09d690..8aa0d27 100644 (file)
@@ -36,7 +36,7 @@
 #define MIDR_VARIANT(midr)     \
        (((midr) & MIDR_VARIANT_MASK) >> MIDR_VARIANT_SHIFT)
 #define MIDR_IMPLEMENTOR_SHIFT 24
-#define MIDR_IMPLEMENTOR_MASK  (0xff << MIDR_IMPLEMENTOR_SHIFT)
+#define MIDR_IMPLEMENTOR_MASK  (0xffU << MIDR_IMPLEMENTOR_SHIFT)
 #define MIDR_IMPLEMENTOR(midr) \
        (((midr) & MIDR_IMPLEMENTOR_MASK) >> MIDR_IMPLEMENTOR_SHIFT)
 
 
 #define APPLE_CPU_PART_M1_ICESTORM     0x022
 #define APPLE_CPU_PART_M1_FIRESTORM    0x023
+#define APPLE_CPU_PART_M1_ICESTORM_PRO 0x024
+#define APPLE_CPU_PART_M1_FIRESTORM_PRO        0x025
+#define APPLE_CPU_PART_M1_ICESTORM_MAX 0x028
+#define APPLE_CPU_PART_M1_FIRESTORM_MAX        0x029
 
 #define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
 #define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)
 #define MIDR_HISI_TSV110 MIDR_CPU_MODEL(ARM_CPU_IMP_HISI, HISI_CPU_PART_TSV110)
 #define MIDR_APPLE_M1_ICESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM)
 #define MIDR_APPLE_M1_FIRESTORM MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM)
+#define MIDR_APPLE_M1_ICESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_PRO)
+#define MIDR_APPLE_M1_FIRESTORM_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_PRO)
+#define MIDR_APPLE_M1_ICESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_ICESTORM_MAX)
+#define MIDR_APPLE_M1_FIRESTORM_MAX MIDR_CPU_MODEL(ARM_CPU_IMP_APPLE, APPLE_CPU_PART_M1_FIRESTORM_MAX)
 
 /* Fujitsu Erratum 010001 affects A64FX 1.0 and 1.1, (v0r0 and v1r0) */
 #define MIDR_FUJITSU_ERRATUM_010001            MIDR_FUJITSU_A64FX
 
 #ifndef __ASSEMBLY__
 
-#include "sysreg.h"
+#include <asm/sysreg.h>
 
 #define read_cpuid(reg)                        read_sysreg_s(SYS_ ## reg)
 
index 73e643a..03acc82 100644 (file)
 #define X86_FEATURE_INVPCID_SINGLE     ( 7*32+ 7) /* Effectively INVPCID && CR4.PCIDE=1 */
 #define X86_FEATURE_HW_PSTATE          ( 7*32+ 8) /* AMD HW-PState */
 #define X86_FEATURE_PROC_FEEDBACK      ( 7*32+ 9) /* AMD ProcFeedbackInterface */
-/* FREE!                                ( 7*32+10) */
+#define X86_FEATURE_XCOMPACTED         ( 7*32+10) /* "" Use compacted XSTATE (XSAVES or XSAVEC) */
 #define X86_FEATURE_PTI                        ( 7*32+11) /* Kernel Page Table Isolation enabled */
 #define X86_FEATURE_RETPOLINE          ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
 #define X86_FEATURE_RETPOLINE_LFENCE   ( 7*32+13) /* "" Use LFENCE for Spectre variant 2 */
 #define X86_FEATURE_SSBD               ( 7*32+17) /* Speculative Store Bypass Disable */
 #define X86_FEATURE_MBA                        ( 7*32+18) /* Memory Bandwidth Allocation */
 #define X86_FEATURE_RSB_CTXSW          ( 7*32+19) /* "" Fill RSB on context switches */
-/* FREE!                                ( 7*32+20) */
+#define X86_FEATURE_PERFMON_V2         ( 7*32+20) /* AMD Performance Monitoring Version 2 */
 #define X86_FEATURE_USE_IBPB           ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
 #define X86_FEATURE_USE_IBRS_FW                ( 7*32+22) /* "" Use IBRS during runtime firmware calls */
 #define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE  ( 7*32+23) /* "" Disable Speculative Store Bypass. */
 #define X86_FEATURE_VMW_VMMCALL                ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */
 #define X86_FEATURE_PVUNLOCK           ( 8*32+20) /* "" PV unlock function */
 #define X86_FEATURE_VCPUPREEMPT                ( 8*32+21) /* "" PV vcpu_is_preempted function */
+#define X86_FEATURE_TDX_GUEST          ( 8*32+22) /* Intel Trust Domain Extensions Guest */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
 #define X86_FEATURE_FSGSBASE           ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
 #define X86_FEATURE_VIRT_SSBD          (13*32+25) /* Virtualized Speculative Store Bypass Disable */
 #define X86_FEATURE_AMD_SSB_NO         (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
 #define X86_FEATURE_CPPC               (13*32+27) /* Collaborative Processor Performance Control */
+#define X86_FEATURE_BRS                        (13*32+31) /* Branch Sampling available */
 
 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
 #define X86_FEATURE_DTHERM             (14*32+ 0) /* Digital Thermal Sensor */
 #define X86_FEATURE_SEV                        (19*32+ 1) /* AMD Secure Encrypted Virtualization */
 #define X86_FEATURE_VM_PAGE_FLUSH      (19*32+ 2) /* "" VM Page Flush MSR is supported */
 #define X86_FEATURE_SEV_ES             (19*32+ 3) /* AMD Secure Encrypted Virtualization - Encrypted State */
+#define X86_FEATURE_V_TSC_AUX          (19*32+ 9) /* "" Virtual TSC_AUX */
 #define X86_FEATURE_SME_COHERENT       (19*32+10) /* "" AMD hardware-enforced cache coherency */
 
 /*
 #define X86_BUG_TAA                    X86_BUG(22) /* CPU is affected by TSX Async Abort(TAA) */
 #define X86_BUG_ITLB_MULTIHIT          X86_BUG(23) /* CPU may incur MCE during certain page attribute changes */
 #define X86_BUG_SRBDS                  X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
+#define X86_BUG_MMIO_STALE_DATA                X86_BUG(25) /* CPU is affected by Processor MMIO Stale Data vulnerabilities */
 
 #endif /* _ASM_X86_CPUFEATURES_H */
index 1ae0fab..36369e7 100644 (file)
 # define DISABLE_SGX   (1 << (X86_FEATURE_SGX & 31))
 #endif
 
+#ifdef CONFIG_INTEL_TDX_GUEST
+# define DISABLE_TDX_GUEST     0
+#else
+# define DISABLE_TDX_GUEST     (1 << (X86_FEATURE_TDX_GUEST & 31))
+#endif
+
 /*
  * Make sure to add features to the correct mask
  */
@@ -73,7 +79,7 @@
 #define DISABLED_MASK5 0
 #define DISABLED_MASK6 0
 #define DISABLED_MASK7 (DISABLE_PTI)
-#define DISABLED_MASK8 0
+#define DISABLED_MASK8 (DISABLE_TDX_GUEST)
 #define DISABLED_MASK9 (DISABLE_SGX)
 #define DISABLED_MASK10        0
 #define DISABLED_MASK11        0
index 403e83b..d27e058 100644 (file)
                                                 * Not susceptible to
                                                 * TSX Async Abort (TAA) vulnerabilities.
                                                 */
+#define ARCH_CAP_SBDR_SSDP_NO          BIT(13) /*
+                                                * Not susceptible to SBDR and SSDP
+                                                * variants of Processor MMIO stale data
+                                                * vulnerabilities.
+                                                */
+#define ARCH_CAP_FBSDP_NO              BIT(14) /*
+                                                * Not susceptible to FBSDP variant of
+                                                * Processor MMIO stale data
+                                                * vulnerabilities.
+                                                */
+#define ARCH_CAP_PSDP_NO               BIT(15) /*
+                                                * Not susceptible to PSDP variant of
+                                                * Processor MMIO stale data
+                                                * vulnerabilities.
+                                                */
+#define ARCH_CAP_FB_CLEAR              BIT(17) /*
+                                                * VERW clears CPU fill buffer
+                                                * even on MDS_NO CPUs.
+                                                */
+#define ARCH_CAP_FB_CLEAR_CTRL         BIT(18) /*
+                                                * MSR_IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]
+                                                * bit available to control VERW
+                                                * behavior.
+                                                */
 
 #define MSR_IA32_FLUSH_CMD             0x0000010b
 #define L1D_FLUSH                      BIT(0)  /*
 #define MSR_IA32_MCU_OPT_CTRL          0x00000123
 #define RNGDS_MITG_DIS                 BIT(0)  /* SRBDS support */
 #define RTM_ALLOW                      BIT(1)  /* TSX development mode */
+#define FB_CLEAR_DIS                   BIT(3)  /* CPU Fill buffer clear disable */
 
 #define MSR_IA32_SYSENTER_CS           0x00000174
 #define MSR_IA32_SYSENTER_ESP          0x00000175
index bf6e960..2161480 100644 (file)
@@ -428,11 +428,12 @@ struct kvm_sync_regs {
        struct kvm_vcpu_events events;
 };
 
-#define KVM_X86_QUIRK_LINT0_REENABLED     (1 << 0)
-#define KVM_X86_QUIRK_CD_NW_CLEARED       (1 << 1)
-#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE     (1 << 2)
-#define KVM_X86_QUIRK_OUT_7E_INC_RIP      (1 << 3)
-#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
+#define KVM_X86_QUIRK_LINT0_REENABLED          (1 << 0)
+#define KVM_X86_QUIRK_CD_NW_CLEARED            (1 << 1)
+#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE          (1 << 2)
+#define KVM_X86_QUIRK_OUT_7E_INC_RIP           (1 << 3)
+#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT     (1 << 4)
+#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN       (1 << 5)
 
 #define KVM_STATE_NESTED_FORMAT_VMX    0
 #define KVM_STATE_NESTED_FORMAT_SVM    1
index efa9693..f69c168 100644 (file)
 #define SVM_VMGEXIT_AP_JUMP_TABLE              0x80000005
 #define SVM_VMGEXIT_SET_AP_JUMP_TABLE          0
 #define SVM_VMGEXIT_GET_AP_JUMP_TABLE          1
+#define SVM_VMGEXIT_PSC                                0x80000010
+#define SVM_VMGEXIT_GUEST_REQUEST              0x80000011
+#define SVM_VMGEXIT_EXT_GUEST_REQUEST          0x80000012
+#define SVM_VMGEXIT_AP_CREATION                        0x80000013
+#define SVM_VMGEXIT_AP_CREATE_ON_INIT          0
+#define SVM_VMGEXIT_AP_CREATE                  1
+#define SVM_VMGEXIT_AP_DESTROY                 2
+#define SVM_VMGEXIT_HV_FEATURES                        0x8000fffd
 #define SVM_VMGEXIT_UNSUPPORTED_EVENT          0x8000ffff
 
 /* Exit code reserved for hypervisor/software use */
        { SVM_VMGEXIT_NMI_COMPLETE,     "vmgexit_nmi_complete" }, \
        { SVM_VMGEXIT_AP_HLT_LOOP,      "vmgexit_ap_hlt_loop" }, \
        { SVM_VMGEXIT_AP_JUMP_TABLE,    "vmgexit_ap_jump_table" }, \
+       { SVM_VMGEXIT_PSC,              "vmgexit_page_state_change" }, \
+       { SVM_VMGEXIT_GUEST_REQUEST,    "vmgexit_guest_request" }, \
+       { SVM_VMGEXIT_EXT_GUEST_REQUEST, "vmgexit_ext_guest_request" }, \
+       { SVM_VMGEXIT_AP_CREATION,      "vmgexit_ap_creation" }, \
+       { SVM_VMGEXIT_HV_FEATURES,      "vmgexit_hypervisor_feature" }, \
        { SVM_EXIT_ERR,         "invalid_guest_state" }
 
 
index 6491fa8..15b940e 100644 (file)
@@ -143,6 +143,12 @@ struct unwind_hint {
        .popsection
 .endm
 
+.macro STACK_FRAME_NON_STANDARD_FP func:req
+#ifdef CONFIG_FRAME_POINTER
+       STACK_FRAME_NON_STANDARD \func
+#endif
+.endm
+
 .macro ANNOTATE_NOENDBR
 .Lhere_\@:
        .pushsection .discard.noendbr
index 05c3642..a2def7b 100644 (file)
@@ -154,25 +154,77 @@ enum i915_mocs_table_index {
        I915_MOCS_CACHED,
 };
 
-/*
+/**
+ * enum drm_i915_gem_engine_class - uapi engine type enumeration
+ *
  * Different engines serve different roles, and there may be more than one
- * engine serving each role. enum drm_i915_gem_engine_class provides a
- * classification of the role of the engine, which may be used when requesting
- * operations to be performed on a certain subset of engines, or for providing
- * information about that group.
+ * engine serving each role.  This enum provides a classification of the role
+ * of the engine, which may be used when requesting operations to be performed
+ * on a certain subset of engines, or for providing information about that
+ * group.
  */
 enum drm_i915_gem_engine_class {
+       /**
+        * @I915_ENGINE_CLASS_RENDER:
+        *
+        * Render engines support instructions used for 3D, Compute (GPGPU),
+        * and programmable media workloads.  These instructions fetch data and
+        * dispatch individual work items to threads that operate in parallel.
+        * The threads run small programs (called "kernels" or "shaders") on
+        * the GPU's execution units (EUs).
+        */
        I915_ENGINE_CLASS_RENDER        = 0,
+
+       /**
+        * @I915_ENGINE_CLASS_COPY:
+        *
+        * Copy engines (also referred to as "blitters") support instructions
+        * that move blocks of data from one location in memory to another,
+        * or that fill a specified location of memory with fixed data.
+        * Copy engines can perform pre-defined logical or bitwise operations
+        * on the source, destination, or pattern data.
+        */
        I915_ENGINE_CLASS_COPY          = 1,
+
+       /**
+        * @I915_ENGINE_CLASS_VIDEO:
+        *
+        * Video engines (also referred to as "bit stream decode" (BSD) or
+        * "vdbox") support instructions that perform fixed-function media
+        * decode and encode.
+        */
        I915_ENGINE_CLASS_VIDEO         = 2,
+
+       /**
+        * @I915_ENGINE_CLASS_VIDEO_ENHANCE:
+        *
+        * Video enhancement engines (also referred to as "vebox") support
+        * instructions related to image enhancement.
+        */
        I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
 
-       /* should be kept compact */
+       /**
+        * @I915_ENGINE_CLASS_COMPUTE:
+        *
+        * Compute engines support a subset of the instructions available
+        * on render engines:  compute engines support Compute (GPGPU) and
+        * programmable media workloads, but do not support the 3D pipeline.
+        */
+       I915_ENGINE_CLASS_COMPUTE       = 4,
+
+       /* Values in this enum should be kept compact. */
 
+       /**
+        * @I915_ENGINE_CLASS_INVALID:
+        *
+        * Placeholder value to represent an invalid engine class assignment.
+        */
        I915_ENGINE_CLASS_INVALID       = -1
 };
 
-/*
+/**
+ * struct i915_engine_class_instance - Engine class/instance identifier
+ *
  * There may be more than one engine fulfilling any role within the system.
  * Each engine of a class is given a unique instance number and therefore
  * any engine can be specified by its class:instance tuplet. APIs that allow
@@ -180,10 +232,21 @@ enum drm_i915_gem_engine_class {
  * for this identification.
  */
 struct i915_engine_class_instance {
-       __u16 engine_class; /* see enum drm_i915_gem_engine_class */
-       __u16 engine_instance;
+       /**
+        * @engine_class:
+        *
+        * Engine class from enum drm_i915_gem_engine_class
+        */
+       __u16 engine_class;
 #define I915_ENGINE_CLASS_INVALID_NONE -1
 #define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
+
+       /**
+        * @engine_instance:
+        *
+        * Engine instance.
+        */
+       __u16 engine_instance;
 };
 
 /**
@@ -2657,24 +2720,65 @@ enum drm_i915_perf_record_type {
        DRM_I915_PERF_RECORD_MAX /* non-ABI */
 };
 
-/*
+/**
+ * struct drm_i915_perf_oa_config
+ *
  * Structure to upload perf dynamic configuration into the kernel.
  */
 struct drm_i915_perf_oa_config {
-       /** String formatted like "%08x-%04x-%04x-%04x-%012x" */
+       /**
+        * @uuid:
+        *
+        * String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x"
+        */
        char uuid[36];
 
+       /**
+        * @n_mux_regs:
+        *
+        * Number of mux regs in &mux_regs_ptr.
+        */
        __u32 n_mux_regs;
+
+       /**
+        * @n_boolean_regs:
+        *
+        * Number of boolean regs in &boolean_regs_ptr.
+        */
        __u32 n_boolean_regs;
+
+       /**
+        * @n_flex_regs:
+        *
+        * Number of flex regs in &flex_regs_ptr.
+        */
        __u32 n_flex_regs;
 
-       /*
-        * These fields are pointers to tuples of u32 values (register address,
-        * value). For example the expected length of the buffer pointed by
-        * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs).
+       /**
+        * @mux_regs_ptr:
+        *
+        * Pointer to tuples of u32 values (register address, value) for mux
+        * registers.  Expected length of buffer is (2 * sizeof(u32) *
+        * &n_mux_regs).
         */
        __u64 mux_regs_ptr;
+
+       /**
+        * @boolean_regs_ptr:
+        *
+        * Pointer to tuples of u32 values (register address, value) for mux
+        * registers.  Expected length of buffer is (2 * sizeof(u32) *
+        * &n_boolean_regs).
+        */
        __u64 boolean_regs_ptr;
+
+       /**
+        * @flex_regs_ptr:
+        *
+        * Pointer to tuples of u32 values (register address, value) for mux
+        * registers.  Expected length of buffer is (2 * sizeof(u32) *
+        * &n_flex_regs).
+        */
        __u64 flex_regs_ptr;
 };
 
@@ -2685,12 +2789,24 @@ struct drm_i915_perf_oa_config {
  * @data_ptr is also depends on the specific @query_id.
  */
 struct drm_i915_query_item {
-       /** @query_id: The id for this query */
+       /**
+        * @query_id:
+        *
+        * The id for this query.  Currently accepted query IDs are:
+        *  - %DRM_I915_QUERY_TOPOLOGY_INFO (see struct drm_i915_query_topology_info)
+        *  - %DRM_I915_QUERY_ENGINE_INFO (see struct drm_i915_engine_info)
+        *  - %DRM_I915_QUERY_PERF_CONFIG (see struct drm_i915_query_perf_config)
+        *  - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions)
+        *  - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`)
+        *  - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info)
+        */
        __u64 query_id;
-#define DRM_I915_QUERY_TOPOLOGY_INFO    1
-#define DRM_I915_QUERY_ENGINE_INFO     2
-#define DRM_I915_QUERY_PERF_CONFIG      3
-#define DRM_I915_QUERY_MEMORY_REGIONS   4
+#define DRM_I915_QUERY_TOPOLOGY_INFO           1
+#define DRM_I915_QUERY_ENGINE_INFO             2
+#define DRM_I915_QUERY_PERF_CONFIG             3
+#define DRM_I915_QUERY_MEMORY_REGIONS          4
+#define DRM_I915_QUERY_HWCONFIG_BLOB           5
+#define DRM_I915_QUERY_GEOMETRY_SUBSLICES      6
 /* Must be kept compact -- no holes and well documented */
 
        /**
@@ -2706,14 +2822,17 @@ struct drm_i915_query_item {
        /**
         * @flags:
         *
-        * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
+        * When &query_id == %DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
         *
-        * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the
+        * When &query_id == %DRM_I915_QUERY_PERF_CONFIG, must be one of the
         * following:
         *
-        *      - DRM_I915_QUERY_PERF_CONFIG_LIST
-        *      - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
-        *      - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
+        *      - %DRM_I915_QUERY_PERF_CONFIG_LIST
+        *      - %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
+        *      - %DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
+        *
+        * When &query_id == %DRM_I915_QUERY_GEOMETRY_SUBSLICES must contain
+        * a struct i915_engine_class_instance that references a render engine.
         */
        __u32 flags;
 #define DRM_I915_QUERY_PERF_CONFIG_LIST          1
@@ -2771,66 +2890,112 @@ struct drm_i915_query {
        __u64 items_ptr;
 };
 
-/*
- * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO :
- *
- * data: contains the 3 pieces of information :
- *
- * - the slice mask with one bit per slice telling whether a slice is
- *   available. The availability of slice X can be queried with the following
- *   formula :
- *
- *           (data[X / 8] >> (X % 8)) & 1
- *
- * - the subslice mask for each slice with one bit per subslice telling
- *   whether a subslice is available. Gen12 has dual-subslices, which are
- *   similar to two gen11 subslices. For gen12, this array represents dual-
- *   subslices. The availability of subslice Y in slice X can be queried
- *   with the following formula :
- *
- *           (data[subslice_offset +
- *                 X * subslice_stride +
- *                 Y / 8] >> (Y % 8)) & 1
- *
- * - the EU mask for each subslice in each slice with one bit per EU telling
- *   whether an EU is available. The availability of EU Z in subslice Y in
- *   slice X can be queried with the following formula :
+/**
+ * struct drm_i915_query_topology_info
  *
- *           (data[eu_offset +
- *                 (X * max_subslices + Y) * eu_stride +
- *                 Z / 8] >> (Z % 8)) & 1
+ * Describes slice/subslice/EU information queried by
+ * %DRM_I915_QUERY_TOPOLOGY_INFO
  */
 struct drm_i915_query_topology_info {
-       /*
+       /**
+        * @flags:
+        *
         * Unused for now. Must be cleared to zero.
         */
        __u16 flags;
 
+       /**
+        * @max_slices:
+        *
+        * The number of bits used to express the slice mask.
+        */
        __u16 max_slices;
+
+       /**
+        * @max_subslices:
+        *
+        * The number of bits used to express the subslice mask.
+        */
        __u16 max_subslices;
+
+       /**
+        * @max_eus_per_subslice:
+        *
+        * The number of bits in the EU mask that correspond to a single
+        * subslice's EUs.
+        */
        __u16 max_eus_per_subslice;
 
-       /*
+       /**
+        * @subslice_offset:
+        *
         * Offset in data[] at which the subslice masks are stored.
         */
        __u16 subslice_offset;
 
-       /*
+       /**
+        * @subslice_stride:
+        *
         * Stride at which each of the subslice masks for each slice are
         * stored.
         */
        __u16 subslice_stride;
 
-       /*
+       /**
+        * @eu_offset:
+        *
         * Offset in data[] at which the EU masks are stored.
         */
        __u16 eu_offset;
 
-       /*
+       /**
+        * @eu_stride:
+        *
         * Stride at which each of the EU masks for each subslice are stored.
         */
        __u16 eu_stride;
 
+       /**
+        * @data:
+        *
+        * Contains 3 pieces of information :
+        *
+        * - The slice mask with one bit per slice telling whether a slice is
+        *   available. The availability of slice X can be queried with the
+        *   following formula :
+        *
+        *   .. code:: c
+        *
+        *      (data[X / 8] >> (X % 8)) & 1
+        *
+        *   Starting with Xe_HP platforms, Intel hardware no longer has
+        *   traditional slices so i915 will always report a single slice
+        *   (hardcoded slicemask = 0x1) which contains all of the platform's
+        *   subslices.  I.e., the mask here does not reflect any of the newer
+        *   hardware concepts such as "gslices" or "cslices" since userspace
+        *   is capable of inferring those from the subslice mask.
+        *
+        * - The subslice mask for each slice with one bit per subslice telling
+        *   whether a subslice is available.  Starting with Gen12 we use the
+        *   term "subslice" to refer to what the hardware documentation
+        *   describes as a "dual-subslices."  The availability of subslice Y
+        *   in slice X can be queried with the following formula :
+        *
+        *   .. code:: c
+        *
+        *      (data[subslice_offset + X * subslice_stride + Y / 8] >> (Y % 8)) & 1
+        *
+        * - The EU mask for each subslice in each slice, with one bit per EU
+        *   telling whether an EU is available. The availability of EU Z in
+        *   subslice Y in slice X can be queried with the following formula :
+        *
+        *   .. code:: c
+        *
+        *      (data[eu_offset +
+        *            (X * max_subslices + Y) * eu_stride +
+        *            Z / 8
+        *       ] >> (Z % 8)) & 1
+        */
        __u8 data[];
 };
 
@@ -2951,52 +3116,68 @@ struct drm_i915_query_engine_info {
        struct drm_i915_engine_info engines[];
 };
 
-/*
- * Data written by the kernel with query DRM_I915_QUERY_PERF_CONFIG.
+/**
+ * struct drm_i915_query_perf_config
+ *
+ * Data written by the kernel with query %DRM_I915_QUERY_PERF_CONFIG and
+ * %DRM_I915_QUERY_GEOMETRY_SUBSLICES.
  */
 struct drm_i915_query_perf_config {
        union {
-               /*
-                * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets
-                * this fields to the number of configurations available.
+               /**
+                * @n_configs:
+                *
+                * When &drm_i915_query_item.flags ==
+                * %DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets this fields to
+                * the number of configurations available.
                 */
                __u64 n_configs;
 
-               /*
-                * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID,
-                * i915 will use the value in this field as configuration
-                * identifier to decide what data to write into config_ptr.
+               /**
+                * @config:
+                *
+                * When &drm_i915_query_item.flags ==
+                * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID, i915 will use the
+                * value in this field as configuration identifier to decide
+                * what data to write into config_ptr.
                 */
                __u64 config;
 
-               /*
-                * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,
-                * i915 will use the value in this field as configuration
-                * identifier to decide what data to write into config_ptr.
+               /**
+                * @uuid:
+                *
+                * When &drm_i915_query_item.flags ==
+                * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID, i915 will use the
+                * value in this field as configuration identifier to decide
+                * what data to write into config_ptr.
                 *
                 * String formatted like "%08x-%04x-%04x-%04x-%012x"
                 */
                char uuid[36];
        };
 
-       /*
+       /**
+        * @flags:
+        *
         * Unused for now. Must be cleared to zero.
         */
        __u32 flags;
 
-       /*
-        * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 will
-        * write an array of __u64 of configuration identifiers.
+       /**
+        * @data:
         *
-        * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_DATA, i915 will
-        * write a struct drm_i915_perf_oa_config. If the following fields of
-        * drm_i915_perf_oa_config are set not set to 0, i915 will write into
-        * the associated pointers the values of submitted when the
+        * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_LIST,
+        * i915 will write an array of __u64 of configuration identifiers.
+        *
+        * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_DATA,
+        * i915 will write a struct drm_i915_perf_oa_config. If the following
+        * fields of struct drm_i915_perf_oa_config are not set to 0, i915 will
+        * write into the associated pointers the values of submitted when the
         * configuration was created :
         *
-        *         - n_mux_regs
-        *         - n_boolean_regs
-        *         - n_flex_regs
+        *  - &drm_i915_perf_oa_config.n_mux_regs
+        *  - &drm_i915_perf_oa_config.n_boolean_regs
+        *  - &drm_i915_perf_oa_config.n_flex_regs
         */
        __u8 data[];
 };
@@ -3134,6 +3315,16 @@ struct drm_i915_query_memory_regions {
        struct drm_i915_memory_region_info regions[];
 };
 
+/**
+ * DOC: GuC HWCONFIG blob uAPI
+ *
+ * The GuC produces a blob with information about the current device.
+ * i915 reads this blob from GuC and makes it available via this uAPI.
+ *
+ * The format and meaning of the blob content are documented in the
+ * Programmer's Reference Manual.
+ */
+
 /**
  * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
  * extension support using struct i915_user_extension.
index e998764..a5e06dc 100644 (file)
@@ -272,6 +272,15 @@ struct prctl_mm_map {
 # define PR_SCHED_CORE_SCOPE_THREAD_GROUP      1
 # define PR_SCHED_CORE_SCOPE_PROCESS_GROUP     2
 
+/* arm64 Scalable Matrix Extension controls */
+/* Flag values must be in sync with SVE versions */
+#define PR_SME_SET_VL                  63      /* set task vector length */
+# define PR_SME_SET_VL_ONEXEC          (1 << 18) /* defer effect until exec */
+#define PR_SME_GET_VL                  64      /* get task vector length */
+/* Bits common to PR_SME_SET_VL and PR_SME_GET_VL */
+# define PR_SME_VL_LEN_MASK            0xffff
+# define PR_SME_VL_INHERIT             (1 << 17) /* inherit across exec */
+
 #define PR_SET_VMA             0x53564d41
 # define PR_SET_VMA_ANON_NAME          0
 
index 5d99e7c..cab645d 100644 (file)
 
 /* Set or get vhost backend capability */
 
-/* Use message type V2 */
-#define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1
-/* IOTLB can accept batching hints */
-#define VHOST_BACKEND_F_IOTLB_BATCH  0x2
-
 #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)
 #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)
 
 /* Get the valid iova range */
 #define VHOST_VDPA_GET_IOVA_RANGE      _IOR(VHOST_VIRTIO, 0x78, \
                                             struct vhost_vdpa_iova_range)
-
 /* Get the config size */
 #define VHOST_VDPA_GET_CONFIG_SIZE     _IOR(VHOST_VIRTIO, 0x79, __u32)
 
 /* Get the count of all virtqueues */
 #define VHOST_VDPA_GET_VQS_COUNT       _IOR(VHOST_VIRTIO, 0x80, __u32)
 
+/* Get the number of virtqueue groups. */
+#define VHOST_VDPA_GET_GROUP_NUM       _IOR(VHOST_VIRTIO, 0x81, __u32)
+
+/* Get the number of address spaces. */
+#define VHOST_VDPA_GET_AS_NUM          _IOR(VHOST_VIRTIO, 0x7A, unsigned int)
+
+/* Get the group for a virtqueue: read index, write group in num,
+ * The virtqueue index is stored in the index field of
+ * vhost_vring_state. The group for this specific virtqueue is
+ * returned via num field of vhost_vring_state.
+ */
+#define VHOST_VDPA_GET_VRING_GROUP     _IOWR(VHOST_VIRTIO, 0x7B,       \
+                                             struct vhost_vring_state)
+/* Set the ASID for a virtqueue group. The group index is stored in
+ * the index field of vhost_vring_state, the ASID associated with this
+ * group is stored at num field of vhost_vring_state.
+ */
+#define VHOST_VDPA_SET_GROUP_ASID      _IOW(VHOST_VIRTIO, 0x7C, \
+                                            struct vhost_vring_state)
+
 #endif
index 5a5bd74..9c366b3 100755 (executable)
@@ -1646,7 +1646,8 @@ Press any other key to refresh statistics immediately.
                          .format(values))
             if len(pids) > 1:
                 sys.exit('Error: Multiple processes found (pids: {}). Use "-p"'
-                         ' to specify the desired pid'.format(" ".join(pids)))
+                         ' to specify the desired pid'
+                         .format(" ".join(map(str, pids))))
             namespace.pid = pids[0]
 
     argparser = argparse.ArgumentParser(description=description_text,
index c1d5867..952f352 100644 (file)
@@ -149,23 +149,30 @@ int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus,
                        int fd, group_fd, *evsel_fd;
 
                        evsel_fd = FD(evsel, idx, thread);
-                       if (evsel_fd == NULL)
-                               return -EINVAL;
+                       if (evsel_fd == NULL) {
+                               err = -EINVAL;
+                               goto out;
+                       }
 
                        err = get_group_fd(evsel, idx, thread, &group_fd);
                        if (err < 0)
-                               return err;
+                               goto out;
 
                        fd = sys_perf_event_open(&evsel->attr,
                                                 threads->map[thread].pid,
                                                 cpu, group_fd, 0);
 
-                       if (fd < 0)
-                               return -errno;
+                       if (fd < 0) {
+                               err = -errno;
+                               goto out;
+                       }
 
                        *evsel_fd = fd;
                }
        }
+out:
+       if (err)
+               perf_evsel__close(evsel);
 
        return err;
 }
index a75bf11..54d4e50 100644 (file)
@@ -891,7 +891,9 @@ static int copy_kcore_dir(struct perf_inject *inject)
        if (ret < 0)
                return ret;
        pr_debug("%s\n", cmd);
-       return system(cmd);
+       ret = system(cmd);
+       free(cmd);
+       return ret;
 }
 
 static int output_fd(struct perf_inject *inject)
@@ -916,7 +918,7 @@ static int __cmd_inject(struct perf_inject *inject)
                inject->tool.tracing_data = perf_event__repipe_tracing_data;
        }
 
-       output_data_offset = session->header.data_offset;
+       output_data_offset = perf_session__data_offset(session->evlist);
 
        if (inject->build_id_all) {
                inject->tool.mmap         = perf_event__repipe_buildid_mmap;
index 4ce87a8..d2ecd4d 100644 (file)
@@ -2586,6 +2586,8 @@ int cmd_stat(int argc, const char **argv)
        if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack))
                goto out;
 
+       /* Enable ignoring missing threads when -p option is defined. */
+       evlist__first(evsel_list)->ignore_missing_thread = target.pid;
        status = 0;
        for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) {
                if (stat_config.run_count != 1 && verbose > 0)
index d1ebb55..6f921db 100644 (file)
@@ -151,11 +151,21 @@ static int detect_ioctl(void)
 static int detect_share(int wp_cnt, int bp_cnt)
 {
        struct perf_event_attr attr;
-       int i, fd[wp_cnt + bp_cnt], ret;
+       int i, *fd = NULL, ret = -1;
+
+       if (wp_cnt + bp_cnt == 0)
+               return 0;
+
+       fd = malloc(sizeof(int) * (wp_cnt + bp_cnt));
+       if (!fd)
+               return -1;
 
        for (i = 0; i < wp_cnt; i++) {
                fd[i] = wp_event((void *)&the_var, &attr);
-               TEST_ASSERT_VAL("failed to create wp\n", fd[i] != -1);
+               if (fd[i] == -1) {
+                       pr_err("failed to create wp\n");
+                       goto out;
+               }
        }
 
        for (; i < (bp_cnt + wp_cnt); i++) {
@@ -166,9 +176,11 @@ static int detect_share(int wp_cnt, int bp_cnt)
 
        ret = i != (bp_cnt + wp_cnt);
 
+out:
        while (i--)
                close(fd[i]);
 
+       free(fd);
        return ret;
 }
 
index d54c537..5c0032f 100644 (file)
@@ -97,6 +97,8 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
        ret |= test(ctx, "2.2 > 2.2", 0);
        ret |= test(ctx, "2.2 < 1.1", 0);
        ret |= test(ctx, "1.1 > 2.2", 0);
+       ret |= test(ctx, "1.1e10 < 1.1e100", 1);
+       ret |= test(ctx, "1.1e2 > 1.1e-2", 1);
 
        if (ret) {
                expr__ctx_free(ctx);
diff --git a/tools/perf/tests/shell/lib/perf_csv_output_lint.py b/tools/perf/tests/shell/lib/perf_csv_output_lint.py
deleted file mode 100644 (file)
index 714f283..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python
-# SPDX-License-Identifier: GPL-2.0
-
-import argparse
-import sys
-
-# Basic sanity check of perf CSV output as specified in the man page.
-# Currently just checks the number of fields per line in output.
-
-ap = argparse.ArgumentParser()
-ap.add_argument('--no-args', action='store_true')
-ap.add_argument('--interval', action='store_true')
-ap.add_argument('--system-wide-no-aggr', action='store_true')
-ap.add_argument('--system-wide', action='store_true')
-ap.add_argument('--event', action='store_true')
-ap.add_argument('--per-core', action='store_true')
-ap.add_argument('--per-thread', action='store_true')
-ap.add_argument('--per-die', action='store_true')
-ap.add_argument('--per-node', action='store_true')
-ap.add_argument('--per-socket', action='store_true')
-ap.add_argument('--separator', default=',', nargs='?')
-args = ap.parse_args()
-
-Lines = sys.stdin.readlines()
-
-def check_csv_output(exp):
-  for line in Lines:
-    if 'failed' not in line:
-      count = line.count(args.separator)
-      if count != exp:
-        sys.stdout.write(''.join(Lines))
-        raise RuntimeError(f'wrong number of fields. expected {exp} in {line}')
-
-try:
-  if args.no_args or args.system_wide or args.event:
-    expected_items = 6
-  elif args.interval or args.per_thread or args.system_wide_no_aggr:
-    expected_items = 7
-  elif args.per_core or args.per_socket or args.per_node or args.per_die:
-    expected_items = 8
-  else:
-    ap.print_help()
-    raise RuntimeError('No checking option specified')
-  check_csv_output(expected_items)
-
-except:
-  sys.stdout.write('Test failed for input: ' + ''.join(Lines))
-  raise
index 983220e..38c26f3 100755 (executable)
@@ -6,20 +6,41 @@
 
 set -e
 
-pythonchecker=$(dirname $0)/lib/perf_csv_output_lint.py
-if [ "x$PYTHON" == "x" ]
-then
-       if which python3 > /dev/null
-       then
-               PYTHON=python3
-       elif which python > /dev/null
-       then
-               PYTHON=python
-       else
-               echo Skipping test, python not detected please set environment variable PYTHON.
-               exit 2
-       fi
-fi
+function commachecker()
+{
+       local -i cnt=0 exp=0
+
+       case "$1"
+       in "--no-args")         exp=6
+       ;; "--system-wide")     exp=6
+       ;; "--event")           exp=6
+       ;; "--interval")        exp=7
+       ;; "--per-thread")      exp=7
+       ;; "--system-wide-no-aggr")     exp=7
+                               [ $(uname -m) = "s390x" ] && exp=6
+       ;; "--per-core")        exp=8
+       ;; "--per-socket")      exp=8
+       ;; "--per-node")        exp=8
+       ;; "--per-die")         exp=8
+       esac
+
+       while read line
+       do
+               # Check for lines beginning with Failed
+               x=${line:0:6}
+               [ "$x" = "Failed" ] && continue
+
+               # Count the number of commas
+               x=$(echo $line | tr -d -c ',')
+               cnt="${#x}"
+               # echo $line $cnt
+               [ "$cnt" -ne "$exp" ] && {
+                       echo "wrong number of fields. expected $exp in $line" 1>&2
+                       exit 1;
+               }
+       done
+       return 0
+}
 
 # Return true if perf_event_paranoid is > $1 and not running as root.
 function ParanoidAndNotRoot()
@@ -30,7 +51,7 @@ function ParanoidAndNotRoot()
 check_no_args()
 {
        echo -n "Checking CSV output: no args "
-       perf stat -x, true 2>&1 | $PYTHON $pythonchecker --no-args
+       perf stat -x, true 2>&1 | commachecker --no-args
        echo "[Success]"
 }
 
@@ -42,7 +63,7 @@ check_system_wide()
                echo "[Skip] paranoid and not root"
                return
        fi
-       perf stat -x, -a true 2>&1 | $PYTHON $pythonchecker --system-wide
+       perf stat -x, -a true 2>&1 | commachecker --system-wide
        echo "[Success]"
 }
 
@@ -55,14 +76,14 @@ check_system_wide_no_aggr()
                return
        fi
        echo -n "Checking CSV output: system wide no aggregation "
-       perf stat -x, -A -a --no-merge true 2>&1 | $PYTHON $pythonchecker --system-wide-no-aggr
+       perf stat -x, -A -a --no-merge true 2>&1 | commachecker --system-wide-no-aggr
        echo "[Success]"
 }
 
 check_interval()
 {
        echo -n "Checking CSV output: interval "
-       perf stat -x, -I 1000 true 2>&1 | $PYTHON $pythonchecker --interval
+       perf stat -x, -I 1000 true 2>&1 | commachecker --interval
        echo "[Success]"
 }
 
@@ -70,7 +91,7 @@ check_interval()
 check_event()
 {
        echo -n "Checking CSV output: event "
-       perf stat -x, -e cpu-clock true 2>&1 | $PYTHON $pythonchecker --event
+       perf stat -x, -e cpu-clock true 2>&1 | commachecker --event
        echo "[Success]"
 }
 
@@ -82,7 +103,7 @@ check_per_core()
                echo "[Skip] paranoid and not root"
                return
        fi
-       perf stat -x, --per-core -a true 2>&1 | $PYTHON $pythonchecker --per-core
+       perf stat -x, --per-core -a true 2>&1 | commachecker --per-core
        echo "[Success]"
 }
 
@@ -94,7 +115,7 @@ check_per_thread()
                echo "[Skip] paranoid and not root"
                return
        fi
-       perf stat -x, --per-thread -a true 2>&1 | $PYTHON $pythonchecker --per-thread
+       perf stat -x, --per-thread -a true 2>&1 | commachecker --per-thread
        echo "[Success]"
 }
 
@@ -106,7 +127,7 @@ check_per_die()
                echo "[Skip] paranoid and not root"
                return
        fi
-       perf stat -x, --per-die -a true 2>&1 | $PYTHON $pythonchecker --per-die
+       perf stat -x, --per-die -a true 2>&1 | commachecker --per-die
        echo "[Success]"
 }
 
@@ -118,7 +139,7 @@ check_per_node()
                echo "[Skip] paranoid and not root"
                return
        fi
-       perf stat -x, --per-node -a true 2>&1 | $PYTHON $pythonchecker --per-node
+       perf stat -x, --per-node -a true 2>&1 | commachecker --per-node
        echo "[Success]"
 }
 
@@ -130,7 +151,7 @@ check_per_socket()
                echo "[Skip] paranoid and not root"
                return
        fi
-       perf stat -x, --per-socket -a true 2>&1 | $PYTHON $pythonchecker --per-socket
+       perf stat -x, --per-socket -a true 2>&1 | commachecker --per-socket
        echo "[Success]"
 }
 
index 6ffbb27..ec108d4 100755 (executable)
@@ -43,7 +43,7 @@ CFLAGS="-g -O0 -fno-inline -fno-omit-frame-pointer"
 cc $CFLAGS $TEST_PROGRAM_SOURCE -o $TEST_PROGRAM || exit 1
 
 # Add a 1 second delay to skip samples that are not in the leaf() function
-perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 -- $TEST_PROGRAM 2> /dev/null &
+perf record -o $PERF_DATA --call-graph fp -e cycles//u -D 1000 --user-callchains -- $TEST_PROGRAM 2> /dev/null &
 PID=$!
 
 echo " + Recording (PID=$PID)..."
index d23a9e3..0b4f61b 100644 (file)
@@ -115,7 +115,7 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
         * physical_package_id will be set to -1. Hence skip this
         * test if physical_package_id returns -1 for cpu from perf_cpu_map.
         */
-       if (strncmp(session->header.env.arch, "powerpc", 7)) {
+       if (!strncmp(session->header.env.arch, "ppc64le", 7)) {
                if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
                        return TEST_SKIP;
        }
index 2c5f72f..37c53ba 100755 (executable)
@@ -33,23 +33,13 @@ create_errno_lookup_func()
        local arch=$(arch_string "$1")
        local nr name
 
-       cat <<EoFuncBegin
-static const char *errno_to_name__$arch(int err)
-{
-       switch (err) {
-EoFuncBegin
+       printf "static const char *errno_to_name__%s(int err)\n{\n\tswitch (err) {\n" $arch
 
        while read name nr; do
                printf '\tcase %d: return "%s";\n' $nr $name
        done
 
-       cat <<EoFuncEnd
-       default:
-               return "(unknown)";
-       }
-}
-
-EoFuncEnd
+       printf '\tdefault: return "(unknown)";\n\t}\n}\n'
 }
 
 process_arch()
index 6f85f5d..17311ad 100644 (file)
@@ -50,6 +50,9 @@ struct linger {
 struct msghdr {
        void            *msg_name;      /* ptr to socket address structure */
        int             msg_namelen;    /* size of socket address structure */
+
+       int             msg_inq;        /* output, data left in socket */
+
        struct iov_iter msg_iter;       /* data */
 
        /*
@@ -62,8 +65,9 @@ struct msghdr {
                void __user     *msg_control_user;
        };
        bool            msg_control_is_user : 1;
-       __kernel_size_t msg_controllen; /* ancillary data buffer length */
+       bool            msg_get_inq : 1;/* return INQ after receive */
        unsigned int    msg_flags;      /* flags on received message */
+       __kernel_size_t msg_controllen; /* ancillary data buffer length */
        struct kiocb    *msg_iocb;      /* ptr to iocb for async requests */
 };
 
@@ -434,6 +438,7 @@ extern struct file *do_accept(struct file *file, unsigned file_flags,
 extern int __sys_accept4(int fd, struct sockaddr __user *upeer_sockaddr,
                         int __user *upeer_addrlen, int flags);
 extern int __sys_socket(int family, int type, int protocol);
+extern struct file *__sys_socket_file(int family, int type, int protocol);
 extern int __sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen);
 extern int __sys_connect_file(struct file *file, struct sockaddr_storage *addr,
                              int addrlen, int file_flags);
index 1a80151..d040406 100644 (file)
@@ -387,26 +387,16 @@ static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
        return arm_spe_deliver_synth_event(spe, speq, event, &sample);
 }
 
-#define SPE_MEM_TYPE   (ARM_SPE_L1D_ACCESS | ARM_SPE_L1D_MISS | \
-                        ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS | \
-                        ARM_SPE_REMOTE_ACCESS)
-
-static bool arm_spe__is_memory_event(enum arm_spe_sample_type type)
-{
-       if (type & SPE_MEM_TYPE)
-               return true;
-
-       return false;
-}
-
 static u64 arm_spe__synth_data_source(const struct arm_spe_record *record)
 {
        union perf_mem_data_src data_src = { 0 };
 
        if (record->op == ARM_SPE_LD)
                data_src.mem_op = PERF_MEM_OP_LOAD;
-       else
+       else if (record->op == ARM_SPE_ST)
                data_src.mem_op = PERF_MEM_OP_STORE;
+       else
+               return 0;
 
        if (record->type & (ARM_SPE_LLC_ACCESS | ARM_SPE_LLC_MISS)) {
                data_src.mem_lvl = PERF_MEM_LVL_L3;
@@ -510,7 +500,11 @@ static int arm_spe_sample(struct arm_spe_queue *speq)
                        return err;
        }
 
-       if (spe->sample_memory && arm_spe__is_memory_event(record->type)) {
+       /*
+        * When data_src is zero it means the record is not a memory operation,
+        * skip to synthesize memory sample for this case.
+        */
+       if (spe->sample_memory && data_src) {
                err = arm_spe__synth_mem_sample(speq, spe->memory_id, data_src);
                if (err)
                        return err;
index 82f3d46..328668f 100644 (file)
@@ -872,6 +872,30 @@ out_free:
        return err;
 }
 
+static int filename__read_build_id_ns(const char *filename,
+                                     struct build_id *bid,
+                                     struct nsinfo *nsi)
+{
+       struct nscookie nsc;
+       int ret;
+
+       nsinfo__mountns_enter(nsi, &nsc);
+       ret = filename__read_build_id(filename, bid);
+       nsinfo__mountns_exit(&nsc);
+
+       return ret;
+}
+
+static bool dso__build_id_mismatch(struct dso *dso, const char *name)
+{
+       struct build_id bid;
+
+       if (filename__read_build_id_ns(name, &bid, dso->nsinfo) < 0)
+               return false;
+
+       return !dso__build_id_equal(dso, &bid);
+}
+
 static int dso__cache_build_id(struct dso *dso, struct machine *machine,
                               void *priv __maybe_unused)
 {
@@ -886,6 +910,10 @@ static int dso__cache_build_id(struct dso *dso, struct machine *machine,
                is_kallsyms = true;
                name = machine->mmap_name;
        }
+
+       if (!is_kallsyms && dso__build_id_mismatch(dso, name))
+               return 0;
+
        return build_id_cache__add_b(&dso->bid, name, dso->nsinfo,
                                     is_kallsyms, is_vdso);
 }
index 0a13eb2..4dc8edb 100644 (file)
@@ -91,7 +91,7 @@ static int literal(yyscan_t scanner)
 }
 %}
 
-number         ([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)
+number         ([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)(e-?[0-9]+)?
 
 sch            [-,=]
 spec           \\{sch}
index 53332da..6ad629d 100644 (file)
@@ -3686,6 +3686,20 @@ int perf_session__write_header(struct perf_session *session,
        return perf_session__do_write_header(session, evlist, fd, at_exit, NULL);
 }
 
+size_t perf_session__data_offset(const struct evlist *evlist)
+{
+       struct evsel *evsel;
+       size_t data_offset;
+
+       data_offset = sizeof(struct perf_file_header);
+       evlist__for_each_entry(evlist, evsel) {
+               data_offset += evsel->core.ids * sizeof(u64);
+       }
+       data_offset += evlist->core.nr_entries * sizeof(struct perf_file_attr);
+
+       return data_offset;
+}
+
 int perf_session__inject_header(struct perf_session *session,
                                struct evlist *evlist,
                                int fd,
index 08563c1..56916da 100644 (file)
@@ -136,6 +136,8 @@ int perf_session__inject_header(struct perf_session *session,
                                int fd,
                                struct feat_copier *fc);
 
+size_t perf_session__data_offset(const struct evlist *evlist);
+
 void perf_header__set_feat(struct perf_header *header, int feat);
 void perf_header__clear_feat(struct perf_header *header, int feat);
 bool perf_header__has_feat(const struct perf_header *header, int feat);
index ee8fcfa..8f7baea 100644 (file)
@@ -1372,6 +1372,7 @@ static int parse_ids(bool metric_no_merge, struct perf_pmu *fake_pmu,
 
        *out_evlist = NULL;
        if (!metric_no_merge || hashmap__size(ids->ids) == 0) {
+               bool added_event = false;
                int i;
                /*
                 * We may fail to share events between metrics because a tool
@@ -1393,8 +1394,16 @@ static int parse_ids(bool metric_no_merge, struct perf_pmu *fake_pmu,
                                if (!tmp)
                                        return -ENOMEM;
                                ids__insert(ids->ids, tmp);
+                               added_event = true;
                        }
                }
+               if (!added_event && hashmap__size(ids->ids) == 0) {
+                       char *tmp = strdup("duration_time");
+
+                       if (!tmp)
+                               return -ENOMEM;
+                       ids__insert(ids->ids, tmp);
+               }
        }
        ret = metricgroup__build_event_string(&events, ids, modifier,
                                              has_constraint);
index 3762269..6e5b8cc 100644 (file)
@@ -174,7 +174,7 @@ static int elf_section_address_and_offset(int fd, const char *name, u64 *address
        Elf *elf;
        GElf_Ehdr ehdr;
        GElf_Shdr shdr;
-       int ret;
+       int ret = -1;
 
        elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
        if (elf == NULL)
index 83ef55e..2974b44 100644 (file)
@@ -121,24 +121,24 @@ static void kprobe_multi_link_api_subtest(void)
 })
 
        GET_ADDR("bpf_fentry_test1", addrs[0]);
-       GET_ADDR("bpf_fentry_test2", addrs[1]);
-       GET_ADDR("bpf_fentry_test3", addrs[2]);
-       GET_ADDR("bpf_fentry_test4", addrs[3]);
-       GET_ADDR("bpf_fentry_test5", addrs[4]);
-       GET_ADDR("bpf_fentry_test6", addrs[5]);
-       GET_ADDR("bpf_fentry_test7", addrs[6]);
+       GET_ADDR("bpf_fentry_test3", addrs[1]);
+       GET_ADDR("bpf_fentry_test4", addrs[2]);
+       GET_ADDR("bpf_fentry_test5", addrs[3]);
+       GET_ADDR("bpf_fentry_test6", addrs[4]);
+       GET_ADDR("bpf_fentry_test7", addrs[5]);
+       GET_ADDR("bpf_fentry_test2", addrs[6]);
        GET_ADDR("bpf_fentry_test8", addrs[7]);
 
 #undef GET_ADDR
 
-       cookies[0] = 1;
-       cookies[1] = 2;
-       cookies[2] = 3;
-       cookies[3] = 4;
-       cookies[4] = 5;
-       cookies[5] = 6;
-       cookies[6] = 7;
-       cookies[7] = 8;
+       cookies[0] = 1; /* bpf_fentry_test1 */
+       cookies[1] = 2; /* bpf_fentry_test3 */
+       cookies[2] = 3; /* bpf_fentry_test4 */
+       cookies[3] = 4; /* bpf_fentry_test5 */
+       cookies[4] = 5; /* bpf_fentry_test6 */
+       cookies[5] = 6; /* bpf_fentry_test7 */
+       cookies[6] = 7; /* bpf_fentry_test2 */
+       cookies[7] = 8; /* bpf_fentry_test8 */
 
        opts.kprobe_multi.addrs = (const unsigned long *) &addrs;
        opts.kprobe_multi.cnt = ARRAY_SIZE(addrs);
@@ -149,14 +149,14 @@ static void kprobe_multi_link_api_subtest(void)
        if (!ASSERT_GE(link1_fd, 0, "link1_fd"))
                goto cleanup;
 
-       cookies[0] = 8;
-       cookies[1] = 7;
-       cookies[2] = 6;
-       cookies[3] = 5;
-       cookies[4] = 4;
-       cookies[5] = 3;
-       cookies[6] = 2;
-       cookies[7] = 1;
+       cookies[0] = 8; /* bpf_fentry_test1 */
+       cookies[1] = 7; /* bpf_fentry_test3 */
+       cookies[2] = 6; /* bpf_fentry_test4 */
+       cookies[3] = 5; /* bpf_fentry_test5 */
+       cookies[4] = 4; /* bpf_fentry_test6 */
+       cookies[5] = 3; /* bpf_fentry_test7 */
+       cookies[6] = 2; /* bpf_fentry_test2 */
+       cookies[7] = 1; /* bpf_fentry_test8 */
 
        opts.kprobe_multi.flags = BPF_F_KPROBE_MULTI_RETURN;
        prog_fd = bpf_program__fd(skel->progs.test_kretprobe);
@@ -181,12 +181,12 @@ static void kprobe_multi_attach_api_subtest(void)
        struct kprobe_multi *skel = NULL;
        const char *syms[8] = {
                "bpf_fentry_test1",
-               "bpf_fentry_test2",
                "bpf_fentry_test3",
                "bpf_fentry_test4",
                "bpf_fentry_test5",
                "bpf_fentry_test6",
                "bpf_fentry_test7",
+               "bpf_fentry_test2",
                "bpf_fentry_test8",
        };
        __u64 cookies[8];
@@ -198,14 +198,14 @@ static void kprobe_multi_attach_api_subtest(void)
        skel->bss->pid = getpid();
        skel->bss->test_cookie = true;
 
-       cookies[0] = 1;
-       cookies[1] = 2;
-       cookies[2] = 3;
-       cookies[3] = 4;
-       cookies[4] = 5;
-       cookies[5] = 6;
-       cookies[6] = 7;
-       cookies[7] = 8;
+       cookies[0] = 1; /* bpf_fentry_test1 */
+       cookies[1] = 2; /* bpf_fentry_test3 */
+       cookies[2] = 3; /* bpf_fentry_test4 */
+       cookies[3] = 4; /* bpf_fentry_test5 */
+       cookies[4] = 5; /* bpf_fentry_test6 */
+       cookies[5] = 6; /* bpf_fentry_test7 */
+       cookies[6] = 7; /* bpf_fentry_test2 */
+       cookies[7] = 8; /* bpf_fentry_test8 */
 
        opts.syms = syms;
        opts.cnt = ARRAY_SIZE(syms);
@@ -216,14 +216,14 @@ static void kprobe_multi_attach_api_subtest(void)
        if (!ASSERT_OK_PTR(link1, "bpf_program__attach_kprobe_multi_opts"))
                goto cleanup;
 
-       cookies[0] = 8;
-       cookies[1] = 7;
-       cookies[2] = 6;
-       cookies[3] = 5;
-       cookies[4] = 4;
-       cookies[5] = 3;
-       cookies[6] = 2;
-       cookies[7] = 1;
+       cookies[0] = 8; /* bpf_fentry_test1 */
+       cookies[1] = 7; /* bpf_fentry_test3 */
+       cookies[2] = 6; /* bpf_fentry_test4 */
+       cookies[3] = 5; /* bpf_fentry_test5 */
+       cookies[4] = 4; /* bpf_fentry_test6 */
+       cookies[5] = 3; /* bpf_fentry_test7 */
+       cookies[6] = 2; /* bpf_fentry_test2 */
+       cookies[7] = 1; /* bpf_fentry_test8 */
 
        opts.retprobe = true;
 
index d9aad15..02bb8cb 100644 (file)
@@ -395,6 +395,18 @@ static void test_func_map_prog_compatibility(void)
                                     "./test_attach_probe.o");
 }
 
+static void test_func_replace_global_func(void)
+{
+       const char *prog_name[] = {
+               "freplace/test_pkt_access",
+       };
+
+       test_fexit_bpf2bpf_common("./freplace_global_func.o",
+                                 "./test_pkt_access.o",
+                                 ARRAY_SIZE(prog_name),
+                                 prog_name, false, NULL);
+}
+
 /* NOTE: affect other tests, must run in serial mode */
 void serial_test_fexit_bpf2bpf(void)
 {
@@ -416,4 +428,6 @@ void serial_test_fexit_bpf2bpf(void)
                test_func_replace_multi();
        if (test__start_subtest("fmod_ret_freplace"))
                test_fmod_ret_freplace();
+       if (test__start_subtest("func_replace_global_func"))
+               test_func_replace_global_func();
 }
index 586dc52..5b93d5d 100644 (file)
@@ -364,6 +364,9 @@ static int get_syms(char ***symsp, size_t *cntp)
                        continue;
                if (!strncmp(name, "rcu_", 4))
                        continue;
+               if (!strncmp(name, "__ftrace_invalid_address__",
+                            sizeof("__ftrace_invalid_address__") - 1))
+                       continue;
                err = hashmap__add(map, name, NULL);
                if (err) {
                        free(name);
index c4da87e..19c7088 100644 (file)
@@ -831,6 +831,59 @@ out:
        bpf_object__close(obj);
 }
 
+#include "tailcall_bpf2bpf6.skel.h"
+
+/* Tail call counting works even when there is data on stack which is
+ * not aligned to 8 bytes.
+ */
+static void test_tailcall_bpf2bpf_6(void)
+{
+       struct tailcall_bpf2bpf6 *obj;
+       int err, map_fd, prog_fd, main_fd, data_fd, i, val;
+       LIBBPF_OPTS(bpf_test_run_opts, topts,
+               .data_in = &pkt_v4,
+               .data_size_in = sizeof(pkt_v4),
+               .repeat = 1,
+       );
+
+       obj = tailcall_bpf2bpf6__open_and_load();
+       if (!ASSERT_OK_PTR(obj, "open and load"))
+               return;
+
+       main_fd = bpf_program__fd(obj->progs.entry);
+       if (!ASSERT_GE(main_fd, 0, "entry prog fd"))
+               goto out;
+
+       map_fd = bpf_map__fd(obj->maps.jmp_table);
+       if (!ASSERT_GE(map_fd, 0, "jmp_table map fd"))
+               goto out;
+
+       prog_fd = bpf_program__fd(obj->progs.classifier_0);
+       if (!ASSERT_GE(prog_fd, 0, "classifier_0 prog fd"))
+               goto out;
+
+       i = 0;
+       err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY);
+       if (!ASSERT_OK(err, "jmp_table map update"))
+               goto out;
+
+       err = bpf_prog_test_run_opts(main_fd, &topts);
+       ASSERT_OK(err, "entry prog test run");
+       ASSERT_EQ(topts.retval, 0, "tailcall retval");
+
+       data_fd = bpf_map__fd(obj->maps.bss);
+       if (!ASSERT_GE(map_fd, 0, "bss map fd"))
+               goto out;
+
+       i = 0;
+       err = bpf_map_lookup_elem(data_fd, &i, &val);
+       ASSERT_OK(err, "bss map lookup");
+       ASSERT_EQ(val, 1, "done flag is set");
+
+out:
+       tailcall_bpf2bpf6__destroy(obj);
+}
+
 void test_tailcalls(void)
 {
        if (test__start_subtest("tailcall_1"))
@@ -855,4 +908,6 @@ void test_tailcalls(void)
                test_tailcall_bpf2bpf_4(false);
        if (test__start_subtest("tailcall_bpf2bpf_5"))
                test_tailcall_bpf2bpf_4(true);
+       if (test__start_subtest("tailcall_bpf2bpf_6"))
+               test_tailcall_bpf2bpf_6();
 }
diff --git a/tools/testing/selftests/bpf/progs/freplace_global_func.c b/tools/testing/selftests/bpf/progs/freplace_global_func.c
new file mode 100644 (file)
index 0000000..96cb61a
--- /dev/null
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/bpf.h>
+#include <bpf/bpf_helpers.h>
+
+__noinline
+int test_ctx_global_func(struct __sk_buff *skb)
+{
+       volatile int retval = 1;
+       return retval;
+}
+
+SEC("freplace/test_pkt_access")
+int new_test_pkt_access(struct __sk_buff *skb)
+{
+       return test_ctx_global_func(skb);
+}
+
+char _license[] SEC("license") = "GPL";
index 93510f4..08f95a8 100644 (file)
@@ -54,21 +54,21 @@ static void kprobe_multi_check(void *ctx, bool is_return)
 
        if (is_return) {
                SET(kretprobe_test1_result, &bpf_fentry_test1, 8);
-               SET(kretprobe_test2_result, &bpf_fentry_test2, 7);
-               SET(kretprobe_test3_result, &bpf_fentry_test3, 6);
-               SET(kretprobe_test4_result, &bpf_fentry_test4, 5);
-               SET(kretprobe_test5_result, &bpf_fentry_test5, 4);
-               SET(kretprobe_test6_result, &bpf_fentry_test6, 3);
-               SET(kretprobe_test7_result, &bpf_fentry_test7, 2);
+               SET(kretprobe_test2_result, &bpf_fentry_test2, 2);
+               SET(kretprobe_test3_result, &bpf_fentry_test3, 7);
+               SET(kretprobe_test4_result, &bpf_fentry_test4, 6);
+               SET(kretprobe_test5_result, &bpf_fentry_test5, 5);
+               SET(kretprobe_test6_result, &bpf_fentry_test6, 4);
+               SET(kretprobe_test7_result, &bpf_fentry_test7, 3);
                SET(kretprobe_test8_result, &bpf_fentry_test8, 1);
        } else {
                SET(kprobe_test1_result, &bpf_fentry_test1, 1);
-               SET(kprobe_test2_result, &bpf_fentry_test2, 2);
-               SET(kprobe_test3_result, &bpf_fentry_test3, 3);
-               SET(kprobe_test4_result, &bpf_fentry_test4, 4);
-               SET(kprobe_test5_result, &bpf_fentry_test5, 5);
-               SET(kprobe_test6_result, &bpf_fentry_test6, 6);
-               SET(kprobe_test7_result, &bpf_fentry_test7, 7);
+               SET(kprobe_test2_result, &bpf_fentry_test2, 7);
+               SET(kprobe_test3_result, &bpf_fentry_test3, 2);
+               SET(kprobe_test4_result, &bpf_fentry_test4, 3);
+               SET(kprobe_test5_result, &bpf_fentry_test5, 4);
+               SET(kprobe_test6_result, &bpf_fentry_test6, 5);
+               SET(kprobe_test7_result, &bpf_fentry_test7, 6);
                SET(kprobe_test8_result, &bpf_fentry_test8, 8);
        }
 
diff --git a/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c b/tools/testing/selftests/bpf/progs/tailcall_bpf2bpf6.c
new file mode 100644 (file)
index 0000000..41ce83d
--- /dev/null
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0
+#include <linux/bpf.h>
+#include <bpf/bpf_helpers.h>
+
+#define __unused __attribute__((unused))
+
+struct {
+       __uint(type, BPF_MAP_TYPE_PROG_ARRAY);
+       __uint(max_entries, 1);
+       __uint(key_size, sizeof(__u32));
+       __uint(value_size, sizeof(__u32));
+} jmp_table SEC(".maps");
+
+int done = 0;
+
+SEC("tc")
+int classifier_0(struct __sk_buff *skb __unused)
+{
+       done = 1;
+       return 0;
+}
+
+static __noinline
+int subprog_tail(struct __sk_buff *skb)
+{
+       /* Don't propagate the constant to the caller */
+       volatile int ret = 1;
+
+       bpf_tail_call_static(skb, &jmp_table, 0);
+       return ret;
+}
+
+SEC("tc")
+int entry(struct __sk_buff *skb)
+{
+       /* Have data on stack which size is not a multiple of 8 */
+       volatile char arr[1] = {};
+
+       return subprog_tail(skb);
+}
+
+char __license[] SEC("license") = "GPL";
index aa8e8b5..cd8c5ec 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 CFLAGS += -I../../../../usr/include/
+CFLAGS += -I../../../../include/
 
 TEST_GEN_PROGS := dma_map_benchmark
 
index c3b3c09..5c997f1 100644 (file)
@@ -10,8 +10,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <linux/map_benchmark.h>
 #include <linux/types.h>
+#include <linux/map_benchmark.h>
 
 #define NSEC_PER_MSEC  1000000L
 
index 81470a9..22423c8 100644 (file)
@@ -37,11 +37,38 @@ ifeq ($(ARCH),riscv)
        UNAME_M := riscv
 endif
 
-LIBKVM = lib/assert.c lib/elf.c lib/io.c lib/kvm_util.c lib/rbtree.c lib/sparsebit.c lib/test_util.c lib/guest_modes.c lib/perf_test_util.c
-LIBKVM_x86_64 = lib/x86_64/apic.c lib/x86_64/processor.c lib/x86_64/vmx.c lib/x86_64/svm.c lib/x86_64/ucall.c lib/x86_64/handlers.S
-LIBKVM_aarch64 = lib/aarch64/processor.c lib/aarch64/ucall.c lib/aarch64/handlers.S lib/aarch64/spinlock.c lib/aarch64/gic.c lib/aarch64/gic_v3.c lib/aarch64/vgic.c
-LIBKVM_s390x = lib/s390x/processor.c lib/s390x/ucall.c lib/s390x/diag318_test_handler.c
-LIBKVM_riscv = lib/riscv/processor.c lib/riscv/ucall.c
+LIBKVM += lib/assert.c
+LIBKVM += lib/elf.c
+LIBKVM += lib/guest_modes.c
+LIBKVM += lib/io.c
+LIBKVM += lib/kvm_util.c
+LIBKVM += lib/perf_test_util.c
+LIBKVM += lib/rbtree.c
+LIBKVM += lib/sparsebit.c
+LIBKVM += lib/test_util.c
+
+LIBKVM_x86_64 += lib/x86_64/apic.c
+LIBKVM_x86_64 += lib/x86_64/handlers.S
+LIBKVM_x86_64 += lib/x86_64/perf_test_util.c
+LIBKVM_x86_64 += lib/x86_64/processor.c
+LIBKVM_x86_64 += lib/x86_64/svm.c
+LIBKVM_x86_64 += lib/x86_64/ucall.c
+LIBKVM_x86_64 += lib/x86_64/vmx.c
+
+LIBKVM_aarch64 += lib/aarch64/gic.c
+LIBKVM_aarch64 += lib/aarch64/gic_v3.c
+LIBKVM_aarch64 += lib/aarch64/handlers.S
+LIBKVM_aarch64 += lib/aarch64/processor.c
+LIBKVM_aarch64 += lib/aarch64/spinlock.c
+LIBKVM_aarch64 += lib/aarch64/ucall.c
+LIBKVM_aarch64 += lib/aarch64/vgic.c
+
+LIBKVM_s390x += lib/s390x/diag318_test_handler.c
+LIBKVM_s390x += lib/s390x/processor.c
+LIBKVM_s390x += lib/s390x/ucall.c
+
+LIBKVM_riscv += lib/riscv/processor.c
+LIBKVM_riscv += lib/riscv/ucall.c
 
 TEST_GEN_PROGS_x86_64 = x86_64/cpuid_test
 TEST_GEN_PROGS_x86_64 += x86_64/cr4_cpuid_sync_test
@@ -173,12 +200,13 @@ LDFLAGS += -pthread $(no-pie-option) $(pgste-option)
 # $(TEST_GEN_PROGS) starts with $(OUTPUT)/
 include ../lib.mk
 
-STATIC_LIBS := $(OUTPUT)/libkvm.a
 LIBKVM_C := $(filter %.c,$(LIBKVM))
 LIBKVM_S := $(filter %.S,$(LIBKVM))
 LIBKVM_C_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM_C))
 LIBKVM_S_OBJ := $(patsubst %.S, $(OUTPUT)/%.o, $(LIBKVM_S))
-EXTRA_CLEAN += $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ) $(STATIC_LIBS) cscope.*
+LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ)
+
+EXTRA_CLEAN += $(LIBKVM_OBJS) cscope.*
 
 x := $(shell mkdir -p $(sort $(dir $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ))))
 $(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c
@@ -187,13 +215,8 @@ $(LIBKVM_C_OBJ): $(OUTPUT)/%.o: %.c
 $(LIBKVM_S_OBJ): $(OUTPUT)/%.o: %.S
        $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
 
-LIBKVM_OBJS = $(LIBKVM_C_OBJ) $(LIBKVM_S_OBJ)
-$(OUTPUT)/libkvm.a: $(LIBKVM_OBJS)
-       $(AR) crs $@ $^
-
 x := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS))))
-all: $(STATIC_LIBS)
-$(TEST_GEN_PROGS): $(STATIC_LIBS)
+$(TEST_GEN_PROGS): $(LIBKVM_OBJS)
 
 cscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib ..
 cscope:
index 7b47ae4..d60a34c 100644 (file)
@@ -336,8 +336,8 @@ static void run_test(enum vm_guest_mode mode, void *arg)
 static void help(char *name)
 {
        puts("");
-       printf("usage: %s [-h] [-i iterations] [-p offset] [-g]"
-              "[-m mode] [-b vcpu bytes] [-v vcpus] [-o] [-s mem type]"
+       printf("usage: %s [-h] [-i iterations] [-p offset] [-g] "
+              "[-m mode] [-n] [-b vcpu bytes] [-v vcpus] [-o] [-s mem type]"
               "[-x memslots]\n", name);
        puts("");
        printf(" -i: specify iteration counts (default: %"PRIu64")\n",
@@ -351,6 +351,7 @@ static void help(char *name)
        printf(" -p: specify guest physical test memory offset\n"
               "     Warning: a low offset can conflict with the loaded test code.\n");
        guest_modes_help();
+       printf(" -n: Run the vCPUs in nested mode (L2)\n");
        printf(" -b: specify the size of the memory region which should be\n"
               "     dirtied by each vCPU. e.g. 10M or 3G.\n"
               "     (default: 1G)\n");
@@ -387,7 +388,7 @@ int main(int argc, char *argv[])
 
        guest_modes_append_default();
 
-       while ((opt = getopt(argc, argv, "ghi:p:m:b:f:v:os:x:")) != -1) {
+       while ((opt = getopt(argc, argv, "ghi:p:m:nb:f:v:os:x:")) != -1) {
                switch (opt) {
                case 'g':
                        dirty_log_manual_caps = 0;
@@ -401,6 +402,9 @@ int main(int argc, char *argv[])
                case 'm':
                        guest_modes_cmdline(optarg);
                        break;
+               case 'n':
+                       perf_test_args.nested = true;
+                       break;
                case 'b':
                        guest_percpu_mem_size = parse_size(optarg);
                        break;
index a86f953..d822cb6 100644 (file)
@@ -30,10 +30,15 @@ struct perf_test_vcpu_args {
 
 struct perf_test_args {
        struct kvm_vm *vm;
+       /* The starting address and size of the guest test region. */
        uint64_t gpa;
+       uint64_t size;
        uint64_t guest_page_size;
        int wr_fract;
 
+       /* Run vCPUs in L2 instead of L1, if the architecture supports it. */
+       bool nested;
+
        struct perf_test_vcpu_args vcpu_args[KVM_MAX_VCPUS];
 };
 
@@ -49,5 +54,9 @@ void perf_test_set_wr_fract(struct kvm_vm *vm, int wr_fract);
 
 void perf_test_start_vcpu_threads(int vcpus, void (*vcpu_fn)(struct perf_test_vcpu_args *));
 void perf_test_join_vcpu_threads(int vcpus);
+void perf_test_guest_code(uint32_t vcpu_id);
+
+uint64_t perf_test_nested_pages(int nr_vcpus);
+void perf_test_setup_nested(struct kvm_vm *vm, int nr_vcpus);
 
 #endif /* SELFTEST_KVM_PERF_TEST_UTIL_H */
index d0d51ad..6ce1854 100644 (file)
@@ -482,13 +482,23 @@ 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,
-       X86_PAGE_SIZE_2M,
-       X86_PAGE_SIZE_1G,
+enum pg_level {
+       PG_LEVEL_NONE,
+       PG_LEVEL_4K,
+       PG_LEVEL_2M,
+       PG_LEVEL_1G,
+       PG_LEVEL_512G,
+       PG_LEVEL_NUM
 };
-void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
-                  enum x86_page_size page_size);
+
+#define PG_LEVEL_SHIFT(_level) ((_level - 1) * 9 + 12)
+#define PG_LEVEL_SIZE(_level) (1ull << PG_LEVEL_SHIFT(_level))
+
+#define PG_SIZE_4K PG_LEVEL_SIZE(PG_LEVEL_4K)
+#define PG_SIZE_2M PG_LEVEL_SIZE(PG_LEVEL_2M)
+#define PG_SIZE_1G PG_LEVEL_SIZE(PG_LEVEL_1G)
+
+void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr, int level);
 
 /*
  * Basic CPU control in CR0
@@ -505,9 +515,6 @@ void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
 #define X86_CR0_CD          (1UL<<30) /* Cache Disable */
 #define X86_CR0_PG          (1UL<<31) /* Paging */
 
-/* VMX_EPT_VPID_CAP bits */
-#define VMX_EPT_VPID_CAP_AD_BITS       (1ULL << 21)
-
 #define XSTATE_XTILE_CFG_BIT           17
 #define XSTATE_XTILE_DATA_BIT          18
 
index 583ceb0..cc3604f 100644 (file)
@@ -96,6 +96,9 @@
 #define VMX_MISC_PREEMPTION_TIMER_RATE_MASK    0x0000001f
 #define VMX_MISC_SAVE_EFER_LMA                 0x00000020
 
+#define VMX_EPT_VPID_CAP_1G_PAGES              0x00020000
+#define VMX_EPT_VPID_CAP_AD_BITS               0x00200000
+
 #define EXIT_REASON_FAILED_VMENTRY     0x80000000
 #define EXIT_REASON_EXCEPTION_NMI      0
 #define EXIT_REASON_EXTERNAL_INTERRUPT 1
@@ -606,6 +609,7 @@ bool load_vmcs(struct vmx_pages *vmx);
 
 bool nested_vmx_supported(void);
 void nested_vmx_check_supported(void);
+bool ept_1g_pages_supported(void);
 
 void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
                   uint64_t nested_paddr, uint64_t paddr);
@@ -613,6 +617,8 @@ void nested_map(struct vmx_pages *vmx, struct kvm_vm *vm,
                 uint64_t nested_paddr, uint64_t paddr, uint64_t size);
 void nested_map_memslot(struct vmx_pages *vmx, struct kvm_vm *vm,
                        uint32_t memslot);
+void nested_identity_map_1g(struct vmx_pages *vmx, struct kvm_vm *vm,
+                           uint64_t addr, uint64_t size);
 void prepare_eptp(struct vmx_pages *vmx, struct kvm_vm *vm,
                  uint32_t eptp_memslot);
 void prepare_virtualize_apic_accesses(struct vmx_pages *vmx, struct kvm_vm *vm);
index e0b0164..be1d972 100644 (file)
@@ -73,20 +73,19 @@ void ucall_uninit(struct kvm_vm *vm)
 
 void ucall(uint64_t cmd, int nargs, ...)
 {
-       struct ucall uc = {
-               .cmd = cmd,
-       };
+       struct ucall uc = {};
        va_list va;
        int i;
 
+       WRITE_ONCE(uc.cmd, cmd);
        nargs = nargs <= UCALL_MAX_ARGS ? nargs : UCALL_MAX_ARGS;
 
        va_start(va, nargs);
        for (i = 0; i < nargs; ++i)
-               uc.args[i] = va_arg(va, uint64_t);
+               WRITE_ONCE(uc.args[i], va_arg(va, uint64_t));
        va_end(va);
 
-       *ucall_exit_mmio_addr = (vm_vaddr_t)&uc;
+       WRITE_ONCE(*ucall_exit_mmio_addr, (vm_vaddr_t)&uc);
 }
 
 uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc)
index 722df3a..f989ff9 100644 (file)
@@ -40,7 +40,7 @@ static bool all_vcpu_threads_running;
  * Continuously write to the first 8 bytes of each page in the
  * specified region.
  */
-static void guest_code(uint32_t vcpu_id)
+void perf_test_guest_code(uint32_t vcpu_id)
 {
        struct perf_test_args *pta = &perf_test_args;
        struct perf_test_vcpu_args *vcpu_args = &pta->vcpu_args[vcpu_id];
@@ -108,8 +108,9 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus,
 {
        struct perf_test_args *pta = &perf_test_args;
        struct kvm_vm *vm;
-       uint64_t guest_num_pages;
+       uint64_t guest_num_pages, slot0_pages = DEFAULT_GUEST_PHY_PAGES;
        uint64_t backing_src_pagesz = get_backing_src_pagesz(backing_src);
+       uint64_t region_end_gfn;
        int i;
 
        pr_info("Testing guest mode: %s\n", vm_guest_mode_string(mode));
@@ -134,34 +135,54 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus,
                    "Guest memory cannot be evenly divided into %d slots.",
                    slots);
 
+       /*
+        * If using nested, allocate extra pages for the nested page tables and
+        * in-memory data structures.
+        */
+       if (pta->nested)
+               slot0_pages += perf_test_nested_pages(vcpus);
+
        /*
         * Pass guest_num_pages to populate the page tables for test memory.
         * The memory is also added to memslot 0, but that's a benign side
         * effect as KVM allows aliasing HVAs in meslots.
         */
-       vm = vm_create_with_vcpus(mode, vcpus, DEFAULT_GUEST_PHY_PAGES,
-                                 guest_num_pages, 0, guest_code, NULL);
+       vm = vm_create_with_vcpus(mode, vcpus, slot0_pages, guest_num_pages, 0,
+                                 perf_test_guest_code, NULL);
 
        pta->vm = vm;
 
+       /* Put the test region at the top guest physical memory. */
+       region_end_gfn = vm_get_max_gfn(vm) + 1;
+
+#ifdef __x86_64__
+       /*
+        * When running vCPUs in L2, restrict the test region to 48 bits to
+        * avoid needing 5-level page tables to identity map L2.
+        */
+       if (pta->nested)
+               region_end_gfn = min(region_end_gfn, (1UL << 48) / pta->guest_page_size);
+#endif
        /*
         * If there should be more memory in the guest test region than there
         * can be pages in the guest, it will definitely cause problems.
         */
-       TEST_ASSERT(guest_num_pages < vm_get_max_gfn(vm),
+       TEST_ASSERT(guest_num_pages < region_end_gfn,
                    "Requested more guest memory than address space allows.\n"
                    "    guest pages: %" PRIx64 " max gfn: %" PRIx64
                    " vcpus: %d wss: %" PRIx64 "]\n",
-                   guest_num_pages, vm_get_max_gfn(vm), vcpus,
+                   guest_num_pages, region_end_gfn - 1, vcpus,
                    vcpu_memory_bytes);
 
-       pta->gpa = (vm_get_max_gfn(vm) - guest_num_pages) * pta->guest_page_size;
+       pta->gpa = (region_end_gfn - guest_num_pages) * pta->guest_page_size;
        pta->gpa = align_down(pta->gpa, backing_src_pagesz);
 #ifdef __s390x__
        /* Align to 1M (segment size) */
        pta->gpa = align_down(pta->gpa, 1 << 20);
 #endif
-       pr_info("guest physical test memory offset: 0x%lx\n", pta->gpa);
+       pta->size = guest_num_pages * pta->guest_page_size;
+       pr_info("guest physical test memory: [0x%lx, 0x%lx)\n",
+               pta->gpa, pta->gpa + pta->size);
 
        /* Add extra memory slots for testing */
        for (i = 0; i < slots; i++) {
@@ -178,6 +199,11 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus,
 
        perf_test_setup_vcpus(vm, vcpus, vcpu_memory_bytes, partition_vcpu_memory_access);
 
+       if (pta->nested) {
+               pr_info("Configuring vCPUs to run in L2 (nested).\n");
+               perf_test_setup_nested(vm, vcpus);
+       }
+
        ucall_init(vm, NULL);
 
        /* Export the shared variables to the guest. */
@@ -198,6 +224,17 @@ void perf_test_set_wr_fract(struct kvm_vm *vm, int wr_fract)
        sync_global_to_guest(vm, perf_test_args);
 }
 
+uint64_t __weak perf_test_nested_pages(int nr_vcpus)
+{
+       return 0;
+}
+
+void __weak perf_test_setup_nested(struct kvm_vm *vm, int nr_vcpus)
+{
+       pr_info("%s() not support on this architecture, skipping.\n", __func__);
+       exit(KSFT_SKIP);
+}
+
 static void *vcpu_thread_main(void *data)
 {
        struct vcpu_thread *vcpu = data;
diff --git a/tools/testing/selftests/kvm/lib/x86_64/perf_test_util.c b/tools/testing/selftests/kvm/lib/x86_64/perf_test_util.c
new file mode 100644 (file)
index 0000000..e258524
--- /dev/null
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * x86_64-specific extensions to perf_test_util.c.
+ *
+ * Copyright (C) 2022, Google, Inc.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <linux/bitmap.h>
+#include <linux/bitops.h>
+
+#include "test_util.h"
+#include "kvm_util.h"
+#include "perf_test_util.h"
+#include "../kvm_util_internal.h"
+#include "processor.h"
+#include "vmx.h"
+
+void perf_test_l2_guest_code(uint64_t vcpu_id)
+{
+       perf_test_guest_code(vcpu_id);
+       vmcall();
+}
+
+extern char perf_test_l2_guest_entry[];
+__asm__(
+"perf_test_l2_guest_entry:"
+"      mov (%rsp), %rdi;"
+"      call perf_test_l2_guest_code;"
+"      ud2;"
+);
+
+static void perf_test_l1_guest_code(struct vmx_pages *vmx, uint64_t vcpu_id)
+{
+#define L2_GUEST_STACK_SIZE 64
+       unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE];
+       unsigned long *rsp;
+
+       GUEST_ASSERT(vmx->vmcs_gpa);
+       GUEST_ASSERT(prepare_for_vmx_operation(vmx));
+       GUEST_ASSERT(load_vmcs(vmx));
+       GUEST_ASSERT(ept_1g_pages_supported());
+
+       rsp = &l2_guest_stack[L2_GUEST_STACK_SIZE - 1];
+       *rsp = vcpu_id;
+       prepare_vmcs(vmx, perf_test_l2_guest_entry, rsp);
+
+       GUEST_ASSERT(!vmlaunch());
+       GUEST_ASSERT(vmreadz(VM_EXIT_REASON) == EXIT_REASON_VMCALL);
+       GUEST_DONE();
+}
+
+uint64_t perf_test_nested_pages(int nr_vcpus)
+{
+       /*
+        * 513 page tables is enough to identity-map 256 TiB of L2 with 1G
+        * pages and 4-level paging, plus a few pages per-vCPU for data
+        * structures such as the VMCS.
+        */
+       return 513 + 10 * nr_vcpus;
+}
+
+void perf_test_setup_ept(struct vmx_pages *vmx, struct kvm_vm *vm)
+{
+       uint64_t start, end;
+
+       prepare_eptp(vmx, vm, 0);
+
+       /*
+        * Identity map the first 4G and the test region with 1G pages so that
+        * KVM can shadow the EPT12 with the maximum huge page size supported
+        * by the backing source.
+        */
+       nested_identity_map_1g(vmx, vm, 0, 0x100000000ULL);
+
+       start = align_down(perf_test_args.gpa, PG_SIZE_1G);
+       end = align_up(perf_test_args.gpa + perf_test_args.size, PG_SIZE_1G);
+       nested_identity_map_1g(vmx, vm, start, end - start);
+}
+
+void perf_test_setup_nested(struct kvm_vm *vm, int nr_vcpus)
+{
+       struct vmx_pages *vmx, *vmx0 = NULL;
+       struct kvm_regs regs;
+       vm_vaddr_t vmx_gva;
+       int vcpu_id;
+
+       nested_vmx_check_supported();
+
+       for (vcpu_id = 0; vcpu_id < nr_vcpus; vcpu_id++) {
+               vmx = vcpu_alloc_vmx(vm, &vmx_gva);
+
+               if (vcpu_id == 0) {
+                       perf_test_setup_ept(vmx, vm);
+                       vmx0 = vmx;
+               } else {
+                       /* Share the same EPT table across all vCPUs. */
+                       vmx->eptp = vmx0->eptp;
+                       vmx->eptp_hva = vmx0->eptp_hva;
+                       vmx->eptp_gpa = vmx0->eptp_gpa;
+               }
+
+               /*
+                * Override the vCPU to run perf_test_l1_guest_code() which will
+                * bounce it into L2 before calling perf_test_guest_code().
+                */
+               vcpu_regs_get(vm, vcpu_id, &regs);
+               regs.rip = (unsigned long) perf_test_l1_guest_code;
+               vcpu_regs_set(vm, vcpu_id, &regs);
+               vcpu_args_set(vm, vcpu_id, 2, vmx_gva, vcpu_id);
+       }
+}
index 33ea5e9..ead7011 100644 (file)
@@ -158,7 +158,7 @@ static void *virt_get_pte(struct kvm_vm *vm, uint64_t pt_pfn, uint64_t vaddr,
                          int level)
 {
        uint64_t *page_table = addr_gpa2hva(vm, pt_pfn << vm->page_shift);
-       int index = vaddr >> (vm->page_shift + level * 9) & 0x1ffu;
+       int index = (vaddr >> PG_LEVEL_SHIFT(level)) & 0x1ffu;
 
        return &page_table[index];
 }
@@ -167,14 +167,14 @@ static uint64_t *virt_create_upper_pte(struct kvm_vm *vm,
                                       uint64_t pt_pfn,
                                       uint64_t vaddr,
                                       uint64_t paddr,
-                                      int level,
-                                      enum x86_page_size page_size)
+                                      int current_level,
+                                      int target_level)
 {
-       uint64_t *pte = virt_get_pte(vm, pt_pfn, vaddr, level);
+       uint64_t *pte = virt_get_pte(vm, pt_pfn, vaddr, current_level);
 
        if (!(*pte & PTE_PRESENT_MASK)) {
                *pte = PTE_PRESENT_MASK | PTE_WRITABLE_MASK;
-               if (level == page_size)
+               if (current_level == target_level)
                        *pte |= PTE_LARGE_MASK | (paddr & PHYSICAL_PAGE_MASK);
                else
                        *pte |= vm_alloc_page_table(vm) & PHYSICAL_PAGE_MASK;
@@ -184,20 +184,19 @@ static uint64_t *virt_create_upper_pte(struct kvm_vm *vm,
                 * a hugepage at this level, and that there isn't a hugepage at
                 * this level.
                 */
-               TEST_ASSERT(level != page_size,
+               TEST_ASSERT(current_level != target_level,
                            "Cannot create hugepage at level: %u, vaddr: 0x%lx\n",
-                           page_size, vaddr);
+                           current_level, vaddr);
                TEST_ASSERT(!(*pte & PTE_LARGE_MASK),
                            "Cannot create page table at level: %u, vaddr: 0x%lx\n",
-                           level, vaddr);
+                           current_level, vaddr);
        }
        return pte;
 }
 
-void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
-                  enum x86_page_size page_size)
+void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr, int level)
 {
-       const uint64_t pg_size = 1ull << ((page_size * 9) + 12);
+       const uint64_t pg_size = PG_LEVEL_SIZE(level);
        uint64_t *pml4e, *pdpe, *pde;
        uint64_t *pte;
 
@@ -222,20 +221,20 @@ void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
         * early if a hugepage was created.
         */
        pml4e = virt_create_upper_pte(vm, vm->pgd >> vm->page_shift,
-                                     vaddr, paddr, 3, page_size);
+                                     vaddr, paddr, PG_LEVEL_512G, level);
        if (*pml4e & PTE_LARGE_MASK)
                return;
 
-       pdpe = virt_create_upper_pte(vm, PTE_GET_PFN(*pml4e), vaddr, paddr, 2, page_size);
+       pdpe = virt_create_upper_pte(vm, PTE_GET_PFN(*pml4e), vaddr, paddr, PG_LEVEL_1G, level);
        if (*pdpe & PTE_LARGE_MASK)
                return;
 
-       pde = virt_create_upper_pte(vm, PTE_GET_PFN(*pdpe), vaddr, paddr, 1, page_size);
+       pde = virt_create_upper_pte(vm, PTE_GET_PFN(*pdpe), vaddr, paddr, PG_LEVEL_2M, level);
        if (*pde & PTE_LARGE_MASK)
                return;
 
        /* Fill in page table entry. */
-       pte = virt_get_pte(vm, PTE_GET_PFN(*pde), vaddr, 0);
+       pte = virt_get_pte(vm, PTE_GET_PFN(*pde), vaddr, PG_LEVEL_4K);
        TEST_ASSERT(!(*pte & PTE_PRESENT_MASK),
                    "PTE already present for 4k page at vaddr: 0x%lx\n", vaddr);
        *pte = PTE_PRESENT_MASK | PTE_WRITABLE_MASK | (paddr & PHYSICAL_PAGE_MASK);
@@ -243,7 +242,7 @@ void __virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
 
 void virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr)
 {
-       __virt_pg_map(vm, vaddr, paddr, X86_PAGE_SIZE_4K);
+       __virt_pg_map(vm, vaddr, paddr, PG_LEVEL_4K);
 }
 
 static uint64_t *_vm_get_page_table_entry(struct kvm_vm *vm, int vcpuid,
index d089d8b..b77a01d 100644 (file)
@@ -198,6 +198,16 @@ bool load_vmcs(struct vmx_pages *vmx)
        return true;
 }
 
+static bool ept_vpid_cap_supported(uint64_t mask)
+{
+       return rdmsr(MSR_IA32_VMX_EPT_VPID_CAP) & mask;
+}
+
+bool ept_1g_pages_supported(void)
+{
+       return ept_vpid_cap_supported(VMX_EPT_VPID_CAP_1G_PAGES);
+}
+
 /*
  * Initialize the control fields to the most basic settings possible.
  */
@@ -215,7 +225,7 @@ static inline void init_vmcs_control_fields(struct vmx_pages *vmx)
                struct eptPageTablePointer eptp = {
                        .memory_type = VMX_BASIC_MEM_TYPE_WB,
                        .page_walk_length = 3, /* + 1 */
-                       .ad_enabled = !!(rdmsr(MSR_IA32_VMX_EPT_VPID_CAP) & VMX_EPT_VPID_CAP_AD_BITS),
+                       .ad_enabled = ept_vpid_cap_supported(VMX_EPT_VPID_CAP_AD_BITS),
                        .address = vmx->eptp_gpa >> PAGE_SHIFT_4K,
                };
 
@@ -392,80 +402,93 @@ void nested_vmx_check_supported(void)
        }
 }
 
-void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
-                  uint64_t nested_paddr, uint64_t paddr)
+static void nested_create_pte(struct kvm_vm *vm,
+                             struct eptPageTableEntry *pte,
+                             uint64_t nested_paddr,
+                             uint64_t paddr,
+                             int current_level,
+                             int target_level)
+{
+       if (!pte->readable) {
+               pte->writable = true;
+               pte->readable = true;
+               pte->executable = true;
+               pte->page_size = (current_level == target_level);
+               if (pte->page_size)
+                       pte->address = paddr >> vm->page_shift;
+               else
+                       pte->address = vm_alloc_page_table(vm) >> vm->page_shift;
+       } else {
+               /*
+                * Entry already present.  Assert that the caller doesn't want
+                * a hugepage at this level, and that there isn't a hugepage at
+                * this level.
+                */
+               TEST_ASSERT(current_level != target_level,
+                           "Cannot create hugepage at level: %u, nested_paddr: 0x%lx\n",
+                           current_level, nested_paddr);
+               TEST_ASSERT(!pte->page_size,
+                           "Cannot create page table at level: %u, nested_paddr: 0x%lx\n",
+                           current_level, nested_paddr);
+       }
+}
+
+
+void __nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
+                    uint64_t nested_paddr, uint64_t paddr, int target_level)
 {
-       uint16_t index[4];
-       struct eptPageTableEntry *pml4e;
+       const uint64_t page_size = PG_LEVEL_SIZE(target_level);
+       struct eptPageTableEntry *pt = vmx->eptp_hva, *pte;
+       uint16_t index;
 
        TEST_ASSERT(vm->mode == VM_MODE_PXXV48_4K, "Attempt to use "
                    "unknown or unsupported guest mode, mode: 0x%x", vm->mode);
 
-       TEST_ASSERT((nested_paddr % vm->page_size) == 0,
+       TEST_ASSERT((nested_paddr >> 48) == 0,
+                   "Nested physical address 0x%lx requires 5-level paging",
+                   nested_paddr);
+       TEST_ASSERT((nested_paddr % page_size) == 0,
                    "Nested physical address not on page boundary,\n"
-                   "  nested_paddr: 0x%lx vm->page_size: 0x%x",
-                   nested_paddr, vm->page_size);
+                   "  nested_paddr: 0x%lx page_size: 0x%lx",
+                   nested_paddr, page_size);
        TEST_ASSERT((nested_paddr >> vm->page_shift) <= vm->max_gfn,
                    "Physical address beyond beyond maximum supported,\n"
                    "  nested_paddr: 0x%lx vm->max_gfn: 0x%lx vm->page_size: 0x%x",
                    paddr, vm->max_gfn, vm->page_size);
-       TEST_ASSERT((paddr % vm->page_size) == 0,
+       TEST_ASSERT((paddr % page_size) == 0,
                    "Physical address not on page boundary,\n"
-                   "  paddr: 0x%lx vm->page_size: 0x%x",
-                   paddr, vm->page_size);
+                   "  paddr: 0x%lx page_size: 0x%lx",
+                   paddr, page_size);
        TEST_ASSERT((paddr >> vm->page_shift) <= vm->max_gfn,
                    "Physical address beyond beyond maximum supported,\n"
                    "  paddr: 0x%lx vm->max_gfn: 0x%lx vm->page_size: 0x%x",
                    paddr, vm->max_gfn, vm->page_size);
 
-       index[0] = (nested_paddr >> 12) & 0x1ffu;
-       index[1] = (nested_paddr >> 21) & 0x1ffu;
-       index[2] = (nested_paddr >> 30) & 0x1ffu;
-       index[3] = (nested_paddr >> 39) & 0x1ffu;
-
-       /* Allocate page directory pointer table if not present. */
-       pml4e = vmx->eptp_hva;
-       if (!pml4e[index[3]].readable) {
-               pml4e[index[3]].address = vm_alloc_page_table(vm) >> vm->page_shift;
-               pml4e[index[3]].writable = true;
-               pml4e[index[3]].readable = true;
-               pml4e[index[3]].executable = true;
-       }
+       for (int level = PG_LEVEL_512G; level >= PG_LEVEL_4K; level--) {
+               index = (nested_paddr >> PG_LEVEL_SHIFT(level)) & 0x1ffu;
+               pte = &pt[index];
 
-       /* Allocate page directory table if not present. */
-       struct eptPageTableEntry *pdpe;
-       pdpe = addr_gpa2hva(vm, pml4e[index[3]].address * vm->page_size);
-       if (!pdpe[index[2]].readable) {
-               pdpe[index[2]].address = vm_alloc_page_table(vm) >> vm->page_shift;
-               pdpe[index[2]].writable = true;
-               pdpe[index[2]].readable = true;
-               pdpe[index[2]].executable = true;
-       }
+               nested_create_pte(vm, pte, nested_paddr, paddr, level, target_level);
 
-       /* Allocate page table if not present. */
-       struct eptPageTableEntry *pde;
-       pde = addr_gpa2hva(vm, pdpe[index[2]].address * vm->page_size);
-       if (!pde[index[1]].readable) {
-               pde[index[1]].address = vm_alloc_page_table(vm) >> vm->page_shift;
-               pde[index[1]].writable = true;
-               pde[index[1]].readable = true;
-               pde[index[1]].executable = true;
-       }
+               if (pte->page_size)
+                       break;
 
-       /* Fill in page table entry. */
-       struct eptPageTableEntry *pte;
-       pte = addr_gpa2hva(vm, pde[index[1]].address * vm->page_size);
-       pte[index[0]].address = paddr >> vm->page_shift;
-       pte[index[0]].writable = true;
-       pte[index[0]].readable = true;
-       pte[index[0]].executable = true;
+               pt = addr_gpa2hva(vm, pte->address * vm->page_size);
+       }
 
        /*
         * For now mark these as accessed and dirty because the only
         * testcase we have needs that.  Can be reconsidered later.
         */
-       pte[index[0]].accessed = true;
-       pte[index[0]].dirty = true;
+       pte->accessed = true;
+       pte->dirty = true;
+
+}
+
+void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
+                  uint64_t nested_paddr, uint64_t paddr)
+{
+       __nested_pg_map(vmx, vm, nested_paddr, paddr, PG_LEVEL_4K);
 }
 
 /*
@@ -476,7 +499,7 @@ void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
  *   nested_paddr - Nested guest physical address to map
  *   paddr - VM Physical Address
  *   size - The size of the range to map
- *   eptp_memslot - Memory region slot for new virtual translation tables
+ *   level - The level at which to map the range
  *
  * Output Args: None
  *
@@ -485,22 +508,29 @@ void nested_pg_map(struct vmx_pages *vmx, struct kvm_vm *vm,
  * Within the VM given by vm, creates a nested guest translation for the
  * page range starting at nested_paddr to the page range starting at paddr.
  */
-void nested_map(struct vmx_pages *vmx, struct kvm_vm *vm,
-               uint64_t nested_paddr, uint64_t paddr, uint64_t size)
+void __nested_map(struct vmx_pages *vmx, struct kvm_vm *vm,
+                 uint64_t nested_paddr, uint64_t paddr, uint64_t size,
+                 int level)
 {
-       size_t page_size = vm->page_size;
+       size_t page_size = PG_LEVEL_SIZE(level);
        size_t npages = size / page_size;
 
        TEST_ASSERT(nested_paddr + size > nested_paddr, "Vaddr overflow");
        TEST_ASSERT(paddr + size > paddr, "Paddr overflow");
 
        while (npages--) {
-               nested_pg_map(vmx, vm, nested_paddr, paddr);
+               __nested_pg_map(vmx, vm, nested_paddr, paddr, level);
                nested_paddr += page_size;
                paddr += page_size;
        }
 }
 
+void nested_map(struct vmx_pages *vmx, struct kvm_vm *vm,
+               uint64_t nested_paddr, uint64_t paddr, uint64_t size)
+{
+       __nested_map(vmx, vm, nested_paddr, paddr, size, PG_LEVEL_4K);
+}
+
 /* Prepare an identity extended page table that maps all the
  * physical pages in VM.
  */
@@ -525,6 +555,13 @@ void nested_map_memslot(struct vmx_pages *vmx, struct kvm_vm *vm,
        }
 }
 
+/* Identity map a region with 1GiB Pages. */
+void nested_identity_map_1g(struct vmx_pages *vmx, struct kvm_vm *vm,
+                           uint64_t addr, uint64_t size)
+{
+       __nested_map(vmx, vm, addr, addr, size, PG_LEVEL_1G);
+}
+
 void prepare_eptp(struct vmx_pages *vmx, struct kvm_vm *vm,
                  uint32_t eptp_memslot)
 {
index 3875c4b..15f046e 100644 (file)
@@ -244,7 +244,7 @@ int main(int argc, char *argv[])
 #ifdef __x86_64__
                /* Identity map memory in the guest using 1gb pages. */
                for (i = 0; i < slot_size; i += size_1gb)
-                       __virt_pg_map(vm, gpa + i, gpa + i, X86_PAGE_SIZE_1G);
+                       __virt_pg_map(vm, gpa + i, gpa + i, PG_LEVEL_1G);
 #else
                for (i = 0; i < slot_size; i += vm_get_page_size(vm))
                        virt_pg_map(vm, gpa + i, gpa + i);
index e0b2bb1..3330fb1 100644 (file)
@@ -44,7 +44,7 @@ static inline void nop_loop(void)
 {
        int i;
 
-       for (i = 0; i < 1000000; i++)
+       for (i = 0; i < 100000000; i++)
                asm volatile("nop");
 }
 
@@ -56,12 +56,14 @@ static inline void check_tsc_msr_rdtsc(void)
        tsc_freq = rdmsr(HV_X64_MSR_TSC_FREQUENCY);
        GUEST_ASSERT(tsc_freq > 0);
 
-       /* First, check MSR-based clocksource */
+       /* For increased accuracy, take mean rdtsc() before and afrer rdmsr() */
        r1 = rdtsc();
        t1 = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
+       r1 = (r1 + rdtsc()) / 2;
        nop_loop();
        r2 = rdtsc();
        t2 = rdmsr(HV_X64_MSR_TIME_REF_COUNT);
+       r2 = (r2 + rdtsc()) / 2;
 
        GUEST_ASSERT(r2 > r1 && t2 > t1);
 
@@ -181,12 +183,14 @@ static void host_check_tsc_msr_rdtsc(struct kvm_vm *vm)
        tsc_freq = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TSC_FREQUENCY);
        TEST_ASSERT(tsc_freq > 0, "TSC frequency must be nonzero");
 
-       /* First, check MSR-based clocksource */
+       /* For increased accuracy, take mean rdtsc() before and afrer ioctl */
        r1 = rdtsc();
        t1 = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TIME_REF_COUNT);
+       r1 = (r1 + rdtsc()) / 2;
        nop_loop();
        r2 = rdtsc();
        t2 = vcpu_get_msr(vm, VCPU_ID, HV_X64_MSR_TIME_REF_COUNT);
+       r2 = (r2 + rdtsc()) / 2;
 
        TEST_ASSERT(t2 > t1, "Time reference MSR is not monotonic (%ld <= %ld)", t1, t2);
 
index da2325f..bdecd53 100644 (file)
@@ -35,7 +35,7 @@ static void mmu_role_test(u32 *cpuid_reg, u32 evil_cpuid_val)
        run = vcpu_state(vm, VCPU_ID);
 
        /* Map 1gb page without a backing memlot. */
-       __virt_pg_map(vm, MMIO_GPA, MMIO_GPA, X86_PAGE_SIZE_1G);
+       __virt_pg_map(vm, MMIO_GPA, MMIO_GPA, PG_LEVEL_1G);
 
        r = _vcpu_run(vm, VCPU_ID);
 
index 2a2d240..1a5cc3c 100644 (file)
@@ -7,10 +7,31 @@ else ifneq ($(filter -%,$(LLVM)),)
 LLVM_SUFFIX := $(LLVM)
 endif
 
-CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX)
+CLANG_TARGET_FLAGS_arm          := arm-linux-gnueabi
+CLANG_TARGET_FLAGS_arm64        := aarch64-linux-gnu
+CLANG_TARGET_FLAGS_hexagon      := hexagon-linux-musl
+CLANG_TARGET_FLAGS_m68k         := m68k-linux-gnu
+CLANG_TARGET_FLAGS_mips         := mipsel-linux-gnu
+CLANG_TARGET_FLAGS_powerpc      := powerpc64le-linux-gnu
+CLANG_TARGET_FLAGS_riscv        := riscv64-linux-gnu
+CLANG_TARGET_FLAGS_s390         := s390x-linux-gnu
+CLANG_TARGET_FLAGS_x86          := x86_64-linux-gnu
+CLANG_TARGET_FLAGS              := $(CLANG_TARGET_FLAGS_$(ARCH))
+
+ifeq ($(CROSS_COMPILE),)
+ifeq ($(CLANG_TARGET_FLAGS),)
+$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk
+else
+CLANG_FLAGS     += --target=$(CLANG_TARGET_FLAGS)
+endif # CLANG_TARGET_FLAGS
+else
+CLANG_FLAGS     += --target=$(notdir $(CROSS_COMPILE:%-=%))
+endif # CROSS_COMPILE
+
+CC := $(LLVM_PREFIX)clang$(LLVM_SUFFIX) $(CLANG_FLAGS) -fintegrated-as
 else
 CC := $(CROSS_COMPILE)gcc
-endif
+endif # LLVM
 
 ifeq (0,$(MAKELEVEL))
     ifeq ($(OUTPUT),)
index b984f8c..a29f796 100644 (file)
@@ -37,4 +37,3 @@ gro
 ioam6_parser
 toeplitz
 cmsg_sender
-bind_bhash_test
index 464df13..7ea54af 100644 (file)
@@ -59,7 +59,6 @@ TEST_GEN_FILES += toeplitz
 TEST_GEN_FILES += cmsg_sender
 TEST_GEN_FILES += stress_reuseport_listen
 TEST_PROGS += test_vxlan_vnifiltering.sh
-TEST_GEN_FILES += bind_bhash_test
 
 TEST_FILES := settings
 
@@ -70,5 +69,4 @@ include bpf/Makefile
 
 $(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma
 $(OUTPUT)/tcp_mmap: LDLIBS += -lpthread
-$(OUTPUT)/bind_bhash_test: LDLIBS += -lpthread
 $(OUTPUT)/tcp_inq: LDLIBS += -lpthread
diff --git a/tools/testing/selftests/net/bind_bhash_test.c b/tools/testing/selftests/net/bind_bhash_test.c
deleted file mode 100644 (file)
index 252e737..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * This times how long it takes to bind to a port when the port already
- * has multiple sockets in its bhash table.
- *
- * In the setup(), we populate the port's bhash table with
- * MAX_THREADS * MAX_CONNECTIONS number of entries.
- */
-
-#include <unistd.h>
-#include <stdio.h>
-#include <netdb.h>
-#include <pthread.h>
-
-#define MAX_THREADS 600
-#define MAX_CONNECTIONS 40
-
-static const char *bind_addr = "::1";
-static const char *port;
-
-static int fd_array[MAX_THREADS][MAX_CONNECTIONS];
-
-static int bind_socket(int opt, const char *addr)
-{
-       struct addrinfo *res, hint = {};
-       int sock_fd, reuse = 1, err;
-
-       sock_fd = socket(AF_INET6, SOCK_STREAM, 0);
-       if (sock_fd < 0) {
-               perror("socket fd err");
-               return -1;
-       }
-
-       hint.ai_family = AF_INET6;
-       hint.ai_socktype = SOCK_STREAM;
-
-       err = getaddrinfo(addr, port, &hint, &res);
-       if (err) {
-               perror("getaddrinfo failed");
-               return -1;
-       }
-
-       if (opt) {
-               err = setsockopt(sock_fd, SOL_SOCKET, opt, &reuse, sizeof(reuse));
-               if (err) {
-                       perror("setsockopt failed");
-                       return -1;
-               }
-       }
-
-       err = bind(sock_fd, res->ai_addr, res->ai_addrlen);
-       if (err) {
-               perror("failed to bind to port");
-               return -1;
-       }
-
-       return sock_fd;
-}
-
-static void *setup(void *arg)
-{
-       int sock_fd, i;
-       int *array = (int *)arg;
-
-       for (i = 0; i < MAX_CONNECTIONS; i++) {
-               sock_fd = bind_socket(SO_REUSEADDR | SO_REUSEPORT, bind_addr);
-               if (sock_fd < 0)
-                       return NULL;
-               array[i] = sock_fd;
-       }
-
-       return NULL;
-}
-
-int main(int argc, const char *argv[])
-{
-       int listener_fd, sock_fd, i, j;
-       pthread_t tid[MAX_THREADS];
-       clock_t begin, end;
-
-       if (argc != 2) {
-               printf("Usage: listener <port>\n");
-               return -1;
-       }
-
-       port = argv[1];
-
-       listener_fd = bind_socket(SO_REUSEADDR | SO_REUSEPORT, bind_addr);
-       if (listen(listener_fd, 100) < 0) {
-               perror("listen failed");
-               return -1;
-       }
-
-       /* Set up threads to populate the bhash table entry for the port */
-       for (i = 0; i < MAX_THREADS; i++)
-               pthread_create(&tid[i], NULL, setup, fd_array[i]);
-
-       for (i = 0; i < MAX_THREADS; i++)
-               pthread_join(tid[i], NULL);
-
-       begin = clock();
-
-       /* Bind to the same port on a different address */
-       sock_fd  = bind_socket(0, "2001:0db8:0:f101::1");
-
-       end = clock();
-
-       printf("time spent = %f\n", (double)(end - begin) / CLOCKS_PER_SEC);
-
-       /* clean up */
-       close(sock_fd);
-       close(listener_fd);
-       for (i = 0; i < MAX_THREADS; i++) {
-               for (j = 0; i < MAX_THREADS; i++)
-                       close(fd_array[i][j]);
-       }
-
-       return 0;
-}
index f91bf14..8a69c91 100644 (file)
@@ -2,6 +2,7 @@
 
 CLANG ?= clang
 CCINCLUDE += -I../../bpf
+CCINCLUDE += -I../../../lib
 CCINCLUDE += -I../../../../../usr/include/
 
 TEST_CUSTOM_PROGS = $(OUTPUT)/bpf/nat6to4.o
@@ -10,5 +11,4 @@ all: $(TEST_CUSTOM_PROGS)
 $(OUTPUT)/%.o: %.c
        $(CLANG) -O2 -target bpf -c $< $(CCINCLUDE) -o $@
 
-clean:
-       rm -f $(TEST_CUSTOM_PROGS)
+EXTRA_CLEAN := $(TEST_CUSTOM_PROGS)
index 54701c8..03b5867 100755 (executable)
@@ -70,6 +70,10 @@ NSB_LO_IP6=2001:db8:2::2
 NL_IP=172.17.1.1
 NL_IP6=2001:db8:4::1
 
+# multicast and broadcast addresses
+MCAST_IP=224.0.0.1
+BCAST_IP=255.255.255.255
+
 MD5_PW=abc123
 MD5_WRONG_PW=abc1234
 
@@ -308,6 +312,9 @@ addr2str()
        127.0.0.1) echo "loopback";;
        ::1) echo "IPv6 loopback";;
 
+       ${BCAST_IP}) echo "broadcast";;
+       ${MCAST_IP}) echo "multicast";;
+
        ${NSA_IP})      echo "ns-A IP";;
        ${NSA_IP6})     echo "ns-A IPv6";;
        ${NSA_LO_IP})   echo "ns-A loopback IP";;
@@ -1793,12 +1800,33 @@ ipv4_addr_bind_novrf()
        done
 
        #
-       # raw socket with nonlocal bind
+       # tests for nonlocal bind
        #
        a=${NL_IP}
        log_start
-       run_cmd nettest -s -R -P icmp -f -l ${a} -I ${NSA_DEV} -b
-       log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address after device bind"
+       run_cmd nettest -s -R -f -l ${a} -b
+       log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address"
+
+       log_start
+       run_cmd nettest -s -f -l ${a} -b
+       log_test_addr ${a} $? 0 "TCP socket bind to nonlocal address"
+
+       log_start
+       run_cmd nettest -s -D -P icmp -f -l ${a} -b
+       log_test_addr ${a} $? 0 "ICMP socket bind to nonlocal address"
+
+       #
+       # check that ICMP sockets cannot bind to broadcast and multicast addresses
+       #
+       a=${BCAST_IP}
+       log_start
+       run_cmd nettest -s -D -P icmp -l ${a} -b
+       log_test_addr ${a} $? 1 "ICMP socket bind to broadcast address"
+
+       a=${MCAST_IP}
+       log_start
+       run_cmd nettest -s -D -P icmp -l ${a} -b
+       log_test_addr ${a} $? 1 "ICMP socket bind to multicast address"
 
        #
        # tcp sockets
@@ -1850,13 +1878,34 @@ ipv4_addr_bind_vrf()
        log_test_addr ${a} $? 1 "Raw socket bind to out of scope address after VRF bind"
 
        #
-       # raw socket with nonlocal bind
+       # tests for nonlocal bind
        #
        a=${NL_IP}
        log_start
-       run_cmd nettest -s -R -P icmp -f -l ${a} -I ${VRF} -b
+       run_cmd nettest -s -R -f -l ${a} -I ${VRF} -b
        log_test_addr ${a} $? 0 "Raw socket bind to nonlocal address after VRF bind"
 
+       log_start
+       run_cmd nettest -s -f -l ${a} -I ${VRF} -b
+       log_test_addr ${a} $? 0 "TCP socket bind to nonlocal address after VRF bind"
+
+       log_start
+       run_cmd nettest -s -D -P icmp -f -l ${a} -I ${VRF} -b
+       log_test_addr ${a} $? 0 "ICMP socket bind to nonlocal address after VRF bind"
+
+       #
+       # check that ICMP sockets cannot bind to broadcast and multicast addresses
+       #
+       a=${BCAST_IP}
+       log_start
+       run_cmd nettest -s -D -P icmp -l ${a} -I ${VRF} -b
+       log_test_addr ${a} $? 1 "ICMP socket bind to broadcast address after VRF bind"
+
+       a=${MCAST_IP}
+       log_start
+       run_cmd nettest -s -D -P icmp -l ${a} -I ${VRF} -b
+       log_test_addr ${a} $? 1 "ICMP socket bind to multicast address after VRF bind"
+
        #
        # tcp sockets
        #
@@ -1889,10 +1938,12 @@ ipv4_addr_bind()
 
        log_subsection "No VRF"
        setup
+       set_sysctl net.ipv4.ping_group_range='0 2147483647' 2>/dev/null
        ipv4_addr_bind_novrf
 
        log_subsection "With VRF"
        setup "yes"
+       set_sysctl net.ipv4.ping_group_range='0 2147483647' 2>/dev/null
        ipv4_addr_bind_vrf
 }
 
index b35010c..a699187 100755 (executable)
@@ -31,7 +31,7 @@ BUGS="flush_remove_add reload"
 
 # List of possible paths to pktgen script from kernel tree for performance tests
 PKTGEN_SCRIPT_PATHS="
-       ../../../samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh
+       ../../../../samples/pktgen/pktgen_bench_xmit_mode_netif_receive.sh
        pktgen/pktgen_bench_xmit_mode_netif_receive.sh"
 
 # Definition of set types:
index eb8543b..924ecb3 100755 (executable)
@@ -374,6 +374,45 @@ EOF
        return $lret
 }
 
+test_local_dnat_portonly()
+{
+       local family=$1
+       local daddr=$2
+       local lret=0
+       local sr_s
+       local sr_r
+
+ip netns exec "$ns0" nft -f /dev/stdin <<EOF
+table $family nat {
+       chain output {
+               type nat hook output priority 0; policy accept;
+               meta l4proto tcp dnat to :2000
+
+       }
+}
+EOF
+       if [ $? -ne 0 ]; then
+               if [ $family = "inet" ];then
+                       echo "SKIP: inet port test"
+                       test_inet_nat=false
+                       return
+               fi
+               echo "SKIP: Could not add $family dnat hook"
+               return
+       fi
+
+       echo SERVER-$family | ip netns exec "$ns1" timeout 5 socat -u STDIN TCP-LISTEN:2000 &
+       sc_s=$!
+
+       result=$(ip netns exec "$ns0" timeout 1 socat TCP:$daddr:2000 STDOUT)
+
+       if [ "$result" = "SERVER-inet" ];then
+               echo "PASS: inet port rewrite without l3 address"
+       else
+               echo "ERROR: inet port rewrite"
+               ret=1
+       fi
+}
 
 test_masquerade6()
 {
@@ -1148,6 +1187,10 @@ fi
 reset_counters
 test_local_dnat ip
 test_local_dnat6 ip6
+
+reset_counters
+test_local_dnat_portonly inet 10.0.1.99
+
 reset_counters
 $test_inet_nat && test_local_dnat inet
 $test_inet_nat && test_local_dnat6 inet
index 6bb36ca..a309876 100644 (file)
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
        if (write)
                gup.gup_flags |= FOLL_WRITE;
 
-       gup_fd = open("/sys/kernel/debug/gup_test", O_RDWR);
+       gup_fd = open(GUP_TEST_FILE, O_RDWR);
        if (gup_fd == -1) {
                switch (errno) {
                case EACCES:
@@ -224,7 +224,7 @@ int main(int argc, char **argv)
                        printf("check if CONFIG_GUP_TEST is enabled in kernel config\n");
                        break;
                default:
-                       perror("failed to open /sys/kernel/debug/gup_test");
+                       perror("failed to open " GUP_TEST_FILE);
                        break;
                }
                exit(KSFT_SKIP);
index 2fcf243..f5e4e0b 100644 (file)
@@ -54,6 +54,7 @@ static int ksm_write_sysfs(const char *file_path, unsigned long val)
        }
        if (fprintf(f, "%lu", val) < 0) {
                perror("fprintf");
+               fclose(f);
                return 1;
        }
        fclose(f);
@@ -72,6 +73,7 @@ static int ksm_read_sysfs(const char *file_path, unsigned long *val)
        }
        if (fscanf(f, "%lu", val) != 1) {
                perror("fscanf");
+               fclose(f);
                return 1;
        }
        fclose(f);
index bca07b9..7d1b809 100644 (file)
@@ -64,8 +64,8 @@ QEMU_VPORT_RESULT := virtio-serial-device
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
 else
-QEMU_MACHINE := -cpu cortex-a53 -machine virt
-CFLAGS += -march=armv8-a -mtune=cortex-a53
+QEMU_MACHINE := -cpu max -machine virt
+CFLAGS += -march=armv8-a
 endif
 else ifeq ($(ARCH),aarch64_be)
 CHOST := aarch64_be-linux-musl
@@ -76,8 +76,8 @@ QEMU_VPORT_RESULT := virtio-serial-device
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
 else
-QEMU_MACHINE := -cpu cortex-a53 -machine virt
-CFLAGS += -march=armv8-a -mtune=cortex-a53
+QEMU_MACHINE := -cpu max -machine virt
+CFLAGS += -march=armv8-a
 endif
 else ifeq ($(ARCH),arm)
 CHOST := arm-linux-musleabi
@@ -88,8 +88,8 @@ QEMU_VPORT_RESULT := virtio-serial-device
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
 else
-QEMU_MACHINE := -cpu cortex-a15 -machine virt
-CFLAGS += -march=armv7-a -mtune=cortex-a15 -mabi=aapcs-linux
+QEMU_MACHINE := -cpu max -machine virt
+CFLAGS += -march=armv7-a -mabi=aapcs-linux
 endif
 else ifeq ($(ARCH),armeb)
 CHOST := armeb-linux-musleabi
@@ -100,8 +100,8 @@ QEMU_VPORT_RESULT := virtio-serial-device
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host -machine virt,gic_version=host,accel=kvm
 else
-QEMU_MACHINE := -cpu cortex-a15 -machine virt
-CFLAGS += -march=armv7-a -mabi=aapcs-linux # We don't pass -mtune=cortex-a15 due to a compiler bug on big endian.
+QEMU_MACHINE := -cpu max -machine virt
+CFLAGS += -march=armv7-a -mabi=aapcs-linux
 LDFLAGS += -Wl,--be8
 endif
 else ifeq ($(ARCH),x86_64)
@@ -112,8 +112,7 @@ KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/arch/x86/boot/bzImage
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host -machine q35,accel=kvm
 else
-QEMU_MACHINE := -cpu Skylake-Server -machine q35
-CFLAGS += -march=skylake-avx512
+QEMU_MACHINE := -cpu max -machine q35
 endif
 else ifeq ($(ARCH),i686)
 CHOST := i686-linux-musl
@@ -123,8 +122,7 @@ KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/arch/x86/boot/bzImage
 ifeq ($(subst x86_64,i686,$(HOST_ARCH)),$(ARCH))
 QEMU_MACHINE := -cpu host -machine q35,accel=kvm
 else
-QEMU_MACHINE := -cpu coreduo -machine q35
-CFLAGS += -march=prescott
+QEMU_MACHINE := -cpu max -machine q35
 endif
 else ifeq ($(ARCH),mips64)
 CHOST := mips64-linux-musl
@@ -182,7 +180,7 @@ KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/vmlinux
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host,accel=kvm -machine pseries
 else
-QEMU_MACHINE := -machine pseries
+QEMU_MACHINE := -machine pseries -device spapr-rng,rng=rng -object rng-random,id=rng
 endif
 else ifeq ($(ARCH),powerpc64le)
 CHOST := powerpc64le-linux-musl
@@ -192,7 +190,7 @@ KERNEL_BZIMAGE := $(KERNEL_BUILD_PATH)/vmlinux
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host,accel=kvm -machine pseries
 else
-QEMU_MACHINE := -machine pseries
+QEMU_MACHINE := -machine pseries -device spapr-rng,rng=rng -object rng-random,id=rng
 endif
 else ifeq ($(ARCH),powerpc)
 CHOST := powerpc-linux-musl
@@ -247,7 +245,7 @@ QEMU_VPORT_RESULT := virtio-serial-ccw
 ifeq ($(HOST_ARCH),$(ARCH))
 QEMU_MACHINE := -cpu host,accel=kvm -machine s390-ccw-virtio -append $(KERNEL_CMDLINE)
 else
-QEMU_MACHINE := -machine s390-ccw-virtio -append $(KERNEL_CMDLINE)
+QEMU_MACHINE := -cpu max -machine s390-ccw-virtio -append $(KERNEL_CMDLINE)
 endif
 else
 $(error I only build: x86_64, i686, arm, armeb, aarch64, aarch64_be, mips, mipsel, mips64, mips64el, powerpc64, powerpc64le, powerpc, m68k, riscv64, riscv32, s390x)
index 2a0f48f..c9e1284 100644 (file)
@@ -21,6 +21,7 @@
 #include <sys/utsname.h>
 #include <sys/sendfile.h>
 #include <sys/sysmacros.h>
+#include <sys/random.h>
 #include <linux/random.h>
 #include <linux/version.h>
 
@@ -58,6 +59,8 @@ static void seed_rng(void)
 {
        int bits = 256, fd;
 
+       if (!getrandom(NULL, 0, GRND_NONBLOCK))
+               return;
        pretty_message("[+] Fake seeding RNG...");
        fd = open("/dev/random", O_WRONLY);
        if (fd < 0)
index a9b5a52..bad88f4 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_TTY=y
 CONFIG_BINFMT_ELF=y
 CONFIG_BINFMT_SCRIPT=y
 CONFIG_VDSO=y
+CONFIG_STRICT_KERNEL_RWX=y
 CONFIG_VIRTUALIZATION=y
 CONFIG_HYPERVISOR_GUEST=y
 CONFIG_PARAVIRT=y
@@ -65,6 +66,8 @@ CONFIG_PROC_FS=y
 CONFIG_PROC_SYSCTL=y
 CONFIG_SYSFS=y
 CONFIG_TMPFS=y
+CONFIG_RANDOM_TRUST_CPU=y
+CONFIG_RANDOM_TRUST_BOOTLOADER=y
 CONFIG_CONSOLE_LOGLEVEL_DEFAULT=15
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_PRINTK_TIME=y
index 64ec222..a49df89 100644 (file)
@@ -3328,9 +3328,11 @@ bool kvm_vcpu_block(struct kvm_vcpu *vcpu)
 
        vcpu->stat.generic.blocking = 1;
 
+       preempt_disable();
        kvm_arch_vcpu_blocking(vcpu);
-
        prepare_to_rcuwait(wait);
+       preempt_enable();
+
        for (;;) {
                set_current_state(TASK_INTERRUPTIBLE);
 
@@ -3340,9 +3342,11 @@ bool kvm_vcpu_block(struct kvm_vcpu *vcpu)
                waited = true;
                schedule();
        }
-       finish_rcuwait(wait);
 
+       preempt_disable();
+       finish_rcuwait(wait);
        kvm_arch_vcpu_unblocking(vcpu);
+       preempt_enable();
 
        vcpu->stat.generic.blocking = 0;
 
@@ -4300,8 +4304,11 @@ static int kvm_ioctl_create_device(struct kvm *kvm,
                kvm_put_kvm_no_destroy(kvm);
                mutex_lock(&kvm->lock);
                list_del(&dev->vm_node);
+               if (ops->release)
+                       ops->release(dev);
                mutex_unlock(&kvm->lock);
-               ops->destroy(dev);
+               if (ops->destroy)
+                       ops->destroy(dev);
                return ret;
        }