Merge branch 'acpi-properties'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 11 Aug 2022 17:21:03 +0000 (19:21 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 11 Aug 2022 17:21:03 +0000 (19:21 +0200)
Merge changes adding support for device properties with buffer values
to the ACPI device properties handling code.

* acpi-properties:
  ACPI: property: Fix error handling in acpi_init_properties()
  ACPI: property: Read buffer properties as integers
  ACPI: property: Add support for parsing buffer property UUID
  ACPI: property: Unify integer value reading functions
  ACPI: property: Switch node property referencing from ifs to a switch
  ACPI: property: Move property ref argument parsing into a new function
  ACPI: property: Use acpi_object_type consistently in property ref parsing
  ACPI: property: Tie data nodes to acpi handles
  ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool

1994 files changed:
.mailmap
Documentation/ABI/testing/sysfs-class-hwmon
Documentation/ABI/testing/sysfs-devices-system-cpu
Documentation/admin-guide/kernel-parameters.txt
Documentation/admin-guide/perf/hns3-pmu.rst [new file with mode: 0644]
Documentation/admin-guide/perf/index.rst
Documentation/admin-guide/pm/cpuidle.rst
Documentation/arm/google/chromebook-boot-flow.rst [new file with mode: 0644]
Documentation/arm/index.rst
Documentation/arm64/elf_hwcaps.rst
Documentation/arm64/memory.rst
Documentation/arm64/silicon-errata.rst
Documentation/core-api/protection-keys.rst
Documentation/devicetree/bindings/arm/altera.yaml
Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/arm/atmel-at91.yaml
Documentation/devicetree/bindings/arm/bcm/brcm,bcm4708.yaml
Documentation/devicetree/bindings/arm/bcm/brcm,bcmbca.yaml
Documentation/devicetree/bindings/arm/cpus.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/npcm/npcm.yaml
Documentation/devicetree/bindings/arm/npcm/nuvoton,gcr.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/sunplus,sp7021.yaml [new file with mode: 0644]
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/nuvoton,npcm845-clk.yaml [new file with mode: 0644]
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/clock/sunplus,sp7021-clkc.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/cpufreq/qcom-cpufreq-nvmem.yaml
Documentation/devicetree/bindings/display/mediatek/mediatek,mutex.yaml [deleted file]
Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.yaml
Documentation/devicetree/bindings/display/panel/samsung,ld9040.yaml
Documentation/devicetree/bindings/display/panel/sitronix,st7789v.yaml
Documentation/devicetree/bindings/display/panel/tpo,td.yaml
Documentation/devicetree/bindings/firmware/arm,scmi.yaml
Documentation/devicetree/bindings/firmware/fsl,scu.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/firmware/qcom,scm.txt
Documentation/devicetree/bindings/gpio/gpio-zynq.yaml
Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/hwmon/national,lm90.yaml
Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
Documentation/devicetree/bindings/input/fsl,scu-key.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-irqc.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/interrupt-controller/sifive,plic-1.0.0.yaml
Documentation/devicetree/bindings/interrupt-controller/sunplus,sp7021-intc.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/memory-controllers/mediatek,smi-common.yaml
Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.yaml
Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
Documentation/devicetree/bindings/net/ethernet-controller.yaml
Documentation/devicetree/bindings/net/fsl,fec.yaml
Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/nvmem/fsl,scu-ocotp.yaml [new file with mode: 0644]
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/renesas,rzg2l-pinctrl.yaml
Documentation/devicetree/bindings/power/fsl,scu-pd.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/power/mediatek,power-controller.yaml
Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
Documentation/devicetree/bindings/pwm/clk-pwm.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/pwm/pwm-mediatek.txt
Documentation/devicetree/bindings/regulator/mps,mp5416.yaml
Documentation/devicetree/bindings/regulator/pwm-regulator.txt [deleted file]
Documentation/devicetree/bindings/regulator/pwm-regulator.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml
Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt [deleted file]
Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/regulator/regulator.yaml
Documentation/devicetree/bindings/reset/nuvoton,npcm750-reset.yaml
Documentation/devicetree/bindings/reset/sunplus,reset.yaml [new file with mode: 0644]
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/mediatek/devapc.yaml
Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/soc/mediatek/mtk-svs.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/soc/microchip/atmel,at91rm9200-tcb.yaml
Documentation/devicetree/bindings/soc/microchip/microchip,mpfs-sys-controller.yaml
Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml
Documentation/devicetree/bindings/soc/qcom/qcom,rpmh-rsc.yaml
Documentation/devicetree/bindings/soc/qcom/qcom,smd-rpm.yaml
Documentation/devicetree/bindings/soc/qcom/qcom,spm.yaml
Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.yaml
Documentation/devicetree/bindings/soc/samsung/exynos-pmu.yaml
Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml
Documentation/devicetree/bindings/sound/renesas,rz-ssi.yaml
Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/spi/mediatek,spi-mt65xx.yaml
Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml
Documentation/devicetree/bindings/spi/nuvoton,npcm-fiu.txt
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad-peripheral-props.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml
Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
Documentation/devicetree/bindings/spi/samsung,spi.yaml
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
Documentation/devicetree/bindings/spi/spi-cadence.yaml
Documentation/devicetree/bindings/spi/spi-controller.yaml
Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
Documentation/devicetree/bindings/spi/spi-zynqmp-qspi.yaml
Documentation/devicetree/bindings/spi/spi_atmel.txt [deleted file]
Documentation/devicetree/bindings/thermal/fsl,scu-thermal.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/timer/allwinner,sun4i-a10-timer.yaml
Documentation/devicetree/bindings/timer/ingenic,tcu.yaml
Documentation/devicetree/bindings/timer/mediatek,mtk-timer.txt
Documentation/devicetree/bindings/timer/nuvoton,npcm7xx-timer.yaml
Documentation/devicetree/bindings/timer/nvidia,tegra186-timer.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/timer/renesas,cmt.yaml
Documentation/devicetree/bindings/timer/st,nomadik-mtu.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/trivial-devices.yaml
Documentation/devicetree/bindings/usb/allwinner,sun4i-a10-musb.yaml
Documentation/devicetree/bindings/usb/atmel-usb.txt
Documentation/devicetree/bindings/usb/generic-ehci.yaml
Documentation/devicetree/bindings/usb/generic-ohci.yaml
Documentation/devicetree/bindings/vendor-prefixes.yaml
Documentation/devicetree/bindings/watchdog/fsl,scu-wdt.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
Documentation/features/vm/ioremap_prot/arch-support.txt
Documentation/filesystems/overlayfs.rst
Documentation/firmware-guide/acpi/DSD-properties-rules.rst
Documentation/firmware-guide/acpi/apei/einj.rst
Documentation/hwmon/aquacomputer_d5next.rst
Documentation/hwmon/asus_ec_sensors.rst
Documentation/hwmon/dell-smm-hwmon.rst
Documentation/hwmon/index.rst
Documentation/hwmon/lm90.rst
Documentation/hwmon/lt7182s.rst [new file with mode: 0644]
Documentation/hwmon/pmbus-core.rst
Documentation/memory-barriers.txt
Documentation/networking/ip-sysctl.rst
Documentation/staging/static-keys.rst
Documentation/virt/kvm/arm/hyp-abi.rst
MAINTAINERS
Makefile
arch/Kconfig
arch/alpha/kernel/irq.c
arch/arc/kernel/jump_label.c
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/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-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-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_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.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-pcb8309.dts [new file with mode: 0644]
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/qcom-apq8060-dragonboard.dts
arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dts
arch/arm/boot/dts/qcom-apq8064-cm-qs600.dts
arch/arm/boot/dts/qcom-apq8064-ifc6410.dts
arch/arm/boot/dts/qcom-apq8064-sony-xperia-lagan-yuga.dts
arch/arm/boot/dts/qcom-apq8064.dtsi
arch/arm/boot/dts/qcom-apq8084.dtsi
arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dts
arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dts
arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dtsi
arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi
arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dts
arch/arm/boot/dts/qcom-ipq4019.dtsi
arch/arm/boot/dts/qcom-ipq8064-ap148.dts
arch/arm/boot/dts/qcom-ipq8064-rb3011.dts
arch/arm/boot/dts/qcom-ipq8064-smb208.dtsi [new file with mode: 0644]
arch/arm/boot/dts/qcom-ipq8064-v1.0.dtsi
arch/arm/boot/dts/qcom-ipq8064.dtsi
arch/arm/boot/dts/qcom-mdm9615-wp8548.dtsi
arch/arm/boot/dts/qcom-mdm9615.dtsi
arch/arm/boot/dts/qcom-msm8226.dtsi
arch/arm/boot/dts/qcom-msm8660.dtsi
arch/arm/boot/dts/qcom-msm8960.dtsi
arch/arm/boot/dts/qcom-msm8974-lge-nexus5-hammerhead.dts
arch/arm/boot/dts/qcom-msm8974-sony-xperia-rhine.dtsi
arch/arm/boot/dts/qcom-msm8974.dtsi
arch/arm/boot/dts/qcom-msm8974pro-fairphone-fp2.dts
arch/arm/boot/dts/qcom-msm8974pro-samsung-klte.dts
arch/arm/boot/dts/qcom-msm8974pro-sony-xperia-shinano-castor.dts
arch/arm/boot/dts/qcom-pm8841.dtsi
arch/arm/boot/dts/qcom-pm8941.dtsi
arch/arm/boot/dts/qcom-pmx55.dtsi
arch/arm/boot/dts/qcom-pmx65.dtsi
arch/arm/boot/dts/qcom-sdx55.dtsi
arch/arm/boot/dts/qcom-sdx65-mtp.dts
arch/arm/boot/dts/qcom-sdx65.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/stm32mp151.dtsi
arch/arm/boot/dts/stm32mp153c-dhcor-drc-compact.dts [new file with mode: 0644]
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/sunplus-sp7021-achip.dtsi [new file with mode: 0644]
arch/arm/boot/dts/sunplus-sp7021-demo-v3.dts [new file with mode: 0644]
arch/arm/boot/dts/sunplus-sp7021.dtsi [new file with mode: 0644]
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/configs/am200epdkit_defconfig
arch/arm/configs/aspeed_g4_defconfig
arch/arm/configs/aspeed_g5_defconfig
arch/arm/configs/assabet_defconfig
arch/arm/configs/at91_dt_defconfig
arch/arm/configs/axm55xx_defconfig
arch/arm/configs/badge4_defconfig
arch/arm/configs/bcm2835_defconfig
arch/arm/configs/cerfcube_defconfig
arch/arm/configs/clps711x_defconfig
arch/arm/configs/cm_x300_defconfig
arch/arm/configs/cns3420vb_defconfig
arch/arm/configs/colibri_pxa270_defconfig
arch/arm/configs/colibri_pxa300_defconfig
arch/arm/configs/collie_defconfig
arch/arm/configs/corgi_defconfig
arch/arm/configs/davinci_all_defconfig
arch/arm/configs/dove_defconfig
arch/arm/configs/ep93xx_defconfig
arch/arm/configs/eseries_pxa_defconfig
arch/arm/configs/exynos_defconfig
arch/arm/configs/ezx_defconfig
arch/arm/configs/footbridge_defconfig
arch/arm/configs/h3600_defconfig
arch/arm/configs/h5000_defconfig
arch/arm/configs/hackkit_defconfig
arch/arm/configs/hisi_defconfig
arch/arm/configs/imx_v4_v5_defconfig
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/configs/integrator_defconfig
arch/arm/configs/iop32x_defconfig
arch/arm/configs/ixp4xx_defconfig
arch/arm/configs/jornada720_defconfig
arch/arm/configs/keystone_defconfig
arch/arm/configs/lart_defconfig
arch/arm/configs/lpc18xx_defconfig
arch/arm/configs/lpc32xx_defconfig
arch/arm/configs/lpd270_defconfig
arch/arm/configs/lubbock_defconfig
arch/arm/configs/magician_defconfig
arch/arm/configs/mainstone_defconfig
arch/arm/configs/milbeaut_m10v_defconfig
arch/arm/configs/mini2440_defconfig
arch/arm/configs/mmp2_defconfig
arch/arm/configs/moxart_defconfig
arch/arm/configs/mps2_defconfig
arch/arm/configs/multi_v4t_defconfig
arch/arm/configs/multi_v5_defconfig
arch/arm/configs/multi_v7_defconfig
arch/arm/configs/mv78xx0_defconfig
arch/arm/configs/mvebu_v5_defconfig
arch/arm/configs/mvebu_v7_defconfig
arch/arm/configs/mxs_defconfig
arch/arm/configs/neponset_defconfig
arch/arm/configs/netwinder_defconfig
arch/arm/configs/nhk8815_defconfig
arch/arm/configs/omap1_defconfig
arch/arm/configs/omap2plus_defconfig
arch/arm/configs/orion5x_defconfig
arch/arm/configs/oxnas_v6_defconfig
arch/arm/configs/palmz72_defconfig
arch/arm/configs/pcm027_defconfig
arch/arm/configs/pleb_defconfig
arch/arm/configs/pxa168_defconfig
arch/arm/configs/pxa255-idp_defconfig
arch/arm/configs/pxa3xx_defconfig
arch/arm/configs/pxa910_defconfig
arch/arm/configs/pxa_defconfig
arch/arm/configs/qcom_defconfig
arch/arm/configs/realview_defconfig
arch/arm/configs/rpc_defconfig
arch/arm/configs/s3c2410_defconfig
arch/arm/configs/s3c6400_defconfig
arch/arm/configs/s5pv210_defconfig
arch/arm/configs/sama5_defconfig
arch/arm/configs/sama7_defconfig
arch/arm/configs/shannon_defconfig
arch/arm/configs/shmobile_defconfig
arch/arm/configs/simpad_defconfig
arch/arm/configs/socfpga_defconfig
arch/arm/configs/sp7021_defconfig [new file with mode: 0644]
arch/arm/configs/spear13xx_defconfig
arch/arm/configs/spear3xx_defconfig
arch/arm/configs/spear6xx_defconfig
arch/arm/configs/spitz_defconfig
arch/arm/configs/stm32_defconfig
arch/arm/configs/sunxi_defconfig
arch/arm/configs/tct_hammer_defconfig
arch/arm/configs/tegra_defconfig
arch/arm/configs/trizeps4_defconfig
arch/arm/configs/u8500_defconfig
arch/arm/configs/versatile_defconfig
arch/arm/configs/vexpress_defconfig
arch/arm/configs/vf610m4_defconfig
arch/arm/configs/viper_defconfig
arch/arm/configs/vt8500_v6_v7_defconfig
arch/arm/configs/xcep_defconfig
arch/arm/configs/zeus_defconfig
arch/arm/include/asm/dma.h
arch/arm/include/asm/io.h
arch/arm/kernel/jump_label.c
arch/arm/lib/findbit.S
arch/arm/mach-at91/sam_secure.c
arch/arm/mach-at91/sam_secure.h
arch/arm/mach-at91/sama5.c
arch/arm/mach-bcm/Kconfig
arch/arm/mach-bcm/Makefile
arch/arm/mach-bcm/bcm63xx.c [deleted file]
arch/arm/mach-bcm/bcm_kona_smc.c
arch/arm/mach-cns3xxx/Kconfig
arch/arm/mach-davinci/Kconfig
arch/arm/mach-davinci/Makefile
arch/arm/mach-davinci/board-dm644x-evm.c [deleted file]
arch/arm/mach-davinci/board-dm646x-evm.c [deleted file]
arch/arm/mach-davinci/board-neuros-osd2.c [deleted file]
arch/arm/mach-davinci/board-sffsdr.c [deleted file]
arch/arm/mach-davinci/dm644x.c [deleted file]
arch/arm/mach-davinci/dm646x.c [deleted file]
arch/arm/mach-dove/Kconfig
arch/arm/mach-dove/pcie.c
arch/arm/mach-ep93xx/Kconfig
arch/arm/mach-footbridge/Kconfig
arch/arm/mach-hisi/Kconfig
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/cpu-imx25.c
arch/arm/mach-iop32x/Kconfig
arch/arm/mach-mmp/Kconfig
arch/arm/mach-mmp/mmp2.h
arch/arm/mach-mmp/pxa168.h
arch/arm/mach-mmp/pxa910.h
arch/arm/mach-mv78xx0/Kconfig
arch/arm/mach-mv78xx0/pcie.c
arch/arm/mach-omap1/Kconfig
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/display.c
arch/arm/mach-omap2/pdata-quirks.c
arch/arm/mach-omap2/prm3xxx.c
arch/arm/mach-orion5x/Kconfig
arch/arm/mach-orion5x/pci.c
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/icontrol.c
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-qcom/Kconfig
arch/arm/mach-qcom/platsmp.c
arch/arm/mach-s3c/Kconfig
arch/arm/mach-s3c/Kconfig.s3c24xx
arch/arm/mach-s3c/Kconfig.s3c64xx
arch/arm/mach-s3c/mach-mini2440.c
arch/arm/mach-sa1100/Kconfig
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
arch/arm/mach-sunplus/Kconfig [new file with mode: 0644]
arch/arm/mach-sunplus/Makefile [new file with mode: 0644]
arch/arm/mach-sunplus/sp7021.c [new file with mode: 0644]
arch/arm/mach-zynq/common.c
arch/arm/mm/ioremap.c
arch/arm/mm/nommu.c
arch/arm64/Kconfig
arch/arm64/Kconfig.platforms
arch/arm64/boot/Makefile
arch/arm64/boot/dts/Makefile
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/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/nuvoton/Makefile [new file with mode: 0644]
arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts [new file with mode: 0644]
arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi [new file with mode: 0644]
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-hk01.dts
arch/arm64/boot/dts/qcom/ipq8074-hk10.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-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-poplar.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-xiaomi-polaris.dts [new file with mode: 0644]
arch/arm64/boot/dts/qcom/sdm845.dtsi
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dts
arch/arm64/boot/dts/qcom/sdm850.dtsi
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/configs/defconfig
arch/arm64/include/asm/asm-extable.h
arch/arm64/include/asm/asm-uaccess.h
arch/arm64/include/asm/asm_pointer_auth.h
arch/arm64/include/asm/assembler.h
arch/arm64/include/asm/barrier.h
arch/arm64/include/asm/cache.h
arch/arm64/include/asm/cacheflush.h
arch/arm64/include/asm/cpu.h
arch/arm64/include/asm/cpu_ops.h
arch/arm64/include/asm/cpufeature.h
arch/arm64/include/asm/cpuidle.h
arch/arm64/include/asm/el2_setup.h
arch/arm64/include/asm/fixmap.h
arch/arm64/include/asm/hwcap.h
arch/arm64/include/asm/io.h
arch/arm64/include/asm/kernel-pgtable.h
arch/arm64/include/asm/memory.h
arch/arm64/include/asm/mmu_context.h
arch/arm64/include/asm/pgtable-hwdef.h
arch/arm64/include/asm/pgtable.h
arch/arm64/include/asm/processor.h
arch/arm64/include/asm/sysreg.h
arch/arm64/include/asm/uaccess.h
arch/arm64/include/asm/virt.h
arch/arm64/include/uapi/asm/hwcap.h
arch/arm64/kernel/Makefile
arch/arm64/kernel/acpi.c
arch/arm64/kernel/acpi_numa.c
arch/arm64/kernel/alternative.c
arch/arm64/kernel/armv8_deprecated.c
arch/arm64/kernel/cpu_errata.c
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuidle.c
arch/arm64/kernel/cpuinfo.c
arch/arm64/kernel/entry.S
arch/arm64/kernel/fpsimd.c
arch/arm64/kernel/head.S
arch/arm64/kernel/hibernate.c
arch/arm64/kernel/hyp-stub.S
arch/arm64/kernel/idreg-override.c
arch/arm64/kernel/image-vars.h
arch/arm64/kernel/jump_label.c
arch/arm64/kernel/kaslr.c
arch/arm64/kernel/kuser32.S
arch/arm64/kernel/mte.c
arch/arm64/kernel/pi/Makefile [new file with mode: 0644]
arch/arm64/kernel/pi/kaslr_early.c [new file with mode: 0644]
arch/arm64/kernel/signal.c
arch/arm64/kernel/sigreturn32.S
arch/arm64/kernel/sleep.S
arch/arm64/kernel/stacktrace.c
arch/arm64/kernel/suspend.c
arch/arm64/kernel/traps.c
arch/arm64/kernel/vdso/Makefile
arch/arm64/kernel/vdso/vdso.lds.S
arch/arm64/kernel/vdso32/Makefile
arch/arm64/kernel/vdso32/vdso.lds.S
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h
arch/arm64/kvm/hyp/nvhe/sys_regs.c
arch/arm64/kvm/sys_regs.c
arch/arm64/lib/mte.S
arch/arm64/mm/cache.S
arch/arm64/mm/copypage.c
arch/arm64/mm/dma-mapping.c
arch/arm64/mm/extable.c
arch/arm64/mm/fault.c
arch/arm64/mm/hugetlbpage.c
arch/arm64/mm/init.c
arch/arm64/mm/ioremap.c
arch/arm64/mm/kasan_init.c
arch/arm64/mm/mmu.c
arch/arm64/mm/mteswap.c
arch/arm64/mm/proc.S
arch/arm64/tools/cpucaps
arch/arm64/tools/gen-sysreg.awk
arch/arm64/tools/sysreg
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/irq.c
arch/ia64/kernel/msi_ia64.c
arch/loongarch/Kconfig
arch/loongarch/include/asm/acpi.h
arch/loongarch/include/asm/asmmacro.h
arch/loongarch/include/asm/atomic.h
arch/loongarch/include/asm/barrier.h
arch/loongarch/include/asm/cmpxchg.h
arch/loongarch/include/asm/compiler.h [deleted file]
arch/loongarch/include/asm/elf.h
arch/loongarch/include/asm/futex.h
arch/loongarch/include/asm/irq.h
arch/loongarch/include/asm/irqflags.h
arch/loongarch/include/asm/local.h
arch/loongarch/include/asm/loongson.h
arch/loongarch/include/asm/stacktrace.h
arch/loongarch/include/asm/thread_info.h
arch/loongarch/include/asm/uaccess.h
arch/loongarch/kernel/acpi.c
arch/loongarch/kernel/cacheinfo.c
arch/loongarch/kernel/entry.S
arch/loongarch/kernel/env.c
arch/loongarch/kernel/fpu.S
arch/loongarch/kernel/genex.S
arch/loongarch/kernel/head.S
arch/loongarch/kernel/irq.c
arch/loongarch/kernel/ptrace.c
arch/loongarch/kernel/reset.c
arch/loongarch/kernel/setup.c
arch/loongarch/kernel/smp.c
arch/loongarch/kernel/switch.S
arch/loongarch/kernel/time.c
arch/loongarch/lib/clear_user.S
arch/loongarch/lib/copy_user.S
arch/loongarch/lib/delay.c
arch/loongarch/mm/page.S
arch/loongarch/mm/tlbex.S
arch/m68k/Kconfig.cpu
arch/m68k/Kconfig.debug
arch/m68k/Kconfig.machine
arch/m68k/configs/amiga_defconfig
arch/m68k/configs/apollo_defconfig
arch/m68k/configs/atari_defconfig
arch/m68k/configs/bvme6000_defconfig
arch/m68k/configs/hp300_defconfig
arch/m68k/configs/mac_defconfig
arch/m68k/configs/multi_defconfig
arch/m68k/configs/mvme147_defconfig
arch/m68k/configs/mvme16x_defconfig
arch/m68k/configs/q40_defconfig
arch/m68k/configs/sun3_defconfig
arch/m68k/configs/sun3x_defconfig
arch/m68k/include/asm/bitops.h
arch/m68k/include/asm/processor.h
arch/m68k/include/uapi/asm/bootinfo-virt.h
arch/m68k/kernel/traps.c
arch/m68k/mac/iop.c
arch/m68k/mac/macints.c
arch/m68k/q40/q40ints.c
arch/m68k/sun3/mmu_emu.c
arch/m68k/virt/config.c
arch/m68k/virt/ints.c
arch/m68k/virt/platform.c
arch/mips/cavium-octeon/octeon-irq.c
arch/mips/include/asm/jump_label.h
arch/mips/include/asm/mach-loongson64/irq.h
arch/mips/kernel/jump_label.c
arch/mips/kernel/module.c
arch/parisc/kernel/irq.c
arch/parisc/kernel/jump_label.c
arch/powerpc/Kconfig
arch/powerpc/kernel/Makefile
arch/riscv/Makefile
arch/riscv/kernel/jump_label.c
arch/s390/include/asm/archrandom.h
arch/s390/include/asm/jump_label.h
arch/s390/kernel/jump_label.c
arch/s390/kernel/module.c
arch/sh/configs/ecovec24_defconfig
arch/sh/kernel/irq.c
arch/sparc/kernel/module.c
arch/x86/.gitignore
arch/x86/Kconfig
arch/x86/Kconfig.debug
arch/x86/events/amd/uncore.c
arch/x86/events/intel/core.c
arch/x86/events/intel/ds.c
arch/x86/events/perf_event.h
arch/x86/hyperv/irqdomain.c
arch/x86/include/asm/amd-ibs.h
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/fpu/api.h
arch/x86/include/asm/mwait.h
arch/x86/include/asm/nospec-branch.h
arch/x86/include/asm/perf_event.h
arch/x86/include/asm/sev.h
arch/x86/include/asm/special_insns.h
arch/x86/include/asm/tlbflush.h
arch/x86/include/uapi/asm/bootparam.h
arch/x86/kernel/Makefile
arch/x86/kernel/amd_nb.c
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/mce/inject.c
arch/x86/kernel/cpu/mce/internal.h
arch/x86/kernel/cpu/vmware.c
arch/x86/kernel/e820.c
arch/x86/kernel/fpu/core.c
arch/x86/kernel/jump_label.c
arch/x86/kernel/kexec-bzimage64.c
arch/x86/kernel/module.c
arch/x86/kernel/pmem.c
arch/x86/kernel/process.c
arch/x86/kernel/setup.c
arch/x86/kernel/sev-shared.c
arch/x86/kernel/sev.c
arch/x86/mm/extable.c
arch/x86/mm/init.c
arch/x86/mm/pkeys.c
arch/x86/mm/tlb.c
arch/x86/purgatory/Makefile
arch/x86/purgatory/kexec-purgatory.S [new file with mode: 0644]
arch/xtensa/kernel/irq.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/acpi/acpi_lpit.c
drivers/acpi/acpi_lpss.c
drivers/acpi/acpi_video.c
drivers/acpi/apei/apei-base.c
drivers/acpi/apei/bert.c
drivers/acpi/apei/einj.c
drivers/acpi/bus.c
drivers/acpi/container.c
drivers/acpi/cppc_acpi.c
drivers/acpi/device_pm.c
drivers/acpi/device_sysfs.c
drivers/acpi/ec.c
drivers/acpi/glue.c
drivers/acpi/irq.c
drivers/acpi/pci_link.c
drivers/acpi/processor_driver.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_thermal.c
drivers/acpi/property.c
drivers/acpi/resource.c
drivers/acpi/scan.c
drivers/acpi/sleep.c
drivers/acpi/video_detect.c
drivers/acpi/viot.c
drivers/acpi/x86/s2idle.c
drivers/ata/Kconfig
drivers/base/regmap/regcache.c
drivers/base/regmap/regmap-irq.c
drivers/base/regmap/regmap.c
drivers/bus/hisi_lpc.c
drivers/char/hw_random/Kconfig
drivers/clk/bcm/Kconfig
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
drivers/clocksource/Kconfig
drivers/clocksource/Makefile
drivers/clocksource/sh_cmt.c
drivers/clocksource/timer-mediatek.c
drivers/clocksource/timer-microchip-pit64b.c
drivers/clocksource/timer-sun4i.c
drivers/clocksource/timer-sun5i.c
drivers/clocksource/timer-tegra186.c [new file with mode: 0644]
drivers/clocksource/timer-ti-dm.c
drivers/cpuidle/Kconfig.arm
drivers/edac/ghes_edac.c
drivers/edac/synopsys_edac.c
drivers/firmware/arm_scmi/Kconfig
drivers/firmware/arm_scmi/Makefile
drivers/firmware/arm_scmi/driver.c
drivers/firmware/arm_scmi/perf.c
drivers/firmware/arm_scmi/powercap.c [new file with mode: 0644]
drivers/firmware/arm_scmi/protocols.h
drivers/firmware/arm_scmi/scmi_power_control.c [new file with mode: 0644]
drivers/firmware/arm_scmi/system.c
drivers/firmware/arm_scpi.c
drivers/firmware/qcom_scm-legacy.c
drivers/firmware/qcom_scm.c
drivers/firmware/tegra/bpmp-debugfs.c
drivers/firmware/tegra/bpmp.c
drivers/firmware/xilinx/zynqmp.c
drivers/gpio/gpio-msc313.c
drivers/gpio/gpio-tegra.c
drivers/gpio/gpio-tegra186.c
drivers/gpio/gpio-thunderx.c
drivers/gpio/gpio-visconti.c
drivers/gpio/gpiolib.c
drivers/gpu/drm/amd/display/Kconfig
drivers/gpu/drm/i915/gt/intel_engine.h
drivers/gpu/drm/i915/gt/intel_engine_cs.c
drivers/gpu/drm/i915/gt/intel_execlists_submission.c
drivers/gpu/drm/i915/gt/uc/intel_guc.c
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/nouveau/nouveau_dmem.c
drivers/gpu/drm/tiny/simpledrm.c
drivers/hwmon/Kconfig
drivers/hwmon/aquacomputer_d5next.c
drivers/hwmon/aspeed-pwm-tacho.c
drivers/hwmon/asus-ec-sensors.c
drivers/hwmon/asus_wmi_sensors.c
drivers/hwmon/dell-smm-hwmon.c
drivers/hwmon/drivetemp.c
drivers/hwmon/f71882fg.c
drivers/hwmon/gsc-hwmon.c
drivers/hwmon/k10temp.c
drivers/hwmon/lm75.h
drivers/hwmon/lm90.c
drivers/hwmon/mcp3021.c
drivers/hwmon/nct6775-platform.c
drivers/hwmon/occ/common.c
drivers/hwmon/occ/p9_sbe.c
drivers/hwmon/pmbus/Kconfig
drivers/hwmon/pmbus/Makefile
drivers/hwmon/pmbus/lt7182s.c [new file with mode: 0644]
drivers/hwmon/pmbus/ltc2978.c
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c
drivers/hwmon/sch56xx-common.c
drivers/hwmon/sht15.c
drivers/hwmon/tps23861.c
drivers/i2c/busses/Kconfig
drivers/idle/intel_idle.c
drivers/iommu/hyperv-iommu.c
drivers/irqchip/Kconfig
drivers/irqchip/Makefile
drivers/irqchip/irq-bcm6345-l1.c
drivers/irqchip/irq-gic-v3.c
drivers/irqchip/irq-gic.c
drivers/irqchip/irq-loongarch-cpu.c [new file with mode: 0644]
drivers/irqchip/irq-loongson-eiointc.c [new file with mode: 0644]
drivers/irqchip/irq-loongson-liointc.c
drivers/irqchip/irq-loongson-pch-lpc.c [new file with mode: 0644]
drivers/irqchip/irq-loongson-pch-msi.c
drivers/irqchip/irq-loongson-pch-pic.c
drivers/irqchip/irq-mips-gic.c
drivers/irqchip/irq-renesas-rzg2l.c [new file with mode: 0644]
drivers/irqchip/irq-sifive-plic.c
drivers/irqchip/irq-sp7021-intc.c [new file with mode: 0644]
drivers/irqchip/irq-stm32-exti.c
drivers/memory/mtk-smi.c
drivers/memory/tegra/tegra234.c
drivers/mfd/bcm2835-pm.c
drivers/mfd/mfd-core.c
drivers/mmc/host/sdhci-acpi.c
drivers/mmc/host/sdhci-pci-core.c
drivers/net/ethernet/fungible/funeth/funeth_rx.c
drivers/net/ethernet/fungible/funeth/funeth_tx.c
drivers/net/ethernet/fungible/funeth/funeth_txrx.h
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/ice/ice_sriov.c
drivers/net/ethernet/intel/ice/ice_txrx.c
drivers/net/ethernet/intel/ice/ice_virtchnl.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/sfc/ptp.c
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
drivers/net/ipa/ipa_qmi_msg.h
drivers/net/macsec.c
drivers/net/pcs/pcs-xpcs.c
drivers/net/sungem_phy.c
drivers/net/virtio_net.c
drivers/nvme/host/pci.c
drivers/of/kexec.c
drivers/parisc/iosapic.c
drivers/pci/controller/pci-hyperv.c
drivers/perf/arm-cci.c
drivers/perf/arm-ccn.c
drivers/perf/arm_spe_pmu.c
drivers/perf/fsl_imx8_ddr_perf.c
drivers/perf/hisilicon/Kconfig
drivers/perf/hisilicon/Makefile
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
drivers/perf/hisilicon/hisi_uncore_hha_pmu.c
drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c
drivers/perf/hisilicon/hisi_uncore_pa_pmu.c
drivers/perf/hisilicon/hisi_uncore_pmu.c
drivers/perf/hisilicon/hisi_uncore_pmu.h
drivers/perf/hisilicon/hisi_uncore_sllc_pmu.c
drivers/perf/hisilicon/hns3_pmu.c [new file with mode: 0644]
drivers/perf/marvell_cn10k_tad_pmu.c
drivers/perf/riscv_pmu.c
drivers/perf/riscv_pmu_sbi.c
drivers/phy/broadcom/Kconfig
drivers/pinctrl/pinctrl-ocelot.c
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
drivers/pinctrl/renesas/pinctrl-rzg2l.c
drivers/platform/x86/thinkpad_acpi.c
drivers/powercap/dtpm_cpu.c
drivers/ptp/Kconfig
drivers/pwm/Kconfig
drivers/pwm/Makefile
drivers/pwm/core.c
drivers/pwm/pwm-atmel-tcb.c
drivers/pwm/pwm-clk.c [new file with mode: 0644]
drivers/pwm/pwm-lpc18xx-sct.c
drivers/pwm/pwm-mediatek.c
drivers/pwm/pwm-sifive.c
drivers/pwm/pwm-twl-led.c
drivers/regulator/Kconfig
drivers/regulator/Makefile
drivers/regulator/core.c
drivers/regulator/devres.c
drivers/regulator/max597x-regulator.c [new file with mode: 0644]
drivers/regulator/mp5416.c
drivers/regulator/mt6370-regulator.c [new file with mode: 0644]
drivers/regulator/mt6380-regulator.c
drivers/regulator/of_regulator.c
drivers/regulator/qcom_smd-regulator.c
drivers/regulator/qcom_spmi-regulator.c
drivers/regulator/rpi-panel-attiny-regulator.c
drivers/regulator/rt5120-regulator.c [new file with mode: 0644]
drivers/regulator/rt5190a-regulator.c
drivers/regulator/scmi-regulator.c
drivers/regulator/ti-abb-regulator.c
drivers/reset/Kconfig
drivers/reset/Makefile
drivers/reset/reset-npcm.c
drivers/reset/reset-sunplus.c [new file with mode: 0644]
drivers/s390/net/qeth_core_main.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/scsi_ioctl.c
drivers/sh/intc/chip.c
drivers/soc/Kconfig
drivers/soc/Makefile
drivers/soc/amlogic/meson-mx-socinfo.c
drivers/soc/amlogic/meson-secure-pwrc.c
drivers/soc/bcm/bcm2835-power.c
drivers/soc/bcm/brcmstb/biuctrl.c
drivers/soc/bcm/brcmstb/pm/pm-arm.c
drivers/soc/fsl/guts.c
drivers/soc/fujitsu/Kconfig [new file with mode: 0644]
drivers/soc/fujitsu/Makefile [new file with mode: 0644]
drivers/soc/fujitsu/a64fx-diag.c [new file with mode: 0644]
drivers/soc/imx/gpcv2.c
drivers/soc/imx/imx8m-blk-ctrl.c
drivers/soc/mediatek/Kconfig
drivers/soc/mediatek/Makefile
drivers/soc/mediatek/mt6795-pm-domains.h [new file with mode: 0644]
drivers/soc/mediatek/mt8183-pm-domains.h
drivers/soc/mediatek/mt8186-pm-domains.h
drivers/soc/mediatek/mt8192-pm-domains.h
drivers/soc/mediatek/mt8195-pm-domains.h
drivers/soc/mediatek/mt8365-mmsys.h
drivers/soc/mediatek/mtk-devapc.c
drivers/soc/mediatek/mtk-mutex.c
drivers/soc/mediatek/mtk-pm-domains.c
drivers/soc/mediatek/mtk-pm-domains.h
drivers/soc/mediatek/mtk-pmic-wrap.c
drivers/soc/mediatek/mtk-svs.c [new file with mode: 0644]
drivers/soc/qcom/Kconfig
drivers/soc/qcom/Makefile
drivers/soc/qcom/apr.c
drivers/soc/qcom/cmd-db.c
drivers/soc/qcom/icc-bwmon.c [new file with mode: 0644]
drivers/soc/qcom/llcc-qcom.c
drivers/soc/qcom/mdt_loader.c
drivers/soc/qcom/ocmem.c
drivers/soc/qcom/qcom_aoss.c
drivers/soc/qcom/rpmhpd.c
drivers/soc/qcom/rpmpd.c
drivers/soc/qcom/smd-rpm.c
drivers/soc/qcom/smp2p.c
drivers/soc/qcom/socinfo.c
drivers/soc/qcom/spm.c
drivers/soc/renesas/r8a779a0-sysc.c
drivers/soc/renesas/rcar-gen4-sysc.h
drivers/soc/renesas/rcar-sysc.h
drivers/soc/sunxi/Kconfig
drivers/soc/ti/pruss.c
drivers/soc/ti/wkup_m3_ipc.c
drivers/soc/xilinx/xlnx_event_manager.c
drivers/soundwire/slave.c
drivers/spi/Kconfig
drivers/spi/Makefile
drivers/spi/atmel-quadspi.c
drivers/spi/spi-altera-dfl.c
drivers/spi/spi-amd.c
drivers/spi/spi-armada-3700.c
drivers/spi/spi-atmel.c
drivers/spi/spi-bcm2835.c
drivers/spi/spi-dw-core.c
drivers/spi/spi-dw-dma.c
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-dw.h
drivers/spi/spi-fsi.c
drivers/spi/spi-gxp.c [new file with mode: 0644]
drivers/spi/spi-intel-pci.c
drivers/spi/spi-intel.c
drivers/spi/spi-microchip-core.c [new file with mode: 0644]
drivers/spi/spi-mpc52xx-psc.c
drivers/spi/spi-npcm-fiu.c
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-s3c64xx.c
drivers/spi/spi-sh.c
drivers/spi/spi-sifive.c
drivers/spi/spi-stm32-qspi.c
drivers/spi/spi-synquacer.c
drivers/spi/spi-tegra20-slink.c
drivers/spi/spi-tegra210-quad.c
drivers/spi/spi-ti-qspi.c
drivers/spi/spi-topcliff-pch.c
drivers/spi/spi-zynqmp-gqspi.c
drivers/spi/spi.c
drivers/thermal/cpufreq_cooling.c
drivers/thermal/rcar_gen3_thermal.c
drivers/thunderbolt/acpi.c
drivers/tty/serial/Kconfig
drivers/ufs/core/ufshcd.c
drivers/ufs/host/ufshcd-pltfrm.c
drivers/usb/core/usb-acpi.c
drivers/xen/events/events_base.c
fs/attr.c
fs/dlm/Kconfig
fs/dlm/Makefile
fs/dlm/ast.c
fs/dlm/config.c
fs/dlm/config.h
fs/dlm/dlm_internal.h
fs/dlm/lock.c
fs/dlm/lock.h
fs/dlm/lockspace.c
fs/dlm/lowcomms.c
fs/dlm/member.c
fs/dlm/plock.c
fs/dlm/recoverd.c
fs/dlm/user.c
fs/erofs/compress.h
fs/erofs/data.c
fs/erofs/decompressor.c
fs/erofs/decompressor_lzma.c
fs/erofs/dir.c
fs/erofs/zdata.c
fs/erofs/zdata.h
fs/erofs/zpvec.h [deleted file]
fs/ext2/inode.c
fs/ext2/super.c
fs/ext4/inode.c
fs/f2fs/file.c
fs/f2fs/recovery.c
fs/fat/file.c
fs/jfs/file.c
fs/ksmbd/vfs.c
fs/ksmbd/vfs.h
fs/locks.c
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify.h
fs/notify/fanotify/fanotify_user.c
fs/notify/fdinfo.c
fs/notify/fsnotify.c
fs/notify/inotify/inotify_user.c
fs/ntfs/attrib.c
fs/ocfs2/file.c
fs/ocfs2/ocfs2.h
fs/ocfs2/slot_map.c
fs/ocfs2/super.c
fs/open.c
fs/overlayfs/copy_up.c
fs/overlayfs/inode.c
fs/overlayfs/overlayfs.h
fs/overlayfs/super.c
fs/posix_acl.c
fs/quota/dquot.c
fs/read_write.c
fs/reiserfs/inode.c
fs/userfaultfd.c
fs/xattr.c
fs/xfs/xfs_iops.c
fs/zonefs/super.c
include/acpi/acpi_bus.h
include/acpi/cppc_acpi.h
include/acpi/processor.h
include/asm-generic/barrier.h
include/asm-generic/io.h
include/clocksource/timer-ti-dm.h
include/dt-bindings/clock/exynos7885.h
include/dt-bindings/clock/nuvoton,npcm845-clk.h [new file with mode: 0644]
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/sunplus,sp7021-clkc.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/mt6795-power.h [new file with mode: 0644]
include/dt-bindings/power/qcom-rpmpd.h
include/dt-bindings/power/tegra234-powergate.h
include/dt-bindings/reset/sunplus,sp7021-reset.h [new file with mode: 0644]
include/dt-bindings/reset/tegra234-reset.h
include/dt-bindings/soc/samsung,boot-mode.h [new file with mode: 0644]
include/linux/acpi.h
include/linux/acpi_viot.h
include/linux/cgroup-defs.h
include/linux/cpuhotplug.h
include/linux/evm.h
include/linux/fanotify.h
include/linux/firmware/xlnx-zynqmp.h
include/linux/fs.h
include/linux/fsnotify_backend.h
include/linux/gfp.h
include/linux/gpio/driver.h
include/linux/huge_mm.h
include/linux/ima.h
include/linux/irq.h
include/linux/irqchip/mmp.h
include/linux/irqdesc.h
include/linux/jump_label.h
include/linux/kernel_stat.h
include/linux/lockdep.h
include/linux/mfd/bcm2835-pm.h
include/linux/mm.h
include/linux/mnt_idmapping.h
include/linux/of.h
include/linux/once_lite.h
include/linux/pci_ids.h
include/linux/perf/riscv_pmu.h
include/linux/perf_event.h
include/linux/posix_acl.h
include/linux/posix_acl_xattr.h
include/linux/pwm.h
include/linux/quotaops.h
include/linux/regmap.h
include/linux/regulator/consumer.h
include/linux/regulator/driver.h
include/linux/sched.h
include/linux/sched/rt.h
include/linux/sched/topology.h
include/linux/scmi_protocol.h
include/linux/security.h
include/linux/soc/mediatek/mtk-mutex.h
include/linux/spi/spi.h
include/linux/wait.h
include/linux/xattr.h
include/net/addrconf.h
include/net/bluetooth/l2cap.h
include/net/inet_connection_sock.h
include/net/sock.h
include/net/tcp.h
include/trace/events/dlm.h
include/trace/events/kmem.h
include/trace/events/scmi.h
include/uapi/asm-generic/fcntl.h
include/uapi/linux/fanotify.h
include/uapi/linux/perf_event.h
kernel/cgroup/rstat.c
kernel/configs/x86_debug.config
kernel/events/core.c
kernel/events/ring_buffer.c
kernel/irq/Kconfig
kernel/irq/chip.c
kernel/irq/debugfs.c
kernel/irq/generic-chip.c
kernel/irq/ipi.c
kernel/irq/irqdesc.c
kernel/irq/irqdomain.c
kernel/irq/manage.c
kernel/irq/pm.c
kernel/jump_label.c
kernel/locking/lockdep.c
kernel/locking/rwsem.c
kernel/rseq.c
kernel/sched/core.c
kernel/sched/core_sched.c
kernel/sched/cpufreq_schedutil.c
kernel/sched/cputime.c
kernel/sched/deadline.c
kernel/sched/fair.c
kernel/sched/features.h
kernel/sched/pelt.h
kernel/sched/rt.c
kernel/sched/sched.h
kernel/sched/topology.c
kernel/watch_queue.c
kernel/workqueue.c
mm/gup.c
mm/hmm.c
mm/hugetlb.c
mm/ioremap.c
mm/kasan/common.c
mm/kfence/core.c
mm/memory.c
mm/memremap.c
mm/page_alloc.c
mm/secretmem.c
mm/shmem.c
mm/slab.c
mm/slab.h
mm/slab_common.c
mm/slob.c
mm/slub.c
mm/swap_slots.c
net/bluetooth/hci_sync.c
net/bluetooth/l2cap_core.c
net/bluetooth/mgmt.c
net/bridge/br_netlink.c
net/caif/caif_socket.c
net/decnet/af_decnet.c
net/dsa/switch.c
net/ipv4/fib_trie.c
net/ipv4/tcp.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_metrics.c
net/ipv4/tcp_output.c
net/ipv6/mcast.c
net/ipv6/ping.c
net/ipv6/tcp_ipv6.c
net/mac80211/iface.c
net/mptcp/options.c
net/mptcp/protocol.c
net/mptcp/subflow.c
net/netfilter/nf_tables_api.c
net/netfilter/nfnetlink_queue.c
net/netfilter/nft_queue.c
net/sctp/associola.c
net/sctp/stream.c
net/sctp/stream_sched.c
net/tipc/socket.c
net/tls/tls_device.c
scripts/remove-stale-files
security/integrity/evm/evm_main.c
security/integrity/ima/ima_kexec.c
security/security.c
tools/arch/x86/include/asm/cpufeatures.h
tools/include/uapi/asm-generic/fcntl.h
tools/perf/scripts/python/arm-cs-trace-disasm.py
tools/perf/util/bpf-loader.c
tools/perf/util/symbol-elf.c
tools/spi/spidev_test.c
tools/testing/selftests/rseq/rseq-riscv.h
tools/testing/selftests/rseq/rseq.c
tools/vm/slabinfo.c

index 13e4f504e17fbb7f91d6f87ae5589b989157ee73..71577c3962521890631e1687b77197f6b7382eee 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -60,6 +60,10 @@ Arnd Bergmann <arnd@arndb.de>
 Atish Patra <atishp@atishpatra.org> <atish.patra@wdc.com>
 Axel Dyks <xl@xlsigned.net>
 Axel Lin <axel.lin@gmail.com>
+Baolin Wang <baolin.wang@linux.alibaba.com> <baolin.wang@linaro.org>
+Baolin Wang <baolin.wang@linux.alibaba.com> <baolin.wang@spreadtrum.com>
+Baolin Wang <baolin.wang@linux.alibaba.com> <baolin.wang@unisoc.com>
+Baolin Wang <baolin.wang@linux.alibaba.com> <baolin.wang7@gmail.com>
 Bart Van Assche <bvanassche@acm.org> <bart.vanassche@sandisk.com>
 Bart Van Assche <bvanassche@acm.org> <bart.vanassche@wdc.com>
 Ben Gardner <bgardner@wabtec.com>
@@ -135,6 +139,8 @@ Frank Rowand <frowand.list@gmail.com> <frowand@mvista.com>
 Frank Zago <fzago@systemfabricworks.com>
 Gao Xiang <xiang@kernel.org> <gaoxiang25@huawei.com>
 Gao Xiang <xiang@kernel.org> <hsiangkao@aol.com>
+Gao Xiang <xiang@kernel.org> <hsiangkao@linux.alibaba.com>
+Gao Xiang <xiang@kernel.org> <hsiangkao@redhat.com>
 Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@de.ibm.com>
 Gerald Schaefer <gerald.schaefer@linux.ibm.com> <gerald.schaefer@de.ibm.com>
 Gerald Schaefer <gerald.schaefer@linux.ibm.com> <geraldsc@linux.vnet.ibm.com>
@@ -371,6 +377,7 @@ Sean Nyekjaer <sean@geanix.com> <sean.nyekjaer@prevas.dk>
 Sebastian Reichel <sre@kernel.org> <sebastian.reichel@collabora.co.uk>
 Sebastian Reichel <sre@kernel.org> <sre@debian.org>
 Sedat Dilek <sedat.dilek@gmail.com> <sedat.dilek@credativ.de>
+Seth Forshee <sforshee@kernel.org> <seth.forshee@canonical.com>
 Shiraz Hashim <shiraz.linux.kernel@gmail.com> <shiraz.hashim@st.com>
 Shuah Khan <shuah@kernel.org> <shuahkhan@gmail.com>
 Shuah Khan <shuah@kernel.org> <shuah.khan@hp.com>
index 653d4c75eddb3345232a126da7008c5cc1817041..7271781a23b2844f4879448a7e6beb691cb36257 100644 (file)
@@ -938,3 +938,12 @@ Description:
                - 1: enable
 
                RW
+
+What:          /sys/class/hwmon/hwmonX/device/pec
+Description:
+               PEC support on I2C devices
+
+               - 0, off, n: disable
+               - 1, on, y: enable
+
+               RW
index bcc974d276dc4521367b3a12038526f1cc49e166..df79e129d09794cf9fc8d8c0606e8ded61a40609 100644 (file)
@@ -493,12 +493,13 @@ What:             /sys/devices/system/cpu/cpuX/regs/
                /sys/devices/system/cpu/cpuX/regs/identification/
                /sys/devices/system/cpu/cpuX/regs/identification/midr_el1
                /sys/devices/system/cpu/cpuX/regs/identification/revidr_el1
+               /sys/devices/system/cpu/cpuX/regs/identification/smidr_el1
 Date:          June 2016
 Contact:       Linux ARM Kernel Mailing list <linux-arm-kernel@lists.infradead.org>
 Description:   AArch64 CPU registers
 
                'identification' directory exposes the CPU ID registers for
-               identifying model and revision of the CPU.
+               identifying model and revision of the CPU and SMCU.
 
 What:          /sys/devices/system/cpu/aarch32_el0
 Date:          May 2021
index c0fdb04a0435a6daf88492cbaf76adfb6aeac716..5e9147fe89688327fcb8ebfd46883abc72edd414 100644 (file)
        arm64.nomte     [ARM64] Unconditionally disable Memory Tagging Extension
                        support
 
+       arm64.nosve     [ARM64] Unconditionally disable Scalable Vector
+                       Extension support
+
+       arm64.nosme     [ARM64] Unconditionally disable Scalable Matrix
+                       Extension support
+
        ataflop=        [HW,M68k]
 
        atarimouse=     [HW,MOUSE] Atari Mouse
                                improves system performance, but it may also
                                expose users to several CPU vulnerabilities.
                                Equivalent to: nopti [X86,PPC]
-                                              kpti=0 [ARM64]
+                                              if nokaslr then kpti=0 [ARM64]
                                               nospectre_v1 [X86,PPC]
                                               nobp=0 [S390]
                                               nospectre_v2 [X86,PPC,S390,ARM64]
                                               no_entry_flush [PPC]
                                               no_uaccess_flush [PPC]
                                               mmio_stale_data=off [X86]
+                                              retbleed=off [X86]
 
                                Exceptions:
                                               This does not have any effect on
                                               mds=full,nosmt [X86]
                                               tsx_async_abort=full,nosmt [X86]
                                               mmio_stale_data=full,nosmt [X86]
+                                              retbleed=auto,nosmt [X86]
 
        mminit_loglevel=
                        [KNL] When CONFIG_DEBUG_MEMORY_INIT is set, this
diff --git a/Documentation/admin-guide/perf/hns3-pmu.rst b/Documentation/admin-guide/perf/hns3-pmu.rst
new file mode 100644 (file)
index 0000000..578407e
--- /dev/null
@@ -0,0 +1,136 @@
+======================================
+HNS3 Performance Monitoring Unit (PMU)
+======================================
+
+HNS3(HiSilicon network system 3) Performance Monitoring Unit (PMU) is an
+End Point device to collect performance statistics of HiSilicon SoC NIC.
+On Hip09, each SICL(Super I/O cluster) has one PMU device.
+
+HNS3 PMU supports collection of performance statistics such as bandwidth,
+latency, packet rate and interrupt rate.
+
+Each HNS3 PMU supports 8 hardware events.
+
+HNS3 PMU driver
+===============
+
+The HNS3 PMU driver registers a perf PMU with the name of its sicl id.::
+
+  /sys/devices/hns3_pmu_sicl_<sicl_id>
+
+PMU driver provides description of available events, filter modes, format,
+identifier and cpumask in sysfs.
+
+The "events" directory describes the event code of all supported events
+shown in perf list.
+
+The "filtermode" directory describes the supported filter modes of each
+event.
+
+The "format" directory describes all formats of the config (events) and
+config1 (filter options) fields of the perf_event_attr structure.
+
+The "identifier" file shows version of PMU hardware device.
+
+The "bdf_min" and "bdf_max" files show the supported bdf range of each
+pmu device.
+
+The "hw_clk_freq" file shows the hardware clock frequency of each pmu
+device.
+
+Example usage of checking event code and subevent code::
+
+  $# cat /sys/devices/hns3_pmu_sicl_0/events/dly_tx_normal_to_mac_time
+  config=0x00204
+  $# cat /sys/devices/hns3_pmu_sicl_0/events/dly_tx_normal_to_mac_packet_num
+  config=0x10204
+
+Each performance statistic has a pair of events to get two values to
+calculate real performance data in userspace.
+
+The bits 0~15 of config (here 0x0204) are the true hardware event code. If
+two events have same value of bits 0~15 of config, that means they are
+event pair. And the bit 16 of config indicates getting counter 0 or
+counter 1 of hardware event.
+
+After getting two values of event pair in usersapce, the formula of
+computation to calculate real performance data is:::
+
+  counter 0 / counter 1
+
+Example usage of checking supported filter mode::
+
+  $# cat /sys/devices/hns3_pmu_sicl_0/filtermode/bw_ssu_rpu_byte_num
+  filter mode supported: global/port/port-tc/func/func-queue/
+
+Example usage of perf::
+
+  $# perf list
+  hns3_pmu_sicl_0/bw_ssu_rpu_byte_num/ [kernel PMU event]
+  hns3_pmu_sicl_0/bw_ssu_rpu_time/     [kernel PMU event]
+  ------------------------------------------
+
+  $# perf stat -g -e hns3_pmu_sicl_0/bw_ssu_rpu_byte_num,global=1/ -e hns3_pmu_sicl_0/bw_ssu_rpu_time,global=1/ -I 1000
+  or
+  $# perf stat -g -e hns3_pmu_sicl_0/config=0x00002,global=1/ -e hns3_pmu_sicl_0/config=0x10002,global=1/ -I 1000
+
+
+Filter modes
+--------------
+
+1. global mode
+PMU collect performance statistics for all HNS3 PCIe functions of IO DIE.
+Set the "global" filter option to 1 will enable this mode.
+Example usage of perf::
+
+  $# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,global=1/ -I 1000
+
+2. port mode
+PMU collect performance statistic of one whole physical port. The port id
+is same as mac id. The "tc" filter option must be set to 0xF in this mode,
+here tc stands for traffic class.
+
+Example usage of perf::
+
+  $# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,port=0,tc=0xF/ -I 1000
+
+3. port-tc mode
+PMU collect performance statistic of one tc of physical port. The port id
+is same as mac id. The "tc" filter option must be set to 0 ~ 7 in this
+mode.
+Example usage of perf::
+
+  $# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,port=0,tc=0/ -I 1000
+
+4. func mode
+PMU collect performance statistic of one PF/VF. The function id is BDF of
+PF/VF, its conversion formula::
+
+  func = (bus << 8) + (device << 3) + (function)
+
+for example:
+  BDF         func
+  35:00.0    0x3500
+  35:00.1    0x3501
+  35:01.0    0x3508
+
+In this mode, the "queue" filter option must be set to 0xFFFF.
+Example usage of perf::
+
+  $# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,bdf=0x3500,queue=0xFFFF/ -I 1000
+
+5. func-queue mode
+PMU collect performance statistic of one queue of PF/VF. The function id
+is BDF of PF/VF, the "queue" filter option must be set to the exact queue
+id of function.
+Example usage of perf::
+
+  $# perf stat -a -e hns3_pmu_sicl_0/config=0x1020F,bdf=0x3500,queue=0/ -I 1000
+
+6. func-intr mode
+PMU collect performance statistic of one interrupt of PF/VF. The function
+id is BDF of PF/VF, the "intr" filter option must be set to the exact
+interrupt id of function.
+Example usage of perf::
+
+  $# perf stat -a -e hns3_pmu_sicl_0/config=0x00301,bdf=0x3500,intr=0/ -I 1000
index 69b23f087c05088e06dca4170f814994a1b74f6d..9c9ece88ce53a10ce1525d959d853f72e1d6b572 100644 (file)
@@ -9,6 +9,7 @@ Performance monitor support
 
    hisi-pmu
    hisi-pcie-pmu
+   hns3-pmu
    imx-ddr
    qcom_l2_pmu
    qcom_l3_pmu
index aec2cd2aaea739dcd9605fb5c6ecb854cef30ac0..19754beb5a4e658b88c0b990594278804019be07 100644 (file)
@@ -612,8 +612,8 @@ the ``menu`` governor to be used on the systems that use the ``ladder`` governor
 by default this way, for example.
 
 The other kernel command line parameters controlling CPU idle time management
-described below are only relevant for the *x86* architecture and some of
-them affect Intel processors only.
+described below are only relevant for the *x86* architecture and references
+to ``intel_idle`` affect Intel processors only.
 
 The *x86* architecture support code recognizes three kernel command line
 options related to CPU idle time management: ``idle=poll``, ``idle=halt``,
@@ -635,10 +635,13 @@ idle, so it very well may hurt single-thread computations performance as well as
 energy-efficiency.  Thus using it for performance reasons may not be a good idea
 at all.]
 
-The ``idle=nomwait`` option disables the ``intel_idle`` driver and causes
-``acpi_idle`` to be used (as long as all of the information needed by it is
-there in the system's ACPI tables), but it is not allowed to use the
-``MWAIT`` instruction of the CPUs to ask the hardware to enter idle states.
+The ``idle=nomwait`` option prevents the use of ``MWAIT`` instruction of
+the CPU to enter idle states. When this option is used, the ``acpi_idle``
+driver will use the ``HLT`` instruction instead of ``MWAIT``. On systems
+running Intel processors, this option disables the ``intel_idle`` driver
+and forces the use of the ``acpi_idle`` driver instead. Note that in either
+case, ``acpi_idle`` driver will function only if all the information needed
+by it is in the system's ACPI tables.
 
 In addition to the architecture-level kernel command line options affecting CPU
 idle time management, there are parameters affecting individual ``CPUIdle``
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 2bda5461a80b486c999143ea92fc93f2d06996b7..495ada7915e1e3860a42beed537b7c538a3080b4 100644 (file)
@@ -31,6 +31,8 @@ SoC-specific documents
 .. toctree::
    :maxdepth: 1
 
+   google/chromebook-boot-flow
+
    ixp4xx
 
    marvell
index 3d116fb536c538a58d1fbc2db25c1dde29004ef6..31fc10b833dd06eb61c6b8b3801cda9b8cd9ddba 100644 (file)
@@ -301,6 +301,10 @@ HWCAP2_WFXT
 
     Functionality implied by ID_AA64ISAR2_EL1.WFXT == 0b0010.
 
+HWCAP2_EBF16
+
+    Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0010.
+
 4. Unused AT_HWCAP bits
 -----------------------
 
index 901cd094f4ecdcccf8ec3ba6d0bf49d86028d0d5..2a641ba7be3b717aa2f9343fe94e05f5e6700e79 100644 (file)
@@ -33,9 +33,8 @@ AArch64 Linux memory layout with 4KB pages + 4 levels (48-bit)::
   0000000000000000     0000ffffffffffff         256TB          user
   ffff000000000000     ffff7fffffffffff         128TB          kernel logical memory map
  [ffff600000000000     ffff7fffffffffff]         32TB          [kasan shadow region]
-  ffff800000000000     ffff800007ffffff         128MB          bpf jit region
-  ffff800008000000     ffff80000fffffff         128MB          modules
-  ffff800010000000     fffffbffefffffff         124TB          vmalloc
+  ffff800000000000     ffff800007ffffff         128MB          modules
+  ffff800008000000     fffffbffefffffff         124TB          vmalloc
   fffffbfff0000000     fffffbfffdffffff         224MB          fixed mappings (top down)
   fffffbfffe000000     fffffbfffe7fffff           8MB          [guard region]
   fffffbfffe800000     fffffbffff7fffff          16MB          PCI I/O space
@@ -51,9 +50,8 @@ AArch64 Linux memory layout with 64KB pages + 3 levels (52-bit with HW support):
   0000000000000000     000fffffffffffff           4PB          user
   fff0000000000000     ffff7fffffffffff          ~4PB          kernel logical memory map
  [fffd800000000000     ffff7fffffffffff]        512TB          [kasan shadow region]
-  ffff800000000000     ffff800007ffffff         128MB          bpf jit region
-  ffff800008000000     ffff80000fffffff         128MB          modules
-  ffff800010000000     fffffbffefffffff         124TB          vmalloc
+  ffff800000000000     ffff800007ffffff         128MB          modules
+  ffff800008000000     fffffbffefffffff         124TB          vmalloc
   fffffbfff0000000     fffffbfffdffffff         224MB          fixed mappings (top down)
   fffffbfffe000000     fffffbfffe7fffff           8MB          [guard region]
   fffffbfffe800000     fffffbffff7fffff          16MB          PCI I/O space
index d27db84d585ed223e7a4cbe220ebcbd1ff6ddaa6..33b04db8408f98dce58be3e71cbef70fcdb2f66e 100644 (file)
@@ -82,10 +82,14 @@ stable kernels.
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A57      | #1319537        | ARM64_ERRATUM_1319367       |
 +----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A57      | #1742098        | ARM64_ERRATUM_1742098       |
++----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A72      | #853709         | N/A                         |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A72      | #1319367        | ARM64_ERRATUM_1319367       |
 +----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A72      | #1655431        | ARM64_ERRATUM_1742098       |
++----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A73      | #858921         | ARM64_ERRATUM_858921        |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A76      | #1188873,1418040| ARM64_ERRATUM_1418040       |
@@ -102,6 +106,8 @@ stable kernels.
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A510     | #2077057        | ARM64_ERRATUM_2077057       |
 +----------------+-----------------+-----------------+-----------------------------+
+| ARM            | Cortex-A510     | #2441009        | ARM64_ERRATUM_2441009       |
++----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A710     | #2119858        | ARM64_ERRATUM_2119858       |
 +----------------+-----------------+-----------------+-----------------------------+
 | ARM            | Cortex-A710     | #2054223        | ARM64_ERRATUM_2054223       |
index ec575e72d0b2ab7da24924aacd3ed61324533c53..bf28ac0401f38a0c7bd5cec975c1bf5c76af34a0 100644 (file)
@@ -4,31 +4,29 @@
 Memory Protection Keys
 ======================
 
-Memory Protection Keys for Userspace (PKU aka PKEYs) is a feature
-which is found on Intel's Skylake (and later) "Scalable Processor"
-Server CPUs. It will be available in future non-server Intel parts
-and future AMD processors.
-
-For anyone wishing to test or use this feature, it is available in
-Amazon's EC2 C5 instances and is known to work there using an Ubuntu
-17.04 image.
-
-Memory Protection Keys provides a mechanism for enforcing page-based
-protections, but without requiring modification of the page tables
-when an application changes protection domains.  It works by
-dedicating 4 previously ignored bits in each page table entry to a
-"protection key", giving 16 possible keys.
-
-There is also a new user-accessible register (PKRU) with two separate
-bits (Access Disable and Write Disable) for each key.  Being a CPU
-register, PKRU is inherently thread-local, potentially giving each
+Memory Protection Keys provide a mechanism for enforcing page-based
+protections, but without requiring modification of the page tables when an
+application changes protection domains.
+
+Pkeys Userspace (PKU) is a feature which can be found on:
+        * Intel server CPUs, Skylake and later
+        * Intel client CPUs, Tiger Lake (11th Gen Core) and later
+        * Future AMD CPUs
+
+Pkeys work by dedicating 4 previously Reserved bits in each page table entry to
+a "protection key", giving 16 possible keys.
+
+Protections for each key are defined with a per-CPU user-accessible register
+(PKRU).  Each of these is a 32-bit register storing two bits (Access Disable
+and Write Disable) for each of 16 keys.
+
+Being a CPU register, PKRU is inherently thread-local, potentially giving each
 thread a different set of protections from every other thread.
 
-There are two new instructions (RDPKRU/WRPKRU) for reading and writing
-to the new register.  The feature is only available in 64-bit mode,
-even though there is theoretically space in the PAE PTEs.  These
-permissions are enforced on data access only and have no effect on
-instruction fetches.
+There are two instructions (RDPKRU/WRPKRU) for reading and writing to the
+register.  The feature is only available in 64-bit mode, even though there is
+theoretically space in the PAE PTEs.  These permissions are enforced on data
+access only and have no effect on instruction fetches.
 
 Syscalls
 ========
index 5e2017c0a0516921678455d9db466cf5ffb5cc92..e6de1d7f516c38a752d3dc6a365fac56c6f8bbae 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 4e495e03264b79056a3d199f90ff2288183017ef..2b7848bb7769547f3a2ab788ca38b8b47531c4c9 100644 (file)
@@ -163,9 +163,11 @@ properties:
           - const: microchip,sama7g5
           - const: microchip,sama7
 
-      - description: Microchip LAN9662 PCB8291 Evaluation Board.
+      - description: Microchip LAN9662 Evaluation Boards.
         items:
-          - const: microchip,lan9662-pcb8291
+          - enum:
+              - microchip,lan9662-pcb8291
+              - microchip,lan9662-pcb8309
           - const: microchip,lan9662
           - const: microchip,lan966
 
index 8b7e87fb6c346c021dca8d9f63c339de820fd3a0..958df32b489956ccb6cc3dbc4c5eba96755b93a0 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 5fb4558404173793e22378b4d35b984b612effdb..324e591043609d6942636664bf86c0fca757ea33 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
 
 ...
index ed04650291a809b149ce2f83ce2e72199439c8eb..5c2e3a5f3789ab2b6136de83e31e95bc75cdb311 100644 (file)
@@ -221,6 +221,7 @@ properties:
           - qcom,kpss-acc-v1
           - qcom,kpss-acc-v2
           - qcom,msm8226-smp
+          - qcom,msm8909-smp
           # Only valid on ARM 32-bit, see above for ARM v8 64-bit
           - qcom,msm8916-smp
           - renesas,apmu
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 ef524378d449bce1568aaf27cab3973e3cff7ef6..7431579ab0e8545dbbfc59c8bb00882ca52c2677 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 4a2bd9759c47f45957a16da574c372801781c23b..07c0ea94e85080210de3a0bd3f6a9df37a870261 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 611f666f359d82d6667a9baa5b93d04d28440a33..8585f6f18f691b44f74cf18ed3743a6bd553bc9b 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 95e51378089c9d48cf1a1b70116e07d370786501..43409e5721d59bd0d6da4156b5e0a231120c5c3b 100644 (file)
@@ -8,6 +8,7 @@ title: NPCM Platforms Device Tree Bindings
 
 maintainers:
   - Jonathan Neuschäfer <j.neuschaefer@gmx.net>
+  - Tomer Maimon <tmaimon77@gmail.com>
 
 properties:
   $nodename:
@@ -26,4 +27,10 @@ properties:
               - nuvoton,npcm750-evb         # NPCM750 evaluation board
           - const: nuvoton,npcm750
 
+      - description: NPCM845 based boards
+        items:
+          - enum:
+              - nuvoton,npcm845-evb         # NPCM845 evaluation board
+          - const: nuvoton,npcm845
+
 additionalProperties: true
index fcb211add7d37c8859cb71cf4883789b2fe2156a..94e72f25b33116e02898cebe0486d8e0c68166ab 100644 (file)
@@ -8,6 +8,7 @@ title: Global Control Registers block in Nuvoton SoCs
 
 maintainers:
   - Jonathan Neuschäfer <j.neuschaefer@gmx.net>
+  - Tomer Maimon <tmaimon77@gmail.com>
 
 description:
   The Global Control Registers (GCR) are a block of registers in Nuvoton SoCs
@@ -20,6 +21,7 @@ properties:
       - enum:
           - nuvoton,wpcm450-gcr
           - nuvoton,npcm750-gcr
+          - nuvoton,npcm845-gcr
       - const: syscon
       - const: simple-mfd
 
index 5c06d1bfc046c9e68d4e6e7051916b3ca4da8418..fb1d00bcc847c14f1a2bda9d2d49bd82773a128e 100644 (file)
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 title: QCOM device tree bindings
 
 maintainers:
-  - Stephen Boyd <sboyd@codeaurora.org>
+  - Bjorn Andersson <bjorn.andersson@linaro.org>
 
 description: |
   Some qcom based bootloaders identify the dtb blob based on a set of
@@ -38,18 +38,24 @@ description: |
         msm8992
         msm8994
         msm8996
+        msm8998
+        qcs404
         sa8155p
         sa8540p
         sc7180
         sc7280
         sc8180x
         sc8280xp
+        sda660
         sdm630
         sdm632
+        sdm636
         sdm660
         sdm845
         sdx55
         sdx65
+        sm6125
+        sm6350
         sm7225
         sm8150
         sm8250
@@ -90,6 +96,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: "/"
@@ -153,28 +164,50 @@ properties:
           - const: qcom,msm8974
 
       - items:
-          - enum:
-              - alcatel,idol347
-          - const: qcom,msm8916-mtp/1
           - const: qcom,msm8916-mtp
+          - const: qcom,msm8916-mtp/1
           - const: qcom,msm8916
 
       - items:
           - enum:
-              - longcheer,l8150
+              - alcatel,idol347
+              - asus,z00l
+              - huawei,g7
+              - longcheer,l8910
               - samsung,a3u-eur
               - samsung,a5u-eur
+              - samsung,j5
+              - samsung,serranove
+              - wingtech,wt88047
+          - const: qcom,msm8916
+
+      - items:
+          - const: longcheer,l8150
+          - const: qcom,msm8916-v1-qrd/9-v1
           - const: qcom,msm8916
 
+      - items:
+          - enum:
+              - lg,bullhead
+              - microsoft,talkman
+              - xiaomi,libra
+          - const: qcom,msm8992
+
       - items:
           - enum:
               - sony,karin_windy
+          - const: qcom,apq8094
+
+      - items:
+          - enum:
+              - huawei,angler
+              - microsoft,cityman
+              - sony,ivy-row
               - sony,karin-row
               - sony,satsuki-row
               - sony,sumire-row
               - sony,suzuran-row
-              - qcom,msm8994
-          - const: qcom,apq8094
+          - const: qcom,msm8994
 
       - items:
           - enum:
@@ -190,9 +223,24 @@ properties:
               - sony,kagura-row
               - sony,keyaki-row
               - xiaomi,gemini
+              - xiaomi,natrium
               - xiaomi,scorpio
           - const: qcom,msm8996
 
+      - items:
+          - enum:
+              - asus,novago-tp370ql
+              - fxtec,pro1
+              - hp,envy-x2
+              - lenovo,miix-630
+              - oneplus,cheeseburger
+              - oneplus,dumpling
+              - qcom,msm8998-mtp
+              - sony,xperia-lilac
+              - sony,xperia-maple
+              - sony,xperia-poplar
+          - const: qcom,msm8998
+
       - items:
           - enum:
               - qcom,ipq4019-ap-dk01.1-c1
@@ -214,19 +262,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,14 +584,34 @@ properties:
 
       - items:
           - enum:
+              - lenovo,thinkpad-x13s
+              - qcom,sc8280xp-crd
               - qcom,sc8280xp-qrd
           - const: qcom,sc8280xp
 
+      - items:
+          - enum:
+              - sony,discovery-row
+              - sony,kirin-row
+              - sony,pioneer-row
+              - sony,voyager-row
+          - const: qcom,sdm630
+
+      - items:
+          - enum:
+              - inforce,ifc6560
+          - const: qcom,sda660
+
       - items:
           - enum:
               - fairphone,fp3
           - const: qcom,sdm632
 
+      - items:
+          - enum:
+              - sony,mermaid-row
+          - const: qcom,sdm636
+
       - items:
           - enum:
               - xiaomi,lavender
@@ -269,6 +635,13 @@ properties:
               - qcom,ipq6018-cp01-c1
           - const: qcom,ipq6018
 
+      - items:
+          - enum:
+              - qcom,qcs404-evb-1000
+              - qcom,qcs404-evb-4000
+          - const: qcom,qcs404-evb
+          - const: qcom,qcs404
+
       - items:
           - enum:
               - qcom,sa8155p-adp
@@ -279,6 +652,34 @@ properties:
               - qcom,sa8295p-adp
           - const: qcom,sa8540p
 
+      - items:
+          - enum:
+              - lenovo,yoga-c630
+              - lg,judyln
+              - lg,judyp
+              - oneplus,enchilada
+              - oneplus,fajita
+              - qcom,sdm845-mtp
+              - shift,axolotl
+              - samsung,w737
+              - sony,akari-row
+              - sony,akatsuki-row
+              - sony,apollo-row
+              - thundercomm,db845c
+              - xiaomi,beryllium
+              - xiaomi,polaris
+          - const: qcom,sdm845
+
+      - items:
+          - enum:
+              - sony,pdx201
+          - const: qcom,sm6125
+
+      - items:
+          - enum:
+              - sony,pdx213
+          - const: qcom,sm6350
+
       - items:
           - enum:
               - fairphone,fp4
@@ -286,19 +687,29 @@ properties:
 
       - items:
           - enum:
+              - microsoft,surface-duo
+              - qcom,sm8150-hdk
               - qcom,sm8150-mtp
+              - sony,bahamut-generic
+              - sony,griffin-generic
           - const: qcom,sm8150
 
       - items:
           - enum:
               - qcom,qrb5165-rb5
+              - qcom,sm8250-hdk
               - qcom,sm8250-mtp
+              - sony,pdx203-generic
+              - sony,pdx206-generic
           - const: qcom,sm8250
 
       - items:
           - enum:
+              - microsoft,surface-duo2
               - qcom,sm8350-hdk
               - qcom,sm8350-mtp
+              - sony,pdx214-generic
+              - sony,pdx215-generic
           - const: qcom,sm8350
 
       - items:
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 cf9eb1e8326afdc7e0186dbfaed9864441989d9d..7811ba64149cbb8271d3dd90d2c0124e993fccbe 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 8b31565fee591f97d5d86bb52e08461970df5687..4c605bccc474ed3febe193ad508a94d72a594dad 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
diff --git a/Documentation/devicetree/bindings/arm/sunplus,sp7021.yaml b/Documentation/devicetree/bindings/arm/sunplus,sp7021.yaml
new file mode 100644 (file)
index 0000000..def7d0c
--- /dev/null
@@ -0,0 +1,29 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/sunplus,sp7021.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus SP7021 Boards
+
+maintainers:
+  - qinjian <qinjian@cqplus1.com>
+
+description: |
+  ARM platforms using Sunplus SP7021, an ARM Cortex A7 (4-cores) based SoC.
+  Wiki: https://sunplus-tibbo.atlassian.net/wiki/spaces/doc/overview
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    items:
+      - enum:
+          - sunplus,sp7021-achip
+          - sunplus,sp7021-demo-v3
+      - const: sunplus,sp7021
+
+additionalProperties: true
+
+...
index 95278a6a9a8ecb740acc05f5684faedba20517e2..0c2356778208afadfdf4f61f4569cad90d15a3cf 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 8eee312c2e6f5a649aeb86d5ca29fc6ad0656e73..99566688d033d98cad1d2a73eeb511b836aa7e65 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:
index 8c6543b5c0dc276f9b3f7a93f00040adf7f6b775..711bb4d08c60a470d61ae680c8f4aec8672dcefb 100644 (file)
@@ -40,7 +40,6 @@ required:
   - compatible
   - reg
   - nvidia,bpmp
-  - status
 
 examples:
   - |
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 e79eeac5f0861586a4ce7ac65cc310fee8198d3f..17caf78f0ccf553ce65a27b2a84d41b4490d189c 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>;
+    };
diff --git a/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml b/Documentation/devicetree/bindings/clock/nuvoton,npcm845-clk.yaml
new file mode 100644 (file)
index 0000000..771db2d
--- /dev/null
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/nuvoton,npcm845-clk.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nuvoton NPCM8XX Clock Controller Binding
+
+maintainers:
+  - Tomer Maimon <tmaimon77@gmail.com>
+
+description: |
+  Nuvoton Arbel BMC NPCM8XX contains an integrated clock controller, which
+  generates and supplies clocks to all modules within the BMC.
+
+properties:
+  compatible:
+    enum:
+      - nuvoton,npcm845-clk
+
+  reg:
+    maxItems: 1
+
+  '#clock-cells':
+    const: 1
+    description:
+      See include/dt-bindings/clock/nuvoton,npcm8xx-clock.h for the full
+      list of NPCM8XX clock IDs.
+
+required:
+  - compatible
+  - reg
+  - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    ahb {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        clock-controller@f0801000 {
+            compatible = "nuvoton,npcm845-clk";
+            reg = <0x0 0xf0801000 0x0 0x1000>;
+            #clock-cells = <1>;
+        };
+    };
+...
index 31497677e8de2a11bc0b3d16f60bf100c078914c..7a8d375e055e180efcdaf8c63ce92cd79259e559 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 5073e569a47fd54d65081bfb62299c749eab14a2..006d33a9e0f10f7a789b3bbbc5673eb2c647c6d9 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 f8c4742278073f6245cda9e5481cb10c06d8ac16..242fe922b035ee202af13c8aa1e9f5d9395b9225 100644 (file)
@@ -78,6 +78,7 @@ if:
       contains:
         enum:
           - st,stm32mp1-rcc-secure
+          - st,stm32mp13-rcc
 then:
   properties:
     clocks:
diff --git a/Documentation/devicetree/bindings/clock/sunplus,sp7021-clkc.yaml b/Documentation/devicetree/bindings/clock/sunplus,sp7021-clkc.yaml
new file mode 100644 (file)
index 0000000..bcc1408
--- /dev/null
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/sunplus,sp7021-clkc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus SP7021 SoC Clock Controller
+
+maintainers:
+  - Qin Jian <qinjian@cqplus1.com>
+
+properties:
+  compatible:
+    const: sunplus,sp7021-clkc
+
+  reg:
+    maxItems: 3
+
+  clocks:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    extclk: osc0 {
+      compatible = "fixed-clock";
+      #clock-cells = <0>;
+      clock-frequency = <27000000>;
+      clock-output-names = "extclk";
+    };
+
+    clkc: clock-controller@9c000004 {
+      compatible = "sunplus,sp7021-clkc";
+      reg = <0x9c000004 0x28>,
+            <0x9c000200 0x44>,
+            <0x9c000268 0x08>;
+      clocks = <&extclk>;
+      #clock-cells = <1>;
+    };
+
+...
index a9a776da5505604dd06035f3fefe12ace63efb22..10b3a7a4af3662f024e88bd7c2c03a1ce18b0681 100644 (file)
@@ -63,8 +63,8 @@ additionalProperties: true
 examples:
   - |
     / {
-        model = "Qualcomm Technologies, Inc. QCS404";
-        compatible = "qcom,qcs404";
+        model = "Qualcomm Technologies, Inc. QCS404 EVB 1000";
+        compatible = "qcom,qcs404-evb-1000", "qcom,qcs404-evb", "qcom,qcs404";
         #address-cells = <2>;
         #size-cells = <2>;
 
diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,mutex.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,mutex.yaml
deleted file mode 100644 (file)
index 3fdad71..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-%YAML 1.2
----
-$id: http://devicetree.org/schemas/display/mediatek/mediatek,mutex.yaml#
-$schema: http://devicetree.org/meta-schemas/core.yaml#
-
-title: Mediatek mutex
-
-maintainers:
-  - Chun-Kuang Hu <chunkuang.hu@kernel.org>
-  - Philipp Zabel <p.zabel@pengutronix.de>
-
-description: |
-  Mediatek mutex, namely MUTEX, is used to send the triggers signals called
-  Start Of Frame (SOF) / End Of Frame (EOF) to each sub-modules on the display
-  data path or MDP data path.
-  In some SoC, such as mt2701, MUTEX could be a hardware mutex which protects
-  the shadow register.
-  MUTEX device node must be siblings to the central MMSYS_CONFIG node.
-  For a description of the MMSYS_CONFIG binding, see
-  Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml
-  for details.
-
-properties:
-  compatible:
-    enum:
-      - mediatek,mt2701-disp-mutex
-      - mediatek,mt2712-disp-mutex
-      - mediatek,mt8167-disp-mutex
-      - mediatek,mt8173-disp-mutex
-      - mediatek,mt8183-disp-mutex
-      - mediatek,mt8186-disp-mutex
-      - mediatek,mt8192-disp-mutex
-      - mediatek,mt8195-disp-mutex
-
-  reg:
-    maxItems: 1
-
-  interrupts:
-    maxItems: 1
-
-  power-domains:
-    description: A phandle and PM domain specifier as defined by bindings of
-      the power controller specified by phandle. See
-      Documentation/devicetree/bindings/power/power-domain.yaml for details.
-
-  clocks:
-    items:
-      - description: MUTEX Clock
-
-  mediatek,gce-events:
-    description:
-      The event id which is mapping to the specific hardware event signal
-      to gce. The event id is defined in the gce header
-      include/dt-bindings/gce/<chip>-gce.h of each chips.
-    $ref: /schemas/types.yaml#/definitions/uint32-array
-
-required:
-  - compatible
-  - reg
-  - interrupts
-  - power-domains
-  - clocks
-
-additionalProperties: false
-
-examples:
-  - |
-    #include <dt-bindings/interrupt-controller/arm-gic.h>
-    #include <dt-bindings/clock/mt8173-clk.h>
-    #include <dt-bindings/power/mt8173-power.h>
-    #include <dt-bindings/gce/mt8173-gce.h>
-
-    soc {
-        #address-cells = <2>;
-        #size-cells = <2>;
-
-        mutex: mutex@14020000 {
-            compatible = "mediatek,mt8173-disp-mutex";
-            reg = <0 0x14020000 0 0x1000>;
-            interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_LOW>;
-            power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
-            clocks = <&mmsys CLK_MM_MUTEX_32K>;
-            mediatek,gce-events = <CMDQ_EVENT_MUTEX0_STREAM_EOF>,
-                                  <CMDQ_EVENT_MUTEX1_STREAM_EOF>;
-        };
-    };
index 5e4e0e552c2f893af73df20590560123573cd24e..628c4b8981114fbc4372d484a6bf32e9820a561a 100644 (file)
@@ -21,6 +21,9 @@ properties:
   enable-gpios: true
   port: true
 
+  spi-cpha: true
+  spi-cpol: true
+
 required:
   - compatible
   - enable-gpios
index d525165d6d6314a15b2b5a08c564ecd95224a1eb..c0fabeb3862886c2c0ee362500a7d44cc8cdc2e2 100644 (file)
@@ -42,6 +42,9 @@ properties:
   panel-height-mm:
     description: physical panel height [mm]
 
+  spi-cpha: true
+  spi-cpol: true
+
 required:
   - compatible
   - reg
index 9e1d707c2ace18da7d26ae834740e56703405f49..d984b59daa4ad12f08403d2e7587b785d22878d4 100644 (file)
@@ -23,6 +23,9 @@ properties:
   backlight: true
   port: true
 
+  spi-cpha: true
+  spi-cpol: true
+
 required:
   - compatible
   - reg
index f902a9d741414baf52a1cfdaec0b46475242451a..e8c8ee8d7c8830ca920bd2069c3d40c5e4399c19 100644 (file)
@@ -28,6 +28,9 @@ properties:
   backlight: true
   port: true
 
+  spi-cpha: true
+  spi-cpol: true
+
 required:
   - compatible
   - port
index 948e2a38beed5f438343ecd40092511bbd03c53a..1c0388da6721ad24b741b25debaa67eafaddcc6c 100644 (file)
@@ -183,6 +183,12 @@ properties:
             required:
               - reg
 
+  protocol@18:
+    type: object
+    properties:
+      reg:
+        const: 0x18
+
 additionalProperties: false
 
 patternProperties:
@@ -323,6 +329,10 @@ examples:
                     };
                 };
             };
+
+            scmi_powercap: protocol@18 {
+                reg = <0x18>;
+            };
         };
     };
 
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 0f4e5ab2647791a9392a58ca184f453767175a50..b3f702cbed87872be3998fc0b3d43e8f4cfe7288 100644 (file)
@@ -23,10 +23,13 @@ Required properties:
  * "qcom,scm-msm8994"
  * "qcom,scm-msm8996"
  * "qcom,scm-msm8998"
+ * "qcom,scm-qcs404"
  * "qcom,scm-sc7180"
  * "qcom,scm-sc7280"
+ * "qcom,scm-sm6125"
  * "qcom,scm-sdm845"
  * "qcom,scm-sdx55"
+ * "qcom,scm-sdx65"
  * "qcom,scm-sm6350"
  * "qcom,scm-sm8150"
  * "qcom,scm-sm8250"
@@ -43,6 +46,7 @@ Required properties:
   clock and "bus" for the bus clock per the requirements of the compatible.
 - qcom,dload-mode: phandle to the TCSR hardware block and offset of the
                   download mode control register (optional)
+- interconnects: Specifies the bandwidth requirements of the SCM interface (optional)
 
 Example for MSM8916:
 
index 378da2649e668e1937cadf30db3d8cf0b037ed85..29c27eadbac8151225b551f2dff5da08799d0f28 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 b046578498524d882c932bdf92cca78175f196a1..e1719839faf03ed424737f0004299501773a61a3 100644 (file)
@@ -16,6 +16,7 @@ properties:
       - adi,adm1032
       - adi,adt7461
       - adi,adt7461a
+      - adi,adt7481
       - dallas,max6646
       - dallas,max6647
       - dallas,max6649
@@ -50,6 +51,12 @@ properties:
   "#thermal-sensor-cells":
     const: 1
 
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
   vcc-supply:
     description: phandle to the regulator that provides the +VCC supply
 
@@ -61,6 +68,29 @@ required:
   - compatible
   - reg
 
+patternProperties:
+  "^channel@([0-2])$":
+    type: object
+    description: Represents channels of the device and their specific configuration.
+
+    properties:
+      reg:
+        description: The channel number. 0 is local channel, 1-2 are remote channels.
+        items:
+          minimum: 0
+          maximum: 2
+
+      label:
+        description: A descriptive name for this channel, like "ambient" or "psu".
+
+      temperature-offset-millicelsius:
+        description: Temperature offset to be added to or subtracted from remote temperature measurements.
+
+    required:
+      - reg
+
+    additionalProperties: false
+
 allOf:
   - if:
       not:
@@ -70,12 +100,84 @@ allOf:
               enum:
                 - adi,adt7461
                 - adi,adt7461a
+                - adi,adt7481
                 - ti,tmp451
                 - ti,tmp461
     then:
       properties:
         ti,extended-range-enable: false
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - dallas,max6646
+              - dallas,max6647
+              - dallas,max6649
+              - dallas,max6657
+              - dallas,max6658
+              - dallas,max6659
+              - dallas,max6695
+              - dallas,max6696
+    then:
+      patternProperties:
+        "^channel@([0-2])$":
+          properties:
+            temperature-offset-millicelsius: false
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,adt7461
+              - adi,adt7461a
+              - adi,adt7481
+              - onnn,nct1008
+    then:
+      patternProperties:
+        "^channel@([0-2])$":
+          properties:
+            temperature-offset-millicelsius:
+              maximum: 127750
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - adi,adm1032
+              - dallas,max6680
+              - dallas,max6681
+              - gmt,g781
+              - national,lm86
+              - national,lm89
+              - national,lm90
+              - national,lm99
+              - nxp,sa56004
+              - winbond,w83l771
+    then:
+      patternProperties:
+        "^channel@([0-2])$":
+          properties:
+            temperature-offset-millicelsius:
+              maximum: 127875
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - ti,tmp451
+              - ti,tmp461
+    then:
+      patternProperties:
+        "^channel@([0-2])$":
+          properties:
+            temperature-offset-millicelsius:
+              maximum: 127937
+
 additionalProperties: false
 
 examples:
@@ -94,3 +196,32 @@ examples:
             #thermal-sensor-cells = <1>;
         };
     };
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      sensor@4c {
+        compatible = "adi,adt7481";
+        reg = <0x4c>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        channel@0 {
+          reg = <0x0>;
+          label = "local";
+        };
+
+        channel@1 {
+          reg = <0x1>;
+          label = "front";
+          temperature-offset-millicelsius = <4000>;
+        };
+
+        channel@2 {
+          reg = <0x2>;
+          label = "back";
+          temperature-offset-millicelsius = <750>;
+        };
+      };
+    };
index f771c09aabfccd20c55d8a32e8d90a8fd97f867a..0ec033e488304ab8d35cd0ea80473e01ad7dcbcb 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>;
+    };
diff --git a/Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml b/Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml
new file mode 100644 (file)
index 0000000..c2e697f
--- /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/interconnect/qcom,msm8998-bwmon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Interconnect Bandwidth Monitor
+
+maintainers:
+  - Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+
+description: |
+  Bandwidth Monitor measures current throughput on buses between various NoC
+  fabrics and provides information when it crosses configured thresholds.
+
+  Certain SoCs might have more than one Bandwidth Monitors, for example on SDM845::
+   - Measuring the bandwidth between CPUs and Last Level Cache Controller -
+     called just BWMON,
+   - Measuring the bandwidth between Last Level Cache Controller and memory
+     (DDR) - called LLCC BWMON.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - qcom,sdm845-bwmon
+          - const: qcom,msm8998-bwmon
+      - const: qcom,msm8998-bwmon       # BWMON v4
+
+  interconnects:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  operating-points-v2: true
+  opp-table: true
+
+  reg:
+    # BWMON v4 (currently described) and BWMON v5 use one register address
+    # space.  BWMON v2 uses two register spaces - not yet described.
+    maxItems: 1
+
+required:
+  - compatible
+  - interconnects
+  - interrupts
+  - operating-points-v2
+  - opp-table
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interconnect/qcom,sdm845.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pmu@1436400 {
+        compatible = "qcom,sdm845-bwmon", "qcom,msm8998-bwmon";
+        reg = <0x01436400 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";
+            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>;
+            };
+        };
+    };
diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-irqc.yaml b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-irqc.yaml
new file mode 100644 (file)
index 0000000..33b90e9
--- /dev/null
@@ -0,0 +1,134 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/renesas,rzg2l-irqc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/G2L (and alike SoC's) Interrupt Controller (IA55)
+
+maintainers:
+  - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
+  - Geert Uytterhoeven <geert+renesas@glider.be>
+
+description: |
+  IA55 performs various interrupt controls including synchronization for the external
+  interrupts of NMI, IRQ, and GPIOINT and the interrupts of the built-in peripheral
+  interrupts output by each IP. And it notifies the interrupt to the GIC
+    - IRQ sense select for 8 external interrupts, mapped to 8 GIC SPI interrupts
+    - GPIO pins used as external interrupt input pins, mapped to 32 GIC SPI interrupts
+    - NMI edge select (NMI is not treated as NMI exception and supports fall edge and
+      stand-up edge detection interrupts)
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r9a07g044-irqc    # RZ/G2{L,LC}
+          - renesas,r9a07g054-irqc    # RZ/V2L
+      - const: renesas,rzg2l-irqc
+
+  '#interrupt-cells':
+    description: The first cell should contain external interrupt number (IRQ0-7) and the
+                 second cell is used to specify the flag.
+    const: 2
+
+  '#address-cells':
+    const: 0
+
+  interrupt-controller: true
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 41
+
+  clocks:
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: clk
+      - const: pclk
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - '#interrupt-cells'
+  - '#address-cells'
+  - interrupt-controller
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+  - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/r9a07g044-cpg.h>
+
+    irqc: interrupt-controller@110a0000 {
+            compatible = "renesas,r9a07g044-irqc", "renesas,rzg2l-irqc";
+            reg = <0x110a0000 0x10000>;
+            #interrupt-cells = <2>;
+            #address-cells = <0>;
+            interrupt-controller;
+            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 444 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 445 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 446 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 447 IRQ_TYPE_LEVEL_HIGH>,
+                         <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 456 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 457 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 458 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 459 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 460 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 461 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 462 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 463 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 464 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 465 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 471 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>,
+                         <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>;
+            clocks = <&cpg CPG_MOD R9A07G044_IA55_CLK>,
+                     <&cpg CPG_MOD R9A07G044_IA55_PCLK>;
+            clock-names = "clk", "pclk";
+            power-domains = <&cpg>;
+            resets = <&cpg R9A07G044_IA55_RESETN>;
+    };
index 27092c6a86c491c08823c675fd3ce4fbe952da37..92e0f8c3eff2da6b8e69cbcdedc9dc3888468989 100644 (file)
@@ -26,9 +26,14 @@ description:
   with priority below this threshold will not cause the PLIC to raise its
   interrupt line leading to the context.
 
-  While the PLIC supports both edge-triggered and level-triggered interrupts,
-  interrupt handlers are oblivious to this distinction and therefore it is not
-  specified in the PLIC device-tree binding.
+  The PLIC supports both edge-triggered and level-triggered interrupts. For
+  edge-triggered interrupts, the RISC-V PLIC spec allows two responses to edges
+  seen while an interrupt handler is active; the PLIC may either queue them or
+  ignore them. In the first case, handlers are oblivious to the trigger type, so
+  it is not included in the interrupt specifier. In the second case, software
+  needs to know the trigger type, so it can reorder the interrupt flow to avoid
+  missing interrupts. This special handling is needed by at least the Renesas
+  RZ/Five SoC (AX45MP AndesCore with a NCEPLIC100) and the T-HEAD C900 PLIC.
 
   While the RISC-V ISA doesn't specify a memory layout for the PLIC, the
   "sifive,plic-1.0.0" device is a concrete implementation of the PLIC that
@@ -47,6 +52,10 @@ maintainers:
 properties:
   compatible:
     oneOf:
+      - items:
+          - enum:
+              - renesas,r9a07g043-plic
+          - const: andestech,nceplic100
       - items:
           - enum:
               - sifive,fu540-c000-plic
@@ -64,8 +73,7 @@ properties:
   '#address-cells':
     const: 0
 
-  '#interrupt-cells':
-    const: 1
+  '#interrupt-cells': true
 
   interrupt-controller: true
 
@@ -82,6 +90,12 @@ properties:
     description:
       Specifies how many external interrupts are supported by this controller.
 
+  clocks: true
+
+  power-domains: true
+
+  resets: true
+
 required:
   - compatible
   - '#address-cells'
@@ -91,6 +105,47 @@ required:
   - interrupts-extended
   - riscv,ndev
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - andestech,nceplic100
+              - thead,c900-plic
+
+    then:
+      properties:
+        '#interrupt-cells':
+          const: 2
+
+    else:
+      properties:
+        '#interrupt-cells':
+          const: 1
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a07g043-plic
+
+    then:
+      properties:
+        clocks:
+          maxItems: 1
+
+        power-domains:
+          maxItems: 1
+
+        resets:
+          maxItems: 1
+
+      required:
+        - clocks
+        - power-domains
+        - resets
+
 additionalProperties: false
 
 examples:
diff --git a/Documentation/devicetree/bindings/interrupt-controller/sunplus,sp7021-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/sunplus,sp7021-intc.yaml
new file mode 100644 (file)
index 0000000..bd0021d
--- /dev/null
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/sunplus,sp7021-intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus SP7021 SoC Interrupt Controller
+
+maintainers:
+  - Qin Jian <qinjian@cqplus1.com>
+
+properties:
+  compatible:
+    items:
+      - const: sunplus,sp7021-intc
+
+  reg:
+    maxItems: 2
+    description:
+      Specifies base physical address(s) and size of the controller regs.
+      The 1st region include type/polarity/priority/mask regs.
+      The 2nd region include clear/masked_ext0/masked_ext1/group regs.
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+    description:
+      The first cell is the IRQ number, the second cell is the trigger
+      type as defined in interrupt.txt in this directory.
+
+  interrupts:
+    maxItems: 2
+    description:
+      EXT_INT0 & EXT_INT1, 2 interrupts references to primary interrupt
+      controller.
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    intc: interrupt-controller@9c000780 {
+        compatible = "sunplus,sp7021-intc";
+        reg = <0x9c000780 0x80>, <0x9c000a80 0x80>;
+        interrupt-controller;
+        #interrupt-cells = <2>;
+        interrupt-parent = <&gic>;
+        interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, /* EXT_INT0 */
+                     <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; /* EXT_INT1 */
+    };
+
+...
index a98b359bf9095ea29ee49621bbab052174ea467b..71bc5cefb49cf8742cc35cafe5ca22ab21047b44 100644 (file)
@@ -32,6 +32,7 @@ properties:
           - mediatek,mt2701-smi-common
           - mediatek,mt2712-smi-common
           - mediatek,mt6779-smi-common
+          - mediatek,mt6795-smi-common
           - mediatek,mt8167-smi-common
           - mediatek,mt8173-smi-common
           - mediatek,mt8183-smi-common
index c886681f62a7c81873ee13fc0f51ffb1c6a6b26c..59dcd163668f39edec220108954fec781fe15976 100644 (file)
@@ -20,6 +20,7 @@ properties:
           - mediatek,mt2701-smi-larb
           - mediatek,mt2712-smi-larb
           - mediatek,mt6779-smi-larb
+          - mediatek,mt6795-smi-larb
           - mediatek,mt8167-smi-larb
           - mediatek,mt8173-smi-larb
           - mediatek,mt8183-smi-larb
index 6a4831fd3616cdba526d92b220b87f4d12fe8ab7..55fc620c72cd9dcfb192afae017ff4e92ecc613b 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:
index 4f15463611f8bbc68f5642d4341b7265548693a3..170cd201adc2e0d7cdf64a215453c453aa916e82 100644 (file)
@@ -167,70 +167,65 @@ properties:
       - in-band-status
 
   fixed-link:
-    allOf:
-      - if:
-          type: array
-        then:
-          deprecated: true
-          items:
-            - minimum: 0
-              maximum: 31
-              description:
-                Emulated PHY ID, choose any but unique to the all
-                specified fixed-links
-
-            - enum: [0, 1]
-              description:
-                Duplex configuration. 0 for half duplex or 1 for
-                full duplex
-
-            - enum: [10, 100, 1000, 2500, 10000]
-              description:
-                Link speed in Mbits/sec.
-
-            - enum: [0, 1]
-              description:
-                Pause configuration. 0 for no pause, 1 for pause
-
-            - enum: [0, 1]
-              description:
-                Asymmetric pause configuration. 0 for no asymmetric
-                pause, 1 for asymmetric pause
-
-
-      - if:
-          type: object
-        then:
-          properties:
-            speed:
-              description:
-                Link speed.
-              $ref: /schemas/types.yaml#/definitions/uint32
-              enum: [10, 100, 1000, 2500, 10000]
-
-            full-duplex:
-              $ref: /schemas/types.yaml#/definitions/flag
-              description:
-                Indicates that full-duplex is used. When absent, half
-                duplex is assumed.
-
-            pause:
-              $ref: /schemas/types.yaml#definitions/flag
-              description:
-                Indicates that pause should be enabled.
-
-            asym-pause:
-              $ref: /schemas/types.yaml#/definitions/flag
-              description:
-                Indicates that asym_pause should be enabled.
-
-            link-gpios:
-              maxItems: 1
-              description:
-                GPIO to determine if the link is up
-
-          required:
-            - speed
+    oneOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32-array
+        deprecated: true
+        items:
+          - minimum: 0
+            maximum: 31
+            description:
+              Emulated PHY ID, choose any but unique to the all
+              specified fixed-links
+
+          - enum: [0, 1]
+            description:
+              Duplex configuration. 0 for half duplex or 1 for
+              full duplex
+
+          - enum: [10, 100, 1000, 2500, 10000]
+            description:
+              Link speed in Mbits/sec.
+
+          - enum: [0, 1]
+            description:
+              Pause configuration. 0 for no pause, 1 for pause
+
+          - enum: [0, 1]
+            description:
+              Asymmetric pause configuration. 0 for no asymmetric
+              pause, 1 for asymmetric pause
+      - type: object
+        additionalProperties: false
+        properties:
+          speed:
+            description:
+              Link speed.
+            $ref: /schemas/types.yaml#/definitions/uint32
+            enum: [10, 100, 1000, 2500, 10000]
+
+          full-duplex:
+            $ref: /schemas/types.yaml#/definitions/flag
+            description:
+              Indicates that full-duplex is used. When absent, half
+              duplex is assumed.
+
+          pause:
+            $ref: /schemas/types.yaml#definitions/flag
+            description:
+              Indicates that pause should be enabled.
+
+          asym-pause:
+            $ref: /schemas/types.yaml#/definitions/flag
+            description:
+              Indicates that asym_pause should be enabled.
+
+          link-gpios:
+            maxItems: 1
+            description:
+              GPIO to determine if the link is up
+
+        required:
+          - speed
 
 additionalProperties: true
 
index daa2f79a294f534846243d80878566346e0401e5..1b1853062cd3f0ddde040b91154c5e2e5f532606 100644 (file)
@@ -183,6 +183,7 @@ properties:
       Should specify the gpio for phy reset.
 
   phy-reset-duration:
+    $ref: /schemas/types.yaml#/definitions/uint32
     deprecated: true
     description:
       Reset duration in milliseconds.  Should present only if property
@@ -191,12 +192,14 @@ properties:
       and 1 millisecond will be used instead.
 
   phy-reset-active-high:
+    type: boolean
     deprecated: true
     description:
       If present then the reset sequence using the GPIO specified in the
       "phy-reset-gpios" property is reversed (H=reset state, L=operation state).
 
   phy-reset-post-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
     deprecated: true
     description:
       Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay
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>;
+      };
+    };
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 bfce850c2035196f57c8e528dd2518c726a7dc5e..0681b9a3965f0632d990fb52c96e0ab0cbf9ab8b 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 52df1b1461745f97e67f8765a4b346e7b5c4a64c..997b746391120551f1e060b966aa27afc07ee59b 100644 (file)
@@ -47,6 +47,17 @@ properties:
   gpio-ranges:
     maxItems: 1
 
+  interrupt-controller: true
+
+  '#interrupt-cells':
+    const: 2
+    description:
+      The first cell contains the global GPIO port index, constructed using the
+      RZG2L_GPIO() helper macro in <dt-bindings/pinctrl/rzg2l-pinctrl.h> and the
+      second cell is used to specify the flag.
+      E.g. "interrupts = <RZG2L_GPIO(43, 0) IRQ_TYPE_EDGE_FALLING>;" if P43_0 is
+      being used as an interrupt.
+
   clocks:
     maxItems: 1
 
@@ -110,6 +121,8 @@ required:
   - gpio-controller
   - '#gpio-cells'
   - gpio-ranges
+  - interrupt-controller
+  - '#interrupt-cells'
   - clocks
   - power-domains
   - resets
@@ -126,6 +139,8 @@ examples:
             gpio-controller;
             #gpio-cells = <2>;
             gpio-ranges = <&pinctrl 0 0 392>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
             clocks = <&cpg CPG_MOD R9A07G044_GPIO_HCLK>;
             resets = <&cpg R9A07G044_GPIO_RSTN>,
                      <&cpg R9A07G044_GPIO_PORT_RESETN>,
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 135c6f7220914286760e764e66e66ece402cdd84..b448101fac43e28ac50811dc8975525c0f1caf44 100644 (file)
@@ -23,6 +23,7 @@ properties:
 
   compatible:
     enum:
+      - mediatek,mt6795-power-controller
       - mediatek,mt8167-power-controller
       - mediatek,mt8173-power-controller
       - mediatek,mt8183-power-controller
@@ -62,6 +63,7 @@ patternProperties:
       reg:
         description: |
           Power domain index. Valid values are defined in:
+              "include/dt-bindings/power/mt6795-power.h" - for MT8167 type power domain.
               "include/dt-bindings/power/mt8167-power.h" - for MT8167 type power domain.
               "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain.
               "include/dt-bindings/power/mt8183-power.h" - for MT8183 type power domain.
index ad77a6380f38b50e13519c85184fa4ea21002ff9..0ccca493251acf1bacc1bebe63b0688580fec389 100644 (file)
@@ -18,6 +18,7 @@ properties:
     enum:
       - qcom,mdm9607-rpmpd
       - qcom,msm8226-rpmpd
+      - qcom,msm8909-rpmpd
       - qcom,msm8916-rpmpd
       - qcom,msm8939-rpmpd
       - qcom,msm8953-rpmpd
diff --git a/Documentation/devicetree/bindings/pwm/clk-pwm.yaml b/Documentation/devicetree/bindings/pwm/clk-pwm.yaml
new file mode 100644 (file)
index 0000000..ec17682
--- /dev/null
@@ -0,0 +1,46 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/clk-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Clock based PWM controller
+
+maintainers:
+  - Nikita Travkin <nikita@trvn.ru>
+
+description: |
+  Some systems have clocks that can be exposed to external devices.
+  (e.g. by muxing them to GPIO pins)
+  It's often possible to control duty-cycle of such clocks which makes them
+  suitable for generating PWM signal.
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: clk-pwm
+
+  clocks:
+    description: Clock used to generate the signal.
+    maxItems: 1
+
+  "#pwm-cells":
+    const: 2
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - clocks
+
+examples:
+  - |
+    pwm {
+      compatible = "clk-pwm";
+      #pwm-cells = <2>;
+      clocks = <&gcc 0>;
+      pinctrl-names = "default";
+      pinctrl-0 = <&pwm_clk_flash_default>;
+    };
index 033d1fc0f405618ccb5d585e0816bf2f8857b750..554c96b6d0c3e006cae943d41ad62228a66be372 100644 (file)
@@ -9,6 +9,8 @@ Required properties:
    - "mediatek,mt7628-pwm": found on mt7628 SoC.
    - "mediatek,mt7629-pwm": found on mt7629 SoC.
    - "mediatek,mt8183-pwm": found on mt8183 SoC.
+   - "mediatek,mt8195-pwm", "mediatek,mt8183-pwm": found on mt8195 SoC.
+   - "mediatek,mt8365-pwm": found on mt8365 SoC.
    - "mediatek,mt8516-pwm": found on mt8516 SoC.
  - reg: physical base address and length of the controller's registers.
  - #pwm-cells: must be 2. See pwm.yaml in this directory for a description of
@@ -18,6 +20,7 @@ Required properties:
                 has no clocks
    - "top": the top clock generator
    - "main": clock used by the PWM core
+   - "pwm1-3": the three per PWM clocks for mt8365
    - "pwm1-8": the eight per PWM clocks for mt2712
    - "pwm1-6": the six per PWM clocks for mt7622
    - "pwm1-5": the five per PWM clocks for mt7623
index 90727fdc1283330acb8e59195a9ef399895df41b..7023c597c3ed53ff850b1369fa37f2415d3c1b74 100644 (file)
@@ -15,6 +15,7 @@ properties:
   compatible:
     enum:
       - mps,mp5416
+      - mps,mp5496
 
   reg:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/regulator/pwm-regulator.txt b/Documentation/devicetree/bindings/regulator/pwm-regulator.txt
deleted file mode 100644 (file)
index 3d78d50..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-Bindings for the Generic PWM Regulator
-======================================
-
-Currently supports 2 modes of operation:
-
-Voltage Table:         When in this mode, a voltage table (See below) of
-                       predefined voltage <=> duty-cycle values must be
-                       provided via DT. Limitations are that the regulator can
-                       only operate at the voltages supplied in the table.
-                       Intermediary duty-cycle values which would normally
-                       allow finer grained voltage selection are ignored and
-                       rendered useless.  Although more control is given to
-                       the user if the assumptions made in continuous-voltage
-                       mode do not reign true.
-
-Continuous Voltage:    This mode uses the regulator's maximum and minimum
-                       supplied voltages specified in the
-                       regulator-{min,max}-microvolt properties to calculate
-                       appropriate duty-cycle values.  This allows for a much
-                       more fine grained solution when compared with
-                       voltage-table mode above.  This solution does make an
-                       assumption that a %50 duty-cycle value will cause the
-                       regulator voltage to run at half way between the
-                       supplied max_uV and min_uV values.
-
-Required properties:
---------------------
-- compatible:          Should be "pwm-regulator"
-
-- pwms:                        PWM specification (See: ../pwm/pwm.txt)
-
-Only required for Voltage Table Mode:
-- voltage-table:       Voltage and Duty-Cycle table consisting of 2 cells
-                           First cell is voltage in microvolts (uV)
-                           Second cell is duty-cycle in percent (%)
-
-Optional properties for Continuous mode:
-- pwm-dutycycle-unit:  Integer value encoding the duty cycle unit. If not
-                       defined, <100> is assumed, meaning that
-                       pwm-dutycycle-range contains values expressed in
-                       percent.
-
-- pwm-dutycycle-range: Should contain 2 entries. The first entry is encoding
-                       the dutycycle for regulator-min-microvolt and the
-                       second one the dutycycle for regulator-max-microvolt.
-                       Duty cycle values are expressed in pwm-dutycycle-unit.
-                       If not defined, <0 100> is assumed.
-
-NB: To be clear, if voltage-table is provided, then the device will be used
-in Voltage Table Mode.  If no voltage-table is provided, then the device will
-be used in Continuous Voltage Mode.
-
-Optional properties:
---------------------
-- enable-gpios:                GPIO to use to enable/disable the regulator
-
-Any property defined as part of the core regulator binding can also be used.
-(See: ../regulator/regulator.txt)
-
-Continuous Voltage With Enable GPIO Example:
-       pwm_regulator {
-               compatible = "pwm-regulator";
-               pwms = <&pwm1 0 8448 0>;
-               enable-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
-               regulator-min-microvolt = <1016000>;
-               regulator-max-microvolt = <1114000>;
-               regulator-name = "vdd_logic";
-               /* unit == per-mille */
-               pwm-dutycycle-unit = <1000>;
-               /*
-                * Inverted PWM logic, and the duty cycle range is limited
-                * to 30%-70%.
-                */
-               pwm-dutycycle-range = <700 300>; /* */
-       };
-
-Voltage Table Example:
-       pwm_regulator {
-               compatible = "pwm-regulator";
-               pwms = <&pwm1 0 8448 0>;
-               regulator-min-microvolt = <1016000>;
-               regulator-max-microvolt = <1114000>;
-               regulator-name = "vdd_logic";
-
-                             /* Voltage Duty-Cycle */
-               voltage-table = <1114000 0>,
-                               <1095000 10>,
-                               <1076000 20>,
-                               <1056000 30>,
-                               <1036000 40>,
-                               <1016000 50>;
-       };
diff --git a/Documentation/devicetree/bindings/regulator/pwm-regulator.yaml b/Documentation/devicetree/bindings/regulator/pwm-regulator.yaml
new file mode 100644 (file)
index 0000000..82b6f2f
--- /dev/null
@@ -0,0 +1,126 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/pwm-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bindings for the Generic PWM Regulator
+
+maintainers:
+  - Brian Norris <briannorris@chromium.org>
+  - Lee Jones <lee@kernel.org>
+  - Alexandre Courbot <acourbot@nvidia.com>
+
+description: |
+  Currently supports 2 modes of operation:
+
+  Voltage Table:
+    When in this mode, a voltage table (See below) of predefined voltage <=>
+    duty-cycle values must be provided via DT. Limitations are that the
+    regulator can only operate at the voltages supplied in the table.
+    Intermediary duty-cycle values which would normally allow finer grained
+    voltage selection are ignored and rendered useless.  Although more control
+    is given to the user if the assumptions made in continuous-voltage mode do
+    not reign true.
+
+  Continuous Voltage:
+    This mode uses the regulator's maximum and minimum supplied voltages
+    specified in the regulator-{min,max}-microvolt properties to calculate
+    appropriate duty-cycle values.  This allows for a much more fine grained
+    solution when compared with voltage-table mode above.  This solution does
+    make an assumption that a %50 duty-cycle value will cause the regulator
+    voltage to run at half way between the supplied max_uV and min_uV values.
+
+  If voltage-table is provided, then the device will be used in Voltage Table
+  Mode.  If no voltage-table is provided, then the device will be used in
+  Continuous Voltage Mode.
+
+allOf:
+  - $ref: regulator.yaml#
+
+properties:
+  compatible:
+    const: pwm-regulator
+
+  pwms:
+    maxItems: 1
+
+  voltage-table:
+    description: Voltage and Duty-Cycle table.
+    $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    items:
+      items:
+        - description: voltage in microvolts (uV)
+        - description: duty-cycle in percent (%)
+
+  enable-gpios:
+    description: Regulator enable GPIO
+    maxItems: 1
+
+   # Optional properties for Continuous mode:
+  pwm-dutycycle-unit:
+    description:
+      Integer value encoding the duty cycle unit. If not
+        defined, <100> is assumed, meaning that
+        pwm-dutycycle-range contains values expressed in
+        percent.
+    default: 100
+
+  pwm-dutycycle-range:
+    description:
+      Should contain 2 entries. The first entry is encoding
+        the dutycycle for regulator-min-microvolt and the
+        second one the dutycycle for regulator-max-microvolt.
+        Duty cycle values are expressed in pwm-dutycycle-unit.
+        If not defined, <0 100> is assumed.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    items:
+      - description: the dutycycle for regulator-min-microvolt
+      - description: the dutycycle for regulator-max-microvolt
+    default: [ 0 100 ]
+
+required:
+  - compatible
+  - pwms
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    // Continuous Voltage With Enable GPIO Example:
+    regulator {
+        compatible = "pwm-regulator";
+        pwms = <&pwm1 0 8448 0>;
+        enable-gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
+        regulator-min-microvolt = <1016000>;
+        regulator-max-microvolt = <1114000>;
+        regulator-name = "vdd_logic";
+        /* unit == per-mille */
+        pwm-dutycycle-unit = <1000>;
+        /*
+        * Inverted PWM logic, and the duty cycle range is limited
+        * to 30%-70%.
+        */
+        pwm-dutycycle-range = <700 300>; /* */
+    };
+
+  - |
+    // Voltage Table Example:
+    regulator {
+        compatible = "pwm-regulator";
+        pwms = <&pwm1 0 8448 0>;
+        regulator-min-microvolt = <1016000>;
+        regulator-max-microvolt = <1114000>;
+        regulator-name = "vdd_logic";
+
+                /* Voltage Duty-Cycle */
+        voltage-table = <1114000 0>,
+            <1095000 10>,
+            <1076000 20>,
+            <1056000 30>,
+            <1036000 40>,
+            <1016000 50>;
+    };
+...
index 6a9a7eed466f453725a1e3b370d2cc79636295e1..c233461cc980d37e65ae9943172d6693b9eeb8d3 100644 (file)
@@ -30,6 +30,9 @@ description:
 
   For pm8841, s1, s2, s3, s4, s5, s6, s7, s8
 
+  For pm8909, s1, s2, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
+  l14, l15, l17, l18
+
   For pm8916, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
   l12, l13, l14, l15, l16, l17, l18
 
@@ -78,6 +81,7 @@ properties:
       - qcom,rpm-mp5496-regulators
       - qcom,rpm-pm8226-regulators
       - qcom,rpm-pm8841-regulators
+      - qcom,rpm-pm8909-regulators
       - qcom,rpm-pm8916-regulators
       - qcom,rpm-pm8941-regulators
       - qcom,rpm-pm8950-regulators
diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.txt
deleted file mode 100644 (file)
index c2a39b1..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-Qualcomm SPMI Regulators
-
-- compatible:
-       Usage: required
-       Value type: <string>
-       Definition: must be one of:
-                       "qcom,pm8004-regulators"
-                       "qcom,pm8005-regulators"
-                       "qcom,pm8226-regulators"
-                       "qcom,pm8841-regulators"
-                       "qcom,pm8916-regulators"
-                       "qcom,pm8941-regulators"
-                       "qcom,pm8950-regulators"
-                       "qcom,pm8994-regulators"
-                       "qcom,pmi8994-regulators"
-                       "qcom,pm660-regulators"
-                       "qcom,pm660l-regulators"
-                       "qcom,pms405-regulators"
-
-- interrupts:
-       Usage: optional
-       Value type: <prop-encoded-array>
-       Definition: List of OCP interrupts.
-
-- interrupt-names:
-       Usage: required if 'interrupts' property present
-       Value type: <string-array>
-       Definition: List of strings defining the names of the
-                   interrupts in the 'interrupts' property 1-to-1.
-                   Supported values are "ocp-<regulator_name>", where
-                   <regulator_name> corresponds to a voltage switch
-                   type regulator.
-
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s4-supply:
-- vdd_s5-supply:
-- vdd_s6-supply:
-- vdd_s7-supply:
-- vdd_s8-supply:
-       Usage: optional (pm8841 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s4-supply:
-- vdd_l1_l3-supply:
-- vdd_l2-supply:
-- vdd_l4_l5_l6-supply:
-- vdd_l7-supply:
-- vdd_l8_l11_l14_l15_l16-supply:
-- vdd_l9_l10_l12_l13_l17_l18-supply:
-       Usage: optional (pm8916 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_l1_l3-supply:
-- vdd_l2_lvs_1_2_3-supply:
-- vdd_l4_l11-supply:
-- vdd_l5_l7-supply:
-- vdd_l6_l12_l14_l15-supply:
-- vdd_l8_l16_l18_19-supply:
-- vdd_l9_l10_l17_l22-supply:
-- vdd_l13_l20_l23_l24-supply:
-- vdd_l21-supply:
-- vin_5vs-supply:
-       Usage: optional (pm8941 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s4-supply:
-- vdd_s4-supply:
-- vdd_s5-supply:
-- vdd_s6-supply:
-- vdd_l1_l19-supply:
-- vdd_l2_l23-supply:
-- vdd_l3-supply:
-- vdd_l4_l5_l6_l7_l16-supply:
-- vdd_l8_l11_l12_l17_l22-supply:
-- vdd_l9_l10_l13_l14_l15_l18-supply:
-- vdd_l20-supply:
-- vdd_l21-supply:
-       Usage: optional (pm8950 only)
-       Value type: <phandle>
-       Definition: reference to regulator supplying the input pin, as
-                   described in the data sheet
-
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s4-supply:
-- vdd_s5-supply:
-- vdd_s6-supply:
-- vdd_s7-supply:
-- vdd_s8-supply:
-- vdd_s9-supply:
-- vdd_s10-supply:
-- vdd_s11-supply:
-- vdd_s12-supply:
-- vdd_l1-supply:
-- vdd_l2_l26_l28-supply:
-- vdd_l3_l11-supply:
-- vdd_l4_l27_l31-supply:
-- vdd_l5_l7-supply:
-- vdd_l6_l12_l32-supply:
-- vdd_l8_l16_l30-supply:
-- vdd_l9_l10_l18_l22-supply:
-- vdd_l13_l19_l23_l24-supply:
-- vdd_l14_l15-supply:
-- vdd_l17_l29-supply:
-- vdd_l20_l21-supply:
-- vdd_l25-supply:
-- vdd_lvs_1_2-supply:
-       Usage: optional (pm8994 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_l1-supply:
-       Usage: optional (pmi8994 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_l1_l6_l7-supply:
-- vdd_l2_l3-supply:
-- vdd_l5-supply:
-- vdd_l8_l9_l10_l11_l12_l13_l14-supply:
-- vdd_l15_l16_l17_l18_l19-supply:
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s5-supply:
-- vdd_s6-supply:
-       Usage: optional (pm660 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_l1_l9_l10-supply:
-- vdd_l2-supply:
-- vdd_l3_l5_l7_l8-supply:
-- vdd_l4_l6-supply:
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s4-supply:
-- vdd_s5-supply:
-       Usage: optional (pm660l only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- vdd_l1_l2-supply:
-- vdd_l3_l8-supply:
-- vdd_l4-supply:
-- vdd_l5_l6-supply:
-- vdd_l10_l11_l12_l13-supply:
-- vdd_l7-supply:
-- vdd_l9-supply:
-- vdd_s1-supply:
-- vdd_s2-supply:
-- vdd_s3-supply:
-- vdd_s4-supply:
-- vdd_s5-supply
-       Usage: optional (pms405 only)
-       Value type: <phandle>
-       Definition: Reference to regulator supplying the input pin, as
-                   described in the data sheet.
-
-- qcom,saw-reg:
-       Usage: optional
-       Value type: <phandle>
-       Description: Reference to syscon node defining the SAW registers.
-
-
-The regulator node houses sub-nodes for each regulator within the device. Each
-sub-node is identified using the node's name, with valid values listed for each
-of the PMICs below.
-
-pm8004:
-       s2, s5
-
-pm8005:
-       s1, s2, s3, s4
-
-pm8841:
-       s1, s2, s3, s4, s5, s6, s7, s8
-
-pm8916:
-       s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
-       l14, l15, l16, l17, l18
-
-pm8941:
-       s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
-       l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
-       5vs1, 5vs2
-
-pm8994:
-       s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5,
-       l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
-       l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, lvs1, lvs2
-
-pmi8994:
-       s1, s2, s3, l1
-
-The content of each sub-node is defined by the standard binding for regulators -
-see regulator.txt - with additional custom properties described below:
-
-- regulator-initial-mode:
-       Usage: optional
-       Value type: <u32>
-       Description: 2 = Set initial mode to auto mode (automatically select
-                   between HPM and LPM); not available on boost type
-                   regulators.
-
-                   1 = Set initial mode to high power mode (HPM), also referred
-                   to as NPM. HPM consumes more ground current than LPM, but
-                   it can source significantly higher load current. HPM is not
-                   available on boost type regulators. For voltage switch type
-                   regulators, HPM implies that over current protection and
-                   soft start are active all the time.
-
-                   0 = Set initial mode to low power mode (LPM).
-
-- qcom,ocp-max-retries:
-       Usage: optional
-       Value type: <u32>
-       Description: Maximum number of times to try toggling a voltage switch
-                    off and back on as a result of consecutive over current
-                    events.
-
-- qcom,ocp-retry-delay:
-       Usage: optional
-       Value type: <u32>
-       Description: Time to delay in milliseconds between each voltage switch
-                    toggle after an over current event takes place.
-
-- qcom,pin-ctrl-enable:
-       Usage: optional
-       Value type: <u32>
-       Description: Bit mask specifying which hardware pins should be used to
-                    enable the regulator, if any; supported bits are:
-                       0 = ignore all hardware enable signals
-                       BIT(0) = follow HW0_EN signal
-                       BIT(1) = follow HW1_EN signal
-                       BIT(2) = follow HW2_EN signal
-                       BIT(3) = follow HW3_EN signal
-
-- qcom,pin-ctrl-hpm:
-       Usage: optional
-       Value type: <u32>
-       Description: Bit mask specifying which hardware pins should be used to
-                    force the regulator into high power mode, if any;
-                    supported bits are:
-                       0 = ignore all hardware enable signals
-                       BIT(0) = follow HW0_EN signal
-                       BIT(1) = follow HW1_EN signal
-                       BIT(2) = follow HW2_EN signal
-                       BIT(3) = follow HW3_EN signal
-                       BIT(4) = follow PMIC awake state
-
-- qcom,vs-soft-start-strength:
-       Usage: optional
-       Value type: <u32>
-       Description: This property sets the soft start strength for voltage
-                    switch type regulators; supported values are:
-                       0 = 0.05 uA
-                       1 = 0.25 uA
-                       2 = 0.55 uA
-                       3 = 0.75 uA
-
-- qcom,saw-slave:
-       Usage: optional
-       Value type: <boo>
-       Description: SAW controlled gang slave. Will not be configured.
-
-- qcom,saw-leader:
-       Usage: optional
-       Value type: <boo>
-       Description: SAW controlled gang leader. Will be configured as
-                    SAW regulator.
-
-Example:
-
-       regulators {
-               compatible = "qcom,pm8941-regulators";
-               vdd_l1_l3-supply = <&s1>;
-
-               s1: s1 {
-                       regulator-min-microvolt = <1300000>;
-                       regulator-max-microvolt = <1400000>;
-               };
-
-               ...
-
-               l1: l1 {
-                       regulator-min-microvolt = <1225000>;
-                       regulator-max-microvolt = <1300000>;
-               };
-
-               ....
-       };
-
-Example 2:
-
-       saw3: syscon@9A10000 {
-               compatible = "syscon";
-               reg = <0x9A10000 0x1000>;
-       };
-
-       ...
-
-       spm-regulators {
-               compatible = "qcom,pm8994-regulators";
-               qcom,saw-reg = <&saw3>;
-               s8 {
-                       qcom,saw-slave;
-               };
-               s9 {
-                       qcom,saw-slave;
-               };
-               s10 {
-                       qcom,saw-slave;
-               };
-               pm8994_s11_saw: s11 {
-                       qcom,saw-leader;
-                       regulator-always-on;
-                       regulator-min-microvolt = <900000>;
-                       regulator-max-microvolt = <1140000>;
-               };
-       };
diff --git a/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml b/Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml
new file mode 100644 (file)
index 0000000..8b7c4af
--- /dev/null
@@ -0,0 +1,323 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/qcom,spmi-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm SPMI Regulators
+
+maintainers:
+  - Robert Marko <robimarko@gmail.com>
+
+properties:
+  compatible:
+    enum:
+      - qcom,pm660-regulators
+      - qcom,pm660l-regulators
+      - qcom,pm8004-regulators
+      - qcom,pm8005-regulators
+      - qcom,pm8226-regulators
+      - qcom,pm8841-regulators
+      - qcom,pm8916-regulators
+      - qcom,pm8941-regulators
+      - qcom,pm8950-regulators
+      - qcom,pm8994-regulators
+      - qcom,pmi8994-regulators
+      - qcom,pmp8074-regulators
+      - qcom,pms405-regulators
+
+  qcom,saw-reg:
+    description: Reference to syscon node defining the SAW registers
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+patternProperties:
+  "^(5vs[1-2]|(l|s)[1-9][0-9]?|lvs[1-3])$":
+    description: List of regulators and its properties
+    type: object
+    $ref: regulator.yaml#
+
+    properties:
+      qcom,ocp-max-retries:
+        description:
+          Maximum number of times to try toggling a voltage switch off and
+          back on as a result of consecutive over current events
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+      qcom,ocp-retry-delay:
+        description:
+          Time to delay in milliseconds between each voltage switch toggle
+          after an over current event takes place
+        $ref: /schemas/types.yaml#/definitions/uint32
+
+      qcom,pin-ctrl-enable:
+        description:
+          Bit mask specifying which hardware pins should be used to enable the
+          regulator, if any.
+          Supported bits are
+          0 = ignore all hardware enable signals
+          BIT(0) = follow HW0_EN signal
+          BIT(1) = follow HW1_EN signal
+          BIT(2) = follow HW2_EN signal
+          BIT(3) = follow HW3_EN signal
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 15
+
+      qcom,pin-ctrl-hpm:
+        description:
+          Bit mask specifying which hardware pins should be used to force the
+          regulator into high power mode, if any.
+          Supported bits are
+          0 = ignore all hardware enable signals
+          BIT(0) = follow HW0_EN signal
+          BIT(1) = follow HW1_EN signal
+          BIT(2) = follow HW2_EN signal
+          BIT(3) = follow HW3_EN signal
+          BIT(4) = follow PMIC awake state
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 31
+
+      qcom,vs-soft-start-strength:
+        description:
+          This property sets the soft start strength for voltage switch type
+          regulators.
+          Supported values are
+          0 = 0.05 uA
+          1 = 0.25 uA
+          2 = 0.55 uA
+          3 = 0.75 uA
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 3
+
+      qcom,saw-slave:
+        description: SAW controlled gang slave. Will not be configured.
+        type: boolean
+
+      qcom,saw-leader:
+        description:
+          SAW controlled gang leader. Will be configured as SAW regulator.
+        type: boolean
+
+      unevaluatedProperties: false
+
+required:
+  - compatible
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm660-regulators
+    then:
+      properties:
+        vdd_l15_l16_l17_l18_l19-supply: true
+        vdd_l1_l6_l7-supply: true
+        vdd_l2_l3-supply: true
+        vdd_l5-supply: true
+        vdd_l8_l9_l10_l11_l12_l13_l14-supply: true
+      patternProperties:
+        "^vdd_s[1-6]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm660l-regulators
+    then:
+      properties:
+        vdd_l1_l9_l10-supply: true
+        vdd_l2-supply: true
+        vdd_l3_l5_l7_l8-supply: true
+        vdd_l4_l6-supply: true
+      patternProperties:
+        "^vdd_s[1-5]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8004-regulators
+    then:
+      patternProperties:
+        "^vdd_s[25]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8005-regulators
+    then:
+      patternProperties:
+        "^vdd_s[1-4]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8226-regulators
+    then:
+      properties:
+        vdd_l10_l11_l13-supply: true
+        vdd_l12_l14-supply: true
+        vdd_l15_l16_l17_l18-supply: true
+        vdd_l19_l20_l21_l22_l23_l28-supply: true
+        vdd_l1_l2_l4_l5-supply: true
+        vdd_l25-supply: true
+        vdd_l3_l24_l26-supply: true
+        vdd_l6_l7_l8_l9_l27-supply: true
+        vdd_lvs1-supply: true
+      patternProperties:
+        "^vdd_s[1-5]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8841-regulators
+    then:
+      patternProperties:
+        "^vdd_s[1-8]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8916-regulators
+    then:
+      properties:
+        vdd_l1_l3-supply: true
+        vdd_l4_l5_l6-supply: true
+        vdd_l8_l11_l14_l15_l16-supply: true
+        vdd_l9_l10_l12_l13_l17_l18-supply: true
+      patternProperties:
+        "^vdd_l[27]-supply$": true
+        "^vdd_s[1-4]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8941-regulators
+    then:
+      properties:
+        interrupts:
+          items:
+            - description: Over-current protection interrupt for 5V S1
+            - description: Over-current protection interrupt for 5V S2
+        interrupt-names:
+          items:
+            - const: ocp-5vs1
+            - const: ocp-5vs2
+        vdd_l13_l20_l23_l24-supply: true
+        vdd_l1_l3-supply: true
+        vdd_l21-supply: true
+        vdd_l2_lvs_1_2_3-supply: true
+        vdd_l4_l11-supply: true
+        vdd_l5_l7-supply: true
+        vdd_l6_l12_l14_l15-supply: true
+        vdd_l8_l16_l18_19-supply: true
+        vdd_l9_l10_l17_l22-supply: true
+        vin_5vs-supply: true
+      patternProperties:
+        "^vdd_s[1-3]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8950-regulators
+    then:
+      properties:
+        vdd_l1_l19-supply: true
+        vdd_l20-supply: true
+        vdd_l21-supply: true
+        vdd_l2_l23-supply: true
+        vdd_l3-supply: true
+        vdd_l4_l5_l6_l7_l16-supply: true
+        vdd_l8_l11_l12_l17_l22-supply: true
+        vdd_l9_l10_l13_l14_l15_l18-supply: true
+      patternProperties:
+        "^vdd_s[1-6]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pm8994-regulators
+    then:
+      properties:
+        vdd_l1-supply: true
+        vdd_l13_l19_l23_l24-supply: true
+        vdd_l14_l15-supply: true
+        vdd_l17_l29-supply: true
+        vdd_l20_l21-supply: true
+        vdd_l25-supply: true
+        vdd_l2_l26_l28-supply: true
+        vdd_l3_l11-supply: true
+        vdd_l4_l27_l31-supply: true
+        vdd_l5_l7-supply: true
+        vdd_l6_l12_l32-supply: true
+        vdd_l8_l16_l30-supply: true
+        vdd_l9_l10_l18_l22-supply: true
+        vdd_lvs_1_2-supply: true
+      patternProperties:
+        "^vdd_s[1-9][0-2]?-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pmi8994-regulators
+    then:
+      properties:
+        vdd_l1-supply: true
+      patternProperties:
+        "^vdd_s[1-3]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pmp8074-regulators
+    then:
+      properties:
+        vdd_l10_l11_l12_l13-supply: true
+        vdd_l1_l2-supply: true
+        vdd_l3_l8-supply: true
+        vdd_l5_l6_l15-supply: true
+      patternProperties:
+        "^vdd_l[479]-supply$": true
+        "^vdd_s[1-5]-supply$": true
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - qcom,pms405-regulators
+    then:
+      properties:
+        vdd_s3-supply: true
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    regulators {
+      compatible = "qcom,pm8941-regulators";
+      vdd_l1_l3-supply = <&s1>;
+
+      s1: s1 {
+        regulator-min-microvolt = <1300000>;
+        regulator-max-microvolt = <1400000>;
+      };
+
+      l1: l1 {
+        regulator-min-microvolt = <1225000>;
+        regulator-max-microvolt = <1300000>;
+      };
+    };
+...
index a9b66ececccf3fd040a421ed677b97ca78bc2887..6e8aa9eed3aa1966414a303073489db2b0ec2f6d 100644 (file)
@@ -23,6 +23,7 @@ properties:
 
   regulator-microvolt-offset:
     description: Offset applied to voltages to compensate for voltage drops
+    $ref: "/schemas/types.yaml#/definitions/uint32"
 
   regulator-min-microamp:
     description: smallest current consumers may set
index fa5e4ea6400e7e8683f9623227acfde4bbdb47b7..d82e65e37cc0c9a00a119ddd72db0803404ed225 100644 (file)
@@ -11,7 +11,9 @@ maintainers:
 
 properties:
   compatible:
-    const: nuvoton,npcm750-reset
+    enum:
+      - nuvoton,npcm750-reset        # Poleg NPCM7XX SoC
+      - nuvoton,npcm845-reset        # Arbel NPCM8XX SoC
 
   reg:
     maxItems: 1
@@ -19,6 +21,10 @@ properties:
   '#reset-cells':
     const: 2
 
+  nuvoton,sysgcr:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: a phandle to access GCR registers.
+
   nuvoton,sw-reset-number:
     $ref: /schemas/types.yaml#/definitions/uint32
     minimum: 1
@@ -31,6 +37,7 @@ required:
   - compatible
   - reg
   - '#reset-cells'
+  - nuvoton,sysgcr
 
 additionalProperties: false
 
@@ -41,6 +48,7 @@ examples:
         compatible = "nuvoton,npcm750-reset";
         reg = <0xf0801000 0x70>;
         #reset-cells = <2>;
+        nuvoton,sysgcr = <&gcr>;
         nuvoton,sw-reset-number = <2>;
     };
 
diff --git a/Documentation/devicetree/bindings/reset/sunplus,reset.yaml b/Documentation/devicetree/bindings/reset/sunplus,reset.yaml
new file mode 100644 (file)
index 0000000..f24646b
--- /dev/null
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/reset/sunplus,reset.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Sunplus SoC Reset Controller
+
+maintainers:
+  - Qin Jian <qinjian@cqplus1.com>
+
+properties:
+  compatible:
+    const: sunplus,sp7021-reset
+
+  reg:
+    maxItems: 1
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    rstc: reset@9c000054 {
+      compatible = "sunplus,sp7021-reset";
+      reg = <0x9c000054 0x28>;
+      #reset-cells = <1>;
+    };
+
+...
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..e28ef19
--- /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: /schemas/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 31e4d3c339bfe723330a2f052068b4866bfadd7a..d0a4bc3b03e968a5b3c8004c2db9be14e7ba8ec6 100644 (file)
@@ -20,6 +20,7 @@ properties:
   compatible:
     enum:
       - mediatek,mt6779-devapc
+      - mediatek,mt8186-devapc
 
   reg:
     description: The base address of devapc register bank
diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mutex.yaml
new file mode 100644 (file)
index 0000000..627dcc3
--- /dev/null
@@ -0,0 +1,99 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mutex.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek mutex
+
+maintainers:
+  - Chun-Kuang Hu <chunkuang.hu@kernel.org>
+  - Philipp Zabel <p.zabel@pengutronix.de>
+
+description: |
+  Mediatek mutex, namely MUTEX, is used to send the triggers signals called
+  Start Of Frame (SOF) / End Of Frame (EOF) to each sub-modules on the display
+  data path or MDP data path.
+  In some SoC, such as mt2701, MUTEX could be a hardware mutex which protects
+  the shadow register.
+  MUTEX device node must be siblings to the central MMSYS_CONFIG node.
+  For a description of the MMSYS_CONFIG binding, see
+  Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.yaml
+  for details.
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt2701-disp-mutex
+      - mediatek,mt2712-disp-mutex
+      - mediatek,mt8167-disp-mutex
+      - mediatek,mt8173-disp-mutex
+      - mediatek,mt8183-disp-mutex
+      - mediatek,mt8186-disp-mutex
+      - mediatek,mt8192-disp-mutex
+      - mediatek,mt8195-disp-mutex
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  power-domains:
+    description: A phandle and PM domain specifier as defined by bindings of
+      the power controller specified by phandle. See
+      Documentation/devicetree/bindings/power/power-domain.yaml for details.
+
+  clocks:
+    items:
+      - description: MUTEX Clock
+
+  mediatek,gce-events:
+    description:
+      The event id which is mapping to the specific hardware event signal
+      to gce. The event id is defined in the gce header
+      include/dt-bindings/gce/<chip>-gce.h of each chips.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+
+  mediatek,gce-client-reg:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      items:
+        - description: phandle of GCE
+        - description: GCE subsys id
+        - description: register offset
+        - description: register size
+    description: The register of client driver can be configured by gce with
+      4 arguments defined in this property. Each GCE subsys id is mapping to
+      a client defined in the header include/dt-bindings/gce/<chip>-gce.h.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - power-domains
+  - clocks
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/mt8173-clk.h>
+    #include <dt-bindings/power/mt8173-power.h>
+    #include <dt-bindings/gce/mt8173-gce.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        mutex: mutex@14020000 {
+            compatible = "mediatek,mt8173-disp-mutex";
+            reg = <0 0x14020000 0 0x1000>;
+            interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_LOW>;
+            power-domains = <&spm MT8173_POWER_DOMAIN_MM>;
+            clocks = <&mmsys CLK_MM_MUTEX_32K>;
+            mediatek,gce-events = <CMDQ_EVENT_MUTEX0_STREAM_EOF>,
+                                  <CMDQ_EVENT_MUTEX1_STREAM_EOF>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/soc/mediatek/mtk-svs.yaml b/Documentation/devicetree/bindings/soc/mediatek/mtk-svs.yaml
new file mode 100644 (file)
index 0000000..d911fa2
--- /dev/null
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/mediatek/mtk-svs.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek Smart Voltage Scaling (SVS) Device Tree Bindings
+
+maintainers:
+  - Roger Lu <roger.lu@mediatek.com>
+  - Matthias Brugger <matthias.bgg@gmail.com>
+  - Kevin Hilman <khilman@kernel.org>
+
+description: |+
+  The SVS engine is a piece of hardware which has several
+  controllers(banks) for calculating suitable voltage to
+  different power domains(CPU/GPU/CCI) according to
+  chip process corner, temperatures and other factors. Then DVFS
+  driver could apply SVS bank voltage to PMIC/Buck.
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt8183-svs
+      - mediatek,mt8192-svs
+
+  reg:
+    maxItems: 1
+    description: Address range of the MTK SVS controller.
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+    description: Main clock for MTK SVS controller to work.
+
+  clock-names:
+    const: main
+
+  nvmem-cells:
+    minItems: 1
+    description:
+      Phandle to the calibration data provided by a nvmem device.
+    items:
+      - description: SVS efuse for SVS controller
+      - description: Thermal efuse for SVS controller
+
+  nvmem-cell-names:
+    items:
+      - const: svs-calibration-data
+      - const: t-calibration-data
+
+  resets:
+    maxItems: 1
+
+  reset-names:
+    items:
+      - const: svs_rst
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - nvmem-cells
+  - nvmem-cell-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/mt8183-clk.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        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";
+        };
+    };
index 597d67fba92f1998c87d447405a7dfec44efeeb5..33748a06189830898b8caf702962c352b40f1e6b 100644 (file)
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
 %YAML 1.2
 ---
-$id: "http://devicetree.org/schemas/soc/microchip/atmel,at91rm9200-tcb.yaml#"
-$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+$id: http://devicetree.org/schemas/soc/microchip/atmel,at91rm9200-tcb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Atmel Timer Counter Block
 
@@ -75,7 +75,7 @@ patternProperties:
 
   "^pwm@[0-2]$":
     description: The timer block channels that are used as PWMs.
-    $ref: ../../pwm/pwm.yaml#
+    $ref: /schemas/pwm/pwm.yaml#
     type: object
     properties:
       compatible:
index b0dae51e1d42ad39328eaa83d6f50bd0a53b6ee8..04ffee3a7c596ed794b5c2405816eb9dd5d94589 100644 (file)
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
 %YAML 1.2
 ---
-$id: "http://devicetree.org/schemas/soc/microchip/microchip,mpfs-sys-controller.yaml#"
-$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+$id: http://devicetree.org/schemas/soc/microchip/microchip,mpfs-sys-controller.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Microchip PolarFire SoC (MPFS) MSS (microprocessor subsystem) system controller
 
index e2e173dfada7e5e71952576b9ae9fa97c4fd2e8c..d01e987681531da09f65c5432e5a7e484611f853 100644 (file)
@@ -33,6 +33,7 @@ properties:
           - qcom,sm8150-aoss-qmp
           - qcom,sm8250-aoss-qmp
           - qcom,sm8350-aoss-qmp
+          - qcom,sm8450-aoss-qmp
       - const: qcom,aoss-qmp
 
   reg:
index f5ecf4a8c377025a4377654084a4162e60dbf5c4..4a50f1d277240a692ee19265f1391b5b50060d04 100644 (file)
@@ -65,33 +65,22 @@ properties:
 
   qcom,tcs-config:
     $ref: /schemas/types.yaml#/definitions/uint32-matrix
+    minItems: 4
+    maxItems: 4
     items:
-      - items:
-          - description: TCS type
-            enum: [ 0, 1, 2, 3 ]
-          - description: Number of TCS
-      - items:
-          - description: TCS type
-            enum: [ 0, 1, 2, 3 ]
-          - description: Number of TCS
-      - items:
-          - description: TCS type
-            enum: [ 0, 1, 2, 3]
-          - description: Numbe r of TCS
-      - items:
-          - description: TCS type
-            enum: [ 0, 1, 2, 3 ]
-          - description: Number of TCS
+      items:
+        - description: |
+            TCS type::
+             - ACTIVE_TCS
+             - SLEEP_TCS
+             - WAKE_TCS
+             - CONTROL_TCS
+          enum: [ 0, 1, 2, 3 ]
+        - description: Number of TCS
     description: |
       The tuple defining the configuration of TCS. Must have two cells which
       describe each TCS type.  The order of the TCS must match the hardware
       configuration.
-      Cell 1 (TCS Type):: TCS types to be specified::
-       - ACTIVE_TCS
-       - SLEEP_TCS
-       - WAKE_TCS
-       - CONTROL_TCS
-      Cell 2 (Number of TCS):: <u32>
 
   qcom,tcs-offset:
     $ref: /schemas/types.yaml#/definitions/uint32
index f0f1bf06aea6ae00ffea1ee25be1958809b2f15a..50f834563e19447d6b02db07fcd050736d5948da 100644 (file)
@@ -34,6 +34,7 @@ properties:
       - qcom,rpm-apq8084
       - qcom,rpm-ipq6018
       - qcom,rpm-msm8226
+      - qcom,rpm-msm8909
       - qcom,rpm-msm8916
       - qcom,rpm-msm8936
       - qcom,rpm-msm8953
@@ -51,6 +52,9 @@ properties:
     $ref: /schemas/clock/qcom,rpmcc.yaml#
     unevaluatedProperties: false
 
+  power-controller:
+    $ref: /schemas/power/qcom,rpmpd.yaml#
+
   qcom,smd-channels:
     $ref: /schemas/types.yaml#/definitions/string-array
     description: Channel name used for the RPM communication
index 07d2d5398345db9dbd313529438b9834c908b81e..f433e6e0a19f957b0e6c642546eb48ede79d63ad 100644 (file)
@@ -22,6 +22,7 @@ properties:
           - qcom,sdm660-silver-saw2-v4.1-l2
           - qcom,msm8998-gold-saw2-v4.1-l2
           - qcom,msm8998-silver-saw2-v4.1-l2
+          - qcom,msm8909-saw2-v3.0-cpu
           - qcom,msm8916-saw2-v3.0-cpu
           - qcom,msm8226-saw2-v2.1-cpu
           - qcom,msm8974-saw2-v2.1-cpu
index d891ecfb2691ac53594ac5eef8bba420c75293d1..5320504bb5e004f000b2a67b7994bfe2d5c132f8 100644 (file)
@@ -77,7 +77,6 @@ properties:
           Should reference the tx-enable and tx-rings-empty SMEM states.
 
       qcom,smem-state-names:
-        $ref: /schemas/types.yaml#/definitions/string-array
         items:
           - const: tx-enable
           - const: tx-rings-empty
index c30a6437030d754fcec5fa29aa2f0ea0e42c37ba..13bb8dfcefe6eaf5308403c2b3c4bdc429a1fc49 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 fde886a8cf437eb5e7ad75ec1c7257cf3803e806..60b49562ff69496fe61766d7d5dc0739ea2460b7 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 64461d4320048ea81cda8b7df3db721cb2414607..847873289f25dc122a5d972a446b071f50f2e097 100644 (file)
@@ -65,10 +65,11 @@ properties:
       - ti,am4376-pruss0 # for AM437x SoC family and PRUSS unit 0
       - ti,am4376-pruss1 # for AM437x SoC family and PRUSS unit 1
       - ti,am5728-pruss  # for AM57xx SoC family
-      - ti,k2g-pruss     # for 66AK2G SoC family
+      - ti,am625-pruss   # for K3 AM62x SoC family
+      - ti,am642-icssg   # for K3 AM64x SoC family
       - ti,am654-icssg   # for K3 AM65x SoC family
       - ti,j721e-icssg   # for K3 J721E SoC family
-      - ti,am642-icssg   # for K3 AM64x SoC family
+      - ti,k2g-pruss     # for 66AK2G SoC family
 
   reg:
     maxItems: 1
index 7e8d252f7bca4ef47cd0609a51ebcd0dffd801db..0d9840375132481483716c7393895fefd5f30d20 100644 (file)
@@ -13,6 +13,7 @@ properties:
   compatible:
     items:
       - enum:
+          - renesas,r9a07g043-ssi  # RZ/G2UL
           - renesas,r9a07g044-ssi  # RZ/G2{L,LC}
           - renesas,r9a07g054-ssi  # RZ/V2L
       - const: renesas,rz-ssi
@@ -50,7 +51,7 @@ properties:
     minItems: 1
     maxItems: 2
     description:
-      The first cell represents a phandle to dmac
+      The first cell represents a phandle to dmac.
       The second cell specifies the encoded MID/RID values of the SSI port
       connected to the DMA client and the slave channel configuration
       parameters.
diff --git a/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml b/Documentation/devicetree/bindings/spi/atmel,at91rm9200-spi.yaml
new file mode 100644 (file)
index 0000000..d85d540
--- /dev/null
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/atmel,at91rm9200-spi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel SPI device
+
+maintainers:
+  - Tudor Ambarus <tudor.ambarus@microchip.com>
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: atmel,at91rm9200-spi
+      - items:
+          - const: microchip,sam9x60-spi
+          - const: atmel,at91rm9200-spi
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clock-names:
+    contains:
+      const: spi_clk
+
+  clocks:
+    maxItems: 1
+
+  atmel,fifo-size:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Maximum number of data the RX and TX FIFOs can store for FIFO
+      capable SPI controllers.
+    enum: [ 16, 32 ]
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clock-names
+  - clocks
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    spi1: spi@fffcc000 {
+        compatible = "atmel,at91rm9200-spi";
+        reg = <0xfffcc000 0x4000>;
+        interrupts = <13 IRQ_TYPE_LEVEL_HIGH 5>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        clocks = <&spi1_clk>;
+        clock-names = "spi_clk";
+        cs-gpios = <&pioB 3 GPIO_ACTIVE_HIGH>;
+        atmel,fifo-size = <32>;
+
+        mmc@0 {
+            compatible = "mmc-spi-slot";
+            reg = <0>;
+            gpios = <&pioC 4 GPIO_ACTIVE_HIGH>;    /* CD */
+            spi-max-frequency = <25000000>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml b/Documentation/devicetree/bindings/spi/hpe,gxp-spifi.yaml
new file mode 100644 (file)
index 0000000..7797c31
--- /dev/null
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/hpe,gxp-spifi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HPE GXP spi controller flash interface
+
+maintainers:
+  - Nick Hawkins <nick.hawkins@hpe.com>
+  - Jean-Marie Verdun <verdun@hpe.com>
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+properties:
+  compatible:
+    const: hpe,gxp-spifi
+
+  reg:
+    items:
+      - description: cfg registers
+      - description: data registers
+      - description: mapped memory
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+
+    spi@200 {
+      compatible = "hpe,gxp-spifi";
+      reg = <0x200 0x80>, <0xc000 0x100>, <0x38000000 0x800000>;
+      interrupts = <20>;
+      interrupt-parent = <&vic0>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      flash@0 {
+        reg = <0>;
+        compatible = "jedec,spi-nor";
+      };
+
+      flash@1 {
+        reg = <1>;
+        compatible = "jedec,spi-nor";
+      };
+    };
index 94ef0552bd4241a9e128b91ad2f0cd285606dc1e..8d2a6c084eab0a957c8306e2763fa40eaa32adf7 100644 (file)
@@ -18,6 +18,7 @@ properties:
       - items:
           - enum:
               - mediatek,mt7629-spi
+              - mediatek,mt8365-spi
           - const: mediatek,mt7622-spi
       - items:
           - enum:
@@ -33,6 +34,7 @@ properties:
       - items:
           - enum:
               - mediatek,mt7986-spi-ipm
+              - mediatek,mt8188-spi-ipm
           - const: mediatek,spi-ipm
       - items:
           - enum:
index 41e60fe4b09f1d1d2c80270c77b66516a5faa8b3..970b1119898be27567ca8aae6d9f10f237c7794e 100644 (file)
@@ -23,6 +23,10 @@ allOf:
 properties:
   compatible:
     oneOf:
+      - enum:
+          - mediatek,mt8173-nor
+          - mediatek,mt8186-nor
+          - mediatek,mt8192-nor
       - items:
           - enum:
               - mediatek,mt2701-nor
@@ -30,13 +34,13 @@ properties:
               - mediatek,mt7622-nor
               - mediatek,mt7623-nor
               - mediatek,mt7629-nor
-              - mediatek,mt8186-nor
-              - mediatek,mt8192-nor
               - mediatek,mt8195-nor
-          - enum:
-              - mediatek,mt8173-nor
-      - items:
           - const: mediatek,mt8173-nor
+      - items:
+          - enum:
+              - mediatek,mt8188-nor
+          - const: mediatek,mt8186-nor
+
   reg:
     maxItems: 1
 
@@ -64,7 +68,6 @@ properties:
 required:
   - compatible
   - reg
-  - interrupts
   - clocks
   - clock-names
 
index a388005842adaa6a1a25e6e8563e140169e1c75c..c63ce4cc0a80fb569ed066c2a465767a791383ff 100644 (file)
@@ -6,8 +6,13 @@ The NPCM7XX supports three FIU modules,
 FIU0 and FIUx supports two chip selects,
 FIU3 support four chip select.
 
+The NPCM8XX supports four FIU modules,
+FIU0 and FIUx supports two chip selects,
+FIU1 and FIU3 supports four chip selects.
+
 Required properties:
-  - compatible : "nuvoton,npcm750-fiu" for the NPCM7XX BMC
+  - compatible : "nuvoton,npcm750-fiu" for Poleg NPCM7XX BMC
+                            "nuvoton,npcm845-fiu" for Arbel NPCM8XX BMC
   - #address-cells : should be 1.
   - #size-cells : should be 0.
   - reg : the first contains the register location and length,
@@ -30,6 +35,12 @@ Aliases:
                fiu1 represent fiu 3 controller
                fiu2 represent fiu x controller
 
+  In the NPCM8XX BMC:
+               fiu0 represent fiu 0 controller
+               fiu1 represent fiu 1 controller
+               fiu2 represent fiu 3 controller
+               fiu3 represent fiu x controller
+
 Example:
 fiu3: spi@c00000000 {
        compatible = "nuvoton,npcm750-fiu";
diff --git a/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/nvidia,tegra210-quad-peripheral-props.yaml
new file mode 100644 (file)
index 0000000..24e0c21
--- /dev/null
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/nvidia,tegra210-quad-peripheral-props.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Peripheral properties for Tegra Quad SPI Controller
+
+maintainers:
+  - Thierry Reding <thierry.reding@gmail.com>
+  - Jonathan Hunter <jonathanh@nvidia.com>
+
+properties:
+  nvidia,tx-clk-tap-delay:
+    description:
+      Delays the clock going out to device with this tap value.
+      Tap value varies based on platform design trace lengths from Tegra
+      QSPI to corresponding slave device.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 31
+
+  nvidia,rx-clk-tap-delay:
+    description:
+      Delays the clock coming in from the device with this tap value.
+      Tap value varies based on platform design trace lengths from Tegra
+      QSPI to corresponding slave device.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 255
+
+unevaluatedProperties: true
+
index 0296edd1de22e7b8f190f52f465d5c777adf6a43..6b733e5c116384dd21b2387cab830ba34eee6b44 100644 (file)
@@ -20,6 +20,7 @@ properties:
       - nvidia,tegra186-qspi
       - nvidia,tegra194-qspi
       - nvidia,tegra234-qspi
+      - nvidia,tegra241-qspi
 
   reg:
     maxItems: 1
@@ -57,27 +58,6 @@ patternProperties:
       spi-tx-bus-width:
         enum: [1, 2, 4]
 
-      nvidia,tx-clk-tap-delay:
-        description:
-          Delays the clock going out to device with this tap value.
-          Tap value varies based on platform design trace lengths from Tegra
-          QSPI to corresponding slave device.
-        $ref: /schemas/types.yaml#/definitions/uint32
-        minimum: 0
-        maximum: 31
-
-      nvidia,rx-clk-tap-delay:
-        description:
-          Delays the clock coming in from the device with this tap value.
-          Tap value varies based on platform design trace lengths from Tegra
-          QSPI to corresponding slave device.
-        $ref: /schemas/types.yaml#/definitions/uint32
-        minimum: 0
-        maximum: 255
-
-    required:
-      - reg
-
 required:
   - compatible
   - reg
index 78ceb9d67754f405635c0f8cf936732cbf92a4b3..2e20ca313ec1da5b8e5f5fec53d529d8c6be390c 100644 (file)
@@ -45,12 +45,15 @@ properties:
       - const: rx
 
   interconnects:
-    maxItems: 2
+    minItems: 2
+    maxItems: 3
 
   interconnect-names:
+    minItems: 2
     items:
       - const: qup-core
       - const: qup-config
+      - const: qup-memory
 
   interrupts:
     maxItems: 1
index a50f24f9359de1b94e536b9725a1b47fd38bd836..e0a465d70b0a465a7451a6ffe89ce909fe176b68 100644 (file)
@@ -20,7 +20,9 @@ properties:
           - samsung,s3c2443-spi # for S3C2443, S3C2416 and S3C2450
           - samsung,s3c6410-spi
           - samsung,s5pv210-spi # for S5PV210 and S5PC110
+          - samsung,exynos4210-spi
           - samsung,exynos5433-spi
+          - samsung,exynosautov9-spi
           - tesla,fsd-spi
       - const: samsung,exynos7-spi
         deprecated: true
@@ -85,7 +87,9 @@ allOf:
       properties:
         compatible:
           contains:
-            const: samsung,exynos5433-spi
+            enum:
+              - samsung,exynos5433-spi
+              - samsung,exynosautov9-spi
     then:
       properties:
         clocks:
index d7e08b03e204f91dadb383b7ad5e7610c7f866a7..37c3c272407d06394bf937053a53935703386510 100644 (file)
@@ -61,6 +61,8 @@ properties:
           - const: snps,dw-apb-ssi
       - description: Intel Keem Bay SPI Controller
         const: intel,keembay-ssi
+      - description: Intel Thunder Bay SPI Controller
+        const: intel,thunderbay-ssi
       - description: Baikal-T1 SPI Controller
         const: baikal,bt1-ssi
       - description: Baikal-T1 System Boot SPI Controller
@@ -124,9 +126,16 @@ properties:
 
   rx-sample-delay-ns:
     default: 0
-    description: Default value of the rx-sample-delay-ns property.
+    description: |
+      Default value of the rx-sample-delay-ns property.
       This value will be used if the property is not explicitly defined
-      for a SPI slave device. See below.
+      for a SPI slave device.
+
+      SPI Rx sample delay offset, unit is nanoseconds.
+      The delay from the default sample time before the actual sample of the
+      rxd input signal occurs. The "rx_sample_delay" is an optional feature
+      of the designware controller, and the upper limit is also subject to
+      controller configuration.
 
 patternProperties:
   "^.*@[0-9a-f]+$":
@@ -136,19 +145,6 @@ patternProperties:
         minimum: 0
         maximum: 3
 
-      spi-rx-bus-width:
-        const: 1
-
-      spi-tx-bus-width:
-        const: 1
-
-      rx-sample-delay-ns:
-        description: SPI Rx sample delay offset, unit is nanoseconds.
-          The delay from the default sample time before the actual
-          sample of the rxd input signal occurs. The "rx_sample_delay"
-          is an optional feature of the designware controller, and the
-          upper limit is also subject to controller configuration.
-
 unevaluatedProperties: false
 
 required:
index 9787be21318e6664045e65df6e39686c8af92f32..82d0ca5c00f3b0fb09aa084b9c8fb88ec0560142 100644 (file)
@@ -49,6 +49,13 @@ properties:
     enum: [ 0, 1 ]
     default: 0
 
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clock-names
+  - clocks
+
 unevaluatedProperties: false
 
 examples:
index ebb4d5f1cf4ff0936939850e09c70bb9e8bcd44c..655713fba7e252354eb6c1b67f9018b916d439c6 100644 (file)
@@ -95,6 +95,17 @@ patternProperties:
     type: object
     $ref: spi-peripheral-props.yaml
 
+    properties:
+      spi-cpha:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description:
+          The device requires shifted clock phase (CPHA) mode.
+
+      spi-cpol:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description:
+          The device requires inverse clock polarity (CPOL) mode.
+
     required:
       - compatible
       - reg
@@ -139,9 +150,9 @@ examples:
         };
 
         flash@2 {
-          compatible = "jedec,spi-nor";
-          spi-max-frequency = <50000000>;
-          reg = <2>, <3>;
-          stacked-memories = /bits/ 64 <0x10000000 0x10000000>;
+            compatible = "jedec,spi-nor";
+            spi-max-frequency = <50000000>;
+            reg = <2>, <3>;
+            stacked-memories = /bits/ 64 <0x10000000 0x10000000>;
         };
     };
index 5e32928c4fc3ca186c865f975350c7f640317216..ce048e782e80422d2a5474b2c94262ac55e6abc1 100644 (file)
@@ -34,16 +34,6 @@ properties:
     description:
       The device requires 3-wire mode.
 
-  spi-cpha:
-    $ref: /schemas/types.yaml#/definitions/flag
-    description:
-      The device requires shifted clock phase (CPHA) mode.
-
-  spi-cpol:
-    $ref: /schemas/types.yaml#/definitions/flag
-    description:
-      The device requires inverse clock polarity (CPOL) mode.
-
   spi-cs-high:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
@@ -71,6 +61,11 @@ properties:
     description:
       Delay, in microseconds, after a read transfer.
 
+  rx-sample-delay-ns:
+    description: SPI Rx sample delay offset, unit is nanoseconds.
+      The delay from the default sample time before the actual
+      sample of the rxd input signal occurs.
+
   spi-tx-bus-width:
     description:
       Bus width to the SPI bus used for write transfers.
@@ -112,5 +107,6 @@ properties:
 allOf:
   - $ref: cdns,qspi-nor-peripheral-props.yaml#
   - $ref: samsung,spi-peripheral-props.yaml#
+  - $ref: nvidia,tegra210-quad-peripheral-props.yaml#
 
 additionalProperties: true
index ea72c8001256fa254bf20c461674f17674b5c8a2..fafde1c06be67d403ff2da5d66ce097e32790f2c 100644 (file)
@@ -30,6 +30,13 @@ properties:
   clocks:
     maxItems: 2
 
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clock-names
+  - clocks
+
 unevaluatedProperties: false
 
 examples:
diff --git a/Documentation/devicetree/bindings/spi/spi_atmel.txt b/Documentation/devicetree/bindings/spi/spi_atmel.txt
deleted file mode 100644 (file)
index 5bb4a8f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-Atmel SPI device
-
-Required properties:
-- compatible : should be "atmel,at91rm9200-spi" or "microchip,sam9x60-spi".
-- reg: Address and length of the register set for the device
-- interrupts: Should contain spi interrupt
-- cs-gpios: chipselects (optional for SPI controller version >= 2 with the
-  Chip Select Active After Transfer feature).
-- clock-names: tuple listing input clock names.
-       Required elements: "spi_clk"
-- clocks: phandles to input clocks.
-
-Optional properties:
-- atmel,fifo-size: maximum number of data the RX and TX FIFOs can store for FIFO
-  capable SPI controllers.
-
-Example:
-
-spi1: spi@fffcc000 {
-       compatible = "atmel,at91rm9200-spi";
-       reg = <0xfffcc000 0x4000>;
-       interrupts = <13 4 5>;
-       #address-cells = <1>;
-       #size-cells = <0>;
-       clocks = <&spi1_clk>;
-       clock-names = "spi_clk";
-       cs-gpios = <&pioB 3 0>;
-       atmel,fifo-size = <32>;
-
-       mmc-slot@0 {
-               compatible = "mmc-spi-slot";
-               reg = <0>;
-               gpios = <&pioC 4 0>;    /* CD */
-               spi-max-frequency = <25000000>;
-       };
-};
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>;
+    };
index 53fd24bdc34e3c6fdfe5a79f076c3c64cdd39eda..3711872b6b99d2e99f8b9748d0b59b36fb7037c4 100644 (file)
@@ -20,6 +20,7 @@ properties:
           - allwinner,suniv-f1c100s-timer
       - items:
           - enum:
+              - allwinner,sun20i-d1-timer
               - allwinner,sun50i-a64-timer
               - allwinner,sun50i-h6-timer
               - allwinner,sun50i-h616-timer
index d541cf2067bc1453fb8e395329aba7f01de9d205..0a01e4f5eddb0822a072d9fbe191e97e2b899ff7 100644 (file)
@@ -113,7 +113,7 @@ properties:
 patternProperties:
   "^watchdog@[a-f0-9]+$":
     type: object
-    $ref: ../watchdog/watchdog.yaml#
+    $ref: /schemas/watchdog/watchdog.yaml#
     properties:
       compatible:
         oneOf:
@@ -145,7 +145,7 @@ patternProperties:
 
   "^pwm@[a-f0-9]+$":
     type: object
-    $ref: ../pwm/pwm.yaml#
+    $ref: /schemas/pwm/pwm.yaml#
     properties:
       compatible:
         oneOf:
index 6f1f9dba6e88c02668e5e8e26432849bfb5a0f30..f1c848af91d3a7935049125262e3c6c0193daacc 100644 (file)
@@ -1,7 +1,8 @@
 MediaTek Timers
 ---------------
 
-MediaTek SoCs have two different timers on different platforms,
+MediaTek SoCs have different timers on different platforms,
+- CPUX (ARM/ARM64 System Timer)
 - GPT (General Purpose Timer)
 - SYST (System Timer)
 
@@ -29,6 +30,9 @@ Required properties:
        * "mediatek,mt7629-timer" for MT7629 compatible timers (SYST)
        * "mediatek,mt6765-timer" for MT6765 and all above compatible timers (SYST)
 
+       For those SoCs that use CPUX
+       * "mediatek,mt6795-systimer" for MT6795 compatible timers (CPUX)
+
 - reg: Should contain location and length for timer register.
 - clocks: Should contain system clock.
 
index 0cbc26a7215141a41be3f5c18e3ef4c1ee7e5bbb..737af78ad70c3409820c3aed51f04b383ef6618e 100644 (file)
@@ -8,12 +8,14 @@ title: Nuvoton NPCM7xx timer
 
 maintainers:
   - Jonathan Neuschäfer <j.neuschaefer@gmx.net>
+  - Tomer Maimon <tmaimon77@gmail.com>
 
 properties:
   compatible:
     enum:
       - nuvoton,wpcm450-timer  # for Hermon WPCM450
       - nuvoton,npcm750-timer  # for Poleg NPCM750
+      - nuvoton,npcm845-timer  # for Arbel NPCM845
 
   reg:
     maxItems: 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 53dd6d9f518f96f2ff9bff65f08da01ef9767dbc..bde6c9b66bf426898faf2f6859f5284543f41600 100644 (file)
@@ -80,7 +80,6 @@ properties:
               - renesas,r8a77980-cmt0     # 32-bit CMT0 on R-Car V3H
               - renesas,r8a77990-cmt0     # 32-bit CMT0 on R-Car E3
               - renesas,r8a77995-cmt0     # 32-bit CMT0 on R-Car D3
-              - renesas,r8a779a0-cmt0     # 32-bit CMT0 on R-Car V3U
           - const: renesas,rcar-gen3-cmt0 # 32-bit CMT0 on R-Car Gen3 and RZ/G2
 
       - items:
@@ -97,9 +96,20 @@ properties:
               - renesas,r8a77980-cmt1     # 48-bit CMT on R-Car V3H
               - renesas,r8a77990-cmt1     # 48-bit CMT on R-Car E3
               - renesas,r8a77995-cmt1     # 48-bit CMT on R-Car D3
-              - renesas,r8a779a0-cmt1     # 48-bit CMT on R-Car V3U
           - const: renesas,rcar-gen3-cmt1 # 48-bit CMT on R-Car Gen3 and RZ/G2
 
+      - items:
+          - enum:
+              - renesas,r8a779a0-cmt0     # 32-bit CMT0 on R-Car V3U
+              - renesas,r8a779f0-cmt0     # 32-bit CMT0 on R-Car S4-8
+          - const: renesas,rcar-gen4-cmt0 # 32-bit CMT0 on R-Car Gen4
+
+      - items:
+          - enum:
+              - renesas,r8a779a0-cmt1     # 48-bit CMT on R-Car V3U
+              - renesas,r8a779f0-cmt1     # 48-bit CMT on R-Car S4-8
+          - const: renesas,rcar-gen4-cmt1 # 48-bit CMT on R-Car Gen4
+
   reg:
     maxItems: 1
 
@@ -135,6 +145,7 @@ allOf:
             enum:
               - renesas,rcar-gen2-cmt0
               - renesas,rcar-gen3-cmt0
+              - renesas,rcar-gen4-cmt0
     then:
       properties:
         interrupts:
@@ -148,6 +159,7 @@ allOf:
             enum:
               - renesas,rcar-gen2-cmt1
               - renesas,rcar-gen3-cmt1
+              - renesas,rcar-gen4-cmt1
     then:
       properties:
         interrupts:
diff --git a/Documentation/devicetree/bindings/timer/st,nomadik-mtu.yaml b/Documentation/devicetree/bindings/timer/st,nomadik-mtu.yaml
new file mode 100644 (file)
index 0000000..901848d
--- /dev/null
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2022 Linaro Ltd.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/timer/st,nomadik-mtu.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: ST Microelectronics Nomadik Multi-Timer Unit MTU Timer
+
+maintainers:
+  - Linus Walleij <linus.walleij@linaro.org>
+
+description: This timer is found in the ST Microelectronics Nomadik
+  SoCs STn8800, STn8810 and STn8815 as well as in ST-Ericsson DB8500.
+
+properties:
+  compatible:
+    items:
+      - const: st,nomadik-mtu
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    description: The first clock named TIMCLK clocks the actual timers and
+      the second clock clocks the digital interface to the interconnect.
+    maxItems: 2
+
+  clock-names:
+    items:
+      - const: timclk
+      - const: apb_pclk
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/mfd/dbx500-prcmu.h>
+    timer@a03c6000 {
+      compatible = "st,nomadik-mtu";
+      reg = <0xa03c6000 0x1000>;
+      interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+
+      clocks = <&prcmu_clk PRCMU_TIMCLK>, <&prcc_pclk 6 6>;
+      clock-names = "timclk", "apb_pclk";
+    };
index 6aafa71806a3d6478901440f70a115f5567b6bee..5d87b8426ff4cdc940a07badd7c682757be8fd05 100644 (file)
@@ -41,6 +41,8 @@ properties:
           - adi,adp5585-02
             # Analog Devices ADP5589 Keypad Decoder and I/O Expansion
           - adi,adp5589
+            # Analog Devices LT7182S Dual Channel 6A, 20V PolyPhase Step-Down Silent Switcher
+          - adi,lt7182s
             # AMS iAQ-Core VOC Sensor
           - ams,iaq-core
             # i2c serial eeprom (24cxx)
index 933fa356d2ce04385b81dd999bd6733fb2d7f0ba..e5dbf4169bc9e384195b4b45d4abf1330a180137 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 f512f029072817b829e687e257bc8b41f170261b..12183ef47ee48fbee2d5041df8366aa1e778b6e5 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 1e84e1b7ab271fcfc795779f86fa80fe7dd473a8..25a6c14618e11844918a8931f8bfc053a675b8d9 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
index bb6bbd5f129d44a62863b56acd8331da6f03ae90..180361b79f526bb5a4b08e395d7d476d96b90a1a 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
index 0496773a3c4d870a50f1c96369dd469332731c7f..ff0ac853cb8248f429114a73cd2a341e217f5fb7 100644 (file)
@@ -510,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,.*":
@@ -1101,6 +1103,8 @@ patternProperties:
     description: SGX Sensortech
   "^sharp,.*":
     description: Sharp Corporation
+  "^shift,.*":
+    description: SHIFT GmbH
   "^shimafuji,.*":
     description: Shimafuji Electric, Inc.
   "^shiratech,.*":
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 9059f54dc023df58cdde319c2bef389e0b895f83..866a958b8a2bc0be41eeef721a1417beecc9521a 100644 (file)
@@ -6,7 +6,8 @@ expiry.
 
 Required properties:
 - compatible      : "nuvoton,npcm750-wdt" for NPCM750 (Poleg), or
-                    "nuvoton,wpcm450-wdt" for WPCM450 (Hermon).
+                    "nuvoton,wpcm450-wdt" for WPCM450 (Hermon), or
+                    "nuvoton,npcm845-wdt" for NPCM845 (Arbel).
 - reg             : Offset and length of the register set for the device.
 - interrupts      : Contain the timer interrupt with flags for
                     falling edge.
index b01bf7bca3e6d9e9038eeef28c413e584dba3d83..6bd78eb4dc6e04f1a3aa90a5ec1c101acb3a4ea4 100644 (file)
@@ -9,7 +9,7 @@
     |       alpha: | TODO |
     |         arc: |  ok  |
     |         arm: | TODO |
-    |       arm64: | TODO |
+    |       arm64: |  ok  |
     |        csky: | TODO |
     |     hexagon: | TODO |
     |        ia64: | TODO |
index 316cfd8b1891e53ddf82f9352779484b42cdc0a8..7da6c30ed596ad72a446b5dc81b52b305b77b069 100644 (file)
@@ -466,10 +466,6 @@ overlay filesystem and the value of st_ino for filesystem objects may not be
 persistent and could change even while the overlay filesystem is mounted, as
 summarized in the `Inode properties`_ table above.
 
-4) "idmapped mounts"
-When the upper or lower layers are idmapped mounts overlayfs will be mounted
-without support for POSIX Access Control Lists (ACLs). This limitation will
-eventually be lifted.
 
 Changes to underlying filesystems
 ---------------------------------
index 8b2d8d0864c2f9e4bf74f591bfddb8509ebaca27..70442bc2521e5bf8223780ec19d722ffa5a6669a 100644 (file)
@@ -21,7 +21,9 @@ specific type) associated with it.
 
 In the ACPI _DSD context it is an element of the sub-package following the
 generic Device Properties UUID in the _DSD return package as specified in the
-Device Properties UUID definition document [1]_.
+section titled "Well-Known _DSD UUIDs and Data Structure Formats" sub-section
+"Device Properties UUID" in _DSD (Device Specific Data) Implementation Guide
+document [1]_.
 
 It also may be regarded as the definition of a key and the associated data type
 that can be returned by _DSD in the Device Properties UUID sub-package for a
@@ -36,7 +38,9 @@ Property subsets are nested collections of properties.  Each of them is
 associated with an additional key (name) allowing the subset to be referred
 to as a whole (and to be treated as a separate entity).  The canonical
 representation of property subsets is via the mechanism specified in the
-Hierarchical Properties Extension UUID definition document [2]_.
+section titled "Well-Known _DSD UUIDs and Data Structure Formats" sub-section
+"Hierarchical Data Extension UUID" in _DSD (Device Specific Data)
+Implementation Guide document [1]_.
 
 Property sets may be hierarchical.  That is, a property set may contain
 multiple property subsets that each may contain property subsets of its
@@ -96,5 +100,4 @@ contents.
 References
 ==========
 
-.. [1] https://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
-.. [2] https://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf
+.. [1] https://github.com/UEFI/DSD-Guide
index 55e2331a64380a8d6984d72c68aea897a0119361..d6b61d22f52584a66f5f8aed51b0a9ce0d93c2d6 100644 (file)
@@ -168,7 +168,7 @@ An error injection example::
   0x00000008   Memory Correctable
   0x00000010   Memory Uncorrectable non-fatal
   # echo 0x12345000 > param1           # Set memory address for injection
-  # echo $((-1 << 12)) > param2                # Mask 0xfffffffffffff000 - anywhere in this page
+  # echo 0xfffffffffffff000 > param2           # Mask - anywhere in this page
   # echo 0x8 > error_type                      # Choose correctable memory error
   # echo 1 > error_inject                      # Inject now
 
index 717e28226cde9cda46d4bcaa45935468662176ee..33649a1e3a05f2d5c453f16478a55fa2240a64d1 100644 (file)
@@ -9,6 +9,7 @@ Supported devices:
 * Aquacomputer Farbwerk RGB controller
 * Aquacomputer Farbwerk 360 RGB controller
 * Aquacomputer Octo fan controller
+* Aquacomputer Quadro fan controller
 
 Author: Aleksa Savic
 
@@ -33,6 +34,9 @@ better suited for userspace tools.
 The Octo exposes four temperature sensors and eight PWM controllable fans, along
 with their speed (in RPM), power, voltage and current.
 
+The Quadro exposes four temperature sensors, a flow sensor and four PWM controllable
+fans, along with their speed (in RPM), power, voltage and current.
+
 The Farbwerk and Farbwerk 360 expose four temperature sensors. Depending on the device,
 not all sysfs and debugfs entries will be available.
 
@@ -45,13 +49,14 @@ the kernel and supports hotswapping.
 Sysfs entries
 -------------
 
-================ =============================================
+================ ==============================================
 temp[1-4]_input  Temperature sensors (in millidegrees Celsius)
-fan[1-2]_input   Pump/fan speed (in RPM)
-power[1-2]_input Pump/fan power (in micro Watts)
-in[0-2]_input    Pump/fan voltage (in milli Volts)
-curr[1-2]_input  Pump/fan current (in milli Amperes)
-================ =============================================
+fan[1-8]_input   Pump/fan speed (in RPM) / Flow speed (in dL/h)
+power[1-8]_input Pump/fan power (in micro Watts)
+in[0-7]_input    Pump/fan voltage (in milli Volts)
+curr[1-8]_input  Pump/fan current (in milli Amperes)
+pwm[1-8]         Fan PWM (0 - 255)
+================ ==============================================
 
 Debugfs entries
 ---------------
index 78ca69eda877890fbfd42a3caaa64b21a4049a9c..02f4ad314a1eb9e021cf906e8a7c191cf8610401 100644 (file)
@@ -13,12 +13,16 @@ Supported boards:
  * ROG CROSSHAIR VIII FORMULA
  * ROG CROSSHAIR VIII HERO
  * ROG CROSSHAIR VIII IMPACT
+ * ROG MAXIMUS XI HERO
+ * ROG MAXIMUS XI HERO (WI-FI)
  * ROG STRIX B550-E GAMING
  * ROG STRIX B550-I GAMING
  * ROG STRIX X570-E GAMING
  * ROG STRIX X570-E GAMING WIFI II
  * ROG STRIX X570-F GAMING
  * ROG STRIX X570-I GAMING
+ * ROG STRIX Z690-A GAMING WIFI D4
+ * ROG ZENITH II EXTREME
 
 Authors:
     - Eugene Shalygin <eugene.shalygin@gmail.com>
index e5d85e40972c287d63be6e5a439f9e5626b79af1..d8f1d6859b964be0cda1fd299cc3a580d33ba62d 100644 (file)
@@ -46,6 +46,9 @@ temp[1-10]_input                RO      Temperature reading in milli-degrees
 temp[1-10]_label                RO      Temperature sensor label.
 =============================== ======= =======================================
 
+Due to the nature of the SMM interface, each pwmX attribute controls
+fan number X.
+
 Disabling automatic BIOS fan control
 ------------------------------------
 
index a72c16872ec2d4147fb4599c4c010d3917045157..f7113b0f8b2a66fb23227db7b12083d79272da43 100644 (file)
@@ -109,6 +109,7 @@ Hardware Monitoring Kernel Drivers
    lm95234
    lm95245
    lochnagar
+   lt7182s
    ltc2992
    ltc2945
    ltc2947
index 05391fb4042d96d1a00fa386cf638d569204772c..23af17a0ab442da9e3882fcbe0c0d0f325e4bad5 100644 (file)
@@ -3,6 +3,14 @@ Kernel driver lm90
 
 Supported chips:
 
+  * National Semiconductor LM84
+
+    Prefix: 'lm84'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the National Semiconductor website
+
   * National Semiconductor LM90
 
     Prefix: 'lm90'
@@ -43,6 +51,30 @@ Supported chips:
 
               http://www.national.com/mpf/LM/LM86.html
 
+  * Analog Devices ADM1020
+
+    Prefix: 'adm1020'
+
+    Addresses scanned: I2C 0x4c - 0x4e
+
+    Datasheet: Publicly available at the Analog Devices website
+
+  * Analog Devices ADM1021
+
+    Prefix: 'adm1021'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the Analog Devices website
+
+  * Analog Devices ADM1021A/ADM1023
+
+    Prefix: 'adm1023'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the Analog Devices website
+
   * Analog Devices ADM1032
 
     Prefix: 'adm1032'
@@ -73,6 +105,36 @@ Supported chips:
 
               https://www.onsemi.com/PowerSolutions/product.do?id=ADT7461A
 
+  * Analog Devices ADT7481
+
+    Prefix: 'adt7481'
+
+    Addresses scanned: I2C 0x4b and 0x4c
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=ADT7481
+
+  * Analog Devices ADT7482
+
+    Prefix: 'adt7482'
+
+    Addresses scanned: I2C 0x4c
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=ADT7482
+
+  * Analog Devices ADT7483A
+
+    Prefix: 'adt7483a'
+
+    Addresses scanned: I2C 0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=ADT7483A
+
   * ON Semiconductor NCT1008
 
     Prefix: 'nct1008'
@@ -83,6 +145,72 @@ Supported chips:
 
               https://www.onsemi.com/PowerSolutions/product.do?id=NCT1008
 
+  * ON Semiconductor NCT210
+
+    Prefix: 'adm1021'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=NCT210
+
+  * ON Semiconductor NCT214
+
+    Prefix: 'nct214'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=NCT214
+
+  * ON Semiconductor NCT218
+
+    Prefix: 'nct218'
+
+    Addresses scanned: I2C 0x4c - 0x4d
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=NCT218
+
+  * ON Semiconductor NCT72
+
+    Prefix: 'nct72'
+
+    Addresses scanned: I2C 0x4c - 0x4d
+
+    Datasheet: Publicly available at the ON Semiconductor website
+
+              https://www.onsemi.com/PowerSolutions/product.do?id=NCT72
+
+  * Maxim MAX1617
+
+    Prefix: 'max1617'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the Maxim website
+
+  * Maxim MAX1617A
+
+    Prefix: 'max1617a'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the Maxim website
+
+  * Maxim MAX6642
+
+    Prefix: 'max6642'
+
+    Addresses scanned: I2C 0x48-0x4f
+
+    Datasheet: Publicly available at the Maxim website
+
+              http://datasheets.maxim-ic.com/en/ds/MAX6642.pdf
+
   * Maxim MAX6646
 
     Prefix: 'max6646'
@@ -105,7 +233,7 @@ Supported chips:
 
   * Maxim MAX6648
 
-    Prefix: 'max6646'
+    Prefix: 'max6648'
 
     Addresses scanned: I2C 0x4c
 
@@ -191,7 +319,7 @@ Supported chips:
 
   * Maxim MAX6692
 
-    Prefix: 'max6646'
+    Prefix: 'max6648'
 
     Addresses scanned: I2C 0x4c
 
@@ -275,6 +403,46 @@ Supported chips:
 
               https://www.ti.com/lit/gpn/tmp461
 
+  * Philips NE1617, NE1617A
+
+    Prefix: 'max1617' (probably detected as a max1617)
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheets: Publicly available at the Philips website
+
+  * Philips NE1618
+
+    Prefix: 'ne1618'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheets: Publicly available at the Philips website
+
+  * Genesys Logic GL523SM
+
+    Prefix: 'gl523sm'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet:
+
+  * TI THMC10
+
+    Prefix: 'thmc10'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the TI website
+
+  * Onsemi MC1066
+
+    Prefix: 'mc1066'
+
+    Addresses scanned: I2C 0x18 - 0x1a, 0x29 - 0x2b, 0x4c - 0x4e
+
+    Datasheet: Publicly available at the Onsemi website
+
 Author: Jean Delvare <jdelvare@suse.de>
 
 
@@ -285,6 +453,12 @@ The LM90 is a digital temperature sensor. It senses its own temperature as
 well as the temperature of up to one external diode. It is compatible
 with many other devices, many of which are supported by this driver.
 
+The family of chips supported by this driver is derived from MAX1617.
+This chip as well as various compatible chips support a local and a remote
+temperature sensor with 8 bit accuracy. Later chips provide improved accuracy
+and other additional features such as hysteresis and temperature offset
+registers.
+
 Note that there is no easy way to differentiate between the MAX6657,
 MAX6658 and MAX6659 variants. The extra features of the MAX6659 are only
 supported by this driver if the chip is located at address 0x4d or 0x4e,
@@ -292,15 +466,31 @@ or if the chip type is explicitly selected as max6659.
 The MAX6680 and MAX6681 only differ in their pinout, therefore they obviously
 can't (and don't need to) be distinguished.
 
-The specificity of this family of chipsets over the ADM1021/LM84
-family is that it features critical limits with hysteresis, and an
-increased resolution of the remote temperature measurement.
-
 The different chipsets of the family are not strictly identical, although
 very similar. For reference, here comes a non-exhaustive list of specific
 features:
 
+LM84:
+  * 8 bit sensor resolution
+
+ADM1020, ADM1021, GL523SM, MAX1617, NE1617, NE1617A, THMC10:
+  * 8 bit sensor resolution
+  * Low temperature limits
+
+NCT210, NE1618:
+  * 11 bit sensor resolution for remote temperature sensor
+  * Low temperature limits
+
+ADM1021A, ADM1023:
+  * Temperature offset register for remote temperature sensor
+  * 11 bit resolution for remote temperature sensor
+  * Low temperature limits
+
 LM90:
+  * 11 bit resolution for remote temperature sensor
+  * Temperature offset register for remote temperature sensor
+  * Low and critical temperature limits
+  * Configurable conversion rate
   * Filter and alert configuration register at 0xBF.
   * ALERT is triggered by temperatures over critical limits.
 
@@ -322,8 +512,31 @@ ADM1032:
 ADT7461, ADT7461A, NCT1008:
   * Extended temperature range (breaks compatibility)
   * Lower resolution for remote temperature
+  * SMBus PEC support for Write Byte and Receive Byte transactions.
+  * 10 bit temperature resolution
+
+ADT7481, ADT7482, ADT7483:
+  * Temperature offset register
+  * SMBus PEC support
+  * 10 bit temperature resolution for external sensors
+  * Two remote sensors
+  * Selectable address (ADT7483)
+
+MAX6642:
+  * No critical limit register
+  * Conversion rate not configurable
+  * Better local resolution (10 bit)
+  * 10 bit external sensor resolution
+
+MAX6646, MAX6647, MAX6649:
+  * Better local resolution
+  * Extended range unsigned external temperature
+
+MAX6648, MAX6692:
+  * Better local resolution
+  * Unsigned temperature
 
-MAX6654:
+MAX6654, MAX6690:
   * Better local resolution
   * Selectable address
   * Remote sensor type selection
@@ -423,6 +636,6 @@ two transactions will typically mean twice as much delay waiting for
 transaction completion, effectively doubling the register cache refresh time.
 I guess reliability comes at a price, but it's quite expensive this time.
 
-So, as not everyone might enjoy the slowdown, PEC can be disabled through
-sysfs. Just write 0 to the "pec" file and PEC will be disabled. Write 1
-to that file to enable PEC again.
+So, as not everyone might enjoy the slowdown, PEC is disabled by default and
+can be enabled through sysfs. Just write 1 to the "pec" file and PEC will be
+enabled. Write 0 to that file to disable PEC again.
diff --git a/Documentation/hwmon/lt7182s.rst b/Documentation/hwmon/lt7182s.rst
new file mode 100644 (file)
index 0000000..f726831
--- /dev/null
@@ -0,0 +1,92 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Kernel driver lt7182s
+=====================
+
+Supported chips:
+
+  * ADI LT7182S
+
+    Prefix: 'lt7182s'
+
+    Addresses scanned: -
+
+    Datasheet: https://www.analog.com/en/products/lt7182s.html
+
+Author: Guenter Roeck <linux@roeck-us.net>
+
+
+Description
+-----------
+
+LT7182S is a Dual Channel 6A, 20V PolyPhase Step-Down Silent Switcher with
+Digital Power System Management support.
+
+
+Usage Notes
+-----------
+
+This driver does not probe for PMBus devices. You will have to instantiate
+devices explicitly.
+
+Example: the following commands will load the driver for a LT7182S
+at address 0x4f on I2C bus #4::
+
+    # modprobe lt7182s
+    # echo lt7182s 0x4f > /sys/bus/i2c/devices/i2c-4/new_device
+
+It can also be instantiated by declaring an entry in device tree.
+
+
+Sysfs attributes
+----------------
+
+======================= ====================================
+curr[1-2]_label                "iin[12]"
+curr[1-2]_input                Measured input current
+curr[1-2]_max          Maximum input current
+curr[1-2]_max_alarm    Current high alarm
+
+curr[3-4]_label                "iout[1-2]"
+curr[3-4]_input                Measured output current
+curr[3-4]_highest      Highest measured output current
+curr[3-4]_max          Maximum output current
+curr[3-4]_max_alarm    Output current high alarm
+
+in[1-2]_label          "vin[12]"
+in[1-2]_input          Measured input voltage
+in[1-2]_highest                Highest measured input voltage
+in[1-2]_crit           Critical maximum input voltage
+in[1-2]_crit_alarm     Input voltage critical high alarm
+in[1-2]_min            Minimum input voltage
+in[1-2]_min_alarm      Input voltage low alarm
+in[1-2]_rated_min      Rated minimum input voltage
+in[1-2]_rated_max      Rated maximum input voltage
+in1_reset_history      Write to reset history for all attributes
+
+in[3-5]_label          "vmon[1-3]"
+in[3-5]_input          Measured voltage on ITH1/ITH2/EXTVCC pins
+                       Only available if enabled with MFR_ADC_CONTROL_LT7182S
+                       command.
+
+in[3-4|6-7]_label      "vout[1-2]"
+in[3-4|6-7]_input      Measured output voltage
+in[3-4|6-7]_highest    Highest measured output voltage
+in[3-4|6-7]_lcrit      Critical minimum output voltage
+in[3-4|6-7]_lcrit_alarm        Output voltage critical low alarm
+in[3-4|6-7]_min                Minimum output voltage
+in[3-4|6-7]_max_alarm  Output voltage low alarm
+in[3-4|6-7]_max                Maximum output voltage
+in[3-4|6-7]_max_alarm  Output voltage high alarm
+in[3-4|6-7]_crit       Critical maximum output voltage
+in[3-4|6-7]_crit_alarm Output voltage critical high alarm
+
+power[1-2]_label       "pout[1-2]"
+power[1-2]_input       Measured output power
+
+temp1_input            Measured temperature
+temp1_crit             Critical high temperature
+temp1_crit_alarm       Chip temperature critical high alarm
+temp1_max              Maximum temperature
+temp1_max_alarm                Chip temperature high alarm
+======================= ====================================
index e7e0c9ef10bec461bf6d9dd2f1f00c8dee59ecdc..84c5a4e40c409c3632595add8ad50dadbbe2dc41 100644 (file)
@@ -121,6 +121,15 @@ Specifically, it provides the following information.
   non-standard PMBus commands to standard commands, or to augment standard
   command return values with device specific information.
 
+PEC Support
+===========
+
+Many PMBus devices support SMBus PEC (Packet Error Checking). If supported
+by both the I2C adapter and by the PMBus chip, it is by default enabled.
+If PEC is supported, the PMBus core driver adds an attribute named 'pec' to
+the I2C device. This attribute can be used to control PEC support in the
+communication with the PMBus chip.
+
 API functions
 =============
 
index b12df9137e1c176f841f270f7829bdd1fa34e728..832b5d36e279cd4a89a6f3447c15c7ea3a3a6fef 100644 (file)
@@ -1894,6 +1894,7 @@ There are some more advanced barrier functions:
 
  (*) dma_wmb();
  (*) dma_rmb();
+ (*) dma_mb();
 
      These are for use with consistent memory to guarantee the ordering
      of writes or reads of shared memory accessible to both the CPU and a
@@ -1925,11 +1926,11 @@ There are some more advanced barrier functions:
      The dma_rmb() allows us guarantee the device has released ownership
      before we read the data from the descriptor, and the dma_wmb() allows
      us to guarantee the data is written to the descriptor before the device
-     can see it now has ownership.  Note that, when using writel(), a prior
-     wmb() is not needed to guarantee that the cache coherent memory writes
-     have completed before writing to the MMIO region.  The cheaper
-     writel_relaxed() does not provide this guarantee and must not be used
-     here.
+     can see it now has ownership.  The dma_mb() implies both a dma_rmb() and
+     a dma_wmb().  Note that, when using writel(), a prior wmb() is not needed
+     to guarantee that the cache coherent memory writes have completed before
+     writing to the MMIO region.  The cheaper writel_relaxed() does not provide
+     this guarantee and must not be used here.
 
      See the subsection "Kernel I/O barrier effects" for more information on
      relaxed I/O accessors and the Documentation/core-api/dma-api.rst file for
index 66c72230eaade96599bbfff2914b98e9011a3df8..d7a1bf1a55b5eb3009f30cdf964b03e39d15e0d4 100644 (file)
@@ -2866,7 +2866,14 @@ sctp_rmem - vector of 3 INTEGERs: min, default, max
        Default: 4K
 
 sctp_wmem  - vector of 3 INTEGERs: min, default, max
-       Currently this tunable has no effect.
+       Only the first value ("min") is used, "default" and "max" are
+       ignored.
+
+       min: Minimum size of send buffer that can be used by SCTP sockets.
+       It is guaranteed to each SCTP socket (but not association) even
+       under moderate memory pressure.
+
+       Default: 4K
 
 addr_scope_policy - INTEGER
        Control IPv4 address scoping - draft-stewart-tsvwg-sctp-ipv4-00
index 38290b9f25eb25a0c20f7a674c17afa6eb5d1892..b0a519f456cfa37560a7ae97ce7c913724204d93 100644 (file)
@@ -201,9 +201,6 @@ static_key->entry field makes use of the two least significant bits.
 * ``void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)``,
     see: arch/x86/kernel/jump_label.c
 
-* ``__init_or_module void arch_jump_label_transform_static(struct jump_entry *entry, enum jump_label_type type)``,
-    see: arch/x86/kernel/jump_label.c
-
 * ``struct jump_entry``,
     see: arch/x86/include/asm/jump_label.h
 
index 4d43fbc2519531f5c64acc78f063ac5708ff83ff..412b276449d3a99df28e68053715e4c0baa71cfc 100644 (file)
@@ -60,12 +60,13 @@ these functions (see arch/arm{,64}/include/asm/virt.h):
 
 * ::
 
-    x0 = HVC_VHE_RESTART (arm64 only)
+    x0 = HVC_FINALISE_EL2 (arm64 only)
 
-  Attempt to upgrade the kernel's exception level from EL1 to EL2 by enabling
-  the VHE mode. This is conditioned by the CPU supporting VHE, the EL2 MMU
-  being off, and VHE not being disabled by any other means (command line
-  option, for example).
+  Finish configuring EL2 depending on the command-line options,
+  including an attempt to upgrade the kernel's exception level from
+  EL1 to EL2 by enabling the VHE mode. This is conditioned by the CPU
+  supporting VHE, the EL2 MMU being off, and VHE not being disabled by
+  any other means (command line option, for example).
 
 Any other value of r0/x0 triggers a hypervisor-specific handling,
 which is not documented here.
index 64379c699903bc022dc7656eb02dadc8a18818b1..21b58f9b8b1064b627bfc30cfd550a37517de9e2 100644 (file)
@@ -242,6 +242,11 @@ F: include/trace/events/9p.h
 F:     include/uapi/linux/virtio_9p.h
 F:     net/9p/
 
+A64FX DIAG DRIVER
+M:     Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>
+S:     Supported
+F:     drivers/soc/fujitsu/a64fx-diag.c
+
 A8293 MEDIA DRIVER
 M:     Antti Palosaari <crope@iki.fi>
 L:     linux-media@vger.kernel.org
@@ -1894,6 +1899,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
@@ -2141,11 +2147,13 @@ M:      Jean-Marie Verdun <verdun@hpe.com>
 M:     Nick Hawkins <nick.hawkins@hpe.com>
 S:     Maintained
 F:     Documentation/devicetree/bindings/arm/hpe,gxp.yaml
+F:     Documentation/devicetree/bindings/spi/hpe,gxp-spi.yaml
 F:     Documentation/devicetree/bindings/timer/hpe,gxp-timer.yaml
 F:     arch/arm/boot/dts/hpe-bmc*
 F:     arch/arm/boot/dts/hpe-gxp*
 F:     arch/arm/mach-hpe/
 F:     drivers/clocksource/timer-gxp.c
+F:     drivers/spi/spi-gxp.c
 F:     drivers/watchdog/gxp-wdt.c
 
 ARM/IGEP MACHINE SUPPORT
@@ -2449,9 +2457,11 @@ F:       Documentation/devicetree/bindings/*/*npcm*
 F:     Documentation/devicetree/bindings/arm/npcm/*
 F:     arch/arm/boot/dts/nuvoton-npcm*
 F:     arch/arm/mach-npcm/
+F:     arch/arm64/boot/dts/nuvoton/
 F:     drivers/*/*npcm*
 F:     drivers/*/*/*npcm*
 F:     include/dt-bindings/clock/nuvoton,npcm7xx-clock.h
+F:     include/dt-bindings/clock/nuvoton,npcm845-clk.h
 
 ARM/NUVOTON WPCM450 ARCHITECTURE
 M:     Jonathan Neuschäfer <j.neuschaefer@gmx.net>
@@ -2616,6 +2626,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/
@@ -2734,6 +2746,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*
@@ -2823,6 +2836,23 @@ F:       drivers/clocksource/armv7m_systick.c
 N:     stm32
 N:     stm
 
+ARM/SUNPLUS SP7021 SOC SUPPORT
+M:     Qin Jian <qinjian@cqplus1.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for mon-subscribers)
+S:     Maintained
+W:     https://sunplus-tibbo.atlassian.net/wiki/spaces/doc/overview
+F:     Documentation/devicetree/bindings/arm/sunplus,sp7021.yaml
+F:     Documentation/devicetree/bindings/clock/sunplus,sp7021-clkc.yaml
+F:     Documentation/devicetree/bindings/interrupt-controller/sunplus,sp7021-intc.yaml
+F:     Documentation/devicetree/bindings/reset/sunplus,reset.yaml
+F:     arch/arm/boot/dts/sunplus-sp7021*.dts*
+F:     arch/arm/configs/sp7021_*defconfig
+F:     arch/arm/mach-sunplus/
+F:     drivers/irqchip/irq-sp7021-intc.c
+F:     drivers/reset/reset-sunplus.c
+F:     include/dt-bindings/clock/sunplus,sp7021-clkc.h
+F:     include/dt-bindings/reset/sunplus,sp7021-reset.h
+
 ARM/Synaptics SoC support
 M:     Jisheng Zhang <jszhang@kernel.org>
 M:     Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
@@ -3875,15 +3905,28 @@ BROADCOM BCMBCA ARM ARCHITECTURE
 M:     William Zhang <william.zhang@broadcom.com>
 M:     Anand Gore <anand.gore@broadcom.com>
 M:     Kursad Oney <kursad.oney@broadcom.com>
+M:     Florian Fainelli <f.fainelli@gmail.com>
 R:     Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 T:     git git://github.com/broadcom/stblinux.git
 F:     Documentation/devicetree/bindings/arm/bcm/brcm,bcmbca.yaml
-F:     arch/arm/boot/dts/bcm47622.dtsi
-F:     arch/arm/boot/dts/bcm947622.dts
+F:     arch/arm64/boot/dts/broadcom/bcmbca/*
 N:     bcmbca
 N:     bcm[9]?47622
+N:     bcm[9]?4912
+N:     bcm[9]?63138
+N:     bcm[9]?63146
+N:     bcm[9]?63148
+N:     bcm[9]?63158
+N:     bcm[9]?63178
+N:     bcm[9]?6756
+N:     bcm[9]?6813
+N:     bcm[9]?6846
+N:     bcm[9]?6855
+N:     bcm[9]?6856
+N:     bcm[9]?6858
+N:     bcm[9]?6878
 
 BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE
 M:     Florian Fainelli <f.fainelli@gmail.com>
@@ -3959,14 +4002,6 @@ S:       Maintained
 F:     arch/arm/boot/dts/bcm47189*
 F:     arch/arm/boot/dts/bcm53573*
 
-BROADCOM BCM63XX ARM ARCHITECTURE
-M:     Florian Fainelli <f.fainelli@gmail.com>
-R:     Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-T:     git git://github.com/broadcom/stblinux.git
-N:     bcm63xx
-
 BROADCOM BCM63XX/BCM33XX UDC DRIVER
 M:     Kevin Cernekee <cernekee@gmail.com>
 L:     linux-usb@vger.kernel.org
@@ -7485,6 +7520,8 @@ F:        include/video/s1d13xxxfb.h
 EROFS FILE SYSTEM
 M:     Gao Xiang <xiang@kernel.org>
 M:     Chao Yu <chao@kernel.org>
+R:     Yue Hu <huyue2@coolpad.com>
+R:     Jeffle Xu <jefflexu@linux.alibaba.com>
 L:     linux-erofs@lists.ozlabs.org
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
@@ -9036,6 +9073,12 @@ F:       Documentation/admin-guide/perf/hisi-pcie-pmu.rst
 F:     Documentation/admin-guide/perf/hisi-pmu.rst
 F:     drivers/perf/hisilicon
 
+HISILICON HNS3 PMU DRIVER
+M:     Guangbin Huang <huangguangbin2@huawei.com>
+S:     Supported
+F:     Documentation/admin-guide/perf/hns3-pmu.rst
+F:     drivers/perf/hisilicon/hns3_pmu.c
+
 HISILICON QM AND ZIP Controller DRIVER
 M:     Zhou Wang <wangzhou1@hisilicon.com>
 L:     linux-crypto@vger.kernel.org
@@ -9618,6 +9661,7 @@ F:        drivers/input/misc/ideapad_slidebar.c
 
 IDMAPPED MOUNTS
 M:     Christian Brauner <brauner@kernel.org>
+M:     Seth Forshee <sforshee@kernel.org>
 L:     linux-fsdevel@vger.kernel.org
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
@@ -16325,7 +16369,6 @@ F:      drivers/media/rc/pwm-ir-tx.c
 PWM SUBSYSTEM
 M:     Thierry Reding <thierry.reding@gmail.com>
 R:     Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-M:     Lee Jones <lee.jones@linaro.org>
 L:     linux-pwm@vger.kernel.org
 S:     Maintained
 Q:     https://patchwork.ozlabs.org/project/linux-pwm/list/
@@ -16336,6 +16379,7 @@ F:      Documentation/driver-api/pwm.rst
 F:     drivers/gpio/gpio-mvebu.c
 F:     drivers/pwm/
 F:     drivers/video/backlight/pwm_bl.c
+F:     include/dt-bindings/pwm/
 F:     include/linux/pwm.h
 F:     include/linux/pwm_backlight.h
 K:     pwm_(config|apply_state|ops)
@@ -16660,6 +16704,13 @@ S:     Maintained
 F:     Documentation/devicetree/bindings/i2c/i2c-qcom-cci.txt
 F:     drivers/i2c/busses/i2c-qcom-cci.c
 
+QUALCOMM INTERCONNECT BWMON DRIVER
+M:     Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
+L:     linux-arm-msm@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml
+F:     drivers/soc/qcom/icc-bwmon.c
+
 QUALCOMM IOMMU
 M:     Rob Clark <robdclark@gmail.com>
 L:     iommu@lists.linux.dev
@@ -17283,6 +17334,7 @@ F:      drivers/clk/microchip/clk-mpfs.c
 F:     drivers/mailbox/mailbox-mpfs.c
 F:     drivers/pci/controller/pcie-microchip-host.c
 F:     drivers/soc/microchip/
+F:     drivers/spi/spi-microchip-core.c
 F:     include/soc/microchip/mpfs.h
 
 RNBD BLOCK DRIVERS
index b79c1c18149d38ff8798df248d73ec819c8a8dfe..df92892325ae0bc35a31de1d8b606dbd84154cb7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
 VERSION = 5
 PATCHLEVEL = 19
 SUBLEVEL = 0
-EXTRAVERSION = -rc8
+EXTRAVERSION =
 NAME = Superb Owl
 
 # *DOCUMENTATION*
index 71b9272acb28bf0e4f23226954c1d2a3be1fd256..5ea3e3838c2115e5c11117bb78eec74dba658651 100644 (file)
@@ -223,6 +223,9 @@ config HAVE_FUNCTION_DESCRIPTORS
 config TRACE_IRQFLAGS_SUPPORT
        bool
 
+config TRACE_IRQFLAGS_NMI_SUPPORT
+       bool
+
 #
 # An arch should select this if it provides all these things:
 #
index f6d2946edbd2465c5488292ceb8b2f6f12154673..15f2effd6baf80d272988a123388cc7dd7754af6 100644 (file)
@@ -60,7 +60,7 @@ int irq_select_affinity(unsigned int irq)
                cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);
        last_cpu = cpu;
 
-       cpumask_copy(irq_data_get_affinity_mask(data), cpumask_of(cpu));
+       irq_data_update_affinity(data, cpumask_of(cpu));
        chip->irq_set_affinity(data, cpumask_of(cpu), false);
        return 0;
 }
index b8600dc325b5aa6db4f0d2cfa65f3139c713640b..70b74a5d047b75a6b495c323c625ee1dee9bdc05 100644 (file)
@@ -96,19 +96,6 @@ void arch_jump_label_transform(struct jump_entry *entry,
        flush_icache_range(entry->code, entry->code + JUMP_LABEL_NOP_SIZE);
 }
 
-void arch_jump_label_transform_static(struct jump_entry *entry,
-                                     enum jump_label_type type)
-{
-       /*
-        * We use only one NOP type (1x, 4 byte) in arch_static_branch, so
-        * there's no need to patch an identical NOP over the top of it here.
-        * The generic code calls 'arch_jump_label_transform' if the NOP needs
-        * to be replaced by a branch, so 'arch_jump_label_transform_static' is
-        * never called with type other than JUMP_LABEL_NOP.
-        */
-       BUG_ON(type != JUMP_LABEL_NOP);
-}
-
 #ifdef CONFIG_ARC_DBG_JUMP_LABEL
 #define SELFTEST_MSG   "ARC: instruction generation self-test: "
 
index 7630ba9cb6ccc30cd75672c57e0aa248f5a298c9..40559667647370f4e78d6bc1597d7288c1950181 100644 (file)
@@ -350,6 +350,7 @@ config ARCH_MULTIPLATFORM
 config ARCH_FOOTBRIDGE
        bool "FootBridge"
        depends on CPU_LITTLE_ENDIAN
+       depends on ATAGS
        select CPU_SA110
        select FOOTBRIDGE
        select NEED_MACH_MEMORY_H
@@ -361,6 +362,7 @@ config ARCH_RPC
        bool "RiscPC"
        depends on !CC_IS_CLANG && GCC_VERSION < 90100 && GCC_VERSION >= 60000
        depends on CPU_LITTLE_ENDIAN
+       depends on ATAGS
        select ARCH_ACORN
        select ARCH_MAY_HAVE_PC_FDC
        select ARCH_SPARSEMEM_ENABLE
@@ -380,6 +382,7 @@ config ARCH_RPC
 config ARCH_SA1100
        bool "SA1100-based"
        depends on CPU_LITTLE_ENDIAN
+       depends on ATAGS
        select ARCH_MTD_XIP
        select ARCH_SPARSEMEM_ENABLE
        select CLKSRC_MMIO
@@ -588,6 +591,8 @@ source "arch/arm/mach-sti/Kconfig"
 
 source "arch/arm/mach-stm32/Kconfig"
 
+source "arch/arm/mach-sunplus/Kconfig"
+
 source "arch/arm/mach-sunxi/Kconfig"
 
 source "arch/arm/mach-tegra/Kconfig"
@@ -1539,14 +1544,26 @@ config USE_OF
          Include support for flattened device tree machine descriptions.
 
 config ATAGS
-       bool "Support for the traditional ATAGS boot data passing" if USE_OF
+       bool "Support for the traditional ATAGS boot data passing"
        default y
        help
          This is the traditional way of passing data to the kernel at boot
          time. If you are solely relying on the flattened device tree (or
          the ARM_ATAG_DTB_COMPAT option) then you may unselect this option
-         to remove ATAGS support from your kernel binary.  If unsure,
-         leave this to y.
+         to remove ATAGS support from your kernel binary.
+
+config UNUSED_BOARD_FILES
+       bool "Board support for machines without known users"
+       depends on ATAGS
+       help
+         Most ATAGS based board files are completely unused and are
+         scheduled for removal in early 2023, and left out of kernels
+         by default now.  If you are using a board file that is marked
+         as unused, turn on this option to build support into the kernel.
+
+         To keep support for your individual board from being removed,
+         send a reply to the email discussion at
+         https://lore.kernel.org/all/CAK8P3a0Z9vGEQbVRBo84bSyPFM-LF+hs5w8ZA51g2Z+NsdtDQA@mail.gmail.com/
 
 config DEPRECATED_PARAM_STRUCT
        bool "Provide old way to pass kernel parameters"
index 9b0aa4822d6934a544e9af831df888695b9a8bf3..792796a348c3287e2a2ac2b10803b8b1a4639686 100644 (file)
@@ -271,7 +271,7 @@ choice
 
        config DEBUG_BCM63XX_UART
                bool "Kernel low-level debugging on BCM63XX UART"
-               depends on ARCH_BCM_63XX
+               depends on ARCH_BCMBCA
 
        config DEBUG_BERLIN_UART
                bool "Marvell Berlin SoC Debug UART"
index c8e3633f5434f6fd3edc2c66797462b26eabb20f..56f655deebb14c38beddacfa713b27933c4c7b8c 100644 (file)
@@ -215,6 +215,7 @@ machine-$(CONFIG_ARCH_RENESAS)              += shmobile
 machine-$(CONFIG_ARCH_INTEL_SOCFPGA)   += socfpga
 machine-$(CONFIG_ARCH_STI)             += sti
 machine-$(CONFIG_ARCH_STM32)           += stm32
+machine-$(CONFIG_ARCH_SUNPLUS)         += sunplus
 machine-$(CONFIG_ARCH_SUNXI)           += sunxi
 machine-$(CONFIG_ARCH_TEGRA)           += tegra
 machine-$(CONFIG_ARCH_U8500)           += ux500
index 5112f493f49462eac8ba7f2cee38deab059a2b93..05d8aef6e5d252b9cb2be1d23fc47b282cf16258 100644 (file)
@@ -79,6 +79,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \
        at91-vinco.dtb
 dtb-$(CONFIG_SOC_SAMA7G5) += \
        at91-sama7g5ek.dtb
+dtb-$(CONFIG_SOC_SP7021) += \
+       sunplus-sp7021-demo-v3.dtb
 dtb-$(CONFIG_ARCH_AXXIA) += \
        axm5516-amarillo.dtb
 dtb-$(CONFIG_ARCH_BCM2835) += \
@@ -135,6 +137,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 +149,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 +183,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 +559,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 +751,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 +776,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) += \
@@ -770,9 +786,10 @@ dtb-$(CONFIG_SOC_IMX7ULP) += \
 dtb-$(CONFIG_SOC_IMXRT) += \
        imxrt1050-evk.dtb
 dtb-$(CONFIG_SOC_LAN966) += \
-       lan966x-pcb8291.dtb \
        lan966x-kontron-kswitch-d10-mmt-6g-2gs.dtb \
-       lan966x-kontron-kswitch-d10-mmt-8g.dtb
+       lan966x-kontron-kswitch-d10-mmt-8g.dtb \
+       lan966x-pcb8291.dtb \
+       lan966x-pcb8309.dtb
 dtb-$(CONFIG_SOC_LS1021A) += \
        ls1021a-iot.dtb \
        ls1021a-moxa-uc-8410a.dtb \
@@ -1148,7 +1165,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 +1209,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 +1576,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 \
index 3b0675a1c46073d4a7c0c6f579609901dd0aaa74..4be9887033f99a318c383bb0ad9dad8f12c32673 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 c72b09ab8da016766ca13d2c342aa04b71c59aad..207d2b63e0eb37e3a87d1793f15f43bf5cb5e249 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 9312197316f008b4b1a6832366d4420384dfc640..b956e2f60fe0701bf35ccac55d0388017dc41a10 100644 (file)
                "NC",
                "NC";
 };
+
+&baseboard_eeprom {
+       vcc-supply = <&ldo4_reg>;
+};
index 147c00de37955929a2b1e8b053aac0e0e3e86cb0..34579e98636e637c09aa68cf3bd57b58c19f0f04 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 215f279e476bb59f3b76ddd83d62af91200d5a10..d388cffa1a4d61d79ee90a874b4c6d06ea518f99 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 d9f003d886bf56da4f493c05e6ca87b8cd686afd..993b1342069966a716c014b8a369b75d0588cef9 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 b9745a2f0e4dea5cf6efb9c14b0f91dfa26e7a04..25c6ac9913d2e339167eabae481b7df572122823 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 1a7e187b1953913dfc0021e1cee0e9c52d66c516..f6356266564c87f259ed3b2ca6132bff01b9784c 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 92a0e98ec23170573a5708954fc1f21b9244d5f8..7b40ca9483ca2460a989ec78a78c396501a83cd5 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 e7e439a0630a526d75a8940601f093d5067198b1..e0364adb83938f43c6cfd5bafc832d35175ed1f7 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 124026fa0d095324ade7b27d33cdc371865ba043..dae448040a97b4abfa39889728a661d4c335ba33 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 b5e88e627bc1816e049cb3917ce0cf35ce30bc79..8691eec33b61b408f9a49a3cf2d184649cff88d3 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 246a1a9b3e44f6b2cad0c4e36fc6ba2a86df30c5..a2676d10c24af1830ba6daabf22579db4f85f28c 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 6b9877560741492fa83956c96219f16e9da066b1..c497200f9cb0b436590feb975c68a1d1af113056 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 7d8f32bf70db2c632713931ed4aff6d987fe9178..75ad42179aeebeb9e1b43f39cf6f0719ba2235b7 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 c8b80f156ec981bac2de6c8440deb878179ec7aa..35b653014f2b0afed32a8ff5f8b5f684f152dd85 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 c9323d1df303544174bc4757281c30d1c17c25af..d039af87936761a316c1d81080113219d81f12be 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 5a74b83145cfcbf08d03cdbc48aa707f46f676b2..123a95f875540450c1d4a32c088412faf55f23e7 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 8f2268c027785787c6b292b26759020da34bb4b0..415210b034efa441d6999609ead732bc6edee71a 100644 (file)
 
                                adc {
                                        #io-channel-cells = <1>;
-                                       compatible ="ti,am4372-adc";
+                                       compatible = "ti,am4372-adc";
                                };
                        };
                };
index 7da718abbd8529b8fba636b4cd599439a5479eee..29936bfbeeb7ea5367188613976c02ba4cbe4bb6 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 1a4a09bdde634d3cea4ba5f0f47447287a9463d2..84d40e1d70effea5916c2ffa46c3c8688f054b29 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 c910d157a6860fa0caeaf67c8d41f1302abaa75c..6ba7699b69edb09311ab037c1c19f121852f18fb 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 b52634ecf1d9c07d8df1b376e6ae6be31c165e68..866b8630d407ef0b7049e0a7fd4f5b20f866ebe3 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 0abac5ffe45aa420bac19f565c2a24616cb67bef..702a85af2078363c06c5a65a543978686652536e 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 396172067f6abfa1a38a6fa397cee9e092609393..095df5567c931d546edab51619ffe8f0910d2782 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 10ad46f29393de6059507e0707e432993efbdfea..d1452a04e9040dc6e1e6de073617e5b2469307f9 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 fb9c8a0b241c646f3ff119d6790d148126f6358f..116aca5e688fc60d6234bc956f0a6fb4528f9052 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 f4878df39753edb8a6ecab59fbbc82d42f08a0e2..d1e0db6e573072fb4db0e2b587a643f4333e9adc 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 53b4bd35522ad92a2456fe3196cc8778b2afe1a7..f7daa3bc707ef0219a392d9d23158902b7ec2115 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 4140a5303b4824e5741b70b996c6caaada1b72bf..95299167dcf580e4a6e251d7b6bfee3885d352b0 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 3e77b4337802c88fb567af0451cd9ac69c7fb5e2..5a74197be0ad8232dd51cd5b7d3de65962150ab3 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 36932e3b781abe8ac0d171c2d2ba6b6cb25ba834..622ac40dd16443ac5062cf146e97432446253a9d 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 0efcc166dabf6bb00f34ca25f12ea818a55e34bc..1ecf72a61bcad1e045c27dfd3e4fac6816de9c3c 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 1d24b394ea4c3e3686d14006c0690afe3fd700c9..a497dd135491b35bffed47843f32146e5a9963af 100644 (file)
@@ -5,7 +5,7 @@
 
 / {
        model = "AST2500 EVB";
-       compatible = "aspeed,ast2500";
+       compatible = "aspeed,ast2500-evb", "aspeed,ast2500";
 
        aliases {
                serial4 = &uart5;
index dd7148060c4a33ab93ea562be427345daa73f695..d0a5c2ff0fec429b9dddf44616010dac52c85262 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 5a6063bd4508db7f209007306b4c931a56e5ed21..c698e653826937f0fb5566140abf42277585bdd7 100644 (file)
@@ -8,7 +8,7 @@
 
 / {
        model = "AST2600 EVB";
-       compatible = "aspeed,ast2600";
+       compatible = "aspeed,ast2600-evb-a1", "aspeed,ast2600";
 
        aliases {
                serial4 = &uart5;
index 1b2e7ad37566cba07050993fb9bc16fd09f22299..82a6f14a45f002e88dedb1c725ab5b6bd1145e60 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 0d1fb5ccfd36b63799c9088502f759d94b91d475..f75cad41ae6f644bdd07dcb2ba47b2596886c0bb 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 382da7934eaa2ec84c4371fa35a8c93176b3f1f7..a6a2bc3b855c2e1b45b24b16d19288a93a1beb52 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 7213434695bf205b17ef4449e18f41fbecfc9e79..bf59a9962379d14fa2210a5bacdbde16de204fe2 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 60a39ea10ab1c46eb65180cbccd28cff7aefffee..208b0f094ed95f4e0f4055387b4c8033d3854a36 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>;
index a52a289cee85ec944ff386493a0b67c0048a815e..48776fb663fbbad0b3296c7b7c178a5e3f4335f3 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 7d38d121ec6da91f80f6452d7f6ca1b46ea9dbba..31ff19ef87a0b456927c0585f1cb5ff810316289 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 3d4bdad27c2dcc278e93cf775cf6308b2e30ba91..ac0d666ca10ef477e2d87ca0f2b9a41820cdf507 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 cd660c1ff3f503fd5afae505487e436146b0a635..45631b47a7b394482a0ffe9c77157f9a92acd21c 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 084f54866f386ee7abaa41b6b06e11fe070f96b2..893e621ecab11722971b253a9817eefae35b9558 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 4816486c0c9eb8c2481ef3cf05078fa54d2cfba5..bbf864f84d37f22225fcd502ded080512b6dc5ca 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 72b7a6639ed911515458eb79ada58d1b8648a67b..3f6010ef2b86f264fe88935a737b3ce9c60d762b 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 328ef472c479d921f48a0d1ff0296d67af378a67..8a7fb55ab48933910b232e3be4a5c2deafa84a1f 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 230f3584bcab01d683d4c2a79ed065956e51b0d0..a20a532fc2805fe17726969bba611ee173866705 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 7ae4ea0d2931bf4c9b1c99b6b86c909292c9d042..0cb7b20ff3ab88d73bee9808698014e41c5dbceb 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 61bc74b423cf3e5c0ae8672401f370fed2f9af15..a5e64ccc2b3a422d3fabcac1c72f3ef166afb2dc 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
index 69e1bd256271160c91612740cf0c60c82bb17474..46cbba6305b8f3245439e24c1553febaedaf20e4 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 7edf057047f8f06bf0a49a05a6182a451861afdd..9dfd5de808d18add2cfc0c04f0cfc28fc2b604f8 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               btn {
+               button {
                        label = "Button";
                        gpios = <&pioC 4 GPIO_ACTIVE_LOW>;
                        linux,code = <0x103>;
index 5a81cab5fc3a74ff31e3ec4e183c17cf776ab9cf..2c718cf84d7b444926ec3db9a1bb204db0aedc2c 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 3b8812fcd8540f6a8efee1685f0b2e6ebdb6b921..307663b4eec25e2b7bf13145b9cce5134b778849 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 c08834ddf07b261274b1cd3a3c18ad59be93b62e..e5e21dff882fba05c14fa58d5361edf9f2495495 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 2799b2a1f4d25856eda252b4a64d7396448d4059..7075df6549e99ad97b15ace959a2fc0bc7e4153c 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 9c622892c69296f52c9d8c3214f835f93361d861..42640fe6b6d045c93617bdfda12e43ca47222454 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 4f123477e631d08624cb0c14a9cb97f7bdfbb514..f71377c9b757f9a893e30d35fe96955ea72528ab 100644 (file)
@@ -18,7 +18,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               wakeup {
+               key-wakeup {
                        label = "Wakeup";
                        linux,code = <10>;
                        wakeup-source;
index 969d990767fc1a6082d126ccb8642f80aff07811..9d26f999634839770c412e11f4e198f2b559afdf 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 81ccb0636a009c5c340e597cb925f6d0a137fdf3..81c38e101f586d6e7c12536a5b003d8f92904b4b 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 a4623cc67cc1e56dcacfe6c4f79a8a44aeb70dbe..8aa9e8dea3375e906fd08c553311ffe9b8500a71 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 08f0d4b995ffd0aba25afd08c1949a2f402f32ea..0dc6ca377b0c6e6e27de1320c75dc1a304442a74 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 ba621783acdbcc3daa32e4b14d602e6ced226c1a..76b2025c67b4ce18c5a9ed65d3f5b88b44cab216 100644 (file)
 &macb0 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_macb0_default>;
+       #address-cells = <1>;
+       #size-cells = <0>;
        phy-mode = "rmii";
 
        ethernet-phy@0 {
index 5e8755f22784f3ef133ac87dd1e085f82e8d41d5..b665ddc6b0de9e08a3d59303f07a4a460cfadfc8 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 164201a8fbf2d876e11758d07eaed3829cd9d25d..6865be8d7787dad56946cd95211c014562981233 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 8ed58af013919f70bf475462340cd6cd53bec805..76a711b167b0b5a92a10f626bc21df66acd8b7f5 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 cdfe891f9a9e65be58b660b3461724cfafedc5ad..85949c24b6879a4e0c655221f8ad6726c214f336 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 a49c2966b41e259d4d3c5353dadc01291b84813b..1f42a6a981bfed6ebbc9d5b20517c2476da5ca34 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 e519d27479362ba81ef672a4616d8f8fb0d193da..f122f302f8e02892c495075036aba284a1a0b905 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 7017f626f362d7b645dae64d8736ea8e42df5633..fce4e93c6bee808bb52055d8b1b02225f0a8016d 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 103544620fd7cab9295dd2f4d02ce7d6b58bb4bd..de44da2e4aae24dc3e9ea086447ffa13a5618ffa 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 54d130c921851a4e862189b7aedc7d59ee520952..ef73f727f7bde3b0918f7deef116b3fb478dae63 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 89f0f717f7ed384cfce38a069f6b427b63366dde..ec2becf6133bad2f87c32324fa4978dbd73fe3fe 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 7368347c9357ad9cb98fc1b5338a6c31f30be372..9d9820db9482c59322c233a4f445784ba857aeab 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 6381088ba24f3ef440264c58f8d17741872ca9f7..bb72f050a4fefa04afdbbec20f2e5a798db841f2 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 7adc36ca8a467572f18612f7cf4ff14321ab4735..259aca5653051f8db6d7c4b302b595b512bfd7bb 100644 (file)
                                clock-names = "slow_xtal", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&slow_xtal>;
index 6fb4fe49cf1c23141dcf2e46dfc0df30663b8c28..88869ca874d1ae3cab71bb2ff98d8a739822877f 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 fe45d96239c9a82786bfd1238eff9be38344ba64..c080df8c2312b9a74dd7d97df958b4e7ebd49584 100644 (file)
                                clock-names = "t0_clk", "slow_clk";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&slow_xtal>;
index e732565913a4b65ae4ec20fb93f05bd9275003b9..ce8baff6a9f4e0702f126d9965a1275da68b9ce0 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 85c17dd1c8d5caa3f271e17a20b94b7e80a14098..60d61291f34445142c31b511ad349948c517407b 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 7da70aeeb528fed9b6e5a49579378319ca3424f7..92f2c05c873f631a26480a0e09a00619c8e36b5e 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 2ab730fd64724ebdfe91300c866177fad1706c16..09794561c7ceb2dd6edd5f364c98eb56ff4aa78d 100644 (file)
                                clock-names = "slow_clk", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9g45-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&clk32k>;
index e5db198a87a85e816f00bf460c2655f23c7f1912..7f45e81ca165c0e4b3a51c378c403fa2de426e5a 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 0785389f5507755ed0b4cea963f162fb898855e3..556f35ce49e34a4c7952a09e96d3a08909bf2145 100644 (file)
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
                        };
 
-                       rstc@fffffe00 {
+                       reset-controller@fffffe00 {
                                compatible = "atmel,at91sam9g45-rstc";
                                reg = <0xfffffe00 0x10>;
                                clocks = <&clk32k>;
index c905d7bfc771f1c9ceb89f2a4f33401b79e62fe2..4c644d4c6be727a88f1288e6146c8982aadb194b 100644 (file)
                };
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
 
-               enter {
+               button-enter {
                        label = "Enter";
                        gpios = <&pioB 3 GPIO_ACTIVE_LOW>;
                        linux,code = <28>;
index 730d1182c73e07e8037356cb67a67af0110756e4..12c634811820120f27f0f948de36afdfee972b9c 100644 (file)
                                clock-names = "slow_clk", "main_xtal";
                        };
 
-                       rstc@fffffd00 {
+                       reset-controller@fffffd00 {
                                compatible = "atmel,at91sam9260-rstc";
                                reg = <0xfffffd00 0x10>;
                                clocks = <&clk32k>;
index ddaadfec6751940642ee6520e8d8c3168f0078d6..a57351270551a6ad8fe26374d57487f8ad03941f 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 395e883644cd86a18d154cd6bcae2ec96cedb0c6..ea3b11336c794f10703cfd15080555245a7a761f 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 3bcf4e0a3c8514920840e1183c0295f63fc1a828..f13ef80b6637346fd040d59757ad5e418d680837 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 ca266c5d9f9bb24a3e116b41588433e88314ae26..98817a6675b9dda10fa138a054d73cc78539d9df 100644 (file)
        };
 };
 
+&v3d {
+       clocks = <&firmware_clocks 5>;
+};
+
 &vchiq {
        interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>;
 };
index 89af57482bc8fa1778e1ec9ed679afc78e36f590..941c4d16791b451bd3826099d01095c8d20274a0 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 ead6e9804dbf4908cd02bb2a299e4aeb3e9a2453..78465ad37c5f0a65c2fc86e49d31d70e3081877a 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 c25e797b90600a26a5ed510084bef57e65ee80ae..a037d2bc5b114982b6540662e320c485f8f9fb0a 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 c113661a6668fe61f5ac9e4b7eeddc318d2fbc1f..d2d9c6e67f398933b4cb0a903d6b0994dd9e9b97 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 8ed403767540e2fa6b859aca0d9dfcb9498e9d27..09ee3e46c0ccdce5b0b60884cea52d41c3af33fe 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 667b118ba4ee1a35b2170414c689433cd200f243..32619c6045d3ee8c7c8adb086c447c0de021a129 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 d659e409a17e95e98f92a85c57b3379745c0f076..a658b9b7bcecd9934ed24d66b2bda57b553d5c1f 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 ff31ce45831a7b8bb8d224fae444559de9f0ff14..f8f53457dd4391144975da0498ae18528b8c4730 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 5bac1e15775a346f9f27995a234ad39c9cc8ace3..0ed25bf71f0dfa8eb18d764fb4450f26279d7a75 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 cd797b4202ad83cfe5503a3bc2596092221ad2c3..f1412ba83defbfc03c05dd1fd74e586e7ae30186 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 5b4a481be4f49ac3dbbe64b6b03993a3d1c08f24..14ee410183af6d5241329e5b62c8ba7c92cda2f0 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 c81944cd6d0bb394ca532a260a5ac81044726972..600ab087f5e5962bef70cdc19c04eec566e1d947 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 43a5d675dd675ec8d09961c81f6c387b8975b620..fd6d8d2a4456f42c358f074fe4457376464b73fd 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 4c60eda296d9737f7a0269da39952c401bf60d92..76fc1099d47d528d9111384356ffcda7934dd894 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 9ca6d1b2590d4b59f9f5f75c6aaf6a12a247218a..6bcdfb73cb9eff8893049cfdf6f83b3702760d60 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 0e273c598732f288915379e2c5e043c544a8e6a6..ca47cc4f2ba1a71f6b3162c3f4c9bebd4f45eec5 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 d00495a8b6fce9cd5832295207719ec231f3c516..0edc2543e568b2d3d29e11f1460fae384cd00bf4 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 8b1a05a0f1a115fcebe10fd9171c6f6cf0f7543b..1f0998f34afdfb2ac2c77a5907b12fa383ebb47c 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 68aaf0af39454d39d48d9135a77d0c75feba8887..c8c02377543b39680f816bc781377df6fccb07d9 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 9316a36434f7fed658bbbbaec45d1d3968f6e546..3b35a7af4b1c9fb86e540ab08528e90fde4a27bc 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 12e34a0439b4daf130871258ed9504e05e6c9dbb..19a7971b5a00fb294f861d692ff1fa714b7e89cf 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 7546c8d07bcd7a0c4fc204fa4a01e576e1aa1c57..f52a75c4ca09a1c96565c11393129b8110bf6ba1 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 beae9eab9cb8c48f3b35a28bcd5e521cd5e70e46..5ff6c588e16ec35136db6957b7e09e6f51a39565 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 7879f7d7d9c331e2fe51ae8de83e96260999fdfa..99253fd7adb31d65700666ba2936c044a9e7cc32 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 56d309dbc6b0dd1f6a4bd303a5df0ba2e5c2c694..de961fbb6200b9c1fa16f7bf094889be99d445fd 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 89f992af61d16a6f99268e95baa0587d6cb730e4..087f7f60de18cb5e0e4d51ba7a8fc795d807e68b 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 c2a266a439d0504dd76a0404b9eb840c873a1c36..11d1068160da9257b8bbec234036376634ffb889 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 d8503758342b4935d04b313b76a2cd668f6f5b4c..a5fec56d11c086b668e1f09fd1f5ee495b10cc57 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 60bfd52ee67729e24764ce4e2e26ff5b9af00b41..2c38b642a8b8e8276f0adfabcae4c8109541a7c3 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 9bef6b9bfa8d9d3827fc3344f33aeef44422ed48..86c7cc0fa70e613d165812e196abcd9551888740 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 b51a0ee7e584a44e20c1c056c4ba84a2fbaabd6c..9ad15bcae1ca7e551a7ed86b54efb519324556ae 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 6fa101f0a90d4032c98ad75bfa230bd35e64cfcb..ee24d37685368bbec40ecc00cd96bdb9ce834305 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 b959a9504eeabaa62e441df72f1772b14d0a7859..6549d07b9887a2980c720e081ccc1523f2ad894e 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 b0d8a688141d3d19c26c5e6b618311cf5d8decab..654fcce9fdede396d92714e08984c0e041f67128 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 cbe8c8e4a301271cb546aab25f268893935f76c3..bf053a2fcc7ca9af2e710f1c284ab1ad30e18e1b 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 9efcb24242280aae5aa97d1d251486dfd25bcd90..78a90dd57a4e14d505f038d4692153223ef3580c 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 42097a4c2659f926afa4089fb30cda7e657ef389..f850dce37b207b14e8ef746473e5692660e0716e 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 a2566ad4619c48bc0c61fe45de68d99333e85120..3bf6e24978ac2b6c347b34795beea1851a16f800 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 57ca1cfaecd8e8192d4923db24b356bdd0b6359c..e20b6d2eb274ac4bdc2629d8ad2e3e238c37beba 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 2e1a7e382cb7a43fe7247267e92b6a561441ad9f..9d863570fcf3ae7e258e298a212e260e1e420af4 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 07eb3a8287d655cfa47de657aa905a8410ec6099..55b92645b0f1f8fcc5aff552a4f654cfe7b37399 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 c016e12b73729ce4382c1be68449aff5691dc6d1..2df04528af82cb9179106b977bbcc9fc81e96b3f 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 daca63f25134d570cca934c4187557933d377aea..e678bc03d8165a557bb303c52c283d74358222a9 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 65f8a759f1e31c8dd4f26874c35d20ded59881da..5fc1b847f4aa540f45420be1c24f8bedb305b5dd 100644 (file)
 
                        trips {
                                cpu-crit {
-                                       temperature     = <125000>;
-                                       hysteresis      = <0>;
-                                       type            = "critical";
+                                       temperature = <125000>;
+                                       hysteresis = <0>;
+                                       type = "critical";
                                };
                        };
 
index cca49a2e2d623b92eb99505aebad5f78edc41f12..b774a8d63813fa085c01e53ef3b8624e3fd79a05 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 a76c74b44bbaf7e153e1c9d88375b602d21ace9d..363009e747b389d05708d60a03f4da0eae639532 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 b0b8c774a37f995230be8bb11d66d0d414d949b4..16e70a264faf5ea6b36bb714fce7610ce7f5d4eb 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 dd63a148a16bdf0e1273e5b353021ee0c1d47863..4fe3b365337670a1caeda1813e7d28ad542dfca4 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 58b7d9fc7574350bdeb5ca74acc130e9eb6452cd..c54451dde6dd4b5d4630ac8bbab000e99bee0872 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 576cfc52567b3e4a92fa8caa14dc132bdb47c959..1830844c840481963cddd10ee2c03af152776d29 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 df5c8ab906273ddf9c242cdbfb6335c08c0993ec..15bec75be74cf315a76285a0f1c8d6bc2a9fc19a 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 e9aecac4f5b5b462d2c077d34d377bf1fa1437b1..1fdd9a2491652a04e2c6d1b2f85394addda5f6d8 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 0386376fa486d5e6b92d8b4e8a652bb9523598f8..e46e4d22db3945249aa5f2e80d12d87ea6e5358e 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 8ef48c00f98d4ef63428a3712e222c4b822750f1..fe3f9a970b1883737ac2404c1ff903820ce4c624 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 778796c10af86d2e9a5bd841426db0e68fb6396a..244a957f9ba3a44963c10b12d639a4aac08e7dfd 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 c16e183822bee8a0bf48deaca947c202b6790d6b..577114c4c20a374f49ba3a8ae2fb18db53d7264d 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 bc4ae91cba1653edb1bc5a89e727921496af42e2..931db7932c115f2593033ed38087de1994c6da88 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 1a49f15f2df2e2e2ba6de4ede9d6a27985fc98b5..935e2359f8dfa7f4aa142152448e36f73579ee2a 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 156de653f2cd3cb4fdffb8e1d341cf3b3197e52c..27ef9a62b23cf4c9dd09fbc13130078e0a0e2001 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 57a028a69373d500acb978c2934e837dafc63e2b..ce5221c6b358e0f0b9ed75fd65f65b6264015d41 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 a8d8bb0419a09fc59140e6fd2974338d0edbc7fa..f23a25cce119560a2f0936ae0540adfc96276ff7 100644 (file)
 &gpio1 {
        status = "okay";
 };
+
+&pcie0 {
+       status = "okay";
+};
+
+&pcie1 {
+       status = "okay";
+};
index 36597f587f46064783cfff851d650f4d563c6b7e..7f839331a7779f884a8395ba2247eff77ffa0d1a 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 7b429622a288a30ffbedbe31cf5a5c89d89ba844..0ac3f284fbb8135cceb39ff20fbbfe0d835d72f3 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 cc30d154ec949530a85488af9f343f05c9cd4ec5..011ba2eff29ebb8f15830f21c9d7cd3d064105ac 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 78dad233ff34fe760d34dcd3df18de13c468c747..326b9e0ed8d3118f33300d52e33310f25637dce3 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 6f0ca3354e39d0e97956e3e0bfd637f168d733fa..5c4ecda27a476a0e0d713d3f40bdbf5ee3603d37 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 3c0a18b30837fa79f4eaa2904a2a35485e101f0d..bba85011ecc93da5f366846b5e072a5edcf1d2e1 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 a08ce2f37ea21bdf7aac35d0bf3f883a8ddd5945..5f37b751f70052d67dbb8fdafd66fa751d11fc08 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 6373009bb7272e2ac0b8c7d3ba7a7e9e1a2c8be9..76f44ae0de46925b7ac39a4616f468169f942532 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 01f44d95f671ac76f3ec6c27ae7163f2df59b161..b8e9dd23fc51270bac3f8a38b8bcc1370150326d 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 03dffc690b79b3ef0dd5911616792515bb1b704b..94122e9c66255128d607d04556931d1c9873447b 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 a9406280b979ae0a739e81f7692d3dd63eab3465..202ab0fee3b70bb573c7ce4eac3b161be9fed4c4 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 23f50c9be527313d817a03ad40f6a3752aff4696..b967397a46c5be7a64f4e68bebbdad96902039d2 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 36c369c42b77c709fdf93b92cbfc4cef7d7ae2bc..a5ad88b897ffc0cd6e1a30215bb17042228bda1f 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 1f17cc30ed14a981b3d82c7620fb21df877cd272..68d589e081bc6b363cb0d31c053b8e6104113ceb 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 97f131b1014b7d992c2ead97dfece5cbd2fe7f30..7a515b87bc7c5d8b2b1c38e3bf8552979eb48e35 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 88b8afd55664aa16a7463a541d71069132f6c2ac..58847d4fa846b281eb44ecbc433d9132d52b8e15 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 017b26108bb0c415ce6f629c4fca75e8999b6c87..04388c575efe9925c64735b827554c90e2f3808b 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 9ce9fb3fc19020ab81a89445375797e9fb2c1d92..c8da0d4b1b3332bd2f7a43e6bc425c1e0d999463 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 f7795f2d0f0eedc7cef3eab5b560aacfecafdd3c..71c0e87d3a1d5983a8c6bd9c6e896b38550fdcb8 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 918947a3897e4d344db0e4d88f10e9889e9a04f3..48732edadff159712bccee4e4c4716aa438e8b1d 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 c15ecfc4077dc2d77eec415b454540b90028e131..3d84b9c6dea311d7e6b4dc038969ed773f8df1a1 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 24609bb20158d7300f786329d76ba25b66eb5007..5eca10ecd550a0236c3ef02a69c71e2ee9228be5 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 150607f8103d63a97e615385098c383d6ba8c620..43e4a541f47984f3fdb8d02754341e8ab8a841b7 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 6c7814b4372ef73d8d7693e49a51a19bedf703de..f7b9233828922b22be44846686d4b70b38a96d27 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 946b791faf85e30989fd06fd149904d4f093f17f..55b7759682a93c1c237d7af35f7a00fff10dabf7 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 d6434ec8602245c86cb7e4a8f2b16a0b48b5f380..9e2123470cadfd609337dbe2a91b90d815783989 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 546ba274f4e51a116739f7dbf2ca5c61157c0c72..14cf9c4ca0ed7a654dc963f9acf259c8f78b6207 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 d91f7fa2cf808844ce0961e99c8608d40b8c8bce..3de7019572a20397265356e0e3b63f08f36e2225 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 1c24f9b35973f703427c957f857c2c4b359c0228..f5fb617f46bd1746c85a18e5aa45b697d7b6fa3f 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 982752e1df24a504895845aae546fa41cf3613f7..8c0e1716c0b3835804d2557df69d84c667f71b13 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 4ee76281979c2d83eb9523ce718ab03991bea724..0ebcb66c6319f35d724ad67309877e5573714173 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 fa8044c21cb8cd8018a37f0a56d10e5e891e67f0..bc4de0c05511b46a40ff7199b1de795ac60a85b2 100644 (file)
@@ -68,7 +68,7 @@
                };
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
index b660c7d055844f6e0654fbf0b32ef2b457d07f6f..e140307be2e7d472c5c739baf701e287f989ca27 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 2adb923c0b27b1abad9b0f1744c5dcb82e9d250b..5c4938b0d5a198ce04955906efd997a504bcdd16 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 be0de0fd31f95b8f2fb4104a1f8b656596a15b58..c0c7575fbecf26332f8dec031c6a67f365f352bd 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 85654d6baf28e7d102f4e1a2d859c68a23ba95ef..f7408722d68ab2332f407112bdaf1b942f34cf55 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 1e20a6639e4248d7f0a1603dccdafefc3acd1e86..592d9c23a447fc90968a384498eb7ce026aada69 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 67487f3caee1aef477ec68f59e0e07d22d2a8d4c..b7a6469d34721ccc637456702d0513f3d22adb9a 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 c4ce23d8ac9f2ebdd72d216573b2515e2d4d93a3..522660c912a0d5e07e334086219b2119b379809d 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 b86deebef7b7b94fcf7544436e0595d2bfabf59a..0a0b7acddfb2369105f4c7cf0446a2a793a400f3 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 516ec915a91150d38d03f1bbdcc3476a89c8846c..779b52858a25337f0070e5c6e4829fabed48d834 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 fdd81fdc3f35721395240c44a417f7c99ff43240..8e0ed209ede06413df2a316d2a035e158e092107 100644 (file)
@@ -80,7 +80,7 @@
                };
        };
 
-       soc {
+       soc: soc {
                ocram: sram@900000 {
                        compatible = "mmio-sram";
                        reg = <0x00900000 0x20000>;
index a0683b4aeca159d8d6b790b667ab21a914fe20bc..fa160a3898704d1e58db4aefb6a2d79212a55207 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 86e84781cf5d85f5853565b6ac20e619ca0b755a..44637d606e6122ac9c1c7667d821b4f243b2bba4 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 62e72773e53b39721bbcc37c67b78813c5a2b933..ce39c6a3f64045c3aab5414faef2249e2682dba0 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 8768222e183e54f1bd32e27a6456236379926206..8263bfef9bf85dc7eab5bfdebda6933af92644ec 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 7f1f19b74bfa5985dea38aeb7d1d6b129a7deb01..a3f247c722b438bcb91d6a22bee2633158b5fde7 100644 (file)
                >;
        };
 };
+
+&reg_tft_vcom {
+       regulator-min-microvolt = <3160000>;
+       regulator-max-microvolt = <3160000>;
+       voltage-table = <3160000 73>;
+};
index 9caba4529c718e136aaf6520866eaf867413ce85..3b77eae40e3956f0e12ead287c1cec31e277ad9c 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 bd763bae596b0222bdd749c77fd3a1587fb18533..7c17b91f09655837bf968af963a552ef840bf261 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 7df270cea2928ca18a1ffc324b30bab77c090769..023e76215064f7f20f7c00fada9c66eb429a50a0 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>;
 
 /* 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 19578f660b092b6c07df90f27ba7797125d74c5c..f0db0d4471f40f014d69613b7822fbd22fe27ae4 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 69ae430a53bd1746a7225eee9d5b03c242476859..8254bce1b8a22831f9f05ffb1895532ec2bb4e34 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 77a91a97e6cf17b2a2a60c88ed37ecd9cc27b5cc..3def1b621c8efb353391ecd2829a7d625a207e37 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 652feff334966be07cbce7b0149705db989295e1..4f7fefc14d0aca8332acf83e4e10cd7c8206316f 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>;
                        };
                };
 
-               bus@2100000 { /* AIPS2 */
+               aips2: bus@2100000 { /* AIPS2 */
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
                        #size-cells = <1>;
index a17b8bbbdb9560cae9de75aded4c6082c77c1e7c..663ee9df79e6778fe1bc32e243392d6394d2526a 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 fc6334336b3d071c4fe13e5920b6dff16aa6dc16..4d075e2bf7496e016fc925948885b1d3640c1c94 100644 (file)
                #phy-cells = <0>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
index a6cf0f21c66d12aa0b7549984fd0a4af1c9eb6c2..43868311f48a5d848ca2542d7d3d6cd275ba13c3 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 0d4ba9494cf2ea82625c7ab8e33832ea64496f03..38ea4dcfa2281d23f069e71c4ff9b2fe93f97423 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 caf2c5d03f7e034960757a355ed892d4746e88d0..4b87e2dc70dcdf2289842b17c50883277a549378 100644 (file)
@@ -14,7 +14,7 @@
 };
 
 &usdhc2 {
-       fsl,tuning-step= <6>;
+       fsl,tuning-step = <6>;
 };
 
 &iomuxc {
index afeec01f652288fe73c48aace20b68ca14d3dc50..c95efd1d8c2dbc355b8216d6bd4a76b94ab035f5 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 2c3ae715c683d68c7920e78d65f96ac4b8f660d9..577a424b0e1d5e1507ca04180b2827f3ff89bf82 100644 (file)
@@ -94,7 +94,6 @@
 };
 
 &adc1 {
-       num-channels = <10>;
        vref-supply = <&reg_module_3v3_avdd>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_adc1>;
index 326e6da91ed4b2cfb120a439fa9fefbadcfb2dd5..8541cb3f3b3e224213d79eb92d2b013f1cd8e382 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 8e4d5cd186140176f5d1622f053ced1e398a270e..be593d47e3b1eca081a02a35709ee05a76d6d769 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 9bf67490ac4973d5845322f7b4303a307699a2cd..2bccd45e9fc22d47267e93f8b37c825dfb37b589 100644 (file)
@@ -50,7 +50,7 @@
 };
 
 / {
-       soc {
+       soc: soc {
                aips3: bus@2200000 {
                        compatible = "fsl,aips-bus", "simple-bus";
                        #address-cells = <1>;
index 59bcfc9a6b10ff45a8c81a75e28601918a3b01bc..c92e4e2f6ab9ca064ddb774b96dd9e62c1b1df45 100644 (file)
        status = "okay";
 };
 
+&snvs_poweroff {
+       status = "okay";
+};
+
 &uart3 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart3>;
index b770fc9379707b6dc02492b0ef1c982831c3b26d..fa488a6de0d4629ce8d91e8f68fed2f2c6dca7db 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 3b9df8c82ae3073634988f20a0b133ec7df0991d..826f13da5b81c0c727b63223937e57f24ff62a8f 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 f1c60b0cb143edad66f9376f34b0a856bfc86187..a8c31ee656230c5d96cba2c856ffb09f774cf717 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 f3f0537d5a37538f8b3938d2e16092364dbce2cf..90aaeddfb4f6d75eee56df3715ebb6979e124bf2 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 20480276cb0eb4454003078ace57184f8ad6c920..3ec9ef6baaa41b1850fc14aad1b5f4bdb38e71d0 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 8ee73c870b12667288c2ca819054f68391c6eaba..6d505cb02aad68771e67b2fb8060b6a0c1c50ce0 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 af39e5370fa1226b09dadd4b8ec4e6753bfc0802..2fb4d2133a1b2cae011571e7d6f62fa283e10256 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 87b132bcd272dabac01b77630b0bca7a7511bec7..c7a8b5aa24085f01e4cbc7308b44ffa90109a662 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 219a0404a058c64fd1b4d809a015e5d8f1314953..531a45b176a1fd7d104103a5b1141bf4c9048093 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 f053f512274174e51c840c487186e56117f74ae2..78f4224a9bf4eb5795c34605ae186d5cbe52d7aa 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 21b509c43393e7e0e766b2b652314bedf0a7e5a3..546268b8d0b13b665d71fdfcf76a0e01e31b9ce4 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";
 };
        no-1-8-v;
        non-removable;
        vmmc-supply = <&reg_wifi>;
-       enable-sdio-wakeup;
+       wakeup-source;
        status = "okay";
 };
 
index f8cba47536a0e3e6ee3283b1bec2dacef638d5c4..7ceb7c09f7ad45134c1a13df9234bb11e3d3ac22 100644 (file)
@@ -78,7 +78,7 @@
                #phy-cells = <0>;
        };
 
-       soc {
+       soc: soc {
                etm@3007d000 {
                        compatible = "arm,coresight-etm3x", "arm,primecell";
                        reg = <0x3007d000 0x1000>;
index fca4e0a95c1b3f91d9daac78c15674c8399c31d1..58ebb02d948a683e42827085def69cba83e303bc 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 aa70d3f2e2e2f88ad77b78783b02354c0ad7ffae..38de76630d6a5c082f403c486c7ef81287828966 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 94de220a5965868ef210b405f942b922923eefe2..ef51395d353776dab40fc1d3f75f743609bc83a4 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 039eed79d2e730c5c0c4ec9aca844b9b852e5621..29148285f9fc88b3e1cef4905cf4c61c6fd7a738 100644 (file)
                             <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
-       soc {
+       soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "simple-bus";
index 77b911b060416f75b7d19a145a559e21ce57f477..03e6a858a7beca7706d8796ce03d3573fe8102d1 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 71064483d34f15b7537699ccb0fc95191368c719..42cf74db673ccab5fed44cd05888bc3cfd33919b 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 b8f152e7af7f76cbcc142292528dd5db7b10f4ee..65c32946c5223a1e0cdf2a43815eabce09f39e0e 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 d0e6a9a434025df25aa3a90bb107967e9a3a1fcd..f6306933ff426bf6fb6ae3d0a2b637e9f3f49235 100644 (file)
@@ -125,7 +125,7 @@ netcp: netcp@4000000 {
                        interfaces {
                                gbe0: interface-0 {
                                        slave-port = <0>;
-                                       link-interface  = <5>;
+                                       link-interface = <5>;
                                };
                        };
                };
index 37198294f4b26ecf161a6ea583a122d0764d72ef..380dd9d637eefb7150869b060e63d6870861413f 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 022d93c366c723dc0c54f126cfb7456d1eef38e8..8a421c65f9209e6936a9d72b8d3c6252d60308fa 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 8a9447703310f1058dd21ffac0db22e89676ccda..da6d3934c2e885f8999b4bec91b17cec1df6449e 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 e96ca664abc27e7d9189904920ed03b1595ed8ad..5ec6680a533da8b4e1ab180f4cc93c10c1a9a5d8 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 dff5fea72b2fe0fa06850b7115c1b673259674a4..421a02bbc9d30fc0c67f7173daf2c01e0d1523f1 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 fc9fdc857ae835fd9ebcdfbfd951d2b5d6276857..50789f9e2215f8dba027bd0ccf3dccf88e990934 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 725dcf707b315c04208c21ea1639dbe6aeec56b8..0097e72e3fb22ff38e6ae7b8b0c53336650eab18 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 3c7e3a7d6f14095205e4efdad4bed730c786a654..24d9055c4a08c679892e77922a42bf66307fb319 100644 (file)
@@ -4,6 +4,7 @@
  */
 /dts-v1/;
 #include "lan966x.dtsi"
+#include "dt-bindings/phy/phy-lan966x-serdes.h"
 
 / {
        model = "Microchip EVB - LAN9662";
        aliases {
                serial0 = &usart3;
        };
-};
-
-&gpio {
-       fc_shrd7_pins: fc_shrd7-pins {
-               pins = "GPIO_49";
-               function = "fc_shrd7";
-       };
 
-       fc_shrd8_pins: fc_shrd8-pins {
-               pins = "GPIO_54";
-               function = "fc_shrd8";
+       gpio-restart {
+               compatible = "gpio-restart";
+               gpios = <&gpio 56 GPIO_ACTIVE_LOW>;
+               priority = <200>;
        };
+};
 
-       fc3_b_pins: fcb3-spi-pins {
-               /* SCK, RXD, TXD */
-               pins = "GPIO_51", "GPIO_52", "GPIO_53";
+&gpio {
+       fc3_b_pins: fc3-b-pins {
+               /* RX, TX */
+               pins = "GPIO_52", "GPIO_53";
                function = "fc3_b";
        };
 
@@ -45,7 +42,7 @@
 &can0 {
        pinctrl-0 = <&can0_b_pins>;
        pinctrl-names = "default";
-       status = "okay";
+       status = "disabled"; /* Conflict with switch */
 };
 
 &flx3 {
        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";
        };
 };
 
+&mdio1 {
+       status = "okay";
+};
+
+&phy0 {
+       status = "okay";
+};
+
+&phy1 {
+       status = "okay";
+};
+
+&port0 {
+       phy-handle = <&phy0>;
+       phy-mode = "gmii";
+       phys = <&serdes 0 CU(0)>;
+       status = "okay";
+};
+
+&port1 {
+       phy-handle = <&phy1>;
+       phy-mode = "gmii";
+       phys = <&serdes 1 CU(1)>;
+       status = "okay";
+};
+
+&serdes {
+       status = "okay";
+};
+
+&switch {
+       status = "okay";
+};
+
 &watchdog {
        status = "okay";
 };
diff --git a/arch/arm/boot/dts/lan966x-pcb8309.dts b/arch/arm/boot/dts/lan966x-pcb8309.dts
new file mode 100644 (file)
index 0000000..05ce27e
--- /dev/null
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * lan966x_pcb8309.dts - Device Tree file for PCB8309
+ */
+/dts-v1/;
+#include "lan966x.dtsi"
+#include "dt-bindings/phy/phy-lan966x-serdes.h"
+
+/ {
+       model = "Microchip EVB - LAN9662";
+       compatible = "microchip,lan9662-pcb8309", "microchip,lan9662", "microchip,lan966";
+
+       aliases {
+               serial0 = &usart3;
+               i2c102 = &i2c102;
+               i2c103 = &i2c103;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-restart {
+               compatible = "gpio-restart";
+               gpios = <&gpio 56 GPIO_ACTIVE_LOW>;
+               priority = <200>;
+       };
+
+       i2c-mux {
+               compatible = "i2c-mux";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               mux-controls = <&mux>;
+               i2c-parent = <&i2c4>;
+
+               i2c102: i2c-sfp@1 {
+                       reg = <1>;
+               };
+
+               i2c103: i2c-sfp@2 {
+                       reg = <2>;
+               };
+       };
+
+       mux: mux-controller {
+               compatible = "gpio-mux";
+               #mux-control-cells = <0>;
+
+               mux-gpios = <&sgpio_out 11 0 GPIO_ACTIVE_HIGH>, /* p11b0 */
+                           <&sgpio_out 11 1 GPIO_ACTIVE_HIGH>; /* p11b1 */
+       };
+
+       sfp2: sfp2 {
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c102>;
+               tx-disable-gpios = <&sgpio_out 10 0 GPIO_ACTIVE_LOW>;
+               los-gpios = <&sgpio_in  2 0 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in  2 1 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in  1 0 GPIO_ACTIVE_HIGH>;
+       };
+
+       sfp3: sfp3 {
+               compatible = "sff,sfp";
+               i2c-bus = <&i2c103>;
+               tx-disable-gpios = <&sgpio_out 10 1 GPIO_ACTIVE_LOW>;
+               los-gpios = <&sgpio_in  3 0 GPIO_ACTIVE_HIGH>;
+               mod-def0-gpios = <&sgpio_in  3 1 GPIO_ACTIVE_LOW>;
+               tx-fault-gpios = <&sgpio_in  1 1 GPIO_ACTIVE_HIGH>;
+       };
+};
+
+&flx3 {
+       atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
+       status = "okay";
+
+       usart3: serial@200 {
+               pinctrl-0 = <&fc3_b_pins>;
+               pinctrl-names = "default";
+               status = "okay";
+       };
+};
+
+&flx4 {
+       atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+       status = "okay";
+
+       i2c4: i2c@600 {
+               compatible = "microchip,sam9x60-i2c";
+               reg = <0x600 0x200>;
+               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&nic_clk>;
+               pinctrl-0 = <&fc4_b_pins>;
+               pinctrl-names = "default";
+               i2c-analog-filter;
+               i2c-digital-filter;
+               i2c-digital-filter-width-ns = <35>;
+               i2c-sda-hold-time-ns = <1500>;
+               status = "okay";
+       };
+};
+
+&gpio {
+       fc3_b_pins: fc3-b-pins {
+               /* RXD, TXD */
+               pins = "GPIO_52", "GPIO_53";
+               function = "fc3_b";
+       };
+
+       fc4_b_pins: fc4-b-pins {
+               /* SCL, SDA */
+               pins = "GPIO_57", "GPIO_58";
+               function = "fc4_b";
+       };
+
+       sgpio_a_pins: sgpio-a-pins {
+               /* SCK, D0, D1, LD */
+               pins = "GPIO_32", "GPIO_33", "GPIO_34", "GPIO_35";
+               function = "sgpio_a";
+       };
+};
+
+&mdio1 {
+       status = "okay";
+};
+
+&phy0 {
+       status = "okay";
+};
+
+&phy1 {
+       status = "okay";
+};
+
+&port0 {
+       phy-handle = <&phy0>;
+       phy-mode = "gmii";
+       phys = <&serdes 0 CU(0)>;
+       status = "okay";
+};
+
+&port1 {
+       phy-handle = <&phy1>;
+       phy-mode = "gmii";
+       phys = <&serdes 1 CU(1)>;
+       status = "okay";
+};
+
+&port2 {
+       sfp = <&sfp2>;
+       managed = "in-band-status";
+       phy-mode = "sgmii";
+       phys = <&serdes 2 SERDES6G(0)>;
+       status = "okay";
+};
+
+&port3 {
+       sfp = <&sfp3>;
+       managed = "in-band-status";
+       phy-mode = "sgmii";
+       phys = <&serdes 3 SERDES6G(1)>;
+       status = "okay";
+};
+
+&serdes {
+       status = "okay";
+};
+
+&sgpio {
+       pinctrl-0 = <&sgpio_a_pins>;
+       pinctrl-names = "default";
+       microchip,sgpio-port-ranges = <0 3>, <8 11>;
+       status = "okay";
+
+       gpio@0 {
+               ngpios = <64>;
+       };
+       gpio@1 {
+               ngpios = <64>;
+       };
+};
+
+&switch {
+       status = "okay";
+};
index 3cb02fffe71612b7b97fb797386186e8ffe56f48..894bf9da19a4bc038fd2613ebfa79b91b50ba329 100644 (file)
@@ -38,7 +38,7 @@
                sys_clk: sys_clk {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
-                       clock-frequency = <162500000>;
+                       clock-frequency = <165625000>;
                };
 
                cpu_clk: cpu_clk {
@@ -65,7 +65,7 @@
                #clock-cells = <1>;
                clocks = <&cpu_clk>, <&ddr_clk>, <&sys_clk>;
                clock-names = "cpu", "ddr", "sys";
-               reg = <0xe00c00a8 0x38>;
+               reg = <0xe00c00a8 0x38>, <0xe00c02cc 0x4>;
        };
 
        timer {
                #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 10b8249b8ab6f98381d669002d5a465b3c1c831b..1bb686a7b3ec94841953275421710391254c8b70 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 66bcdaf4b6f9023481f658d80b5b2ff0cfb6141e..ce8e26d7791f42b629ac8e92dbba05905f16ae16 100644 (file)
        };
 
        sgtl5000: audio-codec@2a {
-               #sound-dai-cells=<0x0>;
+               #sound-dai-cells = <0x0>;
                compatible = "fsl,sgtl5000";
                reg = <0x2a>;
                VDDA-supply = <&reg_3p3v>;
index 6c88be2a7e8e70ad2cf0ad34c2f86c9d412ebc25..fa761620f0731ea282b5cf37c54aed28b7a852b6 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 26eaba3fa96f3df868c07ec400d61807646441b2..8e3860d5d9160057f2699a5c8e73053e993e13ef 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 9997a5d0333a3f7339136dfe4eeecb9bfe148a55..0f8bac8bac8bb37985eb5c8d2f8b1790bd714493 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 94f1c03deccefa2e425110a5b2941db557b4a2d0..cf9c04a61ba3c62a04fcbc10f41715a3141b7c2b 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 ef583cfd3baf9fcc52ec81f143d6621949c6625f..b8eba3ba153c25d6229e76e2fc10027e4faf01c1 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 f4848362b3be60e0269df28c4df00e2b588753ef..25d31e40a5535b64f6351710b86900b2b95bae95 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 13c86936d1c83bd977acbe8123c1f691a62f0b25..e8b4b6d30d197efa2fbfd619cafd127b48010ff6 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 88d8f0b2f4c21181b4e079b5b131062983feda3c..61f5da68d4b0ce4db9817f582b1f829159542ea3 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 027c1b0c6a98368b43e6f92b1c279c31cb143661..5008115d2494e05203d98be5503dcb19deb645f4 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 1b9b9a8145a73d4b8ed9dccd5e12a72f188575a3..bf67a8e9be59c857b810de408168dc0a59b39f07 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 eb536cbebd9bc9629d67782346742685f495cee3..84e14bee7235f9788ab0d82cf6112bb6de791a86 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 3696980a3da1c1428a884d82e68df667ead91c71..c7b5ef15b71629654498fb47a38133f42e960b63 100644 (file)
                        compatible = "nuvoton,npcm750-reset";
                        reg = <0xf0801000 0x70>;
                        #reset-cells = <2>;
+                       nuvoton,sysgcr = <&gcr>;
                };
 
                clk: clock-controller@f0801000 {
                        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 13eee0fe564201144a6c3b49c821ebfb7204bbe2..30eed40b89b5c2292550604cddf98f9daf95dde8 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 af964f139abff33d8fd61108b34aeb836bedf568..5acf5dd87c5936741bb28df85fafb07556190a8e 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 c9332195d096d7e3efec942b3fdd63c7f75aea6c..abd403c228c7a856720272d476f8aa2c195ec5ba 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 5cc0cf7cd16c690869fb2d9b02cced17dde78fb2..f95eea63b355f215bcdee7742628f9d172cb89b0 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 0365f06165e90f5ad7f40b48c30fd23647d73e80..28a6a9345be5222a0647c7619346713098e697e7 100644 (file)
                        spi-cpol;
                        spi-cpha;
 
-                       backlight= <&backlight>;
+                       backlight = <&backlight>;
                        label = "lcd";
                        port {
                                lcd_in: endpoint {
index 99f5585097a1be9396020a255d7b0c253dc3ae1a..2192026104638315a537143b8c41814b99c48ade 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 9c6a9272459045af7448e383627cb235d0de39c0..36fc8805e0c1554fc5c76f8bd9f9be366422ce2c 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 73d477898ec2a5521b7ce46e051b9cdeb714458d..c595afe4181d7839139b620689575a8006a04093 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 d40c3d2c4914e400cf1365397632dc3d59ebf0f8..dd797155644986a166f41d0cf17841ee0275cb60 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 7dde9fbb06d33c83a0e4e5f36e0968ac94e45bfd..f68da828b0505b58c967cb4a68ea21d46792acbe 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 006a6d97231c43eb463d1095bae3cf6fd1fc7cd7..adc714c398257b7075e4a65d48ea7efb465cf6c9 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 37608af6c07f5909931cfe0ef66486b7e6c22fa8..559853764487f28f171708aba3e00dbb436eda38 100644 (file)
 
        lcd: lcd@1 {
                reg = <1>;      /* CS1 */
-               compatible =    "tpo,td043mtea1";
+               compatible = "tpo,td043mtea1";
                spi-max-frequency = <100000>;
                spi-cpol;
                spi-cpha;
index 7d530ae3483b806e2c125facb086eabab6fff3a7..258ecd9e45198feb4b7cc29669bb156692db32da 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 06cc3a19ddaa9388953363023e1fa696703324b6..3b505fe415ed9e0f27f27080ddfec561be7eadc4 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 8a6721d436bde259e3b555ce72c279623bebfeca..147c99191dc29cc3889f855d14378a94f966336c 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 138d6478ac84e3cebaebc9f27e10e4ec4872364b..70a1dd629c7aa90b0e46847d6db8e3258aaae6c3 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
 #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/pinctrl/qcom,pmic-mpp.h>
 #include "qcom-msm8660.dtsi"
                                };
 
                                gpio@150 {
-                                       dragon_ethernet_gpios: ethernet-gpios {
+                                       dragon_ethernet_gpios: ethernet-state {
                                                pinconf {
                                                        pins = "gpio7";
                                                        function = "normal";
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_bmp085_gpios: bmp085-gpios {
+                                       dragon_bmp085_gpios: bmp085-state {
                                                pinconf {
                                                        pins = "gpio16";
                                                        function = "normal";
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_mpu3050_gpios: mpu3050-gpios {
+                                       dragon_mpu3050_gpios: mpu3050-state {
                                                pinconf {
                                                        pins = "gpio17";
                                                        function = "normal";
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_sdcc3_gpios: sdcc3-gpios {
+                                       dragon_sdcc3_gpios: sdcc3-state {
                                                pinconf {
                                                        pins = "gpio22";
                                                        function = "normal";
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_sdcc5_gpios: sdcc5-gpios {
+                                       dragon_sdcc5_gpios: sdcc5-state {
                                                pinconf {
                                                        pins = "gpio26";
                                                        function = "normal";
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_ak8975_gpios: ak8975-gpios {
+                                       dragon_ak8975_gpios: ak8975-state {
                                                pinconf {
                                                        pins = "gpio33";
                                                        function = "normal";
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_cm3605_gpios: cm3605-gpios {
+                                       dragon_cm3605_gpios: cm3605-state {
                                                /* Pin 34 connected to the proxy IRQ */
-                                               pinconf_gpio34 {
+                                               gpio34-pins {
                                                        pins = "gpio34";
                                                        function = "normal";
                                                        input-enable;
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                                /* Pin 35 connected to ASET */
-                                               pinconf_gpio35 {
+                                               gpio35-pins {
                                                        pins = "gpio35";
                                                        function = "normal";
                                                        output-high;
                                                        power-source = <PM8058_GPIO_S3>;
                                                };
                                        };
-                                       dragon_veth_gpios: veth-gpios {
+                                       dragon_veth_gpios: veth-state {
                                                pinconf {
                                                        pins = "gpio40";
                                                        function = "normal";
                                        compatible = "qcom,pm8058-led";
                                        reg = <0x131>;
                                        label = "pm8058:red";
+                                       color = <LED_COLOR_ID_RED>;
                                        default-state = "off";
                                };
                                led@132 {
                                        compatible = "qcom,pm8058-led";
                                        reg = <0x132>;
                                        label = "pm8058:yellow";
+                                       color = <LED_COLOR_ID_YELLOW>;
                                        default-state = "off";
                                        linux,default-trigger = "mmc0";
                                };
                                        compatible = "qcom,pm8058-led";
                                        reg = <0x133>;
                                        label = "pm8058:green";
+                                       function = LED_FUNCTION_HEARTBEAT;
+                                       color = <LED_COLOR_ID_GREEN>;
                                        default-state = "on";
                                        linux,default-trigger = "heartbeat";
                                };
index ca9f7352819639d0373e74156bf19b86822223a8..fee278e32cb6605cc9c979b7e36e9aa40c40c5de 100644 (file)
@@ -24,9 +24,9 @@
                ramoops@88d00000{
                        compatible = "ramoops";
                        reg = <0x88d00000 0x100000>;
-                       record-size     = <0x00020000>;
-                       console-size    = <0x00020000>;
-                       ftrace-size     = <0x00020000>;
+                       record-size = <0x00020000>;
+                       console-size = <0x00020000>;
+                       ftrace-size = <0x00020000>;
                };
        };
 
 
        gpio-keys {
                compatible = "gpio-keys";
-               volume_up {
+               key-volume-up {
                        label = "Volume Up";
                        gpios = <&pm8921_gpio 4 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_VOLUMEUP>;
                };
-               volume_down {
+               key-volume-down {
                        label = "Volume Down";
                        gpios = <&pm8921_gpio 38 GPIO_ACTIVE_HIGH>;
                        linux,code = <KEY_VOLUMEDOWN>;
@@ -98,8 +98,8 @@
                                 * tabla2x-slim-VDDIO_CDC
                                 */
                                s4 {
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
                                        qcom,switch-mode-frequency = <3200000>;
                                        regulator-always-on;
                                };
                        };
                };
 
-               imem@2a03f000 {
-                       compatible = "syscon", "simple-mfd";
+               sram@2a03f000 {
+                       compatible = "qcom,apq8064-imem", "syscon", "simple-mfd";
                        reg = <0x2a03f000 0x1000>;
 
                        reboot-mode {
                                compatible = "syscon-reboot-mode";
                                offset = <0x65c>;
 
-                               mode-normal     = <0x77665501>;
-                               mode-bootloader = <0x77665500>;
-                               mode-recovery   = <0x77665502>;
+                               mode-normal = <0x77665501>;
+                               mode-bootloader = <0x77665500>;
+                               mode-recovery = <0x77665502>;
                        };
                };
        };
index e068a8d0adf0babffb3a3632cf07d758d6286ec7..e3bf57cd7423c55409f979cf964b423ba3eb4df5 100644 (file)
@@ -82,8 +82,8 @@
                                };
 
                                s4 {
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
                                        qcom,switch-mode-frequency = <3200000>;
                                };
 
                qcom,ssbi@500000 {
                        pmic@0 {
                                gpio@150 {
-                                       wlan_default_gpios: wlan-gpios {
-                                               pios {
+                                       wlan_default_gpios: wlan-gpios-state {
+                                               pinconf {
                                                        pins = "gpio43";
                                                        function = "normal";
                                                        bias-disable;
                        sdcc3: mmc@12180000 {
                                status = "okay";
                                vmmc-supply = <&v3p3_fixed>;
-                               pinctrl-names   = "default";
-                               pinctrl-0       = <&card_detect>;
-                               cd-gpios        = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&card_detect>;
+                               cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
                        };
                        /* WLAN */
                        sdcc4: mmc@121c0000 {
index 2638b380be20146657f6c291cb55d4ed49d87888..0322cb88d448051d5a47864f7173aedc5179da2b 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "qcom-apq8064-v2.0.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
@@ -39,6 +40,7 @@
 
                led@1 {
                        label = "apq8064:green:user1";
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&pm8921_gpio 18 GPIO_ACTIVE_HIGH>;
                        default-state = "on";
                };
                                };
 
                                s4 {
-                                       regulator-min-microvolt = <1800000>;
-                                       regulator-max-microvolt = <1800000>;
+                                       regulator-min-microvolt = <1800000>;
+                                       regulator-max-microvolt = <1800000>;
                                        qcom,switch-mode-frequency = <3200000>;
                                };
 
                };
 
                sata0: sata@29000000 {
-                       status          = "okay";
-                       target-supply   = <&pm8921_s4>;
+                       status = "okay";
+                       target-supply = <&pm8921_s4>;
                };
 
                /* OTG */
                qcom,ssbi@500000 {
                        pmic@0 {
                                gpio@150 {
-                                       wlan_default_gpios: wlan-gpios {
-                                               pios {
+                                       wlan_default_gpios: wlan-gpios-state {
+                                               pinconf {
                                                        pins = "gpio43";
                                                        function = "normal";
                                                        bias-disable;
                                                };
                                        };
 
-                                       notify_led: nled {
-                                               pios {
+                                       notify_led: nled-state {
+                                               pinconf {
                                                        pins = "gpio18";
                                                        function = "normal";
                                                        bias-disable;
                        sdcc3: mmc@12180000 {
                                status = "okay";
                                vmmc-supply = <&pm8921_l6>;
-                               pinctrl-names   = "default";
-                               pinctrl-0       = <&card_detect>;
-                               cd-gpios        = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&card_detect>;
+                               cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
                        };
                        /* WLAN */
                        sdcc4: mmc@121c0000 {
                        status = "okay";
 
                        core-vdda-supply = <&pm8921_hdmi_switch>;
-                       hdmi-mux-supply = <&ext_3p3v>;
 
                        hpd-gpios = <&tlmm_pinmux 72 GPIO_ACTIVE_HIGH>;
 
index 0cee62c7b8b0466020b9edb6946ffbb499bf980c..c07c5474750d3f87c94ef2c8103ad118e5d780ae 100644 (file)
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin_a>;
 
-               camera-focus {
+               key-camera-focus {
                        label = "camera_focus";
                        gpios = <&pm8921_gpio 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_CAMERA_FOCUS>;
                };
 
-               camera-snapshot {
+               key-camera-snapshot {
                        label = "camera_snapshot";
                        gpios = <&pm8921_gpio 4 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_CAMERA>;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "volume_down";
                        gpios = <&pm8921_gpio 29 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pm8921_gpio 35 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                qcom,ssbi@500000 {
                        pmic@0 {
                                gpio@150 {
-                                       gpio_keys_pin_a: gpio-keys-pin-active {
+                                       gpio_keys_pin_a: gpio-keys-active-state {
                                                pins = "gpio3", "gpio4", "gpio29", "gpio35";
                                                function = "normal";
 
index 34c0ba7fa3582147ffe9d820299fabbede64ce94..ada4c828bf2f49dff1d3bc95188fc02ba46b8061 100644 (file)
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
-                       thermal-sensors = <&gcc 7>;
+                       thermal-sensors = <&tsens 7>;
                        coefficients = <1199 0>;
 
                        trips {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
-                       thermal-sensors = <&gcc 8>;
+                       thermal-sensors = <&tsens 8>;
                        coefficients = <1132 0>;
 
                        trips {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
-                       thermal-sensors = <&gcc 9>;
+                       thermal-sensors = <&tsens 9>;
                        coefficients = <1199 0>;
 
                        trips {
                        polling-delay-passive = <250>;
                        polling-delay = <1000>;
 
-                       thermal-sensors = <&gcc 10>;
+                       thermal-sensors = <&tsens 10>;
                        coefficients = <1132 0>;
 
                        trips {
 
        firmware {
                scm {
-                       compatible = "qcom,scm-apq8064";
+                       compatible = "qcom,scm-apq8064", "qcom,scm";
 
                        clocks = <&rpmcc RPM_DAYTONA_FABRIC_CLK>;
                        clock-names = "core";
                };
 
                sps_sic_non_secure: sps-sic-non-secure@12100000 {
-                       compatible      = "syscon";
-                       reg             = <0x12100000 0x10000>;
+                       compatible = "syscon";
+                       reg = <0x12100000 0x10000>;
                };
 
                gsbi1: gsbi@12440000 {
                };
 
                qfprom: qfprom@700000 {
-                       compatible      = "qcom,qfprom";
-                       reg             = <0x00700000 0x1000>;
-                       #address-cells  = <1>;
-                       #size-cells     = <1>;
+                       compatible = "qcom,apq8064-qfprom", "qcom,qfprom";
+                       reg = <0x00700000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
                        ranges;
-                       tsens_calib: calib {
+                       tsens_calib: calib@404 {
                                reg = <0x404 0x10>;
                        };
-                       tsens_backup: backup_calib {
+                       tsens_backup: backup_calib@414 {
                                reg = <0x414 0x10>;
                        };
                };
 
                gcc: clock-controller@900000 {
-                       compatible = "qcom,gcc-apq8064";
+                       compatible = "qcom,gcc-apq8064", "syscon";
                        reg = <0x00900000 0x4000>;
-                       nvmem-cells = <&tsens_calib>, <&tsens_backup>;
-                       nvmem-cell-names = "calib", "calib_backup";
                        #clock-cells = <1>;
                        #power-domain-cells = <1>;
                        #reset-cells = <1>;
-                       #thermal-sensor-cells = <1>;
+
+                       tsens: thermal-sensor {
+                               compatible = "qcom,msm8960-tsens";
+
+                               nvmem-cells = <&tsens_calib>, <&tsens_backup>;
+                               nvmem-cell-names = "calib", "calib_backup";
+                               interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "uplow";
+
+                               #qcom,sensors = <11>;
+                               #thermal-sensor-cells = <1>;
+                       };
                };
 
                lcc: clock-controller@28000000 {
                };
 
                l2cc: clock-controller@2011000 {
-                       compatible      = "qcom,kpss-gcc", "syscon";
-                       reg             = <0x2011000 0x1000>;
+                       compatible = "qcom,kpss-gcc", "syscon";
+                       reg = <0x2011000 0x1000>;
                };
 
                rpm@108000 {
-                       compatible      = "qcom,rpm-apq8064";
-                       reg             = <0x108000 0x1000>;
-                       qcom,ipc        = <&l2cc 0x8 2>;
+                       compatible = "qcom,rpm-apq8064";
+                       reg = <0x108000 0x1000>;
+                       qcom,ipc = <&l2cc 0x8 2>;
 
-                       interrupts      = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
-                                         <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
-                                         <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
-                       interrupt-names = "ack", "err", "wakeup";
+                       interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "ack", "err", "wakeup";
 
                        rpmcc: clock-controller {
-                               compatible      = "qcom,rpmcc-apq8064", "qcom,rpmcc";
+                               compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&pxo_board>, <&cxo_board>;
+                               clock-names = "pxo", "cxo";
                        };
 
                        regulators {
                };
 
                sata_phy0: phy@1b400000 {
-                       compatible      = "qcom,apq8064-sata-phy";
-                       status          = "disabled";
-                       reg             = <0x1b400000 0x200>;
-                       reg-names       = "phy_mem";
-                       clocks          = <&gcc SATA_PHY_CFG_CLK>;
-                       clock-names     = "cfg";
-                       #phy-cells      = <0>;
+                       compatible = "qcom,apq8064-sata-phy";
+                       status = "disabled";
+                       reg = <0x1b400000 0x200>;
+                       reg-names = "phy_mem";
+                       clocks = <&gcc SATA_PHY_CFG_CLK>;
+                       clock-names = "cfg";
+                       #phy-cells = <0>;
                };
 
                sata0: sata@29000000 {
-                       compatible              = "qcom,apq8064-ahci", "generic-ahci";
-                       status                  = "disabled";
-                       reg                     = <0x29000000 0x180>;
-                       interrupts              = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
-
-                       clocks                  = <&gcc SFAB_SATA_S_H_CLK>,
-                                               <&gcc SATA_H_CLK>,
-                                               <&gcc SATA_A_CLK>,
-                                               <&gcc SATA_RXOOB_CLK>,
-                                               <&gcc SATA_PMALIVE_CLK>;
-                       clock-names             = "slave_iface",
-                                               "iface",
-                                               "bus",
-                                               "rxoob",
-                                               "core_pmalive";
-
-                       assigned-clocks         = <&gcc SATA_RXOOB_CLK>,
-                                               <&gcc SATA_PMALIVE_CLK>;
-                       assigned-clock-rates    = <100000000>, <100000000>;
-
-                       phys                    = <&sata_phy0>;
-                       phy-names               = "sata-phy";
-                       ports-implemented       = <0x1>;
+                       compatible = "qcom,apq8064-ahci", "generic-ahci";
+                       status   = "disabled";
+                       reg      = <0x29000000 0x180>;
+                       interrupts = <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
+
+                       clocks = <&gcc SFAB_SATA_S_H_CLK>,
+                                <&gcc SATA_H_CLK>,
+                                <&gcc SATA_A_CLK>,
+                                <&gcc SATA_RXOOB_CLK>,
+                                <&gcc SATA_PMALIVE_CLK>;
+                       clock-names = "slave_iface",
+                                     "iface",
+                                     "bus",
+                                     "rxoob",
+                                     "core_pmalive";
+
+                       assigned-clocks = <&gcc SATA_RXOOB_CLK>,
+                                         <&gcc SATA_PMALIVE_CLK>;
+                       assigned-clock-rates = <100000000>, <100000000>;
+
+                       phys = <&sata_phy0>;
+                       phy-names = "sata-phy";
+                       ports-implemented = <0x1>;
                };
 
                /* Temporary fixed regulator */
                        #size-cells = <1>;
                        ranges;
                        sdcc1: mmc@12400000 {
-                               status          = "disabled";
-                               compatible      = "arm,pl18x", "arm,primecell";
-                               pinctrl-names   = "default";
-                               pinctrl-0       = <&sdcc1_pins>;
+                               status = "disabled";
+                               compatible = "arm,pl18x", "arm,primecell";
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&sdcc1_pins>;
                                arm,primecell-periphid = <0x00051180>;
-                               reg             = <0x12400000 0x2000>;
-                               interrupts      = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <8>;
-                               max-frequency   = <96000000>;
+                               reg = <0x12400000 0x2000>;
+                               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <8>;
+                               max-frequency = <96000000>;
                                non-removable;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
                        };
 
                        sdcc3: mmc@12180000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x12180000 0x2000>;
-                               interrupts      = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <4>;
+                               status = "disabled";
+                               reg = <0x12180000 0x2000>;
+                               interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <4>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
-                               max-frequency   = <192000000>;
+                               max-frequency = <192000000>;
                                no-1-8-v;
                                dmas = <&sdcc3bam 2>, <&sdcc3bam 1>;
                                dma-names = "tx", "rx";
                        };
 
                        sdcc4: mmc@121c0000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x121c0000 0x2000>;
-                               interrupts      = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC4_CLK>, <&gcc SDC4_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <4>;
+                               status = "disabled";
+                               reg = <0x121c0000 0x2000>;
+                               interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC4_CLK>, <&gcc SDC4_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <4>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
-                               max-frequency   = <48000000>;
+                               max-frequency = <48000000>;
                                dmas = <&sdcc4bam 2>, <&sdcc4bam 1>;
                                dma-names = "tx", "rx";
                                pinctrl-names = "default";
                        syscon-sfpb = <&mmss_sfpb>;
                        phys = <&dsi0_phy>;
                        phy-names = "dsi";
+                       status = "disabled";
+
                        ports {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                <0x04700300 0x200>,
                                <0x04700500 0x5c>;
                        reg-names = "dsi_pll", "dsi_phy", "dsi_phy_regulator";
-                       clock-names = "iface_clk", "ref";
+                       clock-names = "iface", "ref";
                        clocks = <&mmcc DSI_M_AHB_CLK>,
                                 <&pxo_board>;
+                       status = "disabled";
                };
 
 
                                      "slave_iface";
 
                        phys = <&hdmi_phy>;
-                       phy-names = "hdmi-phy";
 
                        ports {
                                #address-cells = <1>;
index da50a1a0197f9a01e5856acd5881427843a92aa3..72f9255855a1dff4bfc7a34f0e953eec03b327a7 100644 (file)
@@ -95,7 +95,7 @@
 
        firmware {
                scm {
-                       compatible = "qcom,scm";
+                       compatible = "qcom,scm-apq8084", "qcom,scm";
                        clocks = <&gcc GCC_CE1_CLK> , <&gcc GCC_CE1_AXI_CLK>, <&gcc GCC_CE1_AHB_CLK>;
                        clock-names = "core", "bus", "iface";
                };
                };
 
                qfprom: qfprom@fc4bc000 {
+                       compatible = "qcom,apq8084-qfprom", "qcom,qfprom";
+                       reg = <0xfc4bc000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       compatible = "qcom,qfprom";
-                       reg = <0xfc4bc000 0x1000>;
                        tsens_calib: calib@d0 {
                                reg = <0xd0 0x18>;
                        };
                        status = "disabled";
                };
 
-               sdhci@f9824900 {
+               mmc@f9824900 {
                        compatible = "qcom,apq8084-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9824900 0x11c>, <0xf9824000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        status = "disabled";
                };
 
-               sdhci@f98a4900 {
+               mmc@f98a4900 {
                        compatible = "qcom,apq8084-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
index 028ac8e247979a25731e948e411c6993429b9829..cf7da1ab177cfe268f016d9c406dbbcd88a030e4 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
+#include <dt-bindings/leds/common.h>
 #include "qcom-ipq4018-ap120c-ac.dtsi"
 
 / {
 
                power {
                        label = "ap120c-ac:green:power";
+                       function = LED_FUNCTION_POWER;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
                        default-state = "on";
                };
 
                wlan {
                        label = "ap120c-ac:green:wlan";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
                };
 
                support {
                        label = "ap120c-ac:green:support";
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
                        panic-indicator;
                };
index b7916fc26d6837fc892c0efd8a48f99eea2d2ec0..c4f89b712fd9d6220c5aa1562c3dd50daecbfc8e 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
+#include <dt-bindings/leds/common.h>
 #include "qcom-ipq4018-ap120c-ac.dtsi"
 
 / {
@@ -8,18 +9,24 @@
 
                status: status {
                        label = "ap120c-ac:blue:status";
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_BLUE>;
                        gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
                        default-state = "keep";
                };
 
                wlan2g {
                        label = "ap120c-ac:green:wlan2g";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_GREEN>;
                        gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy0tpt";
                };
 
                wlan5g {
                        label = "ap120c-ac:red:wlan5g";
+                       function = LED_FUNCTION_WLAN;
+                       color = <LED_COLOR_ID_RED>;
                        gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
                        linux,default-trigger = "phy1tpt";
                };
index 1f3b1ce82108839e2becd978d098fc88efdb852f..af9a26fb5d4a163839f225ef69da41a9daa25a13 100644 (file)
@@ -11,7 +11,7 @@
        keys {
                compatible = "gpio-keys";
 
-               reset {
+               key-reset {
                        label = "reset";
                        gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_RESTART>;
index faeaa6bf0def9cb0add5f5042754845a433af0ce..44a9597d8bfd576307a06de18d447669ede66f73 100644 (file)
@@ -93,7 +93,7 @@
                                #address-cells = <1>;
                                #size-cells = <1>;
                                reg = <0>;
-                               compatible = "n25q128a11";
+                               compatible = "micron,n25q128a11", "jedec,spi-nor";
                                spi-max-frequency = <24000000>;
                        };
                };
index d596dd1180ae633a3cd1c830494b1ef1cfa931f2..c7a6e77da272659951afc2606b14739ae4826916 100644 (file)
@@ -56,7 +56,7 @@
                                #address-cells = <1>;
                                #size-cells = <1>;
                                reg = <0>;
-                               compatible = "n25q128a11";
+                               compatible = "micron,n25q128a11", "jedec,spi-nor";
                                spi-max-frequency = <24000000>;
                        };
                };
index c5da723f7674b817ffc0c2e15e983dd6cd46825c..bb307b8f678c2dfc0e9b7e5ccb3012578f1ad8c8 100644 (file)
 
        firmware {
                scm {
-                       compatible = "qcom,scm-ipq4019";
+                       compatible = "qcom,scm-ipq4019", "qcom,scm";
                };
        };
 
                        status = "disabled";
                };
 
-               sdhci: sdhci@7824900 {
+               sdhci: mmc@7824900 {
                        compatible = "qcom,sdhci-msm-v4";
                        reg = <0x7824900 0x11c>, <0x7824000 0x800>;
                        interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
index b63d01d10189c1b1b34e57f5d9d5e2246ecd34cb..a654d3c22c4f557da2e0c0e2d4ea41a88fba0ce7 100644 (file)
@@ -7,12 +7,6 @@
 
        soc {
                pinmux@800000 {
-                       i2c4_pins: i2c4_pinmux {
-                               pins = "gpio12", "gpio13";
-                               function = "gsbi4";
-                               bias-disable;
-                       };
-
                        buttons_pins: buttons_pins {
                                mux {
                                        pins = "gpio54", "gpio65";
index 596d129d4a953a05efbdb51dda293b642fb373a5..5a65cce2500c13ca646d68a8dd846b724b41818b 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "qcom-ipq8064.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        model = "MikroTik RB3011UiAS-RM";
                        };
                };
 
-               gpio_keys {
+               gpio-keys {
                        compatible = "gpio-keys";
                        pinctrl-0 = <&buttons_pins>;
                        pinctrl-names = "default";
 
-                       button@1 {
+                       button {
                                label = "reset";
                                linux,code = <KEY_RESTART>;
                                gpios = <&qcom_pinmux 66 GPIO_ACTIVE_LOW>;
 
                        led@7 {
                                label = "rb3011:green:user";
+                               color = <LED_COLOR_ID_GREEN>;
                                gpios = <&qcom_pinmux 33 GPIO_ACTIVE_HIGH>;
                                default-state = "off";
                        };
                };
        };
 
-       mdio0_pins: mdio0_pins {
-               mux {
-                       pins = "gpio0", "gpio1";
-                       function = "gpio";
-                       drive-strength = <8>;
-                       bias-disable;
-               };
-       };
-
        mdio1_pins: mdio1_pins {
                mux {
                        pins = "gpio10", "gpio11";
diff --git a/arch/arm/boot/dts/qcom-ipq8064-smb208.dtsi b/arch/arm/boot/dts/qcom-ipq8064-smb208.dtsi
new file mode 100644 (file)
index 0000000..ac9c44f
--- /dev/null
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include "qcom-ipq8064.dtsi"
+
+&rpm {
+       smb208_regulators: regulators {
+               compatible = "qcom,rpm-smb208-regulators";
+
+               smb208_s1a: s1a {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
+
+                       qcom,switch-mode-frequency = <1200000>;
+               };
+
+               smb208_s1b: s1b {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
+
+                       qcom,switch-mode-frequency = <1200000>;
+               };
+
+               smb208_s2a: s2a {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1250000>;
+
+                       qcom,switch-mode-frequency = <1200000>;
+               };
+
+               smb208_s2b: s2b {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1250000>;
+
+                       qcom,switch-mode-frequency = <1200000>;
+               };
+       };
+};
index 5c802b99e15fb13359bc472967c7f92afaa06873..411c8d63c38e10e6ed027452b82e835edbbebf5c 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "qcom-ipq8064.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 
 / {
        model = "Qualcomm Technologies, Inc. IPQ8064-v1.0";
                        status = "okay";
                };
 
-               gpio_keys {
+               gpio-keys {
                        compatible = "gpio-keys";
                        pinctrl-0 = <&buttons_pins>;
                        pinctrl-names = "default";
 
-                       button@1 {
+                       button-1 {
                                label = "reset";
                                linux,code = <KEY_RESTART>;
                                gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>;
                                linux,input-type = <1>;
                                debounce-interval = <60>;
                        };
-                       button@2 {
+                       button-2 {
                                label = "wps";
                                linux,code = <KEY_WPS_BUTTON>;
                                gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>;
 
                        led@9 {
                                label = "status_led_fail";
+                               function = LED_FUNCTION_STATUS;
                                gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>;
                                default-state = "off";
                        };
 
                        led@53 {
                                label = "status_led_pass";
+                               function = LED_FUNCTION_STATUS;
                                gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>;
                                default-state = "off";
                        };
index 808ea18622835a8a6afdbaea2da6bb46f4ffac21..c8337c870bdb27ef239d49edcbf1990f97258286 100644 (file)
                };
 
                smem: smem@41000000 {
+                       compatible = "qcom,smem";
                        reg = <0x41000000 0x200000>;
                        no-map;
+
+                       hwlocks = <&sfpb_mutex 3>;
                };
        };
 
                                };
                        };
 
+                       i2c4_pins: i2c4-default {
+                               pins = "gpio12", "gpio13";
+                               function = "gsbi4";
+                               drive-strength = <12>;
+                               bias-disable;
+                       };
+
                        spi_pins: spi_pins {
                                mux {
                                        pins = "gpio18", "gpio19", "gpio21";
 
                                pullups {
                                        pins = "gpio39";
+                                       function = "nand";
+                                       drive-strength = <10>;
                                        bias-pull-up;
                                };
 
                                        pins = "gpio40", "gpio41", "gpio42",
                                               "gpio43", "gpio44", "gpio45",
                                               "gpio46", "gpio47";
+                                       function = "nand";
+                                       drive-strength = <10>;
                                        bias-bus-hold;
                                };
                        };
+
+                       mdio0_pins: mdio0-pins {
+                               mux {
+                                       pins = "gpio0", "gpio1";
+                                       function = "mdio";
+                                       drive-strength = <8>;
+                                       bias-disable;
+                               };
+                       };
+
+                       rgmii2_pins: rgmii2-pins {
+                               mux {
+                                       pins = "gpio27", "gpio28", "gpio29",
+                                              "gpio30", "gpio31", "gpio32",
+                                              "gpio51", "gpio52", "gpio59",
+                                              "gpio60", "gpio61", "gpio62";
+                                       function = "rgmii2";
+                                       drive-strength = <8>;
+                                       bias-disable;
+                               };
+                       };
                };
 
                intc: interrupt-controller@2000000 {
                        regulator;
                };
 
+               gsbi1: gsbi@12440000 {
+                       compatible = "qcom,gsbi-v1.0.0";
+                       reg = <0x12440000 0x100>;
+                       cell-index = <1>;
+                       clocks = <&gcc GSBI1_H_CLK>;
+                       clock-names = "iface";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       syscon-tcsr = <&tcsr>;
+
+                       status = "disabled";
+
+                       gsbi1_serial: serial@12450000 {
+                               compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
+                               reg = <0x12450000 0x100>,
+                                     <0x12400000 0x03>;
+                               interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gcc GSBI1_UART_CLK>, <&gcc GSBI1_H_CLK>;
+                               clock-names = "core", "iface";
+
+                               status = "disabled";
+                       };
+
+                       gsbi1_i2c: i2c@12460000 {
+                               compatible = "qcom,i2c-qup-v1.1.1";
+                               reg = <0x12460000 0x1000>;
+                               interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gcc GSBI1_QUP_CLK>, <&gcc GSBI1_H_CLK>;
+                               clock-names = "core", "iface";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               status = "disabled";
+                       };
+               };
+
                gsbi2: gsbi@12480000 {
                        compatible = "qcom,gsbi-v1.0.0";
                        cell-index = <2>;
                                status = "disabled";
                        };
 
-                       i2c@124a0000 {
+                       gsbi2_i2c: i2c@124a0000 {
                                compatible = "qcom,i2c-qup-v1.1.1";
                                reg = <0x124a0000 0x1000>;
                                interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;
                        };
                };
 
+               gsbi6: gsbi@16500000 {
+                       compatible = "qcom,gsbi-v1.0.0";
+                       reg = <0x16500000 0x100>;
+                       cell-index = <6>;
+                       clocks = <&gcc GSBI6_H_CLK>;
+                       clock-names = "iface";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       syscon-tcsr = <&tcsr>;
+
+                       status = "disabled";
+
+                       gsbi6_i2c: i2c@16580000 {
+                               compatible = "qcom,i2c-qup-v1.1.1";
+                               reg = <0x16580000 0x1000>;
+                               interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+
+                               clocks = <&gcc GSBI6_QUP_CLK>, <&gcc GSBI6_H_CLK>;
+                               clock-names = "core", "iface";
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               status = "disabled";
+                       };
+
+                       gsbi6_spi: spi@16580000 {
+                               compatible = "qcom,spi-qup-v1.1.1";
+                               reg = <0x16580000 0x1000>;
+                               interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+
+                               clocks = <&gcc GSBI6_QUP_CLK>, <&gcc GSBI6_H_CLK>;
+                               clock-names = "core", "iface";
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               status = "disabled";
+                       };
+               };
+
                gsbi7: gsbi@16600000 {
                        status = "disabled";
                        compatible = "qcom,gsbi-v1.0.0";
                                clock-names = "core", "iface";
                                status = "disabled";
                        };
+
+                       gsbi7_i2c: i2c@16680000 {
+                               compatible = "qcom,i2c-qup-v1.1.1";
+                               reg = <0x16680000 0x1000>;
+                               interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
+
+                               clocks = <&gcc GSBI7_QUP_CLK>, <&gcc GSBI7_H_CLK>;
+                               clock-names = "core", "iface";
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               status = "disabled";
+                       };
                };
 
                rng@1a500000 {
                };
 
                qfprom: qfprom@700000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,ipq8064-qfprom", "qcom,qfprom";
                        reg = <0x00700000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
+                       speedbin_efuse: speedbin@c0 {
+                               reg = <0xc0 0x4>;
+                       };
                        tsens_calib: calib@400 {
                                reg = <0x400 0xb>;
                        };
                        rpmcc: clock-controller {
                                compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&pxo_board>;
+                               clock-names = "pxo";
                        };
                };
 
                l2cc: clock-controller@2011000 {
                        compatible = "qcom,kpss-gcc", "syscon";
                        reg = <0x2011000 0x1000>;
-                       clocks = <&gcc PLL8_VOTE>, <&gcc PXO_SRC>;
+                       clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
                        clock-names = "pll8_vote", "pxo";
                        clock-output-names = "acpu_l2_aux";
                };
                        #address-cells = <3>;
                        #size-cells = <2>;
 
-                       ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00100000   /* downstream I/O */
+                       ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00010000   /* downstream I/O */
                                  0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
 
                        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
                        #address-cells = <3>;
                        #size-cells = <2>;
 
-                       ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00100000   /* downstream I/O */
+                       ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00010000   /* downstream I/O */
                                  0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
 
                        interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
                        #address-cells = <3>;
                        #size-cells = <2>;
 
-                       ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00100000   /* downstream I/O */
+                       ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00010000   /* downstream I/O */
                                  0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */
 
                        interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
 
                gmac0: ethernet@37000000 {
                        device_type = "network";
-                       compatible = "qcom,ipq806x-gmac";
+                       compatible = "qcom,ipq806x-gmac", "snps,dwmac";
                        reg = <0x37000000 0x200000>;
                        interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
 
                gmac1: ethernet@37200000 {
                        device_type = "network";
-                       compatible = "qcom,ipq806x-gmac";
+                       compatible = "qcom,ipq806x-gmac", "snps,dwmac";
                        reg = <0x37200000 0x200000>;
                        interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
 
                gmac2: ethernet@37400000 {
                        device_type = "network";
-                       compatible = "qcom,ipq806x-gmac";
+                       compatible = "qcom,ipq806x-gmac", "snps,dwmac";
                        reg = <0x37400000 0x200000>;
                        interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
 
                gmac3: ethernet@37600000 {
                        device_type = "network";
-                       compatible = "qcom,ipq806x-gmac";
+                       compatible = "qcom,ipq806x-gmac", "snps,dwmac";
                        reg = <0x37600000 0x200000>;
                        interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
                        interrupt-names = "macirq";
                        clocks = <&gcc USB30_1_UTMI_CLK>;
                        clock-names = "ref";
                        #phy-cells = <0>;
+
+                       status = "disabled";
                };
 
                ss_phy_1: phy@110f8830 {
                        clocks = <&gcc USB30_1_MASTER_CLK>;
                        clock-names = "ref";
                        #phy-cells = <0>;
+
+                       status = "disabled";
                };
 
                usb3_1: usb3@110f8800 {
                        ranges;
 
                        sdcc1: mmc@12400000 {
-                               status          = "disabled";
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               status = "disabled";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               reg             = <0x12400000 0x2000>;
-                               interrupts      = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x12400000 0x2000>;
+                               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <8>;
-                               max-frequency   = <96000000>;
+                               clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <8>;
+                               max-frequency = <96000000>;
                                non-removable;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
                        };
 
                        sdcc3: mmc@12180000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x12180000 0x2000>;
-                               interrupts      = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+                               status = "disabled";
+                               reg = <0x12180000 0x2000>;
+                               interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
                                interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <8>;
+                               clocks = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <8>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
-                               max-frequency   = <192000000>;
+                               max-frequency = <192000000>;
                                sd-uhs-sdr104;
                                sd-uhs-ddr50;
                                vqmmc-supply = <&vsdcc_fixed>;
                                dma-names = "tx", "rx";
                        };
                };
+
+               sfpb_mutex: hwlock@1200600 {
+                       compatible = "qcom,sfpb-mutex";
+                       reg = <0x01200600 0x100>;
+
+                       #hwlock-cells = <1>;
+               };
        };
 };
index 10ad929759ed798e85cbc7768b9b989984f4ccdc..49de1821ac3a81ee0800378381ef58065e704086 100644 (file)
 };
 
 &pmicgpio {
-       usb_vbus_5v_pins: usb_vbus_5v_pins {
+       usb_vbus_5v_pins: usb-vbus-5v-state {
                pins = "gpio4";
                function = "normal";
                output-high;
index 8f0752ce1c7ba5fa8cb54af95742f97a8d8f6aa7..b47c86412de2cecd7b0ed2b7ca5a26d80d70847f 100644 (file)
 
                                pmicgpio: gpio@150 {
                                        compatible = "qcom,pm8018-gpio", "qcom,ssbi-gpio";
+                                       reg = <0x150>;
                                        interrupt-controller;
                                        #interrupt-cells = <2>;
                                        gpio-controller;
                                arm,primecell-periphid = <0x00051180>;
                                reg = <0x12180000 0x2000>;
                                interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
+                               interrupt-names = "cmd_irq";
                                clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
                                clock-names = "mclk", "apb_pclk";
                                bus-width = <8>;
                                status = "disabled";
                                reg = <0x12140000 0x2000>;
                                interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
+                               interrupt-names = "cmd_irq";
                                clocks = <&gcc SDC2_CLK>, <&gcc SDC2_H_CLK>;
                                clock-names = "mclk", "apb_pclk";
                                bus-width = <4>;
                        interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
                                     <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
-                       interrupt-names = "ack", "err", "wakeup";
+                       interrupt-names = "ack", "err", "wakeup";
 
                        regulators {
                                compatible = "qcom,rpm-pm8018-regulators";
index 28eca15b5712f8ee12c97b36d578e06797944ba2..0b5effdb269aead5c4537241f258bd180c3bbac5 100644 (file)
                        reg = <0xf9011000 0x1000>;
                };
 
-               sdhc_1: sdhci@f9824900 {
+               sdhc_1: mmc@f9824900 {
                        compatible = "qcom,msm8226-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9824900 0x11c>, <0xf9824000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        status = "disabled";
                };
 
-               sdhc_2: sdhci@f98a4900 {
+               sdhc_2: mmc@f98a4900 {
                        compatible = "qcom,msm8226-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        status = "disabled";
                };
 
-               sdhc_3: sdhci@f9864900 {
+               sdhc_3: mmc@f9864900 {
                        compatible = "qcom,msm8226-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9864900 0x11c>, <0xf9864000 0x800>;
                        reg-names = "hc_mem", "core_mem";
index 47b97daecef1a572379729d0fb4ff5bf18ea8548..63a501c63cf8e1a1e6ebe2b12e5b7439032aec9d 100644 (file)
@@ -56,7 +56,7 @@
                        clock-frequency = <19200000>;
                };
 
-               pxo_board {
+               pxo_board: pxo_board {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <27000000>;
                };
 
                l2cc: clock-controller@2082000 {
-                       compatible      = "qcom,kpss-gcc", "syscon";
-                       reg             = <0x02082000 0x1000>;
+                       compatible = "qcom,kpss-gcc", "syscon";
+                       reg = <0x02082000 0x1000>;
                };
 
                rpm: rpm@104000 {
-                       compatible      = "qcom,rpm-msm8660";
-                       reg             = <0x00104000 0x1000>;
-                       qcom,ipc        = <&l2cc 0x8 2>;
-
-                       interrupts      = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
-                                         <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
-                                         <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
-                       interrupt-names = "ack", "err", "wakeup";
+                       compatible = "qcom,rpm-msm8660";
+                       reg = <0x00104000 0x1000>;
+                       qcom,ipc = <&l2cc 0x8 2>;
+
+                       interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "ack", "err", "wakeup";
                        clocks = <&gcc RPM_MSG_RAM_H_CLK>;
                        clock-names = "ram";
 
                        rpmcc: clock-controller {
-                               compatible      = "qcom,rpmcc-msm8660", "qcom,rpmcc";
+                               compatible = "qcom,rpmcc-msm8660", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&pxo_board>;
+                               clock-names = "pxo";
                        };
 
                        pm8901-regulators {
                        #size-cells = <1>;
                        ranges;
                        sdcc1: mmc@12400000 {
-                               status          = "disabled";
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               status = "disabled";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               reg             = <0x12400000 0x8000>;
-                               interrupts      = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <8>;
-                               max-frequency   = <48000000>;
+                               reg = <0x12400000 0x8000>;
+                               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <8>;
+                               max-frequency = <48000000>;
                                non-removable;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
                        };
 
                        sdcc2: mmc@12140000 {
-                               status          = "disabled";
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               status = "disabled";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               reg             = <0x12140000 0x8000>;
-                               interrupts      = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC2_CLK>, <&gcc SDC2_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <8>;
-                               max-frequency   = <48000000>;
+                               reg = <0x12140000 0x8000>;
+                               interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC2_CLK>, <&gcc SDC2_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <8>;
+                               max-frequency = <48000000>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
                        };
 
                        sdcc3: mmc@12180000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x12180000 0x8000>;
-                               interrupts      = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <4>;
+                               status = "disabled";
+                               reg = <0x12180000 0x8000>;
+                               interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <4>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
-                               max-frequency   = <48000000>;
+                               max-frequency = <48000000>;
                                no-1-8-v;
                        };
 
                        sdcc4: mmc@121c0000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x121c0000 0x8000>;
-                               interrupts      = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC4_CLK>, <&gcc SDC4_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <4>;
-                               max-frequency   = <48000000>;
+                               status = "disabled";
+                               reg = <0x121c0000 0x8000>;
+                               interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC4_CLK>, <&gcc SDC4_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <4>;
+                               max-frequency = <48000000>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
                        };
 
                        sdcc5: mmc@12200000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x12200000 0x8000>;
-                               interrupts      = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC5_CLK>, <&gcc SDC5_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <4>;
+                               status = "disabled";
+                               reg = <0x12200000 0x8000>;
+                               interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC5_CLK>, <&gcc SDC5_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <4>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
-                               max-frequency   = <48000000>;
+                               max-frequency = <48000000>;
                        };
                };
 
index 4a2d74cf01d29ce4fa8641937b17d7eddf29ce52..19554f3b51966bab79ab58038c57d8af72443483 100644 (file)
                };
 
                l2cc: clock-controller@2011000 {
-                       compatible      = "qcom,kpss-gcc", "syscon";
-                       reg             = <0x2011000 0x1000>;
+                       compatible = "qcom,kpss-gcc", "syscon";
+                       reg = <0x2011000 0x1000>;
                };
 
                rpm@108000 {
-                       compatible      = "qcom,rpm-msm8960";
-                       reg             = <0x108000 0x1000>;
-                       qcom,ipc        = <&l2cc 0x8 2>;
+                       compatible = "qcom,rpm-msm8960";
+                       reg = <0x108000 0x1000>;
+                       qcom,ipc = <&l2cc 0x8 2>;
 
-                       interrupts      = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
-                                         <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
-                                         <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
-                       interrupt-names = "ack", "err", "wakeup";
+                       interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
+                                    <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
+                       interrupt-names = "ack", "err", "wakeup";
 
                        regulators {
                                compatible = "qcom,rpm-pm8921-regulators";
                        #size-cells = <1>;
                        ranges;
                        sdcc1: mmc@12400000 {
-                               status          = "disabled";
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               status = "disabled";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               reg             = <0x12400000 0x8000>;
-                               interrupts      = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <8>;
-                               max-frequency   = <96000000>;
+                               reg = <0x12400000 0x8000>;
+                               interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <8>;
+                               max-frequency = <96000000>;
                                non-removable;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
                        };
 
                        sdcc3: mmc@12180000 {
-                               compatible      = "arm,pl18x", "arm,primecell";
+                               compatible = "arm,pl18x", "arm,primecell";
                                arm,primecell-periphid = <0x00051180>;
-                               status          = "disabled";
-                               reg             = <0x12180000 0x8000>;
-                               interrupts      = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
-                               interrupt-names = "cmd_irq";
-                               clocks          = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
-                               clock-names     = "mclk", "apb_pclk";
-                               bus-width       = <4>;
+                               status = "disabled";
+                               reg = <0x12180000 0x8000>;
+                               interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+                               interrupt-names = "cmd_irq";
+                               clocks = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
+                               clock-names = "mclk", "apb_pclk";
+                               bus-width = <4>;
                                cap-sd-highspeed;
                                cap-mmc-highspeed;
-                               max-frequency   = <192000000>;
+                               max-frequency = <192000000>;
                                no-1-8-v;
                                vmmc-supply = <&vsdcc_fixed>;
                        };
index 9493886a5c0dd7302b9daf6d20797ab9045ee19e..ec5d340562b66855590886055ea5703076842e6f 100644 (file)
@@ -3,6 +3,7 @@
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin_a>;
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_VOLUMEUP>;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "volume_down";
                        gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
 };
 
 &pm8941_gpios {
-       gpio_keys_pin_a: gpio-keys-active {
+       gpio_keys_pin_a: gpio-keys-active-state {
                pins = "gpio2", "gpio3";
                function = "normal";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       fuelgauge_pin: fuelgauge-int {
+       fuelgauge_pin: fuelgauge-int-state {
                pins = "gpio9";
                function = "normal";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       wlan_sleep_clk_pin: wl-sleep-clk {
+       wlan_sleep_clk_pin: wl-sleep-clk-state {
                pins = "gpio16";
                function = "func2";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       wlan_regulator_pin: wl-reg-active {
+       wlan_regulator_pin: wl-reg-active-state {
                pins = "gpio17";
                function = "normal";
 
        };
 };
 
+&pm8941_lpg {
+       status = "okay";
+
+       qcom,power-source = <1>;
+
+       multi-led {
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_STATUS;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@7 {
+                       reg = <7>;
+                       color = <LED_COLOR_ID_RED>;
+               };
+
+               led@6 {
+                       reg = <6>;
+                       color = <LED_COLOR_ID_GREEN>;
+               };
+
+               led@5 {
+                       reg = <5>;
+                       color = <LED_COLOR_ID_BLUE>;
+               };
+       };
+};
+
 &rpm_requests {
        pm8841-regulators {
                compatible = "qcom,rpm-pm8841-regulators";
index 1d21de46f85c7d4c2e7cf31d297b08c0970e466e..5a70683d9103a03e772ad49c9f1e0e22de1640f7 100644 (file)
@@ -3,6 +3,7 @@
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin_a>;
 
-               volume-down {
+               key-volume-down {
                        label = "volume_down";
                        gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               camera-snapshot {
+               key-camera-snapshot {
                        label = "camera_snapshot";
                        gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_CAMERA>;
                };
 
-               camera-focus {
+               key-camera-focus {
                        label = "camera_focus";
                        gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_CAMERA_FOCUS>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
 };
 
 &pm8941_gpios {
-       gpio_keys_pin_a: gpio-keys-active {
+       gpio_keys_pin_a: gpio-keys-active-state {
                pins = "gpio2", "gpio3", "gpio4", "gpio5";
                function = "normal";
 
        };
 };
 
+&pm8941_lpg {
+       status = "okay";
+
+       qcom,power-source = <1>;
+
+       rgb-led {
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_STATUS;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@5 {
+                       reg = <5>;
+                       color = <LED_COLOR_ID_BLUE>;
+               };
+
+               led@6 {
+                       reg = <6>;
+                       color = <LED_COLOR_ID_GREEN>;
+               };
+
+               led@7 {
+                       reg = <7>;
+                       color = <LED_COLOR_ID_RED>;
+               };
+       };
+};
+
 &pm8941_wled {
        status = "okay";
 
index c3b8a6d6302753d4b233cb9495bddd54208e9c74..8baca2a777176a3e8669ab1a988df9f25f878425 100644 (file)
@@ -96,7 +96,7 @@
 
        firmware {
                scm {
-                       compatible = "qcom,scm";
+                       compatible = "qcom,scm-msm8974", "qcom,scm";
                        clocks = <&gcc GCC_CE1_CLK>, <&gcc GCC_CE1_AXI_CLK>, <&gcc GCC_CE1_AHB_CLK>;
                        clock-names = "core", "bus", "iface";
                };
                        reg = <0xf90b8000 0x1000>, <0xf9008000 0x1000>;
                };
 
-               sdhc_1: sdhci@f9824900 {
+               sdhc_1: mmc@f9824900 {
                        compatible = "qcom,msm8974-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9824900 0x11c>, <0xf9824000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        status = "disabled";
                };
 
-               sdhc_3: sdhci@f9864900 {
+               sdhc_3: mmc@f9864900 {
                        compatible = "qcom,msm8974-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf9864900 0x11c>, <0xf9864000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                        status = "disabled";
                };
 
-               sdhc_2: sdhci@f98a4900 {
+               sdhc_2: mmc@f98a4900 {
                        compatible = "qcom,msm8974-sdhci", "qcom,sdhci-msm-v4";
                        reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>;
                        reg-names = "hc_mem", "core_mem";
                blsp2_uart1: serial@f995d000 {
                        compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
                        reg = <0xf995d000 0x1000>;
-                       interrupts = <GIC_SPI 113 IRQ_TYPE_NONE>;
+                       interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&gcc GCC_BLSP2_UART1_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
                        clock-names = "core", "iface";
                        pinctrl-names = "default", "sleep";
                };
 
                qfprom: qfprom@fc4bc000 {
+                       compatible = "qcom,msm8974-qfprom", "qcom,qfprom";
+                       reg = <0xfc4bc000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
-                       compatible = "qcom,qfprom";
-                       reg = <0xfc4bc000 0x1000>;
                        tsens_calib: calib@d0 {
                                reg = <0xd0 0x18>;
                        };
                        #interrupt-cells = <4>;
                };
 
+               bam_dmux_dma: dma-controller@fc834000 {
+                       compatible = "qcom,bam-v1.4.0";
+                       reg = <0xfc834000 0x7000>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       #dma-cells = <1>;
+                       qcom,ee = <0>;
+
+                       num-channels = <6>;
+                       qcom,num-ees = <1>;
+                       qcom,powered-remotely;
+               };
+
                remoteproc_mss: remoteproc@fc880000 {
                        compatible = "qcom,msm8974-mss-pil";
                        reg = <0xfc880000 0x100>, <0xfc820000 0x020>;
                        qcom,smem-states = <&modem_smp2p_out 0>;
                        qcom,smem-state-names = "stop";
 
+                       status = "disabled";
+
                        mba {
                                memory-region = <&mba_region>;
                        };
                                memory-region = <&mpss_region>;
                        };
 
+                       bam_dmux: bam-dmux {
+                               compatible = "qcom,bam-dmux";
+
+                               interrupt-parent = <&modem_smsm>;
+                               interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>;
+                               interrupt-names = "pc", "pc-ack";
+
+                               qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>;
+                               qcom,smem-state-names = "pc", "pc-ack";
+
+                               dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>;
+                               dma-names = "tx", "rx";
+                       };
+
                        smd-edge {
                                interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>;
 
 
                        status = "disabled";
 
-                       gpu_opp_table: opp_table {
+                       gpu_opp_table: opp-table {
                                compatible = "operating-points-v2";
 
                                opp-320000000 {
                        };
                };
 
-               ocmem@fdd00000 {
+               sram@fdd00000 {
                        compatible = "qcom,msm8974-ocmem";
                        reg = <0xfdd00000 0x2000>,
                              <0xfec00000 0x180000>;
                        reg-names = "ctrl", "mem";
+                       ranges = <0 0xfec00000 0x180000>;
                        clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
                                 <&mmcc OCMEMCX_OCMEMNOC_CLK>;
                        clock-names = "core", "iface";
                        qcom,smem-states = <&adsp_smp2p_out 0>;
                        qcom,smem-state-names = "stop";
 
+                       status = "disabled";
+
                        smd-edge {
                                interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;
 
                        };
                };
 
-               imem: imem@fe805000 {
-                       compatible = "syscon", "simple-mfd";
+               imem: sram@fe805000 {
+                       compatible = "qcom,msm8974-imem", "syscon", "simple-mfd";
                        reg = <0xfe805000 0x1000>;
 
                        reboot-mode {
index 58cb2ce1e4dfed2c95a8b426ef97169367162ac7..ff6e0066768ba560d7f9a285ad924e4f51414c24 100644 (file)
@@ -3,6 +3,7 @@
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
@@ -25,7 +26,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin_a>;
 
-               camera-snapshot {
+               key-camera-snapshot {
                        label = "camera_snapshot";
                        gpios = <&pm8941_gpios 1 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_CAMERA>;
@@ -33,7 +34,7 @@
                        debounce-interval = <15>;
                };
 
-               volume-down {
+               key-volume-down {
                        label = "volume_down";
                        gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEDOWN>;
@@ -41,7 +42,7 @@
                        debounce-interval = <15>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_VOLUMEUP>;
@@ -78,9 +79,9 @@
 
 &imem {
        reboot-mode {
-               mode-normal     = <0x77665501>;
-               mode-bootloader = <0x77665500>;
-               mode-recovery   = <0x77665502>;
+               mode-normal = <0x77665501>;
+               mode-bootloader = <0x77665500>;
+               mode-recovery = <0x77665502>;
        };
 };
 
 };
 
 &pm8941_gpios {
-       gpio_keys_pin_a: gpio-keys-active {
+       gpio_keys_pin_a: gpio-keys-active-state {
                pins = "gpio1", "gpio2", "gpio5";
                function = "normal";
 
        };
 };
 
+&pm8941_lpg {
+       status = "okay";
+
+       qcom,power-source = <1>;
+
+       multi-led {
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_STATUS;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@7 {
+                       reg = <7>;
+                       color = <LED_COLOR_ID_RED>;
+               };
+
+               led@6 {
+                       reg = <6>;
+                       color = <LED_COLOR_ID_GREEN>;
+               };
+
+               led@5 {
+                       reg = <5>;
+                       color = <LED_COLOR_ID_BLUE>;
+               };
+       };
+};
+
 &pronto {
        status = "okay";
 
 };
 
 &remoteproc_adsp {
+       status = "okay";
        cx-supply = <&pm8841_s2>;
 };
 
 &remoteproc_mss {
+       status = "okay";
        cx-supply = <&pm8841_s2>;
        mss-supply = <&pm8841_s3>;
        mx-supply = <&pm8841_s1>;
index d6b2300a8223110fd1d6b0d44a8c4c3aacb800ac..983e10c3d863ccfcd3f89827dbe765dd7b3c27b2 100644 (file)
@@ -25,7 +25,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin_a>;
 
-               volume-down {
+               key-volume-down {
                        label = "volume_down";
                        gpios = <&pma8084_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -33,7 +33,7 @@
                        debounce-interval = <15>;
                };
 
-               home-key {
+               key-home {
                        label = "home_key";
                        gpios = <&pma8084_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
@@ -42,7 +42,7 @@
                        debounce-interval = <15>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pma8084_gpios 5 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
 };
 
 &pma8084_gpios {
-       gpio_keys_pin_a: gpio-keys-active {
+       gpio_keys_pin_a: gpio-keys-active-state {
                pins = "gpio2", "gpio3", "gpio5";
                function = "normal";
 
                power-source = <PMA8084_GPIO_S4>;
        };
 
-       touchkey_pin: touchkey-int-pin {
+       touchkey_pin: touchkey-int-state {
                pins = "gpio6";
                function = "normal";
                bias-disable;
                power-source = <PMA8084_GPIO_S4>;
        };
 
-       touch_pin: touchscreen-int-pin {
+       touch_pin: touchscreen-int-state {
                pins = "gpio8";
                function = "normal";
                bias-disable;
                power-source = <PMA8084_GPIO_S4>;
        };
 
-       panel_en_pin: panel-en-pin {
+       panel_en_pin: panel-en-state {
                pins = "gpio14";
                function = "normal";
                bias-pull-up;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
        };
 
-       wlan_sleep_clk_pin: wlan-sleep-clk-pin {
+       wlan_sleep_clk_pin: wlan-sleep-clk-state {
                pins = "gpio16";
                function = "func2";
 
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
        };
 
-       panel_rst_pin: panel-rst-pin {
+       panel_rst_pin: panel-rst-state {
                pins = "gpio17";
                function = "normal";
                bias-disable;
                qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
        };
 
-       fuelgauge_pin: fuelgauge-int-pin {
+       fuelgauge_pin: fuelgauge-int-state {
                pins = "gpio21";
                function = "normal";
                bias-disable;
 };
 
 &remoteproc_adsp {
+       status = "okay";
        cx-supply = <&pma8084_s2>;
 };
 
 &remoteproc_mss {
+       status = "okay";
        cx-supply = <&pma8084_s2>;
        mss-supply = <&pma8084_s6>;
        mx-supply = <&pma8084_s1>;
index 9bd8faea61a569a2d78680312fb1ae8cced1d877..3f45f5c5d37b589685bf9861a921a6559bd9f154 100644 (file)
@@ -3,6 +3,7 @@
 #include "qcom-pm8841.dtsi"
 #include "qcom-pm8941.dtsi"
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 / {
                pinctrl-names = "default";
                pinctrl-0 = <&gpio_keys_pin_a>;
 
-               volume-down {
+               key-volume-down {
                        label = "volume_down";
                        gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_VOLUMEDOWN>;
                };
 
-               camera-snapshot {
+               key-camera-snapshot {
                        label = "camera_snapshot";
                        gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_CAMERA>;
                };
 
-               camera-focus {
+               key-camera-focus {
                        label = "camera_focus";
                        gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
                        linux,code = <KEY_CAMERA_FOCUS>;
                };
 
-               volume-up {
+               key-volume-up {
                        label = "volume_up";
                        gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
                        linux,input-type = <1>;
 };
 
 &pm8941_gpios {
-       gpio_keys_pin_a: gpio-keys-active {
+       gpio_keys_pin_a: gpio-keys-active-state {
                pins = "gpio2", "gpio5";
                function = "normal";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       bt_reg_on_pin: bt-reg-on {
+       bt_reg_on_pin: bt-reg-on-state {
                pins = "gpio16";
                function = "normal";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       wlan_sleep_clk_pin: wl-sleep-clk {
+       wlan_sleep_clk_pin: wl-sleep-clk-state {
                pins = "gpio17";
                function = "func2";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       wlan_regulator_pin: wl-reg-active {
+       wlan_regulator_pin: wl-reg-active-state {
                pins = "gpio18";
                function = "normal";
 
                power-source = <PM8941_GPIO_S3>;
        };
 
-       lcd_dcdc_en_pin_a: lcd-dcdc-en-active {
+       lcd_dcdc_en_pin_a: lcd-dcdc-en-active-state {
                pins = "gpio20";
                function = "normal";
 
 
 };
 
+&pm8941_lpg {
+       status = "okay";
+
+       qcom,power-source = <1>;
+
+       rgb-led {
+               color = <LED_COLOR_ID_RGB>;
+               function = LED_FUNCTION_STATUS;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               led@5 {
+                       reg = <5>;
+                       color = <LED_COLOR_ID_BLUE>;
+               };
+
+               led@6 {
+                       reg = <6>;
+                       color = <LED_COLOR_ID_GREEN>;
+               };
+
+               led@7 {
+                       reg = <7>;
+                       color = <LED_COLOR_ID_RED>;
+               };
+       };
+};
+
 &rpm_requests {
        pm8941-regulators {
                compatible = "qcom,rpm-pm8941-regulators";
index 2caf71eacb52005065cfff0921ce2050d0724744..b5cdde034d188f6add87a02b4d5c9feed4e0867c 100644 (file)
@@ -24,6 +24,7 @@
                        compatible = "qcom,spmi-temp-alarm";
                        reg = <0x2400>;
                        interrupts = <4 0x24 0 IRQ_TYPE_EDGE_RISING>;
+                       #thermal-sensor-cells = <0>;
                };
        };
 
index cdd2bdb77b329c90a6a7708b02c01a1c28789c34..59d0cde63251a809733d0d49a5b3080b98692382 100644 (file)
@@ -68,7 +68,7 @@
                        interrupt-controller;
                        #interrupt-cells = <2>;
 
-                       boost_bypass_n_pin: boost-bypass {
+                       boost_bypass_n_pin: boost-bypass-state {
                                pins = "gpio21";
                                function = "normal";
                        };
                #address-cells = <1>;
                #size-cells = <0>;
 
+               pm8941_lpg: lpg {
+                       compatible = "qcom,pm8941-lpg";
+
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       #pwm-cells = <2>;
+
+                       status = "disabled";
+               };
+
                pm8941_wled: wled@d800 {
                        compatible = "qcom,pm8941-wled";
                        reg = <0xd800>;
index 6571b88d018a50a46a279bc1ac339b69dcba8581..9de7578a4c5f15c2cb48f78815cc9c9b88fd2f75 100644 (file)
@@ -69,6 +69,7 @@
                        compatible = "qcom,pmx55-gpio", "qcom,spmi-gpio";
                        reg = <0xc000>;
                        gpio-controller;
+                       gpio-ranges = <&pmx55_gpios 0 0 11>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index 5411b833d26e75f3fefb61f1103fa7e416192df8..abf229a8b75ac857f8f980128442bc14224e4063 100644 (file)
                };
 
                pmx65_gpios: pinctrl@8800 {
-                       compatible = "qcom,pmx65-gpio";
+                       compatible = "qcom,pmx65-gpio", "qcom,spmi-gpio";
                        reg = <0x8800>;
                        gpio-controller;
+                       gpio-ranges = <&pmx65_gpios 0 0 16>;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #interrupt-cells = <2>;
index 1c2b208a5670b51a60291fdb2d91fb0f3b5dba87..c72540223fa92df1f728f0523fc1834ab71854e8 100644 (file)
                blsp1_uart3: serial@831000 {
                        compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
                        reg = <0x00831000 0x200>;
-                       interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_LOW>;
+                       interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&gcc 30>,
                                 <&gcc 9>;
                        clock-names = "core", "iface";
                        reg = <0x01fc0000 0x1000>;
                };
 
-               sdhc_1: sdhci@8804000 {
+               sdhc_1: mmc@8804000 {
                        compatible = "qcom,sdx55-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x08804000 0x1000>;
                        interrupts = <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>,
                        #interrupt-cells = <2>;
                };
 
-               imem@1468f000 {
-                       compatible = "simple-mfd";
+               sram@1468f000 {
+                       compatible = "qcom,sdx55-imem", "syscon", "simple-mfd";
                        reg = <0x1468f000 0x1000>;
 
                        #address-cells = <1>;
index 79dc31aa7cd1050069da7039efde4dfce09c925a..85ea02d8362d40ef1c1b7066a4f7af3eff98b9c4 100644 (file)
        };
 };
 
-&blsp1_uart3 {
-       status = "ok";
-};
-
 &apps_rsc {
        pmx65-rpmh-regulators {
                compatible = "qcom,pmx65-rpmh-regulators";
                        regulator-max-microvolt = <1300000>;
                };
 
-               ldo1 {
+               vreg_l1b_1p2: ldo1 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                };
 
-               ldo4 {
+               vreg_l4b_0p88: ldo4 {
                        regulator-min-microvolt = <880000>;
                        regulator-max-microvolt = <912000>;
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                };
 
-               ldo5 {
+               vreg_l5b_1p8: ldo5 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                };
 
-               ldo10 {
+               vreg_l10b_3p08: ldo10 {
                        regulator-min-microvolt = <3088000>;
                        regulator-max-microvolt = <3088000>;
                        regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
                };
        };
 };
+
+&blsp1_uart3 {
+       status = "okay";
+};
+
+&qpic_bam {
+       status = "okay";
+};
+
+&qpic_nand {
+       status = "okay";
+
+       nand@0 {
+               reg = <0>;
+
+               nand-ecc-strength = <4>;
+               nand-ecc-step-size = <512>;
+               nand-bus-width = <8>;
+               /* ico and efs2 partitions are secured */
+               secure-regions = /bits/ 64 <0x500000 0x500000
+                                           0xa00000 0xb00000>;
+       };
+};
+
+&remoteproc_mpss {
+       status = "okay";
+       memory-region = <&mpss_adsp_mem>;
+};
+
+&usb {
+       status = "okay";
+};
+
+&usb_dwc3 {
+       dr_mode = "peripheral";
+};
+
+&usb_hsphy {
+       status = "okay";
+       vdda-pll-supply = <&vreg_l4b_0p88>;
+       vdda33-supply = <&vreg_l10b_3p08>;
+       vdda18-supply = <&vreg_l5b_1p8>;
+};
+
+&usb_qmpphy {
+       status = "okay";
+       vdda-phy-supply = <&vreg_l4b_0p88>;
+       vdda-pll-supply = <&vreg_l1b_1p2>;
+};
index df6f9d6288fe161a71ef913a0a3fc936f66469a7..8daefd50217a30eaba58524ade54bb49b074f731 100644 (file)
                        clock-output-names = "sleep_clk";
                        #clock-cells = <0>;
                };
+
+               nand_clk_dummy: nand-clk-dummy {
+                       compatible = "fixed-clock";
+                       clock-frequency = <32764>;
+                       #clock-cells = <0>;
+               };
        };
 
        cpus {
                        compatible = "arm,cortex-a7";
                        reg = <0x0>;
                        enable-method = "psci";
+                       clocks = <&apcs>;
+                       power-domains = <&rpmhpd SDX65_CX_AO>;
+                       power-domain-names = "rpmhpd";
+                       operating-points-v2 = <&cpu_opp_table>;
                };
        };
 
+       cpu_opp_table: cpu-opp-table {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-345600000 {
+                       opp-hz = /bits/ 64 <345600000>;
+                       required-opps = <&rpmhpd_opp_low_svs>;
+               };
+
+               opp-576000000 {
+                       opp-hz = /bits/ 64 <576000000>;
+                       required-opps = <&rpmhpd_opp_svs>;
+               };
+
+               opp-1094400000 {
+                       opp-hz = /bits/ 64 <1094400000>;
+                       required-opps = <&rpmhpd_opp_nom>;
+               };
+
+               opp-1497600000 {
+                       opp-hz = /bits/ 64 <1497600000>;
+                       required-opps = <&rpmhpd_opp_turbo>;
+               };
+       };
+
+       firmware {
+               scm {
+                       compatible = "qcom,scm-sdx65", "qcom,scm";
+               };
+       };
+
+       mc_virt: interconnect-mc-virt {
+               compatible = "qcom,sdx65-mc-virt";
+               #interconnect-cells = <1>;
+               qcom,bcm-voters = <&apps_bcm_voter>;
+       };
+
        psci {
                compatible = "arm,psci-1.0";
                method = "smc";
                };
 
                smem_mem: memory@8fe20000 {
-                       no-map;
+                       compatible = "qcom,smem";
                        reg = <0x8fe20000 0xc0000>;
+                       hwlocks = <&tcsr_mutex 3>;
+                       no-map;
                };
 
                cmd_db: reserved-memory@8fee0000 {
                };
        };
 
+       smp2p-mpss {
+               compatible = "qcom,smp2p";
+               qcom,smem = <435>, <428>;
+               interrupts = <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>;
+               mboxes = <&apcs 14>;
+               qcom,local-pid = <0>;
+               qcom,remote-pid = <1>;
+
+               modem_smp2p_out: master-kernel {
+                       qcom,entry-name = "master-kernel";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               modem_smp2p_in: slave-kernel {
+                       qcom,entry-name = "slave-kernel";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               ipa_smp2p_out: ipa-ap-to-modem {
+                       qcom,entry-name = "ipa";
+                       #qcom,smem-state-cells = <1>;
+               };
+
+               ipa_smp2p_in: ipa-modem-to-ap {
+                       qcom,entry-name = "ipa";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+       };
+
        soc: soc {
                #address-cells = <1>;
                #size-cells = <1>;
                        reg = <0x00100000 0x001f7400>;
                        clocks = <&rpmhcc RPMH_CXO_CLK>, <&rpmhcc RPMH_CXO_CLK_A>, <&sleep_clk>;
                        clock-names = "bi_tcxo", "bi_tcxo_ao", "sleep_clk";
+                       #power-domain-cells = <1>;
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                };
                        status = "disabled";
                };
 
+               usb_hsphy: phy@ff4000 {
+                       compatible = "qcom,usb-snps-hs-7nm-phy";
+                       reg = <0xff4000 0x120>;
+                       #phy-cells = <0>;
+                       status = "disabled";
+                       clocks = <&rpmhcc RPMH_CXO_CLK>;
+                       clock-names = "ref";
+                       resets = <&gcc GCC_QUSB2PHY_BCR>;
+               };
+
+               usb_qmpphy: phy@ff6000 {
+                       compatible = "qcom,sdx65-qmp-usb3-uni-phy";
+                       reg = <0x00ff6000 0x1c8>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB3_PHY_AUX_CLK>,
+                                <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
+                                <&gcc GCC_USB3_PRIM_CLKREF_EN>;
+                       clock-names = "aux", "cfg_ahb", "ref";
+
+                       resets = <&gcc GCC_USB3PHY_PHY_BCR>,
+                                <&gcc GCC_USB3_PHY_BCR>;
+                       reset-names = "phy", "common";
+
+                       usb_ssphy: phy@ff6200 {
+                               reg = <0x00ff6e00 0x160>,
+                                     <0x00ff7000 0x1ec>,
+                                     <0x00ff6200 0x1e00>;
+                               #phy-cells = <0>;
+                               #clock-cells = <0>;
+                               clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>;
+                               clock-names = "pipe0";
+                               clock-output-names = "usb3_uni_phy_pipe_clk_src";
+                       };
+               };
+
+               system_noc: interconnect@1620000 {
+                       compatible = "qcom,sdx65-system-noc";
+                       reg = <0x01620000 0x31200>;
+                       #interconnect-cells = <1>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               qpic_bam: dma-controller@1b04000 {
+                       compatible = "qcom,bam-v1.7.0";
+                       reg = <0x01b04000 0x1c000>;
+                       interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&rpmhcc RPMH_QPIC_CLK>;
+                       clock-names = "bam_clk";
+                       #dma-cells = <1>;
+                       qcom,ee = <0>;
+                       qcom,controlled-remotely;
+                       status = "disabled";
+               };
+
+               qpic_nand: nand-controller@1b30000 {
+                       compatible = "qcom,sdx55-nand";
+                       reg = <0x01b30000 0x10000>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       clocks = <&rpmhcc RPMH_QPIC_CLK>,
+                                <&nand_clk_dummy>;
+                       clock-names = "core", "aon";
+
+                       dmas = <&qpic_bam 0>,
+                              <&qpic_bam 1>,
+                              <&qpic_bam 2>;
+                       dma-names = "tx", "rx", "cmd";
+                       status = "disabled";
+               };
+
                tcsr_mutex: hwlock@1f40000 {
                        compatible = "qcom,tcsr-mutex";
                        reg = <0x01f40000 0x40000>;
                        #hwlock-cells = <1>;
                };
 
-               sdhc_1: sdhci@8804000 {
+               remoteproc_mpss: remoteproc@4080000 {
+                       compatible = "qcom,sdx55-mpss-pas";
+                       reg = <0x04080000 0x4040>;
+
+                       interrupts-extended = <&intc GIC_SPI 250 IRQ_TYPE_EDGE_RISING>,
+                                             <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
+                                             <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
+                                             <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
+                                             <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
+                                             <&modem_smp2p_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 SDX65_CX>,
+                                       <&rpmhpd SDX65_MSS>;
+                       power-domain-names = "cx", "mss";
+
+                       qcom,smem-states = <&modem_smp2p_out 0>;
+                       qcom,smem-state-names = "stop";
+
+                       status = "disabled";
+
+                       glink-edge {
+                               interrupts = <GIC_SPI 114 IRQ_TYPE_EDGE_RISING>;
+                               label = "mpss";
+                               qcom,remote-pid = <1>;
+                               mboxes = <&apcs 15>;
+                       };
+               };
+
+               sdhc_1: mmc@8804000 {
                        compatible = "qcom,sdx65-sdhci", "qcom,sdhci-msm-v5";
                        reg = <0x08804000 0x1000>;
                        reg-names = "hc_mem";
                        status = "disabled";
                };
 
+               mem_noc: interconnect@9680000 {
+                       compatible = "qcom,sdx65-mem-noc";
+                       reg = <0x09680000 0x27200>;
+                       #interconnect-cells = <1>;
+                       qcom,bcm-voters = <&apps_bcm_voter>;
+               };
+
+               usb: usb@a6f8800 {
+                       compatible = "qcom,sdx65-dwc3", "qcom,dwc3";
+                       reg = <0x0a6f8800 0x400>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       clocks = <&gcc GCC_USB30_SLV_AHB_CLK>,
+                                <&gcc GCC_USB30_MASTER_CLK>,
+                                <&gcc GCC_USB30_MSTR_AXI_CLK>,
+                                <&gcc GCC_USB30_MOCK_UTMI_CLK>,
+                                <&gcc GCC_USB30_SLEEP_CLK>;
+                       clock-names = "cfg_noc", "core", "iface", "mock_utmi",
+                                       "sleep";
+
+                       assigned-clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>,
+                                         <&gcc GCC_USB30_MASTER_CLK>;
+                       assigned-clock-rates = <19200000>, <200000000>;
+
+                       interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 76 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 18 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 19 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "hs_phy_irq",
+                                         "ss_phy_irq",
+                                         "dm_hs_phy_irq",
+                                         "dp_hs_phy_irq";
+
+                       power-domains = <&gcc USB30_GDSC>;
+
+                       resets = <&gcc GCC_USB30_BCR>;
+
+                       usb_dwc3: usb@a600000 {
+                               compatible = "snps,dwc3";
+                               reg = <0x0a600000 0xcd00>;
+                               interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+                               iommus = <&apps_smmu 0x1a0 0x0>;
+                               snps,dis_u2_susphy_quirk;
+                               snps,dis_enblslpm_quirk;
+                               phys = <&usb_hsphy>, <&usb_ssphy>;
+                               phy-names = "usb2-phy", "usb3-phy";
+                       };
+               };
+
+               restart@c264000 {
+                       compatible = "qcom,pshold";
+                       reg = <0x0c264000 0x1000>;
+               };
+
                spmi_bus: qcom,spmi@c440000 {
                        compatible = "qcom,spmi-pmic-arb";
                        reg = <0xc440000 0xd00>,
                        interrupt-controller;
                };
 
+               imem@1468f000 {
+                       compatible = "simple-mfd";
+                       reg = <0x1468f000 0x1000>;
+                       ranges = <0x0 0x1468f000 0x1000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       pil-reloc@94c {
+                               compatible = "qcom,pil-reloc-info";
+                               reg = <0x94c 0xc8>;
+                       };
+               };
+
                apps_smmu: iommu@15000000 {
                        compatible = "qcom,sdx65-smmu-500", "arm,mmu-500";
                        reg = <0x15000000 0x40000>;
                        #clock-cells = <0>;
                };
 
+               watchdog@17817000 {
+                       compatible = "qcom,apss-wdt-sdx65", "qcom,kpss-wdt";
+                       reg = <0x17817000 0x1000>;
+                       clocks = <&sleep_clk>;
+               };
+
                timer@17820000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                                        };
                                };
                        };
+
+                       apps_bcm_voter: bcm-voter {
+                               compatible = "qcom,bcm-voter";
+                       };
+
                };
        };
 
index 9c0d9686fe01133b9bb3dbab2a982d13f547ed83..69a5a44b8a2fdd741c45d90390ed34769b9d8b1b 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 57cd2fa722490b08cfe80a840fb2cb3500fc01be..5ad5349a50dc9b2630deafdb7911fb6910e3400f 100644 (file)
                                compatible = "dlg,da9063-rtc";
                        };
 
-                       wdt {
+                       watchdog {
                                compatible = "dlg,da9063-watchdog";
                        };
                };
index c802f9f13c18b83769630765f2f250fd6b19ea59..fe14727eefe1ec8caddc3a46d7c3eaef2f80d57c 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 6e691b6cac05cdf4037bff297a9cef7f2dfdd0c8..26a40782cc899bd0ebe74df0ca5f91f099dde72f 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 38e2ab928707d99edca9858a8ae7f9ebb1f003ef..ec0a20d5130d6f0491a75d737973d7ae67f47ca6 100644 (file)
                interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
                interrupt-controller;
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 62aa9f61321bea7425301c7c10f667f0e34a2477..c66de9dd12dfca3880b7d6b54b0e739da02fdf87 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index c8978f4f62e9f2dcf14ccf1614b2664b9df9de7a..79b537b24642662d2954a12dd06d2a88d5f28025 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 99d554fe3329eb7a4e0d5a2046131cfdce264b41..4d93319674c6efcf8fed348436b435532a063db8 100644 (file)
                        compatible = "dlg,da9063-rtc";
                };
 
-               wdt {
+               watchdog {
                        compatible = "dlg,da9063-watchdog";
                };
        };
index 92a76164432a897618f70228b1644d3aa24048f6..b7af1befa126ba624b8391f0e7fe8dd2f4320cac 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 3f8f3ce87e122a10f515b5ede098fa4aa53e1b07..4bf813335e2121bacc6557b3b9097e283d5ebac4 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 d3665910958bbf6d9d0a90b323ab6b4aa433ebfc..5b97fa85474fd63492283f1f9a9cb2995c1848c1 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 390aa33cd55ac8a8bc1880869eb86645f034e442..962b4d1291dba65b634628b47ff92410d819094b 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 667d57a4ff45a5e13b1d3b92e5d2d6f5179e5fd5..cfa318a506eb03c10afe4e07cba074203acd8177 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 12b2e59aebc478bd4881048420c2ad930a0c2877..dbbc5170094e01ffc6a91b52322cc2564ae094d6 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 35b7a5798eeeeb88721ac56924e980e688a2b0fb..9312be362a7adadcf09e0a89ace01366a5783350 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 fc478ac4e781f99a847cc8ca723c8f10b0f79d6d..0a1ae689b162bbc814627441d0a361d21a2c0409 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 36c0945f43b2285da819c86daf1e7a8c6ebb3353..a9ed3cd2c2da64512a557a58af7753f300286fea 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 797476e8bef145009be06b43efea8cbe05abf3b7..5c3d08e3eea3a0b20c48b3b42def2637db018923 100644 (file)
                regulator-boot-on;
        };
 
-       gpio_keys {
+       gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
                pinctrl-names = "default";
index c4ca73b40d4afe7065d552ebdb9d5cca41a68b34..399d6b9c5fd4bbc054619280e7d56bbef2834fd6 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 9a4a9749c4055a96e4ed982e32de34e512895602..a5a0826341e6d7524bc3dc77db399c32acf01c0a 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 7fb582302b3265290b4f4ad852c19a85eb158c39..052afe5543e2ada206a316669ee810c7d359ed47 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 1e33859de4847c60e4cc269cf7c6f8f688b05f23..1a515695149230c7be8716b3d492b5bb3a402236 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 8c7376d64bc497c2a623d622513c54684b633bf0..fd90f3b8fc328f3ed470c6285c07fe12e0603fa3 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 55467bc30fa6a3c9f606c7c23aae6e3a9ac17c30..633e5a0324635d3de77cf7451838883e8a1828b8 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 c4d1d142d8c68d9afa5fbfc85f0bfc7d052d9955..80e0f07c8e878a9a412f4db2bbf4652b65973bb1 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 9c1e38c54eae972e324bd49155184bd2f84e5bc3..09618bb7d872c9f26c2d9cdac69d66364021016c 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 a10d25ac8f7bf0c396bb292736567fe2e5a3007a..f9dde0eef527dbc0097c6e451b1a61804d45fc00 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 05112c25176d3f1afbdb13cc1d79bc2cd3173abc..700bb548d6b271a434db544ab332ce05065fda2f 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 82fc6fba9999277bb5c4cb519a0bc435d523ff0a..dcdcc55c409827f9fe9c7528dd7153cb103e1ae1 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 4e9fdb0f722d89a8679072a3e7292ee2e9b2f6f6..e2a4e6232eb5884c4e4fe2efd6152e0c48b7fd5e 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 54a6838d73f511e88f3665d126a0d8341a011d3f..e406c8c7c7e5adf79e6193b997cd0cec0d7cd569 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 0c99a5934ebf29317bbd132865791a9b30dbbe83..2d9994379eb235557564759197533574d0d5b323 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 46cad7cb94bf75a26dcbd86cde3fd29217f60f17..ef150f4ee99d5ca20a6538761204b3efe4ccfc8b 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 c158a7ea86ec0f774e521fae7e7b2e854b56f413..abf3006f0a842435b9d56750e805fe93261649c6 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 20a7d72827c214bac7463ea51ac85e901b7e6da8..3268366bd8bcc1741b2c3ed41022719d2ec9e658 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 4f084f4fe44f054d7ea80d4afb4facd09092d91c..4660751cb207c33e7e8743dee3c9d26eb2244aa1 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 0a3186d57cb564d76e35b2e3b1036cfc752c64f4..f53959b7d031244d0865f9de40be553edabb8c0a 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 67a7a66e11d543ab28a1de44a7307832e3ab95dd..c03df635550001353d3844fe44b9a4126c7d63da 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 bc0b7354b6c0604e3a6352b6b5ff0b20df9a66db..0f5c6cd0f3a11478b6ecefdd0ab6fe15b8c8faa1 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 daa1067055c8de6cf8e5b8bdd2f9318bcbbaea70..5541df4df6284b3a4c15cc0d038d5a62272f7bae 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 dfb2ee65e4a860f79126cf9dfa103152068b7a6d..eaa7c4f0e2571cfe3b46abdb4bb973cb3dc92b8a 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 a78caaa1f3c5c4c764298920dca6e538ea5a2aea..cdd3653d487f61e787b31eb7d80504331a069db2 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 ae34e7e5789230b3c699c7ecdc31ed6027591d9a..6d6daef9fb7a34965d9e96545065fed897677adc 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 f1b85aae88428ad103322d8445bfb25b6ab4e4e4..12e90a1cc6a149883a4a04223c1eb06b3bb3a498 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 c328b67bea0ca37b95f646614ef55519552b0f33..d3f60f6a456d6d578b188c2a966eeda38d7d98dd 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 659a17fc755cf234206670512de09c3cd876732d..2c50a021aa76831f7870fef5612906398d3bfb71 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 8fa423c52592d246df438faad08af525558fe5fd..2d0935ad2225d6c3500e9c7034982150f2ff1071 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 7b9242664875c05170091c838c7bd28598d9eab2..1e5c01898ccff3d5eb6e54a173de7c19be56c3cc 100644 (file)
                                };
                        };
 
-                       reset_controller: rstc@fc068600 {
+                       reset_controller: reset-controller@fc068600 {
                                compatible = "atmel,sama5d3-rstc", "atmel,at91sam9g45-rstc";
                                reg = <0xfc068600 0x10>;
                                clocks = <&clk32k>;
index a37e3a80392de0083f9d4e6561c996b10f1b30e2..bb6d71e6dfebcdacbaafdfd68e7f1a4fa27a3d72 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 a61a078ea042e6e0062002ac5dfacc3c86fd0afa..69381819e07b12c25266d36d5a3e990a214e6326 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 26bda2557fe811e188bbd17d8b0f5b966eb959c7..4370e3cbbb4b2b5ed1458d843c109ec398cc3f54 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 ddd1cf4d05543e67e61aa91db1a07fba5dcac4d9..05408df38203aa04dc8b4b61bd7759c4eef90e6b 100644 (file)
 
                smi: flash@ea000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@e6000000 {
                                #address-cells = <1>;
index 3a51a41eb5e4d4ffebfae79f604817dfb0b65fb3..7700f2afc1285ae014123e7c118f8ad8a3869f40 100644 (file)
 
                smi: flash@ea000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@e6000000 {
                                #address-cells = <1>;
index 13e1bdb3ddbf1190b2a16258b078470059c4f7a3..818886e117138dcdfbcfa2c6ad4bf7b66af2bac3 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 2beb30ca2cba94803a25af9c2b599ca5d6a7f3ca..303ef29fb805c8983bcdcc0e02a8c98be6aedd12 100644 (file)
@@ -80,7 +80,7 @@
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index 1c41e4a40334070b8097a9933ffaf4b194000ba6..ea0b53036f7b479a7081b8212219cb3030bdd671 100644 (file)
@@ -94,7 +94,7 @@
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index c322407a0adeb5f3c58e411a19d51103e0a40245..3c026d021c92445e8bfa2b896ad4402bc8ef4216 100644 (file)
@@ -95,7 +95,7 @@
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index b587e4ec11e5de305139bcf7e970211b3753868f..34503ac9c51c24abf6e2d903618a2090a2185a52 100644 (file)
 
                smi: flash@fc000000 {
                        status = "okay";
-                       clock-rate=<50000000>;
+                       clock-rate = <50000000>;
 
                        flash@f8000000 {
                                #address-cells = <1>;
index 47ac4474ed96e6a9ef30ea198912faaf18af8493..b12474446a48732e44a3fa9af2d350ac002efede 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 35137c6e52eeb49bec231a61faf88aeddce9aaa4..dd30d08ccb9b96afe608736654e7d72888123e98 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 c28b326402548bd4d977116fb79fa893991b9bd3..9afe8301bd4791315cb5b4cb083ec2883d0c2c25 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 8f504edefd3f24e7abf9c19d34430a82489a0b5f..e66fa59c2de64ebfd7d4cdf6e716784ce7d59396 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 b6746ac167bc16a6ae76df012049fd21cec1835a..5f41256d7f4b4ed75a62fb10dbabd7dc9fde57ee 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 53062d50e455abac1e6fd0dced6903e7db456dc3..806da3fc33cd7ee4b8b2de10ed1a764a17eff213 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 e6d4fd0eb5f429088c914ab0183b571bacaee511..ed5c79c3d04b0ce85b6f527eb17fef373bf6e27d 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 1713f787811769d8ea2160410fed0426b4e6c926..5ebb77947fd913c6abea8f13165a2c8e92b31d5e 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 9e212b0af89d8f20fed8ecaa74603474f8ea8692..aca43d2bdaad44ef2a0e8a120c679c217709af44 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 ce2f62cf129bed020dd6c38f91f4ed877b62821c..a39dd5f7bcae629f5f54944c8e8d844373160676 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 4c72dedcd1be76cb87fc123da6175625d0573d36..2aa94605d3d47e4b0d811f75ed9e6cd90fb6460a 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 0d98aca0173607753e1d938abb4df62079eb1cee..3de0e9dbe030489dd1df6074058b43124aa8bb53 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 91dde07a38ba27418d1932a0be70149806739959..2059593da21dc308ff92930fd52b2348c3826cf2 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 59e01ce10318412528d8813edcb6994e099a96a7..2b452883a7081d0d9f3747ef18778ca357179368 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 38cc7faf68841294c5fe18214aaa86f02bd06b70..5c5d8059bdc757d1c7ca786844604c09a50dba97 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 9bb73bb6190126394694a332794fa259c11f40e3..f3e70d3b65ac4ac75262b422938d30b965fcb670 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 f9ebc47e64217f26e2307bde7044407c349ebc63..3a921db23e9f625396ea7f9f8f8964b860ba022d 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 0fb1386257cfababd413f6bf9ad29e6f634cb493..531c263c9f466f9d6da2b2d69349bd6ef21f9353 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 09d6226d598f433e3c53e18aea06069d3c88865e..e6b8ffd332c7e2dba8fb53e98bac1994cc61e896 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 fa6889e30591304f0421bf4a16de3e5fa94afba6..4d00e759288291ef02e57b48d5525023c0000822 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 fa6889e30591304f0421bf4a16de3e5fa94afba6..4d00e759288291ef02e57b48d5525023c0000822 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 6052243ad81c53dca965b4a74706334a9d6bbbf3..2cc9341d43d29511ecbb55722e9dacc10624409e 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 */
index e04dda5ddd954e4246cae0b5a78b3d82bc98daa9..742fdeeff4b604d559fd718ebc914593049e9d56 100644 (file)
                        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";
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 76c54b006d8712e49a29b60ff3e1938e0e67d9c5..90933077d66dec808ada9dda5565213e7dfc0e3d 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 75172314d7afd3fb515bc1e846cccac8cc3550aa..9937b28548c23ea09f053788c3414b948de19705 100644 (file)
        };
 };
 
+&vdd {
+       regulator-min-microvolt = <2900000>;
+       regulator-max-microvolt = <2900000>;
+};
+
 &pwr_regulators {
        vdd-supply = <&vdd_io>;
 };
index 6336c3ca0f0e283e0869096b838f87dbaf4e9514..134a798ad3f23f628e8673fadaf58b777cf64e41 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 6706d8311a6655f0b6d7e93a3d9fa72daf90f53f..935b7084b5a23e1898e29fa0437a6fc59b896e8c 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 0a562b2cc5bc6771c65ed77c2c72d2f76c87bd55..62e7aa587f891e54de3417fbf5f261ec657c7eaa 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 1ac82376baef159e3b10d58cf444c2df1f5a5314..a332d61fd5614d9ea7bb5d119e4d682d305056ab 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 2ce361f8fede937cf9c0012dad4b5dfe8785b4cf..3a6c4bd0a44f9dc2304d0eb84a2fc95bb5af5d42 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 715d748544499e5300d27155d02156630e478c89..70e634b37aae0a840d0f141bad83b17d07ba9761 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 4f8d55d3ba79c73e2f35edbc245908b3df663a24..928b86a95f34955926e560879445add878bef518 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 4461d5098b20b7c423a67af3519c6733bfcd3e86..1a262a05fdcb25c05781e925fb1005dbccc7a53c 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 d5c7b7984d857f260984f51074e4484bd066bd70..d729b7c705db54d9cf9f40cda299fc71abc1cef1 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 cd9f655e4f9240b81a5cba8a5de8123fd5df6507..27a0d51289ddd4eeb9b9eaa14c1ebd565e30e38c 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 ff0a7a952e0c1add68b0769df6914ab12087e8e8..f5c8ccc5b872c198f205c6f34cf6f1856e04a14c 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 8e7dfcffe1fbe471a1e694bb1a32d5b52f9f0646..43641cb82398fca8c5b234e492764441cebb1118 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 cd3df12b6573be7ed58c569c74d27ae345e39f22..9e1a33f94cadc58a56e3bb92b6bcdda8341d830b 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 26e2e6172e0dc52bd5890a4771eea6bf55483500..42cd1131adf3d098fb434c9e4126a6d88d870db1 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 a9f749f49bebe37fe81d815d7c82cc4b481ca9cb..cf8413fba6c1ad7f04c739379b3e34c84148134b 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 9daffd90c12f0b5535b5a2a1e160e67650f99d72..f1f9dbead32a93e19e48f627b82c76ea9dd9c9f4 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 6f9c97add54e686898b53d4a2a4cc6e2f1332ecf..305b34a321f5cc21ee38986b6d53f93bda6ae3a1 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 4759ba3f2986e031d4eb21669cd33cad1134d3bd..59f6f6d5e7ca4c24a28c11f24449c1d8d1b4b218 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 90f75fa85e68b93fbecddc5daf8079cb0a3cf464..b96e015f54eefb6a202c726b2031949f9b30f759 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 bf5b5e2f6168beefaef40d67e25c9befae73ce85..bc394686fedbb8fc8c9c514113eebb30c940b052 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 a6a1087a0c9b2bded7eafb7bb1d8b4a160b874c1..28197bbcb1d56ad3604f60a6172d0c9f8cf4586a 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 265e0fa57a32af2ce9c05ffcf61e57d9e406b4be..9f39b5a2bb35ee80d62ece671e0b91a4bcbc3b53 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 03d3e5f45a0909c02448b870090dfff3d9ae2f46..4ef26d8f534034b705d40a3d6eaf21bd39ff6280 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 6931aaab23827ac597c74e5b0be9a793cef1aa39..9f472521f4a45ca32a6053175160c79967478f67 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 084323d5c61cb03c7e882c29dc21f298e77058bc..db194c606fdcdf48bb7d13c9ca5de0042cd8a69b 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 47954551f5735c4d221b4e15ea034f0961f88d66..434871040aca00b07d74f42eae522b5d05ff6239 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";
 };
diff --git a/arch/arm/boot/dts/sunplus-sp7021-achip.dtsi b/arch/arm/boot/dts/sunplus-sp7021-achip.dtsi
new file mode 100644 (file)
index 0000000..493d323
--- /dev/null
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for Sunplus SP7021
+ *
+ * Copyright (C) 2021 Sunplus Technology Co.
+ */
+
+#include "sunplus-sp7021.dtsi"
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+
+/ {
+       compatible = "sunplus,sp7021-achip", "sunplus,sp7021";
+       model = "Sunplus SP7021 (CA7)";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&gic>;
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <0>;
+                       clock-frequency = <931000000>;
+               };
+               cpu1: cpu@1 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <1>;
+                       clock-frequency = <931000000>;
+               };
+               cpu2: cpu@2 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <2>;
+                       clock-frequency = <931000000>;
+               };
+               cpu3: cpu@3 {
+                       compatible = "arm,cortex-a7";
+                       device_type = "cpu";
+                       reg = <3>;
+                       clock-frequency = <931000000>;
+               };
+       };
+
+       gic: interrupt-controller@9f101000 {
+               compatible = "arm,cortex-a7-gic";
+               interrupt-controller;
+               #interrupt-cells = <3>;
+               reg = <0x9f101000 0x1000>,
+                     <0x9f102000 0x2000>,
+                     <0x9f104000 0x2000>,
+                     <0x9f106000 0x2000>;
+       };
+
+       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)>;
+               clock-frequency = <XTAL>;
+               arm,cpu-registers-not-fw-configured;
+       };
+
+       arm-pmu {
+               compatible = "arm,cortex-a7-pmu";
+               interrupts = <GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+       };
+
+       soc@9c000000 {
+               intc: interrupt-controller@780 {
+                       interrupt-parent = <&gic>;
+                       interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, /* EXT_INT0 */
+                                    <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>; /* EXT_INT1 */
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/sunplus-sp7021-demo-v3.dts b/arch/arm/boot/dts/sunplus-sp7021-demo-v3.dts
new file mode 100644 (file)
index 0000000..d5c5ffc
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for Sunplus SP7021 Demo V3 SBC board
+ *
+ * Copyright (C) Sunplus Technology Co.
+ */
+
+/dts-v1/;
+
+#include "sunplus-sp7021-achip.dtsi"
+
+/ {
+       compatible = "sunplus,sp7021-demo-v3", "sunplus,sp7021";
+       model = "Sunplus SP7021/CA7/Demo_V3";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               device_type = "memory";
+               reg = <0x00000000 0x20000000>;
+       };
+};
diff --git a/arch/arm/boot/dts/sunplus-sp7021.dtsi b/arch/arm/boot/dts/sunplus-sp7021.dtsi
new file mode 100644 (file)
index 0000000..7dc4ce3
--- /dev/null
@@ -0,0 +1,310 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for Sunplus SP7021
+ *
+ * Copyright (C) 2021 Sunplus Technology Co.
+ */
+
+#include <dt-bindings/clock/sunplus,sp7021-clkc.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/reset/sunplus,sp7021-reset.h>
+#include <dt-bindings/pinctrl/sppctl-sp7021.h>
+#include <dt-bindings/gpio/gpio.h>
+
+#define XTAL   27000000
+
+/ {
+       compatible = "sunplus,sp7021";
+       model = "Sunplus SP7021";
+
+       clocks {
+               extclk: osc0 {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <XTAL>;
+                       clock-output-names = "extclk";
+               };
+       };
+
+       soc@9c000000 {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges = <0 0x9c000000 0x400000>;
+               interrupt-parent = <&intc>;
+
+               clkc: clock-controller@4 {
+                       compatible = "sunplus,sp7021-clkc";
+                       reg = <0x4 0x28>,
+                             <0x200 0x44>,
+                             <0x268 0x04>;
+                       clocks = <&extclk>;
+                       #clock-cells = <1>;
+               };
+
+               intc: interrupt-controller@780 {
+                       compatible = "sunplus,sp7021-intc";
+                       reg = <0x780 0x80>, <0xa80 0x80>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
+               otp: otp@af00 {
+                       compatible = "sunplus,sp7021-ocotp";
+                       reg = <0xaf00 0x34>, <0xaf80 0x58>;
+                       reg-names = "hb_gpio", "otprx";
+                       clocks = <&clkc CLK_OTPRX>;
+                       resets = <&rstc RST_OTPRX>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       therm_calib: thermal-calibration@14 {
+                               reg = <0x14 0x3>;
+                       };
+                       disc_vol: disconnect-voltage@18 {
+                               reg = <0x18 0x2>;
+                       };
+                       mac_addr0: mac-address0@34 {
+                               reg = <0x34 0x6>;
+                       };
+                       mac_addr1: mac-address1@3a {
+                               reg = <0x3a 0x6>;
+                       };
+               };
+
+               pctl: pinctrl@100 {
+                       compatible = "sunplus,sp7021-pctl";
+                       reg = <0x100 0x100>,
+                             <0x300 0x100>,
+                             <0x32e4 0x1C>,
+                             <0x80 0x20>;
+                       reg-names = "moon2", "gpioxt", "first", "moon1";
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       clocks = <&clkc CLK_GPIO>;
+                       resets = <&rstc RST_GPIO>;
+
+                       emac_pins: pinmux-emac-pins {
+                               sunplus,pins = <
+                                       SPPCTL_IOPAD(49,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_CLK_OUT,0)
+                                       SPPCTL_IOPAD(44,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_MAC_SMI_MDC,0)
+                                       SPPCTL_IOPAD(43,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_MAC_SMI_MDIO,0)
+                                       SPPCTL_IOPAD(52,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_TXEN,0)
+                                       SPPCTL_IOPAD(50,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_TXD0,0)
+                                       SPPCTL_IOPAD(51,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_TXD1,0)
+                                       SPPCTL_IOPAD(46,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_CRSDV,0)
+                                       SPPCTL_IOPAD(47,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_RXD0,0)
+                                       SPPCTL_IOPAD(48,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_RXD1,0)
+                                       SPPCTL_IOPAD(45,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P0_MAC_RMII_RXER,0)
+                                       SPPCTL_IOPAD(59,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_TXEN,0)
+                                       SPPCTL_IOPAD(57,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_TXD0,0)
+                                       SPPCTL_IOPAD(58,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_TXD1,0)
+                                       SPPCTL_IOPAD(54,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_CRSDV,0)
+                                       SPPCTL_IOPAD(55,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_RXD0,0)
+                                       SPPCTL_IOPAD(56,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_RXD1,0)
+                                       SPPCTL_IOPAD(53,SPPCTL_PCTL_G_PMUX,MUXF_L2SW_P1_MAC_RMII_RXER,0)
+                               >;
+                               sunplus,zerofunc = <
+                                       MUXF_L2SW_LED_FLASH0
+                                       MUXF_L2SW_LED_FLASH1
+                                       MUXF_L2SW_LED_ON0
+                                       MUXF_L2SW_LED_ON1
+                                       MUXF_DAISY_MODE
+                               >;
+                       };
+
+                       emmc_pins: pinmux-emmc-pins {
+                               function = "CARD0_EMMC";
+                               groups = "CARD0_EMMC";
+                       };
+
+                       leds_pins: pinmux-leds-pins {
+                               sunplus,pins = < SPPCTL_IOPAD(0,SPPCTL_PCTL_G_GPIO,0,SPPCTL_PCTL_L_OUT) >;
+                       };
+
+                       sdcard_pins: pinmux-sdcard-pins {
+                               function = "SD_CARD";
+                               groups = "SD_CARD";
+                               sunplus,pins = < SPPCTL_IOPAD(91, SPPCTL_PCTL_G_GPIO, 0, 0) >;
+                       };
+
+                       spi0_pins: pinmux-spi0-pins {
+                               sunplus,pins = <
+                                       SPPCTL_IOPAD(26,SPPCTL_PCTL_G_GPIO,0,0)
+                                       SPPCTL_IOPAD(28,SPPCTL_PCTL_G_GPIO,0,0)
+                                       SPPCTL_IOPAD(23,SPPCTL_PCTL_G_PMUX,MUXF_SPI0S_DO,0)
+                                       SPPCTL_IOPAD(25,SPPCTL_PCTL_G_PMUX,MUXF_SPI0S_DI,0)
+                                       SPPCTL_IOPAD(27,SPPCTL_PCTL_G_PMUX,MUXF_SPI0S_CLK,0)
+                               >;
+                       };
+
+                       uart0_pins: pinmux-uart0-pins {
+                               function = "UA0";
+                               groups = "UA0";
+                       };
+
+                       uart1_pins: pinmux-uart1-pins {
+                               sunplus,pins = <
+                                       SPPCTL_IOPAD(14,SPPCTL_PCTL_G_PMUX,MUXF_UA4_TX,0)
+                                       SPPCTL_IOPAD(16,SPPCTL_PCTL_G_PMUX,MUXF_UA4_RX,0)
+                               >;
+                       };
+
+                       uart2_pins: pinmux-uart2-pins {
+                               sunplus,pins = <
+                                       SPPCTL_IOPAD(16,SPPCTL_PCTL_G_PMUX,MUXF_UA2_TX,0)
+                                       SPPCTL_IOPAD(17,SPPCTL_PCTL_G_PMUX,MUXF_UA2_RX,0)
+                                       SPPCTL_IOPAD(18,SPPCTL_PCTL_G_PMUX,MUXF_UA2_RTS,0)
+                                       SPPCTL_IOPAD(19,SPPCTL_PCTL_G_PMUX,MUXF_UA2_CTS,0)
+                               >;
+                       };
+
+                       uart4_pins: pinmux-uart4-pins {
+                               sunplus,pins = <
+                                       SPPCTL_IOPAD(22,SPPCTL_PCTL_G_PMUX,MUXF_UA4_TX,0)
+                                       SPPCTL_IOPAD(20,SPPCTL_PCTL_G_PMUX,MUXF_UA4_RX,0)
+                                       SPPCTL_IOPAD(23,SPPCTL_PCTL_G_PMUX,MUXF_UA4_RTS,0)
+                                       SPPCTL_IOPAD(21,SPPCTL_PCTL_G_PMUX,MUXF_UA4_CTS,0)
+                               >;
+                       };
+               };
+
+               rstc: reset@54 {
+                       compatible = "sunplus,sp7021-reset";
+                       reg = <0x54 0x28>;
+                       #reset-cells = <1>;
+               };
+
+               rtc: rtc@3a00 {
+                       compatible = "sunplus,sp7021-rtc";
+                       reg = <0x3a00 0x80>;
+                       reg-names = "rtc";
+                       clocks = <&clkc CLK_RTC>;
+                       resets = <&rstc RST_RTC>;
+                       interrupts = <163 IRQ_TYPE_EDGE_RISING>;
+               };
+
+               spi_controller0: spi@2d80 {
+                       compatible = "sunplus,sp7021-spi";
+                       reg = <0x2d80 0x80>, <0x2e00 0x80>;
+                       reg-names = "master", "slave";
+                       interrupts = <144 IRQ_TYPE_LEVEL_HIGH>,
+                                    <146 IRQ_TYPE_LEVEL_HIGH>,
+                                    <145 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "dma_w", "master_risc", "slave_risc";
+                       clocks = <&clkc CLK_SPI_COMBO_0>;
+                       resets = <&rstc RST_SPI_COMBO_0>;
+
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi0_pins>;
+                       cs-gpios = <&pctl 26 GPIO_ACTIVE_LOW>,
+                                  <&pctl 28 GPIO_ACTIVE_LOW>;
+               };
+
+               spi_controller1: spi@f480 {
+                       compatible = "sunplus,sp7021-spi";
+                       reg = <0xf480 0x80>, <0xf500 0x80>;
+                       reg-names = "master", "slave";
+                       interrupts = <67 IRQ_TYPE_LEVEL_HIGH>,
+                                    <69 IRQ_TYPE_LEVEL_HIGH>,
+                                    <68 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "dma_w", "master_risc", "slave_risc";
+                       clocks = <&clkc CLK_SPI_COMBO_1>;
+                       resets = <&rstc RST_SPI_COMBO_1>;
+                       spi-max-frequency = <25000000>;
+                       status = "disabled";
+               };
+
+               spi_controller2: spi@f600 {
+                       compatible = "sunplus,sp7021-spi";
+                       reg = <0xf600 0x80>, <0xf680 0x80>;
+                       reg-names = "master", "slave";
+                       interrupts = <70 IRQ_TYPE_LEVEL_HIGH>,
+                                    <72 IRQ_TYPE_LEVEL_HIGH>,
+                                    <71 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "dma_w", "master_risc", "slave_risc";
+                       clocks = <&clkc CLK_SPI_COMBO_2>;
+                       resets = <&rstc RST_SPI_COMBO_2>;
+                       spi-max-frequency = <25000000>;
+                       status = "disabled";
+               };
+
+               spi_controller3: spi@f780 {
+                       compatible = "sunplus,sp7021-spi";
+                       reg = <0xf780 0x80>, <0xf800 0x80>;
+                       reg-names = "master", "slave";
+                       interrupts = <73 IRQ_TYPE_LEVEL_HIGH>,
+                                    <75 IRQ_TYPE_LEVEL_HIGH>,
+                                    <74 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "dma_w", "master_risc", "slave_risc";
+                       clocks = <&clkc CLK_SPI_COMBO_3>;
+                       resets = <&rstc RST_SPI_COMBO_3>;
+                       spi-max-frequency = <25000000>;
+                       status = "disabled";
+               };
+
+               uart0: serial@900 {
+                       compatible = "sunplus,sp7021-uart";
+                       reg = <0x900 0x80>;
+                       interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clkc CLK_UA0>;
+                       resets = <&rstc RST_UA0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart0_pins>;
+               };
+
+               uart1: serial@980 {
+                       compatible = "sunplus,sp7021-uart";
+                       reg = <0x980 0x80>;
+                       interrupts = <54 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clkc CLK_UA1>;
+                       resets = <&rstc RST_UA1>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart1_pins>;
+                       status = "disabled";
+               };
+
+               uart2: serial@800 {
+                       compatible = "sunplus,sp7021-uart";
+                       reg = <0x800 0x80>;
+                       interrupts = <55 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clkc CLK_UA2>;
+                       resets = <&rstc RST_UA2>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart2_pins>;
+                       status = "disabled";
+               };
+
+               uart3: serial@880 {
+                       compatible = "sunplus,sp7021-uart";
+                       reg = <0x880 0x80>;
+                       interrupts = <56 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clkc CLK_UA3>;
+                       resets = <&rstc RST_UA3>;
+                       status = "disabled";
+               };
+
+               uart4: serial@8780 {
+                       compatible = "sunplus,sp7021-uart";
+                       reg = <0x8780 0x80>;
+                       interrupts = <134 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&clkc CLK_UA4>;
+                       resets = <&rstc RST_UA4>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&uart4_pins>;
+                       status = "disabled";
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&leds_pins>;
+               system-led {
+                       label = "system-led";
+                       gpios = <&pctl 0 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+                       linux,default-trigger = "heartbeat";
+               };
+       };
+};
index d03f5853ef7bf83e199df7db5d48045d1ba92886..e899d14f38c3dad6c86317d476f5abc064caf12c 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 fc67e30fe2129964675203977f9492f4052460d5..60804b0e6c56a62f9049f4a51354747b0d195b26 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 d7e9f977f986840a512624fbf2b0e1427edb9904..09aefb4e90f855629f96572a6df0e95672649d7b 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 9e14fe5fdcde0a7bb7aaea963c62ba1869e0c951..89731bb34c6b71f2bd0ccab34c7c1801345c6e7c 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 b791ce97424bd37dc0b6fbf5afef6b973e69bcd3..284209b0bd966b46fb6254c2f70dfb588f8998b5 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 658edfb8d7fa80243d5b7aefb50c3f562c35efeb..fffd62bcea6a9b0abdc9602a05f349a753623fe1 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 2498cf18fd3910f141fd59873acf26b99fdf099f..b9d00009d1f4a46845bc413371ab342b1c2a5a9a 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 ef8f722dd9cba27e25e4f2d5dd0750c1b50a8699..f02d8c79eee76099dd9de4320ef2ad0e873e0845 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 3209554ec7e6c9a3913e52de53c87d065e978d7d..bce12b3411fc782acaa6bf9459b80bc97837d4ad 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 814257c79bf1744f75f5eaca3515da71056728f4..800283ad6bdc7712077fbfeb7a66276fed576f13 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 28b889e4e33bbc29433a33dd14542c6073e361b4..f41dd4039c07bba2a97f996834fe52bf7f570e43 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 a93cfb492ba10b7fa9f30ecc5be2548882151596..13061ab5247b36ec729d0e67f1cdd66477d9fe90 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 6a9592ceb5f2b1bc9e634a2f2ea604847dd594c2..8f40fcfc11b04d5012ae7566425c61cfe94248a2 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 a170a4ba36c1511e32bd5acb9598408439b62bf6..dac6d02a1b150dbf4b22a973b07cac456963db3c 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 a054d39db466e9a361b3cc9e3ced43e87a73f06c..bf797a1f27ea006f850fe5455ece2e703a4e313b 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 d2a3bf9d28bd7d46b380a121be18e64e06c8078c..cb1190b77db3530e8473165cba4f2f0cfd17d0c3 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 00ecbbd5e9e16f7ad24e874afec6f98178807c86..53487cc21513809464c5514936349a08b4e50f60 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 79b6b79fab65f37832d83977716edf4156a7d76a..11f21aeba8e99b9035159a401b956186b8baf791 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 0fb4b1f5bc1c6c775f4f79e2f95e0dc1c86d4ad5..48fe628c6d875223830b2c4d1e458250cb535128 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 c4a6a6a94559eace54d2e4055cb387e16788563c..5b4c5ef309967139fe7588b2aa302ad8d23e9bb1 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 9d0c86711de21b171bf2d0492040941310550c4d..dc51835423a9e760547a5a5aa855b7611c5b6d71 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 b0a00970b61c43541992b42d373c0cf640d4a4b4..caa17e876e4114bff9279a8156cf77e0c175c8bc 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 93b83b3c5655499b66969e896e719d1e3156d7aa..ad968ff968d77cfc66437c60e3a928778ae74974 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 fbfa75e53f321980dc78e41f677bb01d4ab47d3d..c172fdb5e1aeb24cd1524d62b08c1686d40cc2ad 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 2c2ad2a38f04bb0bda4f884f969413383ce1288a..ee683c5a9c6242f01b327ffe4039528137ed0467 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 cd63e0ef74455d721de4f5dbe337f78ec6fd805b..1b241f0542b89f2265809456f0a324ed1667d1bb 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 c662ab261ed5f92a90dbf1f6a3ea500f25f1d901..c27e70d8bf2b91dcfb88bfcee5ae2923383e7ef1 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 ba257ed36d9cda669eabcddb56f8b0e0642fcabe..540530c983ff56aea98f36d2d9e0608e59ed6315 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 7d4a6ca4936a01d8fad9df8aaf7ec7b4f8caa7c5..8dbc15f9a9e4f2b741f14e74ecacc709e7c50015 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 22231d450b1bd7f3b9d605ba6f5904fbd579a1de..310dff05910d5c919862a05e4f01d0832acf93ea 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 e58dda4f9d2c22fccd24c44e5e3e667fc67cc09f..b7acea39b94225702179ee6ff9f5f997084df55f 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 8ce61035290b529f753270727f6d7a9d73a4ff67..7c81f0205549968b902f3484b697a271a11d9184 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 cf70aff26c6648f41b6009c07f19d63c0185be02..d23201ba8cd7d1282d4b7525558512e87f65751f 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 bf5d1c4568b0d3b79fe13d58d63115c37f6e27c5..dfb1fbafe3aa4e78927c5da7a83878e079fd4b7d 100644 (file)
@@ -49,7 +49,7 @@
        gpio-keys {
                compatible = "gpio-keys";
                autorepeat;
-               K1 {
+               key {
                        label = "K1";
                        gpios = <&gpio0 0x32 0x1>;
                        linux,code = <0x66>;
index 9252ce0e722b9e6464e196e0dd75fb1bc63321a0..3f633eaf97700e6adf59868e2a543dae0b661f4a 100644 (file)
@@ -1,25 +1,22 @@
 CONFIG_LOCALVERSION="gum"
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_PREEMPT=y
 CONFIG_EXPERT=y
 # CONFIG_EPOLL is not set
 # CONFIG_SHMEM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_ARCH_GUMSTIX=y
-CONFIG_PCCARD=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 # CONFIG_OABI_COMPAT is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="console=ttyS0,115200n8 root=1f01 rootfstype=jffs2"
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=m
 CONFIG_UNIX=y
@@ -35,6 +32,7 @@ CONFIG_BT_RFCOMM_TTY=y
 CONFIG_BT_BNEP=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
+CONFIG_PCCARD=y
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
@@ -48,14 +46,15 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_PXA2XX=y
 CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_SD=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=m
 CONFIG_PATA_PCMCIA=m
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
 CONFIG_SMC91X=m
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
@@ -84,16 +83,15 @@ CONFIG_VFAT_FS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 CONFIG_JFFS2_RUBIN=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DETECT_SOFTLOCKUP is not set
-# CONFIG_DEBUG_PREEMPT is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_USER=y
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_ARC4=m
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_PREEMPT is not set
+CONFIG_DEBUG_USER=y
index 5d20057bdc43a0c164159b984dca7a5be2a73658..67feb060bb197da6ee671dee56326000cfc76b0a 100644 (file)
@@ -1,5 +1,4 @@
 CONFIG_KERNEL_XZ=y
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -17,9 +16,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_AIO is not set
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB_FREELIST_RANDOM=y
-CONFIG_SLAB_FREELIST_HARDENED=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_ASPEED=y
 CONFIG_MACH_ASPEED_G4=y
@@ -30,7 +26,6 @@ CONFIG_UACCESS_WITH_MEMCPY=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_KEXEC=y
-CONFIG_FIRMWARE_MEMMAP=y
 CONFIG_JUMP_LABEL=y
 CONFIG_STRICT_KERNEL_RWX=y
 # CONFIG_BLK_DEV_BSG is not set
@@ -38,6 +33,10 @@ CONFIG_STRICT_KERNEL_RWX=y
 # CONFIG_MQ_IOSCHED_DEADLINE is not set
 # CONFIG_MQ_IOSCHED_KYBER is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB_FREELIST_RANDOM=y
+CONFIG_SLAB_FREELIST_HARDENED=y
+# CONFIG_COMPAT_BRK is not set
 # CONFIG_COMPACTION is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -57,12 +56,12 @@ CONFIG_NET_NCSI=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FIRMWARE_MEMMAP=y
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_PARTITIONED_MASTER=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_ASPEED_SMC=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_BLOCK=y
@@ -88,9 +87,9 @@ CONFIG_FTGMAC100=y
 # CONFIG_NET_VENDOR_MELLANOX is not set
 # CONFIG_NET_VENDOR_MICREL is not set
 # CONFIG_NET_VENDOR_MICROSEMI is not set
+# CONFIG_NET_VENDOR_NI is not set
 # CONFIG_NET_VENDOR_NATSEMI is not set
 # CONFIG_NET_VENDOR_NETRONOME is not set
-# CONFIG_NET_VENDOR_NI is not set
 # CONFIG_NET_VENDOR_QUALCOMM is not set
 # CONFIG_NET_VENDOR_RENESAS is not set
 # CONFIG_NET_VENDOR_ROCKER is not set
@@ -134,6 +133,7 @@ CONFIG_I2C_MUX_PCA954x=y
 CONFIG_I2C_ASPEED=y
 CONFIG_I2C_FSI=y
 CONFIG_SPI=y
+CONFIG_SPI_ASPEED_SMC=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_ASPEED=y
@@ -244,9 +244,8 @@ CONFIG_CRYPTO_USER_API_HASH=y
 # CONFIG_XZ_DEC_SPARC is not set
 CONFIG_PRINTK_TIME=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_DEBUG_INFO_DWARF4=y
+CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_GDB_SCRIPTS=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
index ae4f3c56ae6b55dfa2cfe574f26f0505da145b4b..247ab72b25900bd64c592da20efd5a5170c5e930 100644 (file)
@@ -1,5 +1,4 @@
 CONFIG_KERNEL_XZ=y
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -17,9 +16,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_AIO is not set
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB_FREELIST_RANDOM=y
-CONFIG_SLAB_FREELIST_HARDENED=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_ASPEED=y
 CONFIG_MACH_ASPEED_G5=y
@@ -36,13 +32,16 @@ CONFIG_KEXEC=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
-CONFIG_FIRMWARE_MEMMAP=y
 CONFIG_JUMP_LABEL=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_BLK_DEBUG_FS is not set
 # CONFIG_MQ_IOSCHED_DEADLINE is not set
 # CONFIG_MQ_IOSCHED_KYBER is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB_FREELIST_RANDOM=y
+CONFIG_SLAB_FREELIST_HARDENED=y
+# CONFIG_COMPAT_BRK is not set
 # CONFIG_COMPACTION is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -70,12 +69,12 @@ CONFIG_NET_NCSI=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FIRMWARE_MEMMAP=y
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_PARTITIONED_MASTER=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_ASPEED_SMC=y
 CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_FASTMAP=y
 CONFIG_MTD_UBI_BLOCK=y
@@ -103,9 +102,9 @@ CONFIG_FTGMAC100=y
 # CONFIG_NET_VENDOR_MELLANOX is not set
 # CONFIG_NET_VENDOR_MICREL is not set
 # CONFIG_NET_VENDOR_MICROSEMI is not set
+# CONFIG_NET_VENDOR_NI is not set
 # CONFIG_NET_VENDOR_NATSEMI is not set
 # CONFIG_NET_VENDOR_NETRONOME is not set
-# CONFIG_NET_VENDOR_NI is not set
 # CONFIG_NET_VENDOR_QUALCOMM is not set
 # CONFIG_NET_VENDOR_RENESAS is not set
 # CONFIG_NET_VENDOR_ROCKER is not set
@@ -156,6 +155,7 @@ CONFIG_I2C_ASPEED=y
 CONFIG_I2C_FSI=y
 CONFIG_I2C_SLAVE=y
 CONFIG_SPI=y
+CONFIG_SPI_ASPEED_SMC=y
 CONFIG_SPI_FSI=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
@@ -273,9 +273,8 @@ CONFIG_CRYPTO_USER_API_HASH=y
 # CONFIG_XZ_DEC_SPARC is not set
 CONFIG_PRINTK_TIME=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_DEBUG_INFO_DWARF4=y
+CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_GDB_SCRIPTS=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
index 04c86ff558daa4ae0a4b605061f690ff6635bbb5..801383e4135d7e624579c2aeb8c0ef1732c1b311 100644 (file)
@@ -1,25 +1,19 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_ASSABET=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="mem=32M console=ttySA0,38400n8 initrd=0xc0800000,3M root=/dev/ram"
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_SA1100_FIR=m
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
 CONFIG_MTD=y
 CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -46,11 +40,14 @@ CONFIG_FB=y
 CONFIG_FB_SA1100=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_SOUND=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_TMPFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_DEBUG_USER=y
index db15a8be6389e28de06126080d992a19a6ea3cc4..da90ce9cd42e1b6c5af2976e6dbd9f332fd3d126 100644 (file)
@@ -1,5 +1,4 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -9,7 +8,6 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
-CONFIG_SLAB=y
 CONFIG_ARCH_MULTI_V4T=y
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V7 is not set
@@ -27,8 +25,9 @@ CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 r
 CONFIG_KEXEC=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -66,6 +65,7 @@ CONFIG_ATMEL_SSC=y
 CONFIG_EEPROM_AT24=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
@@ -139,9 +139,9 @@ CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_ATMEL_ISI=y
+CONFIG_VIDEO_MT9V032=m
 CONFIG_VIDEO_OV2640=m
 CONFIG_VIDEO_OV7740=m
-CONFIG_VIDEO_MT9V032=m
 CONFIG_DRM=y
 CONFIG_DRM_ATMEL_HLCDC=y
 CONFIG_DRM_PANEL_SIMPLE=y
@@ -206,8 +206,8 @@ CONFIG_PWM_ATMEL=y
 CONFIG_PWM_ATMEL_HLCDC_PWM=y
 CONFIG_PWM_ATMEL_TCB=y
 CONFIG_EXT4_FS=y
-CONFIG_AUTOFS_FS=m
 CONFIG_FANOTIFY=y
+CONFIG_AUTOFS_FS=m
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_UBIFS_FS=y
index 46075216ee6df333ca1730566f9d406c65f7e7b3..bfbaa2df3be53da2e62e406f3322bf1a7dffbe69 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_FHANDLE=y
 CONFIG_AUDIT=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_TASKSTATS=y
@@ -21,12 +22,8 @@ CONFIG_SCHED_AUTOGROUP=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
-# CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
 CONFIG_ARCH_AXXIA=y
-CONFIG_GPIO_PCA953X=y
 CONFIG_ARM_LPAE=y
 CONFIG_ARM_THUMBEE=y
 CONFIG_ARM_ERRATA_430973=y
@@ -37,26 +34,24 @@ CONFIG_ARM_ERRATA_754327=y
 CONFIG_ARM_ERRATA_764369=y
 CONFIG_ARM_ERRATA_775420=y
 CONFIG_ARM_ERRATA_798181=y
-CONFIG_PCI=y
-CONFIG_PCI_MSI=y
 CONFIG_PCIE_AXXIA=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=16
 CONFIG_HOTPLUG_CPU=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_OABI_COMPAT=y
 CONFIG_HIGHMEM=y
-CONFIG_KSM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_VFP=y
 CONFIG_NEON=y
+# CONFIG_SUSPEND is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=y
-# CONFIG_SUSPEND is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_KSM=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -76,6 +71,8 @@ CONFIG_INET_IPCOMP=y
 CONFIG_NETWORK_PHY_TIMESTAMPING=y
 CONFIG_BRIDGE=y
 # CONFIG_WIRELESS is not set
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
@@ -142,9 +139,10 @@ CONFIG_DP83640_PHY=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_PL061=y
-CONFIG_POWER_SUPPLY=y
+CONFIG_GPIO_PCA953X=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_AXXIA=y
+CONFIG_POWER_SUPPLY=y
 CONFIG_SENSORS_ADT7475=y
 CONFIG_SENSORS_JC42=y
 CONFIG_SENSORS_LM75=y
@@ -224,8 +222,9 @@ CONFIG_NFS_FSCACHE=y
 CONFIG_SUNRPC_DEBUG=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_CRYPTO_XCBC=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_SCHED_DEBUG is not set
@@ -233,6 +232,5 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=60
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
 CONFIG_CRYPTO_GCM=y
-CONFIG_CRYPTO_XCBC=y
 CONFIG_CRYPTO_SHA256=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
index d9119da65f4890faf32ae51a5a9010c3af685ddd..506f3378da07f53f7516cea86c95251480facf4f 100644 (file)
@@ -1,26 +1,21 @@
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
-CONFIG_MODULES=y
-CONFIG_MODVERSIONS=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_BADGE4=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="init=/linuxrc root=/dev/mtdblock3"
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=m
+CONFIG_MODULES=y
+CONFIG_MODVERSIONS=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=m
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=y
-CONFIG_IRLAN=y
-CONFIG_IRCOMM=y
-CONFIG_IRDA_ULTRA=y
-CONFIG_SA1100_FIR=y
 CONFIG_BT=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIVHCI=m
@@ -101,10 +96,9 @@ CONFIG_MINIX_FS=m
 CONFIG_NFS_FS=m
 CONFIG_NFS_V3=y
 CONFIG_SMB_FS=m
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index a9ed79b7f8716cfee6f1bc453d6e8ddc10d820ba..c4d2e2334b6e621a7da186900f8223fce428d035 100644 (file)
@@ -2,6 +2,7 @@
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_LOG_BUF_SHIFT=18
@@ -19,19 +20,12 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
-# CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_JUMP_LABEL=y
 CONFIG_CC_STACKPROTECTOR_REGULAR=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_BCM=y
 CONFIG_ARCH_BCM2835=y
-CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_AEABI=y
-CONFIG_KSM=y
-CONFIG_CMA=y
 CONFIG_SECCOMP=y
 CONFIG_KEXEC=y
 CONFIG_CRASH_DUMP=y
@@ -44,9 +38,15 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_CPUFREQ_DT=y
 CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
 CONFIG_VFP=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 # CONFIG_SUSPEND is not set
 CONFIG_PM=y
+CONFIG_JUMP_LABEL=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_KSM=y
+CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -63,8 +63,7 @@ CONFIG_MAC80211=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_STANDALONE is not set
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=32
+CONFIG_RASPBERRYPI_FIRMWARE=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_SCSI_CONSTANTS=y
@@ -106,6 +105,7 @@ CONFIG_REGULATOR_GPIO=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_CAMERA_SUPPORT=y
 CONFIG_DRM=y
+CONFIG_DRM_V3D=y
 CONFIG_DRM_VC4=y
 CONFIG_FB_SIMPLE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
@@ -151,7 +151,6 @@ CONFIG_BCM2835_MBOX=y
 CONFIG_RASPBERRYPI_POWER=y
 CONFIG_PWM=y
 CONFIG_PWM_BCM2835=y
-CONFIG_RASPBERRYPI_FIRMWARE=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
@@ -170,20 +169,22 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+# CONFIG_XZ_DEC_ARM is not set
+# CONFIG_XZ_DEC_ARMTHUMB is not set
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=32
 CONFIG_PRINTK_TIME=y
 CONFIG_BOOT_PRINTK_DELAY=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_LOCKUP_DETECTOR=y
-CONFIG_SCHED_TRACER=y
-CONFIG_STACK_TRACER=y
-CONFIG_FUNCTION_PROFILER=y
-CONFIG_TEST_KSTRTOX=y
 CONFIG_DEBUG_FS=y
 CONFIG_KGDB=y
 CONFIG_KGDB_KDB=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_FUNCTION_PROFILER=y
+CONFIG_STACK_TRACER=y
+CONFIG_SCHED_TRACER=y
 CONFIG_STRICT_DEVMEM=y
-# CONFIG_XZ_DEC_ARM is not set
-# CONFIG_XZ_DEC_ARMTHUMB is not set
+CONFIG_TEST_KSTRTOX=y
index 3f910bbf1bfdfa14ce8a0cd21de4eea5dba20729..7e6f7dfa3023126b8ddd135df8d4a227fa96cfc3 100644 (file)
@@ -1,23 +1,19 @@
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_CERF=y
 CONFIG_SA1100_CERF_FLASH_16MB=y
-CONFIG_PCCARD=m
-CONFIG_PCMCIA_SA1100=m
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttySA0,38400 root=/dev/mtdblock3 rootfstype=jffs2 rw mem=32M init=/linuxrc"
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=m
 CONFIG_FPE_FASTFPE=y
 CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -27,9 +23,11 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_IP_PNP_RARP=y
 # CONFIG_IPV6 is not set
+CONFIG_PCCARD=m
+CONFIG_PCMCIA_SA1100=m
 CONFIG_MTD=y
-CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
@@ -47,6 +45,10 @@ CONFIG_SERIAL_SA1100_CONSOLE=y
 CONFIG_WATCHDOG=y
 CONFIG_SA1100_WATCHDOG=m
 # CONFIG_VGA_CONSOLE is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=m
 CONFIG_EXT3_FS=m
 CONFIG_MSDOS_FS=m
@@ -60,11 +62,10 @@ CONFIG_NFS_V4=y
 CONFIG_NFSD=m
 CONFIG_NFSD_V4=y
 CONFIG_SMB_FS=m
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_ISO8859_1=m
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 63a153f5cf683efe1b80e38d904284585a1b67ac..92481b2a88fa24734b4da0528212526fa3a865a8 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_LZMA=y
 CONFIG_EMBEDDED=y
-CONFIG_SLOB=y
 CONFIG_JUMP_LABEL=y
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_ARCH_CLPS711X=y
@@ -14,16 +13,13 @@ CONFIG_ARCH_CLEP7312=y
 CONFIG_ARCH_EDB7211=y
 CONFIG_ARCH_P720T=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 # CONFIG_COREDUMP is not set
+CONFIG_SLOB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=y
-CONFIG_IRTTY_SIR=y
 # CONFIG_WIRELESS is not set
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
index bb0fcd82d2a7a1ad0c39efacd58bbae53f009066..31f41159bef2ed1f4bd88a4a4c5510b326c68b27 100644 (file)
@@ -1,29 +1,27 @@
 CONFIG_LOCALVERSION="-cm-x300"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
-CONFIG_GPIO_PCA953X=y
 CONFIG_MACH_CM_X300=y
-CONFIG_NO_HZ=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=/dev/mtdblock5 rootfstype=ubifs console=ttyS2,38400"
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_FPE_NWFPE=y
 CONFIG_APM_EMULATION=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -55,6 +53,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
 CONFIG_DM9000=y
@@ -80,6 +79,7 @@ CONFIG_I2C_PXA=y
 CONFIG_SPI=y
 CONFIG_SPI_GPIO=y
 CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_PCA953X=y
 # CONFIG_HWMON is not set
 CONFIG_PMIC_DA903X=y
 CONFIG_REGULATOR=y
@@ -91,8 +91,6 @@ CONFIG_LCD_TDO24M=y
 CONFIG_BACKLIGHT_DA903X=m
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_FONTS=y
-CONFIG_FONT_6x11=y
 CONFIG_LOGO=y
 CONFIG_SOUND=m
 CONFIG_SND=m
@@ -147,18 +145,19 @@ CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_CIFS=m
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_ISO8859_1=m
-CONFIG_DEBUG_FS=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_T10DIF=y
+CONFIG_FONTS=y
+CONFIG_FONT_6x11=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_FS=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
 CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_AES=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-CONFIG_CRC_T10DIF=y
index 63fa2eb21b7535f90c3a8598e62baa5aa9524097..b3aab97c0728f6f9091d6b04ec62688b083c261f 100644 (file)
@@ -1,5 +1,4 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
@@ -9,23 +8,22 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 # CONFIG_PERF_EVENTS is not set
-CONFIG_SLAB=y
 CONFIG_PROFILING=y
+CONFIG_ARCH_MULTI_V6=y
+CONFIG_ARCH_CNS3XXX=y
+CONFIG_MACH_CNS3420VB=y
+CONFIG_UNUSED_BOARD_FILES=y
+CONFIG_CMDLINE="console=ttyS0,38400 mem=128M root=/dev/mmcblk0p1 ro rootwait"
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_IOSCHED_BFQ=m
-CONFIG_ARCH_MULTI_V6=y
 #CONFIG_ARCH_MULTI_V7 is not set
-CONFIG_ARCH_CNS3XXX=y
-CONFIG_MACH_CNS3420VB=y
 CONFIG_DEBUG_CNS3XXX=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="console=ttyS0,38400 mem=128M root=/dev/mmcblk0p1 ro rootwait"
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -36,6 +34,7 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=20000
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 # CONFIG_SATA_PMP is not set
 # CONFIG_ATA_SFF is not set
@@ -43,9 +42,9 @@ CONFIG_ATA=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+CONFIG_LEGACY_PTY_COUNT=16
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
-CONFIG_LEGACY_PTY_COUNT=16
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 # CONFIG_VGA_CONSOLE is not set
@@ -59,6 +58,6 @@ CONFIG_AUTOFS4_FS=y
 CONFIG_FSCACHE=y
 CONFIG_TMPFS=y
 # CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_FS=y
 # CONFIG_ARM_UNWIND is not set
 CONFIG_CRC_CCITT=y
+CONFIG_DEBUG_FS=y
index b29898fd6a12adc210cb4a3564ecf9acfe448d0c..8357d721c69c85803d471a91e903b2b1495d8d79 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_IKCONFIG=y
@@ -9,20 +10,20 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_SLAB=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_PXA=y
+CONFIG_MACH_COLIBRI=y
+CONFIG_AEABI=y
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 # CONFIG_BLK_DEV_BSG is not set
-# CONFIG_ARCH_MULTI_V7 is not set
-CONFIG_ARCH_PXA=y
-CONFIG_MACH_COLIBRI=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -35,13 +36,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
 CONFIG_VLAN_8021Q=m
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_ULTRA=y
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-CONFIG_IRTTY_SIR=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
@@ -64,22 +58,22 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PXA2XX=y
 CONFIG_MTD_BLOCK2MTD=y
+CONFIG_MTD_ONENAND=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_DISKONCHIP=y
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED=y
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0x4000000
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_HIGH=y
 CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE=y
-CONFIG_MTD_ONENAND=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=8
 CONFIG_NETDEVICES=y
-CONFIG_PHYLIB=y
 CONFIG_NET_ETHERNET=y
 CONFIG_DM9000=y
+CONFIG_PHYLIB=y
 CONFIG_HOSTAP=y
 CONFIG_HOSTAP_FIRMWARE=y
 CONFIG_HOSTAP_FIRMWARE_NVRAM=y
@@ -107,9 +101,6 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
 # CONFIG_USB_HID is not set
 CONFIG_USB=y
@@ -143,13 +134,8 @@ CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_KEYS=y
 CONFIG_SECURITY=y
 CONFIG_CRYPTO_PCBC=m
@@ -161,3 +147,11 @@ CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRC_CCITT=y
 CONFIG_CRC16=y
 CONFIG_LIBCRC32C=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_PRINTK_TIME=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_LL=y
index f9d110294644f0b41b3f63dc3aa83fe3b79e469f..42adfefdb6dceaee5840a62f27f846c248696740 100644 (file)
@@ -1,13 +1,13 @@
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_COLIBRI300=y
 CONFIG_AEABI=y
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttyS0,115200 rw"
 CONFIG_CPU_IDLE=y
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
@@ -18,6 +18,7 @@ CONFIG_IPV6=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
 CONFIG_AX88796=y
@@ -48,12 +49,12 @@ CONFIG_EXT3_FS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_AES=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
-CONFIG_CRYPTO_ECB=y
-CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_ARC4=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
index 36384fd575f8ed8b7a71cd49e0d4e0ddbb1ef03a..d35cc59ce8477e031af93336ae648b50e8e2ec84 100644 (file)
@@ -1,4 +1,3 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
@@ -6,22 +5,21 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_BASE_FULL is not set
 # CONFIG_EPOLL is not set
-CONFIG_SLOB=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_COLLIE=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_PCMCIA_DEBUG=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="noinitrd root=/dev/mtdblock2 rootfstype=jffs2 fbcon=rotate:1"
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
+# CONFIG_SWAP is not set
+CONFIG_SLOB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
+CONFIG_PCMCIA_DEBUG=y
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
@@ -48,12 +46,12 @@ CONFIG_KEYBOARD_LOCOMO=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 # CONFIG_SERIO_SERPORT is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CS=y
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_SA1100=y
 CONFIG_SERIAL_SA1100_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HWMON is not set
 CONFIG_MCP_SA11X0=y
 CONFIG_MCP_UCB1200=y
@@ -64,8 +62,6 @@ CONFIG_FB_SA1100=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_FONTS=y
-CONFIG_FONT_MINI_4x6=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_LOCOMO=y
@@ -80,9 +76,11 @@ CONFIG_ROMFS_FS=y
 CONFIG_NLS_DEFAULT="cp437"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_CRC_CCITT=y
+CONFIG_FONTS=y
+CONFIG_FONT_MINI_4x6=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_DETECT_SOFTLOCKUP is not set
 CONFIG_DEBUG_MUTEXES=y
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_CRC_CCITT=y
index 96c677c98bc714cfe7a19821f1260faad8d499e1..1f137f74050f242bca062ccbf474b1b421efeb6a 100644 (file)
@@ -1,14 +1,11 @@
 CONFIG_SYSVIPC=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_PROFILING=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_PXA_SHARPSL=y
@@ -16,14 +13,14 @@ CONFIG_MACH_POODLE=y
 CONFIG_MACH_CORGI=y
 CONFIG_MACH_SHEPHERD=y
 CONFIG_MACH_HUSKY=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_PXA2XX=y
-CONFIG_PREEMPT=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2   debug"
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=m
 CONFIG_PM=y
 CONFIG_NET=y
@@ -58,11 +55,6 @@ CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_RAW=m
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_PXA_FICP=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
@@ -81,6 +73,8 @@ CONFIG_BT_HCIBT3C=m
 CONFIG_BT_HCIBLUECARD=m
 CONFIG_BT_HCIBTUART=m
 CONFIG_BT_HCIVHCI=m
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -95,10 +89,15 @@ CONFIG_CHR_DEV_OSST=m
 CONFIG_BLK_DEV_SR=m
 CONFIG_CHR_DEV_SG=m
 CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_PATA_PCMCIA=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_ASYNC=m
 CONFIG_USB_CATC=m
 CONFIG_USB_KAWETH=m
 CONFIG_USB_PEGASUS=m
@@ -106,10 +105,6 @@ CONFIG_USB_RTL8150=m
 CONFIG_USB_USBNET=m
 # CONFIG_USB_NET_CDC_SUBSET is not set
 CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_BSDCOMP=m
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 CONFIG_INPUT_EVDEV=y
@@ -120,11 +115,11 @@ CONFIG_TOUCHSCREEN_ADS7846=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=m
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=m
 CONFIG_SERIAL_8250_CS=m
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 CONFIG_I2C=y
 CONFIG_I2C_PXA=y
 CONFIG_SPI=y
@@ -136,13 +131,8 @@ CONFIG_LCD_CORGI=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_SOUND=y
 CONFIG_SOUND_PRIME=y
-CONFIG_USB_KBD=m
-CONFIG_USB_MOUSE=m
 CONFIG_HID_A4TECH=m
 CONFIG_HID_APPLE=m
 CONFIG_HID_BELKIN=m
@@ -159,6 +149,8 @@ CONFIG_HID_PETALYNX=m
 CONFIG_HID_SAMSUNG=m
 CONFIG_HID_SONY=m
 CONFIG_HID_SUNPLUS=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
 CONFIG_USB=m
 CONFIG_USB_MON=m
 CONFIG_USB_SL811_HCD=m
@@ -220,16 +212,12 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V4=y
 CONFIG_SMB_FS=m
 CONFIG_SMB_NLS_DEFAULT=y
-CONFIG_PARTITION_ADVANCED=y
+CONFIG_NFS_V4=m
 CONFIG_NLS_DEFAULT="cp437"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_DEBUG_PREEMPT is not set
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_LL=y
 CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_ECB=m
@@ -252,3 +240,9 @@ CONFIG_CRYPTO_TWOFISH=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRC_CCITT=y
 CONFIG_LIBCRC32C=m
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_FTRACE is not set
index b58d45a03607e01993b71467b26b202bd00716fc..fc71a03a9c8c6ddcfaa1710ae779e5e7c03ce1e0 100644 (file)
@@ -1,8 +1,8 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
@@ -10,34 +10,16 @@ CONFIG_CGROUPS=y
 CONFIG_CHECKPOINT_RESTORE=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_ARCH_MULTIPLATFORM=y
-CONFIG_ARCH_MULTI_V7=n
 CONFIG_ARCH_MULTI_V5=y
+# CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_DAVINCI=y
-CONFIG_ARCH_DAVINCI_DM644x=y
-CONFIG_ARCH_DAVINCI_DM355=y
-CONFIG_ARCH_DAVINCI_DM646x=y
 CONFIG_ARCH_DAVINCI_DA830=y
 CONFIG_ARCH_DAVINCI_DA850=y
-CONFIG_ARCH_DAVINCI_DM365=y
-CONFIG_MACH_SFFSDR=y
-CONFIG_MACH_NEUROS_OSD2=y
-CONFIG_MACH_DM355_LEOPARD=y
-CONFIG_MACH_MITYOMAPL138=y
-CONFIG_MACH_OMAPL138_HAWKBOARD=y
 CONFIG_DAVINCI_MUX_DEBUG=y
 CONFIG_DAVINCI_MUX_WARNINGS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_CMA=y
 CONFIG_SECCOMP=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_AUTO_ZRELADDR=y
@@ -48,6 +30,13 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=m
 CONFIG_CPU_FREQ_GOV_ONDEMAND=m
 CONFIG_CPUFREQ_DT=m
 CONFIG_CPU_IDLE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_SWAP is not set
+CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -65,7 +54,6 @@ CONFIG_BT_HCIUART_LL=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_FW_LOADER=m
-CONFIG_DMA_CMA=y
 CONFIG_DA8XX_MSTPRI=y
 CONFIG_MTD=m
 CONFIG_MTD_TESTS=m
@@ -95,8 +83,8 @@ CONFIG_NETCONSOLE=y
 CONFIG_TUN=m
 CONFIG_DM9000=y
 CONFIG_TI_DAVINCI_EMAC=y
-CONFIG_LSI_ET1011C_PHY=y
 CONFIG_LXT_PHY=y
+CONFIG_LSI_ET1011C_PHY=y
 CONFIG_SMSC_PHY=y
 CONFIG_PPP=m
 CONFIG_PPP_DEFLATE=m
@@ -113,7 +101,6 @@ CONFIG_KEYBOARD_XTKBD=m
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_PWM_BEEPER=m
-CONFIG_INPUT_DM355EVM=m
 CONFIG_SERIO_LIBPS2=y
 # CONFIG_VT_CONSOLE is not set
 CONFIG_SERIAL_8250=y
@@ -141,7 +128,6 @@ CONFIG_SYSCON_REBOOT_MODE=m
 CONFIG_BATTERY_LEGO_EV3=m
 CONFIG_WATCHDOG=y
 CONFIG_DAVINCI_WATCHDOG=y
-CONFIG_MFD_DM355EVM_MSP=y
 CONFIG_TPS6507X=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -262,10 +248,11 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_T10DIF=m
+CONFIG_DMA_CMA=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_RT_MUTEXES=y
 CONFIG_DEBUG_MUTEXES=y
 # CONFIG_ARM_UNWIND is not set
 CONFIG_DEBUG_USER=y
-# CONFIG_CRYPTO_HW is not set
-CONFIG_CRC_T10DIF=m
index f8fb4758f80d402a630d4c89fb927ba6a9d48cd8..16ed5c110e8d105f2ed7fbbe200121395c610f31 100644 (file)
@@ -3,27 +3,21 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_PARTITION_ADVANCED=y
 # CONFIG_ARCH_MULTI_V6 is not set
 CONFIG_ARCH_MULTI_V7=y
 CONFIG_ARCH_DOVE=y
 CONFIG_MACH_DOVE_DB=y
 CONFIG_MACH_CM_A510=y
 CONFIG_MACH_DOVE_DT=y
-CONFIG_PCI=y
-CONFIG_PCI_MSI=y
-CONFIG_PCI_MVEBU=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_VFP=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -33,6 +27,9 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_MVEBU=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
@@ -53,6 +50,7 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_COUNT=1
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_ATA=y
 CONFIG_SATA_MV=y
@@ -117,14 +115,8 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
 CONFIG_NLS_UTF8=y
-CONFIG_PRINTK_TIME=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_FS=y
-# CONFIG_SCHED_DEBUG is not set
 CONFIG_TIMER_STATS=y
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_CRYPTO_NULL=y
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_PCBC=m
@@ -142,3 +134,9 @@ CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_CRC_CCITT=y
 CONFIG_LIBCRC32C=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_DEBUG_USER=y
index fef802b7af8c6078c2e6438a18f2add451acd0c4..3154125321c5cddef1530dfa9e857135d4354114 100644 (file)
@@ -5,16 +5,9 @@ CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_ARCH_MULTI_V4T=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_EP93XX=y
-CONFIG_MACH_ADSSPHERE=y
 CONFIG_MACH_EDB9301=y
 CONFIG_MACH_EDB9302=y
 CONFIG_MACH_EDB9302A=y
@@ -23,19 +16,15 @@ CONFIG_MACH_EDB9307A=y
 CONFIG_MACH_EDB9312=y
 CONFIG_MACH_EDB9315=y
 CONFIG_MACH_EDB9315A=y
-CONFIG_MACH_GESBC9312=y
-CONFIG_MACH_MICRO9H=y
-CONFIG_MACH_MICRO9M=y
-CONFIG_MACH_MICRO9L=y
-CONFIG_MACH_MICRO9S=y
-CONFIG_MACH_SIM_ONE=y
-CONFIG_MACH_SNAPPER_CL15=y
 CONFIG_MACH_TS72XX=y
 CONFIG_MACH_VISION_EP9307=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/nfs ip=bootp"
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -52,8 +41,8 @@ CONFIG_IPV6=y
 # CONFIG_IPV6_SIT is not set
 # CONFIG_FW_LOADER is not set
 CONFIG_MTD=y
-CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -68,6 +57,7 @@ CONFIG_EEPROM_LEGACY=y
 CONFIG_SCSI=y
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NETDEVICES=y
 CONFIG_EP93XX_ETH=y
 CONFIG_USB_RTL8150=y
@@ -124,6 +114,7 @@ CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_LIBCRC32C=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_SLAB=y
 CONFIG_DEBUG_SPINLOCK=y
@@ -131,4 +122,3 @@ CONFIG_DEBUG_MUTEXES=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_LIBCRC32C=y
index 2146adc1825eead0c8c25873c8ae29967914b4eb..b4c2e6457e043418fa28f4ae80c4d0ee9af958bb 100644 (file)
@@ -3,42 +3,33 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_ARCH_PXA_ESERIES=y
-# CONFIG_ARM_THUMB is not set
 CONFIG_IWMMXT=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA=m
-CONFIG_PCMCIA_PXA2XX=m
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_KEXEC=y
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=y
 CONFIG_PM=y
+CONFIG_SLAB=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=y
-CONFIG_IRLAN=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_ULTRA=y
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-CONFIG_PXA_FICP=y
 CONFIG_CFG80211=m
 CONFIG_MAC80211=m
 CONFIG_MAC80211_RC_PID=y
 # CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_PCCARD=y
+CONFIG_PCMCIA=m
+CONFIG_PCMCIA_PXA2XX=m
 # CONFIG_STANDALONE is not set
 CONFIG_MTD=m
 CONFIG_MTD_RAW_NAND=m
@@ -46,6 +37,7 @@ CONFIG_MTD_NAND_TMIO=m
 CONFIG_BLK_DEV_LOOP=m
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=m
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_ATA=m
 # CONFIG_SATA_PMP is not set
@@ -62,8 +54,8 @@ CONFIG_KEYBOARD_GPIO=m
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_WM97XX=m
 # CONFIG_SERIO is not set
-CONFIG_SERIAL_PXA=y
 # CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_PXA=y
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 CONFIG_MFD_T7L66XB=y
@@ -76,8 +68,6 @@ CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_MINI_4x6=y
 CONFIG_SOUND=y
 CONFIG_SND=m
 CONFIG_SND_MIXER_OSS=m
@@ -97,10 +87,11 @@ CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 # CONFIG_ENABLE_MUST_CHECK is not set
 CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_FONTS=y
+CONFIG_FONT_MINI_4x6=y
index aa061074db7874b67d42507e0098b237daa9e9b3..1ce74f46e114f1d55b15bd769f636bf87b27f197 100644 (file)
@@ -13,12 +13,9 @@ CONFIG_BIG_LITTLE=y
 CONFIG_NR_CPUS=8
 CONFIG_HIGHMEM=y
 CONFIG_SECCOMP=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc mem=256M"
-CONFIG_ENERGY_MODEL=y
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
@@ -34,6 +31,7 @@ CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
 CONFIG_PM_DEBUG=y
 CONFIG_PM_ADVANCED_DEBUG=y
+CONFIG_ENERGY_MODEL=y
 CONFIG_ARM_CRYPTO=y
 CONFIG_CRYPTO_SHA1_ARM_NEON=m
 CONFIG_CRYPTO_SHA256_ARM=m
@@ -170,8 +168,6 @@ CONFIG_THERMAL_EMULATION=y
 CONFIG_WATCHDOG=y
 CONFIG_S3C2410_WATCHDOG=y
 CONFIG_MFD_CROS_EC_DEV=y
-CONFIG_CHROME_PLATFORMS=y
-CONFIG_CROS_EC=y
 CONFIG_MFD_MAX14577=y
 CONFIG_MFD_MAX77686=y
 CONFIG_MFD_MAX77693=y
@@ -207,19 +203,19 @@ CONFIG_MEDIA_PLATFORM_SUPPORT=y
 CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
 CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m
 CONFIG_VIDEO_S5P_FIMC=m
 CONFIG_VIDEO_S5P_MIPI_CSIS=m
 CONFIG_VIDEO_EXYNOS_FIMC_LITE=m
 CONFIG_VIDEO_EXYNOS4_FIMC_IS=m
-CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
 CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
-CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
 CONFIG_V4L_TEST_DRIVERS=y
 CONFIG_VIDEO_VIVID=m
-CONFIG_VIDEO_S5K6A3=m
 CONFIG_VIDEO_S5C73M3=m
+CONFIG_VIDEO_S5K6A3=m
 CONFIG_DRM=y
 CONFIG_DRM_EXYNOS=y
 CONFIG_DRM_EXYNOS_FIMD=y
@@ -295,11 +291,11 @@ CONFIG_MMC_DW_EXYNOS=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_CLASS_FLASH=y
-CONFIG_LEDS_AAT1290=y
 CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_PWM=y
-CONFIG_LEDS_MAX77693=y
 CONFIG_LEDS_MAX8997=y
+CONFIG_LEDS_AAT1290=y
+CONFIG_LEDS_MAX77693=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_MAX8998=y
@@ -309,6 +305,8 @@ CONFIG_RTC_DRV_S5M=y
 CONFIG_RTC_DRV_S3C=y
 CONFIG_DMADEVICES=y
 CONFIG_PL330_DMA=y
+CONFIG_CHROME_PLATFORMS=y
+CONFIG_CROS_EC=y
 CONFIG_CROS_EC_I2C=y
 CONFIG_CROS_EC_SPI=y
 CONFIG_COMMON_CLK_MAX77686=y
@@ -319,12 +317,12 @@ CONFIG_DEVFREQ_GOV_PERFORMANCE=y
 CONFIG_DEVFREQ_GOV_POWERSAVE=y
 CONFIG_DEVFREQ_GOV_USERSPACE=y
 CONFIG_ARM_EXYNOS_BUS_DEVFREQ=y
-CONFIG_EXYNOS5422_DMC=y
 CONFIG_DEVFREQ_EVENT_EXYNOS_NOCP=y
 CONFIG_EXTCON=y
 CONFIG_EXTCON_MAX14577=y
 CONFIG_EXTCON_MAX77693=y
 CONFIG_EXTCON_MAX8997=y
+CONFIG_EXYNOS5422_DMC=y
 CONFIG_IIO=y
 CONFIG_EXYNOS_ADC=y
 CONFIG_STMPE_ADC=y
@@ -376,10 +374,10 @@ CONFIG_FONTS=y
 CONFIG_FONT_7x14=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_SOFTLOCKUP_DETECTOR=y
 # CONFIG_DETECT_HUNG_TASK is not set
 CONFIG_PROVE_LOCKING=y
index 5d000c8be44e88fcccac634f9d1bec968c24d8b5..1a41391d7367e3268cc4dc2d873ab7b66df522c8 100644 (file)
@@ -1,28 +1,21 @@
 CONFIG_LOCALVERSION="-ezx200910312315"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_BZIP2=y
 CONFIG_RD_LZMA=y
 CONFIG_EXPERT=y
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_PXA_EZX=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=tty1 root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=3 ip=192.168.0.202:192.168.0.200:192.168.0.200:255.255.255.0 debug"
 CONFIG_KEXEC=y
 CONFIG_CPU_FREQ=y
@@ -33,9 +26,15 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_CPU_IDLE=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=m
-CONFIG_BINFMT_MISC=m
 CONFIG_PM=y
 CONFIG_APM_EMULATION=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -72,6 +71,7 @@ CONFIG_NF_CONNTRACK_SANE=m
 CONFIG_NF_CONNTRACK_SIP=m
 CONFIG_NF_CONNTRACK_TFTP=m
 CONFIG_NF_CT_NETLINK=m
+CONFIG_NF_NAT=m
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
 CONFIG_NETFILTER_XT_TARGET_LED=m
 CONFIG_NETFILTER_XT_TARGET_MARK=m
@@ -113,7 +113,6 @@ CONFIG_IP_NF_MATCH_TTL=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
 CONFIG_IP_NF_TARGET_LOG=m
-CONFIG_NF_NAT=m
 CONFIG_IP_NF_TARGET_MASQUERADE=m
 CONFIG_IP_NF_TARGET_NETMAP=m
 CONFIG_IP_NF_TARGET_REDIRECT=m
@@ -179,15 +178,15 @@ CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_NETDEVICES=y
 CONFIG_DUMMY=y
-# CONFIG_WLAN is not set
 CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_FILTER=y
+CONFIG_PPP_MULTILINK=y
 CONFIG_PPP_ASYNC=m
 CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
 # CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_WLAN is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_GPIO=y
@@ -199,9 +198,9 @@ CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=y
 CONFIG_INPUT_PCAP=y
 # CONFIG_SERIO is not set
+CONFIG_LEGACY_PTY_COUNT=8
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-CONFIG_LEGACY_PTY_COUNT=8
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
@@ -218,27 +217,27 @@ CONFIG_REGULATOR_PCAP=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_VIDEO_DEV=y
 CONFIG_MEDIA_TUNER_CUSTOMISE=y
+CONFIG_RADIO_TEA5764=y
+# CONFIG_MEDIA_TUNER_MC44S803 is not set
+# CONFIG_MEDIA_TUNER_MT2060 is not set
+# CONFIG_MEDIA_TUNER_MT20XX is not set
+# CONFIG_MEDIA_TUNER_MT2131 is not set
+# CONFIG_MEDIA_TUNER_MT2266 is not set
+# CONFIG_MEDIA_TUNER_MXL5005S is not set
+# CONFIG_MEDIA_TUNER_MXL5007T is not set
+# CONFIG_MEDIA_TUNER_QT1010 is not set
 # CONFIG_MEDIA_TUNER_SIMPLE is not set
-# CONFIG_MEDIA_TUNER_TDA8290 is not set
-# CONFIG_MEDIA_TUNER_TDA827X is not set
 # CONFIG_MEDIA_TUNER_TDA18271 is not set
+# CONFIG_MEDIA_TUNER_TDA827X is not set
+# CONFIG_MEDIA_TUNER_TDA8290 is not set
 # CONFIG_MEDIA_TUNER_TDA9887 is not set
 # CONFIG_MEDIA_TUNER_TEA5761 is not set
 # CONFIG_MEDIA_TUNER_TEA5767 is not set
-# CONFIG_MEDIA_TUNER_MT20XX is not set
-# CONFIG_MEDIA_TUNER_MT2060 is not set
-# CONFIG_MEDIA_TUNER_MT2266 is not set
-# CONFIG_MEDIA_TUNER_MT2131 is not set
-# CONFIG_MEDIA_TUNER_QT1010 is not set
 # CONFIG_MEDIA_TUNER_XC2028 is not set
 # CONFIG_MEDIA_TUNER_XC5000 is not set
-# CONFIG_MEDIA_TUNER_MXL5005S is not set
-# CONFIG_MEDIA_TUNER_MXL5007T is not set
-# CONFIG_MEDIA_TUNER_MC44S803 is not set
 # CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
 CONFIG_VIDEO_PXA27x=y
 # CONFIG_V4L_USB_DRIVERS is not set
-CONFIG_RADIO_TEA5764=y
 CONFIG_FB=y
 CONFIG_FB_PXA=y
 CONFIG_FB_PXA_OVERLAY=y
@@ -248,8 +247,6 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_PWM=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_MINI_4x6=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_MIXER_OSS=y
@@ -260,8 +257,8 @@ CONFIG_SND_PCM_OSS=y
 # CONFIG_SND_USB is not set
 CONFIG_SND_SOC=y
 CONFIG_SND_PXA2XX_SOC=y
-# CONFIG_USB_HID is not set
 CONFIG_HID_APPLE=m
+# CONFIG_USB_HID is not set
 CONFIG_USB=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_GADGET=y
@@ -354,14 +351,8 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_SCHED_DEBUG is not set
 CONFIG_DEBUG_RT_MUTEXES=y
-CONFIG_PROVE_LOCKING=y
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_USER=y
 CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_CRYPTD=m
 CONFIG_CRYPTO_TEST=m
@@ -389,3 +380,11 @@ CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_FONTS=y
+CONFIG_FONT_MINI_4x6=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_FS=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_PROVE_LOCKING=y
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_USER=y
index 7a32de51f0faaafb621d8544ed4ff593a80b5866..504070812ad0ef03a8bbb44a9c194baad67170ee 100644 (file)
@@ -4,18 +4,16 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
-CONFIG_MODULES=y
 CONFIG_ARCH_FOOTBRIDGE=y
-CONFIG_ARCH_CATS=y
 CONFIG_ARCH_EBSA285_HOST=y
 CONFIG_ARCH_NETWINDER=y
-CONFIG_LEDS=y
-CONFIG_LEDS_TIMER=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_FPE_NWFPE=y
 CONFIG_FPE_NWFPE_XP=y
 CONFIG_BINFMT_AOUT=y
+CONFIG_MODULES=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_ACORN_PARTITION=y
+CONFIG_ACORN_PARTITION_ADFS=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -26,15 +24,6 @@ CONFIG_IP_PNP_BOOTP=y
 CONFIG_SYN_COOKIES=y
 # CONFIG_IPV6 is not set
 CONFIG_ATM=y
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_ULTRA=y
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-CONFIG_IRDA_DEBUG=y
-CONFIG_WINBOND_FIR=m
 CONFIG_PARPORT=y
 CONFIG_PARPORT_PC=y
 CONFIG_PARPORT_PC_FIFO=y
@@ -71,17 +60,17 @@ CONFIG_VORTEX=y
 CONFIG_NET_PCI=y
 CONFIG_NE2K_PCI=y
 CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPPOE=m
+CONFIG_PPP_ASYNC=m
 CONFIG_SLIP=m
 CONFIG_SLIP_COMPRESSED=y
 CONFIG_SLIP_SMART=y
 CONFIG_SLIP_MODE_SLIP6=y
-CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_21285=y
 CONFIG_SERIAL_21285_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_PRINTER=m
 CONFIG_DS1620=y
 CONFIG_NWBUTTON=y
@@ -99,6 +88,10 @@ CONFIG_SOUND=m
 CONFIG_USB=m
 CONFIG_USB_MON=m
 CONFIG_USB_PRINTER=m
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_EXT2_FS=y
 CONFIG_AUTOFS4_FS=y
 CONFIG_ISO9660_FS=m
@@ -109,9 +102,6 @@ CONFIG_ADFS_FS=m
 CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=m
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_ACORN_PARTITION=y
-CONFIG_ACORN_PARTITION_ADFS=y
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_850=m
index c02b3e4096101a4096da59fbb575e428ac7db656..5bd1ec539610bc240b905177b83fc82b7383415d 100644 (file)
@@ -1,28 +1,21 @@
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_H3600=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_PREEMPT=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 # CONFIG_CPU_FREQ_STAT is not set
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
 # CONFIG_WIRELESS is not set
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
 CONFIG_MTD=y
 CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -36,6 +29,7 @@ CONFIG_BLK_DEV_LOOP=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_PATA_PCMCIA=y
 CONFIG_NETDEVICES=y
index a67d6020aee5c82aa6f471e438bf44f407c4fffc..d01f1a6bd04d9d95463f7c02425115990662e6cb 100644 (file)
@@ -5,22 +5,21 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_H5000=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="keepinitrd"
 CONFIG_KEXEC=y
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
 CONFIG_APM_EMULATION=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -43,9 +42,9 @@ CONFIG_MTD_PHYSMAP=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+CONFIG_LEGACY_PTY_COUNT=32
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-CONFIG_LEGACY_PTY_COUNT=32
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 # CONFIG_VGA_CONSOLE is not set
@@ -60,11 +59,7 @@ CONFIG_TMPFS=y
 CONFIG_JFFS2_FS=y
 CONFIG_JFFS2_COMPRESSION_OPTIONS=y
 # CONFIG_NETWORK_FILESYSTEMS is not set
-CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_FTRACE is not set
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_MD5=y
@@ -73,3 +68,7 @@ CONFIG_CRYPTO_DES=y
 CONFIG_CRYPTO_DEFLATE=y
 # CONFIG_CRYPTO_HW is not set
 CONFIG_CRC_CCITT=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_FTRACE is not set
index 742d18cdabde842e8151f7601b87a398e3818c80..b9327b2eacd3c41428703dff5b015843b871854c 100644 (file)
@@ -1,17 +1,14 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_HACKKIT=y
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttySA0,115200 root=/dev/ram0 initrd=0xc0400000,8M init=/rootshell"
 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -33,13 +30,17 @@ CONFIG_DUMMY=y
 CONFIG_SERIAL_SA1100=y
 CONFIG_SERIAL_SA1100_CONSOLE=y
 # CONFIG_VGA_CONSOLE is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
 CONFIG_CRAMFS=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_SPINLOCK=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 74d611e41e025f4a2ce3a7308efe7d880de3df1e..1db5356b1ccd91d774277b21608807a1a3cc8acc 100644 (file)
@@ -1,24 +1,25 @@
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_RD_LZMA=y
 CONFIG_ARCH_HISI=y
 CONFIG_ARCH_HI3xxx=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_CMDLINE_PARTITION=y
-CONFIG_ARCH_HIX5HD2=y
 CONFIG_ARCH_HIP01=y
 CONFIG_ARCH_HIP04=y
+CONFIG_ARCH_HIX5HD2=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=16
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
 CONFIG_PM=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_CMDLINE_PARTITION=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -39,20 +40,20 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=2
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
 CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_SPI=y
 CONFIG_SPI_PL022=y
 CONFIG_PINCTRL_SINGLE=y
-CONFIG_DEBUG_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIOLIB=y
-CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_REGULATOR_GPIO=y
+CONFIG_DEBUG_GPIO=y
 CONFIG_GPIO_DWAPB=y
 CONFIG_MFD_SYSCON=y
+CONFIG_GPIO_GENERIC_PLATFORM=y
 CONFIG_POWER_RESET_SYSCON=y
 CONFIG_DRM=y
 CONFIG_FB_SIMPLE=y
@@ -66,13 +67,13 @@ CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_STORAGE=y
 CONFIG_NOP_USB_XCEIV=y
 CONFIG_MMC=y
-CONFIG_RTC_CLASS=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_PLTFM=y
+CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_PL031=y
 CONFIG_DMADEVICES=y
-CONFIG_DW_DMAC=y
 CONFIG_PL330_DMA=y
+CONFIG_DW_DMAC=y
 CONFIG_PWM=y
 CONFIG_PHY_HIX5HD2_SATA=y
 CONFIG_EXT4_FS=y
@@ -81,11 +82,10 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_FS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_LOCKUP_DETECTOR=y
-CONFIG_VFP=y
 CONFIG_VFPv3=y
+CONFIG_DEBUG_FS=y
index 1d9fa77bbafc499cd6eca2ee223c2e13147c8392..bfa2a95638af8181b98f0120a75838c85b37d6e7 100644 (file)
@@ -1,4 +1,3 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_NO_HZ=y
@@ -8,8 +7,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
 CONFIG_PROFILING=y
 CONFIG_ARCH_MULTI_V4T=y
 CONFIG_ARCH_MULTI_V5=y
@@ -24,13 +21,13 @@ CONFIG_SOC_IMX1=y
 CONFIG_SOC_IMX25=y
 CONFIG_SOC_IMX27=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_PM_DEBUG=y
 CONFIG_KPROBES=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -63,6 +60,7 @@ CONFIG_MTD_UBI=y
 CONFIG_EEPROM_AT24=y
 CONFIG_EEPROM_AT25=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_PATA_IMX=y
 CONFIG_NETDEVICES=y
index 88a3602c4e58aeabbc10d75165d8e0e607da52bf..01012537a9b900076f506c3463ab8abe288eacf2 100644 (file)
@@ -13,8 +13,6 @@ CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_PERF_EVENTS=y
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_COMPAT_BRK is not set
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_MXC=y
 CONFIG_SOC_IMX31=y
@@ -58,6 +56,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
 CONFIG_BINFMT_MISC=m
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -258,14 +257,14 @@ CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MUX=y
 CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_MUX=y
 CONFIG_VIDEO_CODA=m
 CONFIG_VIDEO_IMX_PXP=y
-CONFIG_VIDEO_ADV7180=m
 CONFIG_VIDEO_OV2680=m
 CONFIG_VIDEO_OV5640=m
 CONFIG_VIDEO_OV5645=m
+CONFIG_VIDEO_ADV7180=m
 CONFIG_IMX_IPUV3_CORE=y
 CONFIG_DRM=y
 CONFIG_DRM_MSM=y
@@ -468,6 +467,7 @@ CONFIG_PRINTK_TIME=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
+# CONFIG_SLUB_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
 CONFIG_PROVE_LOCKING=y
 # CONFIG_FTRACE is not set
index 5b485722ccf9772854bc19de1284ac308d1f649b..9ca43c84b45218d62e671c7377b75214bdc3dc04 100644 (file)
@@ -81,5 +81,5 @@ CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
index ead14c3f23d811fdb9050d887d9ace77d6661241..c16e92cdfd008497022182606a7f100d14226368 100644 (file)
@@ -3,22 +3,20 @@ CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_IOP32X=y
 CONFIG_MACH_GLANTANK=y
 CONFIG_ARCH_IQ80321=y
 CONFIG_ARCH_IQ31244=y
 CONFIG_MACH_N2100=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp cachepolicy=writealloc"
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -45,6 +43,7 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_SATA_SIL=y
 CONFIG_SATA_VITESSE=y
@@ -95,12 +94,6 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_LL=y
-CONFIG_DEBUG_LL_UART_8250=y
 CONFIG_KEYS=y
 CONFIG_CRYPTO_NULL=y
 CONFIG_CRYPTO_LRW=y
@@ -127,3 +120,8 @@ CONFIG_CRYPTO_TEA=y
 CONFIG_CRYPTO_TWOFISH=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_LIBCRC32C=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_LL=y
+CONFIG_DEBUG_LL_UART_8250=y
index 960978a23d16c98e2f11a2054b099d95d2fa748b..6b65ac2a72e7f8bf65480bf77daf7352fe41abec 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_INITRAMFS_COMPRESSION_XZ=y
 CONFIG_EXPERT=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_IXP4XX=y
-# CONFIG_ARM_THUMB is not set
 CONFIG_CPU_BIG_ENDIAN=y
 CONFIG_AEABI=y
 CONFIG_CMDLINE="console=ttyS0,115200"
index 069f60ffdcd897ba93adf00011af437aad9ea664..3dcf89d3e1f1ee1bb919f8fa56820a417b2fd60b 100644 (file)
@@ -1,18 +1,14 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_MODULES=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_JORNADA720=y
 CONFIG_SA1100_JORNADA720_SSP=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
 CONFIG_PM=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -20,13 +16,12 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRCOMM=m
-CONFIG_SA1100_FIR=m
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_NBD=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_PATA_PCMCIA=y
 CONFIG_NETDEVICES=y
@@ -40,9 +35,9 @@ CONFIG_KEYBOARD_HP7XX=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_HP7XX=y
+CONFIG_LEGACY_PTY_COUNT=32
 CONFIG_SERIAL_SA1100=y
 CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_LEGACY_PTY_COUNT=32
 # CONFIG_HWMON is not set
 CONFIG_FB=y
 CONFIG_FB_S1D13XXX=y
index b1bcb858216b98cbecbd50a7812c798c77647ebe..68b89b90ca29a3e5f02aa936cfcf7f98c4563bd7 100644 (file)
@@ -1,43 +1,41 @@
-# CONFIG_SWAP is not set
 CONFIG_POSIX_MQUEUE=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CGROUPS=y
+CONFIG_BLK_CGROUP=y
+CONFIG_CGROUP_SCHED=y
 CONFIG_CGROUP_FREEZER=y
 CONFIG_CGROUP_DEVICE=y
 CONFIG_CGROUP_CPUACCT=y
-CONFIG_CGROUP_SCHED=y
-CONFIG_BLK_CGROUP=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_KALLSYMS_ALL=y
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
+CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
 CONFIG_PROFILING=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
 CONFIG_ARCH_KEYSTONE=y
 CONFIG_ARM_LPAE=y
-CONFIG_PCI=y
-CONFIG_PCI_MSI=y
 CONFIG_PCI_KEYSTONE=y
 CONFIG_SMP=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_ARM_PSCI=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
-CONFIG_CMA=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 # CONFIG_SUSPEND is not set
 CONFIG_PM=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_SWAP is not set
+CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -113,9 +111,11 @@ CONFIG_VLAN_8021Q=y
 CONFIG_CAN=m
 CONFIG_CAN_C_CAN=m
 CONFIG_CAN_C_CAN_PLATFORM=m
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
+CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -131,10 +131,15 @@ CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_NETDEVICES=y
+CONFIG_TI_CPTS=y
 CONFIG_TI_KEYSTONE_NETCP=y
 CONFIG_TI_KEYSTONE_NETCP_ETHSS=y
-CONFIG_TI_CPTS=y
 CONFIG_MARVELL_PHY=y
+CONFIG_MICREL_PHY=y
+CONFIG_DP83867_PHY=y
+CONFIG_INPUT_EVDEV=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_GPIO_DECODER=m
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
@@ -144,6 +149,7 @@ CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DAVINCI=y
 CONFIG_SPI=y
+CONFIG_SPI_CADENCE_QUADSPI=y
 CONFIG_SPI_DAVINCI=y
 CONFIG_SPI_SPIDEV=y
 CONFIG_PTP_1588_CLOCK=y
@@ -152,9 +158,10 @@ CONFIG_GPIOLIB=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_DAVINCI=y
 CONFIG_GPIO_SYSCON=y
-CONFIG_POWER_SUPPLY=y
+CONFIG_GPIO_PCA953X=m
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_KEYSTONE=y
+CONFIG_POWER_SUPPLY=y
 # CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
 CONFIG_DAVINCI_WATCHDOG=y
@@ -166,8 +173,8 @@ CONFIG_USB_MON=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_DWC3=y
-CONFIG_NOP_USB_XCEIV=y
 CONFIG_KEYSTONE_USB_PHY=y
+CONFIG_NOP_USB_XCEIV=y
 CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
@@ -180,6 +187,8 @@ CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_ONESHOT=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_CPU=y
+CONFIG_LEDS_TRIGGER_ACTIVITY=y
 CONFIG_LEDS_TRIGGER_GPIO=y
 CONFIG_DMADEVICES=y
 CONFIG_TI_EDMA=y
@@ -196,7 +205,6 @@ CONFIG_PWM_TIECAP=m
 CONFIG_KEYSTONE_IRQ=y
 CONFIG_RESET_TI_SCI=m
 CONFIG_RESET_TI_SYSCON=m
-CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_EXT4_FS=y
 CONFIG_EXT4_FS_POSIX_ACL=y
 CONFIG_FANOTIFY=y
@@ -216,10 +224,7 @@ CONFIG_NFSD=y
 CONFIG_NFSD_V3_ACL=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_SHIRQ=y
-CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_CRYPTO_USER=y
 CONFIG_CRYPTO_AUTHENC=y
 CONFIG_CRYPTO_CBC=y
@@ -229,12 +234,7 @@ CONFIG_CRYPTO_DES=y
 CONFIG_CRYPTO_ANSI_CPRNG=y
 CONFIG_CRYPTO_USER_API_HASH=y
 CONFIG_CRYPTO_USER_API_SKCIPHER=y
-CONFIG_SPI_CADENCE_QUADSPI=y
-CONFIG_INPUT_MISC=y
-CONFIG_INPUT_EVDEV=m
-CONFIG_INPUT_GPIO_DECODER=m
-CONFIG_GPIO_PCA953X=m
-CONFIG_LEDS_TRIGGER_ACTIVITY=y
-CONFIG_LEDS_TRIGGER_CPU=y
-CONFIG_MICREL_PHY=y
-CONFIG_DP83867_PHY=y
+CONFIG_DMA_CMA=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_DEBUG_USER=y
index 2dfa33d7dca391e4a249e3af02759a46185c7725..0c2f19d756c0e11f3c5649ee59354fffe85a9e28 100644 (file)
@@ -1,32 +1,22 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_LART=y
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttySA0,9600 root=/dev/ram"
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
 CONFIG_PM=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_PACKET=m
 CONFIG_UNIX=y
 CONFIG_INET=y
 CONFIG_SYN_COOKIES=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_DEBUG=y
-CONFIG_SA1100_FIR=m
 CONFIG_MTD=y
 CONFIG_MTD_DEBUG=y
 CONFIG_MTD_DEBUG_VERBOSE=1
@@ -37,15 +27,19 @@ CONFIG_NETDEVICES=y
 CONFIG_DUMMY=m
 CONFIG_NET_ETHERNET=y
 CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_ASYNC=m
 CONFIG_SLIP=m
 CONFIG_SLIP_COMPRESSED=y
 CONFIG_SERIAL_SA1100=y
 CONFIG_SERIAL_SA1100_CONSOLE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_SOUND=m
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=m
 CONFIG_REISERFS_FS=m
index 688c9849eec8d937ca2a696084b4b6b8633a9092..142c1700f450790535e465a5a62632d8307bdb0f 100644 (file)
@@ -15,8 +15,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EVENTFD is not set
 # CONFIG_AIO is not set
 CONFIG_EMBEDDED=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_SLUB_DEBUG is not set
 # CONFIG_MMU is not set
 CONFIG_ARCH_LPC18XX=y
 CONFIG_SET_MEM_PARAM=y
@@ -24,13 +22,11 @@ CONFIG_DRAM_BASE=0x28000000
 CONFIG_DRAM_SIZE=0x02000000
 CONFIG_FLASH_MEM_BASE=0x1b000000
 CONFIG_FLASH_SIZE=0x00080000
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_ZFLAT=y
 # CONFIG_COREDUMP is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -60,6 +56,7 @@ CONFIG_SRAM=y
 CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_ARC is not set
@@ -92,11 +89,11 @@ CONFIG_KEYBOARD_GPIO_POLLED=y
 # CONFIG_VT is not set
 # CONFIG_UNIX98_PTYS is not set
 # CONFIG_LEGACY_PTYS is not set
-CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_8250=y
 # CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C_LPC2K=y
 CONFIG_SPI=y
@@ -153,11 +150,12 @@ CONFIG_JFFS2_FS=y
 CONFIG_CRC_ITU_T=y
 CONFIG_CRC7=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_FS=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+# CONFIG_SLUB_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_DEBUG_LL=y
 CONFIG_EARLY_PRINTK=y
index 6c3e4a1419639d53a76599628790cc3bf10bef07..8a41fe4e62f1239eef9ec901d959a2a3c91bc330 100644 (file)
@@ -10,12 +10,9 @@ CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_EMBEDDED=y
-CONFIG_SLAB=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_LPC32XX=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE="console=ttyS0,115200n81 root=/dev/ram0"
@@ -24,9 +21,9 @@ CONFIG_VFP=y
 CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -60,6 +57,7 @@ CONFIG_EEPROM_AT24=y
 CONFIG_EEPROM_AT25=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NETDEVICES=y
 # CONFIG_NET_VENDOR_BROADCOM is not set
 # CONFIG_NET_VENDOR_CIRRUS is not set
@@ -93,11 +91,11 @@ CONFIG_SERIAL_HS_LPC32XX_CONSOLE=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_PNX=y
-CONFIG_GPIO_LPC32XX=y
 CONFIG_SPI=y
 CONFIG_SPI_PL022=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
+CONFIG_GPIO_LPC32XX=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCF857X=y
 CONFIG_SENSORS_DS620=y
@@ -187,10 +185,10 @@ CONFIG_CRYPTO_ANSI_CPRNG=y
 CONFIG_CRC_CCITT=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_GDB_SCRIPTS=y
-CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
 CONFIG_PANIC_ON_OOPS=y
 CONFIG_PANIC_TIMEOUT=5
 # CONFIG_SCHED_DEBUG is not set
index 5c0a671ed294d12519edf99f473c3d311396f3b9..b0c21a99a0a8af0d73e4e8c849b53ef847b49a7e 100644 (file)
@@ -1,15 +1,13 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_SLAB=y
-CONFIG_MODULES=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_LOGICPD_PXA270=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200 mem=64M"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
@@ -53,8 +51,8 @@ CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index cf49dc1629a761741fd8b9bf26cd5baecd4ba647..4fc744c96196223db183b8297c2cf509e30d4f64 100644 (file)
@@ -1,24 +1,20 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_MODULES=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_ARCH_LUBBOCK=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_PXA2XX=y
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200 mem=64M"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
 CONFIG_MTD=y
 CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -29,9 +25,9 @@ CONFIG_MTD_CFI_GEOMETRY=y
 CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
-CONFIG_SMC91X=y
 CONFIG_NET_PCMCIA=y
 CONFIG_PCMCIA_PCNET=y
+CONFIG_SMC91X=y
 CONFIG_INPUT_EVDEV=y
 # CONFIG_SERIO_SERPORT is not set
 CONFIG_SERIO_SA1111=y
@@ -40,14 +36,18 @@ CONFIG_SERIAL_PXA_CONSOLE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_USB_GADGET=y
 CONFIG_USB_G_SERIAL=m
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 13da808ffa133f068db9d00fa3cd445d8629246d..9cbb63c694361f1e1526a3473e1114d7d1b5a390 100644 (file)
@@ -1,29 +1,28 @@
 CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_PREEMPT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_H4700=y
 CONFIG_MACH_MAGICIAN=y
-CONFIG_NO_HZ=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="keepinitrd"
 CONFIG_KEXEC=y
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -35,15 +34,6 @@ CONFIG_IP_PNP=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_DIAG is not set
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_ULTRA=y
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-CONFIG_IRDA_DEBUG=y
-CONFIG_IRTTY_SIR=m
-CONFIG_PXA_FICP=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
@@ -60,11 +50,11 @@ CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_NETDEVICES=y
 CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_MPPE=m
 # CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_PPP_ASYNC=m
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_GPIO=y
@@ -73,19 +63,19 @@ CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=m
 # CONFIG_SERIO is not set
-CONFIG_SERIAL_PXA=y
 # CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_PXA=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=m
 CONFIG_I2C_PXA=y
 CONFIG_W1_MASTER_DS1WM=y
+CONFIG_HTC_EGPIO=y
 CONFIG_POWER_SUPPLY=y
 CONFIG_PDA_POWER=y
 CONFIG_BATTERY_DS2760=y
 # CONFIG_HWMON is not set
 CONFIG_MFD_ASIC3=y
-CONFIG_HTC_EGPIO=y
 CONFIG_HTC_PASIC3=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_GPIO=y
@@ -99,8 +89,6 @@ CONFIG_BACKLIGHT_PWM=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_FONTS=y
-CONFIG_FONT_MINI_4x6=y
 CONFIG_SOUND=y
 CONFIG_SND=m
 CONFIG_SND_MIXER_OSS=m
@@ -112,6 +100,7 @@ CONFIG_SND_PXA2XX_SOC=m
 CONFIG_USB=y
 CONFIG_USB_MON=m
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_GPIO_VBUS=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_VBUS_DRAW=500
 CONFIG_USB_PXA27X=y
@@ -121,7 +110,6 @@ CONFIG_USB_GADGETFS=m
 CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_USB_CDC_COMPOSITE=m
-CONFIG_USB_GPIO_VBUS=y
 CONFIG_MMC=y
 CONFIG_SDIO_UART=m
 CONFIG_MMC_PXA=y
@@ -148,6 +136,11 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_1251=m
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_FONTS=y
+CONFIG_FONT_MINI_4x6=y
 CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
@@ -155,7 +148,4 @@ CONFIG_TIMER_STATS=y
 # CONFIG_DEBUG_PREEMPT is not set
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
-CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-CONFIG_CRC_CCITT=y
index 03b4c61bdaddb4a15673b1b223159a29182e62e2..096cd7bc667ab88511bc3bcc573610aff7c9e40c 100644 (file)
@@ -1,16 +1,12 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_MODULES=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_MAINSTONE=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200 mem=64M"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
@@ -38,14 +34,18 @@ CONFIG_FB_PXA=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_LOGO=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 7c07f9893a0f9c2920c2c37ce6f76c4c025430b0..37739b61b0c3809d0af46f67aa73a7eb2f2d1853 100644 (file)
@@ -45,7 +45,6 @@ CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_KERNEL_MODE_NEON=y
 CONFIG_EFI_VARS=m
-CONFIG_EFI_CAPSULE_LOADER=m
 CONFIG_ARM_CRYPTO=y
 CONFIG_CRYPTO_SHA1_ARM_NEON=m
 CONFIG_CRYPTO_SHA1_ARM_CE=m
@@ -64,8 +63,7 @@ CONFIG_CMDLINE_PARTITION=y
 CONFIG_CMA=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=64
+CONFIG_EFI_CAPSULE_LOADER=m
 CONFIG_OF_OVERLAY=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
@@ -115,5 +113,7 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_HW is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC_ITU_T=m
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=64
 CONFIG_PRINTK_TIME=y
 CONFIG_MAGIC_SYSRQ=y
index 3ef48e79b41019753e0af36aa2ca70b94dd58323..86e00f684e167eaf85e8c0599535982c4314c34e 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_COMPAT_BRK is not set
 CONFIG_ARCH_MULTI_V4T=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_S3C24XX=y
@@ -12,6 +11,7 @@ CONFIG_S3C_ADC=y
 CONFIG_CPU_S3C2440=y
 CONFIG_MACH_MINI2440=y
 CONFIG_AEABI=y
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_KEXEC=y
 CONFIG_CPU_IDLE=y
 CONFIG_APM_EMULATION=y
@@ -19,7 +19,6 @@ CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_BLK_DEV_INTEGRITY=y
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_BSD_DISKLABEL=y
@@ -28,6 +27,7 @@ CONFIG_SOLARIS_X86_PARTITION=y
 CONFIG_UNIXWARE_DISKLABEL=y
 CONFIG_LDM_PARTITION=y
 CONFIG_BINFMT_MISC=m
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -104,6 +104,7 @@ CONFIG_SCSI=m
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=m
 CONFIG_CHR_DEV_SG=m
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 CONFIG_TUN=m
@@ -328,10 +329,10 @@ CONFIG_LIBCRC32C=m
 CONFIG_FONTS=y
 CONFIG_FONT_8x8=y
 CONFIG_FONT_MINI_4x6=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 CONFIG_DEBUG_USER=y
index a5e8d2235a1a4dd300465cb1966419326e90735c..4d39c615117bc63e412f61fbc3ecbdcfed8be9ff 100644 (file)
@@ -1,22 +1,18 @@
 CONFIG_SYSVIPC=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_MMP=y
-CONFIG_MACH_BROWNSTONE=y
-CONFIG_MACH_FLINT=y
-CONFIG_MACH_MARVELL_JASPER=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_MACH_MMP2_DT=y
 CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS2,38400 mem=128M user_debug=255 earlyprintk"
 CONFIG_VFP=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -28,9 +24,9 @@ CONFIG_IP_PNP=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
-CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_ONENAND=y
 CONFIG_MTD_ONENAND_GENERIC=y
+CONFIG_MTD_RAW_NAND=y
 # CONFIG_BLK_DEV is not set
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
@@ -39,9 +35,9 @@ CONFIG_SMC91X=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_PXA=y
@@ -55,17 +51,18 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_MAX8925=y
 # CONFIG_VGA_CONSOLE is not set
 # CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_MAX8925=y
-CONFIG_MMC=y
-# CONFIG_DNOTIFY is not set
-CONFIG_TMPFS=y
-CONFIG_TMPFS_POSIX_ACL=y
+# CONFIG_RESET_CONTROLLER is not set
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT4_FS=y
+# CONFIG_DNOTIFY is not set
 CONFIG_MSDOS_FS=y
 CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
 CONFIG_JFFS2_FS=y
 CONFIG_CRAMFS=y
 CONFIG_NFS_FS=y
@@ -73,16 +70,16 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
+CONFIG_CRC_CCITT=y
 CONFIG_PRINTK_TIME=y
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_DEBUG_PREEMPT is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_DYNAMIC_DEBUG is not set
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_MMP_UART3=y
 CONFIG_EARLY_PRINTK=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRC_CCITT=y
index eacc089d86c5637bda79aecaa236c5fd83e37fc5..082a38a14c1244326401a3f1f407fe66ca337f09 100644 (file)
@@ -1,7 +1,7 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
+CONFIG_PREEMPT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 # CONFIG_ELF_CORE is not set
@@ -11,18 +11,17 @@ CONFIG_IKCONFIG_PROC=y
 # CONFIG_EVENTFD is not set
 # CONFIG_AIO is not set
 CONFIG_EMBEDDED=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_COMPAT_BRK is not set
 # CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_MULTI_V4=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MOXART=y
 CONFIG_MACH_UC7112LX=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 # CONFIG_ATAGS is not set
 CONFIG_ARM_APPENDED_DTB=y
+# CONFIG_SWAP is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -118,10 +117,15 @@ CONFIG_EXT3_FS=y
 CONFIG_TMPFS=y
 CONFIG_CONFIGFS_FS=y
 CONFIG_JFFS2_FS=y
+CONFIG_KEYS=y
+CONFIG_CRC32_BIT=y
+CONFIG_DMA_API_DEBUG=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_KGDB=y
 CONFIG_DEBUG_PAGEALLOC=y
+# CONFIG_SLUB_DEBUG is not set
 CONFIG_DEBUG_OBJECTS=y
 CONFIG_DEBUG_KMEMLEAK=y
 CONFIG_DEBUG_STACK_USAGE=y
@@ -131,12 +135,8 @@ CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 CONFIG_PROVE_LOCKING=y
-CONFIG_DMA_API_DEBUG=y
-CONFIG_KGDB=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_UART_8250=y
 CONFIG_DEBUG_UART_PHYS=0x98200000
 CONFIG_DEBUG_UART_VIRT=0xf9820000
 CONFIG_EARLY_PRINTK=y
-CONFIG_KEYS=y
-CONFIG_CRC32_BIT=y
index c1e98e33a34878ddd8fc8316d12d5a36f4ac5bec..700568474549f5bfe6db6f5c9ca76b2182041c22 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_EXPERT=y
@@ -10,21 +11,17 @@ CONFIG_EXPERT=y
 # CONFIG_SIGNALFD is not set
 # CONFIG_EVENTFD is not set
 # CONFIG_AIO is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_BLOCK is not set
 # CONFIG_MMU is not set
 CONFIG_ARCH_MPS2=y
 CONFIG_SET_MEM_PARAM=y
 CONFIG_DRAM_BASE=0x21000000
 CONFIG_DRAM_SIZE=0x1000000
-CONFIG_PREEMPT_VOLUNTARY=y
 # CONFIG_ATAGS is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+# CONFIG_SUSPEND is not set
+# CONFIG_BLOCK is not set
 CONFIG_BINFMT_FLAT=y
 # CONFIG_COREDUMP is not set
-# CONFIG_SUSPEND is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -67,9 +64,9 @@ CONFIG_SMSC911X=y
 # CONFIG_SERIO is not set
 # CONFIG_VT is not set
 # CONFIG_LEGACY_PTYS is not set
-CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_MPS2_UART_CONSOLE=y
 CONFIG_SERIAL_MPS2_UART=y
+CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 CONFIG_WATCHDOG=y
@@ -97,9 +94,10 @@ CONFIG_NFS_V4_2=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_DEBUG_FS=y
+# CONFIG_SLUB_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MEMTEST=y
index e530107be412dff650de169b9285bceec3eec9d4..6c3e45b71ab5649cbeeb322f4f7a238bb373d050 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
-CONFIG_SLOB=y
 CONFIG_ARCH_MULTI_V4T=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_AT91=y
@@ -11,23 +10,22 @@ CONFIG_SOC_AT91RM9200=y
 CONFIG_ARCH_CLPS711X=y
 CONFIG_ARCH_MXC=y
 CONFIG_SOC_IMX1=y
+CONFIG_ARCH_NSPIRE=y
 CONFIG_ARCH_INTEGRATOR=y
 CONFIG_ARCH_INTEGRATOR_AP=y
 CONFIG_INTEGRATOR_IMPD1=y
 CONFIG_INTEGRATOR_CM720T=y
 CONFIG_INTEGRATOR_CM920T=y
 CONFIG_INTEGRATOR_CM922T_XA10=y
-CONFIG_ARCH_NSPIRE=y
 CONFIG_AEABI=y
 # CONFIG_ATAGS is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_CPUIDLE=y
 CONFIG_ARM_CLPS711X_CPUIDLE=y
 CONFIG_JUMP_LABEL=y
 CONFIG_PARTITION_ADVANCED=y
 # CONFIG_COREDUMP is not set
+CONFIG_SLOB=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
index f8d3011507320b69f02631940874469a41bcff24..e0be0e0023f39c2cdd7d7b93d0112d1b5928484d 100644 (file)
@@ -12,17 +12,8 @@ CONFIG_MACH_ASPEED_G4=y
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_AT91SAM9=y
 CONFIG_ARCH_DAVINCI=y
-CONFIG_ARCH_DAVINCI_DM644x=y
-CONFIG_ARCH_DAVINCI_DM355=y
-CONFIG_ARCH_DAVINCI_DM646x=y
 CONFIG_ARCH_DAVINCI_DA830=y
 CONFIG_ARCH_DAVINCI_DA850=y
-CONFIG_ARCH_DAVINCI_DM365=y
-CONFIG_MACH_SFFSDR=y
-CONFIG_MACH_NEUROS_OSD2=y
-CONFIG_MACH_DM355_LEOPARD=y
-CONFIG_MACH_MITYOMAPL138=y
-CONFIG_MACH_OMAPL138_HAWKBOARD=y
 CONFIG_ARCH_MXC=y
 CONFIG_SOC_IMX25=y
 CONFIG_SOC_IMX27=y
@@ -31,8 +22,6 @@ CONFIG_MACH_KIRKWOOD=y
 CONFIG_ARCH_NPCM=y
 CONFIG_ARCH_WPCM450=y
 CONFIG_ARCH_ORION5X=y
-CONFIG_MACH_DB88F5281=y
-CONFIG_MACH_RD88F5182=y
 CONFIG_MACH_RD88F5182_DT=y
 CONFIG_MACH_KUROBOX_PRO=y
 CONFIG_MACH_DNS323=y
@@ -40,19 +29,14 @@ CONFIG_MACH_TS209=y
 CONFIG_MACH_TERASTATION_PRO2=y
 CONFIG_MACH_LINKSTATION_PRO=y
 CONFIG_MACH_LINKSTATION_MINI=y
-CONFIG_MACH_LINKSTATION_LS_HGL=y
 CONFIG_MACH_TS409=y
-CONFIG_MACH_WRT350N_V2=y
 CONFIG_MACH_TS78XX=y
 CONFIG_MACH_MV2120=y
 CONFIG_MACH_D2NET_DT=y
 CONFIG_MACH_NET2BIG=y
 CONFIG_MACH_MSS2_DT=y
-CONFIG_MACH_WNR854T=y
-CONFIG_MACH_RD88F5181L_GE=y
-CONFIG_MACH_RD88F5181L_FXO=y
-CONFIG_MACH_RD88F6183AP_GE=y
 CONFIG_ARCH_SUNXI=y
+CONFIG_ARCH_VERSATILE=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
 CONFIG_ARM_APPENDED_DTB=y
@@ -78,7 +62,6 @@ CONFIG_NET_PKTGEN=m
 CONFIG_CFG80211=y
 CONFIG_MAC80211=y
 CONFIG_PCI_MVEBU=y
-CONFIG_ARCH_VERSATILE=y
 CONFIG_PCI_VERSATILE=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
@@ -98,17 +81,14 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_ATMEL=y
 CONFIG_MTD_NAND_ORION=y
 CONFIG_MTD_SPI_NOR=y
-CONFIG_SPI_ASPEED_SMC=y
 CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
+CONFIG_VIRTIO_BLK=y
 CONFIG_ATMEL_SSC=m
 CONFIG_EEPROM_AT24=y
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=m
-CONFIG_VIRTIO_PCI=y
-CONFIG_VIRTIO_MMIO=y
-CONFIG_VIRTIO_BLK=y
 CONFIG_CHR_DEV_SG=m
 CONFIG_ATA=y
 CONFIG_SATA_AHCI=y
@@ -161,6 +141,7 @@ CONFIG_I2C_AT91=y
 CONFIG_I2C_IMX=y
 CONFIG_I2C_MV64XXX=y
 CONFIG_SPI=y
+CONFIG_SPI_ASPEED_SMC=y
 CONFIG_SPI_ATMEL=y
 CONFIG_SPI_IMX=y
 CONFIG_SPI_ORION=y
@@ -273,6 +254,8 @@ CONFIG_RTC_DRV_ASPEED=m
 CONFIG_DMADEVICES=y
 CONFIG_AT_HDMAC=y
 CONFIG_MV_XOR=y
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_MMIO=y
 CONFIG_STAGING=y
 CONFIG_ASPEED_LPC_CTRL=m
 CONFIG_ASPEED_LPC_SNOOP=m
@@ -307,10 +290,10 @@ CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_CRC_CCITT=y
 CONFIG_LIBCRC32C=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
index ce9826bce29b336a388265f7812d247825c06866..bcd7a431c66ef5867f4f21db6d6b83fe4621473e 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_ARCH_VIRT=y
+CONFIG_ARCH_AIROHA=y
 CONFIG_ARCH_ACTIONS=y
 CONFIG_ARCH_ALPINE=y
 CONFIG_ARCH_ARTPEC=y
@@ -28,15 +29,16 @@ CONFIG_ARCH_BCM_21664=y
 CONFIG_ARCH_BCM_23550=y
 CONFIG_ARCH_BCM2835=y
 CONFIG_ARCH_BCM_53573=y
-CONFIG_ARCH_BCM_63XX=y
 CONFIG_ARCH_BRCMSTB=y
 CONFIG_ARCH_BCMBCA=y
+CONFIG_ARCH_BCMBCA_CORTEXA7=y
+CONFIG_ARCH_BCMBCA_CORTEXA9=y
+CONFIG_ARCH_BCMBCA_BRAHMAB15=y
 CONFIG_ARCH_BERLIN=y
 CONFIG_MACH_BERLIN_BG2=y
 CONFIG_MACH_BERLIN_BG2CD=y
 CONFIG_MACH_BERLIN_BG2Q=y
 CONFIG_ARCH_DIGICOLOR=y
-CONFIG_ARCH_AIROHA=y
 CONFIG_ARCH_EXYNOS=y
 CONFIG_ARCH_HIGHBANK=y
 CONFIG_ARCH_HISI=y
@@ -94,6 +96,7 @@ CONFIG_MACH_SPEAR1310=y
 CONFIG_MACH_SPEAR1340=y
 CONFIG_ARCH_STI=y
 CONFIG_ARCH_STM32=y
+CONFIG_ARCH_SUNPLUS=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_ARCH_UNIPHIER=y
@@ -129,12 +132,6 @@ CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_ARM_TEGRA_CPUIDLE=y
 CONFIG_ARM_QCOM_SPM_CPUIDLE=y
 CONFIG_KERNEL_MODE_NEON=y
-CONFIG_ARM_SCMI_PROTOCOL=y
-CONFIG_RASPBERRYPI_FIRMWARE=y
-CONFIG_TRUSTED_FOUNDATIONS=y
-CONFIG_BCM47XX_NVRAM=y
-CONFIG_BCM47XX_SPROM=y
-CONFIG_EFI_CAPSULE_LOADER=m
 CONFIG_ARM_CRYPTO=y
 CONFIG_CRYPTO_SHA1_ARM_NEON=m
 CONFIG_CRYPTO_SHA1_ARM_CE=m
@@ -207,6 +204,12 @@ CONFIG_PCI_EPF_TEST=m
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_OMAP_OCP2SCP=y
+CONFIG_ARM_SCMI_PROTOCOL=y
+CONFIG_RASPBERRYPI_FIRMWARE=y
+CONFIG_TRUSTED_FOUNDATIONS=y
+CONFIG_BCM47XX_NVRAM=y
+CONFIG_BCM47XX_SPROM=y
+CONFIG_EFI_CAPSULE_LOADER=m
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -227,7 +230,6 @@ CONFIG_MTD_NAND_DAVINCI=y
 CONFIG_MTD_NAND_STM32_FMC2=y
 CONFIG_MTD_NAND_PL35X=y
 CONFIG_MTD_SPI_NOR=y
-CONFIG_SPI_ASPEED_SMC=m
 CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
@@ -259,13 +261,13 @@ CONFIG_SATA_MV=y
 CONFIG_SATA_RCAR=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_VENDOR_ASIX=y
-CONFIG_SPI_AX88796C=m
 CONFIG_VIRTIO_NET=y
 CONFIG_B53_SPI_DRIVER=m
 CONFIG_B53_MDIO_DRIVER=m
 CONFIG_B53_MMAP_DRIVER=m
 CONFIG_NET_DSA_BCM_SF2=m
 CONFIG_SUN4I_EMAC=y
+CONFIG_SPI_AX88796C=m
 CONFIG_BCMGENET=m
 CONFIG_BGMAC_BCMA=y
 CONFIG_SYSTEMPORT=m
@@ -298,7 +300,6 @@ CONFIG_MARVELL_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_ROCKCHIP_PHY=y
 CONFIG_DP83867_PHY=y
-CONFIG_USB_BRCMSTB=m
 CONFIG_MDIO_MSCC_MIIM=m
 CONFIG_USB_PEGASUS=y
 CONFIG_USB_RTL8152=m
@@ -435,6 +436,7 @@ CONFIG_I2C_RCAR=y
 CONFIG_I2C_CROS_EC_TUNNEL=m
 CONFIG_I2C_SLAVE_EEPROM=y
 CONFIG_SPI=y
+CONFIG_SPI_ASPEED_SMC=m
 CONFIG_SPI_ATMEL=m
 CONFIG_SPI_ATMEL_QUADSPI=m
 CONFIG_SPI_BCM2835=y
@@ -465,10 +467,10 @@ CONFIG_SPI_SPIDEV=y
 CONFIG_SPMI=y
 CONFIG_PTP_1588_CLOCK=y
 CONFIG_PINCTRL_AS3722=y
-CONFIG_PINCTRL_STMFX=y
 CONFIG_PINCTRL_MICROCHIP_SGPIO=y
 CONFIG_PINCTRL_OCELOT=y
 CONFIG_PINCTRL_PALMAS=y
+CONFIG_PINCTRL_STMFX=y
 CONFIG_PINCTRL_OWL=y
 CONFIG_PINCTRL_S500=y
 CONFIG_PINCTRL_MSM=y
@@ -511,7 +513,6 @@ CONFIG_BATTERY_ACT8945A=y
 CONFIG_BATTERY_CPCAP=m
 CONFIG_BATTERY_SBS=y
 CONFIG_BATTERY_BQ27XXX=m
-CONFIG_BATTERY_ACER_A500=m
 CONFIG_AXP20X_POWER=m
 CONFIG_BATTERY_MAX17040=m
 CONFIG_BATTERY_MAX17042=m
@@ -523,6 +524,7 @@ CONFIG_CHARGER_MAX8997=m
 CONFIG_CHARGER_MAX8998=m
 CONFIG_CHARGER_SMB347=m
 CONFIG_CHARGER_TPS65090=y
+CONFIG_BATTERY_ACER_A500=m
 CONFIG_SENSORS_ARM_SCMI=y
 CONFIG_SENSORS_ASPEED=m
 CONFIG_SENSORS_IIO_HWMON=y
@@ -577,7 +579,6 @@ CONFIG_GXP_WATCHDOG=y
 CONFIG_BCMA_HOST_SOC=y
 CONFIG_BCMA_DRIVER_GMAC_CMN=y
 CONFIG_BCMA_DRIVER_GPIO=y
-CONFIG_MFD_ACER_A500_EC=m
 CONFIG_MFD_ACT8945A=y
 CONFIG_MFD_AS3711=y
 CONFIG_MFD_AS3722=y
@@ -610,6 +611,7 @@ CONFIG_MFD_TPS6586X=y
 CONFIG_MFD_TPS65910=y
 CONFIG_MFD_STM32_LPTIMER=m
 CONFIG_MFD_STPMIC1=y
+CONFIG_MFD_ACER_A500_EC=m
 CONFIG_REGULATOR_ACT8865=y
 CONFIG_REGULATOR_ACT8945A=y
 CONFIG_REGULATOR_ANATOP=y
@@ -664,31 +666,31 @@ CONFIG_MEDIA_SUPPORT=m
 CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_MMP_CAMERA=m
+CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_ASPEED=m
-CONFIG_VIDEO_STM32_DCMI=m
+CONFIG_VIDEO_ATMEL_ISC=m
+CONFIG_VIDEO_ATMEL_XISC=m
+CONFIG_VIDEO_ATMEL_ISI=m
+CONFIG_VIDEO_MICROCHIP_CSI2DC=m
+CONFIG_VIDEO_MMP_CAMERA=m
+CONFIG_VIDEO_TEGRA_VDE=m
 CONFIG_VIDEO_RENESAS_CEU=m
+CONFIG_VIDEO_RCAR_VIN=m
+CONFIG_VIDEO_RENESAS_FDP1=m
+CONFIG_VIDEO_RENESAS_JPU=m
+CONFIG_VIDEO_RENESAS_VSP1=m
+CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
 CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m
 CONFIG_VIDEO_S5P_FIMC=m
 CONFIG_VIDEO_S5P_MIPI_CSIS=m
 CONFIG_VIDEO_EXYNOS_FIMC_LITE=m
 CONFIG_VIDEO_EXYNOS4_FIMC_IS=m
-CONFIG_VIDEO_RCAR_VIN=m
-CONFIG_VIDEO_ATMEL_ISC=m
-CONFIG_VIDEO_ATMEL_XISC=m
-CONFIG_VIDEO_ATMEL_ISI=m
-CONFIG_VIDEO_MICROCHIP_CSI2DC=m
-CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
 CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
-CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
 CONFIG_VIDEO_STI_BDISP=m
-CONFIG_VIDEO_STI_HVA=m
 CONFIG_VIDEO_STI_DELTA=m
-CONFIG_VIDEO_RENESAS_FDP1=m
-CONFIG_VIDEO_RENESAS_JPU=m
-CONFIG_VIDEO_RENESAS_VSP1=m
-CONFIG_VIDEO_TEGRA_VDE=m
+CONFIG_VIDEO_STI_HVA=m
+CONFIG_VIDEO_STM32_DCMI=m
 CONFIG_V4L_TEST_DRIVERS=y
 CONFIG_VIDEO_VIVID=m
 CONFIG_VIDEO_ADV7180=m
@@ -725,13 +727,13 @@ CONFIG_DRM_PANEL_LVDS=m
 CONFIG_DRM_PANEL_SIMPLE=y
 CONFIG_DRM_PANEL_EDP=y
 CONFIG_DRM_PANEL_SAMSUNG_LD9040=m
-CONFIG_DRM_PANEL_SHARP_LQ101R1SX01=m
 CONFIG_DRM_PANEL_ORISETECH_OTM8009A=m
 CONFIG_DRM_PANEL_RAYDIUM_RM68200=m
 CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03=m
 CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m
-CONFIG_DRM_LVDS_CODEC=m
+CONFIG_DRM_PANEL_SHARP_LQ101R1SX01=m
 CONFIG_DRM_DISPLAY_CONNECTOR=m
+CONFIG_DRM_LVDS_CODEC=m
 CONFIG_DRM_NXP_PTN3460=m
 CONFIG_DRM_PARADE_PS8622=m
 CONFIG_DRM_SII902X=m
@@ -747,6 +749,7 @@ CONFIG_DRM_IMX_PARALLEL_DISPLAY=m
 CONFIG_DRM_IMX_TVE=m
 CONFIG_DRM_IMX_LDB=m
 CONFIG_DRM_IMX_HDMI=m
+CONFIG_DRM_V3D=m
 CONFIG_DRM_VC4=m
 CONFIG_DRM_ETNAVIV=m
 CONFIG_DRM_MXSFB=m
@@ -832,6 +835,7 @@ CONFIG_USB_OTG=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_MVEBU=y
 CONFIG_USB_XHCI_TEGRA=m
+CONFIG_USB_BRCMSTB=m
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_STI=y
 CONFIG_USB_EHCI_EXYNOS=m
@@ -936,10 +940,10 @@ CONFIG_LEDS_CLASS_FLASH=m
 CONFIG_LEDS_CPCAP=m
 CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_PWM=y
-CONFIG_LEDS_MAX77693=m
 CONFIG_LEDS_MAX8997=m
 CONFIG_LEDS_ACER_A500=m
 CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_MAX77693=m
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_ONESHOT=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
@@ -1162,10 +1166,10 @@ CONFIG_KEYSTONE_IRQ=y
 CONFIG_RESET_MCHP_SPARX5=y
 CONFIG_PHY_SUN4I_USB=y
 CONFIG_PHY_SUN9I_USB=y
+CONFIG_PHY_BRCM_USB=m
 CONFIG_PHY_HIX5HD2_SATA=y
 CONFIG_PHY_BERLIN_SATA=y
 CONFIG_PHY_BERLIN_USB=y
-CONFIG_PHY_BRCM_USB=m
 CONFIG_PHY_MMP3_USB=m
 CONFIG_PHY_LAN966X_SERDES=m
 CONFIG_PHY_CPCAP_USB=m
index cd703c15798fff55999f7739d4e9a911bd231829..a53ccd49f8ffde377c9e97602d41af3c661140ca 100644 (file)
@@ -1,14 +1,12 @@
 CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
-# CONFIG_SLUB_DEBUG is not set
 CONFIG_PROFILING=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V6 is not set
 # CONFIG_ARCH_MULTI_V7 is not set
@@ -16,15 +14,16 @@ CONFIG_ARCH_MV78XX0=y
 CONFIG_MACH_DB78X00_BP=y
 CONFIG_MACH_RD78X00_MASA=y
 CONFIG_MACH_TERASTATION_WXL=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_FPE_NWFPE=y
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_VFP=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BSD_DISKLABEL=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -52,25 +51,26 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=m
 CONFIG_CHR_DEV_SG=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
-CONFIG_MARVELL_PHY=y
 CONFIG_NET_ETHERNET=y
 CONFIG_MII=y
 CONFIG_NET_PCI=y
 CONFIG_MV643XX_ETH=y
 # CONFIG_INPUT_MOUSEDEV is not set
+CONFIG_MARVELL_PHY=y
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
 # CONFIG_VT is not set
+CONFIG_LEGACY_PTY_COUNT=16
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 # CONFIG_SERIAL_8250_PCI is not set
 CONFIG_SERIAL_8250_RUNTIME_UARTS=2
-CONFIG_LEGACY_PTY_COUNT=16
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
@@ -110,21 +110,20 @@ CONFIG_CRAMFS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_BSD_DISKLABEL=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_KERNEL=y
+# CONFIG_SLUB_DEBUG is not set
 CONFIG_SCHEDSTATS=y
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
index d57ff30dabff177416770c80ff6df9670818b24b..ef3a33ebc29a60e158775efea8d4c4b065466ce5 100644 (file)
@@ -2,18 +2,13 @@ CONFIG_SYSVIPC=y
 CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=19
 CONFIG_PROFILING=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_KIRKWOOD=y
 CONFIG_ARCH_ORION5X=y
-CONFIG_MACH_DB88F5281=y
-CONFIG_MACH_RD88F5182=y
 CONFIG_MACH_RD88F5182_DT=y
 CONFIG_MACH_KUROBOX_PRO=y
 CONFIG_MACH_DNS323=y
@@ -22,24 +17,14 @@ CONFIG_MACH_TERASTATION_PRO2=y
 CONFIG_MACH_LINKSTATION_PRO=y
 CONFIG_MACH_LINKSTATION_LSCHL=y
 CONFIG_MACH_LINKSTATION_MINI=y
-CONFIG_MACH_LINKSTATION_LS_HGL=y
 CONFIG_MACH_TS409=y
-CONFIG_MACH_WRT350N_V2=y
 CONFIG_MACH_TS78XX=y
 CONFIG_MACH_MV2120=y
 CONFIG_MACH_D2NET_DT=y
 CONFIG_MACH_NET2BIG=y
 CONFIG_MACH_MSS2_DT=y
-CONFIG_MACH_WNR854T=y
-CONFIG_MACH_RD88F5181L_GE=y
-CONFIG_MACH_RD88F5181L_FXO=y
-CONFIG_MACH_RD88F6183AP_GE=y
-CONFIG_PCI_MVEBU=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CPU_FREQ=y
@@ -47,6 +32,9 @@ CONFIG_CPU_FREQ_STAT=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_KIRKWOOD_CPUIDLE=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -61,6 +49,7 @@ CONFIG_NET_SWITCHDEV=y
 CONFIG_NET_PKTGEN=m
 CONFIG_CFG80211=y
 CONFIG_MAC80211=y
+CONFIG_PCI_MVEBU=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
@@ -84,6 +73,7 @@ CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=m
 CONFIG_CHR_DEV_SG=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_SATA_AHCI=y
 CONFIG_SATA_MV=y
@@ -93,9 +83,9 @@ CONFIG_NET_DSA_MV88E6XXX=y
 CONFIG_MV643XX_ETH=y
 CONFIG_R8169=y
 CONFIG_MARVELL_PHY=y
-CONFIG_MWL8K=m
 CONFIG_LIBERTAS=y
 CONFIG_LIBERTAS_SDIO=y
+CONFIG_MWL8K=m
 CONFIG_INPUT_EVDEV=y
 CONFIG_KEYBOARD_GPIO=y
 # CONFIG_INPUT_MOUSE is not set
@@ -194,16 +184,16 @@ CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
 CONFIG_NLS_UTF8=y
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_FS=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-CONFIG_CRYPTO_DEV_MARVELL_CESA=y
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRC_CCITT=y
-CONFIG_LIBCRC32C=y
index 7b713c083a2a71b7d2af6cbd3d14a51006082c19..68a18264f31b054a5ca2ab90aa1c82af998e0218 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_PERF_EVENTS=y
-CONFIG_SLAB=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_ARMADA_370=y
 CONFIG_MACH_ARMADA_375=y
@@ -24,6 +23,7 @@ CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -147,7 +147,7 @@ CONFIG_NLS_UTF8=y
 CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_PRINTK_TIME=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_SCHED_DEBUG is not set
 CONFIG_DEBUG_USER=y
index f53086ddc48b032bbc58a06ffd9cc97abaed3731..155553ee06f4cae720a357bb645ce719d9b9dd8e 100644 (file)
@@ -15,7 +15,6 @@ CONFIG_CGROUPS=y
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_PERF_EVENTS=y
-# CONFIG_COMPAT_BRK is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_MXS=y
 CONFIG_AEABI=y
@@ -25,6 +24,7 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_BLK_DEV_INTEGRITY=y
+# CONFIG_COMPAT_BRK is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -163,10 +163,10 @@ CONFIG_CRC_ITU_T=m
 CONFIG_CRC7=m
 CONFIG_FONTS=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_DEBUG_KERNEL=y
 CONFIG_FRAME_WARN=2048
 CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_SOFTLOCKUP_DETECTOR=y
 CONFIG_PROVE_LOCKING=y
 CONFIG_BLK_DEV_IO_TRACE=y
index 018a1092d0e7bd9d4a70a27ea77ec830b78d0dba..907403529e30229fb6d9bfa1ed949c657923e13b 100644 (file)
@@ -1,16 +1,9 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_ASSABET=y
 CONFIG_ASSABET_NEPONSET=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_PCMCIA_SA1111=y
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
 CONFIG_ZBOOT_ROM_TEXT=0x80000
 CONFIG_ZBOOT_ROM_BSS=0xc1000000
 CONFIG_ZBOOT_ROM=y
@@ -18,14 +11,21 @@ CONFIG_CMDLINE="console=ttySA0,38400n8 cpufreq=221200 rw root=/dev/mtdblock2 mtd
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
 CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_MSDOS_PARTITION is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
+CONFIG_PCMCIA_SA1111=y
 CONFIG_MTD=y
-CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -39,20 +39,20 @@ CONFIG_BLK_DEV_SD=m
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
 CONFIG_NET_VENDOR_SMC=y
+CONFIG_PCMCIA_PCNET=y
 CONFIG_SMC9194=y
 CONFIG_SMC91X=y
 CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_PCNET=y
 # CONFIG_INPUT_MOUSE is not set
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_SERIO_SERPORT=m
 CONFIG_SERIO_SA1111=y
-CONFIG_SERIAL_NONSTANDARD=y
+CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CS=y
 CONFIG_SERIAL_SA1100=y
 CONFIG_SERIAL_SA1100_CONSOLE=y
-CONFIG_LEGACY_PTY_COUNT=64
+CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_WATCHDOG=y
@@ -68,17 +68,19 @@ CONFIG_USB=m
 CONFIG_USB_MON=m
 CONFIG_USB_OHCI_HCD=m
 CONFIG_USB_STORAGE=m
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
 CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
-# CONFIG_MSDOS_PARTITION is not set
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_ISO8859_1=m
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index c3c171cec91bbe43f6e61e3edeedffed75bb41ea..cf7bbcf9d98a75f9ca1b7cd2ee069abdd0815ae7 100644 (file)
@@ -2,14 +2,11 @@ CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_ARCH_FOOTBRIDGE=y
 CONFIG_ARCH_NETWINDER=y
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
 CONFIG_DEPRECATED_PARAM_STRUCT=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=0x801"
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -51,9 +48,6 @@ CONFIG_977_WATCHDOG=y
 CONFIG_FB=y
 CONFIG_FB_CYBER2000=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SOUND_PRIME=y
@@ -62,6 +56,10 @@ CONFIG_SOUND_TRACEINIT=y
 CONFIG_SOUND_DMAP=y
 CONFIG_SOUND_YM3812=y
 CONFIG_SOUND_WAVEARTIST=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
@@ -72,7 +70,6 @@ CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_SMB_FS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_CODEPAGE_852=y
@@ -80,6 +77,9 @@ CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
 CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_UTF8=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
index 907d6512821ad3c76236d437416e2ae58f06384b..d5881de4201836115986de950114dbeeb3d7da51 100644 (file)
@@ -1,5 +1,4 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -10,14 +9,14 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
-CONFIG_SLAB=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_NOMADIK=y
 CONFIG_MACH_NOMADIK_8815NHK=y
 CONFIG_AEABI=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -59,6 +58,7 @@ CONFIG_BLK_DEV_RAM=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_SCAN_ASYNC=y
@@ -135,7 +135,7 @@ CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_SHA1=y
 CONFIG_CRYPTO_DES=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_FS=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
index 14c17a218ec5732c847d5bab46787ee87a7d16dc..54a9f50122af172e038ec7f8428a973941ff8f0e 100644 (file)
@@ -1,64 +1,49 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-# CONFIG_KALLSYMS is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_BASE_FULL is not set
 # CONFIG_SHMEM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-CONFIG_SLOB=y
+# CONFIG_KALLSYMS is not set
 CONFIG_PROFILING=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_MULTI_V4T=y
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_OMAP=y
 CONFIG_ARCH_OMAP1=y
-CONFIG_OMAP_RESET_CLOCKS=y
-# CONFIG_OMAP_MUX is not set
 CONFIG_OMAP_32K_TIMER=y
 CONFIG_OMAP_DM_TIMER=y
 CONFIG_ARCH_OMAP730=y
 CONFIG_ARCH_OMAP850=y
 CONFIG_ARCH_OMAP16XX=y
-CONFIG_MACH_OMAP_INNOVATOR=y
-CONFIG_MACH_OMAP_H2=y
-CONFIG_MACH_OMAP_H3=y
-CONFIG_MACH_HERALD=y
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_RESET_CLOCKS=y
 CONFIG_MACH_OMAP_OSK=y
-CONFIG_MACH_OMAP_PERSEUS2=y
-CONFIG_MACH_OMAP_FSAMPLE=y
-CONFIG_MACH_VOICEBLUE=y
 CONFIG_MACH_OMAP_PALMTE=y
-CONFIG_MACH_OMAP_PALMZ71=y
-CONFIG_MACH_OMAP_PALMTT=y
 CONFIG_MACH_SX1=y
 CONFIG_MACH_NOKIA770=y
 CONFIG_MACH_AMS_DELTA=y
 CONFIG_MACH_OMAP_GENERIC=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_PCCARD=y
-CONFIG_OMAP_CF=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_LEDS=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=1f03 rootfstype=jffs2"
 CONFIG_FPE_NWFPE=y
-CONFIG_BINFMT_MISC=y
-CONFIG_PM=y
 # CONFIG_SUSPEND is not set
+CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_SWAP is not set
+CONFIG_SLOB=y
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -79,6 +64,8 @@ CONFIG_BT_RFCOMM=y
 CONFIG_BT_RFCOMM_TTY=y
 CONFIG_BT_BNEP=y
 CONFIG_BT_HIDP=y
+CONFIG_PCCARD=y
+CONFIG_OMAP_CF=y
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 CONFIG_CONNECTOR=y
@@ -99,12 +86,21 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=m
 CONFIG_PATA_PCMCIA=m
 CONFIG_NETDEVICES=y
 CONFIG_TUN=y
 CONFIG_PHYLIB=y
 CONFIG_SMC91X=y
+CONFIG_PPP=y
+CONFIG_PPP_BSDCOMP=y
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_ASYNC=y
+CONFIG_SLIP=y
+CONFIG_SLIP_COMPRESSED=y
 CONFIG_USB_CATC=y
 CONFIG_USB_KAWETH=y
 CONFIG_USB_PEGASUS=y
@@ -112,14 +108,6 @@ CONFIG_USB_RTL8150=y
 CONFIG_USB_USBNET=y
 # CONFIG_USB_NET_AX8817X is not set
 # CONFIG_USB_NET_CDC_SUBSET is not set
-CONFIG_PPP=y
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=y
-CONFIG_PPP_DEFLATE=y
-CONFIG_PPP_BSDCOMP=y
-CONFIG_SLIP=y
-CONFIG_SLIP_COMPRESSED=y
 # CONFIG_INPUT_MOUSEDEV is not set
 CONFIG_INPUT_EVDEV=y
 CONFIG_INPUT_EVBUG=y
@@ -130,11 +118,11 @@ CONFIG_TOUCHSCREEN_ADS7846=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=y
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=3
 CONFIG_SERIAL_8250_RUNTIME_UARTS=3
-# CONFIG_LEGACY_PTYS is not set
 CONFIG_HW_RANDOM=y
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
@@ -156,11 +144,6 @@ CONFIG_FB_OMAP_LCD_MIPID=y
 CONFIG_LCD_CLASS_DEVICE=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-CONFIG_FONT_6x11=y
-CONFIG_FONT_MINI_4x6=y
 CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
@@ -222,7 +205,6 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_CODEPAGE_852=y
@@ -235,13 +217,8 @@ CONFIG_NLS_ISO8859_15=y
 CONFIG_NLS_KOI8_R=y
 CONFIG_NLS_UTF8=y
 # CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_MUTEXES=y
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_SECURITY=y
 CONFIG_CRYPTO_ECB=y
 CONFIG_CRYPTO_PCBC=y
@@ -249,3 +226,13 @@ CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_LIBCRC32C=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_FONT_6x11=y
+CONFIG_FONT_MINI_4x6=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_USER=y
index 9380df6b530f0c19919deed2924e7a2d91a89612..99d015cf8919e158b78cea4c697db5cf4248e19f 100644 (file)
@@ -22,11 +22,8 @@ CONFIG_CGROUP_PERF=y
 CONFIG_NAMESPACES=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-CONFIG_SLAB=y
 CONFIG_PROFILING=y
 CONFIG_ARCH_MULTI_V6=y
-CONFIG_POWER_AVS_OMAP=y
-CONFIG_POWER_AVS_OMAP_CLASS3=y
 CONFIG_OMAP_RESET_CLOCKS=y
 CONFIG_ARCH_OMAP2=y
 CONFIG_ARCH_OMAP3=y
@@ -35,6 +32,8 @@ CONFIG_SOC_OMAP5=y
 CONFIG_SOC_AM33XX=y
 CONFIG_SOC_AM43XX=y
 CONFIG_SOC_DRA7XX=y
+CONFIG_POWER_AVS_OMAP=y
+CONFIG_POWER_AVS_OMAP_CLASS3=y
 CONFIG_ARM_THUMBEE=y
 CONFIG_ARM_ERRATA_411920=y
 CONFIG_SMP=y
@@ -69,9 +68,9 @@ CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_MODULE_SRCVERSION_ALL=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=y
+CONFIG_SLAB=y
 CONFIG_CMA=y
 CONFIG_ZSMALLOC=m
 CONFIG_NET=y
@@ -316,6 +315,7 @@ CONFIG_PCI_ENDPOINT_TEST=m
 CONFIG_EEPROM_AT24=m
 CONFIG_EEPROM_AT25=m
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_SCSI_SCAN_ASYNC=y
 CONFIG_ATA=y
 CONFIG_SATA_AHCI_PLATFORM=y
@@ -494,15 +494,15 @@ CONFIG_REGULATOR_TWL4030=y
 CONFIG_RC_CORE=m
 CONFIG_LIRC=y
 CONFIG_RC_DEVICES=y
-CONFIG_IR_SPI=m
-CONFIG_IR_RX51=m
 CONFIG_IR_GPIO_TX=m
 CONFIG_IR_PWM_TX=m
+CONFIG_IR_RX51=m
+CONFIG_IR_SPI=m
 CONFIG_MEDIA_SUPPORT=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_OMAP3=m
-CONFIG_VIDEO_TVP5150=m
 CONFIG_VIDEO_MT9P031=m
+CONFIG_VIDEO_TVP5150=m
 CONFIG_DRM=m
 CONFIG_DRM_OMAP=m
 CONFIG_OMAP5_DSS_HDMI=y
@@ -726,9 +726,8 @@ CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
 CONFIG_PRINTK_TIME=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
-CONFIG_DEBUG_INFO_SPLIT=y
 CONFIG_DEBUG_INFO_DWARF4=y
+CONFIG_DEBUG_INFO_SPLIT=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_SCHEDSTATS=y
index b9e3b647e732df059b5fed5d083f54be69059505..1311d9583fccd93b91ca74ab960e4e53129abe09 100644 (file)
@@ -1,23 +1,14 @@
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
-# CONFIG_SLUB_DEBUG is not set
 CONFIG_PROFILING=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_BSD_DISKLABEL=y
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V6 is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_ORION5X=y
-CONFIG_ARCH_ORION5X_DT=y
-CONFIG_MACH_DB88F5281=y
-CONFIG_MACH_RD88F5182=y
 CONFIG_MACH_RD88F5182_DT=y
 CONFIG_MACH_KUROBOX_PRO=y
 CONFIG_MACH_DNS323=y
@@ -25,28 +16,20 @@ CONFIG_MACH_TS209=y
 CONFIG_MACH_TERASTATION_PRO2=y
 CONFIG_MACH_LINKSTATION_PRO=y
 CONFIG_MACH_LINKSTATION_MINI=y
-CONFIG_MACH_LINKSTATION_LS_HGL=y
 CONFIG_MACH_TS409=y
-CONFIG_MACH_WRT350N_V2=y
 CONFIG_MACH_TS78XX=y
 CONFIG_MACH_MV2120=y
-CONFIG_MACH_EDMINI_V2_DT=y
-CONFIG_MACH_D2NET=y
-CONFIG_MACH_BIGDISK=y
 CONFIG_MACH_NET2BIG=y
-CONFIG_MACH_MSS2=y
-CONFIG_MACH_WNR854T=y
-CONFIG_MACH_RD88F5181L_GE=y
-CONFIG_MACH_RD88F5181L_FXO=y
-CONFIG_MACH_RD88F6183AP_GE=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_FPE_NWFPE=y
 CONFIG_VFP=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BSD_DISKLABEL=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -58,6 +41,7 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
 CONFIG_NET_DSA=y
 CONFIG_NET_PKTGEN=m
+# CONFIG_VGA_ARB is not set
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -69,13 +53,14 @@ CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_RAW_NAND=y
-CONFIG_MTD_NAND_PLATFORM=y
 CONFIG_MTD_NAND_ORION=y
+CONFIG_MTD_NAND_PLATFORM=y
 CONFIG_BLK_DEV_LOOP=y
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=m
 CONFIG_CHR_DEV_SG=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
@@ -103,7 +88,6 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MV64XXX=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_SENSORS_LM75=y
-# CONFIG_VGA_ARB is not set
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
@@ -148,17 +132,18 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_2=y
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
+CONFIG_CRC_T10DIF=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-# CONFIG_DEBUG_BUGVERBOSE is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+# CONFIG_SLUB_DEBUG is not set
 CONFIG_LATENCYTOP=y
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
-CONFIG_CRYPTO_CBC=m
-CONFIG_CRYPTO_ECB=m
-CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRYPTO_DEV_MARVELL_CESA=y
-CONFIG_CRC_T10DIF=y
index de37f7e9099910b952073904147df3f557e7a3e7..600f78b363dd6f496bb74f461792e9b1f05f9e06 100644 (file)
@@ -7,16 +7,11 @@ CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
 CONFIG_STRICT_KERNEL_RWX=y
 CONFIG_STRICT_MODULE_RWX=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_CMDLINE_PARTITION=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_OXNAS=y
 CONFIG_MACH_OX820=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=16
-CONFIG_CMA=y
 CONFIG_FORCE_MAX_ZONEORDER=12
 CONFIG_SECCOMP=y
 CONFIG_ARM_APPENDED_DTB=y
@@ -26,6 +21,11 @@ CONFIG_EFI=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_CPUIDLE=y
 CONFIG_VFP=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_CMDLINE_PARTITION=y
+CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -44,8 +44,6 @@ CONFIG_IPV6_TUNNEL=m
 CONFIG_IPV6_MULTIPLE_TABLES=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-CONFIG_DMA_CMA=y
-CONFIG_CMA_SIZE_MBYTES=64
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -88,5 +86,7 @@ CONFIG_PSTORE_RAM=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=64
 CONFIG_PRINTK_TIME=y
 CONFIG_MAGIC_SYSRQ=y
index e6acb1d588e2111a4235d015c9e84eb730e4c7a0..a9a808bc2f7040f58104a5d249e7ebf1de37eab0 100644 (file)
@@ -1,24 +1,23 @@
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_ARCH_PXA_PALM=y
 # CONFIG_MACH_PALMTX is not set
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="mem=32M console=tty root=/dev/mmcblk0"
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
 CONFIG_APM_EMULATION=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -52,8 +51,6 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_PWM=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
 CONFIG_MMC_DEBUG=y
@@ -72,5 +69,7 @@ CONFIG_TMPFS=y
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_CODEPAGE_866=y
 CONFIG_NLS_UTF8=y
-CONFIG_DEBUG_USER=y
 CONFIG_CRC_T10DIF=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_DEBUG_USER=y
index 106d5bef48e2f326b686e0b08ad0442a9d538688..06bc9a8fef900049b695c6acdef8fbef7309bc19 100644 (file)
@@ -1,6 +1,8 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
@@ -8,22 +10,19 @@ CONFIG_LOG_BUF_SHIFT=14
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 # CONFIG_KALLSYMS is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_PCM027=y
 CONFIG_MACH_PCM990_BASEBOARD=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 # CONFIG_OABI_COMPAT is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -43,6 +42,7 @@ CONFIG_MTD_PHYSMAP=y
 # CONFIG_BLK_DEV is not set
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
@@ -51,9 +51,9 @@ CONFIG_SMC91X=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
@@ -84,7 +84,6 @@ CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_DEFAULT="iso8859-15"
 CONFIG_NLS_CODEPAGE_850=y
 CONFIG_NLS_ISO8859_15=y
index 2170148b975cedd7462623183241aac3620d62b3..d87263336cb22d215781c5e2db38327b1e4ce6b3 100644 (file)
@@ -1,19 +1,18 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_HOTPLUG is not set
 # CONFIG_SHMEM is not set
-CONFIG_MODULES=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_PLEB=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttySA0,9600 mem=16M@0xc0000000 mem=16M@0xc8000000 root=/dev/ram initrd=0xc0400000,4M"
 CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+# CONFIG_SWAP is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -21,9 +20,9 @@ CONFIG_INET=y
 CONFIG_SYN_COOKIES=y
 # CONFIG_IPV6 is not set
 CONFIG_MTD=y
+CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
-CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_CFI_INTELEXT=y
index 0947f022954d465796b9eba766fdef861b51422d..70d327895ccfe67cbdac10aa200b354073059eea 100644 (file)
@@ -1,12 +1,6 @@
 CONFIG_SYSVIPC=y
-CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_MMP=y
 CONFIG_MACH_ASPENITE=y
 CONFIG_MACH_ZYLONITE2=y
 CONFIG_MACH_AVENGERS_LITE=y
@@ -14,10 +8,14 @@ CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_ARCH_MMP=y
 CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -34,9 +32,9 @@ CONFIG_SMC91X=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
 # CONFIG_VGA_CONSOLE is not set
@@ -49,12 +47,12 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
+CONFIG_CRC_CCITT=y
 CONFIG_PRINTK_TIME=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_PREEMPT is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRC_CCITT=y
index 5663245e9534939dbb76e1eaf47e1b74a5f2f1e7..ae0444949a87e52733acd7f1241ef0f0c97de0fd 100644 (file)
@@ -1,16 +1,12 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
-CONFIG_MODULES=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_ARCH_PXA_IDP=y
-# CONFIG_ARM_THUMB is not set
-CONFIG_LEDS=y
-CONFIG_LEDS_CPU=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=/dev/nfs ip=dhcp console=ttyS0,115200 mem=64M"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
 CONFIG_NET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
@@ -38,18 +34,22 @@ CONFIG_FB=y
 CONFIG_FB_PXA=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_CPU=y
 CONFIG_EXT2_FS=y
 CONFIG_MSDOS_FS=y
 CONFIG_JFFS2_FS=y
 CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_ISO8859_1=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
 CONFIG_DEBUG_KERNEL=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 228d4271748b3b00ca59c980c735c2912aa5220b..d1e83b52e03a54bdafa84c8aff699e315370f791 100644 (file)
@@ -1,22 +1,18 @@
 CONFIG_SYSVIPC=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=18
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_KALLSYMS_ALL=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
-CONFIG_MACH_LITTLETON=y
-CONFIG_MACH_TAVOREVB=y
-CONFIG_MACH_SAAR=y
-CONFIG_PREEMPT=y
+CONFIG_MACH_PXA3XX_DT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=64M debug"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -31,11 +27,11 @@ CONFIG_IP_PNP=y
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
-CONFIG_MTD_RAW_NAND=y
-CONFIG_MTD_NAND_MARVELL=y
 CONFIG_MTD_ONENAND=y
 CONFIG_MTD_ONENAND_VERIFY_WRITE=y
 CONFIG_MTD_ONENAND_GENERIC=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_NAND_MARVELL=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
 CONFIG_NETDEVICES=y
@@ -45,12 +41,10 @@ CONFIG_SMC91X=y
 # CONFIG_KEYBOARD_ATKBD is not set
 CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_PXA27x=y
-CONFIG_KEYBOARD_PXA930_ROTARY=y
-CONFIG_MOUSE_PXA930_TRKBALL=y
 CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 # CONFIG_I2C_HELPER_AUTO is not set
@@ -61,7 +55,6 @@ CONFIG_GPIO_MAX732X=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_PCF857X=y
 CONFIG_GPIO_MAX7301=y
-CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_SUPPLY_DEBUG=y
 CONFIG_PDA_POWER=y
 CONFIG_BATTERY_DA9030=y
@@ -79,8 +72,6 @@ CONFIG_BACKLIGHT_DA903X=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
-CONFIG_FONTS=y
-CONFIG_FONT_6x11=y
 CONFIG_LOGO=y
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
@@ -106,9 +97,11 @@ CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS=y
+CONFIG_FONTS=y
+CONFIG_FONT_6x11=y
 CONFIG_PRINTK_TIME=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_SHIRQ=y
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
 # CONFIG_SCHED_DEBUG is not set
index b21196372158d6c5c7eb29d9387eb408b9c59963..5072bde71508cd7ba56aec6d7833bc26d57f653d 100644 (file)
@@ -1,23 +1,21 @@
 CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
+CONFIG_ARCH_MMP=y
+CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M earlyprintk"
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
-CONFIG_ARCH_MMP=y
 CONFIG_MACH_TAVOREVB=y
 CONFIG_MACH_TTC_DKB=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.2.100:/nfsroot/ ip=192.168.2.101:192.168.2.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M earlyprintk"
 CONFIG_FPE_NWFPE=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -34,9 +32,12 @@ CONFIG_SMC91X=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
 CONFIG_SPI=y
+# CONFIG_HWMON is not set
 CONFIG_FB=y
 CONFIG_MMP_DISP=y
 CONFIG_MMP_DISP_CONTROLLER=y
@@ -44,9 +45,6 @@ CONFIG_MMP_SPI=y
 CONFIG_MMP_PANEL_TPOHVGA=y
 CONFIG_MMP_FB=y
 CONFIG_LOGO=y
-# CONFIG_LEGACY_PTYS is not set
-# CONFIG_HW_RANDOM is not set
-# CONFIG_HWMON is not set
 # CONFIG_VGA_CONSOLE is not set
 # CONFIG_USB_SUPPORT is not set
 CONFIG_TMPFS=y
@@ -57,14 +55,14 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
+CONFIG_CRC_CCITT=y
 CONFIG_PRINTK_TIME=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_PREEMPT is not set
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_MMP_UART2=y
 CONFIG_EARLY_PRINTK=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRC_CCITT=y
index 1db70dfd32d23de815b85cdac9de227ade466c9e..104a45722799933cf4726b8f1fc6c3b12bc33296 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_POSIX_MQUEUE=y
 CONFIG_FHANDLE=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_IKCONFIG=y
@@ -11,81 +12,16 @@ CONFIG_LOG_BUF_SHIFT=13
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
-CONFIG_SLOB=y
 CONFIG_PROFILING=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_FORCE_LOAD=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_LDM_PARTITION=y
-CONFIG_CMDLINE_PARTITION=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
-CONFIG_ARCH_LUBBOCK=y
-CONFIG_MACH_MAINSTONE=y
-CONFIG_MACH_ZYLONITE300=y
-CONFIG_MACH_ZYLONITE320=y
-CONFIG_MACH_LITTLETON=y
-CONFIG_MACH_TAVOREVB=y
-CONFIG_MACH_SAAR=y
-CONFIG_ARCH_PXA_IDP=y
-CONFIG_ARCH_VIPER=y
-CONFIG_MACH_ARCOM_ZEUS=y
-CONFIG_MACH_BALLOON3=y
-CONFIG_MACH_CSB726=y
-CONFIG_CSB726_CSB701=y
-CONFIG_MACH_EXEDA=y
-CONFIG_MACH_CM_X300=y
-CONFIG_MACH_CAPC7117=y
 CONFIG_ARCH_GUMSTIX=y
-CONFIG_MACH_XCEP=y
-CONFIG_TRIZEPS_PXA=y
-CONFIG_MACH_TRIZEPS4WL=y
-CONFIG_MACH_LOGICPD_PXA270=y
-CONFIG_MACH_PCM027=y
-CONFIG_MACH_PCM990_BASEBOARD=y
-CONFIG_MACH_COLIBRI=y
-CONFIG_MACH_COLIBRI_PXA270_INCOME=y
-CONFIG_MACH_COLIBRI300=y
-CONFIG_MACH_COLIBRI320=y
-CONFIG_MACH_COLIBRI_EVALBOARD=y
-CONFIG_MACH_VPAC270=y
-CONFIG_MACH_H4700=y
-CONFIG_MACH_H5000=y
-CONFIG_MACH_HIMALAYA=y
-CONFIG_MACH_MAGICIAN=y
-CONFIG_MACH_MIOA701=y
-CONFIG_PXA_EZX=y
-CONFIG_MACH_MP900C=y
-CONFIG_ARCH_PXA_PALM=y
 CONFIG_PXA_SHARPSL=y
-CONFIG_MACH_POODLE=y
-CONFIG_MACH_CORGI=y
-CONFIG_MACH_SHEPHERD=y
-CONFIG_MACH_HUSKY=y
 CONFIG_MACH_AKITA=y
 CONFIG_MACH_BORZOI=y
-CONFIG_MACH_TOSA=y
-CONFIG_TOSA_BT=m
-CONFIG_TOSA_USE_EXT_KEYCODES=y
-CONFIG_MACH_ICONTROL=y
-CONFIG_ARCH_PXA_ESERIES=y
-CONFIG_MACH_ZIPIT2=y
-CONFIG_PCI=y
-CONFIG_PCI_MSI=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCCARD=m
-CONFIG_YENTA=m
-CONFIG_PCMCIA_PXA2XX=m
-CONFIG_PREEMPT=y
+CONFIG_PXA_SYSTEMS_CPLDS=y
 CONFIG_AEABI=y
-# CONFIG_COMPACTION is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_FORCE_MAX_ZONEORDER=9
 CONFIG_CMDLINE="root=/dev/ram0 ro"
 CONFIG_KEXEC=y
 CONFIG_CPU_FREQ=y
@@ -98,7 +34,24 @@ CONFIG_CPUFREQ_DT=m
 CONFIG_ARM_PXA2xx_CPUFREQ=m
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_CPUIDLE=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_CRYPTO_SHA1_ARM=m
+CONFIG_CRYPTO_SHA256_ARM=m
+CONFIG_CRYPTO_SHA512_ARM=m
+CONFIG_CRYPTO_AES_ARM=m
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_FORCE_LOAD=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_LDM_PARTITION=y
+CONFIG_CMDLINE_PARTITION=y
 CONFIG_BINFMT_MISC=y
+CONFIG_SLOB=y
+# CONFIG_COMPACTION is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -116,16 +69,6 @@ CONFIG_BRIDGE=m
 CONFIG_VLAN_8021Q=m
 CONFIG_IEEE802154=y
 CONFIG_DNS_RESOLVER=y
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_ULTRA=y
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-CONFIG_IRDA_DEBUG=y
-CONFIG_IRTTY_SIR=m
-CONFIG_PXA_FICP=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
@@ -152,51 +95,60 @@ CONFIG_MAC80211=m
 CONFIG_RFKILL=y
 CONFIG_RFKILL_INPUT=y
 CONFIG_RFKILL_GPIO=m
+CONFIG_PCI=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCI_MSI=y
+CONFIG_PCCARD=m
+CONFIG_YENTA=m
+CONFIG_PCMCIA_PXA2XX=m
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_CONNECTOR=y
+CONFIG_MTD=y
+CONFIG_MTD_AR7_PARTS=m
+CONFIG_MTD_CMDLINE_PARTS=m
+CONFIG_MTD_OF_PARTS=m
+CONFIG_MTD_AFS_PARTS=m
 CONFIG_MTD_REDBOOT_PARTS=m
 CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=0
 CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
 CONFIG_MTD_REDBOOT_PARTS_READONLY=y
-CONFIG_MTD_CMDLINE_PARTS=m
-CONFIG_MTD_AFS_PARTS=m
-CONFIG_MTD_OF_PARTS=m
-CONFIG_MTD_AR7_PARTS=m
 CONFIG_MTD_BLOCK=m
 CONFIG_NFTL=m
 CONFIG_NFTL_RW=y
+CONFIG_MTD_CFI=y
 CONFIG_MTD_JEDECPROBE=m
 CONFIG_MTD_CFI_ADV_OPTIONS=y
 CONFIG_MTD_CFI_LE_BYTE_SWAP=y
 CONFIG_MTD_CFI_GEOMETRY=y
 CONFIG_MTD_OTP=y
+CONFIG_MTD_CFI_INTELEXT=y
 CONFIG_MTD_CFI_AMDSTD=m
 CONFIG_MTD_CFI_STAA=m
 CONFIG_MTD_RAM=m
 CONFIG_MTD_ROM=m
 CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PXA2XX=m
 CONFIG_MTD_M25P80=m
 CONFIG_MTD_BLOCK2MTD=y
 CONFIG_MTD_DOCG3=m
+CONFIG_MTD_ONENAND=m
+CONFIG_MTD_ONENAND_VERIFY_WRITE=y
+CONFIG_MTD_ONENAND_GENERIC=m
 CONFIG_MTD_RAW_NAND=m
-CONFIG_MTD_NAND_ECC_SW_BCH=y
+CONFIG_MTD_NAND_SHARPSL=m
+CONFIG_MTD_NAND_TMIO=m
+CONFIG_MTD_NAND_BRCMNAND=m
 CONFIG_MTD_NAND_GPIO=m
+CONFIG_MTD_NAND_PLATFORM=m
 CONFIG_MTD_NAND_DISKONCHIP=m
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED=y
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0x4000000
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_HIGH=y
 CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE=y
-CONFIG_MTD_NAND_SHARPSL=m
-CONFIG_MTD_NAND_MARVELL=m
 CONFIG_MTD_NAND_CM_X270=m
-CONFIG_MTD_NAND_TMIO=m
-CONFIG_MTD_NAND_BRCMNAND=m
-CONFIG_MTD_NAND_PLATFORM=m
-CONFIG_MTD_ONENAND=m
-CONFIG_MTD_ONENAND_VERIFY_WRITE=y
-CONFIG_MTD_ONENAND_GENERIC=m
+CONFIG_MTD_NAND_ECC_SW_BCH=y
 CONFIG_MTD_SPI_NOR=m
 CONFIG_MTD_UBI=m
 CONFIG_MTD_UBI_BLOCK=y
@@ -210,8 +162,6 @@ CONFIG_AD525X_DPOT_I2C=m
 CONFIG_ICS932S401=m
 CONFIG_APDS9802ALS=m
 CONFIG_ISL29003=m
-CONFIG_IIO=m
-CONFIG_AD5446=m
 CONFIG_EEPROM_AT24=m
 CONFIG_SENSORS_LIS3_SPI=m
 CONFIG_SCSI=y
@@ -242,13 +192,13 @@ CONFIG_SMC91X=m
 CONFIG_SMSC911X=m
 CONFIG_STMMAC_ETH=m
 CONFIG_PHYLIB=y
-CONFIG_AT803X_PHY=m
-CONFIG_MARVELL_PHY=m
 CONFIG_SMSC_PHY=m
 CONFIG_BROADCOM_PHY=y
 CONFIG_ICPLUS_PHY=m
 CONFIG_MICREL_PHY=m
 CONFIG_FIXED_PHY=m
+CONFIG_MARVELL_PHY=m
+CONFIG_AT803X_PHY=m
 CONFIG_MDIO_BITBANG=y
 CONFIG_PPP=m
 CONFIG_PPP_BSDCOMP=m
@@ -272,16 +222,16 @@ CONFIG_HOSTAP=m
 CONFIG_HOSTAP_FIRMWARE=y
 CONFIG_HOSTAP_FIRMWARE_NVRAM=y
 CONFIG_HOSTAP_CS=m
-CONFIG_LIBERTAS=m
-CONFIG_LIBERTAS_SDIO=m
 CONFIG_HERMES=m
 CONFIG_PCMCIA_HERMES=m
 CONFIG_PCMCIA_SPECTRUM=m
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_SDIO=m
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
 CONFIG_RT2X00=m
 CONFIG_RT73USB=m
 CONFIG_RT2800USB=m
-CONFIG_MWIFIEX=m
-CONFIG_MWIFIEX_SDIO=m
 CONFIG_INPUT_FF_MEMLESS=m
 CONFIG_INPUT_MATRIXKMAP=y
 CONFIG_INPUT_MOUSEDEV=m
@@ -294,14 +244,12 @@ CONFIG_KEYBOARD_ATKBD=m
 CONFIG_KEYBOARD_QT1070=m
 CONFIG_KEYBOARD_GPIO=m
 CONFIG_KEYBOARD_PXA27x=m
-CONFIG_KEYBOARD_PXA930_ROTARY=m
 CONFIG_KEYBOARD_CROS_EC=m
 CONFIG_MOUSE_PS2=m
 CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_MOUSE_SERIAL=m
 CONFIG_MOUSE_CYAPA=m
 CONFIG_MOUSE_ELAN_I2C=m
-CONFIG_MOUSE_PXA930_TRKBALL=m
 CONFIG_MOUSE_NAVPOINT_PXA27x=m
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ADS7846=m
@@ -312,12 +260,9 @@ CONFIG_TOUCHSCREEN_FUJITSU=m
 CONFIG_TOUCHSCREEN_ELO=m
 CONFIG_TOUCHSCREEN_MTOUCH=m
 CONFIG_TOUCHSCREEN_INEXIO=m
-CONFIG_TOUCHSCREEN_HTCPEN=m
 CONFIG_TOUCHSCREEN_PENMOUNT=m
 CONFIG_TOUCHSCREEN_TOUCHRIGHT=m
 CONFIG_TOUCHSCREEN_TOUCHWIN=m
-CONFIG_TOUCHSCREEN_UCB1400=m
-CONFIG_TOUCHSCREEN_WM97XX=m
 CONFIG_TOUCHSCREEN_TOUCHIT213=m
 CONFIG_TOUCHSCREEN_PCAP=m
 CONFIG_TOUCHSCREEN_ST1232=m
@@ -328,7 +273,6 @@ CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
 CONFIG_INPUT_PCAP=m
 CONFIG_INPUT_ADXL34X=m
 CONFIG_SERIO=m
-CONFIG_SERIO_SA1111=m
 CONFIG_LEGACY_PTY_COUNT=8
 CONFIG_SERIAL_8250=m
 CONFIG_SERIAL_8250_CS=m
@@ -341,6 +285,7 @@ CONFIG_I2C_CHARDEV=m
 CONFIG_I2C_MUX_PCA954x=m
 CONFIG_I2C_MUX_PINCTRL=m
 CONFIG_I2C_DESIGNWARE_PLATFORM=m
+CONFIG_I2C_GPIO=y
 CONFIG_I2C_PXA_SLAVE=y
 CONFIG_I2C_XILINX=m
 CONFIG_I2C_CROS_EC_TUNNEL=m
@@ -354,16 +299,17 @@ CONFIG_SPI_XILINX=m
 CONFIG_SPI_SPIDEV=m
 CONFIG_PPS=y
 CONFIG_DEBUG_GPIO=y
+CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_DWAPB=m
 CONFIG_GPIO_GENERIC_PLATFORM=m
 CONFIG_GPIO_MAX732X=m
 CONFIG_GPIO_PCA953X=m
 CONFIG_GPIO_PCF857X=m
+CONFIG_HTC_EGPIO=y
 CONFIG_GPIO_PALMAS=y
 CONFIG_GPIO_TPS6586X=y
 CONFIG_GPIO_TPS65910=y
 CONFIG_GPIO_MAX7301=m
-CONFIG_GPIO_SYSFS=y
 CONFIG_POWER_SUPPLY_DEBUG=y
 CONFIG_PDA_POWER=m
 CONFIG_BATTERY_SBS=m
@@ -387,13 +333,8 @@ CONFIG_MFD_AS3711=y
 CONFIG_MFD_BCM590XX=m
 CONFIG_MFD_AXP20X=y
 CONFIG_MFD_CROS_EC_DEV=m
-CONFIG_CHROME_PLATFORMS=y
-CONFIG_CROS_EC=m
-CONFIG_CROS_EC_I2C=m
-CONFIG_CROS_EC_SPI=m
 CONFIG_MFD_ASIC3=y
 CONFIG_PMIC_DA903X=y
-CONFIG_HTC_EGPIO=y
 CONFIG_HTC_PASIC3=m
 CONFIG_MFD_MAX14577=y
 CONFIG_MFD_MAX77693=y
@@ -441,11 +382,13 @@ CONFIG_VIDEO_V4L2_SUBDEV_API=y
 CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_VIDEO_PXA27x=m
 CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_PXA27x=m
 CONFIG_DRM=m
+CONFIG_FB=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_TILEBLITTING=y
+CONFIG_FB_PXA=y
 CONFIG_FB_PXA_OVERLAY=y
 CONFIG_FB_PXA_PARAMETERS=y
 CONFIG_PXA3XX_GCU=m
@@ -462,31 +405,20 @@ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 CONFIG_LOGO=y
 CONFIG_SOUND=m
 CONFIG_SND=m
-CONFIG_SND_SEQUENCER=m
 CONFIG_SND_MIXER_OSS=m
 CONFIG_SND_PCM_OSS=m
 CONFIG_SND_DYNAMIC_MINORS=y
 CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
+CONFIG_SND_SEQUENCER=m
 CONFIG_SND_USB_AUDIO=m
 CONFIG_SND_SOC=m
 CONFIG_SND_ATMEL_SOC=m
 CONFIG_SND_PXA2XX_SOC=m
-CONFIG_SND_PXA2XX_SOC_CORGI=m
+CONFIG_SND_PXA_SOC_SSP=m
 CONFIG_SND_PXA2XX_SOC_SPITZ=m
-CONFIG_SND_PXA2XX_SOC_Z2=m
-CONFIG_SND_PXA2XX_SOC_POODLE=m
-CONFIG_SND_PXA2XX_SOC_TOSA=m
-CONFIG_SND_PXA2XX_SOC_E740=m
-CONFIG_SND_PXA2XX_SOC_E750=m
-CONFIG_SND_PXA2XX_SOC_E800=m
-CONFIG_SND_PXA2XX_SOC_EM_X270=m
-CONFIG_SND_PXA2XX_SOC_PALM27X=y
-CONFIG_SND_SOC_ZYLONITE=m
-CONFIG_SND_PXA2XX_SOC_HX4700=m
-CONFIG_SND_PXA2XX_SOC_MAGICIAN=m
-CONFIG_SND_PXA2XX_SOC_MIOA701=m
 CONFIG_SND_SOC_AK4642=m
+CONFIG_SND_SOC_WM8731_I2C=m
 CONFIG_SND_SOC_WM8978=m
 CONFIG_SND_SIMPLE_CARD=m
 CONFIG_SOUND_PRIME=m
@@ -575,6 +507,7 @@ CONFIG_USB_LCD=m
 CONFIG_USB_CYTHERM=m
 CONFIG_USB_IDMOUSE=m
 CONFIG_USB_GPIO_VBUS=y
+CONFIG_USB_GPIO_VBUS=m
 CONFIG_USB_ISP1301=m
 CONFIG_USB_GADGET=m
 CONFIG_USB_GADGET_VBUS_DRAW=500
@@ -621,9 +554,9 @@ CONFIG_RTC_DRV_DS1307=m
 CONFIG_RTC_DRV_MAX8907=m
 CONFIG_RTC_DRV_RS5C372=m
 CONFIG_RTC_DRV_ISL1208=m
-CONFIG_RTC_DRV_PALMAS=m
 CONFIG_RTC_DRV_PCF8563=m
 CONFIG_RTC_DRV_PCF8583=m
+CONFIG_RTC_DRV_PALMAS=m
 CONFIG_RTC_DRV_TPS6586X=m
 CONFIG_RTC_DRV_TPS65910=m
 CONFIG_RTC_DRV_S35390A=m
@@ -638,10 +571,16 @@ CONFIG_PXA_DMA=y
 CONFIG_DW_DMAC=m
 CONFIG_UIO=y
 CONFIG_CROS_EC_CHARDEV=m
+CONFIG_CHROME_PLATFORMS=y
+CONFIG_CROS_EC=m
+CONFIG_CROS_EC_I2C=m
+CONFIG_CROS_EC_SPI=m
 CONFIG_COMMON_CLK_S2MPS11=m
 CONFIG_PM_DEVFREQ=y
 CONFIG_EXTCON=y
 CONFIG_MEMORY=y
+CONFIG_IIO=m
+CONFIG_AD5446=m
 CONFIG_PWM=y
 CONFIG_PWM_PXA=m
 CONFIG_PHY_SAMSUNG_USB2=m
@@ -707,17 +646,8 @@ CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_PRINTK_TIME=y
-CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
-CONFIG_FRAME_WARN=0
-CONFIG_STRIP_ASM_SYMS=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_SHIRQ=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_TIMER_STATS=y
-CONFIG_FUNCTION_TRACER=y
-CONFIG_FTRACE_SYSCALLS=y
-CONFIG_DEBUG_USER=y
 CONFIG_SECURITY=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_CRYPTD=m
@@ -743,11 +673,6 @@ CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
-CONFIG_ARM_CRYPTO=y
-CONFIG_CRYPTO_SHA1_ARM=m
-CONFIG_CRYPTO_SHA256_ARM=m
-CONFIG_CRYPTO_SHA512_ARM=m
-CONFIG_CRYPTO_AES_ARM=m
 CONFIG_CRC_CCITT=y
 CONFIG_CRC_T10DIF=m
 CONFIG_FONTS=y
@@ -755,3 +680,11 @@ CONFIG_FONT_8x8=y
 CONFIG_FONT_8x16=y
 CONFIG_FONT_6x11=y
 CONFIG_FONT_MINI_4x6=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_FRAME_WARN=0
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_FUNCTION_TRACER=y
+CONFIG_FTRACE_SYSCALLS=y
index 5cd935ee148aaad5b3f17d616bb44416d62cde2d..8a59441701a80f96256bd334819427b0c7de5b97 100644 (file)
@@ -1,39 +1,38 @@
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_ARCH_QCOM=y
 CONFIG_ARCH_MSM8X60=y
 CONFIG_ARCH_MSM8960=y
 CONFIG_ARCH_MSM8974=y
 CONFIG_ARCH_MDM9615=y
-CONFIG_PCI=y
-CONFIG_PCI_MSI=y
-CONFIG_PCIE_QCOM=y
 CONFIG_SMP=y
-CONFIG_PREEMPT=y
+CONFIG_ARM_PSCI=y
 CONFIG_HIGHMEM=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPUFREQ_DT=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_PARTITION_ADVANCED=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_COMPAT_BRK is not set
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -56,15 +55,18 @@ CONFIG_BT_HCIUART_BCM=y
 CONFIG_CFG80211=m
 CONFIG_MAC80211=m
 CONFIG_RFKILL=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCIE_QCOM=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_MTD=y
+CONFIG_MTD_QCOMSMEM_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_M25P80=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NOR=y
-CONFIG_MTD_QCOMSMEM_PARTS=y
 CONFIG_MTD_UBI=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
@@ -133,10 +135,10 @@ CONFIG_PINCTRL_MSM8660=y
 CONFIG_PINCTRL_MSM8960=y
 CONFIG_PINCTRL_MDM9615=y
 CONFIG_PINCTRL_MSM8X74=y
-CONFIG_PINCTRL_SDX55=y
 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
 CONFIG_PINCTRL_QCOM_SSBI_PMIC=y
 CONFIG_GPIOLIB=y
+CONFIG_PINCTRL_SDX55=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_MSM=y
@@ -144,15 +146,17 @@ CONFIG_CHARGER_QCOM_SMBB=y
 CONFIG_CHARGER_BQ24190=m
 CONFIG_THERMAL=y
 CONFIG_QCOM_TSENS=y
+CONFIG_WATCHDOG=y
+CONFIG_QCOM_WDT=y
 CONFIG_MFD_PM8XXX=y
 CONFIG_MFD_QCOM_RPM=y
 CONFIG_MFD_SPMI_PMIC=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_QCOM_RPM=y
+CONFIG_REGULATOR_QCOM_RPMH=y
 CONFIG_REGULATOR_QCOM_SMD_RPM=y
 CONFIG_REGULATOR_QCOM_SPMI=y
-CONFIG_REGULATOR_QCOM_RPMH=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_DRM=y
 CONFIG_DRM_MSM=m
@@ -160,11 +164,11 @@ CONFIG_DRM_PANEL_SIMPLE=y
 CONFIG_DRM_PANEL_EDP=y
 CONFIG_DRM_ANALOGIX_ANX78XX=m
 CONFIG_FB=y
-CONFIG_FRAMEBUFFER_CONSOLE=y
 # CONFIG_LCD_CLASS_DEVICE is not set
 CONFIG_BACKLIGHT_CLASS_DEVICE=y
 CONFIG_BACKLIGHT_LM3630A=y
 CONFIG_BACKLIGHT_LP855X=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_DYNAMIC_MINORS=y
@@ -180,6 +184,7 @@ CONFIG_USB_MON=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MSM=y
 CONFIG_USB_ACM=y
+CONFIG_USB_DWC3=y
 CONFIG_USB_CHIPIDEA=y
 CONFIG_USB_CHIPIDEA_UDC=y
 CONFIG_USB_CHIPIDEA_HOST=y
@@ -196,7 +201,6 @@ CONFIG_USB_CONFIGFS_ECM=y
 CONFIG_USB_CONFIGFS_F_FS=y
 CONFIG_USB_ULPI_BUS=y
 CONFIG_USB_ETH=m
-CONFIG_USB_DWC3=y
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK_MINORS=32
 CONFIG_MMC_ARMMMCI=y
@@ -218,8 +222,8 @@ CONFIG_COMMON_CLK_QCOM=y
 CONFIG_QCOM_A7PLL=y
 CONFIG_QCOM_CLK_APCS_SDX55=y
 CONFIG_QCOM_CLK_RPM=y
-CONFIG_QCOM_CLK_RPMH=y
 CONFIG_QCOM_CLK_SMD_RPM=y
+CONFIG_QCOM_CLK_RPMH=y
 CONFIG_APQ_MMCC_8084=y
 CONFIG_IPQ_GCC_4019=y
 CONFIG_IPQ_LCC_806X=y
@@ -229,12 +233,12 @@ CONFIG_MDM_LCC_9615=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_SDX_GCC_55=y
-CONFIG_MSM_IOMMU=y
-CONFIG_ARM_SMMU=y
 CONFIG_HWSPINLOCK=y
 CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_MAILBOX=y
 CONFIG_QCOM_APCS_IPC=y
+CONFIG_MSM_IOMMU=y
+CONFIG_ARM_SMMU=y
 CONFIG_REMOTEPROC=y
 CONFIG_QCOM_ADSP_PIL=y
 CONFIG_QCOM_Q6V5_PAS=y
@@ -247,12 +251,12 @@ CONFIG_QCOM_COMMAND_DB=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_OCMEM=y
 CONFIG_QCOM_PM=y
+CONFIG_QCOM_RPMH=y
+CONFIG_QCOM_RPMHPD=y
 CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_SMD_RPM=y
 CONFIG_QCOM_SMP2P=y
 CONFIG_QCOM_SMSM=y
-CONFIG_QCOM_RPMH=y
-CONFIG_QCOM_RPMHPD=y
 CONFIG_QCOM_WCNSS_CTRL=y
 CONFIG_EXTCON_QCOM_SPMI_MISC=y
 CONFIG_IIO=y
@@ -270,10 +274,10 @@ CONFIG_BMP280=y
 CONFIG_PWM=y
 CONFIG_PHY_QCOM_APQ8064_SATA=y
 CONFIG_PHY_QCOM_IPQ806X_SATA=y
-CONFIG_PHY_QCOM_USB_HS=y
-CONFIG_PHY_QCOM_USB_HSIC=y
 CONFIG_PHY_QCOM_QMP=y
+CONFIG_PHY_QCOM_USB_HS=y
 CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=y
+CONFIG_PHY_QCOM_USB_HSIC=y
 CONFIG_QCOM_QFPROM=y
 CONFIG_INTERCONNECT=y
 CONFIG_INTERCONNECT_QCOM=y
@@ -299,19 +303,15 @@ CONFIG_CRYPTO_USER=m
 CONFIG_CRYPTO_USER_API=m
 CONFIG_CRYPTO_USER_API_HASH=m
 CONFIG_CRYPTO_USER_API_SKCIPHER=m
-CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_CRYPTO_USER_API_RNG=m
+CONFIG_CRYPTO_USER_API_AEAD=m
 CONFIG_CRYPTO_DEV_QCOM_RNG=m
 CONFIG_DMA_CMA=y
 CONFIG_CMA_SIZE_MBYTES=64
 CONFIG_PRINTK_TIME=y
 CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
+# CONFIG_SLUB_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
-CONFIG_WATCHDOG=y
-CONFIG_QCOM_WDT=y
-CONFIG_ARM_PSCI=y
-CONFIG_CPU_FREQ=y
-CONFIG_CPUFREQ_DT=y
index 3ef3521c19dbb7868c1dfae4d6c5580d20195f70..92f803c2805c3673ca0dd87ea4c8289a5cd832ba 100644 (file)
@@ -1,10 +1,8 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_FULL=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_PERF_EVENTS=y
-CONFIG_SLAB=y
 CONFIG_ARCH_MULTI_V6=y
 CONFIG_ARCH_REALVIEW=y
 CONFIG_MACH_REALVIEW_EB=y
@@ -21,7 +19,8 @@ CONFIG_CMDLINE="root=/dev/nfs nfsroot=10.1.69.3:/work/nfsroot ip=dhcp console=tt
 CONFIG_VFP=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -43,6 +42,7 @@ CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NETDEVICES=y
 CONFIG_SMC91X=y
 CONFIG_SMSC911X=y
@@ -95,9 +95,9 @@ CONFIG_NFS_FS=y
 CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
index c090643b1ecbc11c6305d8ee5c1f97b29939bfe2..16d74a1f027a6d2d1b61398f0064c9255cea9802 100644 (file)
@@ -2,16 +2,15 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ARCH_RPC=y
 CONFIG_CPU_SA110=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -33,6 +32,7 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=m
 CONFIG_BLK_DEV_SR=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_LOGGING=y
 CONFIG_SCSI_ARXESCSI=m
@@ -55,12 +55,12 @@ CONFIG_INPUT_EVDEV=y
 # CONFIG_MOUSE_PS2 is not set
 CONFIG_MOUSE_RISCPC=y
 # CONFIG_SERIO_SERPORT is not set
+CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=16
 CONFIG_SERIAL_8250_RUNTIME_UARTS=8
 CONFIG_SERIAL_8250_ACORN=y
-CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_PRINTER=m
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
@@ -69,9 +69,6 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_FB=y
 CONFIG_FB_ACORN=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x16=y
-CONFIG_FONT_ACORN_8x8=y
 CONFIG_LOGO=y
 CONFIG_SOUND=m
 CONFIG_SOUND_PRIME=m
@@ -89,10 +86,8 @@ CONFIG_MSDOS_FS=m
 CONFIG_VFAT_FS=m
 CONFIG_ADFS_FS=y
 CONFIG_NFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
 # CONFIG_ACORN_PARTITION_CUMANA is not set
 # CONFIG_ACORN_PARTITION_EESOX is not set
-CONFIG_BSD_DISKLABEL=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_737=m
 CONFIG_NLS_CODEPAGE_775=m
@@ -120,8 +115,11 @@ CONFIG_NLS_ISO8859_6=m
 CONFIG_NLS_ISO8859_7=m
 CONFIG_NLS_ISO8859_9=m
 CONFIG_NLS_KOI8_R=m
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_FONT_ACORN_8x8=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
 CONFIG_DEBUG_LL_UART_8250=y
index 12fa6ca14dcc6d7c34e6b3825bfa9d58042986fd..41b40863a78ea2246d4835715740fc459234e09a 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_IKCONFIG=m
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
 CONFIG_ARCH_MULTI_V4T=y
 CONFIG_ARCH_MULTI_V5=y
 # CONFIG_ARCH_MULTI_V7 is not set
@@ -38,18 +37,17 @@ CONFIG_ARCH_S3C2440=y
 CONFIG_MACH_NEO1973_GTA02=y
 CONFIG_MACH_RX1950=y
 CONFIG_MACH_SMDK2443=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0"
 CONFIG_FPE_NWFPE=y
 CONFIG_FPE_NWFPE_XP=y
 CONFIG_APM_EMULATION=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_BSD_DISKLABEL=y
 CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -206,6 +204,7 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=m
 CONFIG_BLK_DEV_SR=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_CHR_DEV_SCH=m
 CONFIG_SCSI_CONSTANTS=y
 CONFIG_SCSI_SCAN_ASYNC=y
@@ -252,7 +251,6 @@ CONFIG_INPUT_YEALINK=m
 CONFIG_INPUT_CM109=m
 CONFIG_INPUT_UINPUT=m
 CONFIG_INPUT_GPIO_ROTARY_ENCODER=m
-CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=8
@@ -261,6 +259,7 @@ CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_SAMSUNG=y
 CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_DEV_BUS=m
 CONFIG_PRINTER=y
 CONFIG_PPDEV=y
@@ -430,9 +429,9 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-CONFIG_DEBUG_INFO=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_MUTEXES=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 59a258d504aa5b4b93aefdce83e7ccb378d6d506..4f04f583c738988c7b8370cd8e43f3cf159f3f5e 100644 (file)
@@ -5,15 +5,6 @@ CONFIG_KALLSYMS_ALL=y
 CONFIG_ARCH_MULTI_V6=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_S3C64XX=y
-CONFIG_MACH_SMDK6400=y
-CONFIG_MACH_ANW6410=y
-CONFIG_MACH_MINI6410=y
-CONFIG_MACH_REAL6410=y
-CONFIG_MACH_SMDK6410=y
-CONFIG_MACH_NCP=y
-CONFIG_MACH_HMT=y
-CONFIG_MACH_SMARTQ5=y
-CONFIG_MACH_SMARTQ7=y
 CONFIG_MACH_WLF_CRAGG_6410=y
 CONFIG_CMDLINE="console=ttySAC0,115200 root=/dev/ram init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144"
 CONFIG_VFP=y
@@ -71,9 +62,9 @@ CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 CONFIG_CRAMFS=y
 CONFIG_ROMFS_FS=y
-CONFIG_DEBUG_INFO=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_RT_MUTEXES=y
 CONFIG_DEBUG_SPINLOCK=y
 CONFIG_DEBUG_MUTEXES=y
index 70919716f8155c26776b366a6cb3a24d45f1206f..789e900a8a08e608dfc355f3895f0172fde75c6c 100644 (file)
@@ -21,7 +21,6 @@ CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
 CONFIG_BSD_DISKLABEL=y
 CONFIG_SOLARIS_X86_PARTITION=y
@@ -48,6 +47,7 @@ CONFIG_BLK_DEV_RAM_SIZE=8192
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_SG=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NETDEVICES=y
 CONFIG_BRCMFMAC=m
 CONFIG_INPUT_EVDEV=y
@@ -115,9 +115,9 @@ CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
 CONFIG_CRC_CCITT=y
-CONFIG_DEBUG_INFO=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_PREEMPT is not set
 CONFIG_DEBUG_RT_MUTEXES=y
 CONFIG_DEBUG_SPINLOCK=y
index 18852803522e5404fc30044ad0d3eec217fb0a6f..3a6a4851ef26cff605b7b46b0cfc5689f61ee439 100644 (file)
@@ -1,5 +1,4 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -7,7 +6,6 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EMBEDDED=y
-CONFIG_SLAB=y
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_SAMA5D2=y
 CONFIG_SOC_SAMA5D3=y
@@ -26,8 +24,9 @@ CONFIG_MODULES=y
 CONFIG_MODULE_FORCE_LOAD=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -72,6 +71,7 @@ CONFIG_ATMEL_SSC=y
 CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 CONFIG_NET_DSA_MICROCHIP_KSZ9477=m
@@ -152,11 +152,11 @@ CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_ATMEL_ISC=y
 CONFIG_VIDEO_ATMEL_ISI=y
+CONFIG_VIDEO_MT9V032=m
 CONFIG_VIDEO_OV2640=m
 CONFIG_VIDEO_OV5640=m
 CONFIG_VIDEO_OV7670=m
 CONFIG_VIDEO_OV7740=m
-CONFIG_VIDEO_MT9V032=m
 CONFIG_DRM=y
 CONFIG_DRM_ATMEL_HLCDC=y
 CONFIG_DRM_PANEL_SIMPLE=y
index 63302858b9c4553ae71d7e5554d03d8fcde8707d..0384030d8b25a263d003302fd4c8ca65b4c75a65 100644 (file)
@@ -1,5 +1,4 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -14,8 +13,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_IO_URING is not set
 CONFIG_KALLSYMS_ALL=y
 CONFIG_EMBEDDED=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-CONFIG_SLAB=y
 CONFIG_ARCH_AT91=y
 CONFIG_SOC_SAMA7G5=y
 CONFIG_ATMEL_CLOCKSOURCE_TCB=y
@@ -43,8 +40,11 @@ CONFIG_MODULE_FORCE_UNLOAD=y
 CONFIG_PARTITION_ADVANCED=y
 # CONFIG_EFI_PARTITION is not set
 # CONFIG_COREDUMP is not set
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
 CONFIG_CMA=y
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -229,9 +229,9 @@ CONFIG_CRC_ITU_T=y
 CONFIG_DMA_CMA=y
 CONFIG_CMA_SIZE_MBYTES=32
 CONFIG_CMA_ALIGNMENT=9
+# CONFIG_DEBUG_MISC is not set
 # CONFIG_SECTION_MISMATCH_WARN_ONLY is not set
 CONFIG_DEBUG_FS=y
-# CONFIG_DEBUG_MISC is not set
 # CONFIG_SCHED_DEBUG is not set
 CONFIG_STACKTRACE=y
 # CONFIG_FTRACE is not set
index de33abdeb6fa6504c0a4f9eb1cbc278edd270b88..42252e85ee494ce652d85cd4192262da0cbdc42d 100644 (file)
@@ -1,20 +1,20 @@
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_SHANNON=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="console=ttySA0,9600 console=tty1 root=/dev/mtdblock2 init=/linuxrc"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
 CONFIG_INET=y
 # CONFIG_IPV6 is not set
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
 CONFIG_MTD=y
 CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
@@ -40,5 +40,4 @@ CONFIG_VFAT_FS=y
 CONFIG_JFFS2_FS=y
 CONFIG_MINIX_FS=y
 CONFIG_NFS_FS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_DEBUG_USER=y
index 362643cbeffdc539ce5e58945485a643dcfd09dd..a29bebb3742ed386a1374ee3160bf1c588ea4815 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_CGROUPS=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_PERF_EVENTS=y
-CONFIG_SLAB=y
 CONFIG_ARCH_RENESAS=y
 CONFIG_PL310_ERRATA_588369=y
 CONFIG_SMP=y
@@ -25,6 +24,7 @@ CONFIG_CPUFREQ_DT=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_SLAB=y
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -106,6 +106,7 @@ CONFIG_WATCHDOG=y
 CONFIG_DA9063_WATCHDOG=y
 CONFIG_RENESAS_WDT=y
 CONFIG_RENESAS_RZAWDT=y
+CONFIG_RENESAS_RZN1WDT=y
 CONFIG_MFD_AS3711=y
 CONFIG_MFD_DA9063=y
 CONFIG_MFD_STMPE=y
@@ -177,6 +178,7 @@ CONFIG_RTC_DRV_S35390A=y
 CONFIG_RTC_DRV_RX8581=y
 CONFIG_RTC_DRV_DA9063=y
 CONFIG_RTC_DRV_SH=y
+CONFIG_RTC_DRV_RZN1=y
 CONFIG_DMADEVICES=y
 CONFIG_RCAR_DMAC=y
 CONFIG_RENESAS_USB_DMAC=y
index 28d99d8895f94d35febe663c4b0b575c03f4dd83..cc451728f6d9b1ec33b11c35b27f7e056c410a6a 100644 (file)
@@ -1,20 +1,16 @@
 CONFIG_LOCALVERSION="oe1"
 CONFIG_SYSVIPC=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_MODULES=y
 CONFIG_ARCH_SA1100=y
 CONFIG_SA1100_SIMPAD=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_SA1100=y
-CONFIG_PREEMPT=y
-CONFIG_LEDS=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="mtdparts=sa1100:512k(boot),1m(kernel),-(root) console=ttySA0 root=1f02 noinitrd mem=64M jffs2_orphaned_inodes=delete rootfstype=jffs2"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
 CONFIG_BINFMT_MISC=m
 CONFIG_PM=y
 CONFIG_NET=y
@@ -25,18 +21,14 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_IRTTY_SIR=m
-CONFIG_SA1100_FIR=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
 CONFIG_BT_BNEP=m
 CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -56,19 +48,19 @@ CONFIG_DUMMY=y
 CONFIG_NET_ETHERNET=y
 CONFIG_NET_PCI=y
 CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
 CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_3C589=m
 CONFIG_PCMCIA_PCNET=m
 CONFIG_PCMCIA_SMC91C92=m
 CONFIG_PCMCIA_XIRC2PS=m
 CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_FILTER=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPPOE=m
 CONFIG_PPP_ASYNC=m
 CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPPOE=m
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=800
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=600
 CONFIG_INPUT_EVDEV=m
@@ -83,6 +75,8 @@ CONFIG_FB=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
 CONFIG_EXT2_FS=m
 CONFIG_EXT3_FS=m
 CONFIG_REISERFS_FS=m
index 2d9404ea52c6d25459124e5ad86b84d40eaaafad..d91ae3f0d6981c9503f54ebdc69202275f2e5cf5 100644 (file)
@@ -14,13 +14,10 @@ CONFIG_ARM_THUMBEE=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
 CONFIG_HIGHMEM=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -52,7 +49,6 @@ CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_DENALI_DT=y
 CONFIG_MTD_SPI_NOR=y
 # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
-CONFIG_SPI_CADENCE_QUADSPI=y
 CONFIG_OF_OVERLAY=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_RAM=y
@@ -64,6 +60,7 @@ CONFIG_EEPROM_AT24=y
 CONFIG_SCSI=y
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_NETDEVICES=y
 CONFIG_ALTERA_TSE=m
@@ -88,6 +85,7 @@ CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_SPI=y
+CONFIG_SPI_CADENCE_QUADSPI=y
 CONFIG_SPI_DESIGNWARE=y
 CONFIG_SPI_DW_MMIO=y
 CONFIG_SPI_SPIDEV=y
@@ -154,7 +152,7 @@ CONFIG_NFSD_V4=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_DETECT_HUNG_TASK=y
diff --git a/arch/arm/configs/sp7021_defconfig b/arch/arm/configs/sp7021_defconfig
new file mode 100644 (file)
index 0000000..703b9aa
--- /dev/null
@@ -0,0 +1,59 @@
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ_IDLE=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_RD_GZIP is not set
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+# CONFIG_RD_LZ4 is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_PERF_EVENTS=y
+CONFIG_SLAB=y
+CONFIG_ARCH_SUNPLUS=y
+# CONFIG_VDSO is not set
+CONFIG_SMP=y
+CONFIG_THUMB2_KERNEL=y
+CONFIG_FORCE_MAX_ZONEORDER=12
+CONFIG_VFP=y
+CONFIG_NEON=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_UEVENT_HELPER=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_INPUT_SPARSEKMAP=y
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_HWMON is not set
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_RESET_CONTROLLER=y
+CONFIG_EXT4_FS=y
+# CONFIG_DNOTIFY is not set
+CONFIG_FANOTIFY=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
+CONFIG_EXFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_UTF8=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DYNAMIC_DEBUG=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_USER=y
index 065553326b3915eec24efb92d50575f05b82ab24..0227dd566c28b2c3e2423fd0ab942d89629279fa 100644 (file)
@@ -1,18 +1,11 @@
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_PLAT_SPEAR=y
 CONFIG_ARCH_SPEAR13XX=y
 CONFIG_MACH_SPEAR1310=y
 CONFIG_MACH_SPEAR1340=y
 # CONFIG_SWP_EMULATE is not set
-CONFIG_PCI=y
-CONFIG_PCI_MSI=y
-CONFIG_PCIE_SPEAR13XX=y
 CONFIG_SMP=y
 # CONFIG_SMP_ON_UP is not set
 # CONFIG_ARM_CPU_TOPOLOGY is not set
@@ -20,6 +13,10 @@ CONFIG_AEABI=y
 CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_VFP=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=y
 CONFIG_NET=y
 CONFIG_UNIX=y
@@ -28,6 +25,9 @@ CONFIG_IP_PNP=y
 CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_NET_IPIP=y
+CONFIG_PCI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCIE_SPEAR13XX=y
 CONFIG_MTD=y
 CONFIG_MTD_OF_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -97,8 +97,8 @@ CONFIG_ROOT_NFS=y
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=m
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
index afca722d6605c57d99441b88f77533c1c9a8b16f..254d970a4011cbf4ba38fdc8aa4ec884ec5596d0 100644 (file)
@@ -1,16 +1,16 @@
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_PARTITION_ADVANCED=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_PLAT_SPEAR=y
 CONFIG_ARCH_SPEAR3XX=y
 CONFIG_MACH_SPEAR300=y
 CONFIG_MACH_SPEAR310=y
 CONFIG_MACH_SPEAR320=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=y
 CONFIG_NET=y
 CONFIG_MTD=y
@@ -77,8 +77,8 @@ CONFIG_JFFS2_FS=y
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=m
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
index bc32c02cb86b1e9c2cf18b47a8b9dc53a13cdfd6..2809c4eb77e790c7b5c744ac208e1ce50156ad2e 100644 (file)
@@ -1,13 +1,13 @@
 CONFIG_SYSVIPC=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BLK_DEV_INITRD=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_PLAT_SPEAR=y
+CONFIG_ARCH_SPEAR6XX=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
 CONFIG_PARTITION_ADVANCED=y
-# CONFIG_ARCH_MULTI_V7 is not set
-CONFIG_PLAT_SPEAR=y
-CONFIG_ARCH_SPEAR6XX=y
 CONFIG_BINFMT_MISC=y
 CONFIG_NET=y
 CONFIG_MTD=y
@@ -66,8 +66,8 @@ CONFIG_JFFS2_FS=y
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=m
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_SPINLOCK=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
index 43d079ee342a76b0411d4286ab470e47496cc7b7..1284a1d92ca3ebc39b9bc954581167dfdc689b98 100644 (file)
@@ -1,27 +1,23 @@
 CONFIG_SYSVIPC=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED_V2=y
 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_PROFILING=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_PXA_SHARPSL=y
 CONFIG_MACH_AKITA=y
 CONFIG_MACH_BORZOI=y
-CONFIG_PCCARD=y
-CONFIG_PCMCIA_PXA2XX=y
-CONFIG_PREEMPT=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2   debug"
 CONFIG_FPE_NWFPE=y
 CONFIG_BINFMT_AOUT=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_BINFMT_MISC=m
 CONFIG_PM=y
 CONFIG_NET=y
@@ -55,11 +51,6 @@ CONFIG_IP6_NF_MATCH_RT=m
 CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_MANGLE=m
 CONFIG_IP6_NF_RAW=m
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_PXA_FICP=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
@@ -78,6 +69,8 @@ CONFIG_BT_HCIBT3C=m
 CONFIG_BT_HCIBLUECARD=m
 CONFIG_BT_HCIBTUART=m
 CONFIG_BT_HCIVHCI=m
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
@@ -91,10 +84,15 @@ CONFIG_CHR_DEV_ST=m
 CONFIG_CHR_DEV_OSST=m
 CONFIG_BLK_DEV_SR=m
 CONFIG_CHR_DEV_SG=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=y
 CONFIG_PATA_PCMCIA=y
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_ASYNC=m
 CONFIG_USB_CATC=m
 CONFIG_USB_KAWETH=m
 CONFIG_USB_PEGASUS=m
@@ -102,10 +100,6 @@ CONFIG_USB_RTL8150=m
 CONFIG_USB_USBNET=m
 # CONFIG_USB_NET_CDC_SUBSET is not set
 CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_BSDCOMP=m
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 CONFIG_INPUT_EVDEV=y
@@ -116,11 +110,11 @@ CONFIG_TOUCHSCREEN_ADS7846=y
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=m
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=m
 CONFIG_SERIAL_8250_CS=m
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 CONFIG_SPI=y
 CONFIG_SPI_PXA2XX=y
 CONFIG_FB=y
@@ -131,11 +125,6 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
-CONFIG_USB_KBD=m
-CONFIG_USB_MOUSE=m
 CONFIG_HID_A4TECH=m
 CONFIG_HID_APPLE=m
 CONFIG_HID_BELKIN=m
@@ -152,6 +141,8 @@ CONFIG_HID_PETALYNX=m
 CONFIG_HID_SAMSUNG=m
 CONFIG_HID_SONY=m
 CONFIG_HID_SUNPLUS=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
 CONFIG_USB=m
 CONFIG_USB_MON=m
 CONFIG_USB_OHCI_HCD=m
@@ -220,16 +211,12 @@ CONFIG_NFS_V3=y
 CONFIG_NFS_V4=y
 CONFIG_SMB_FS=m
 CONFIG_SMB_NLS_DEFAULT=y
-CONFIG_PARTITION_ADVANCED=y
+CONFIG_NFS_V4=m
 CONFIG_NLS_DEFAULT="cp437"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_UTF8=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_DEBUG_PREEMPT is not set
-# CONFIG_FTRACE is not set
-CONFIG_DEBUG_LL=y
 CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_ECB=m
@@ -252,3 +239,9 @@ CONFIG_CRYPTO_TWOFISH=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRC_CCITT=y
 CONFIG_LIBCRC32C=m
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_FTRACE is not set
index 71d6bfcf455191696e3b94ef93d1ab6a8c684d86..1f5446cda8b643a5cdaedfb9c3f4fb5931340a4e 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
+CONFIG_PREEMPT=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -11,8 +12,6 @@ CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 # CONFIG_EVENTFD is not set
 # CONFIG_AIO is not set
 CONFIG_EMBEDDED=y
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_SLUB_DEBUG is not set
 # CONFIG_BLK_DEV_BSG is not set
 # CONFIG_MMU is not set
 CONFIG_ARCH_STM32=y
@@ -21,14 +20,12 @@ CONFIG_SET_MEM_PARAM=y
 CONFIG_DRAM_BASE=0x90000000
 CONFIG_FLASH_MEM_BASE=0x08000000
 CONFIG_FLASH_SIZE=0x00200000
-CONFIG_PREEMPT=y
 # CONFIG_ATAGS is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_XIP_KERNEL=y
 CONFIG_XIP_PHYS_ADDR=0x08008000
 CONFIG_BINFMT_FLAT=y
 # CONFIG_COREDUMP is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 # CONFIG_FW_LOADER is not set
@@ -38,9 +35,9 @@ CONFIG_KEYBOARD_GPIO=y
 # CONFIG_VT is not set
 # CONFIG_UNIX98_PTYS is not set
 # CONFIG_LEGACY_PTYS is not set
-CONFIG_SERIAL_NONSTANDARD=y
 CONFIG_SERIAL_STM32=y
 CONFIG_SERIAL_STM32_CONSOLE=y
+CONFIG_SERIAL_NONSTANDARD=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
@@ -74,12 +71,13 @@ CONFIG_EXT3_FS=y
 # CONFIG_DNOTIFY is not set
 # CONFIG_INOTIFY_USER is not set
 CONFIG_NLS=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC7=y
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_ENABLE_MUST_CHECK is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_MAGIC_SYSRQ=y
+# CONFIG_SLUB_DEBUG is not set
 # CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_CRYPTO=y
-CONFIG_CRC_ITU_T=y
-CONFIG_CRC7=y
index 8ba7935bd039e943802ac3bc75628008aa4cd012..3d14827e0a31b1a70d2d5f4eb7ca3f68fb30c625 100644 (file)
@@ -97,9 +97,9 @@ CONFIG_IR_SUNXI=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_PLATFORM_SUPPORT=y
 CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_SUN4I_CSI=y
 CONFIG_VIDEO_SUN6I_CSI=y
-CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_SUN8I_DEINTERLACE=y
 CONFIG_VIDEO_SUN8I_ROTATE=y
 CONFIG_DRM=y
index 46cbae6d1b1ff2229641e59bb231e45451aa5a6d..3b29ae1fb75022411c48d2ea24cc4fe367dcf53f 100644 (file)
@@ -1,26 +1,25 @@
 # CONFIG_LOCALVERSION_AUTO is not set
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
-# CONFIG_KALLSYMS is not set
 # CONFIG_ELF_CORE is not set
 # CONFIG_SHMEM is not set
-CONFIG_SLOB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
 # CONFIG_BLK_DEV_BSG is not set
+# CONFIG_KALLSYMS is not set
 CONFIG_ARCH_MULTI_V4T=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_S3C24XX=y
 CONFIG_MACH_TCT_HAMMER=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="mem=64M root=/dev/ram0 init=/linuxrc rw"
 CONFIG_FPE_NWFPE=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_SWAP is not set
+CONFIG_SLOB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -55,5 +54,5 @@ CONFIG_JFFS2_FS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 # CONFIG_ENABLE_MUST_CHECK is not set
-CONFIG_DEBUG_LL=y
 CONFIG_CRC_CCITT=y
+CONFIG_DEBUG_LL=y
index c209722399d7510bb9e139244c2731e334337098..71400af6cef42df1661fb863d3d31759423f72f1 100644 (file)
@@ -16,7 +16,6 @@ CONFIG_BLK_DEV_INITRD=y
 # CONFIG_ELF_CORE is not set
 CONFIG_EMBEDDED=y
 CONFIG_PERF_EVENTS=y
-CONFIG_SLAB=y
 CONFIG_ARCH_TEGRA=y
 CONFIG_SMP=y
 CONFIG_HIGHMEM=y
@@ -29,12 +28,11 @@ CONFIG_CPU_IDLE=y
 CONFIG_ARM_TEGRA_CPUIDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
-CONFIG_TRUSTED_FOUNDATIONS=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PARTITION_ADVANCED=y
+CONFIG_SLAB=y
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -80,6 +78,7 @@ CONFIG_PCI_TEGRA=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEGRA_GMI=y
+CONFIG_TRUSTED_FOUNDATIONS=y
 CONFIG_MTD=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_BLK_DEV_LOOP=y
@@ -91,6 +90,7 @@ CONFIG_ISL29003=y
 CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_SCSI_LOWLEVEL is not set
 CONFIG_ATA=y
 CONFIG_SATA_AHCI=y
@@ -114,9 +114,9 @@ CONFIG_KEYBOARD_GPIO=y
 CONFIG_KEYBOARD_TEGRA=y
 CONFIG_KEYBOARD_CROS_EC=y
 CONFIG_KEYBOARD_CAP11XX=y
+CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_MOUSE_ELAN_I2C=m
 CONFIG_MOUSE_ELAN_I2C_SMBUS=y
-CONFIG_MOUSE_PS2_ELANTECH=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=y
 CONFIG_TOUCHSCREEN_ELAN=y
@@ -139,6 +139,7 @@ CONFIG_I2C_MUX_GPIO=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_I2C_MUX_PINCTRL=y
 CONFIG_I2C_TEGRA=y
+CONFIG_I2C_CROS_EC_TUNNEL=m
 CONFIG_SPI=y
 CONFIG_SPI_TEGRA114=y
 CONFIG_SPI_TEGRA20_SFLASH=y
@@ -158,9 +159,9 @@ CONFIG_POWER_RESET_AS3722=y
 CONFIG_POWER_RESET_GPIO=y
 CONFIG_POWER_RESET_GPIO_RESTART=y
 CONFIG_BATTERY_SBS=y
-CONFIG_CHARGER_BQ24735=y
 CONFIG_BATTERY_BQ27XXX=y
 CONFIG_CHARGER_GPIO=y
+CONFIG_CHARGER_BQ24735=y
 CONFIG_CHARGER_SMB347=y
 CONFIG_CHARGER_TPS65090=y
 CONFIG_BATTERY_ACER_A500=y
@@ -198,8 +199,10 @@ CONFIG_REGULATOR_TPS6586X=y
 CONFIG_REGULATOR_TPS65910=y
 CONFIG_MEDIA_SUPPORT=y
 CONFIG_MEDIA_USB_SUPPORT=y
-CONFIG_USB_VIDEO_CLASS=y
 CONFIG_USB_GSPCA=y
+CONFIG_USB_VIDEO_CLASS=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_TEGRA_VDE=y
 CONFIG_DRM=y
 CONFIG_DRM_NOUVEAU=m
 CONFIG_DRM_TEGRA=y
@@ -286,13 +289,10 @@ CONFIG_SERIO_NVEC_PS2=y
 CONFIG_NVEC_POWER=y
 CONFIG_NVEC_PAZ00=y
 CONFIG_STAGING_MEDIA=y
-CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_TEGRA_VDE=y
 CONFIG_CHROME_PLATFORMS=y
 CONFIG_CROS_EC=y
 CONFIG_CROS_EC_I2C=m
 CONFIG_CROS_EC_SPI=m
-CONFIG_I2C_CROS_EC_TUNNEL=m
 CONFIG_TEGRA_IOMMU_GART=y
 CONFIG_TEGRA_IOMMU_SMMU=y
 CONFIG_ARCH_TEGRA_2x_SOC=y
@@ -343,7 +343,7 @@ CONFIG_CRYPTO_TWOFISH=y
 CONFIG_DMA_CMA=y
 CONFIG_CMA_SIZE_MBYTES=64
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_SLAB=y
 CONFIG_DEBUG_VM=y
index baeba4667e9b6411a14a2da57e9f8dbfbbff0db5..009abe1e49ef6e7f264fdadf0b1f455833c086f5 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
+CONFIG_PREEMPT=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_IKCONFIG=y
@@ -8,25 +9,24 @@ CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_EXTRA_PASS=y
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_TRIZEPS_PXA=y
 CONFIG_MACH_TRIZEPS4=y
-CONFIG_PCCARD=y
-# CONFIG_PCMCIA_LOAD_CIS is not set
-CONFIG_PCMCIA_PXA2XX=y
-CONFIG_PREEMPT=y
 CONFIG_AEABI=y
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=fe01 console=ttyS0,38400n8 loglevel=5"
 CONFIG_FPE_NWFPE=y
 CONFIG_FPE_NWFPE_XP=y
 CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_LDM_PARTITION=y
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -39,14 +39,6 @@ CONFIG_IP_PNP_BOOTP=y
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
 CONFIG_VLAN_8021Q=m
-CONFIG_IRDA=m
-CONFIG_IRLAN=m
-CONFIG_IRNET=m
-CONFIG_IRCOMM=m
-CONFIG_IRDA_ULTRA=y
-CONFIG_IRDA_CACHE_LAST_LSAP=y
-CONFIG_IRDA_FAST_RR=y
-CONFIG_IRTTY_SIR=m
 CONFIG_BT=m
 CONFIG_BT_RFCOMM=m
 CONFIG_BT_RFCOMM_TTY=y
@@ -55,6 +47,9 @@ CONFIG_BT_BNEP_MC_FILTER=y
 CONFIG_BT_BNEP_PROTO_FILTER=y
 CONFIG_BT_HIDP=m
 CONFIG_CFG80211=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_PXA2XX=y
 CONFIG_CONNECTOR=y
 CONFIG_MTD=y
 CONFIG_MTD_REDBOOT_PARTS=y
@@ -77,13 +72,13 @@ CONFIG_MTD_DOC2001PLUS=y
 CONFIG_MTD_DOCPROBE_ADVANCED=y
 CONFIG_MTD_DOCPROBE_ADDRESS=0x4000000
 CONFIG_MTD_DOCPROBE_HIGH=y
+CONFIG_MTD_ONENAND=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_DISKONCHIP=y
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED=y
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0x4000000
 CONFIG_MTD_NAND_DISKONCHIP_PROBE_HIGH=y
 CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE=y
-CONFIG_MTD_ONENAND=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_BLK_DEV_NBD=y
@@ -97,9 +92,17 @@ CONFIG_ATA=m
 CONFIG_PATA_PCMCIA=m
 CONFIG_PATA_PLATFORM=m
 CONFIG_NETDEVICES=y
-CONFIG_PHYLIB=y
 CONFIG_NET_ETHERNET=y
 CONFIG_DM9000=y
+CONFIG_PHYLIB=y
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_MPPE=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
 CONFIG_HOSTAP=y
 CONFIG_HOSTAP_FIRMWARE=y
 CONFIG_HOSTAP_FIRMWARE_NVRAM=y
@@ -107,14 +110,6 @@ CONFIG_HOSTAP_CS=y
 CONFIG_HERMES=y
 CONFIG_PCMCIA_HERMES=y
 CONFIG_PCMCIA_SPECTRUM=y
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_MPPE=m
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
 CONFIG_INPUT_EVDEV=y
@@ -142,17 +137,14 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=y
 # CONFIG_VGA_CONSOLE is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
-CONFIG_SND_SEQUENCER=y
 CONFIG_SND_MIXER_OSS=y
 CONFIG_SND_PCM_OSS=y
 CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_DEBUG=y
+CONFIG_SND_SEQUENCER=y
 CONFIG_SND_PXA2XX_AC97=y
 CONFIG_SND_USB_AUDIO=m
 # CONFIG_USB_HID is not set
@@ -191,8 +183,6 @@ CONFIG_NFSD=y
 CONFIG_NFSD_V4=y
 CONFIG_SMB_FS=m
 CONFIG_CIFS=m
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_LDM_PARTITION=y
 CONFIG_NLS_DEFAULT="iso8859-15"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_850=y
@@ -200,9 +190,6 @@ CONFIG_NLS_ASCII=y
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_USER=y
 CONFIG_KEYS=y
 CONFIG_SECURITY=y
 CONFIG_CRYPTO_PCBC=m
@@ -212,3 +199,9 @@ CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRC_CCITT=y
 CONFIG_CRC16=y
 CONFIG_LIBCRC32C=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_DEBUG_USER=y
index a352207a64d74d054fffe201c7a17c8c520f4029..3bdc217667a6fabf9c2e7fb91d7d7cbb2ef7b678 100644 (file)
@@ -1,4 +1,3 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -21,6 +20,7 @@ CONFIG_NEON=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_PARTITION_ADVANCED=y
+# CONFIG_SWAP is not set
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
index c2d79a67f81f4c570c1f2359d2ba46ec906abcc9..67e3f9138306600b1bab0cb2be34a5671eb6ff23 100644 (file)
@@ -4,7 +4,6 @@ CONFIG_NO_HZ_IDLE=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_SLAB=y
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_VERSATILE=y
 CONFIG_AEABI=y
@@ -15,6 +14,7 @@ CONFIG_VFP=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_PARTITION_ADVANCED=y
+CONFIG_SLAB=y
 CONFIG_CMA=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -88,8 +88,8 @@ CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NLS_CODEPAGE_850=m
 CONFIG_NLS_ISO8859_1=m
+CONFIG_DEBUG_KERNEL=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_USER=y
 CONFIG_DEBUG_LL=y
index 947987730eb7ba730ca94aa9610e74facbc084bc..4e3a0133e4d38db2e0b33062dea164dbe4f5cf6d 100644 (file)
@@ -20,15 +20,12 @@ CONFIG_MCPM=y
 CONFIG_VMSPLIT_2G=y
 CONFIG_NR_CPUS=8
 CONFIG_ARM_PSCI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
 CONFIG_CMDLINE="console=ttyAMA0"
 CONFIG_CPU_IDLE=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_CMA=y
 CONFIG_NET=y
@@ -56,6 +53,7 @@ CONFIG_MTD_UBI=y
 CONFIG_VIRTIO_BLK=y
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_SCSI_VIRTIO=y
 CONFIG_ATA=y
 CONFIG_NETDEVICES=y
@@ -135,9 +133,9 @@ CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 # CONFIG_CRYPTO_HW is not set
 CONFIG_DMA_CMA=y
-CONFIG_DEBUG_INFO=y
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DETECT_HUNG_TASK=y
 # CONFIG_SCHED_DEBUG is not set
 CONFIG_DEBUG_USER=y
index 70fdbfd83484b79e73d04912a2cf7ac819298a1b..2e47cc57a928372d717f4c7a6749ec5e51b1fda7 100644 (file)
@@ -16,9 +16,9 @@ CONFIG_FLASH_SIZE=0x01000000
 CONFIG_CMDLINE="console=/dev/ttyLP2"
 CONFIG_XIP_KERNEL=y
 CONFIG_XIP_PHYS_ADDR=0x0f000080
+# CONFIG_SUSPEND is not set
 CONFIG_BINFMT_FLAT=y
 CONFIG_BINFMT_ZFLAT=y
-# CONFIG_SUSPEND is not set
 # CONFIG_UEVENT_HELPER is not set
 # CONFIG_STANDALONE is not set
 # CONFIG_PREVENT_FIRMWARE_BUILD is not set
index 7c1029716ea575357759986a2169ca160c001ccf..02f9849893b2561216a15676b947b60d85792294 100644 (file)
@@ -1,23 +1,15 @@
-# CONFIG_SWAP is not set
 CONFIG_SYSVIPC=y
 CONFIG_LOG_BUF_SHIFT=13
 CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_EXPERT=y
 # CONFIG_ELF_CORE is not set
 # CONFIG_SHMEM is not set
-CONFIG_SLAB=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_ARCH_VIPER=y
 CONFIG_IWMMXT=y
-CONFIG_PCCARD=m
-CONFIG_PCMCIA_PXA2XX=m
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=31:02 rootfstype=jffs2 ro console=ttyS0,115200"
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
@@ -26,6 +18,11 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=m
 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_FPE_FASTFPE=y
 CONFIG_PM=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_SWAP is not set
+CONFIG_SLAB=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -41,6 +38,8 @@ CONFIG_BT_BNEP=m
 CONFIG_BT_HCIUART=m
 CONFIG_BT_HCIUART_H4=y
 CONFIG_BT_HCIUART_BCSP=y
+CONFIG_PCCARD=m
+CONFIG_PCMCIA_PXA2XX=m
 CONFIG_FW_LOADER=m
 CONFIG_MTD=y
 CONFIG_MTD_REDBOOT_PARTS=y
@@ -61,20 +60,21 @@ CONFIG_MTD_PXA2XX=y
 CONFIG_BLK_DEV_LOOP=m
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=m
 # CONFIG_SATA_PMP is not set
 CONFIG_PATA_PCMCIA=m
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
 CONFIG_SMC91X=y
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_ASYNC=m
 CONFIG_USB_PEGASUS=m
 CONFIG_USB_USBNET=m
 # CONFIG_USB_NET_CDC_SUBSET is not set
 CONFIG_NET_PCMCIA=y
-CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
 CONFIG_INPUT_MOUSEDEV=m
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=m
@@ -94,12 +94,12 @@ CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=m
 # CONFIG_CONSOLE_TRANSLATIONS is not set
 # CONFIG_VT_CONSOLE is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=m
 CONFIG_SERIAL_8250_NR_UARTS=5
 CONFIG_SERIAL_8250_RUNTIME_UARTS=5
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 # CONFIG_I2C_HELPER_AUTO is not set
@@ -146,16 +146,15 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=m
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_850=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
+CONFIG_CRC_T10DIF=m
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_MUTEXES=y
 # CONFIG_FTRACE is not set
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_ARC4=m
-CONFIG_CRC_T10DIF=m
index 9b85326ba287a8340c89a9173ad5fd9828a9087b..cb8d38e9562ad4edb0ec04e045f2d706c7af6e50 100644 (file)
@@ -50,8 +50,8 @@ CONFIG_I2C_WMT=y
 CONFIG_PINCTRL_SINGLE=y
 CONFIG_PINCTRL_WM8750=y
 CONFIG_GPIO_GENERIC_PLATFORM=y
-CONFIG_POWER_SUPPLY=y
 CONFIG_POWER_RESET=y
+CONFIG_POWER_SUPPLY=y
 CONFIG_MFD_SYSCON=y
 CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
index 3752672f980e3aeb7c165f65cfbc22ce08d13e81..0453948d52eff67af81be370dcb074dd8098e3da 100644 (file)
@@ -1,6 +1,8 @@
 CONFIG_LOCALVERSION=".xcep-itech"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
@@ -10,26 +12,23 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
 # CONFIG_UID16 is not set
 # CONFIG_SHMEM is not set
-# CONFIG_VM_EVENT_COUNTERS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLOB=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_MODULE_SRCVERSION_ALL=y
-# CONFIG_BLOCK is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_XCEP=y
 CONFIG_IWMMXT=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=mtd4 rootfstype=jffs2 ro console=ttyS0,115200"
 CONFIG_FPE_NWFPE=y
+CONFIG_KPROBES=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+# CONFIG_BLOCK is not set
+CONFIG_SLOB=y
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_VM_EVENT_COUNTERS is not set
 CONFIG_NET=y
 CONFIG_PACKET=m
 CONFIG_UNIX=y
@@ -54,9 +53,9 @@ CONFIG_NET_ETHERNET=y
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_PXA=y
 CONFIG_SERIAL_PXA_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=m
 CONFIG_I2C_CHARDEV=m
@@ -78,13 +77,13 @@ CONFIG_NFS_V3=y
 CONFIG_NLS=m
 CONFIG_NLS_DEFAULT="utf8"
 CONFIG_NLS_UTF8=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_LIBCRC32C=m
 CONFIG_PRINTK_TIME=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
 CONFIG_STRIP_ASM_SYMS=y
 CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
-# CONFIG_DEBUG_BUGVERBOSE is not set
 # CONFIG_FTRACE is not set
 # CONFIG_ARM_UNWIND is not set
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-# CONFIG_CRYPTO_HW is not set
-CONFIG_LIBCRC32C=m
index 03a12fb51259f3b13f5b3bd385e174c0c1a7c973..c4535315e21634a711120d08299dd0fa9edcd0e0 100644 (file)
@@ -1,17 +1,11 @@
 CONFIG_SYSVIPC=y
 CONFIG_TINY_RCU=y
 CONFIG_LOG_BUF_SHIFT=13
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 # CONFIG_ARCH_MULTI_V7 is not set
 CONFIG_ARCH_PXA=y
 CONFIG_MACH_ARCOM_ZEUS=y
-CONFIG_PCCARD=m
-CONFIG_PCMCIA_PXA2XX=m
 CONFIG_AEABI=y
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_UNUSED_BOARD_FILES=y
 CONFIG_CMDLINE="root=31:02 rootfstype=jffs2 ro console=ttyS0,115200"
 CONFIG_CPU_FREQ=y
 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
@@ -21,6 +15,9 @@ CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
 CONFIG_FPE_NWFPE=y
 CONFIG_PM=y
 CONFIG_APM_EMULATION=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_PARTITION_ADVANCED=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -39,6 +36,8 @@ CONFIG_BT_HCIUART_BCSP=y
 CONFIG_CFG80211=m
 CONFIG_LIB80211=m
 CONFIG_MAC80211=m
+CONFIG_PCCARD=m
+CONFIG_PCMCIA_PXA2XX=m
 CONFIG_MTD=y
 CONFIG_MTD_REDBOOT_PARTS=y
 CONFIG_MTD_REDBOOT_PARTS_READONLY=y
@@ -59,21 +58,22 @@ CONFIG_BLK_DEV_LOOP=m
 CONFIG_EEPROM_AT24=m
 # CONFIG_SCSI_PROC_FS is not set
 CONFIG_BLK_DEV_SD=m
+# CONFIG_BLK_DEV_BSG is not set
 CONFIG_ATA=m
 # CONFIG_SATA_PMP is not set
 CONFIG_PATA_PCMCIA=m
 CONFIG_NETDEVICES=y
 CONFIG_NET_ETHERNET=y
 CONFIG_DM9000=y
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_ASYNC=m
 CONFIG_HERMES=m
 CONFIG_PCMCIA_HERMES=m
 CONFIG_RT2X00=m
 CONFIG_RT73USB=m
 CONFIG_NET_PCMCIA=y
-CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=m
 # CONFIG_INPUT_KEYBOARD is not set
@@ -90,11 +90,11 @@ CONFIG_TOUCHSCREEN_TOUCHWIN=m
 CONFIG_TOUCHSCREEN_TOUCHIT213=m
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_UINPUT=m
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=7
 CONFIG_SERIAL_8250_RUNTIME_UARTS=7
-# CONFIG_LEGACY_PTYS is not set
 CONFIG_I2C=y
 CONFIG_I2C_CHARDEV=y
 # CONFIG_I2C_HELPER_AUTO is not set
@@ -161,14 +161,13 @@ CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=m
-CONFIG_PARTITION_ADVANCED=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_850=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_MAGIC_SYSRQ=y
+CONFIG_CRC_T10DIF=m
 CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_MUTEXES=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRC_T10DIF=m
index a81dda65c57622a253fb2437c53ecba2ad8e82c5..45180a2cc47cbcfa7b29f6232330b3b19806c7cf 100644 (file)
@@ -10,7 +10,7 @@
 #else
 #define MAX_DMA_ADDRESS        ({ \
        extern phys_addr_t arm_dma_zone_size; \
-       arm_dma_zone_size && arm_dma_zone_size < (0x10000000 - PAGE_OFFSET) ? \
+       arm_dma_zone_size && arm_dma_zone_size < (0x100000000ULL - PAGE_OFFSET) ? \
                (PAGE_OFFSET + arm_dma_zone_size) : 0xffffffffUL; })
 #endif
 
index eba7cbc93b86981b7bc5437f3ea3319a3bc44b4c..7fcdc785366c54ce0720c9e7271dbb15edb529da 100644 (file)
@@ -139,11 +139,9 @@ extern void __iomem *__arm_ioremap_caller(phys_addr_t, size_t, unsigned int,
 extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
 extern void __iomem *__arm_ioremap_exec(phys_addr_t, size_t, bool cached);
 void __arm_iomem_set_ro(void __iomem *ptr, size_t size);
-extern void __iounmap(volatile void __iomem *addr);
 
 extern void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t,
        unsigned int, void *);
-extern void (*arch_iounmap)(volatile void __iomem *);
 
 /*
  * Bad read/write accesses...
@@ -380,7 +378,7 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
 #define ioremap_wc ioremap_wc
 #define ioremap_wt ioremap_wc
 
-void iounmap(volatile void __iomem *iomem_cookie);
+void iounmap(volatile void __iomem *io_addr);
 #define iounmap iounmap
 
 void *arch_memremap_wb(phys_addr_t phys_addr, size_t size);
index 303b3ab87f7e892a4607055eae136582372745cf..eb9c24b6e8e23a6d04ba88e35ca4e8adb295f3b1 100644 (file)
@@ -27,9 +27,3 @@ void arch_jump_label_transform(struct jump_entry *entry,
 {
        __arch_jump_label_transform(entry, type, false);
 }
-
-void arch_jump_label_transform_static(struct jump_entry *entry,
-                                     enum jump_label_type type)
-{
-       __arch_jump_label_transform(entry, type, true);
-}
index b5e8b9ae4c7d496dcd292e6437d3bebd6417a870..7fd3600db8efdceee24c1942863b88c393acfe3b 100644 (file)
@@ -40,8 +40,8 @@ ENDPROC(_find_first_zero_bit_le)
  * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
  */
 ENTRY(_find_next_zero_bit_le)
-               teq     r1, #0
-               beq     3b
+               cmp     r2, r1
+               bhs     3b
                ands    ip, r2, #7
                beq     1b                      @ If new byte, goto old routine
  ARM(          ldrb    r3, [r0, r2, lsr #3]    )
@@ -81,8 +81,8 @@ ENDPROC(_find_first_bit_le)
  * Prototype: int find_next_zero_bit(void *addr, unsigned int maxbit, int offset)
  */
 ENTRY(_find_next_bit_le)
-               teq     r1, #0
-               beq     3b
+               cmp     r2, r1
+               bhs     3b
                ands    ip, r2, #7
                beq     1b                      @ If new byte, goto old routine
  ARM(          ldrb    r3, [r0, r2, lsr #3]    )
@@ -115,8 +115,8 @@ ENTRY(_find_first_zero_bit_be)
 ENDPROC(_find_first_zero_bit_be)
 
 ENTRY(_find_next_zero_bit_be)
-               teq     r1, #0
-               beq     3b
+               cmp     r2, r1
+               bhs     3b
                ands    ip, r2, #7
                beq     1b                      @ If new byte, goto old routine
                eor     r3, r2, #0x18           @ big endian byte ordering
@@ -149,8 +149,8 @@ ENTRY(_find_first_bit_be)
 ENDPROC(_find_first_bit_be)
 
 ENTRY(_find_next_bit_be)
-               teq     r1, #0
-               beq     3b
+               cmp     r2, r1
+               bhs     3b
                ands    ip, r2, #7
                beq     1b                      @ If new byte, goto old routine
                eor     r3, r2, #0x18           @ big endian byte ordering
index 2a01f7a7d13fcf7d89a9ec08656dbaebb10098b1..f7789cbe289f94b20106174855352029b5f58034 100644 (file)
@@ -27,6 +27,12 @@ struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1)
        return res;
 }
 
+bool sam_linux_is_optee_available(void)
+{
+       /* If optee has been detected, then we are running in normal world */
+       return optee_available;
+}
+
 void __init sam_secure_init(void)
 {
        struct device_node *np;
index 1e7d8b20ba1ea1193070b427010aacb9d8fb6ca1..1a0b5ebbfc3970e849d7c8793f86c674a71b86ad 100644 (file)
@@ -14,5 +14,6 @@
 
 void __init sam_secure_init(void);
 struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1);
+bool sam_linux_is_optee_available(void);
 
 #endif /* SAM_SECURE_H */
index de5dd28b392e962d8e3b837b457abf4d7955f2be..67ed68fbe3a55cfb642c8d6d50e9e7d774741066 100644 (file)
@@ -9,13 +9,27 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 
+#include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/outercache.h>
 #include <asm/system_misc.h>
 
 #include "generic.h"
 #include "sam_secure.h"
 
+static void sama5_l2c310_write_sec(unsigned long val, unsigned reg)
+{
+       /* OP-TEE configures the L2 cache and does not allow modifying it yet */
+}
+
+static void __init sama5_secure_cache_init(void)
+{
+       sam_secure_init();
+       if (sam_linux_is_optee_available())
+               outer_cache.write_sec = sama5_l2c310_write_sec;
+}
+
 static void __init sama5_dt_device_init(void)
 {
        of_platform_default_populate(NULL, NULL, NULL);
@@ -48,7 +62,6 @@ MACHINE_END
 static void __init sama5d2_init(void)
 {
        of_platform_default_populate(NULL, NULL, NULL);
-       sam_secure_init();
        sama5d2_pm_init();
 }
 
@@ -60,6 +73,7 @@ static const char *const sama5d2_compat[] __initconst = {
 DT_MACHINE_START(sama5d2, "Atmel SAMA5")
        /* Maintainer: Atmel */
        .init_machine   = sama5d2_init,
+       .init_early     = sama5_secure_cache_init,
        .dt_compat      = sama5d2_compat,
        .l2c_aux_mask   = ~0UL,
 MACHINE_END
index f73a056bf560f571d12ffea92fa492dcbcb374e2..8789d93a7c04b3929452ceed8063c024a794e815 100644 (file)
@@ -54,8 +54,6 @@ config ARCH_BCM_NSP
        select ARM_ERRATA_775420
        select ARM_ERRATA_764369 if SMP
        select ARM_TIMER_SP804
-       select THERMAL
-       select THERMAL_OF
        help
          Support for Broadcom Northstar Plus SoC.
          Broadcom Northstar Plus family of SoCs are used for switching control
@@ -182,23 +180,6 @@ config ARCH_BCM_53573
          The base chip is BCM53573 and there are some packaging modifications
          like BCM47189 and BCM47452.
 
-config ARCH_BCM_63XX
-       bool "Broadcom BCM63xx DSL SoC"
-       depends on ARCH_MULTI_V7
-       select ARCH_HAS_RESET_CONTROLLER
-       select ARM_ERRATA_754322
-       select ARM_ERRATA_764369 if SMP
-       select ARM_GIC
-       select ARM_GLOBAL_TIMER
-       select CACHE_L2X0
-       select HAVE_ARM_ARCH_TIMER
-       select HAVE_ARM_TWD if SMP
-       select HAVE_ARM_SCU if SMP
-       help
-         This enables support for systems based on Broadcom DSL SoCs.
-         It currently supports the 'BCM63XX' ARM-based family, which includes
-         the BCM63138 variant.
-
 config ARCH_BRCMSTB
        bool "Broadcom BCM7XXX based boards"
        depends on ARCH_MULTI_V7
@@ -218,8 +199,8 @@ config ARCH_BRCMSTB
          This enables support for Broadcom ARM-based set-top box chipsets,
          including the 7445 family of chips.
 
-config ARCH_BCMBCA
-       bool "Broadcom Broadband SoC"
+menuconfig ARCH_BCMBCA
+       bool "Broadcom Broadband Carrier Access (BCA) origin SoC"
        depends on ARCH_MULTI_V7
        select ARM_AMBA
        select ARM_GIC
@@ -230,4 +211,46 @@ config ARCH_BCMBCA
 
          This enables support for Broadcom BCA ARM-based broadband chipsets,
          including the DSL, PON and Wireless family of chips.
+
+comment "BCMBCA sub platforms"
+
+if ARCH_BCMBCA
+
+config ARCH_BCMBCA_CORTEXA7
+       bool "Cortex-A7 SoCs"
+       help
+         Say Y if you intend to run the kernel on a Broadcom Broadband ARM A7
+         based chipset.
+
+         This enables support for Broadcom BCA ARM A7 broadband chipsets,
+         including various DSL, PON and Wireless family of chips.
+
+config ARCH_BCMBCA_CORTEXA9
+       bool "Cortex-A9 SoCS"
+       select ARM_ERRATA_754322
+       select ARM_ERRATA_764369 if SMP
+       select ARCH_HAS_RESET_CONTROLLER
+       select ARM_GLOBAL_TIMER
+       select CACHE_L2X0
+       select HAVE_ARM_TWD if SMP
+       select HAVE_ARM_SCU if SMP
+       help
+         Say Y if you intend to run the kernel on a Broadcom Broadband ARM A9
+         based BCA chipset.
+
+         This enables support for Broadcom BCA ARM A9 broadband chipset. Currently
+         only DSL chip BCM63138.
+
+config ARCH_BCMBCA_BRAHMAB15
+       bool "Brahma-B15 SoCs"
+       select ARM_ERRATA_798181 if SMP
+       help
+         Say Y if you intend to run the kernel on a Broadcom Broadband ARM B15
+         based BCA chipset.
+
+         This enables support for Broadcom BCA ARM B15 broadband chipset. Currently
+         only DSL chip BCM63148.
+
+endif
+
 endif
index b2394ddb055868a16bd468078c4819fddb395776..020075eb38afbf0d5a2d0ce572e2c8f87b48d86d 100644 (file)
@@ -57,14 +57,13 @@ ifeq ($(CONFIG_ARCH_BCM_5301X),y)
 obj-$(CONFIG_SMP)              += platsmp.o
 endif
 
-# BCM63XXx
-ifeq ($(CONFIG_ARCH_BCM_63XX),y)
-obj-y                          += bcm63xx.o
-obj-$(CONFIG_SMP)              += bcm63xx_smp.o bcm63xx_pmb.o
-endif
-
 ifeq ($(CONFIG_ARCH_BRCMSTB),y)
 CFLAGS_platsmp-brcmstb.o       += -march=armv7-a
 obj-y                          += brcmstb.o
 obj-$(CONFIG_SMP)              += platsmp-brcmstb.o
 endif
+
+# BCMBCA
+ifeq ($(CONFIG_ARCH_BCMBCA),y)
+obj-$(CONFIG_SMP)              += bcm63xx_smp.o bcm63xx_pmb.o
+endif
diff --git a/arch/arm/mach-bcm/bcm63xx.c b/arch/arm/mach-bcm/bcm63xx.c
deleted file mode 100644 (file)
index c4c66ae..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2014 Broadcom Corporation
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation version 2.
- *
- * This program is distributed "as is" WITHOUT ANY WARRANTY of any
- * kind, whether express or implied; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/of_platform.h>
-
-#include <asm/mach/arch.h>
-
-static const char * const bcm63xx_dt_compat[] = {
-       "brcm,bcm63138",
-       NULL
-};
-
-DT_MACHINE_START(BCM63XXX_DT, "BCM63xx DSL SoC")
-       .dt_compat      = bcm63xx_dt_compat,
-       .l2c_aux_val    = 0,
-       .l2c_aux_mask   = ~0,
-MACHINE_END
index 43829e49ad93ffdc31e849d3fedd25ef903d77b6..347bfb7f03e2c8dd69666f3b009b65b693ffe55c 100644 (file)
@@ -52,6 +52,7 @@ int __init bcm_kona_smc_init(void)
                return -ENODEV;
 
        prop_val = of_get_address(node, 0, &prop_size, NULL);
+       of_node_put(node);
        if (!prop_val)
                return -EINVAL;
 
index 1ecf5466931ebad683ce1b6ec78693a6a5cd8ab1..1f85deff248637b54c2d53997fbf3686714c1c05 100644 (file)
@@ -2,6 +2,7 @@
 menuconfig ARCH_CNS3XXX
        bool "Cavium Networks CNS3XXX family"
        depends on ARCH_MULTI_V6
+       depends on ATAGS && UNUSED_BOARD_FILES
        select ARM_GIC
        help
          Support for Cavium Networks CNS3XXX platform.
index 008cbc2ab867d772236d2aba873f7672f446d14e..c8cbd9a3079145f5ef89082f8fbbe7ed3524757d 100644 (file)
@@ -19,24 +19,16 @@ config ARCH_DAVINCI_DMx
 
 comment "DaVinci Core Type"
 
-config ARCH_DAVINCI_DM644x
-       bool "DaVinci 644x based system"
-       select DAVINCI_AINTC
-       select ARCH_DAVINCI_DMx
-
 config ARCH_DAVINCI_DM355
        bool "DaVinci 355 based system"
-       select DAVINCI_AINTC
-       select ARCH_DAVINCI_DMx
-
-config ARCH_DAVINCI_DM646x
-       bool "DaVinci 646x based system"
+       depends on ATAGS && UNUSED_BOARD_FILES
        select DAVINCI_AINTC
        select ARCH_DAVINCI_DMx
 
 config ARCH_DAVINCI_DA830
        bool "DA830/OMAP-L137/AM17x based system"
        depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
+       depends on ATAGS
        select ARCH_DAVINCI_DA8XX
        # needed on silicon revs 1.0, 1.1:
        select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
@@ -45,6 +37,7 @@ config ARCH_DAVINCI_DA830
 config ARCH_DAVINCI_DA850
        bool "DA850/OMAP-L138/AM18x based system"
        depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
+       depends on ATAGS
        select ARCH_DAVINCI_DA8XX
        select DAVINCI_CP_INTC
 
@@ -53,6 +46,7 @@ config ARCH_DAVINCI_DA8XX
 
 config ARCH_DAVINCI_DM365
        bool "DaVinci 365 based system"
+       depends on ATAGS && UNUSED_BOARD_FILES
        select DAVINCI_AINTC
        select ARCH_DAVINCI_DMx
 
@@ -67,28 +61,6 @@ config MACH_DA8XX_DT
          Say y here to include support for TI DaVinci DA850 based using
          Flattened Device Tree. More information at Documentation/devicetree
 
-config MACH_DAVINCI_EVM
-       bool "TI DM644x EVM"
-       default ARCH_DAVINCI_DM644x
-       depends on ARCH_DAVINCI_DM644x
-       help
-         Configure this option to specify the whether the board used
-         for development is a DM644x EVM
-
-config MACH_SFFSDR
-       bool "Lyrtech SFFSDR"
-       depends on ARCH_DAVINCI_DM644x
-       help
-         Say Y here to select the Lyrtech Small Form Factor
-         Software Defined Radio (SFFSDR) board.
-
-config MACH_NEUROS_OSD2
-       bool "Neuros OSD2 Open Television Set Top Box"
-       depends on ARCH_DAVINCI_DM644x
-       help
-         Configure this option to specify the whether the board used
-         for development is a Neuros OSD2 Open Set Top Box.
-
 config MACH_DAVINCI_DM355_EVM
        bool "TI DM355 EVM"
        default ARCH_DAVINCI_DM355
@@ -104,18 +76,6 @@ config MACH_DM355_LEOPARD
          Configure this option to specify the whether the board used
          for development is a DM355 Leopard board.
 
-config MACH_DAVINCI_DM6467_EVM
-       bool "TI DM6467 EVM"
-       default ARCH_DAVINCI_DM646x
-       depends on ARCH_DAVINCI_DM646x
-       select MACH_DAVINCI_DM6467TEVM
-       help
-         Configure this option to specify the whether the board used
-         for development is a DM6467 EVM
-
-config MACH_DAVINCI_DM6467TEVM
-       bool
-
 config MACH_DAVINCI_DM365_EVM
        bool "TI DM365 EVM"
        default ARCH_DAVINCI_DM365
@@ -127,6 +87,7 @@ config MACH_DAVINCI_DM365_EVM
 config MACH_DAVINCI_DA830_EVM
        bool "TI DA830/OMAP-L137/AM17x Reference Platform"
        default ARCH_DAVINCI_DA830
+       depends on ATAGS && UNUSED_BOARD_FILES
        depends on ARCH_DAVINCI_DA830
        select GPIO_PCF857X if I2C
        help
@@ -156,6 +117,7 @@ endchoice
 
 config MACH_DAVINCI_DA850_EVM
        bool "TI DA850/OMAP-L138/AM18x Reference Platform"
+       depends on ATAGS && UNUSED_BOARD_FILES
        default ARCH_DAVINCI_DA850
        depends on ARCH_DAVINCI_DA850
        help
@@ -197,6 +159,7 @@ endchoice
 config MACH_MITYOMAPL138
        bool "Critical Link MityDSP-L138/MityARM-1808 SoM"
        depends on ARCH_DAVINCI_DA850
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say Y here to select the Critical Link MityDSP-L138/MityARM-1808
          System on Module.  Information on this SoM may be found at
@@ -205,6 +168,7 @@ config MACH_MITYOMAPL138
 config MACH_OMAPL138_HAWKBOARD
        bool "TI AM1808 / OMAPL-138 Hawkboard platform"
        depends on ARCH_DAVINCI_DA850
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say Y here to select the TI AM1808 / OMAPL-138 Hawkboard platform .
 
index b04c084b707ed99b394d7cc4fa359bc570768111..3f4894aa7528dac29d76da0c24f971acca08e2e9 100644 (file)
@@ -10,21 +10,15 @@ obj-y                                       := serial.o usb.o common.o sram.o
 obj-$(CONFIG_DAVINCI_MUX)              += mux.o
 
 # Chip specific
-obj-$(CONFIG_ARCH_DAVINCI_DM644x)       += dm644x.o devices.o
 obj-$(CONFIG_ARCH_DAVINCI_DM355)        += dm355.o devices.o
-obj-$(CONFIG_ARCH_DAVINCI_DM646x)       += dm646x.o devices.o
 obj-$(CONFIG_ARCH_DAVINCI_DM365)       += dm365.o devices.o
 obj-$(CONFIG_ARCH_DAVINCI_DA830)       += da830.o devices-da8xx.o usb-da8xx.o
 obj-$(CONFIG_ARCH_DAVINCI_DA850)       += da850.o devices-da8xx.o usb-da8xx.o
 
 # Board specific
 obj-$(CONFIG_MACH_DA8XX_DT)            += da8xx-dt.o pdata-quirks.o
-obj-$(CONFIG_MACH_DAVINCI_EVM)         += board-dm644x-evm.o
-obj-$(CONFIG_MACH_SFFSDR)              += board-sffsdr.o
-obj-$(CONFIG_MACH_NEUROS_OSD2)         += board-neuros-osd2.o
 obj-$(CONFIG_MACH_DAVINCI_DM355_EVM)   += board-dm355-evm.o
 obj-$(CONFIG_MACH_DM355_LEOPARD)       += board-dm355-leopard.o
-obj-$(CONFIG_MACH_DAVINCI_DM6467_EVM)  += board-dm646x-evm.o
 obj-$(CONFIG_MACH_DAVINCI_DM365_EVM)   += board-dm365-evm.o
 obj-$(CONFIG_MACH_DAVINCI_DA830_EVM)   += board-da830-evm.o
 obj-$(CONFIG_MACH_DAVINCI_DA850_EVM)   += board-da850-evm.o
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
deleted file mode 100644 (file)
index 9f405af..0000000
+++ /dev/null
@@ -1,928 +0,0 @@
-/*
- * TI DaVinci EVM board support
- *
- * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
- *
- * 2007 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/dma-mapping.h>
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <linux/gpio/machine.h>
-#include <linux/i2c.h>
-#include <linux/platform_data/pcf857x.h>
-#include <linux/platform_data/gpio-davinci.h>
-#include <linux/property.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/rawnand.h>
-#include <linux/mtd/partitions.h>
-#include <linux/mtd/physmap.h>
-#include <linux/nvmem-provider.h>
-#include <linux/phy.h>
-#include <linux/clk.h>
-#include <linux/videodev2.h>
-#include <linux/v4l2-dv-timings.h>
-#include <linux/export.h>
-#include <linux/leds.h>
-#include <linux/regulator/fixed.h>
-#include <linux/regulator/machine.h>
-
-#include <media/i2c/tvp514x.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-
-#include <linux/platform_data/i2c-davinci.h>
-#include <linux/platform_data/mtd-davinci.h>
-#include <linux/platform_data/mmc-davinci.h>
-#include <linux/platform_data/usb-davinci.h>
-#include <linux/platform_data/mtd-davinci-aemif.h>
-#include <linux/platform_data/ti-aemif.h>
-
-#include "davinci.h"
-#include "common.h"
-#include "mux.h"
-#include "serial.h"
-#include "irqs.h"
-
-#define DM644X_EVM_PHY_ID              "davinci_mdio-0:01"
-#define LXT971_PHY_ID  (0x001378e2)
-#define LXT971_PHY_MASK        (0xfffffff0)
-
-static struct mtd_partition davinci_evm_norflash_partitions[] = {
-       /* bootloader (UBL, U-Boot, etc) in first 5 sectors */
-       {
-               .name           = "bootloader",
-               .offset         = 0,
-               .size           = 5 * SZ_64K,
-               .mask_flags     = MTD_WRITEABLE, /* force read-only */
-       },
-       /* bootloader params in the next 1 sectors */
-       {
-               .name           = "params",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = SZ_64K,
-               .mask_flags     = 0,
-       },
-       /* kernel */
-       {
-               .name           = "kernel",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = SZ_2M,
-               .mask_flags     = 0
-       },
-       /* file system */
-       {
-               .name           = "filesystem",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-               .mask_flags     = 0
-       }
-};
-
-static struct physmap_flash_data davinci_evm_norflash_data = {
-       .width          = 2,
-       .parts          = davinci_evm_norflash_partitions,
-       .nr_parts       = ARRAY_SIZE(davinci_evm_norflash_partitions),
-};
-
-/* NOTE: CFI probe will correctly detect flash part as 32M, but EMIF
- * limits addresses to 16M, so using addresses past 16M will wrap */
-static struct resource davinci_evm_norflash_resource = {
-       .start          = DM644X_ASYNC_EMIF_DATA_CE0_BASE,
-       .end            = DM644X_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
-       .flags          = IORESOURCE_MEM,
-};
-
-static struct platform_device davinci_evm_norflash_device = {
-       .name           = "physmap-flash",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &davinci_evm_norflash_data,
-       },
-       .num_resources  = 1,
-       .resource       = &davinci_evm_norflash_resource,
-};
-
-/* DM644x EVM includes a 64 MByte small-page NAND flash (16K blocks).
- * It may used instead of the (default) NOR chip to boot, using TI's
- * tools to install the secondary boot loader (UBL) and U-Boot.
- */
-static struct mtd_partition davinci_evm_nandflash_partition[] = {
-       /* Bootloader layout depends on whose u-boot is installed, but we
-        * can hide all the details.
-        *  - block 0 for u-boot environment ... in mainline u-boot
-        *  - block 1 for UBL (plus up to four backup copies in blocks 2..5)
-        *  - blocks 6...? for u-boot
-        *  - blocks 16..23 for u-boot environment ... in TI's u-boot
-        */
-       {
-               .name           = "bootloader",
-               .offset         = 0,
-               .size           = SZ_256K + SZ_128K,
-               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
-       },
-       /* Kernel */
-       {
-               .name           = "kernel",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = SZ_4M,
-               .mask_flags     = 0,
-       },
-       /* File system (older GIT kernels started this on the 5MB mark) */
-       {
-               .name           = "filesystem",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-               .mask_flags     = 0,
-       }
-       /* A few blocks at end hold a flash BBT ... created by TI's CCS
-        * using flashwriter_nand.out, but ignored by TI's versions of
-        * Linux and u-boot.  We boot faster by using them.
-        */
-};
-
-static struct davinci_aemif_timing davinci_evm_nandflash_timing = {
-       .wsetup         = 20,
-       .wstrobe        = 40,
-       .whold          = 20,
-       .rsetup         = 10,
-       .rstrobe        = 40,
-       .rhold          = 10,
-       .ta             = 40,
-};
-
-static struct davinci_nand_pdata davinci_evm_nandflash_data = {
-       .core_chipsel   = 0,
-       .parts          = davinci_evm_nandflash_partition,
-       .nr_parts       = ARRAY_SIZE(davinci_evm_nandflash_partition),
-       .engine_type    = NAND_ECC_ENGINE_TYPE_ON_HOST,
-       .ecc_bits       = 1,
-       .bbt_options    = NAND_BBT_USE_FLASH,
-       .timing         = &davinci_evm_nandflash_timing,
-};
-
-static struct resource davinci_evm_nandflash_resource[] = {
-       {
-               .start          = DM644X_ASYNC_EMIF_DATA_CE0_BASE,
-               .end            = DM644X_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
-               .flags          = IORESOURCE_MEM,
-       }, {
-               .start          = DM644X_ASYNC_EMIF_CONTROL_BASE,
-               .end            = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct resource davinci_evm_aemif_resource[] = {
-       {
-               .start          = DM644X_ASYNC_EMIF_CONTROL_BASE,
-               .end            = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct aemif_abus_data davinci_evm_aemif_abus_data[] = {
-       {
-               .cs             = 1,
-       },
-};
-
-static struct platform_device davinci_evm_nandflash_devices[] = {
-       {
-               .name           = "davinci_nand",
-               .id             = 0,
-               .dev            = {
-                       .platform_data  = &davinci_evm_nandflash_data,
-               },
-               .num_resources  = ARRAY_SIZE(davinci_evm_nandflash_resource),
-               .resource       = davinci_evm_nandflash_resource,
-       },
-};
-
-static struct aemif_platform_data davinci_evm_aemif_pdata = {
-       .abus_data = davinci_evm_aemif_abus_data,
-       .num_abus_data = ARRAY_SIZE(davinci_evm_aemif_abus_data),
-       .sub_devices = davinci_evm_nandflash_devices,
-       .num_sub_devices = ARRAY_SIZE(davinci_evm_nandflash_devices),
-};
-
-static struct platform_device davinci_evm_aemif_device = {
-       .name                   = "ti-aemif",
-       .id                     = -1,
-       .dev = {
-               .platform_data  = &davinci_evm_aemif_pdata,
-       },
-       .resource               = davinci_evm_aemif_resource,
-       .num_resources          = ARRAY_SIZE(davinci_evm_aemif_resource),
-};
-
-static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32);
-
-static struct platform_device davinci_fb_device = {
-       .name           = "davincifb",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = &davinci_fb_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-       .num_resources = 0,
-};
-
-static struct tvp514x_platform_data dm644xevm_tvp5146_pdata = {
-       .clk_polarity = 0,
-       .hs_polarity = 1,
-       .vs_polarity = 1
-};
-
-#define TVP514X_STD_ALL        (V4L2_STD_NTSC | V4L2_STD_PAL)
-/* Inputs available at the TVP5146 */
-static struct v4l2_input dm644xevm_tvp5146_inputs[] = {
-       {
-               .index = 0,
-               .name = "Composite",
-               .type = V4L2_INPUT_TYPE_CAMERA,
-               .std = TVP514X_STD_ALL,
-       },
-       {
-               .index = 1,
-               .name = "S-Video",
-               .type = V4L2_INPUT_TYPE_CAMERA,
-               .std = TVP514X_STD_ALL,
-       },
-};
-
-/*
- * this is the route info for connecting each input to decoder
- * ouput that goes to vpfe. There is a one to one correspondence
- * with tvp5146_inputs
- */
-static struct vpfe_route dm644xevm_tvp5146_routes[] = {
-       {
-               .input = INPUT_CVBS_VI2B,
-               .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
-       },
-       {
-               .input = INPUT_SVIDEO_VI2C_VI1C,
-               .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
-       },
-};
-
-static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = {
-       {
-               .name = "tvp5146",
-               .grp_id = 0,
-               .num_inputs = ARRAY_SIZE(dm644xevm_tvp5146_inputs),
-               .inputs = dm644xevm_tvp5146_inputs,
-               .routes = dm644xevm_tvp5146_routes,
-               .can_route = 1,
-               .ccdc_if_params = {
-                       .if_type = VPFE_BT656,
-                       .hdpol = VPFE_PINPOL_POSITIVE,
-                       .vdpol = VPFE_PINPOL_POSITIVE,
-               },
-               .board_info = {
-                       I2C_BOARD_INFO("tvp5146", 0x5d),
-                       .platform_data = &dm644xevm_tvp5146_pdata,
-               },
-       },
-};
-
-static struct vpfe_config dm644xevm_capture_cfg = {
-       .num_subdevs = ARRAY_SIZE(dm644xevm_vpfe_sub_devs),
-       .i2c_adapter_id = 1,
-       .sub_devs = dm644xevm_vpfe_sub_devs,
-       .card_name = "DM6446 EVM",
-       .ccdc = "DM6446 CCDC",
-};
-
-static struct platform_device rtc_dev = {
-       .name           = "rtc_davinci_evm",
-       .id             = -1,
-};
-
-/*----------------------------------------------------------------------*/
-#ifdef CONFIG_I2C
-/*
- * I2C GPIO expanders
- */
-
-#define PCF_Uxx_BASE(x)        (DAVINCI_N_GPIO + ((x) * 8))
-
-
-/* U2 -- LEDs */
-
-static struct gpio_led evm_leds[] = {
-       { .name = "DS8", .active_low = 1,
-               .default_trigger = "heartbeat", },
-       { .name = "DS7", .active_low = 1, },
-       { .name = "DS6", .active_low = 1, },
-       { .name = "DS5", .active_low = 1, },
-       { .name = "DS4", .active_low = 1, },
-       { .name = "DS3", .active_low = 1, },
-       { .name = "DS2", .active_low = 1,
-               .default_trigger = "mmc0", },
-       { .name = "DS1", .active_low = 1,
-               .default_trigger = "disk-activity", },
-};
-
-static const struct gpio_led_platform_data evm_led_data = {
-       .num_leds       = ARRAY_SIZE(evm_leds),
-       .leds           = evm_leds,
-};
-
-static struct platform_device *evm_led_dev;
-
-static int
-evm_led_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
-{
-       struct gpio_led *leds = evm_leds;
-       int status;
-
-       while (ngpio--) {
-               leds->gpio = gpio++;
-               leds++;
-       }
-
-       /* what an extremely annoying way to be forced to handle
-        * device unregistration ...
-        */
-       evm_led_dev = platform_device_alloc("leds-gpio", 0);
-       platform_device_add_data(evm_led_dev,
-                       &evm_led_data, sizeof evm_led_data);
-
-       evm_led_dev->dev.parent = &client->dev;
-       status = platform_device_add(evm_led_dev);
-       if (status < 0) {
-               platform_device_put(evm_led_dev);
-               evm_led_dev = NULL;
-       }
-       return status;
-}
-
-static void
-evm_led_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
-{
-       if (evm_led_dev) {
-               platform_device_unregister(evm_led_dev);
-               evm_led_dev = NULL;
-       }
-}
-
-static struct pcf857x_platform_data pcf_data_u2 = {
-       .gpio_base      = PCF_Uxx_BASE(0),
-       .setup          = evm_led_setup,
-       .teardown       = evm_led_teardown,
-};
-
-
-/* U18 - A/V clock generator and user switch */
-
-static int sw_gpio;
-
-static ssize_t
-sw_show(struct device *d, struct device_attribute *a, char *buf)
-{
-       char *s = gpio_get_value_cansleep(sw_gpio) ? "on\n" : "off\n";
-
-       strcpy(buf, s);
-       return strlen(s);
-}
-
-static DEVICE_ATTR(user_sw, S_IRUGO, sw_show, NULL);
-
-static int
-evm_u18_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
-{
-       int     status;
-
-       /* export dip switch option */
-       sw_gpio = gpio + 7;
-       status = gpio_request(sw_gpio, "user_sw");
-       if (status == 0)
-               status = gpio_direction_input(sw_gpio);
-       if (status == 0)
-               status = device_create_file(&client->dev, &dev_attr_user_sw);
-       else
-               gpio_free(sw_gpio);
-       if (status != 0)
-               sw_gpio = -EINVAL;
-
-       /* audio PLL:  48 kHz (vs 44.1 or 32), single rate (vs double) */
-       gpio_request(gpio + 3, "pll_fs2");
-       gpio_direction_output(gpio + 3, 0);
-
-       gpio_request(gpio + 2, "pll_fs1");
-       gpio_direction_output(gpio + 2, 0);
-
-       gpio_request(gpio + 1, "pll_sr");
-       gpio_direction_output(gpio + 1, 0);
-
-       return 0;
-}
-
-static void
-evm_u18_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
-{
-       gpio_free(gpio + 1);
-       gpio_free(gpio + 2);
-       gpio_free(gpio + 3);
-
-       if (sw_gpio > 0) {
-               device_remove_file(&client->dev, &dev_attr_user_sw);
-               gpio_free(sw_gpio);
-       }
-}
-
-static struct pcf857x_platform_data pcf_data_u18 = {
-       .gpio_base      = PCF_Uxx_BASE(1),
-       .n_latch        = (1 << 3) | (1 << 2) | (1 << 1),
-       .setup          = evm_u18_setup,
-       .teardown       = evm_u18_teardown,
-};
-
-
-/* U35 - various I/O signals used to manage USB, CF, ATA, etc */
-
-static int
-evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
-{
-       /* p0 = nDRV_VBUS (initial:  don't supply it) */
-       gpio_request(gpio + 0, "nDRV_VBUS");
-       gpio_direction_output(gpio + 0, 1);
-
-       /* p1 = VDDIMX_EN */
-       gpio_request(gpio + 1, "VDDIMX_EN");
-       gpio_direction_output(gpio + 1, 1);
-
-       /* p2 = VLYNQ_EN */
-       gpio_request(gpio + 2, "VLYNQ_EN");
-       gpio_direction_output(gpio + 2, 1);
-
-       /* p3 = n3V3_CF_RESET (initial: stay in reset) */
-       gpio_request(gpio + 3, "nCF_RESET");
-       gpio_direction_output(gpio + 3, 0);
-
-       /* (p4 unused) */
-
-       /* p5 = 1V8_WLAN_RESET (initial: stay in reset) */
-       gpio_request(gpio + 5, "WLAN_RESET");
-       gpio_direction_output(gpio + 5, 1);
-
-       /* p6 = nATA_SEL (initial: select) */
-       gpio_request(gpio + 6, "nATA_SEL");
-       gpio_direction_output(gpio + 6, 0);
-
-       /* p7 = nCF_SEL (initial: deselect) */
-       gpio_request(gpio + 7, "nCF_SEL");
-       gpio_direction_output(gpio + 7, 1);
-
-       return 0;
-}
-
-static void
-evm_u35_teardown(struct i2c_client *client, int gpio, unsigned ngpio, void *c)
-{
-       gpio_free(gpio + 7);
-       gpio_free(gpio + 6);
-       gpio_free(gpio + 5);
-       gpio_free(gpio + 3);
-       gpio_free(gpio + 2);
-       gpio_free(gpio + 1);
-       gpio_free(gpio + 0);
-}
-
-static struct pcf857x_platform_data pcf_data_u35 = {
-       .gpio_base      = PCF_Uxx_BASE(2),
-       .setup          = evm_u35_setup,
-       .teardown       = evm_u35_teardown,
-};
-
-/*----------------------------------------------------------------------*/
-
-/* Most of this EEPROM is unused, but U-Boot uses some data:
- *  - 0x7f00, 6 bytes Ethernet Address
- *  - 0x0039, 1 byte NTSC vs PAL (bit 0x80 == PAL)
- *  - ... newer boards may have more
- */
-
-static struct nvmem_cell_info dm644evm_nvmem_cells[] = {
-       {
-               .name           = "macaddr",
-               .offset         = 0x7f00,
-               .bytes          = ETH_ALEN,
-       }
-};
-
-static struct nvmem_cell_table dm644evm_nvmem_cell_table = {
-       .nvmem_name     = "1-00500",
-       .cells          = dm644evm_nvmem_cells,
-       .ncells         = ARRAY_SIZE(dm644evm_nvmem_cells),
-};
-
-static struct nvmem_cell_lookup dm644evm_nvmem_cell_lookup = {
-       .nvmem_name     = "1-00500",
-       .cell_name      = "macaddr",
-       .dev_id         = "davinci_emac.1",
-       .con_id         = "mac-address",
-};
-
-static const struct property_entry eeprom_properties[] = {
-       PROPERTY_ENTRY_U32("pagesize", 64),
-       { }
-};
-
-static const struct software_node eeprom_node = {
-       .properties = eeprom_properties,
-};
-
-/*
- * MSP430 supports RTC, card detection, input from IR remote, and
- * a bit more.  It triggers interrupts on GPIO(7) from pressing
- * buttons on the IR remote, and for card detect switches.
- */
-static struct i2c_client *dm6446evm_msp;
-
-static int dm6446evm_msp_probe(struct i2c_client *client)
-{
-       dm6446evm_msp = client;
-       return 0;
-}
-
-static int dm6446evm_msp_remove(struct i2c_client *client)
-{
-       dm6446evm_msp = NULL;
-       return 0;
-}
-
-static const struct i2c_device_id dm6446evm_msp_ids[] = {
-       { "dm6446evm_msp", 0, },
-       { /* end of list */ },
-};
-
-static struct i2c_driver dm6446evm_msp_driver = {
-       .driver.name    = "dm6446evm_msp",
-       .id_table       = dm6446evm_msp_ids,
-       .probe_new      = dm6446evm_msp_probe,
-       .remove         = dm6446evm_msp_remove,
-};
-
-static int dm6444evm_msp430_get_pins(void)
-{
-       static const char txbuf[2] = { 2, 4, };
-       char buf[4];
-       struct i2c_msg msg[2] = {
-               {
-                       .flags = 0,
-                       .len = 2,
-                       .buf = (void __force *)txbuf,
-               },
-               {
-                       .flags = I2C_M_RD,
-                       .len = 4,
-                       .buf = buf,
-               },
-       };
-       int status;
-
-       if (!dm6446evm_msp)
-               return -ENXIO;
-
-       msg[0].addr = dm6446evm_msp->addr;
-       msg[1].addr = dm6446evm_msp->addr;
-
-       /* Command 4 == get input state, returns port 2 and port3 data
-        *   S Addr W [A] len=2 [A] cmd=4 [A]
-        *   RS Addr R [A] [len=4] A [cmd=4] A [port2] A [port3] N P
-        */
-       status = i2c_transfer(dm6446evm_msp->adapter, msg, 2);
-       if (status < 0)
-               return status;
-
-       dev_dbg(&dm6446evm_msp->dev, "PINS: %4ph\n", buf);
-
-       return (buf[3] << 8) | buf[2];
-}
-
-static int dm6444evm_mmc_get_cd(int module)
-{
-       int status = dm6444evm_msp430_get_pins();
-
-       return (status < 0) ? status : !(status & BIT(1));
-}
-
-static int dm6444evm_mmc_get_ro(int module)
-{
-       int status = dm6444evm_msp430_get_pins();
-
-       return (status < 0) ? status : status & BIT(6 + 8);
-}
-
-static struct davinci_mmc_config dm6446evm_mmc_config = {
-       .get_cd         = dm6444evm_mmc_get_cd,
-       .get_ro         = dm6444evm_mmc_get_ro,
-       .wires          = 4,
-};
-
-static struct i2c_board_info __initdata i2c_info[] =  {
-       {
-               I2C_BOARD_INFO("dm6446evm_msp", 0x23),
-       },
-       {
-               I2C_BOARD_INFO("pcf8574", 0x38),
-               .platform_data  = &pcf_data_u2,
-       },
-       {
-               I2C_BOARD_INFO("pcf8574", 0x39),
-               .platform_data  = &pcf_data_u18,
-       },
-       {
-               I2C_BOARD_INFO("pcf8574", 0x3a),
-               .platform_data  = &pcf_data_u35,
-       },
-       {
-               I2C_BOARD_INFO("24c256", 0x50),
-               .swnode = &eeprom_node,
-       },
-       {
-               I2C_BOARD_INFO("tlv320aic33", 0x1b),
-       },
-};
-
-#define DM644X_I2C_SDA_PIN     GPIO_TO_PIN(2, 12)
-#define DM644X_I2C_SCL_PIN     GPIO_TO_PIN(2, 11)
-
-static struct gpiod_lookup_table i2c_recovery_gpiod_table = {
-       .dev_id = "i2c_davinci.1",
-       .table = {
-               GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SDA_PIN, "sda",
-                           GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
-               GPIO_LOOKUP("davinci_gpio", DM644X_I2C_SCL_PIN, "scl",
-                           GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
-               { }
-       },
-};
-
-/* The msp430 uses a slow bitbanged I2C implementation (ergo 20 KHz),
- * which requires 100 usec of idle bus after i2c writes sent to it.
- */
-static struct davinci_i2c_platform_data i2c_pdata = {
-       .bus_freq       = 20 /* kHz */,
-       .bus_delay      = 100 /* usec */,
-       .gpio_recovery  = true,
-};
-
-static void __init evm_init_i2c(void)
-{
-       gpiod_add_lookup_table(&i2c_recovery_gpiod_table);
-       davinci_init_i2c(&i2c_pdata);
-       i2c_add_driver(&dm6446evm_msp_driver);
-       i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
-}
-#endif
-
-/* Fixed regulator support */
-static struct regulator_consumer_supply fixed_supplies_3_3v[] = {
-       /* Baseboard 3.3V: 5V -> TPS54310PWP -> 3.3V */
-       REGULATOR_SUPPLY("AVDD", "1-001b"),
-       REGULATOR_SUPPLY("DRVDD", "1-001b"),
-};
-
-static struct regulator_consumer_supply fixed_supplies_1_8v[] = {
-       /* Baseboard 1.8V: 5V -> TPS54310PWP -> 1.8V */
-       REGULATOR_SUPPLY("IOVDD", "1-001b"),
-       REGULATOR_SUPPLY("DVDD", "1-001b"),
-};
-
-#define VENC_STD_ALL   (V4L2_STD_NTSC | V4L2_STD_PAL)
-
-/* venc standard timings */
-static struct vpbe_enc_mode_info dm644xevm_enc_std_timing[] = {
-       {
-               .name           = "ntsc",
-               .timings_type   = VPBE_ENC_STD,
-               .std_id         = V4L2_STD_NTSC,
-               .interlaced     = 1,
-               .xres           = 720,
-               .yres           = 480,
-               .aspect         = {11, 10},
-               .fps            = {30000, 1001},
-               .left_margin    = 0x79,
-               .upper_margin   = 0x10,
-       },
-       {
-               .name           = "pal",
-               .timings_type   = VPBE_ENC_STD,
-               .std_id         = V4L2_STD_PAL,
-               .interlaced     = 1,
-               .xres           = 720,
-               .yres           = 576,
-               .aspect         = {54, 59},
-               .fps            = {25, 1},
-               .left_margin    = 0x7e,
-               .upper_margin   = 0x16,
-       },
-};
-
-/* venc dv preset timings */
-static struct vpbe_enc_mode_info dm644xevm_enc_preset_timing[] = {
-       {
-               .name           = "480p59_94",
-               .timings_type   = VPBE_ENC_DV_TIMINGS,
-               .dv_timings     = V4L2_DV_BT_CEA_720X480P59_94,
-               .interlaced     = 0,
-               .xres           = 720,
-               .yres           = 480,
-               .aspect         = {1, 1},
-               .fps            = {5994, 100},
-               .left_margin    = 0x80,
-               .upper_margin   = 0x20,
-       },
-       {
-               .name           = "576p50",
-               .timings_type   = VPBE_ENC_DV_TIMINGS,
-               .dv_timings     = V4L2_DV_BT_CEA_720X576P50,
-               .interlaced     = 0,
-               .xres           = 720,
-               .yres           = 576,
-               .aspect         = {1, 1},
-               .fps            = {50, 1},
-               .left_margin    = 0x7e,
-               .upper_margin   = 0x30,
-       },
-};
-
-/*
- * The outputs available from VPBE + encoders. Keep the order same
- * as that of encoders. First those from venc followed by that from
- * encoders. Index in the output refers to index on a particular encoder.
- * Driver uses this index to pass it to encoder when it supports more
- * than one output. Userspace applications use index of the array to
- * set an output.
- */
-static struct vpbe_output dm644xevm_vpbe_outputs[] = {
-       {
-               .output         = {
-                       .index          = 0,
-                       .name           = "Composite",
-                       .type           = V4L2_OUTPUT_TYPE_ANALOG,
-                       .std            = VENC_STD_ALL,
-                       .capabilities   = V4L2_OUT_CAP_STD,
-               },
-               .subdev_name    = DM644X_VPBE_VENC_SUBDEV_NAME,
-               .default_mode   = "ntsc",
-               .num_modes      = ARRAY_SIZE(dm644xevm_enc_std_timing),
-               .modes          = dm644xevm_enc_std_timing,
-       },
-       {
-               .output         = {
-                       .index          = 1,
-                       .name           = "Component",
-                       .type           = V4L2_OUTPUT_TYPE_ANALOG,
-                       .capabilities   = V4L2_OUT_CAP_DV_TIMINGS,
-               },
-               .subdev_name    = DM644X_VPBE_VENC_SUBDEV_NAME,
-               .default_mode   = "480p59_94",
-               .num_modes      = ARRAY_SIZE(dm644xevm_enc_preset_timing),
-               .modes          = dm644xevm_enc_preset_timing,
-       },
-};
-
-static struct vpbe_config dm644xevm_display_cfg = {
-       .module_name    = "dm644x-vpbe-display",
-       .i2c_adapter_id = 1,
-       .osd            = {
-               .module_name    = DM644X_VPBE_OSD_SUBDEV_NAME,
-       },
-       .venc           = {
-               .module_name    = DM644X_VPBE_VENC_SUBDEV_NAME,
-       },
-       .num_outputs    = ARRAY_SIZE(dm644xevm_vpbe_outputs),
-       .outputs        = dm644xevm_vpbe_outputs,
-};
-
-static struct platform_device *davinci_evm_devices[] __initdata = {
-       &davinci_fb_device,
-       &rtc_dev,
-};
-
-static void __init
-davinci_evm_map_io(void)
-{
-       dm644x_init();
-}
-
-static int davinci_phy_fixup(struct phy_device *phydev)
-{
-       unsigned int control;
-       /* CRITICAL: Fix for increasing PHY signal drive strength for
-        * TX lockup issue. On DaVinci EVM, the Intel LXT971 PHY
-        * signal strength was low causing  TX to fail randomly. The
-        * fix is to Set bit 11 (Increased MII drive strength) of PHY
-        * register 26 (Digital Config register) on this phy. */
-       control = phy_read(phydev, 26);
-       phy_write(phydev, 26, (control | 0x800));
-       return 0;
-}
-
-#define HAS_ATA                (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
-                        IS_ENABLED(CONFIG_PATA_BK3710))
-
-#define HAS_NOR                IS_ENABLED(CONFIG_MTD_PHYSMAP)
-
-#define HAS_NAND       IS_ENABLED(CONFIG_MTD_NAND_DAVINCI)
-
-#define GPIO_nVBUS_DRV         160
-
-static struct gpiod_lookup_table dm644evm_usb_gpio_table = {
-       .dev_id = "musb-davinci",
-       .table = {
-               GPIO_LOOKUP("davinci_gpio", GPIO_nVBUS_DRV, NULL,
-                           GPIO_ACTIVE_HIGH),
-               { }
-       },
-};
-
-static __init void davinci_evm_init(void)
-{
-       int ret;
-       struct clk *aemif_clk;
-       struct davinci_soc_info *soc_info = &davinci_soc_info;
-
-       dm644x_register_clocks();
-
-       regulator_register_always_on(0, "fixed-dummy", fixed_supplies_1_8v,
-                                    ARRAY_SIZE(fixed_supplies_1_8v), 1800000);
-       regulator_register_always_on(1, "fixed-dummy", fixed_supplies_3_3v,
-                                    ARRAY_SIZE(fixed_supplies_3_3v), 3300000);
-
-       dm644x_init_devices();
-
-       ret = dm644x_gpio_register();
-       if (ret)
-               pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
-
-       aemif_clk = clk_get(NULL, "aemif");
-       clk_prepare_enable(aemif_clk);
-
-       if (HAS_ATA) {
-               if (HAS_NAND || HAS_NOR)
-                       pr_warn("WARNING: both IDE and Flash are enabled, but they share AEMIF pins\n"
-                               "\tDisable IDE for NAND/NOR support\n");
-               davinci_init_ide();
-       } else if (HAS_NAND || HAS_NOR) {
-               davinci_cfg_reg(DM644X_HPIEN_DISABLE);
-               davinci_cfg_reg(DM644X_ATAEN_DISABLE);
-
-               /* only one device will be jumpered and detected */
-               if (HAS_NAND) {
-                       platform_device_register(&davinci_evm_aemif_device);
-#ifdef CONFIG_I2C
-                       evm_leds[7].default_trigger = "nand-disk";
-#endif
-                       if (HAS_NOR)
-                               pr_warn("WARNING: both NAND and NOR flash are enabled; disable one of them.\n");
-               } else if (HAS_NOR)
-                       platform_device_register(&davinci_evm_norflash_device);
-       }
-
-       platform_add_devices(davinci_evm_devices,
-                            ARRAY_SIZE(davinci_evm_devices));
-#ifdef CONFIG_I2C
-       nvmem_add_cell_table(&dm644evm_nvmem_cell_table);
-       nvmem_add_cell_lookups(&dm644evm_nvmem_cell_lookup, 1);
-       evm_init_i2c();
-       davinci_setup_mmc(0, &dm6446evm_mmc_config);
-#endif
-       dm644x_init_video(&dm644xevm_capture_cfg, &dm644xevm_display_cfg);
-
-       davinci_serial_init(dm644x_serial_device);
-       dm644x_init_asp();
-
-       /* irlml6401 switches over 1A, in under 8 msec */
-       gpiod_add_lookup_table(&dm644evm_usb_gpio_table);
-       davinci_setup_usb(1000, 8);
-
-       if (IS_BUILTIN(CONFIG_PHYLIB)) {
-               soc_info->emac_pdata->phy_id = DM644X_EVM_PHY_ID;
-               /* Register the fixup for PHY on DaVinci */
-               phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
-                                               davinci_phy_fixup);
-       }
-}
-
-MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
-       /* Maintainer: MontaVista Software <source@mvista.com> */
-       .atag_offset  = 0x100,
-       .map_io       = davinci_evm_map_io,
-       .init_irq     = dm644x_init_irq,
-       .init_time      = dm644x_init_time,
-       .init_machine = davinci_evm_init,
-       .init_late      = davinci_init_late,
-       .dma_zone_size  = SZ_128M,
-MACHINE_END
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
deleted file mode 100644 (file)
index 84ad065..0000000
+++ /dev/null
@@ -1,873 +0,0 @@
-/*
- * TI DaVinci DM646X EVM board
- *
- * Derived from: arch/arm/mach-davinci/board-evm.c
- * Copyright (C) 2006 Texas Instruments.
- *
- * (C) 2007-2008, MontaVista Software, Inc.
- *
- * This file is licensed under the terms of the GNU General Public License
- * version 2. This program is licensed "as is" without any warranty of any
- * kind, whether express or implied.
- *
- */
-
-/**************************************************************************
- * Included Files
- **************************************************************************/
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/leds.h>
-#include <linux/gpio.h>
-#include <linux/platform_device.h>
-#include <linux/i2c.h>
-#include <linux/property.h>
-#include <linux/platform_data/pcf857x.h>
-#include <linux/platform_data/ti-aemif.h>
-
-#include <media/i2c/tvp514x.h>
-#include <media/i2c/adv7343.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/rawnand.h>
-#include <linux/mtd/partitions.h>
-#include <linux/nvmem-provider.h>
-#include <linux/clk.h>
-#include <linux/export.h>
-#include <linux/platform_data/gpio-davinci.h>
-#include <linux/platform_data/i2c-davinci.h>
-#include <linux/platform_data/mtd-davinci.h>
-#include <linux/platform_data/mtd-davinci-aemif.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "serial.h"
-#include "davinci.h"
-#include "irqs.h"
-
-#define NAND_BLOCK_SIZE                SZ_128K
-
-/* Note: We are setting first partition as 'bootloader' constituting UBL, U-Boot
- * and U-Boot environment this avoids dependency on any particular combination
- * of UBL, U-Boot or flashing tools etc.
- */
-static struct mtd_partition davinci_nand_partitions[] = {
-       {
-               /* UBL, U-Boot with environment */
-               .name           = "bootloader",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 16 * NAND_BLOCK_SIZE,
-               .mask_flags     = MTD_WRITEABLE,        /* force read-only */
-       }, {
-               .name           = "kernel",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = SZ_4M,
-               .mask_flags     = 0,
-       }, {
-               .name           = "filesystem",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-               .mask_flags     = 0,
-       }
-};
-
-static struct davinci_aemif_timing dm6467tevm_nandflash_timing = {
-       .wsetup         = 29,
-       .wstrobe        = 24,
-       .whold          = 14,
-       .rsetup         = 19,
-       .rstrobe        = 33,
-       .rhold          = 0,
-       .ta             = 29,
-};
-
-static struct davinci_nand_pdata davinci_nand_data = {
-       .core_chipsel           = 0,
-       .mask_cle               = 0x80000,
-       .mask_ale               = 0x40000,
-       .parts                  = davinci_nand_partitions,
-       .nr_parts               = ARRAY_SIZE(davinci_nand_partitions),
-       .engine_type            = NAND_ECC_ENGINE_TYPE_ON_HOST,
-       .ecc_bits               = 1,
-       .options                = 0,
-};
-
-static struct resource davinci_nand_resources[] = {
-       {
-               .start          = DM646X_ASYNC_EMIF_CS2_SPACE_BASE,
-               .end            = DM646X_ASYNC_EMIF_CS2_SPACE_BASE + SZ_32M - 1,
-               .flags          = IORESOURCE_MEM,
-       }, {
-               .start          = DM646X_ASYNC_EMIF_CONTROL_BASE,
-               .end            = DM646X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device davinci_aemif_devices[] = {
-       {
-               .name           = "davinci_nand",
-               .id             = 0,
-               .num_resources  = ARRAY_SIZE(davinci_nand_resources),
-               .resource       = davinci_nand_resources,
-               .dev            = {
-                       .platform_data  = &davinci_nand_data,
-               },
-       },
-};
-
-static struct resource davinci_aemif_resources[] = {
-       {
-               .start  = DM646X_ASYNC_EMIF_CONTROL_BASE,
-               .end    = DM646X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct aemif_abus_data davinci_aemif_abus_data[] = {
-       {
-               .cs     = 1,
-       },
-};
-
-static struct aemif_platform_data davinci_aemif_pdata = {
-       .abus_data              = davinci_aemif_abus_data,
-       .num_abus_data          = ARRAY_SIZE(davinci_aemif_abus_data),
-       .sub_devices            = davinci_aemif_devices,
-       .num_sub_devices        = ARRAY_SIZE(davinci_aemif_devices),
-};
-
-static struct platform_device davinci_aemif_device = {
-       .name           = "ti-aemif",
-       .id             = -1,
-       .dev = {
-               .platform_data  = &davinci_aemif_pdata,
-       },
-       .resource       = davinci_aemif_resources,
-       .num_resources  = ARRAY_SIZE(davinci_aemif_resources),
-};
-
-#define HAS_ATA                (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
-                        IS_ENABLED(CONFIG_PATA_BK3710))
-
-#ifdef CONFIG_I2C
-/* CPLD Register 0 bits to control ATA */
-#define DM646X_EVM_ATA_RST             BIT(0)
-#define DM646X_EVM_ATA_PWD             BIT(1)
-
-/* CPLD Register 0 Client: used for I/O Control */
-static int cpld_reg0_probe(struct i2c_client *client)
-{
-       if (HAS_ATA) {
-               u8 data;
-               struct i2c_msg msg[2] = {
-                       {
-                               .addr = client->addr,
-                               .flags = I2C_M_RD,
-                               .len = 1,
-                               .buf = &data,
-                       },
-                       {
-                               .addr = client->addr,
-                               .flags = 0,
-                               .len = 1,
-                               .buf = &data,
-                       },
-               };
-
-               /* Clear ATA_RSTn and ATA_PWD bits to enable ATA operation. */
-               i2c_transfer(client->adapter, msg, 1);
-               data &= ~(DM646X_EVM_ATA_RST | DM646X_EVM_ATA_PWD);
-               i2c_transfer(client->adapter, msg + 1, 1);
-       }
-
-       return 0;
-}
-
-static const struct i2c_device_id cpld_reg_ids[] = {
-       { "cpld_reg0", 0, },
-       { },
-};
-
-static struct i2c_driver dm6467evm_cpld_driver = {
-       .driver.name    = "cpld_reg0",
-       .id_table       = cpld_reg_ids,
-       .probe_new      = cpld_reg0_probe,
-};
-
-/* LEDS */
-
-static struct gpio_led evm_leds[] = {
-       { .name = "DS1", .active_low = 1, },
-       { .name = "DS2", .active_low = 1, },
-       { .name = "DS3", .active_low = 1, },
-       { .name = "DS4", .active_low = 1, },
-};
-
-static const struct gpio_led_platform_data evm_led_data = {
-       .num_leds = ARRAY_SIZE(evm_leds),
-       .leds     = evm_leds,
-};
-
-static struct platform_device *evm_led_dev;
-
-static int evm_led_setup(struct i2c_client *client, int gpio,
-                       unsigned int ngpio, void *c)
-{
-       struct gpio_led *leds = evm_leds;
-       int status;
-
-       while (ngpio--) {
-               leds->gpio = gpio++;
-               leds++;
-       }
-
-       evm_led_dev = platform_device_alloc("leds-gpio", 0);
-       platform_device_add_data(evm_led_dev, &evm_led_data,
-                               sizeof(evm_led_data));
-
-       evm_led_dev->dev.parent = &client->dev;
-       status = platform_device_add(evm_led_dev);
-       if (status < 0) {
-               platform_device_put(evm_led_dev);
-               evm_led_dev = NULL;
-       }
-       return status;
-}
-
-static int evm_led_teardown(struct i2c_client *client, int gpio,
-                               unsigned ngpio, void *c)
-{
-       if (evm_led_dev) {
-               platform_device_unregister(evm_led_dev);
-               evm_led_dev = NULL;
-       }
-       return 0;
-}
-
-static int evm_sw_gpio[4] = { -EINVAL, -EINVAL, -EINVAL, -EINVAL };
-
-static int evm_sw_setup(struct i2c_client *client, int gpio,
-                       unsigned ngpio, void *c)
-{
-       int status;
-       int i;
-       char label[10];
-
-       for (i = 0; i < 4; ++i) {
-               snprintf(label, 10, "user_sw%d", i);
-               status = gpio_request(gpio, label);
-               if (status)
-                       goto out_free;
-               evm_sw_gpio[i] = gpio++;
-
-               status = gpio_direction_input(evm_sw_gpio[i]);
-               if (status)
-                       goto out_free;
-
-               status = gpio_export(evm_sw_gpio[i], 0);
-               if (status)
-                       goto out_free;
-       }
-       return 0;
-
-out_free:
-       for (i = 0; i < 4; ++i) {
-               if (evm_sw_gpio[i] != -EINVAL) {
-                       gpio_free(evm_sw_gpio[i]);
-                       evm_sw_gpio[i] = -EINVAL;
-               }
-       }
-       return status;
-}
-
-static int evm_sw_teardown(struct i2c_client *client, int gpio,
-                       unsigned ngpio, void *c)
-{
-       int i;
-
-       for (i = 0; i < 4; ++i) {
-               if (evm_sw_gpio[i] != -EINVAL) {
-                       gpio_unexport(evm_sw_gpio[i]);
-                       gpio_free(evm_sw_gpio[i]);
-                       evm_sw_gpio[i] = -EINVAL;
-               }
-       }
-       return 0;
-}
-
-static int evm_pcf_setup(struct i2c_client *client, int gpio,
-                       unsigned int ngpio, void *c)
-{
-       int status;
-
-       if (ngpio < 8)
-               return -EINVAL;
-
-       status = evm_sw_setup(client, gpio, 4, c);
-       if (status)
-               return status;
-
-       return evm_led_setup(client, gpio+4, 4, c);
-}
-
-static void evm_pcf_teardown(struct i2c_client *client, int gpio,
-                       unsigned int ngpio, void *c)
-{
-       BUG_ON(ngpio < 8);
-
-       evm_sw_teardown(client, gpio, 4, c);
-       evm_led_teardown(client, gpio+4, 4, c);
-}
-
-static struct pcf857x_platform_data pcf_data = {
-       .gpio_base      = DAVINCI_N_GPIO+1,
-       .setup          = evm_pcf_setup,
-       .teardown       = evm_pcf_teardown,
-};
-
-/* Most of this EEPROM is unused, but U-Boot uses some data:
- *  - 0x7f00, 6 bytes Ethernet Address
- *  - ... newer boards may have more
- */
-
-static struct nvmem_cell_info dm646x_evm_nvmem_cells[] = {
-       {
-               .name           = "macaddr",
-               .offset         = 0x7f00,
-               .bytes          = ETH_ALEN,
-       }
-};
-
-static struct nvmem_cell_table dm646x_evm_nvmem_cell_table = {
-       .nvmem_name     = "1-00500",
-       .cells          = dm646x_evm_nvmem_cells,
-       .ncells         = ARRAY_SIZE(dm646x_evm_nvmem_cells),
-};
-
-static struct nvmem_cell_lookup dm646x_evm_nvmem_cell_lookup = {
-       .nvmem_name     = "1-00500",
-       .cell_name      = "macaddr",
-       .dev_id         = "davinci_emac.1",
-       .con_id         = "mac-address",
-};
-
-static const struct property_entry eeprom_properties[] = {
-       PROPERTY_ENTRY_U32("pagesize", 64),
-       { }
-};
-
-static const struct software_node eeprom_node = {
-       .properties = eeprom_properties,
-};
-#endif
-
-static u8 dm646x_iis_serializer_direction[] = {
-       TX_MODE, RX_MODE, INACTIVE_MODE, INACTIVE_MODE,
-};
-
-static u8 dm646x_dit_serializer_direction[] = {
-       TX_MODE,
-};
-
-static struct snd_platform_data dm646x_evm_snd_data[] = {
-       {
-               .tx_dma_offset  = 0x400,
-               .rx_dma_offset  = 0x400,
-               .op_mode        = DAVINCI_MCASP_IIS_MODE,
-               .num_serializer = ARRAY_SIZE(dm646x_iis_serializer_direction),
-               .tdm_slots      = 2,
-               .serial_dir     = dm646x_iis_serializer_direction,
-               .asp_chan_q     = EVENTQ_0,
-       },
-       {
-               .tx_dma_offset  = 0x400,
-               .rx_dma_offset  = 0,
-               .op_mode        = DAVINCI_MCASP_DIT_MODE,
-               .num_serializer = ARRAY_SIZE(dm646x_dit_serializer_direction),
-               .tdm_slots      = 32,
-               .serial_dir     = dm646x_dit_serializer_direction,
-               .asp_chan_q     = EVENTQ_0,
-       },
-};
-
-#ifdef CONFIG_I2C
-static struct i2c_client *cpld_client;
-
-static int cpld_video_probe(struct i2c_client *client)
-{
-       cpld_client = client;
-       return 0;
-}
-
-static int cpld_video_remove(struct i2c_client *client)
-{
-       cpld_client = NULL;
-       return 0;
-}
-
-static const struct i2c_device_id cpld_video_id[] = {
-       { "cpld_video", 0 },
-       { }
-};
-
-static struct i2c_driver cpld_video_driver = {
-       .driver = {
-               .name   = "cpld_video",
-       },
-       .probe_new      = cpld_video_probe,
-       .remove         = cpld_video_remove,
-       .id_table       = cpld_video_id,
-};
-
-static void evm_init_cpld(void)
-{
-       i2c_add_driver(&cpld_video_driver);
-}
-
-static struct i2c_board_info __initdata i2c_info[] =  {
-       {
-               I2C_BOARD_INFO("24c256", 0x50),
-               .swnode = &eeprom_node,
-       },
-       {
-               I2C_BOARD_INFO("pcf8574a", 0x38),
-               .platform_data  = &pcf_data,
-       },
-       {
-               I2C_BOARD_INFO("cpld_reg0", 0x3a),
-       },
-       {
-               I2C_BOARD_INFO("tlv320aic33", 0x18),
-       },
-       {
-               I2C_BOARD_INFO("cpld_video", 0x3b),
-       },
-};
-
-static struct davinci_i2c_platform_data i2c_pdata = {
-       .bus_freq       = 100 /* kHz */,
-       .bus_delay      = 0 /* usec */,
-};
-
-#define VCH2CLK_MASK           (BIT_MASK(10) | BIT_MASK(9) | BIT_MASK(8))
-#define VCH2CLK_SYSCLK8                (BIT(9))
-#define VCH2CLK_AUXCLK         (BIT(9) | BIT(8))
-#define VCH3CLK_MASK           (BIT_MASK(14) | BIT_MASK(13) | BIT_MASK(12))
-#define VCH3CLK_SYSCLK8                (BIT(13))
-#define VCH3CLK_AUXCLK         (BIT(14) | BIT(13))
-
-#define VIDCH2CLK              (BIT(10))
-#define VIDCH3CLK              (BIT(11))
-#define VIDCH1CLK              (BIT(4))
-#define TVP7002_INPUT          (BIT(4))
-#define TVP5147_INPUT          (~BIT(4))
-#define VPIF_INPUT_ONE_CHANNEL (BIT(5))
-#define VPIF_INPUT_TWO_CHANNEL (~BIT(5))
-#define TVP5147_CH0            "tvp514x-0"
-#define TVP5147_CH1            "tvp514x-1"
-
-/* spin lock for updating above registers */
-static spinlock_t vpif_reg_lock;
-
-static int set_vpif_clock(int mux_mode, int hd)
-{
-       unsigned long flags;
-       unsigned int value;
-       int val = 0;
-       int err = 0;
-
-       if (!cpld_client)
-               return -ENXIO;
-
-       /* disable the clock */
-       spin_lock_irqsave(&vpif_reg_lock, flags);
-       value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
-       value |= (VIDCH3CLK | VIDCH2CLK);
-       __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
-       spin_unlock_irqrestore(&vpif_reg_lock, flags);
-
-       val = i2c_smbus_read_byte(cpld_client);
-       if (val < 0)
-               return val;
-
-       if (mux_mode == 1)
-               val &= ~0x40;
-       else
-               val |= 0x40;
-
-       err = i2c_smbus_write_byte(cpld_client, val);
-       if (err)
-               return err;
-
-       value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
-       value &= ~(VCH2CLK_MASK);
-       value &= ~(VCH3CLK_MASK);
-
-       if (hd >= 1)
-               value |= (VCH2CLK_SYSCLK8 | VCH3CLK_SYSCLK8);
-       else
-               value |= (VCH2CLK_AUXCLK | VCH3CLK_AUXCLK);
-
-       __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
-
-       spin_lock_irqsave(&vpif_reg_lock, flags);
-       value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
-       /* enable the clock */
-       value &= ~(VIDCH3CLK | VIDCH2CLK);
-       __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
-       spin_unlock_irqrestore(&vpif_reg_lock, flags);
-
-       return 0;
-}
-
-static struct vpif_subdev_info dm646x_vpif_subdev[] = {
-       {
-               .name   = "adv7343",
-               .board_info = {
-                       I2C_BOARD_INFO("adv7343", 0x2a),
-               },
-       },
-       {
-               .name   = "ths7303",
-               .board_info = {
-                       I2C_BOARD_INFO("ths7303", 0x2c),
-               },
-       },
-};
-
-static const struct vpif_output dm6467_ch0_outputs[] = {
-       {
-               .output = {
-                       .index = 0,
-                       .name = "Composite",
-                       .type = V4L2_OUTPUT_TYPE_ANALOG,
-                       .capabilities = V4L2_OUT_CAP_STD,
-                       .std = V4L2_STD_ALL,
-               },
-               .subdev_name = "adv7343",
-               .output_route = ADV7343_COMPOSITE_ID,
-       },
-       {
-               .output = {
-                       .index = 1,
-                       .name = "Component",
-                       .type = V4L2_OUTPUT_TYPE_ANALOG,
-                       .capabilities = V4L2_OUT_CAP_DV_TIMINGS,
-               },
-               .subdev_name = "adv7343",
-               .output_route = ADV7343_COMPONENT_ID,
-       },
-       {
-               .output = {
-                       .index = 2,
-                       .name = "S-Video",
-                       .type = V4L2_OUTPUT_TYPE_ANALOG,
-                       .capabilities = V4L2_OUT_CAP_STD,
-                       .std = V4L2_STD_ALL,
-               },
-               .subdev_name = "adv7343",
-               .output_route = ADV7343_SVIDEO_ID,
-       },
-};
-
-static struct vpif_display_config dm646x_vpif_display_config = {
-       .set_clock      = set_vpif_clock,
-       .subdevinfo     = dm646x_vpif_subdev,
-       .subdev_count   = ARRAY_SIZE(dm646x_vpif_subdev),
-       .i2c_adapter_id = 1,
-       .chan_config[0] = {
-               .outputs = dm6467_ch0_outputs,
-               .output_count = ARRAY_SIZE(dm6467_ch0_outputs),
-       },
-       .card_name      = "DM646x EVM Video Display",
-};
-
-/**
- * setup_vpif_input_path()
- * @channel: channel id (0 - CH0, 1 - CH1)
- * @sub_dev_name: ptr sub device name
- *
- * This will set vpif input to capture data from tvp514x or
- * tvp7002.
- */
-static int setup_vpif_input_path(int channel, const char *sub_dev_name)
-{
-       int err = 0;
-       int val;
-
-       /* for channel 1, we don't do anything */
-       if (channel != 0)
-               return 0;
-
-       if (!cpld_client)
-               return -ENXIO;
-
-       val = i2c_smbus_read_byte(cpld_client);
-       if (val < 0)
-               return val;
-
-       if (!strcmp(sub_dev_name, TVP5147_CH0) ||
-           !strcmp(sub_dev_name, TVP5147_CH1))
-               val &= TVP5147_INPUT;
-       else
-               val |= TVP7002_INPUT;
-
-       err = i2c_smbus_write_byte(cpld_client, val);
-       if (err)
-               return err;
-       return 0;
-}
-
-/**
- * setup_vpif_input_channel_mode()
- * @mux_mode:  mux mode. 0 - 1 channel or (1) - 2 channel
- *
- * This will setup input mode to one channel (TVP7002) or 2 channel (TVP5147)
- */
-static int setup_vpif_input_channel_mode(int mux_mode)
-{
-       unsigned long flags;
-       int err = 0;
-       int val;
-       u32 value;
-
-       if (!cpld_client)
-               return -ENXIO;
-
-       val = i2c_smbus_read_byte(cpld_client);
-       if (val < 0)
-               return val;
-
-       spin_lock_irqsave(&vpif_reg_lock, flags);
-       value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
-       if (mux_mode) {
-               val &= VPIF_INPUT_TWO_CHANNEL;
-               value |= VIDCH1CLK;
-       } else {
-               val |= VPIF_INPUT_ONE_CHANNEL;
-               value &= ~VIDCH1CLK;
-       }
-       __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
-       spin_unlock_irqrestore(&vpif_reg_lock, flags);
-
-       err = i2c_smbus_write_byte(cpld_client, val);
-       if (err)
-               return err;
-
-       return 0;
-}
-
-static struct tvp514x_platform_data tvp5146_pdata = {
-       .clk_polarity = 0,
-       .hs_polarity = 1,
-       .vs_polarity = 1
-};
-
-#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
-
-static struct vpif_subdev_info vpif_capture_sdev_info[] = {
-       {
-               .name   = TVP5147_CH0,
-               .board_info = {
-                       I2C_BOARD_INFO("tvp5146", 0x5d),
-                       .platform_data = &tvp5146_pdata,
-               },
-       },
-       {
-               .name   = TVP5147_CH1,
-               .board_info = {
-                       I2C_BOARD_INFO("tvp5146", 0x5c),
-                       .platform_data = &tvp5146_pdata,
-               },
-       },
-};
-
-static struct vpif_input dm6467_ch0_inputs[] = {
-       {
-               .input = {
-                       .index = 0,
-                       .name = "Composite",
-                       .type = V4L2_INPUT_TYPE_CAMERA,
-                       .capabilities = V4L2_IN_CAP_STD,
-                       .std = TVP514X_STD_ALL,
-               },
-               .subdev_name = TVP5147_CH0,
-               .input_route = INPUT_CVBS_VI2B,
-               .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
-       },
-};
-
-static struct vpif_input dm6467_ch1_inputs[] = {
-       {
-               .input = {
-                       .index = 0,
-                       .name = "S-Video",
-                       .type = V4L2_INPUT_TYPE_CAMERA,
-                       .capabilities = V4L2_IN_CAP_STD,
-                       .std = TVP514X_STD_ALL,
-               },
-               .subdev_name = TVP5147_CH1,
-               .input_route = INPUT_SVIDEO_VI2C_VI1C,
-               .output_route = OUTPUT_10BIT_422_EMBEDDED_SYNC,
-       },
-};
-
-static struct vpif_capture_config dm646x_vpif_capture_cfg = {
-       .setup_input_path = setup_vpif_input_path,
-       .setup_input_channel_mode = setup_vpif_input_channel_mode,
-       .subdev_info = vpif_capture_sdev_info,
-       .subdev_count = ARRAY_SIZE(vpif_capture_sdev_info),
-       .i2c_adapter_id = 1,
-       .chan_config[0] = {
-               .inputs = dm6467_ch0_inputs,
-               .input_count = ARRAY_SIZE(dm6467_ch0_inputs),
-               .vpif_if = {
-                       .if_type = VPIF_IF_BT656,
-                       .hd_pol = 1,
-                       .vd_pol = 1,
-                       .fid_pol = 0,
-               },
-       },
-       .chan_config[1] = {
-               .inputs = dm6467_ch1_inputs,
-               .input_count = ARRAY_SIZE(dm6467_ch1_inputs),
-               .vpif_if = {
-                       .if_type = VPIF_IF_BT656,
-                       .hd_pol = 1,
-                       .vd_pol = 1,
-                       .fid_pol = 0,
-               },
-       },
-       .card_name = "DM646x EVM Video Capture",
-};
-
-static void __init evm_init_video(void)
-{
-       spin_lock_init(&vpif_reg_lock);
-
-       dm646x_setup_vpif(&dm646x_vpif_display_config,
-                         &dm646x_vpif_capture_cfg);
-}
-
-static void __init evm_init_i2c(void)
-{
-       davinci_init_i2c(&i2c_pdata);
-       i2c_add_driver(&dm6467evm_cpld_driver);
-       i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
-       evm_init_cpld();
-       evm_init_video();
-}
-#endif
-
-#define DM646X_REF_FREQ                        27000000
-#define DM646X_AUX_FREQ                        24000000
-#define DM6467T_EVM_REF_FREQ           33000000
-
-static void __init davinci_map_io(void)
-{
-       dm646x_init();
-}
-
-static void __init dm646x_evm_init_time(void)
-{
-       dm646x_init_time(DM646X_REF_FREQ, DM646X_AUX_FREQ);
-}
-
-static void __init dm6467t_evm_init_time(void)
-{
-       dm646x_init_time(DM6467T_EVM_REF_FREQ, DM646X_AUX_FREQ);
-}
-
-#define DM646X_EVM_PHY_ID              "davinci_mdio-0:01"
-/*
- * The following EDMA channels/slots are not being used by drivers (for
- * example: Timer, GPIO, UART events etc) on dm646x, hence they are being
- * reserved for codecs on the DSP side.
- */
-static const s16 dm646x_dma_rsv_chans[][2] = {
-       /* (offset, number) */
-       { 0,  4},
-       {13,  3},
-       {24,  4},
-       {30,  2},
-       {54,  3},
-       {-1, -1}
-};
-
-static const s16 dm646x_dma_rsv_slots[][2] = {
-       /* (offset, number) */
-       { 0,  4},
-       {13,  3},
-       {24,  4},
-       {30,  2},
-       {54,  3},
-       {128, 384},
-       {-1, -1}
-};
-
-static struct edma_rsv_info dm646x_edma_rsv[] = {
-       {
-               .rsv_chans      = dm646x_dma_rsv_chans,
-               .rsv_slots      = dm646x_dma_rsv_slots,
-       },
-};
-
-static __init void evm_init(void)
-{
-       int ret;
-       struct davinci_soc_info *soc_info = &davinci_soc_info;
-
-       dm646x_register_clocks();
-
-       ret = dm646x_gpio_register();
-       if (ret)
-               pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
-
-#ifdef CONFIG_I2C
-       nvmem_add_cell_table(&dm646x_evm_nvmem_cell_table);
-       nvmem_add_cell_lookups(&dm646x_evm_nvmem_cell_lookup, 1);
-       evm_init_i2c();
-#endif
-
-       davinci_serial_init(dm646x_serial_device);
-       dm646x_init_mcasp0(&dm646x_evm_snd_data[0]);
-       dm646x_init_mcasp1(&dm646x_evm_snd_data[1]);
-
-       if (machine_is_davinci_dm6467tevm())
-               davinci_nand_data.timing = &dm6467tevm_nandflash_timing;
-
-       if (platform_device_register(&davinci_aemif_device))
-               pr_warn("%s: Cannot register AEMIF device.\n", __func__);
-
-       dm646x_init_edma(dm646x_edma_rsv);
-
-       if (HAS_ATA)
-               davinci_init_ide();
-
-       soc_info->emac_pdata->phy_id = DM646X_EVM_PHY_ID;
-}
-
-MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
-       .atag_offset  = 0x100,
-       .map_io       = davinci_map_io,
-       .init_irq     = dm646x_init_irq,
-       .init_time      = dm646x_evm_init_time,
-       .init_machine = evm_init,
-       .init_late      = davinci_init_late,
-       .dma_zone_size  = SZ_128M,
-MACHINE_END
-
-MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
-       .atag_offset  = 0x100,
-       .map_io       = davinci_map_io,
-       .init_irq     = dm646x_init_irq,
-       .init_time      = dm6467t_evm_init_time,
-       .init_machine = evm_init,
-       .init_late      = davinci_init_late,
-       .dma_zone_size  = SZ_128M,
-MACHINE_END
-
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
deleted file mode 100644 (file)
index 94be492..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Neuros Technologies OSD2 board support
- *
- * Modified from original 644X-EVM board support.
- * 2008 (c) Neuros Technology, LLC.
- * 2009 (c) Jorge Luis Zapata Muga <jorgeluis.zapata@gmail.com>
- * 2009 (c) Andrey A. Porodko <Andrey.Porodko@gmail.com>
- *
- * The Neuros OSD 2.0 is the hardware component of the Neuros Open
- * Internet Television Platform. Hardware is very close to TI
- * DM644X-EVM board. It has:
- *     DM6446M02 module with 256MB NAND, 256MB RAM, TLV320AIC32 AIC,
- *     USB, Ethernet, SD/MMC, UART, THS8200, TVP7000 for video.
- *     Additionally realtime clock, IR remote control receiver,
- *     IR Blaster based on MSP430 (firmware although is different
- *     from used in DM644X-EVM), internal ATA-6 3.5” HDD drive
- *     with PATA interface, two muxed red-green leds.
- *
- * For more information please refer to
- *             http://wiki.neurostechnology.com/index.php/OSD_2.0_HD
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- */
-#include <linux/platform_device.h>
-#include <linux/gpio.h>
-#include <linux/leds.h>
-#include <linux/mtd/partitions.h>
-#include <linux/platform_data/gpio-davinci.h>
-#include <linux/platform_data/i2c-davinci.h>
-#include <linux/platform_data/mmc-davinci.h>
-#include <linux/platform_data/mtd-davinci.h>
-#include <linux/platform_data/usb-davinci.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-
-#include "common.h"
-#include "serial.h"
-#include "mux.h"
-#include "davinci.h"
-
-#define NEUROS_OSD2_PHY_ID             "davinci_mdio-0:01"
-#define LXT971_PHY_ID                  0x001378e2
-#define LXT971_PHY_MASK                        0xfffffff0
-
-#define        NTOSD2_AUDIOSOC_I2C_ADDR        0x18
-#define        NTOSD2_MSP430_I2C_ADDR          0x59
-#define        NTOSD2_MSP430_IRQ               2
-
-/* Neuros OSD2 has a Samsung 256 MByte NAND flash (Dev ID of 0xAA,
- * 2048 blocks in the device, 64 pages per block, 2048 bytes per
- * page.
- */
-
-#define NAND_BLOCK_SIZE                SZ_128K
-
-static struct mtd_partition davinci_ntosd2_nandflash_partition[] = {
-       {
-               /* UBL (a few copies) plus U-Boot */
-               .name           = "bootloader",
-               .offset         = 0,
-               .size           = 15 * NAND_BLOCK_SIZE,
-               .mask_flags     = MTD_WRITEABLE, /* force read-only */
-       }, {
-               /* U-Boot environment */
-               .name           = "params",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 1 * NAND_BLOCK_SIZE,
-               .mask_flags     = 0,
-       }, {
-               /* Kernel */
-               .name           = "kernel",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = SZ_4M,
-               .mask_flags     = 0,
-       }, {
-               /* File System */
-               .name           = "filesystem",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = MTDPART_SIZ_FULL,
-               .mask_flags     = 0,
-       }
-       /* A few blocks at end hold a flash Bad Block Table. */
-};
-
-static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
-       .core_chipsel   = 0,
-       .parts          = davinci_ntosd2_nandflash_partition,
-       .nr_parts       = ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
-       .engine_type    = NAND_ECC_ENGINE_TYPE_ON_HOST,
-       .ecc_bits       = 1,
-       .bbt_options    = NAND_BBT_USE_FLASH,
-};
-
-static struct resource davinci_ntosd2_nandflash_resource[] = {
-       {
-               .start          = DM644X_ASYNC_EMIF_DATA_CE0_BASE,
-               .end            = DM644X_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
-               .flags          = IORESOURCE_MEM,
-       }, {
-               .start          = DM644X_ASYNC_EMIF_CONTROL_BASE,
-               .end            = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device davinci_ntosd2_nandflash_device = {
-       .name           = "davinci_nand",
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &davinci_ntosd2_nandflash_data,
-       },
-       .num_resources  = ARRAY_SIZE(davinci_ntosd2_nandflash_resource),
-       .resource       = davinci_ntosd2_nandflash_resource,
-};
-
-static u64 davinci_fb_dma_mask = DMA_BIT_MASK(32);
-
-static struct platform_device davinci_fb_device = {
-       .name           = "davincifb",
-       .id             = -1,
-       .dev = {
-               .dma_mask               = &davinci_fb_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-       .num_resources = 0,
-};
-
-static const struct gpio_led ntosd2_leds[] = {
-       { .name = "led1_green", .gpio = 10, },
-       { .name = "led1_red",   .gpio = 11, },
-       { .name = "led2_green", .gpio = 12, },
-       { .name = "led2_red",   .gpio = 13, },
-};
-
-static struct gpio_led_platform_data ntosd2_leds_data = {
-       .num_leds       = ARRAY_SIZE(ntosd2_leds),
-       .leds           = ntosd2_leds,
-};
-
-static struct platform_device ntosd2_leds_dev = {
-       .name = "leds-gpio",
-       .id   = -1,
-       .dev = {
-               .platform_data          = &ntosd2_leds_data,
-       },
-};
-
-
-static struct platform_device *davinci_ntosd2_devices[] __initdata = {
-       &davinci_fb_device,
-       &ntosd2_leds_dev,
-};
-
-static void __init davinci_ntosd2_map_io(void)
-{
-       dm644x_init();
-}
-
-static struct davinci_mmc_config davinci_ntosd2_mmc_config = {
-       .wires          = 4,
-};
-
-#define HAS_ATA                (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
-                        IS_ENABLED(CONFIG_PATA_BK3710))
-
-#define HAS_NAND       IS_ENABLED(CONFIG_MTD_NAND_DAVINCI)
-
-static __init void davinci_ntosd2_init(void)
-{
-       int ret;
-       struct clk *aemif_clk;
-       struct davinci_soc_info *soc_info = &davinci_soc_info;
-
-       dm644x_register_clocks();
-
-       dm644x_init_devices();
-
-       ret = dm644x_gpio_register();
-       if (ret)
-               pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
-
-       aemif_clk = clk_get(NULL, "aemif");
-       clk_prepare_enable(aemif_clk);
-
-       if (HAS_ATA) {
-               if (HAS_NAND)
-                       pr_warn("WARNING: both IDE and Flash are enabled, but they share AEMIF pins\n"
-                               "\tDisable IDE for NAND/NOR support\n");
-               davinci_init_ide();
-       } else if (HAS_NAND) {
-               davinci_cfg_reg(DM644X_HPIEN_DISABLE);
-               davinci_cfg_reg(DM644X_ATAEN_DISABLE);
-
-               /* only one device will be jumpered and detected */
-               if (HAS_NAND)
-                       platform_device_register(
-                                       &davinci_ntosd2_nandflash_device);
-       }
-
-       platform_add_devices(davinci_ntosd2_devices,
-                               ARRAY_SIZE(davinci_ntosd2_devices));
-
-       davinci_serial_init(dm644x_serial_device);
-       dm644x_init_asp();
-
-       soc_info->emac_pdata->phy_id = NEUROS_OSD2_PHY_ID;
-
-       davinci_setup_usb(1000, 8);
-       /*
-        * Mux the pins to be GPIOs, VLYNQEN is already done at startup.
-        * The AEAWx are five new AEAW pins that can be muxed by separately.
-        * They are a bitmask for GPIO management. According TI
-        * documentation (https://www.ti.com/lit/gpn/tms320dm6446) to employ
-        * gpio(10,11,12,13) for leds any combination of bits works except
-        * four last. So we are to reset all five.
-        */
-       davinci_cfg_reg(DM644X_AEAW0);
-       davinci_cfg_reg(DM644X_AEAW1);
-       davinci_cfg_reg(DM644X_AEAW2);
-       davinci_cfg_reg(DM644X_AEAW3);
-       davinci_cfg_reg(DM644X_AEAW4);
-
-       davinci_setup_mmc(0, &davinci_ntosd2_mmc_config);
-}
-
-MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
-       /* Maintainer: Neuros Technologies <neuros@groups.google.com> */
-       .atag_offset    = 0x100,
-       .map_io          = davinci_ntosd2_map_io,
-       .init_irq       = dm644x_init_irq,
-       .init_time      = dm644x_init_time,
-       .init_machine = davinci_ntosd2_init,
-       .init_late      = davinci_init_late,
-       .dma_zone_size  = SZ_128M,
-MACHINE_END
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
deleted file mode 100644 (file)
index e87fd8f..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-/*
- * Lyrtech SFFSDR board support.
- *
- * Copyright (C) 2008 Philip Balister, OpenSDR <philip@opensdr.com>
- * Copyright (C) 2008 Lyrtech <www.lyrtech.com>
- *
- * Based on DV-EVM platform, original copyright follows:
- *
- * Copyright (C) 2007 MontaVista Software, Inc.
- */
-
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/i2c.h>
-#include <linux/property.h>
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/rawnand.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
-
-#include <linux/platform_data/i2c-davinci.h>
-#include <linux/platform_data/usb-davinci.h>
-
-#include "common.h"
-#include "serial.h"
-#include "mux.h"
-#include "davinci.h"
-
-#define SFFSDR_PHY_ID          "davinci_mdio-0:01"
-static struct mtd_partition davinci_sffsdr_nandflash_partition[] = {
-       /* U-Boot Environment: Block 0
-        * UBL:                Block 1
-        * U-Boot:             Blocks 6-7 (256 kb)
-        * Integrity Kernel:   Blocks 8-31 (3 Mb)
-        * Integrity Data:     Blocks 100-END
-        */
-       {
-               .name           = "Linux Kernel",
-               .offset         = 32 * SZ_128K,
-               .size           = 16 * SZ_128K, /* 2 Mb */
-               .mask_flags     = MTD_WRITEABLE, /* Force read-only */
-       },
-       {
-               .name           = "Linux ROOT",
-               .offset         = MTDPART_OFS_APPEND,
-               .size           = 256 * SZ_128K, /* 32 Mb */
-               .mask_flags     = 0, /* R/W */
-       },
-};
-
-static struct flash_platform_data davinci_sffsdr_nandflash_data = {
-       .parts          = davinci_sffsdr_nandflash_partition,
-       .nr_parts       = ARRAY_SIZE(davinci_sffsdr_nandflash_partition),
-};
-
-static struct resource davinci_sffsdr_nandflash_resource[] = {
-       {
-               .start          = DM644X_ASYNC_EMIF_DATA_CE0_BASE,
-               .end            = DM644X_ASYNC_EMIF_DATA_CE0_BASE + SZ_16M - 1,
-               .flags          = IORESOURCE_MEM,
-       }, {
-               .start          = DM644X_ASYNC_EMIF_CONTROL_BASE,
-               .end            = DM644X_ASYNC_EMIF_CONTROL_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device davinci_sffsdr_nandflash_device = {
-       .name           = "davinci_nand", /* Name of driver */
-       .id             = 0,
-       .dev            = {
-               .platform_data  = &davinci_sffsdr_nandflash_data,
-       },
-       .num_resources  = ARRAY_SIZE(davinci_sffsdr_nandflash_resource),
-       .resource       = davinci_sffsdr_nandflash_resource,
-};
-
-static const struct property_entry eeprom_properties[] = {
-       PROPERTY_ENTRY_U32("pagesize", 32),
-       { }
-};
-
-static const struct software_node eeprom_node = {
-       .properties = eeprom_properties,
-};
-
-static struct i2c_board_info __initdata i2c_info[] =  {
-       {
-               I2C_BOARD_INFO("24c64", 0x50),
-               .swnode = &eeprom_node,
-       },
-       /* Other I2C devices:
-        * MSP430,  addr 0x23 (not used)
-        * PCA9543, addr 0x70 (setup done by U-Boot)
-        * ADS7828, addr 0x48 (ADC for voltage monitoring.)
-        */
-};
-
-static struct davinci_i2c_platform_data i2c_pdata = {
-       .bus_freq       = 20 /* kHz */,
-       .bus_delay      = 100 /* usec */,
-};
-
-static void __init sffsdr_init_i2c(void)
-{
-       davinci_init_i2c(&i2c_pdata);
-       i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info));
-}
-
-static struct platform_device *davinci_sffsdr_devices[] __initdata = {
-       &davinci_sffsdr_nandflash_device,
-};
-
-static void __init davinci_sffsdr_map_io(void)
-{
-       dm644x_init();
-}
-
-static __init void davinci_sffsdr_init(void)
-{
-       struct davinci_soc_info *soc_info = &davinci_soc_info;
-
-       dm644x_register_clocks();
-
-       dm644x_init_devices();
-
-       platform_add_devices(davinci_sffsdr_devices,
-                            ARRAY_SIZE(davinci_sffsdr_devices));
-       sffsdr_init_i2c();
-       davinci_serial_init(dm644x_serial_device);
-       soc_info->emac_pdata->phy_id = SFFSDR_PHY_ID;
-       davinci_setup_usb(0, 0); /* We support only peripheral mode. */
-
-       /* mux VLYNQ pins */
-       davinci_cfg_reg(DM644X_VLYNQEN);
-       davinci_cfg_reg(DM644X_VLYNQWD);
-}
-
-MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
-       .atag_offset  = 0x100,
-       .map_io       = davinci_sffsdr_map_io,
-       .init_irq     = dm644x_init_irq,
-       .init_time      = dm644x_init_time,
-       .init_machine = davinci_sffsdr_init,
-       .init_late      = davinci_init_late,
-       .dma_zone_size  = SZ_128M,
-MACHINE_END
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
deleted file mode 100644 (file)
index 1ce48d0..0000000
+++ /dev/null
@@ -1,765 +0,0 @@
-/*
- * TI DaVinci DM644x chip specific setup
- *
- * Author: Kevin Hilman, Deep Root Systems, LLC
- *
- * 2007 (c) Deep Root Systems, LLC. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/clk-provider.h>
-#include <linux/clk/davinci.h>
-#include <linux/clkdev.h>
-#include <linux/dmaengine.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/irqchip/irq-davinci-aintc.h>
-#include <linux/platform_data/edma.h>
-#include <linux/platform_data/gpio-davinci.h>
-#include <linux/platform_device.h>
-#include <linux/serial_8250.h>
-
-#include <clocksource/timer-davinci.h>
-
-#include <asm/mach/map.h>
-
-#include "common.h"
-#include "cputype.h"
-#include "serial.h"
-#include "asp.h"
-#include "davinci.h"
-#include "irqs.h"
-#include "mux.h"
-
-/*
- * Device specific clocks
- */
-#define DM644X_REF_FREQ                27000000
-
-#define DM644X_EMAC_BASE               0x01c80000
-#define DM644X_EMAC_MDIO_BASE          (DM644X_EMAC_BASE + 0x4000)
-#define DM644X_EMAC_CNTRL_OFFSET       0x0000
-#define DM644X_EMAC_CNTRL_MOD_OFFSET   0x1000
-#define DM644X_EMAC_CNTRL_RAM_OFFSET   0x2000
-#define DM644X_EMAC_CNTRL_RAM_SIZE     0x2000
-
-static struct emac_platform_data dm644x_emac_pdata = {
-       .ctrl_reg_offset        = DM644X_EMAC_CNTRL_OFFSET,
-       .ctrl_mod_reg_offset    = DM644X_EMAC_CNTRL_MOD_OFFSET,
-       .ctrl_ram_offset        = DM644X_EMAC_CNTRL_RAM_OFFSET,
-       .ctrl_ram_size          = DM644X_EMAC_CNTRL_RAM_SIZE,
-       .version                = EMAC_VERSION_1,
-};
-
-static struct resource dm644x_emac_resources[] = {
-       {
-               .start  = DM644X_EMAC_BASE,
-               .end    = DM644X_EMAC_BASE + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start = DAVINCI_INTC_IRQ(IRQ_EMACINT),
-               .end   = DAVINCI_INTC_IRQ(IRQ_EMACINT),
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device dm644x_emac_device = {
-       .name           = "davinci_emac",
-       .id             = 1,
-       .dev = {
-              .platform_data   = &dm644x_emac_pdata,
-       },
-       .num_resources  = ARRAY_SIZE(dm644x_emac_resources),
-       .resource       = dm644x_emac_resources,
-};
-
-static struct resource dm644x_mdio_resources[] = {
-       {
-               .start  = DM644X_EMAC_MDIO_BASE,
-               .end    = DM644X_EMAC_MDIO_BASE + SZ_4K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm644x_mdio_device = {
-       .name           = "davinci_mdio",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(dm644x_mdio_resources),
-       .resource       = dm644x_mdio_resources,
-};
-
-/*
- * Device specific mux setup
- *
- *     soc     description     mux  mode   mode  mux    dbg
- *                             reg  offset mask  mode
- */
-static const struct mux_config dm644x_pins[] = {
-#ifdef CONFIG_DAVINCI_MUX
-MUX_CFG(DM644X, HDIREN,                0,   16,    1,    1,     true)
-MUX_CFG(DM644X, ATAEN,         0,   17,    1,    1,     true)
-MUX_CFG(DM644X, ATAEN_DISABLE, 0,   17,    1,    0,     true)
-
-MUX_CFG(DM644X, HPIEN_DISABLE, 0,   29,    1,    0,     true)
-
-MUX_CFG(DM644X, AEAW,          0,   0,     31,   31,    true)
-MUX_CFG(DM644X, AEAW0,         0,   0,     1,    0,     true)
-MUX_CFG(DM644X, AEAW1,         0,   1,     1,    0,     true)
-MUX_CFG(DM644X, AEAW2,         0,   2,     1,    0,     true)
-MUX_CFG(DM644X, AEAW3,         0,   3,     1,    0,     true)
-MUX_CFG(DM644X, AEAW4,         0,   4,     1,    0,     true)
-
-MUX_CFG(DM644X, MSTK,          1,   9,     1,    0,     false)
-
-MUX_CFG(DM644X, I2C,           1,   7,     1,    1,     false)
-
-MUX_CFG(DM644X, MCBSP,         1,   10,    1,    1,     false)
-
-MUX_CFG(DM644X, UART1,         1,   1,     1,    1,     true)
-MUX_CFG(DM644X, UART2,         1,   2,     1,    1,     true)
-
-MUX_CFG(DM644X, PWM0,          1,   4,     1,    1,     false)
-
-MUX_CFG(DM644X, PWM1,          1,   5,     1,    1,     false)
-
-MUX_CFG(DM644X, PWM2,          1,   6,     1,    1,     false)
-
-MUX_CFG(DM644X, VLYNQEN,       0,   15,    1,    1,     false)
-MUX_CFG(DM644X, VLSCREN,       0,   14,    1,    1,     false)
-MUX_CFG(DM644X, VLYNQWD,       0,   12,    3,    3,     false)
-
-MUX_CFG(DM644X, EMACEN,                0,   31,    1,    1,     true)
-
-MUX_CFG(DM644X, GPIO3V,                0,   31,    1,    0,     true)
-
-MUX_CFG(DM644X, GPIO0,         0,   24,    1,    0,     true)
-MUX_CFG(DM644X, GPIO3,         0,   25,    1,    0,     false)
-MUX_CFG(DM644X, GPIO43_44,     1,   7,     1,    0,     false)
-MUX_CFG(DM644X, GPIO46_47,     0,   22,    1,    0,     true)
-
-MUX_CFG(DM644X, RGB666,                0,   22,    1,    1,     true)
-
-MUX_CFG(DM644X, LOEEN,         0,   24,    1,    1,     true)
-MUX_CFG(DM644X, LFLDEN,                0,   25,    1,    1,     false)
-#endif
-};
-
-/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
-static u8 dm644x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
-       [IRQ_VDINT0]            = 2,
-       [IRQ_VDINT1]            = 6,
-       [IRQ_VDINT2]            = 6,
-       [IRQ_HISTINT]           = 6,
-       [IRQ_H3AINT]            = 6,
-       [IRQ_PRVUINT]           = 6,
-       [IRQ_RSZINT]            = 6,
-       [7]                     = 7,
-       [IRQ_VENCINT]           = 6,
-       [IRQ_ASQINT]            = 6,
-       [IRQ_IMXINT]            = 6,
-       [IRQ_VLCDINT]           = 6,
-       [IRQ_USBINT]            = 4,
-       [IRQ_EMACINT]           = 4,
-       [14]                    = 7,
-       [15]                    = 7,
-       [IRQ_CCINT0]            = 5,    /* dma */
-       [IRQ_CCERRINT]          = 5,    /* dma */
-       [IRQ_TCERRINT0]         = 5,    /* dma */
-       [IRQ_TCERRINT]          = 5,    /* dma */
-       [IRQ_PSCIN]             = 7,
-       [21]                    = 7,
-       [IRQ_IDE]               = 4,
-       [23]                    = 7,
-       [IRQ_MBXINT]            = 7,
-       [IRQ_MBRINT]            = 7,
-       [IRQ_MMCINT]            = 7,
-       [IRQ_SDIOINT]           = 7,
-       [28]                    = 7,
-       [IRQ_DDRINT]            = 7,
-       [IRQ_AEMIFINT]          = 7,
-       [IRQ_VLQINT]            = 4,
-       [IRQ_TINT0_TINT12]      = 2,    /* clockevent */
-       [IRQ_TINT0_TINT34]      = 2,    /* clocksource */
-       [IRQ_TINT1_TINT12]      = 7,    /* DSP timer */
-       [IRQ_TINT1_TINT34]      = 7,    /* system tick */
-       [IRQ_PWMINT0]           = 7,
-       [IRQ_PWMINT1]           = 7,
-       [IRQ_PWMINT2]           = 7,
-       [IRQ_I2C]               = 3,
-       [IRQ_UARTINT0]          = 3,
-       [IRQ_UARTINT1]          = 3,
-       [IRQ_UARTINT2]          = 3,
-       [IRQ_SPINT0]            = 3,
-       [IRQ_SPINT1]            = 3,
-       [45]                    = 7,
-       [IRQ_DSP2ARM0]          = 4,
-       [IRQ_DSP2ARM1]          = 4,
-       [IRQ_GPIO0]             = 7,
-       [IRQ_GPIO1]             = 7,
-       [IRQ_GPIO2]             = 7,
-       [IRQ_GPIO3]             = 7,
-       [IRQ_GPIO4]             = 7,
-       [IRQ_GPIO5]             = 7,
-       [IRQ_GPIO6]             = 7,
-       [IRQ_GPIO7]             = 7,
-       [IRQ_GPIOBNK0]          = 7,
-       [IRQ_GPIOBNK1]          = 7,
-       [IRQ_GPIOBNK2]          = 7,
-       [IRQ_GPIOBNK3]          = 7,
-       [IRQ_GPIOBNK4]          = 7,
-       [IRQ_COMMTX]            = 7,
-       [IRQ_COMMRX]            = 7,
-       [IRQ_EMUINT]            = 7,
-};
-
-/*----------------------------------------------------------------------*/
-
-static s8 queue_priority_mapping[][2] = {
-       /* {event queue no, Priority} */
-       {0, 3},
-       {1, 7},
-       {-1, -1},
-};
-
-static const struct dma_slave_map dm644x_edma_map[] = {
-       { "davinci-mcbsp", "tx", EDMA_FILTER_PARAM(0, 2) },
-       { "davinci-mcbsp", "rx", EDMA_FILTER_PARAM(0, 3) },
-       { "spi_davinci", "tx", EDMA_FILTER_PARAM(0, 16) },
-       { "spi_davinci", "rx", EDMA_FILTER_PARAM(0, 17) },
-       { "dm6441-mmc.0", "rx", EDMA_FILTER_PARAM(0, 26) },
-       { "dm6441-mmc.0", "tx", EDMA_FILTER_PARAM(0, 27) },
-};
-
-static struct edma_soc_info dm644x_edma_pdata = {
-       .queue_priority_mapping = queue_priority_mapping,
-       .default_queue          = EVENTQ_1,
-       .slave_map              = dm644x_edma_map,
-       .slavecnt               = ARRAY_SIZE(dm644x_edma_map),
-};
-
-static struct resource edma_resources[] = {
-       {
-               .name   = "edma3_cc",
-               .start  = 0x01c00000,
-               .end    = 0x01c00000 + SZ_64K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_tc0",
-               .start  = 0x01c10000,
-               .end    = 0x01c10000 + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_tc1",
-               .start  = 0x01c10400,
-               .end    = 0x01c10400 + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_ccint",
-               .start  = DAVINCI_INTC_IRQ(IRQ_CCINT0),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .name   = "edma3_ccerrint",
-               .start  = DAVINCI_INTC_IRQ(IRQ_CCERRINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-       /* not using TC*_ERR */
-};
-
-static const struct platform_device_info dm644x_edma_device __initconst = {
-       .name           = "edma",
-       .id             = 0,
-       .dma_mask       = DMA_BIT_MASK(32),
-       .res            = edma_resources,
-       .num_res        = ARRAY_SIZE(edma_resources),
-       .data           = &dm644x_edma_pdata,
-       .size_data      = sizeof(dm644x_edma_pdata),
-};
-
-/* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */
-static struct resource dm644x_asp_resources[] = {
-       {
-               .name   = "mpu",
-               .start  = DAVINCI_ASP0_BASE,
-               .end    = DAVINCI_ASP0_BASE + SZ_8K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = DAVINCI_DMA_ASP0_TX,
-               .end    = DAVINCI_DMA_ASP0_TX,
-               .flags  = IORESOURCE_DMA,
-       },
-       {
-               .start  = DAVINCI_DMA_ASP0_RX,
-               .end    = DAVINCI_DMA_ASP0_RX,
-               .flags  = IORESOURCE_DMA,
-       },
-};
-
-static struct platform_device dm644x_asp_device = {
-       .name           = "davinci-mcbsp",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(dm644x_asp_resources),
-       .resource       = dm644x_asp_resources,
-};
-
-#define DM644X_VPSS_BASE       0x01c73400
-
-static struct resource dm644x_vpss_resources[] = {
-       {
-               /* VPSS Base address */
-               .name           = "vpss",
-               .start          = DM644X_VPSS_BASE,
-               .end            = DM644X_VPSS_BASE + 0xff,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm644x_vpss_device = {
-       .name                   = "vpss",
-       .id                     = -1,
-       .dev.platform_data      = "dm644x_vpss",
-       .num_resources          = ARRAY_SIZE(dm644x_vpss_resources),
-       .resource               = dm644x_vpss_resources,
-};
-
-static struct resource dm644x_vpfe_resources[] = {
-       {
-               .start          = DAVINCI_INTC_IRQ(IRQ_VDINT0),
-               .end            = DAVINCI_INTC_IRQ(IRQ_VDINT0),
-               .flags          = IORESOURCE_IRQ,
-       },
-       {
-               .start          = DAVINCI_INTC_IRQ(IRQ_VDINT1),
-               .end            = DAVINCI_INTC_IRQ(IRQ_VDINT1),
-               .flags          = IORESOURCE_IRQ,
-       },
-};
-
-static u64 dm644x_video_dma_mask = DMA_BIT_MASK(32);
-static struct resource dm644x_ccdc_resource[] = {
-       /* CCDC Base address */
-       {
-               .start          = 0x01c70400,
-               .end            = 0x01c70400 + 0xff,
-               .flags          = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm644x_ccdc_dev = {
-       .name           = "dm644x_ccdc",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(dm644x_ccdc_resource),
-       .resource       = dm644x_ccdc_resource,
-       .dev = {
-               .dma_mask               = &dm644x_video_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-};
-
-static struct platform_device dm644x_vpfe_dev = {
-       .name           = CAPTURE_DRV_NAME,
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(dm644x_vpfe_resources),
-       .resource       = dm644x_vpfe_resources,
-       .dev = {
-               .dma_mask               = &dm644x_video_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-};
-
-#define DM644X_OSD_BASE                0x01c72600
-
-static struct resource dm644x_osd_resources[] = {
-       {
-               .start  = DM644X_OSD_BASE,
-               .end    = DM644X_OSD_BASE + 0x1ff,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm644x_osd_dev = {
-       .name           = DM644X_VPBE_OSD_SUBDEV_NAME,
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(dm644x_osd_resources),
-       .resource       = dm644x_osd_resources,
-       .dev            = {
-               .dma_mask               = &dm644x_video_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-};
-
-#define DM644X_VENC_BASE               0x01c72400
-
-static struct resource dm644x_venc_resources[] = {
-       {
-               .start  = DM644X_VENC_BASE,
-               .end    = DM644X_VENC_BASE + 0x17f,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-#define DM644X_VPSS_MUXSEL_PLL2_MODE          BIT(0)
-#define DM644X_VPSS_MUXSEL_VPBECLK_MODE       BIT(1)
-#define DM644X_VPSS_VENCLKEN                  BIT(3)
-#define DM644X_VPSS_DACCLKEN                  BIT(4)
-
-static int dm644x_venc_setup_clock(enum vpbe_enc_timings_type type,
-                                  unsigned int pclock)
-{
-       int ret = 0;
-       u32 v = DM644X_VPSS_VENCLKEN;
-
-       switch (type) {
-       case VPBE_ENC_STD:
-               v |= DM644X_VPSS_DACCLKEN;
-               writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
-               break;
-       case VPBE_ENC_DV_TIMINGS:
-               if (pclock <= 27000000) {
-                       v |= DM644X_VPSS_DACCLKEN;
-                       writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
-               } else {
-                       /*
-                        * For HD, use external clock source since
-                        * HD requires higher clock rate
-                        */
-                       v |= DM644X_VPSS_MUXSEL_VPBECLK_MODE;
-                       writel(v, DAVINCI_SYSMOD_VIRT(SYSMOD_VPSS_CLKCTL));
-               }
-               break;
-       default:
-               ret  = -EINVAL;
-       }
-
-       return ret;
-}
-
-static struct resource dm644x_v4l2_disp_resources[] = {
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_VENCINT),
-               .end    = DAVINCI_INTC_IRQ(IRQ_VENCINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device dm644x_vpbe_display = {
-       .name           = "vpbe-v4l2",
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(dm644x_v4l2_disp_resources),
-       .resource       = dm644x_v4l2_disp_resources,
-       .dev            = {
-               .dma_mask               = &dm644x_video_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-};
-
-static struct venc_platform_data dm644x_venc_pdata = {
-       .setup_clock    = dm644x_venc_setup_clock,
-};
-
-static struct platform_device dm644x_venc_dev = {
-       .name           = DM644X_VPBE_VENC_SUBDEV_NAME,
-       .id             = -1,
-       .num_resources  = ARRAY_SIZE(dm644x_venc_resources),
-       .resource       = dm644x_venc_resources,
-       .dev            = {
-               .dma_mask               = &dm644x_video_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-               .platform_data          = &dm644x_venc_pdata,
-       },
-};
-
-static struct platform_device dm644x_vpbe_dev = {
-       .name           = "vpbe_controller",
-       .id             = -1,
-       .dev            = {
-               .dma_mask               = &dm644x_video_dma_mask,
-               .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-};
-
-static struct resource dm644_gpio_resources[] = {
-       {       /* registers */
-               .start  = DAVINCI_GPIO_BASE,
-               .end    = DAVINCI_GPIO_BASE + SZ_4K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {       /* interrupt */
-               .start  = DAVINCI_INTC_IRQ(IRQ_GPIOBNK0),
-               .end    = DAVINCI_INTC_IRQ(IRQ_GPIOBNK0),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_GPIOBNK1),
-               .end    = DAVINCI_INTC_IRQ(IRQ_GPIOBNK1),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_GPIOBNK2),
-               .end    = DAVINCI_INTC_IRQ(IRQ_GPIOBNK2),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_GPIOBNK3),
-               .end    = DAVINCI_INTC_IRQ(IRQ_GPIOBNK3),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_GPIOBNK4),
-               .end    = DAVINCI_INTC_IRQ(IRQ_GPIOBNK4),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct davinci_gpio_platform_data dm644_gpio_platform_data = {
-       .no_auto_base   = true,
-       .base           = 0,
-       .ngpio          = 71,
-};
-
-int __init dm644x_gpio_register(void)
-{
-       return davinci_gpio_register(dm644_gpio_resources,
-                                    ARRAY_SIZE(dm644_gpio_resources),
-                                    &dm644_gpio_platform_data);
-}
-/*----------------------------------------------------------------------*/
-
-static struct map_desc dm644x_io_desc[] = {
-       {
-               .virtual        = IO_VIRT,
-               .pfn            = __phys_to_pfn(IO_PHYS),
-               .length         = IO_SIZE,
-               .type           = MT_DEVICE
-       },
-};
-
-/* Contents of JTAG ID register used to identify exact cpu type */
-static struct davinci_id dm644x_ids[] = {
-       {
-               .variant        = 0x0,
-               .part_no        = 0xb700,
-               .manufacturer   = 0x017,
-               .cpu_id         = DAVINCI_CPU_ID_DM6446,
-               .name           = "dm6446",
-       },
-       {
-               .variant        = 0x1,
-               .part_no        = 0xb700,
-               .manufacturer   = 0x017,
-               .cpu_id         = DAVINCI_CPU_ID_DM6446,
-               .name           = "dm6446a",
-       },
-};
-
-/*
- * Bottom half of timer0 is used for clockevent, top half is used for
- * clocksource.
- */
-static const struct davinci_timer_cfg dm644x_timer_cfg = {
-       .reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_4K),
-       .irq = {
-               DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
-               DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
-       },
-};
-
-static struct plat_serial8250_port dm644x_serial0_platform_data[] = {
-       {
-               .mapbase        = DAVINCI_UART0_BASE,
-               .irq            = DAVINCI_INTC_IRQ(IRQ_UARTINT0),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
-                                 UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 2,
-       },
-       {
-               .flags  = 0,
-       }
-};
-static struct plat_serial8250_port dm644x_serial1_platform_data[] = {
-       {
-               .mapbase        = DAVINCI_UART1_BASE,
-               .irq            = DAVINCI_INTC_IRQ(IRQ_UARTINT1),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
-                                 UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 2,
-       },
-       {
-               .flags  = 0,
-       }
-};
-static struct plat_serial8250_port dm644x_serial2_platform_data[] = {
-       {
-               .mapbase        = DAVINCI_UART2_BASE,
-               .irq            = DAVINCI_INTC_IRQ(IRQ_UARTINT2),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
-                                 UPF_IOREMAP,
-               .iotype         = UPIO_MEM,
-               .regshift       = 2,
-       },
-       {
-               .flags  = 0,
-       }
-};
-
-struct platform_device dm644x_serial_device[] = {
-       {
-               .name                   = "serial8250",
-               .id                     = PLAT8250_DEV_PLATFORM,
-               .dev                    = {
-                       .platform_data  = dm644x_serial0_platform_data,
-               }
-       },
-       {
-               .name                   = "serial8250",
-               .id                     = PLAT8250_DEV_PLATFORM1,
-               .dev                    = {
-                       .platform_data  = dm644x_serial1_platform_data,
-               }
-       },
-       {
-               .name                   = "serial8250",
-               .id                     = PLAT8250_DEV_PLATFORM2,
-               .dev                    = {
-                       .platform_data  = dm644x_serial2_platform_data,
-               }
-       },
-       {
-       }
-};
-
-static const struct davinci_soc_info davinci_soc_info_dm644x = {
-       .io_desc                = dm644x_io_desc,
-       .io_desc_num            = ARRAY_SIZE(dm644x_io_desc),
-       .jtag_id_reg            = 0x01c40028,
-       .ids                    = dm644x_ids,
-       .ids_num                = ARRAY_SIZE(dm644x_ids),
-       .pinmux_base            = DAVINCI_SYSTEM_MODULE_BASE,
-       .pinmux_pins            = dm644x_pins,
-       .pinmux_pins_num        = ARRAY_SIZE(dm644x_pins),
-       .emac_pdata             = &dm644x_emac_pdata,
-       .sram_dma               = 0x00008000,
-       .sram_len               = SZ_16K,
-};
-
-void __init dm644x_init_asp(void)
-{
-       davinci_cfg_reg(DM644X_MCBSP);
-       platform_device_register(&dm644x_asp_device);
-}
-
-void __init dm644x_init(void)
-{
-       davinci_common_init(&davinci_soc_info_dm644x);
-       davinci_map_sysmod();
-}
-
-void __init dm644x_init_time(void)
-{
-       void __iomem *pll1, *psc;
-       struct clk *clk;
-       int rv;
-
-       clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM644X_REF_FREQ);
-
-       pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_1K);
-       dm644x_pll1_init(NULL, pll1, NULL);
-
-       psc = ioremap(DAVINCI_PWR_SLEEP_CNTRL_BASE, SZ_4K);
-       dm644x_psc_init(NULL, psc);
-
-       clk = clk_get(NULL, "timer0");
-       if (WARN_ON(IS_ERR(clk))) {
-               pr_err("Unable to get the timer clock\n");
-               return;
-       }
-
-       rv = davinci_timer_register(clk, &dm644x_timer_cfg);
-       WARN(rv, "Unable to register the timer: %d\n", rv);
-}
-
-static struct resource dm644x_pll2_resources[] = {
-       {
-               .start  = DAVINCI_PLL2_BASE,
-               .end    = DAVINCI_PLL2_BASE + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm644x_pll2_device = {
-       .name           = "dm644x-pll2",
-       .id             = -1,
-       .resource       = dm644x_pll2_resources,
-       .num_resources  = ARRAY_SIZE(dm644x_pll2_resources),
-};
-
-void __init dm644x_register_clocks(void)
-{
-       /* PLL1 and PSC are registered in dm644x_init_time() */
-       platform_device_register(&dm644x_pll2_device);
-}
-
-int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
-                               struct vpbe_config *vpbe_cfg)
-{
-       if (vpfe_cfg || vpbe_cfg)
-               platform_device_register(&dm644x_vpss_device);
-
-       if (vpfe_cfg) {
-               dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
-               platform_device_register(&dm644x_ccdc_dev);
-               platform_device_register(&dm644x_vpfe_dev);
-       }
-
-       if (vpbe_cfg) {
-               dm644x_vpbe_dev.dev.platform_data = vpbe_cfg;
-               platform_device_register(&dm644x_osd_dev);
-               platform_device_register(&dm644x_venc_dev);
-               platform_device_register(&dm644x_vpbe_dev);
-               platform_device_register(&dm644x_vpbe_display);
-       }
-
-       return 0;
-}
-
-static const struct davinci_aintc_config dm644x_aintc_config = {
-       .reg = {
-               .start          = DAVINCI_ARM_INTC_BASE,
-               .end            = DAVINCI_ARM_INTC_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       .num_irqs               = 64,
-       .prios                  = dm644x_default_priorities,
-};
-
-void __init dm644x_init_irq(void)
-{
-       davinci_aintc_init(&dm644x_aintc_config);
-}
-
-void __init dm644x_init_devices(void)
-{
-       struct platform_device *edma_pdev;
-       int ret;
-
-       edma_pdev = platform_device_register_full(&dm644x_edma_device);
-       if (IS_ERR(edma_pdev))
-               pr_warn("%s: Failed to register eDMA\n", __func__);
-
-       platform_device_register(&dm644x_mdio_device);
-       platform_device_register(&dm644x_emac_device);
-
-       ret = davinci_init_wdt();
-       if (ret)
-               pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
-
-}
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
deleted file mode 100644 (file)
index 971b2d4..0000000
+++ /dev/null
@@ -1,726 +0,0 @@
-/*
- * TI DaVinci DM646x chip specific setup
- *
- * Author: Kevin Hilman, Deep Root Systems, LLC
- *
- * 2007 (c) Deep Root Systems, LLC. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/clk-provider.h>
-#include <linux/clk/davinci.h>
-#include <linux/clkdev.h>
-#include <linux/dma-mapping.h>
-#include <linux/dmaengine.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/irqchip/irq-davinci-aintc.h>
-#include <linux/platform_data/edma.h>
-#include <linux/platform_data/gpio-davinci.h>
-#include <linux/platform_device.h>
-#include <linux/serial_8250.h>
-
-#include <clocksource/timer-davinci.h>
-
-#include <asm/mach/map.h>
-
-#include "common.h"
-#include "cputype.h"
-#include "serial.h"
-#include "asp.h"
-#include "davinci.h"
-#include "irqs.h"
-#include "mux.h"
-
-#define DAVINCI_VPIF_BASE       (0x01C12000)
-
-#define VDD3P3V_VID_MASK       (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\
-                                       BIT_MASK(0))
-#define VSCLKDIS_MASK          (BIT_MASK(11) | BIT_MASK(10) | BIT_MASK(9) |\
-                                       BIT_MASK(8))
-
-#define DM646X_EMAC_BASE               0x01c80000
-#define DM646X_EMAC_MDIO_BASE          (DM646X_EMAC_BASE + 0x4000)
-#define DM646X_EMAC_CNTRL_OFFSET       0x0000
-#define DM646X_EMAC_CNTRL_MOD_OFFSET   0x1000
-#define DM646X_EMAC_CNTRL_RAM_OFFSET   0x2000
-#define DM646X_EMAC_CNTRL_RAM_SIZE     0x2000
-
-static struct emac_platform_data dm646x_emac_pdata = {
-       .ctrl_reg_offset        = DM646X_EMAC_CNTRL_OFFSET,
-       .ctrl_mod_reg_offset    = DM646X_EMAC_CNTRL_MOD_OFFSET,
-       .ctrl_ram_offset        = DM646X_EMAC_CNTRL_RAM_OFFSET,
-       .ctrl_ram_size          = DM646X_EMAC_CNTRL_RAM_SIZE,
-       .version                = EMAC_VERSION_2,
-};
-
-static struct resource dm646x_emac_resources[] = {
-       {
-               .start  = DM646X_EMAC_BASE,
-               .end    = DM646X_EMAC_BASE + SZ_16K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXTHINT),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXTHINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXINT),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACRXINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACTXINT),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACTXINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACMISCINT),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_EMACMISCINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device dm646x_emac_device = {
-       .name           = "davinci_emac",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &dm646x_emac_pdata,
-       },
-       .num_resources  = ARRAY_SIZE(dm646x_emac_resources),
-       .resource       = dm646x_emac_resources,
-};
-
-static struct resource dm646x_mdio_resources[] = {
-       {
-               .start  = DM646X_EMAC_MDIO_BASE,
-               .end    = DM646X_EMAC_MDIO_BASE + SZ_4K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm646x_mdio_device = {
-       .name           = "davinci_mdio",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(dm646x_mdio_resources),
-       .resource       = dm646x_mdio_resources,
-};
-
-/*
- * Device specific mux setup
- *
- *     soc     description     mux  mode   mode  mux    dbg
- *                             reg  offset mask  mode
- */
-static const struct mux_config dm646x_pins[] = {
-#ifdef CONFIG_DAVINCI_MUX
-MUX_CFG(DM646X, ATAEN,         0,   0,     5,    1,     true)
-
-MUX_CFG(DM646X, AUDCK1,                0,   29,    1,    0,     false)
-
-MUX_CFG(DM646X, AUDCK0,                0,   28,    1,    0,     false)
-
-MUX_CFG(DM646X, CRGMUX,                        0,   24,    7,    5,     true)
-
-MUX_CFG(DM646X, STSOMUX_DISABLE,       0,   22,    3,    0,     true)
-
-MUX_CFG(DM646X, STSIMUX_DISABLE,       0,   20,    3,    0,     true)
-
-MUX_CFG(DM646X, PTSOMUX_DISABLE,       0,   18,    3,    0,     true)
-
-MUX_CFG(DM646X, PTSIMUX_DISABLE,       0,   16,    3,    0,     true)
-
-MUX_CFG(DM646X, STSOMUX,               0,   22,    3,    2,     true)
-
-MUX_CFG(DM646X, STSIMUX,               0,   20,    3,    2,     true)
-
-MUX_CFG(DM646X, PTSOMUX_PARALLEL,      0,   18,    3,    2,     true)
-
-MUX_CFG(DM646X, PTSIMUX_PARALLEL,      0,   16,    3,    2,     true)
-
-MUX_CFG(DM646X, PTSOMUX_SERIAL,                0,   18,    3,    3,     true)
-
-MUX_CFG(DM646X, PTSIMUX_SERIAL,                0,   16,    3,    3,     true)
-#endif
-};
-
-static u8 dm646x_default_priorities[DAVINCI_N_AINTC_IRQ] = {
-       [IRQ_DM646X_VP_VERTINT0]        = 7,
-       [IRQ_DM646X_VP_VERTINT1]        = 7,
-       [IRQ_DM646X_VP_VERTINT2]        = 7,
-       [IRQ_DM646X_VP_VERTINT3]        = 7,
-       [IRQ_DM646X_VP_ERRINT]          = 7,
-       [IRQ_DM646X_RESERVED_1]         = 7,
-       [IRQ_DM646X_RESERVED_2]         = 7,
-       [IRQ_DM646X_WDINT]              = 7,
-       [IRQ_DM646X_CRGENINT0]          = 7,
-       [IRQ_DM646X_CRGENINT1]          = 7,
-       [IRQ_DM646X_TSIFINT0]           = 7,
-       [IRQ_DM646X_TSIFINT1]           = 7,
-       [IRQ_DM646X_VDCEINT]            = 7,
-       [IRQ_DM646X_USBINT]             = 7,
-       [IRQ_DM646X_USBDMAINT]          = 7,
-       [IRQ_DM646X_PCIINT]             = 7,
-       [IRQ_CCINT0]                    = 7,    /* dma */
-       [IRQ_CCERRINT]                  = 7,    /* dma */
-       [IRQ_TCERRINT0]                 = 7,    /* dma */
-       [IRQ_TCERRINT]                  = 7,    /* dma */
-       [IRQ_DM646X_TCERRINT2]          = 7,
-       [IRQ_DM646X_TCERRINT3]          = 7,
-       [IRQ_DM646X_IDE]                = 7,
-       [IRQ_DM646X_HPIINT]             = 7,
-       [IRQ_DM646X_EMACRXTHINT]        = 7,
-       [IRQ_DM646X_EMACRXINT]          = 7,
-       [IRQ_DM646X_EMACTXINT]          = 7,
-       [IRQ_DM646X_EMACMISCINT]        = 7,
-       [IRQ_DM646X_MCASP0TXINT]        = 7,
-       [IRQ_DM646X_MCASP0RXINT]        = 7,
-       [IRQ_DM646X_RESERVED_3]         = 7,
-       [IRQ_DM646X_MCASP1TXINT]        = 7,
-       [IRQ_TINT0_TINT12]              = 7,    /* clockevent */
-       [IRQ_TINT0_TINT34]              = 7,    /* clocksource */
-       [IRQ_TINT1_TINT12]              = 7,    /* DSP timer */
-       [IRQ_TINT1_TINT34]              = 7,    /* system tick */
-       [IRQ_PWMINT0]                   = 7,
-       [IRQ_PWMINT1]                   = 7,
-       [IRQ_DM646X_VLQINT]             = 7,
-       [IRQ_I2C]                       = 7,
-       [IRQ_UARTINT0]                  = 7,
-       [IRQ_UARTINT1]                  = 7,
-       [IRQ_DM646X_UARTINT2]           = 7,
-       [IRQ_DM646X_SPINT0]             = 7,
-       [IRQ_DM646X_SPINT1]             = 7,
-       [IRQ_DM646X_DSP2ARMINT]         = 7,
-       [IRQ_DM646X_RESERVED_4]         = 7,
-       [IRQ_DM646X_PSCINT]             = 7,
-       [IRQ_DM646X_GPIO0]              = 7,
-       [IRQ_DM646X_GPIO1]              = 7,
-       [IRQ_DM646X_GPIO2]              = 7,
-       [IRQ_DM646X_GPIO3]              = 7,
-       [IRQ_DM646X_GPIO4]              = 7,
-       [IRQ_DM646X_GPIO5]              = 7,
-       [IRQ_DM646X_GPIO6]              = 7,
-       [IRQ_DM646X_GPIO7]              = 7,
-       [IRQ_DM646X_GPIOBNK0]           = 7,
-       [IRQ_DM646X_GPIOBNK1]           = 7,
-       [IRQ_DM646X_GPIOBNK2]           = 7,
-       [IRQ_DM646X_DDRINT]             = 7,
-       [IRQ_DM646X_AEMIFINT]           = 7,
-       [IRQ_COMMTX]                    = 7,
-       [IRQ_COMMRX]                    = 7,
-       [IRQ_EMUINT]                    = 7,
-};
-
-/*----------------------------------------------------------------------*/
-
-/* Four Transfer Controllers on DM646x */
-static s8 dm646x_queue_priority_mapping[][2] = {
-       /* {event queue no, Priority} */
-       {0, 4},
-       {1, 0},
-       {2, 5},
-       {3, 1},
-       {-1, -1},
-};
-
-static const struct dma_slave_map dm646x_edma_map[] = {
-       { "davinci-mcasp.0", "tx", EDMA_FILTER_PARAM(0, 6) },
-       { "davinci-mcasp.0", "rx", EDMA_FILTER_PARAM(0, 9) },
-       { "davinci-mcasp.1", "tx", EDMA_FILTER_PARAM(0, 12) },
-       { "spi_davinci", "tx", EDMA_FILTER_PARAM(0, 16) },
-       { "spi_davinci", "rx", EDMA_FILTER_PARAM(0, 17) },
-};
-
-static struct edma_soc_info dm646x_edma_pdata = {
-       .queue_priority_mapping = dm646x_queue_priority_mapping,
-       .default_queue          = EVENTQ_1,
-       .slave_map              = dm646x_edma_map,
-       .slavecnt               = ARRAY_SIZE(dm646x_edma_map),
-};
-
-static struct resource edma_resources[] = {
-       {
-               .name   = "edma3_cc",
-               .start  = 0x01c00000,
-               .end    = 0x01c00000 + SZ_64K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_tc0",
-               .start  = 0x01c10000,
-               .end    = 0x01c10000 + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_tc1",
-               .start  = 0x01c10400,
-               .end    = 0x01c10400 + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_tc2",
-               .start  = 0x01c10800,
-               .end    = 0x01c10800 + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_tc3",
-               .start  = 0x01c10c00,
-               .end    = 0x01c10c00 + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "edma3_ccint",
-               .start  = DAVINCI_INTC_IRQ(IRQ_CCINT0),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .name   = "edma3_ccerrint",
-               .start  = DAVINCI_INTC_IRQ(IRQ_CCERRINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-       /* not using TC*_ERR */
-};
-
-static const struct platform_device_info dm646x_edma_device __initconst = {
-       .name           = "edma",
-       .id             = 0,
-       .dma_mask       = DMA_BIT_MASK(32),
-       .res            = edma_resources,
-       .num_res        = ARRAY_SIZE(edma_resources),
-       .data           = &dm646x_edma_pdata,
-       .size_data      = sizeof(dm646x_edma_pdata),
-};
-
-static struct resource dm646x_mcasp0_resources[] = {
-       {
-               .name   = "mpu",
-               .start  = DAVINCI_DM646X_MCASP0_REG_BASE,
-               .end    = DAVINCI_DM646X_MCASP0_REG_BASE + (SZ_1K << 1) - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "tx",
-               .start  = DAVINCI_DM646X_DMA_MCASP0_AXEVT0,
-               .end    = DAVINCI_DM646X_DMA_MCASP0_AXEVT0,
-               .flags  = IORESOURCE_DMA,
-       },
-       {
-               .name   = "rx",
-               .start  = DAVINCI_DM646X_DMA_MCASP0_AREVT0,
-               .end    = DAVINCI_DM646X_DMA_MCASP0_AREVT0,
-               .flags  = IORESOURCE_DMA,
-       },
-       {
-               .name   = "tx",
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_MCASP0TXINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .name   = "rx",
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_MCASP0RXINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-/* DIT mode only, rx is not supported */
-static struct resource dm646x_mcasp1_resources[] = {
-       {
-               .name   = "mpu",
-               .start  = DAVINCI_DM646X_MCASP1_REG_BASE,
-               .end    = DAVINCI_DM646X_MCASP1_REG_BASE + (SZ_1K << 1) - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {
-               .name   = "tx",
-               .start  = DAVINCI_DM646X_DMA_MCASP1_AXEVT1,
-               .end    = DAVINCI_DM646X_DMA_MCASP1_AXEVT1,
-               .flags  = IORESOURCE_DMA,
-       },
-       {
-               .name   = "tx",
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_MCASP1TXINT),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device dm646x_mcasp0_device = {
-       .name           = "davinci-mcasp",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(dm646x_mcasp0_resources),
-       .resource       = dm646x_mcasp0_resources,
-};
-
-static struct platform_device dm646x_mcasp1_device = {
-       .name           = "davinci-mcasp",
-       .id             = 1,
-       .num_resources  = ARRAY_SIZE(dm646x_mcasp1_resources),
-       .resource       = dm646x_mcasp1_resources,
-};
-
-static struct platform_device dm646x_dit_device = {
-       .name   = "spdif-dit",
-       .id     = -1,
-};
-
-static u64 vpif_dma_mask = DMA_BIT_MASK(32);
-
-static struct resource vpif_resource[] = {
-       {
-               .start  = DAVINCI_VPIF_BASE,
-               .end    = DAVINCI_VPIF_BASE + 0x03ff,
-               .flags  = IORESOURCE_MEM,
-       }
-};
-
-static struct platform_device vpif_dev = {
-       .name           = "vpif",
-       .id             = -1,
-       .dev            = {
-                       .dma_mask               = &vpif_dma_mask,
-                       .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-       .resource       = vpif_resource,
-       .num_resources  = ARRAY_SIZE(vpif_resource),
-};
-
-static struct resource vpif_display_resource[] = {
-       {
-               .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT2),
-               .end   = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT2),
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT3),
-               .end   = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT3),
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device vpif_display_dev = {
-       .name           = "vpif_display",
-       .id             = -1,
-       .dev            = {
-                       .dma_mask               = &vpif_dma_mask,
-                       .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-       .resource       = vpif_display_resource,
-       .num_resources  = ARRAY_SIZE(vpif_display_resource),
-};
-
-static struct resource vpif_capture_resource[] = {
-       {
-               .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT0),
-               .end   = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT0),
-               .flags = IORESOURCE_IRQ,
-       },
-       {
-               .start = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT1),
-               .end   = DAVINCI_INTC_IRQ(IRQ_DM646X_VP_VERTINT1),
-               .flags = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device vpif_capture_dev = {
-       .name           = "vpif_capture",
-       .id             = -1,
-       .dev            = {
-                       .dma_mask               = &vpif_dma_mask,
-                       .coherent_dma_mask      = DMA_BIT_MASK(32),
-       },
-       .resource       = vpif_capture_resource,
-       .num_resources  = ARRAY_SIZE(vpif_capture_resource),
-};
-
-static struct resource dm646x_gpio_resources[] = {
-       {       /* registers */
-               .start  = DAVINCI_GPIO_BASE,
-               .end    = DAVINCI_GPIO_BASE + SZ_4K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       {       /* interrupt */
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK0),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK0),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK1),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK1),
-               .flags  = IORESOURCE_IRQ,
-       },
-       {
-               .start  = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK2),
-               .end    = DAVINCI_INTC_IRQ(IRQ_DM646X_GPIOBNK2),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct davinci_gpio_platform_data dm646x_gpio_platform_data = {
-       .no_auto_base   = true,
-       .base           = 0,
-       .ngpio          = 43,
-};
-
-int __init dm646x_gpio_register(void)
-{
-       return davinci_gpio_register(dm646x_gpio_resources,
-                                    ARRAY_SIZE(dm646x_gpio_resources),
-                                    &dm646x_gpio_platform_data);
-}
-/*----------------------------------------------------------------------*/
-
-static struct map_desc dm646x_io_desc[] = {
-       {
-               .virtual        = IO_VIRT,
-               .pfn            = __phys_to_pfn(IO_PHYS),
-               .length         = IO_SIZE,
-               .type           = MT_DEVICE
-       },
-};
-
-/* Contents of JTAG ID register used to identify exact cpu type */
-static struct davinci_id dm646x_ids[] = {
-       {
-               .variant        = 0x0,
-               .part_no        = 0xb770,
-               .manufacturer   = 0x017,
-               .cpu_id         = DAVINCI_CPU_ID_DM6467,
-               .name           = "dm6467_rev1.x",
-       },
-       {
-               .variant        = 0x1,
-               .part_no        = 0xb770,
-               .manufacturer   = 0x017,
-               .cpu_id         = DAVINCI_CPU_ID_DM6467,
-               .name           = "dm6467_rev3.x",
-       },
-};
-
-/*
- * Bottom half of timer0 is used for clockevent, top half is used for
- * clocksource.
- */
-static const struct davinci_timer_cfg dm646x_timer_cfg = {
-       .reg = DEFINE_RES_IO(DAVINCI_TIMER0_BASE, SZ_4K),
-       .irq = {
-               DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT12)),
-               DEFINE_RES_IRQ(DAVINCI_INTC_IRQ(IRQ_TINT0_TINT34)),
-       },
-};
-
-static struct plat_serial8250_port dm646x_serial0_platform_data[] = {
-       {
-               .mapbase        = DAVINCI_UART0_BASE,
-               .irq            = DAVINCI_INTC_IRQ(IRQ_UARTINT0),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
-                                 UPF_IOREMAP,
-               .iotype         = UPIO_MEM32,
-               .regshift       = 2,
-       },
-       {
-               .flags  = 0,
-       }
-};
-static struct plat_serial8250_port dm646x_serial1_platform_data[] = {
-       {
-               .mapbase        = DAVINCI_UART1_BASE,
-               .irq            = DAVINCI_INTC_IRQ(IRQ_UARTINT1),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
-                                 UPF_IOREMAP,
-               .iotype         = UPIO_MEM32,
-               .regshift       = 2,
-       },
-       {
-               .flags  = 0,
-       }
-};
-static struct plat_serial8250_port dm646x_serial2_platform_data[] = {
-       {
-               .mapbase        = DAVINCI_UART2_BASE,
-               .irq            = DAVINCI_INTC_IRQ(IRQ_DM646X_UARTINT2),
-               .flags          = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
-                                 UPF_IOREMAP,
-               .iotype         = UPIO_MEM32,
-               .regshift       = 2,
-       },
-       {
-               .flags  = 0,
-       }
-};
-
-struct platform_device dm646x_serial_device[] = {
-       {
-               .name                   = "serial8250",
-               .id                     = PLAT8250_DEV_PLATFORM,
-               .dev                    = {
-                       .platform_data  = dm646x_serial0_platform_data,
-               }
-       },
-       {
-               .name                   = "serial8250",
-               .id                     = PLAT8250_DEV_PLATFORM1,
-               .dev                    = {
-                       .platform_data  = dm646x_serial1_platform_data,
-               }
-       },
-       {
-               .name                   = "serial8250",
-               .id                     = PLAT8250_DEV_PLATFORM2,
-               .dev                    = {
-                       .platform_data  = dm646x_serial2_platform_data,
-               }
-       },
-       {
-       }
-};
-
-static const struct davinci_soc_info davinci_soc_info_dm646x = {
-       .io_desc                = dm646x_io_desc,
-       .io_desc_num            = ARRAY_SIZE(dm646x_io_desc),
-       .jtag_id_reg            = 0x01c40028,
-       .ids                    = dm646x_ids,
-       .ids_num                = ARRAY_SIZE(dm646x_ids),
-       .pinmux_base            = DAVINCI_SYSTEM_MODULE_BASE,
-       .pinmux_pins            = dm646x_pins,
-       .pinmux_pins_num        = ARRAY_SIZE(dm646x_pins),
-       .emac_pdata             = &dm646x_emac_pdata,
-       .sram_dma               = 0x10010000,
-       .sram_len               = SZ_32K,
-};
-
-void __init dm646x_init_mcasp0(struct snd_platform_data *pdata)
-{
-       dm646x_mcasp0_device.dev.platform_data = pdata;
-       platform_device_register(&dm646x_mcasp0_device);
-}
-
-void __init dm646x_init_mcasp1(struct snd_platform_data *pdata)
-{
-       dm646x_mcasp1_device.dev.platform_data = pdata;
-       platform_device_register(&dm646x_mcasp1_device);
-       platform_device_register(&dm646x_dit_device);
-}
-
-void dm646x_setup_vpif(struct vpif_display_config *display_config,
-                      struct vpif_capture_config *capture_config)
-{
-       unsigned int value;
-
-       value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
-       value &= ~VSCLKDIS_MASK;
-       __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
-
-       value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
-       value &= ~VDD3P3V_VID_MASK;
-       __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
-
-       davinci_cfg_reg(DM646X_STSOMUX_DISABLE);
-       davinci_cfg_reg(DM646X_STSIMUX_DISABLE);
-       davinci_cfg_reg(DM646X_PTSOMUX_DISABLE);
-       davinci_cfg_reg(DM646X_PTSIMUX_DISABLE);
-
-       vpif_display_dev.dev.platform_data = display_config;
-       vpif_capture_dev.dev.platform_data = capture_config;
-       platform_device_register(&vpif_dev);
-       platform_device_register(&vpif_display_dev);
-       platform_device_register(&vpif_capture_dev);
-}
-
-int __init dm646x_init_edma(struct edma_rsv_info *rsv)
-{
-       struct platform_device *edma_pdev;
-
-       dm646x_edma_pdata.rsv = rsv;
-
-       edma_pdev = platform_device_register_full(&dm646x_edma_device);
-       return PTR_ERR_OR_ZERO(edma_pdev);
-}
-
-void __init dm646x_init(void)
-{
-       davinci_common_init(&davinci_soc_info_dm646x);
-       davinci_map_sysmod();
-}
-
-void __init dm646x_init_time(unsigned long ref_clk_rate,
-                            unsigned long aux_clkin_rate)
-{
-       void __iomem *pll1, *psc;
-       struct clk *clk;
-       int rv;
-
-       clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, ref_clk_rate);
-       clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate);
-
-       pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_1K);
-       dm646x_pll1_init(NULL, pll1, NULL);
-
-       psc = ioremap(DAVINCI_PWR_SLEEP_CNTRL_BASE, SZ_4K);
-       dm646x_psc_init(NULL, psc);
-
-       clk = clk_get(NULL, "timer0");
-       if (WARN_ON(IS_ERR(clk))) {
-               pr_err("Unable to get the timer clock\n");
-               return;
-       }
-
-       rv = davinci_timer_register(clk, &dm646x_timer_cfg);
-       WARN(rv, "Unable to register the timer: %d\n", rv);
-}
-
-static struct resource dm646x_pll2_resources[] = {
-       {
-               .start  = DAVINCI_PLL2_BASE,
-               .end    = DAVINCI_PLL2_BASE + SZ_1K - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-};
-
-static struct platform_device dm646x_pll2_device = {
-       .name           = "dm646x-pll2",
-       .id             = -1,
-       .resource       = dm646x_pll2_resources,
-       .num_resources  = ARRAY_SIZE(dm646x_pll2_resources),
-};
-
-void __init dm646x_register_clocks(void)
-{
-       /* PLL1 and PSC are registered in dm646x_init_time() */
-       platform_device_register(&dm646x_pll2_device);
-}
-
-static const struct davinci_aintc_config dm646x_aintc_config = {
-       .reg = {
-               .start          = DAVINCI_ARM_INTC_BASE,
-               .end            = DAVINCI_ARM_INTC_BASE + SZ_4K - 1,
-               .flags          = IORESOURCE_MEM,
-       },
-       .num_irqs               = 64,
-       .prios                  = dm646x_default_priorities,
-};
-
-void __init dm646x_init_irq(void)
-{
-       davinci_aintc_init(&dm646x_aintc_config);
-}
-
-static int __init dm646x_init_devices(void)
-{
-       int ret = 0;
-
-       if (!cpu_is_davinci_dm646x())
-               return 0;
-
-       platform_device_register(&dm646x_mdio_device);
-       platform_device_register(&dm646x_emac_device);
-
-       ret = davinci_init_wdt();
-       if (ret)
-               pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
-
-       return ret;
-}
-postcore_initcall(dm646x_init_devices);
index c30c69c664ea81d989dbadd3b59796d98f0c404d..2252f465cafd30a71499ac892c7ae6b7807eaaf7 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 menuconfig ARCH_DOVE
        bool "Marvell Dove" if ARCH_MULTI_V7
+       depends on ATAGS
        select CPU_PJ4
        select GPIOLIB
        select MVEBU_MBUS
@@ -8,6 +9,7 @@ menuconfig ARCH_DOVE
        select PINCTRL_DOVE
        select PLAT_ORION_LEGACY
        select PM_GENERIC_DOMAINS if PM
+       select PCI_QUIRKS if PCI
        help
          Support for the Marvell Dove SoC 88AP510
 
index 2a493bdfffc6e9e7fe1434f105798a9bfc7534d7..f90f42fc495e3163abcfeb6feb6c9082f4eba827 100644 (file)
@@ -136,14 +136,19 @@ static struct pci_ops pcie_ops = {
        .write = pcie_wr_conf,
 };
 
+/*
+ * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
+ * is operating as a root complex this needs to be switched to
+ * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
+ * the device. Decoding setup is handled by the orion code.
+ */
 static void rc_pci_fixup(struct pci_dev *dev)
 {
-       /*
-        * Prevent enumeration of root complex.
-        */
        if (dev->bus->parent == NULL && dev->devfn == 0) {
                int i;
 
+               dev->class &= 0xff;
+               dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
                for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
                        dev->resource[i].start = 0;
                        dev->resource[i].end   = 0;
index 21f4cc2ba651ebe5158b2933325626d25c96da2a..2c40996a444baa2228514fff8210002ee491b2f2 100644 (file)
@@ -1,6 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 menuconfig ARCH_EP93XX
        bool "EP93xx-based"
+       depends on ATAGS
        depends on ARCH_MULTI_V4T
        depends on CPU_LITTLE_ENDIAN
        select ARCH_SPARSEMEM_ENABLE
@@ -26,6 +27,7 @@ comment "EP93xx Platforms"
 
 config MACH_ADSSPHERE
        bool "Support ADS Sphere"
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the ADS
          Sphere board.
@@ -98,6 +100,7 @@ config MACH_EDB9315A
 
 config MACH_GESBC9312
        bool "Support Glomation GESBC-9312-sx"
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the Glomation
          GESBC-9312-sx board.
@@ -108,6 +111,7 @@ config MACH_MICRO9
 config MACH_MICRO9H
        bool "Support Contec Micro9-High"
        select MACH_MICRO9
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Contec Micro9-High board.
@@ -115,6 +119,7 @@ config MACH_MICRO9H
 config MACH_MICRO9M
        bool "Support Contec Micro9-Mid"
        select MACH_MICRO9
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Contec Micro9-Mid board.
@@ -122,6 +127,7 @@ config MACH_MICRO9M
 config MACH_MICRO9L
        bool "Support Contec Micro9-Lite"
        select MACH_MICRO9
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Contec Micro9-Lite board.
@@ -129,18 +135,21 @@ config MACH_MICRO9L
 config MACH_MICRO9S
        bool "Support Contec Micro9-Slim"
        select MACH_MICRO9
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Contec Micro9-Slim board.
 
 config MACH_SIM_ONE
         bool "Support Simplemachines Sim.One board"
+       depends on UNUSED_BOARD_FILES
         help
           Say 'Y' here if you want your kernel to support the
           Simplemachines Sim.One board.
 
 config MACH_SNAPPER_CL15
        bool "Support Bluewater Systems Snapper CL15 Module"
+       depends on UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the Bluewater
          Systems Snapper CL15 Module.
index 728aff93fba9d288da785916d7dd5cf93ea1ceb5..bcd4e4ca34f73e2bc54b31a237a94766c76859c4 100644 (file)
@@ -5,6 +5,7 @@ menu "Footbridge Implementations"
 
 config ARCH_CATS
        bool "CATS"
+       depends on UNUSED_BOARD_FILES
        select CLKEVT_I8253
        select CLKSRC_I8253
        select FOOTBRIDGE_HOST
index 75cccbd3f05f377af63497fe921ebb1d3fe05c2b..7b3440687176b74169a17c3fbdf0120311183056 100644 (file)
@@ -40,7 +40,7 @@ config ARCH_HIP04
        select HAVE_ARM_ARCH_TIMER
        select MCPM if SMP
        select MCPM_QUAD_CLUSTER if SMP
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
        help
          Support for Hisilicon HiP04 SoC family
 
index 696c59fe4588628bb44e71c5d99a2cbeecabf71d..77e435df8dfe79e45fa12e9601cbd32df08939f4 100644 (file)
@@ -96,7 +96,7 @@ config SOC_IMX5
        select HAVE_IMX_SRC
        select MXC_TZIC
 
-config SOC_IMX50
+config SOC_IMX50
        bool "i.MX50 support"
        select PINCTRL_IMX50
        select SOC_IMX5
@@ -111,7 +111,7 @@ config SOC_IMX51
        help
          This enables support for Freescale i.MX51 processor
 
-config SOC_IMX53
+config SOC_IMX53
        bool "i.MX53 support"
        select PINCTRL_IMX53
        select SOC_IMX5
@@ -216,7 +216,7 @@ config SOC_IMX7D
        select SOC_IMX7D_CM4 if ARM_SINGLE_ARMV7M
        select ARM_ERRATA_814220 if ARCH_MULTI_V7
        help
-               This enables support for Freescale i.MX7 Dual processor.
+         This enables support for Freescale i.MX7 Dual processor.
 
 config SOC_IMX7ULP
        bool "i.MX7ULP support"
index b2e1963f473ded80a6a64ade9b4fe685a907baae..3e63445cde062e08b68865707689da1f9f09b0c1 100644 (file)
@@ -32,6 +32,8 @@ static int mx25_read_cpu_rev(void)
                return IMX_CHIP_REVISION_1_0;
        case 0x01:
                return IMX_CHIP_REVISION_1_1;
+       case 0x02:
+               return IMX_CHIP_REVISION_1_2;
        default:
                return IMX_CHIP_REVISION_UNKNOWN;
        }
index 01f60a8e64041895df51cad0fa853d5ed640943d..761fbb04faa1b108d5c85ea10126fc69af05f90f 100644 (file)
@@ -3,6 +3,7 @@ menuconfig ARCH_IOP32X
        bool "IOP32x-based platforms"
        depends on ARCH_MULTI_V5
        depends on CPU_LITTLE_ENDIAN
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_XSCALE
        select GPIO_IOP
        select GPIOLIB
index 333229c65b28e33657a906cdf05b695572740695..d71417d57961bb2ed81c5554123a6a4dbac054ae 100644 (file)
@@ -18,6 +18,7 @@ if ATAGS
 config MACH_ASPENITE
        bool "Marvell's PXA168 Aspenite Development Board"
        depends on ARCH_MULTI_V5
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA168
        help
          Say 'Y' here if you want to support the Marvell PXA168-based
@@ -26,6 +27,7 @@ config MACH_ASPENITE
 config MACH_ZYLONITE2
        bool "Marvell's PXA168 Zylonite2 Development Board"
        depends on ARCH_MULTI_V5
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA168
        help
          Say 'Y' here if you want to support the Marvell PXA168-based
@@ -34,6 +36,7 @@ config MACH_ZYLONITE2
 config MACH_AVENGERS_LITE
        bool "Marvell's PXA168 Avengers Lite Development Board"
        depends on ARCH_MULTI_V5
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA168
        help
          Say 'Y' here if you want to support the Marvell PXA168-based
@@ -42,6 +45,7 @@ config MACH_AVENGERS_LITE
 config MACH_TTC_DKB
        bool "Marvell's PXA910 TavorEVB/TTC_DKB Development Board"
        depends on ARCH_MULTI_V5
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA910
        help
          Say 'Y' here if you want to support the Marvell PXA910-based
@@ -50,6 +54,7 @@ config MACH_TTC_DKB
 config MACH_BROWNSTONE
        bool "Marvell's Brownstone Development Platform"
        depends on ARCH_MULTI_V7
+       depends on UNUSED_BOARD_FILES
        select CPU_MMP2
        help
          Say 'Y' here if you want to support the Marvell MMP2-based
@@ -61,6 +66,7 @@ config MACH_BROWNSTONE
 config MACH_FLINT
        bool "Marvell's Flint Development Platform"
        depends on ARCH_MULTI_V7
+       depends on UNUSED_BOARD_FILES
        select CPU_MMP2
        help
          Say 'Y' here if you want to support the Marvell MMP2-based
@@ -72,6 +78,7 @@ config MACH_FLINT
 config MACH_MARVELL_JASPER
        bool "Marvell's Jasper Development Platform"
        depends on ARCH_MULTI_V7
+       depends on UNUSED_BOARD_FILES
        select CPU_MMP2
        help
          Say 'Y' here if you want to support the Marvell MMP2-base
@@ -83,6 +90,7 @@ config MACH_MARVELL_JASPER
 config MACH_TETON_BGA
        bool "Marvell's PXA168 Teton BGA Development Board"
        depends on ARCH_MULTI_V5
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA168
        help
          Say 'Y' here if you want to support the Marvell PXA168-based
@@ -91,6 +99,7 @@ config MACH_TETON_BGA
 config MACH_GPLUGD
        bool "Marvell's PXA168 GuruPlug Display (gplugD) Board"
        depends on ARCH_MULTI_V5
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA168
        help
          Say 'Y' here if you want to support the Marvell PXA168-based
index 3ebc1bb13f71f6d7d309ee148c9c4c4c1cb6f7ee..7f80b90248fb73d5ea7d27595903ed665352ec0d 100644 (file)
@@ -5,13 +5,13 @@
 #include <linux/platform_data/pxa_sdhci.h>
 
 extern void mmp2_timer_init(void);
-extern void __init mmp2_init_icu(void);
 extern void __init mmp2_init_irq(void);
 extern void mmp2_clear_pmic_int(void);
 
 #include <linux/i2c.h>
 #include <linux/platform_data/i2c-pxa.h>
 #include <linux/platform_data/dma-mmp_tdma.h>
+#include <linux/irqchip/mmp.h>
 
 #include "devices.h"
 
index 34f907cd165a8cbfcc608925405703ef5a65b565..c1547e098f090856465328f3aeb20b8f871b49a9 100644 (file)
@@ -5,7 +5,6 @@
 #include <linux/reboot.h>
 
 extern void pxa168_timer_init(void);
-extern void __init icu_init_irq(void);
 extern void __init pxa168_init_irq(void);
 extern void pxa168_restart(enum reboot_mode, const char *);
 extern void pxa168_clear_keypad_wakeup(void);
@@ -18,6 +17,7 @@ extern void pxa168_clear_keypad_wakeup(void);
 #include <linux/pxa168_eth.h>
 #include <linux/platform_data/mv_usb.h>
 #include <linux/soc/mmp/cputype.h>
+#include <linux/irqchip/mmp.h>
 
 #include "devices.h"
 
index 6ace5a8aa15b909469ce2156c12e8e7f8723c116..7d229214065ae3d9b982d5f8f3fe1de3705039bd 100644 (file)
@@ -3,13 +3,13 @@
 #define __ASM_MACH_PXA910_H
 
 extern void pxa910_timer_init(void);
-extern void __init icu_init_irq(void);
 extern void __init pxa910_init_irq(void);
 
 #include <linux/i2c.h>
 #include <linux/platform_data/i2c-pxa.h>
 #include <linux/platform_data/mtd-nand-pxa3xx.h>
 #include <video/mmp_disp.h>
+#include <linux/irqchip/mmp.h>
 
 #include "devices.h"
 
index f0276f0d11025db08bfd7b486f749830b339461b..da92f94494cc23b98931c7edeb7676a5c0af450e 100644 (file)
@@ -3,6 +3,7 @@ menuconfig ARCH_MV78XX0
        bool "Marvell MV78xx0"
        depends on ARCH_MULTI_V5
        depends on CPU_LITTLE_ENDIAN
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_FEROCEON
        select GPIOLIB
        select MVEBU_MBUS
index e15646af7f26d43be4c3f10e8c75d300d49d0038..4f1847babef2a53e23c2a6342cd48cd38960ba24 100644 (file)
@@ -180,14 +180,19 @@ static struct pci_ops pcie_ops = {
        .write = pcie_wr_conf,
 };
 
+/*
+ * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
+ * is operating as a root complex this needs to be switched to
+ * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
+ * the device. Decoding setup is handled by the orion code.
+ */
 static void rc_pci_fixup(struct pci_dev *dev)
 {
-       /*
-        * Prevent enumeration of root complex.
-        */
        if (dev->bus->parent == NULL && dev->devfn == 0) {
                int i;
 
+               dev->class &= 0xff;
+               dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
                for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
                        dev->resource[i].start = 0;
                        dev->resource[i].end   = 0;
index 0ac0567f721d8a2fff3d80c094aaf3a048909dc9..538a960257cc70602f59ee7a07215d7adb838e10 100644 (file)
@@ -3,6 +3,7 @@ menuconfig ARCH_OMAP1
        bool "TI OMAP1"
        depends on ARCH_MULTI_V4T || ARCH_MULTI_V5
        depends on CPU_LITTLE_ENDIAN
+       depends on ATAGS
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_OMAP
        select CLKSRC_MMIO
@@ -131,6 +132,7 @@ comment "OMAP Board Type"
 config MACH_OMAP_INNOVATOR
        bool "TI Innovator"
        depends on ARCH_OMAP15XX || ARCH_OMAP16XX
+       depends on UNUSED_BOARD_FILES
        help
           TI OMAP 1510 or 1610 Innovator board support. Say Y here if you
           have such a board.
@@ -138,6 +140,7 @@ config MACH_OMAP_INNOVATOR
 config MACH_OMAP_H2
        bool "TI H2 Support"
        depends on ARCH_OMAP16XX
+       depends on UNUSED_BOARD_FILES
        help
          TI OMAP 1610/1611B H2 board support. Say Y here if you have such
          a board.
@@ -145,6 +148,7 @@ config MACH_OMAP_H2
 config MACH_OMAP_H3
        bool "TI H3 Support"
        depends on ARCH_OMAP16XX
+       depends on UNUSED_BOARD_FILES
        help
          TI OMAP 1710 H3 board support. Say Y here if you have such
          a board.
@@ -152,6 +156,7 @@ config MACH_OMAP_H3
 config MACH_HERALD
        bool "HTC Herald"
        depends on ARCH_OMAP850
+       depends on UNUSED_BOARD_FILES
        help
          HTC Herald smartphone support (AKA T-Mobile Wing, ...)
 
@@ -165,6 +170,7 @@ config MACH_OMAP_OSK
 config OMAP_OSK_MISTRAL
        bool "Mistral QVGA board Support"
        depends on MACH_OMAP_OSK
+       depends on UNUSED_BOARD_FILES
        help
          The OSK supports an optional add-on board with a Quarter-VGA
          touchscreen, PDA-ish buttons, a resume button, bicolor LED,
@@ -173,6 +179,7 @@ config OMAP_OSK_MISTRAL
 config MACH_OMAP_PERSEUS2
        bool "TI Perseus2"
        depends on ARCH_OMAP730
+       depends on UNUSED_BOARD_FILES
        help
          Support for TI OMAP 730 Perseus2 board. Say Y here if you have such
          a board.
@@ -180,6 +187,7 @@ config MACH_OMAP_PERSEUS2
 config MACH_OMAP_FSAMPLE
        bool "TI F-Sample"
        depends on ARCH_OMAP730
+       depends on UNUSED_BOARD_FILES
        help
          Support for TI OMAP 850 F-Sample board. Say Y here if you have such
          a board.
@@ -196,6 +204,7 @@ config MACH_OMAP_PALMTE
 config MACH_OMAP_PALMZ71
        bool "Palm Zire71"
        depends on ARCH_OMAP15XX
+       depends on UNUSED_BOARD_FILES
        help
         Support for the Palm Zire71 PDA. To boot the kernel,
         you'll need a PalmOS compatible bootloader; check out
@@ -205,6 +214,7 @@ config MACH_OMAP_PALMZ71
 config MACH_OMAP_PALMTT
        bool "Palm Tungsten|T"
        depends on ARCH_OMAP15XX
+       depends on UNUSED_BOARD_FILES
        help
          Support for the Palm Tungsten|T PDA. To boot the kernel, you'll
          need a PalmOS compatible bootloader (Garux); check out
@@ -245,6 +255,7 @@ config MACH_AMS_DELTA
 config MACH_OMAP_GENERIC
        bool "Generic OMAP board"
        depends on ARCH_OMAP15XX || ARCH_OMAP16XX
+       depends on UNUSED_BOARD_FILES
        help
           Support for generic OMAP-1510, 1610 or 1710 board with
           no FPGA. Can be used as template for porting Linux to
index a8adbb4d478a8a0cf8e870cfe12fbad2b41adc11..3b53dda9ec79d8ecc72d2f097f9836730f3ad448 100644 (file)
@@ -105,6 +105,7 @@ config ARCH_OMAP2PLUS
        select MACH_OMAP_GENERIC
        select MEMORY
        select MFD_SYSCON
+       select OMAP_DM_SYSTIMER
        select OMAP_DM_TIMER
        select OMAP_GPMC
        select PINCTRL
@@ -122,7 +123,7 @@ config ARCH_OMAP2PLUS
 config OMAP_INTERCONNECT_BARRIER
        bool
        select ARM_HEAVY_MB
-       
+
 config ARCH_OMAP
        bool
 
@@ -209,6 +210,7 @@ config SOC_OMAP2420
        bool "OMAP2420 support"
        depends on ARCH_OMAP2
        default y
+       select OMAP_DM_SYSTIMER
        select OMAP_DM_TIMER
        select SOC_HAS_OMAP2_SDRC
 
@@ -241,10 +243,10 @@ config MACH_OMAP2_TUSB6010
        default y if MACH_NOKIA_N8X0
 
 config MACH_NOKIA_N810
-       bool
+       bool
 
 config MACH_NOKIA_N810_WIMAX
-       bool
+       bool
 
 config MACH_NOKIA_N8X0
        bool "Nokia N800/N810"
index 21413a9b7b6c6281f55a1c136547df48dd875673..8d829f3dafe7688a58414fe51323d40533deacfd 100644 (file)
@@ -211,6 +211,7 @@ static int __init omapdss_init_fbdev(void)
        node = of_find_node_by_name(NULL, "omap4_padconf_global");
        if (node)
                omap4_dsi_mux_syscon = syscon_node_to_regmap(node);
+       of_node_put(node);
 
        return 0;
 }
@@ -259,11 +260,13 @@ static int __init omapdss_init_of(void)
 
        if (!pdev) {
                pr_err("Unable to find DSS platform device\n");
+               of_node_put(node);
                return -ENODEV;
        }
 
        r = of_platform_populate(node, NULL, NULL, &pdev->dev);
        put_device(&pdev->dev);
+       of_node_put(node);
        if (r) {
                pr_err("Unable to populate DSS submodule devices\n");
                return r;
index 13f1b89f74b828937f0ae75a753bb8519d50b0b5..5b99d602c87bc9dd61aee6a292343768b50166ff 100644 (file)
@@ -540,6 +540,8 @@ pdata_quirks_init_clocks(const struct of_device_id *omap_dt_match_table)
 
                of_platform_populate(np, omap_dt_match_table,
                                     omap_auxdata_lookup, NULL);
+
+               of_node_put(np);
        }
 }
 
index 1b442b1285693cd9d06425d4d066bb596f5af836..63e73e9b82bc646cc08bd0122210661b3da48dc0 100644 (file)
@@ -708,6 +708,7 @@ static int omap3xxx_prm_late_init(void)
        }
 
        irq_num = of_irq_get(np, 0);
+       of_node_put(np);
        if (irq_num == -EPROBE_DEFER)
                return irq_num;
 
index bf833b51931d193cd3674af3f904389ab5550fa6..0044b2823710441fc34fd15be82a9af760954b8d 100644 (file)
@@ -7,6 +7,7 @@ menuconfig ARCH_ORION5X
        select GPIOLIB
        select MVEBU_MBUS
        select FORCE_PCI
+       select PCI_QUIRKS
        select PHYLIB if NETDEVICES
        select PLAT_ORION_LEGACY
        help
@@ -30,6 +31,7 @@ config ARCH_ORION5X_DT
 config MACH_DB88F5281
        bool "Marvell Orion-2 Development Board"
        select I2C_BOARDINFO if I2C
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Marvell Orion-2 (88F5281) Development Board
@@ -37,6 +39,7 @@ config MACH_DB88F5281
 config MACH_RD88F5182
        bool "Marvell Orion-NAS Reference Design"
        select I2C_BOARDINFO if I2C
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Marvell Orion-NAS (88F5182) RD2
@@ -52,6 +55,7 @@ config MACH_RD88F5182_DT
 config MACH_KUROBOX_PRO
        bool "KuroBox Pro"
        select I2C_BOARDINFO if I2C
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          KuroBox Pro platform.
@@ -59,24 +63,28 @@ config MACH_KUROBOX_PRO
 config MACH_DNS323
        bool "D-Link DNS-323"
        select I2C_BOARDINFO if I2C
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          D-Link DNS-323 platform.
 
 config MACH_TS209
        bool "QNAP TS-109/TS-209"
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          QNAP TS-109/TS-209 platform.
 
 config MACH_TERASTATION_PRO2
        bool "Buffalo Terastation Pro II/Live"
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          Buffalo Terastation Pro II/Live platform.
 
 config MACH_LINKSTATION_PRO
        bool "Buffalo Linkstation Pro/Live"
+       depends on ATAGS
        select I2C_BOARDINFO if I2C
        help
          Say 'Y' here if you want your kernel to support the
@@ -92,6 +100,7 @@ config MACH_LINKSTATION_MINI
 
 config MACH_LINKSTATION_LS_HGL
        bool "Buffalo Linkstation LS-HGL"
+       depends on ATAGS && UNUSED_BOARD_FILES
        select I2C_BOARDINFO if I2C
        help
          Say 'Y' here if you want your kernel to support the
@@ -99,24 +108,28 @@ config MACH_LINKSTATION_LS_HGL
 
 config MACH_TS409
        bool "QNAP TS-409"
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          QNAP TS-409 platform.
 
 config MACH_WRT350N_V2
        bool "Linksys WRT350N v2"
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Linksys WRT350N v2 platform.
 
 config MACH_TS78XX
        bool "Technologic Systems TS-78xx"
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          Technologic Systems TS-78xx platform.
 
 config MACH_MV2120
        bool "HP Media Vault mv2120"
+       depends on ATAGS
        help
          Say 'Y' here if you want your kernel to support the
          HP Media Vault mv2120 or mv5100.
@@ -130,6 +143,7 @@ config MACH_D2NET_DT
 
 config MACH_NET2BIG
        bool "LaCie 2Big Network"
+       depends on ATAGS
        select I2C_BOARDINFO if I2C
        help
          Say 'Y' here if you want your kernel to support the
@@ -144,24 +158,28 @@ config MACH_MSS2_DT
 
 config MACH_WNR854T
        bool "Netgear WNR854T"
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Netgear WNR854T platform.
 
 config MACH_RD88F5181L_GE
        bool "Marvell Orion-VoIP GE Reference Design"
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Marvell Orion-VoIP GE (88F5181L) RD.
 
 config MACH_RD88F5181L_FXO
        bool "Marvell Orion-VoIP FXO Reference Design"
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Marvell Orion-VoIP FXO (88F5181L) RD.
 
 config MACH_RD88F6183AP_GE
        bool "Marvell Orion-1-90 AP GE Reference Design"
+       depends on ATAGS && UNUSED_BOARD_FILES
        help
          Say 'Y' here if you want your kernel to support the
          Marvell Orion-1-90 (88F6183) AP GE RD.
index 92e938bba20d4827a496f29cfb000686e8c8fb0c..9574c73f3c0395ea2bb70855491ceea6dcac3c15 100644 (file)
@@ -515,14 +515,20 @@ static int __init pci_setup(struct pci_sys_data *sys)
 /*****************************************************************************
  * General PCIe + PCI
  ****************************************************************************/
+
+/*
+ * The root complex has a hardwired class of PCI_CLASS_MEMORY_OTHER, when it
+ * is operating as a root complex this needs to be switched to
+ * PCI_CLASS_BRIDGE_HOST or Linux will errantly try to process the BAR's on
+ * the device. Decoding setup is handled by the orion code.
+ */
 static void rc_pci_fixup(struct pci_dev *dev)
 {
-       /*
-        * Prevent enumeration of root complex.
-        */
        if (dev->bus->parent == NULL && dev->devfn == 0) {
                int i;
 
+               dev->class &= 0xff;
+               dev->class |= PCI_CLASS_BRIDGE_HOST << 8;
                for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
                        dev->resource[i].start = 0;
                        dev->resource[i].end   = 0;
index a5df1d9f336005411c97af76234012e8435cf9ab..b90d98bae68d74b12eac0eba44f9fc49c1df6871 100644 (file)
@@ -54,14 +54,18 @@ config MACH_PXA3XX_DT
          the device tree. Needn't select any other machine while
          MACH_PXA3XX_DT is enabled.
 
+if ATAGS
+
 config ARCH_LUBBOCK
        bool "Intel DBPXA250 Development Platform (aka Lubbock)"
+       depends on UNUSED_BOARD_FILES
        select GPIO_REG
        select PXA25x
        select SA1111
 
 config MACH_MAINSTONE
        bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
+       depends on UNUSED_BOARD_FILES
        select GPIO_REG
        select PXA27x
 
@@ -71,23 +75,27 @@ config MACH_ZYLONITE
 
 config MACH_ZYLONITE300
        bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA300
        select CPU_PXA310
        select MACH_ZYLONITE
 
 config MACH_ZYLONITE320
        bool "PXA3xx Development Platform (aka Zylonite) PXA320"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA320
        select MACH_ZYLONITE
 
 config MACH_LITTLETON
        bool "PXA3xx Form Factor Platform (aka Littleton)"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA300
        select CPU_PXA310
        select PXA3xx
 
 config MACH_TAVOREVB
        bool "PXA930 Evaluation Board (aka TavorEVB)"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA930
        select CPU_PXA935
        select PXA3xx
@@ -96,6 +104,7 @@ config MACH_TAVOREVB
 
 config MACH_SAAR
        bool "PXA930 Handheld Platform (aka SAAR)"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA930
        select CPU_PXA935
        select PXA3xx
@@ -106,10 +115,12 @@ comment "Third Party Dev Platforms (sorted by vendor name)"
 
 config ARCH_PXA_IDP
        bool "Accelent Xscale IDP"
+       depends on UNUSED_BOARD_FILES
        select PXA25x
 
 config ARCH_VIPER
        bool "Arcom/Eurotech VIPER SBC"
+       depends on UNUSED_BOARD_FILES
        select ARCOM_PCMCIA
        select I2C_GPIO if I2C=y
        select ISA
@@ -117,17 +128,20 @@ config ARCH_VIPER
 
 config MACH_ARCOM_ZEUS
        bool "Arcom/Eurotech ZEUS SBC"
+       depends on UNUSED_BOARD_FILES
        select ARCOM_PCMCIA
        select ISA
        select PXA27x
 
 config MACH_BALLOON3
        bool "Balloon 3 board"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
 
 config MACH_CSB726
        bool "Enable Cogent CSB726 System On a Module"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
        help
@@ -136,16 +150,19 @@ config MACH_CSB726
 
 config CSB726_CSB701
        bool "Enable support for CSB701 baseboard"
+       depends on UNUSED_BOARD_FILES
        depends on MACH_CSB726
 
 config MACH_CM_X300
        bool "CompuLab CM-X300 modules"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA300
        select CPU_PXA310
        select PXA3xx
 
 config MACH_CAPC7117
        bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA320
        select PXA3xx
 
@@ -170,6 +187,7 @@ endchoice
 
 config MACH_XCEP
        bool "Iskratel Electronics XCEP"
+       depends on UNUSED_BOARD_FILES
        select MTD
        select MTD_CFI
        select MTD_CFI_INTELEXT
@@ -181,6 +199,7 @@ config MACH_XCEP
 
 config TRIZEPS_PXA
        bool "PXA based Keith und Koep Trizeps DIMM-Modules"
+       depends on UNUSED_BOARD_FILES
 
 config MACH_TRIZEPS4
        bool "Keith und Koep Trizeps4 DIMM-Module"
@@ -222,15 +241,18 @@ config TRIZEPS_PCMCIA
 
 config MACH_LOGICPD_PXA270
        bool "LogicPD PXA270 Card Engine Development Platform"
+       depends on UNUSED_BOARD_FILES
        select PXA27x
 
 config MACH_PCM027
        bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
 
 config MACH_PCM990_BASEBOARD
        bool "PHYTEC PCM-990 development board"
+       depends on UNUSED_BOARD_FILES
        depends on MACH_PCM027
 
 choice
@@ -250,30 +272,36 @@ endchoice
 
 config MACH_COLIBRI
        bool "Toradex Colibri PXA270"
+       depends on UNUSED_BOARD_FILES
        select PXA27x
 
 config MACH_COLIBRI_PXA270_INCOME
        bool "Income s.r.o. PXA270 SBC"
+       depends on UNUSED_BOARD_FILES
        depends on MACH_COLIBRI
        select PXA27x
 
 config MACH_COLIBRI300
        bool "Toradex Colibri PXA300/310"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA300
        select CPU_PXA310
        select PXA3xx
 
 config MACH_COLIBRI320
        bool "Toradex Colibri PXA320"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA320
        select PXA3xx
 
 config MACH_COLIBRI_EVALBOARD
        bool "Toradex Colibri Evaluation Carrier Board support"
+       depends on UNUSED_BOARD_FILES
        depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
 
 config MACH_VPAC270
        bool "Voipac PXA270"
+       depends on UNUSED_BOARD_FILES
        select HAVE_PATA_PLATFORM
        select PXA27x
        help
@@ -283,24 +311,29 @@ comment "End-user Products (sorted by vendor name)"
 
 config MACH_H4700
        bool "HP iPAQ hx4700"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
 
 config MACH_H5000
        bool "HP iPAQ h5000"
+       depends on UNUSED_BOARD_FILES
        select PXA25x
 
 config MACH_HIMALAYA
        bool "HTC Himalaya Support"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA26x
 
 config MACH_MAGICIAN
        bool "Enable HTC Magician Support"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
 
 config MACH_MIOA701
        bool "Mitac Mio A701 Support"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
        help
@@ -310,6 +343,7 @@ config MACH_MIOA701
 
 config PXA_EZX
        bool "Motorola EZX Platform"
+       depends on UNUSED_BOARD_FILES
        select IWMMXT
        select PXA27x
 
@@ -345,16 +379,19 @@ config MACH_EZX_E2
 
 config MACH_MP900C
        bool "Nec Mobilepro 900/c"
+       depends on UNUSED_BOARD_FILES
        select PXA25x
 
 config ARCH_PXA_PALM
        bool "PXA based Palm PDAs"
+       depends on UNUSED_BOARD_FILES
 
 config MACH_PALM27X
        bool
 
 config MACH_PALMTE2
        bool "Palm Tungsten|E2"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select PXA25x
@@ -373,6 +410,7 @@ config MACH_PALMTC
 
 config MACH_PALMT5
        bool "Palm Tungsten|T5"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select IWMMXT
@@ -384,6 +422,7 @@ config MACH_PALMT5
 
 config MACH_PALMTX
        bool "Palm T|X"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select IWMMXT
@@ -395,6 +434,7 @@ config MACH_PALMTX
 
 config MACH_PALMZ72
        bool "Palm Zire 72"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select IWMMXT
@@ -406,6 +446,7 @@ config MACH_PALMZ72
 
 config MACH_PALMLD
        bool "Palm LifeDrive"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select IWMMXT
@@ -421,6 +462,7 @@ config PALM_TREO
 
 config MACH_CENTRO
        bool "Palm Centro 685 (GSM)"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select IWMMXT
@@ -433,6 +475,7 @@ config MACH_CENTRO
 
 config MACH_TREO680
        bool "Palm Treo 680"
+       depends on UNUSED_BOARD_FILES
        default y
        depends on ARCH_PXA_PALM
        select IWMMXT
@@ -465,24 +508,28 @@ config PXA_SHARPSL_DETECT_MACH_ID
 config MACH_POODLE
        bool "Enable Sharp SL-5600 (Poodle) Support"
        depends on PXA_SHARPSL
+       depends on UNUSED_BOARD_FILES
        select PXA25x
        select SHARP_LOCOMO
 
 config MACH_CORGI
        bool "Enable Sharp SL-C700 (Corgi) Support"
        depends on PXA_SHARPSL
+       depends on UNUSED_BOARD_FILES
        select PXA25x
        select PXA_SHARP_C7xx
 
 config MACH_SHEPHERD
        bool "Enable Sharp SL-C750 (Shepherd) Support"
        depends on PXA_SHARPSL
+       depends on UNUSED_BOARD_FILES
        select PXA25x
        select PXA_SHARP_C7xx
 
 config MACH_HUSKY
        bool "Enable Sharp SL-C760 (Husky) Support"
        depends on PXA_SHARPSL
+       depends on UNUSED_BOARD_FILES
        select PXA25x
        select PXA_SHARP_C7xx
 
@@ -509,6 +556,7 @@ config MACH_BORZOI
 
 config MACH_TOSA
        bool "Enable Sharp SL-6000x (Tosa) Support"
+       depends on UNUSED_BOARD_FILES
        depends on PXA_SHARPSL
        select PXA25x
 
@@ -532,11 +580,13 @@ config TOSA_USE_EXT_KEYCODES
 
 config MACH_ICONTROL
        bool "TMT iControl/SafeTCam based on the MXM-8x10 CoM"
+       depends on UNUSED_BOARD_FILES
        select CPU_PXA320
        select PXA3xx
 
 config ARCH_PXA_ESERIES
        bool "PXA based Toshiba e-series PDAs"
+       depends on UNUSED_BOARD_FILES
        select FB_W100
        select FB
        select PXA25x
@@ -591,7 +641,10 @@ config MACH_E800
 
 config MACH_ZIPIT2
        bool "Zipit Z2 Handheld"
+       depends on UNUSED_BOARD_FILES
        select PXA27x
+
+endif # ATAGS
 endmenu
 
 config PXA25x
index c546356d0f0214e45fef57d86bba7326dcde67c9..5738496717e27e3b32aa56217192075996cc069b 100644 (file)
@@ -549,7 +549,7 @@ static struct pxa2xx_spi_controller corgi_spi_info = {
 };
 
 static struct gpiod_lookup_table corgi_spi_gpio_table = {
-       .dev_id = "pxa2xx-spi.1",
+       .dev_id = "spi1",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_ADS7846_CS, "cs", 0, GPIO_ACTIVE_LOW),
                GPIO_LOOKUP_IDX("gpio-pxa", CORGI_GPIO_LCDCON_CS, "cs", 1, GPIO_ACTIVE_LOW),
index 2ae06edf413cf81f31079b148bf5ee7c8c1487b0..2fd665944103309aa4785e935adc33ddae1333f4 100644 (file)
@@ -635,7 +635,7 @@ static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
 };
 
 static struct gpiod_lookup_table pxa_ssp2_gpio_table = {
-       .dev_id = "pxa2xx-spi.2",
+       .dev_id = "spi2",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", GPIO88_HX4700_TSC2046_CS, "cs", 0, GPIO_ACTIVE_LOW),
                { },
index 753fe166ab681aa1fdc917f0804c65a6489ddc7a..624088257cfc8af1db612a480ffe9ce55f275bcb 100644 (file)
@@ -140,7 +140,7 @@ struct platform_device pxa_spi_ssp4 = {
 };
 
 static struct gpiod_lookup_table pxa_ssp3_gpio_table = {
-       .dev_id = "pxa2xx-spi.3",
+       .dev_id = "spi3",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS1, "cs", 0, GPIO_ACTIVE_LOW),
                GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS2, "cs", 1, GPIO_ACTIVE_LOW),
@@ -149,7 +149,7 @@ static struct gpiod_lookup_table pxa_ssp3_gpio_table = {
 };
 
 static struct gpiod_lookup_table pxa_ssp4_gpio_table = {
-       .dev_id = "pxa2xx-spi.4",
+       .dev_id = "spi4",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS3, "cs", 0, GPIO_ACTIVE_LOW),
                GPIO_LOOKUP_IDX("gpio-pxa", ICONTROL_MCP251x_nCS4, "cs", 1, GPIO_ACTIVE_LOW),
index f98dc61e87afbd412d6dc9e4f26f27537933149b..98423a96f4406de7aac76de03cd88621016cad67 100644 (file)
@@ -207,7 +207,7 @@ static struct spi_board_info littleton_spi_devices[] __initdata = {
 };
 
 static struct gpiod_lookup_table littleton_spi_gpio_table = {
-       .dev_id = "pxa2xx-spi.2",
+       .dev_id = "spi2",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", LITTLETON_GPIO_LCD_CS, "cs", 0, GPIO_ACTIVE_LOW),
                { },
index 20456a55c4c5d5af4e74acebcaba3824d0264b58..0827ebca1d38446f728c79929c0287a2d3559858 100644 (file)
@@ -994,7 +994,7 @@ static struct pxa2xx_spi_controller magician_spi_info = {
 };
 
 static struct gpiod_lookup_table magician_spi_gpio_table = {
-       .dev_id = "pxa2xx-spi.2",
+       .dev_id = "spi2",
        .table = {
                /* NOTICE must be GPIO, incompatibility with hw PXA SPI framing */
                GPIO_LOOKUP_IDX("gpio-pxa", GPIO14_MAGICIAN_TSC2046_CS, "cs", 0, GPIO_ACTIVE_LOW),
index dd88953adc9d2f202a098ee842b99816d0daf922..9964729cd428f512ffbce40b9d0c99d903efd842 100644 (file)
@@ -578,7 +578,7 @@ static struct pxa2xx_spi_controller spitz_spi_info = {
 };
 
 static struct gpiod_lookup_table spitz_spi_gpio_table = {
-       .dev_id = "pxa2xx-spi.2",
+       .dev_id = "spi2",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_ADS7846_CS, "cs", 0, GPIO_ACTIVE_LOW),
                GPIO_LOOKUP_IDX("gpio-pxa", SPITZ_GPIO_LCDCON_CS, "cs", 1, GPIO_ACTIVE_LOW),
index d03520555497015a53af7a228dded6757494bc85..c4d4162a7e6ee08de8642a490bfa9d5bfc49de33 100644 (file)
@@ -623,7 +623,7 @@ static struct pxa2xx_spi_controller pxa_ssp2_master_info = {
 };
 
 static struct gpiod_lookup_table pxa_ssp1_gpio_table = {
-       .dev_id = "pxa2xx-spi.1",
+       .dev_id = "spi1",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", GPIO24_ZIPITZ2_WIFI_CS, "cs", 0, GPIO_ACTIVE_LOW),
                { },
@@ -631,7 +631,7 @@ static struct gpiod_lookup_table pxa_ssp1_gpio_table = {
 };
 
 static struct gpiod_lookup_table pxa_ssp2_gpio_table = {
-       .dev_id = "pxa2xx-spi.2",
+       .dev_id = "spi2",
        .table = {
                GPIO_LOOKUP_IDX("gpio-pxa", GPIO88_ZIPITZ2_LCD_CS, "cs", 0, GPIO_ACTIVE_LOW),
                { },
index 109e126f727192e06c6216a3488da05f8f44fbb9..12a812e61c1639edbacfbe1f23550cabe15ed5e5 100644 (file)
@@ -20,6 +20,10 @@ config ARCH_MSM8X60
        bool "Enable support for MSM8X60"
        select CLKSRC_QCOM
 
+config ARCH_MSM8909
+       bool "Enable support for MSM8909"
+       select HAVE_ARM_ARCH_TIMER
+
 config ARCH_MSM8916
        bool "Enable support for MSM8916"
        select HAVE_ARM_ARCH_TIMER
index 65a0d5ce2bb3528304675e1e36e1775f65ec9337..5d2f386a46d8745b2515aa0655d7fc58618df485 100644 (file)
@@ -384,6 +384,7 @@ static const struct smp_operations qcom_smp_cortex_a7_ops __initconst = {
 #endif
 };
 CPU_METHOD_OF_DECLARE(qcom_smp_msm8226, "qcom,msm8226-smp", &qcom_smp_cortex_a7_ops);
+CPU_METHOD_OF_DECLARE(qcom_smp_msm8909, "qcom,msm8909-smp", &qcom_smp_cortex_a7_ops);
 CPU_METHOD_OF_DECLARE(qcom_smp_msm8916, "qcom,msm8916-smp", &qcom_smp_cortex_a7_ops);
 
 static const struct smp_operations qcom_smp_kpssv1_ops __initconst = {
index 54548c051402519cea5d394e1a9c932059087108..a64143574546d847e68be30cb90bea166e586ec8 100644 (file)
@@ -43,12 +43,12 @@ config SAMSUNG_ATAGS
        def_bool n
        depends on ATAGS
        help
-          This option enables ATAGS based boot support code for
-          Samsung platforms, including static platform devices, legacy
-          clock, timer and interrupt initialization, etc.
+         This option enables ATAGS based boot support code for
+         Samsung platforms, including static platform devices, legacy
+         clock, timer and interrupt initialization, etc.
 
-          Platforms that support only DT based boot need not to select
-          this option.
+         Platforms that support only DT based boot need not to select
+         this option.
 
 if SAMSUNG_ATAGS
 
@@ -102,7 +102,7 @@ config S3C_DEV_HSMMC3
 config S3C_DEV_HWMON
        bool
        help
-           Compile in platform device definitions for HWMON
+         Compile in platform device definitions for HWMON
 
 config S3C_DEV_I2C1
        bool
@@ -194,7 +194,7 @@ config S3C64XX_DEV_SPI0
 config SAMSUNG_DEV_TS
        bool
        help
-           Common in platform device definitions for touchscreen device
+         Common in platform device definitions for touchscreen device
 
 config SAMSUNG_DEV_KEYPAD
        bool
index 662c5aec2ea3ba0d9c3befced09d9f9fc51e0fd1..7287e173f30e775dd3b579e4b6596848c6109f49 100644 (file)
@@ -8,7 +8,7 @@ menuconfig ARCH_S3C24XX
        bool "Samsung S3C24XX SoCs (deprecated, see help)"
        depends on ARCH_MULTI_V4T || ARCH_MULTI_V5
        depends on CPU_LITTLE_ENDIAN
-       select ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CLKSRC_SAMSUNG_PWM
        select GPIO_SAMSUNG
        select GPIOLIB
@@ -37,8 +37,6 @@ config PLAT_S3C24XX
        help
          Base platform code for any Samsung S3C24XX device
 
-
-
 menu "Samsung S3C24XX SoCs Support"
 
 comment "S3C24XX SoCs"
@@ -293,7 +291,7 @@ config MACH_VR1000
        help
          Say Y here if you are using the Thorcom VR1000 board.
 
-endif  # CPU_S3C2410
+endif # CPU_S3C2410
 
 config S3C2412_PM_SLEEP
        bool
@@ -367,7 +365,7 @@ config MACH_VSTMS
        help
          Say Y here if you are using an VSTMS board
 
-endif  # CPU_S3C2412
+endif # CPU_S3C2412
 
 if CPU_S3C2416
 
@@ -415,7 +413,7 @@ config MACH_S3C2416_DT
          Note: This is under development and not all peripherals can be supported
          with this machine file.
 
-endif  # CPU_S3C2416
+endif # CPU_S3C2416
 
 if CPU_S3C2440 || CPU_S3C2442
 
@@ -444,7 +442,7 @@ config S3C2440_PLL_16934400
        default y if S3C24XX_PLL
        help
          PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
-endif
+endif # CPU_S3C2440 || CPU_S3C2442
 
 if CPU_S3C2440
 
@@ -540,7 +538,7 @@ config SMDK2440_CPU2440
        default y if ARCH_S3C2440
        select S3C2440_XTAL_16934400
 
-endif  # CPU_S3C2440
+endif # CPU_S3C2440
 
 if CPU_S3C2442
 
@@ -559,7 +557,7 @@ config MACH_NEO1973_GTA02
        select POWER_SUPPLY
        select S3C_DEV_USB_HOST
        help
-          Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
+         Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
 
 config MACH_RX1950
        bool "HP iPAQ rx1950"
@@ -570,9 +568,9 @@ config MACH_RX1950
        select S3C2440_XTAL_16934400
        select S3C_DEV_NAND
        help
-          Say Y here if you're using HP iPAQ rx1950
+         Say Y here if you're using HP iPAQ rx1950
 
-endif  # CPU_S3C2442
+endif # CPU_S3C2442
 
 if CPU_S3C2443 || CPU_S3C2416
 
@@ -581,7 +579,7 @@ config S3C2443_SETUP_SPI
        help
          Common setup code for SPI GPIO configurations
 
-endif  # CPU_S3C2443 || CPU_S3C2416
+endif # CPU_S3C2443 || CPU_S3C2416
 
 if CPU_S3C2443
 
@@ -594,13 +592,13 @@ config MACH_SMDK2443
        help
          Say Y here if you are using an SMDK2443
 
-endif  # CPU_S3C2443
+endif # CPU_S3C2443
 
 config PM_H1940
        bool
        help
          Internal node for H1940 and related PM
 
-endmenu        # Samsung S3C24XX SoCs Support
+endmenu # "Samsung S3C24XX SoCs Support"
 
-endif  # ARCH_S3C24XX
+endif # ARCH_S3C24XX
index 2b27bff4d9285ddf0a5bdb43ab7117248b193a17..0c1b91c3ac5fbe4d5a6b446c70ad864d96c5b261 100644 (file)
@@ -104,7 +104,7 @@ config S3C64XX_SETUP_SDHCI_GPIO
 config S3C64XX_SETUP_SPI
        bool
        help
-        Common setup code for SPI GPIO configurations
+         Common setup code for SPI GPIO configurations
 
 config S3C64XX_SETUP_USB_PHY
        bool
@@ -114,8 +114,8 @@ config S3C64XX_SETUP_USB_PHY
 # S36400 Macchine support
 
 config MACH_SMDK6400
-       bool "SMDK6400"
-       depends on ATAGS
+       bool "SMDK6400"
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6400
        select S3C64XX_SETUP_SDHCI
        select S3C_DEV_HSMMC1
@@ -126,7 +126,7 @@ config MACH_SMDK6400
 
 config MACH_ANW6410
        bool "A&W6410"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6410
        select S3C64XX_SETUP_FB_24BPP
        select S3C_DEV_FB
@@ -135,7 +135,7 @@ config MACH_ANW6410
 
 config MACH_MINI6410
        bool "MINI6410"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6410
        select S3C64XX_SETUP_FB_24BPP
        select S3C64XX_SETUP_SDHCI
@@ -151,7 +151,7 @@ config MACH_MINI6410
 
 config MACH_REAL6410
        bool "REAL6410"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6410
        select S3C64XX_SETUP_FB_24BPP
        select S3C64XX_SETUP_SDHCI
@@ -167,7 +167,7 @@ config MACH_REAL6410
 
 config MACH_SMDK6410
        bool "SMDK6410"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6410
        select S3C64XX_SETUP_FB_24BPP
        select S3C64XX_SETUP_I2C1
@@ -205,7 +205,7 @@ config SMDK6410_SD_CH0
        bool "Use channel 0 only"
        depends on MACH_SMDK6410
        help
-          Select CON7 (channel 0) as the MMC/SD slot, as
+         Select CON7 (channel 0) as the MMC/SD slot, as
          at least some SMDK6410 boards come with the
          resistors fitted so that the card detects for
          channels 0 and 1 are the same.
@@ -214,7 +214,7 @@ config SMDK6410_SD_CH1
        bool "Use channel 1 only"
        depends on MACH_SMDK6410
        help
-          Select CON6 (channel 1) as the MMC/SD slot, as
+         Select CON6 (channel 1) as the MMC/SD slot, as
          at least some SMDK6410 boards come with the
          resistors fitted so that the card detects for
          channels 0 and 1 are the same.
@@ -254,17 +254,17 @@ config SMDK6410_WM1192_EV1
 
 config MACH_NCP
        bool "NCP"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6410
        select S3C64XX_SETUP_I2C1
        select S3C_DEV_HSMMC1
        select S3C_DEV_I2C1
        help
-          Machine support for the Samsung NCP
+         Machine support for the Samsung NCP
 
 config MACH_HMT
        bool "Airgoo HMT"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select CPU_S3C6410
        select S3C64XX_SETUP_FB_24BPP
        select S3C_DEV_FB
@@ -292,21 +292,21 @@ config MACH_SMARTQ
        select SAMSUNG_DEV_PWM
        select SAMSUNG_DEV_TS
        help
-           Shared machine support for SmartQ 5/7
+         Shared machine support for SmartQ 5/7
 
 config MACH_SMARTQ5
        bool "SmartQ 5"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select MACH_SMARTQ
        help
-           Machine support for the SmartQ 5
+         Machine support for the SmartQ 5
 
 config MACH_SMARTQ7
        bool "SmartQ 7"
-       depends on ATAGS
+       depends on ATAGS && UNUSED_BOARD_FILES
        select MACH_SMARTQ
        help
-           Machine support for the SmartQ 7
+         Machine support for the SmartQ 7
 
 config MACH_WLF_CRAGG_6410
        bool "Wolfson Cragganmore 6410"
index 131015cc0c34f55475c5da2a1f4d01c5f097286d..a6d17ffcdba13afc047a645c2a6bcaf6690147f3 100644 (file)
@@ -624,7 +624,7 @@ static char mini2440_features_str[12] __initdata = "0tb";
 static int __init mini2440_features_setup(char *str)
 {
        if (str)
-               strlcpy(mini2440_features_str, str,
+               strscpy(mini2440_features_str, str,
                        sizeof(mini2440_features_str));
        return 1;
 }
index 66e79fa9ba2b6264fc4140f744e0648b478502fa..7e0161cb1c1fa0c8baa976f46b37cfb7748e58ad 100644 (file)
@@ -25,6 +25,7 @@ config ASSABET_NEPONSET
 
 config SA1100_CERF
        bool "CerfBoard"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1110_CPUFREQ
        select LEDS_GPIO_REGISTER
        help
@@ -62,6 +63,7 @@ config SA1100_COLLIE
 
 config SA1100_H3100
        bool "Compaq iPAQ H3100"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1110_CPUFREQ
        select HTC_EGPIO
        select MFD_IPAQ_MICRO
@@ -80,6 +82,7 @@ config SA1100_H3600
 
 config SA1100_BADGE4
        bool "HP Labs BadgePAD 4"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1100_CPUFREQ
        select SA1111
        help
@@ -88,6 +91,7 @@ config SA1100_BADGE4
 
 config SA1100_JORNADA720
        bool "HP Jornada 720"
+       depends on UNUSED_BOARD_FILES
        # FIXME: select ARM_SA11x0_CPUFREQ
        select SA1111
        help
@@ -107,6 +111,7 @@ config SA1100_JORNADA720_SSP
 
 config SA1100_HACKKIT
        bool "HackKit Core CPU Board"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1100_CPUFREQ
        help
          Say Y here to support the HackKit Core CPU Board
@@ -114,6 +119,7 @@ config SA1100_HACKKIT
 
 config SA1100_LART
        bool "LART"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1100_CPUFREQ
        help
          Say Y here if you are using the Linux Advanced Radio Terminal
@@ -122,6 +128,7 @@ config SA1100_LART
 
 config SA1100_NANOENGINE
        bool "nanoEngine"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1110_CPUFREQ
        select FORCE_PCI
        select PCI_NANOENGINE
@@ -132,6 +139,7 @@ config SA1100_NANOENGINE
 
 config SA1100_PLEB
        bool "PLEB"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1100_CPUFREQ
        help
          Say Y here if you are using version 1 of the Portable Linux
@@ -141,6 +149,7 @@ config SA1100_PLEB
 
 config SA1100_SHANNON
        bool "Shannon"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1100_CPUFREQ
        select REGULATOR
        select REGULATOR_FIXED_VOLTAGE
@@ -152,6 +161,7 @@ config SA1100_SHANNON
 
 config SA1100_SIMPAD
        bool "Simpad"
+       depends on UNUSED_BOARD_FILES
        select ARM_SA1110_CPUFREQ
        help
          The SIEMENS webpad SIMpad is based on the StrongARM 1110. There
@@ -163,6 +173,7 @@ config SA1100_SIMPAD
 
 config SA1100_SSP
        tristate "Generic PIO SSP"
+       depends on UNUSED_BOARD_FILES
        help
          Say Y here to enable support for the generic PIO SSP driver.
          This isn't for audio support, but for attached sensors and
index abea41f7782e50d3dc3b31b95c38fae82669b9c1..117e7b07995b942cb696f80409631ce605a4356f 100644 (file)
@@ -125,6 +125,7 @@ remove:
 
        list_for_each_entry_safe(pos, tmp, &quirk_list, list) {
                list_del(&pos->list);
+               of_node_put(pos->np);
                kfree(pos);
        }
 
@@ -174,11 +175,12 @@ static int __init rcar_gen2_regulator_quirk(void)
                memcpy(&quirk->i2c_msg, id->data, sizeof(quirk->i2c_msg));
 
                quirk->id = id;
-               quirk->np = np;
+               quirk->np = of_node_get(np);
                quirk->i2c_msg.addr = addr;
 
                ret = of_irq_parse_one(np, 0, argsa);
                if (ret) {      /* Skip invalid entry and continue */
+                       of_node_put(np);
                        kfree(quirk);
                        continue;
                }
@@ -225,6 +227,7 @@ err_free:
 err_mem:
        list_for_each_entry_safe(pos, tmp, &quirk_list, list) {
                list_del(&pos->list);
+               of_node_put(pos->np);
                kfree(pos);
        }
 
diff --git a/arch/arm/mach-sunplus/Kconfig b/arch/arm/mach-sunplus/Kconfig
new file mode 100644 (file)
index 0000000..926cde5
--- /dev/null
@@ -0,0 +1,27 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+
+menuconfig ARCH_SUNPLUS
+       bool "Sunplus SoCs"
+       depends on ARCH_MULTI_V7
+       help
+         Support for Sunplus SoC family: SP7021 and succeeding SoC-based systems,
+         such as the Banana Pi BPI-F2S development board (and derivatives).
+         (<http://www.sinovoip.com.cn/ecp_view.asp?id=586>)
+         (<https://tibbo.com/store/plus1.html>)
+
+config SOC_SP7021
+       bool "Sunplus SP7021 SoC support"
+       depends on ARCH_SUNPLUS
+       default ARCH_SUNPLUS
+       select HAVE_ARM_ARCH_TIMER
+       select ARM_GIC
+       select ARM_PSCI
+       select PINCTRL
+       select PINCTRL_SPPCTL
+       select SERIAL_SUNPLUS
+       select SERIAL_SUNPLUS_CONSOLE
+       help
+         Support for Sunplus SP7021 SoC. It is based on ARM 4-core
+         Cortex-A7 with various peripherals (e.g.: I2C, SPI, SDIO,
+         Ethernet, etc.), FPGA interface,  chip-to-chip bus.
+         It is designed for industrial control.
diff --git a/arch/arm/mach-sunplus/Makefile b/arch/arm/mach-sunplus/Makefile
new file mode 100644 (file)
index 0000000..d211de6
--- /dev/null
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for the linux kernel.
+#
+
+# Object file lists.
+
+obj-$(CONFIG_SOC_SP7021)       += sp7021.o
diff --git a/arch/arm/mach-sunplus/sp7021.c b/arch/arm/mach-sunplus/sp7021.c
new file mode 100644 (file)
index 0000000..774d0a5
--- /dev/null
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Copyright (C) Sunplus Technology Co., Ltd.
+ *       All rights reserved.
+ */
+#include <linux/kernel.h>
+#include <asm/mach/arch.h>
+
+static const char *sp7021_compat[] __initconst = {
+       "sunplus,sp7021",
+       NULL
+};
+
+DT_MACHINE_START(SP7021_DT, "SP7021")
+       .dt_compat      = sp7021_compat,
+MACHINE_END
index e1ca6a5732d27891573cbc2f2a72b3da3ffe81a4..15e8a321a713b7a0ae9ea6e5b1814b721b82a5e0 100644 (file)
@@ -77,6 +77,7 @@ static int __init zynq_get_revision(void)
        }
 
        zynq_devcfg_base = of_iomap(np, 0);
+       of_node_put(np);
        if (!zynq_devcfg_base) {
                pr_err("%s: Unable to map I/O memory\n", __func__);
                return -1;
index 576c0e6c92fca68cf4cb8f45ca7d491cabf38d9f..2129070065c32328baed62a73449f10bc9caf4e1 100644 (file)
@@ -418,7 +418,7 @@ void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
                                                   __builtin_return_address(0));
 }
 
-void __iounmap(volatile void __iomem *io_addr)
+void iounmap(volatile void __iomem *io_addr)
 {
        void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
        struct static_vm *svm;
@@ -446,13 +446,6 @@ void __iounmap(volatile void __iomem *io_addr)
 
        vunmap(addr);
 }
-
-void (*arch_iounmap)(volatile void __iomem *) = __iounmap;
-
-void iounmap(volatile void __iomem *cookie)
-{
-       arch_iounmap(cookie);
-}
 EXPORT_SYMBOL(iounmap);
 
 #if defined(CONFIG_PCI) || IS_ENABLED(CONFIG_PCMCIA)
index 2658f52903da6efac72689b24e6448edcee229bf..c42debaded95c3486f02bf08f695650912af935f 100644 (file)
@@ -230,14 +230,7 @@ void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
        return (void *)phys_addr;
 }
 
-void __iounmap(volatile void __iomem *addr)
-{
-}
-EXPORT_SYMBOL(__iounmap);
-
-void (*arch_iounmap)(volatile void __iomem *);
-
-void iounmap(volatile void __iomem *addr)
+void iounmap(volatile void __iomem *io_addr)
 {
 }
 EXPORT_SYMBOL(iounmap);
index 1652a9800ebee645616948df2249e186e948baff..340e61199057c52a13427e3dafc08e5897987e08 100644 (file)
@@ -101,6 +101,7 @@ config ARM64
        select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
        select ARCH_WANT_LD_ORPHAN_WARN
        select ARCH_WANTS_NO_INSTR
+       select ARCH_WANTS_THP_SWAP if ARM64_4K_PAGES
        select ARCH_HAS_UBSAN_SANITIZE_ALL
        select ARM_AMBA
        select ARM_ARCH_TIMER
@@ -126,6 +127,7 @@ config ARM64
        select GENERIC_CPU_VULNERABILITIES
        select GENERIC_EARLY_IOREMAP
        select GENERIC_IDLE_POLL_SETUP
+       select GENERIC_IOREMAP
        select GENERIC_IRQ_IPI
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
@@ -188,6 +190,7 @@ config ARM64
        select HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_GCC_PLUGINS
        select HAVE_HW_BREAKPOINT if PERF_EVENTS
+       select HAVE_IOREMAP_PROT
        select HAVE_IRQ_TIME_ACCOUNTING
        select HAVE_KVM
        select HAVE_NMI
@@ -226,6 +229,7 @@ config ARM64
        select THREAD_INFO_IN_TASK
        select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD
        select TRACE_IRQFLAGS_SUPPORT
+       select TRACE_IRQFLAGS_NMI_SUPPORT
        help
          ARM 64-bit (AArch64) Linux support.
 
@@ -503,6 +507,22 @@ config ARM64_ERRATUM_834220
 
          If unsure, say Y.
 
+config ARM64_ERRATUM_1742098
+       bool "Cortex-A57/A72: 1742098: ELR recorded incorrectly on interrupt taken between cryptographic instructions in a sequence"
+       depends on COMPAT
+       default y
+       help
+         This option removes the AES hwcap for aarch32 user-space to
+         workaround erratum 1742098 on Cortex-A57 and Cortex-A72.
+
+         Affected parts may corrupt the AES state if an interrupt is
+         taken between a pair of AES instructions. These instructions
+         are only present if the cryptography extensions are present.
+         All software should have a fallback implementation for CPUs
+         that don't implement the cryptography extensions.
+
+         If unsure, say Y.
+
 config ARM64_ERRATUM_845719
        bool "Cortex-A53: 845719: a load might read incorrect data"
        depends on COMPAT
@@ -821,6 +841,23 @@ config ARM64_ERRATUM_2224489
 
          If unsure, say Y.
 
+config ARM64_ERRATUM_2441009
+       bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI"
+       default y
+       select ARM64_WORKAROUND_REPEAT_TLBI
+       help
+         This option adds a workaround for ARM Cortex-A510 erratum #2441009.
+
+         Under very rare circumstances, affected Cortex-A510 CPUs
+         may not handle a race between a break-before-make sequence on one
+         CPU, and another CPU accessing the same page. This could allow a
+         store to a page that has been unmapped.
+
+         Work around this by adding the affected CPUs to the list that needs
+         TLB sequences to be done twice.
+
+         If unsure, say Y.
+
 config ARM64_ERRATUM_2064142
        bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled"
        depends on CORESIGHT_TRBE
index 4e6d635a1731ee157c57dd25f3ec7787ab47b9a0..74e9e9de37597dd63f25e05d1a8e5a4b6d6dccf2 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"
@@ -202,6 +214,17 @@ config ARCH_MXC
          This enables support for the ARMv8 based SoCs in the
          NXP i.MX family.
 
+config ARCH_NPCM
+       bool "Nuvoton NPCM Architecture"
+       select PINCTRL
+       select GPIOLIB
+       select NPCM7XX_TIMER
+       select RESET_CONTROLLER
+       select MFD_SYSCON
+       help
+         General support for NPCM8xx BMC (Arbel).
+         Nuvoton NPCM8xx BMC based on the Cortex A35.
+
 config ARCH_QCOM
        bool "Qualcomm Platforms"
        select GPIOLIB
@@ -248,7 +271,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 ebe80faab88371bc2b1ffb6e3faea9e7f2279c7d..a0e3dedd28839363e55e5eb4e3503f17b5dd69fa 100644 (file)
@@ -16,7 +16,7 @@
 
 OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
 
-targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo
+targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo Image.zst
 
 $(obj)/Image: vmlinux FORCE
        $(call if_changed,objcopy)
@@ -35,3 +35,6 @@ $(obj)/Image.lzma: $(obj)/Image FORCE
 
 $(obj)/Image.lzo: $(obj)/Image FORCE
        $(call if_changed,lzo)
+
+$(obj)/Image.zst: $(obj)/Image FORCE
+       $(call if_changed,zstd)
index 1ba04e31a43876e2dba0b63a2846dbeb4d063778..7b107fa7414bf212827dc9a15c0e010f66453548 100644 (file)
@@ -19,6 +19,7 @@ subdir-y += lg
 subdir-y += marvell
 subdir-y += mediatek
 subdir-y += microchip
+subdir-y += nuvoton
 subdir-y += nvidia
 subdir-y += qcom
 subdir-y += realtek
index 8fa5c060a4fef594b960cad20833cf8306188e8f..6a96494a2e0a3baf5104b08f21b3ce2799804993 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 f6d7d7f7fdabe908bb26806ae3f117c29b2b969a..548539c93ab0c8803504437f901cd1cb959a1386 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 f17cc89f472d9479ba69c096877c98061655a74b..8233582f62881115853efb12e23b1815c6ac64e0 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 997a193726836b62ad7204ab989198dafbc5ae69..e6d5bc0f7a612b872e88ada600458a18e7defd61 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 e47ff06a6fa9990b2d2f0b4de59b2b55de02d20b..0af6dcdf7515a9f3d5008df8664bc40c2df979bd 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 c519d9fa6967c4baf0645664ed2daeee9c60585d..4f8529d5ac007079af2bf882a245acecba4b9d6c 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 63571df24da4f23afe85a5ccd5661da72c864906..620cb3ef5f6cb7f1d6608669d42a91761d8bdb87 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 fb65319a3bd3c50139d382983a80c79b7eb52a56..219f720b8b7d92cd5a81ac625144524ed28f3e47 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 5e59d37521784430d663875313aed5374863d432..723af64a9ceee8c7129e8409647b934ec6eb10de 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 de77c87481fd1f612664804ec3880e9b1a9db33e..77b5349f60879adc64ca603998e78f49cf86072b 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 55b369534a08b0f8c56a745268d36078acdc8dde..a3e040da38a0735d23c3fab1ffe01d48bba2f637 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 1010c1b22d2e6504ef4f0b214f5a84eb906d9e07..b5c1ff19b4c41607d9e01988ffcb0660eeb88c11 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 74e0444af19bf537e195b7d85bedfdaeca43173c..d7f8bad6bb9809eb9941b0ac6f1a6d56f4db5a9c 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 c45d7b7fb39a8f68d71222b5787c52a5662d567f..6fc65e8db2206810ae34b14f48916aed4b2f00b7 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 e8770858b5d058090da5ca0f99b5134680fccb14..fb31dcb1cb6d772e9646898f0e9c96f985e34ea9 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 edb71e4a030478310739007a376d8105dd7cbda8..4903d6358112def0c27c224c9757e7505bda75be 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 fbe94abbb1f9c405d2629c62bbfb5e29efacadca..5a28303d3d4c62c99d144132315566ee75990dd0 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 4db83fbeb115bcd46db381d951edcc19bf183e89..1bf0c472f6b4ac625e113d0010a940bf52626a12 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 aa2bba75265f19cdff8eccb6638518f1021bfce2..14c220d87807d5ab28a7f465fa17a497cfb6f069 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 5159cd5771dc7668f007f3addb1c1f46ba3ab20b..48424e459f125aa0c82e3bbcd4c8314748eac7c3 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 0ab676c639a10d15e2aec7bcc41917c8899792f9..847a7c01f5af56c9ea0d922dfbf1e570fa399cbe 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 c290d1ce2b037dc870ea4f897cfeb81465753720..02bff65e5fd627cc9d09058ad921f749800db566 100644 (file)
@@ -20,8 +20,8 @@
        };
 
        psci {
-               compatible   = "arm,psci-0.2";
-               method       = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 };
 
index e0926f6bb7c334ac3f26e87245322f0c541da9f2..07dab1f1e3c899da5f8fb4541c0fe0631fbfac37 100644 (file)
@@ -20,8 +20,8 @@
        };
 
        psci {
-               compatible   = "arm,psci-0.2";
-               method       = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 };
 
index 3f5254eeb47b1e0c00fbe62c0630b2906abb04d8..04f797b5a012c859cf4169adbdd48724c583e806 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 6c7bfacbad78ea2f7641666f126592727c9f63e6..1fa6e75abd21e7488e7ea7fb895b1395d8a1c0cf 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 707daf92787bae1c19637bb90dcdb5d92d361ad7..afe375fa83cacdf029e656b18fc0b9b75cd5bf8c 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 aa14ea017a6130f20062837e7b22fb9084e1278c..023a520054947eeb6971cdb47c13b93ec7187030 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 e8394a8269ee15e7f6b8aff89eece13a911e236c..6d8cc00fedc7fe430cdf89d4d7bdeda1a33f0823 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 f887bfb445fd7f4fbeed91307cd01719dcc93f7f..63137ce3cb9d65b15f424375b7ed03b674360f65 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 6eae692792ecde5e32e75af1a2ac08550d9bde26..505ffcd8eb76dbf634ccf067e8054d300fe59743 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 c529b6c860a4760ee3b8ec0ae8cc888280249878..a4fa186f0458e99868376d39ce364a7f929313b7 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 b2ab05c2209031e3debce642869e325998b46818..c1470416faade14c22b08f397d4d1dd99076d6b8 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 4b0ff707e21b45128b1b1619b23854870d44fe52..595b49085074d82f085526f145191e36e92241ba 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 fcb304c5a40fd8eee0aa229ec00e362955d92c18..6831137c5c10987ec7f6aab273fcd6f3e0c59c57 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 ebebf344b7153dcfa1a4033fe1ff9d9896c1cb84..f5b3424c0f617c3ee156d64079d3c83cf0227e8b 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 ea9f234d1fc750a0418159392f73f02ec298416f..b8ef3bd8b840224c8a1ad1a99f09e616fc119664 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 8edbfe040805c5169577d86e1b3d0adcc96ea10e..d4858afa0e9cd0f8b90c3a8e38b74872a8125891 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 1e7f77f9b533d53073129ae804ecd7d0c71d500c..f8c40340b9c50dd5b58e0aa9f078907c3e6594f3 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 ff213618a5983cf9fc4859b372728dc3df7179fe..ad50cba42d19acb4bb946a1027ae11427639987b 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 a5d79f2f7c1960fbd13d2debbe27b919f5336a3b..603337ca56081e77af5cb3dc185e7103f187dfab 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 217d7728b63aacd42898bab97124478d08368e3d..049e7a5edca765c1b684fdc22c5fd581b63ced9e 100644 (file)
@@ -22,7 +22,7 @@
 
        gpio-keys {
                compatible = "gpio-keys";
-               button@1 {
+               button {
                        label = "POWER";
                        linux,code = <116>;
                        linux,input-type = <0x1>;
index e927811ade28cda76acb7fc0fa72a454964dbe42..efac50aeca643b2f79bd793bfd618a34098d0979 100644 (file)
@@ -22,7 +22,7 @@
 
        gpio-keys {
                compatible = "gpio-keys";
-               button@1 {
+               button {
                        label = "POWER";
                        linux,code = <116>;
                        linux,input-type = <0x1>;
index a83c82c50e2991220a49b2fc5d2e63854e5a5b0e..a8526f8157eccc2769fea331dc02b907c82a1f78 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 0f37e77f545995195c8aeb3165a7ef25133fa54c..f56d687f772de45a07d13a41e762372d747911e8 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 a496e39e6204fe44b6184907e5a5082695c1573a..5f6f30c801a7fdc50aa4a5729d0dfc72dabf592a 100644 (file)
        };
 
        panel {
-               compatible = "arm,rtsm-display", "panel-dpi";
+               compatible = "arm,rtsm-display";
                port {
                        panel_in: endpoint {
                                remote-endpoint = <&clcd_pads>;
index 065381c1cbf5a495d3f6544cf5441283c8ba0d2a..8d0d45d168d1338e286229dddb8fcd29d5bcb2cc 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 2e43f4531308869378bb8f108f76c53347b9d0ac..ba88d1596f6f1f734135f2441a2e052cc16f1914 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 f099fb611d4e5fa9ac7eb88cbcfd88c95aaa1131..6451c62146fdab52eb28292022d2f3d358e86c28 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 709389582ae370205deeef1436d0b271de91f042..438cd1ff4bd0809721942d69274ba09ac692925f 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 4135d62e44a205de3d5e8233f01a2fe0c910c794..ec85cd2c733cec77b875344e5b82aa2f0eb64dde 100644 (file)
 &mailbox {
        compatible = "arm,mhu-doorbell", "arm,primecell";
        #mbox-cells = <2>;
-       mbox-name = "ARM-MHU";
 };
 
 &smmu_etr {
index dbc22e70b62c1cfda61d5d0c50bc842738dfa1d7..cf4a582113999f737f7a78094dd0df8cbc8b6a42 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 5082fcd1fea51f634b8232742c9303d3f5f85fc3..e8584d3b698f90f56fb1bf6830c4d574c36a7f20 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 b63eefab48bd50e7bafd647e55b710a05f99666e..064f7f5496657544714ce1a3c3efb41c5eba4c29 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 169fbb7cfd34261d1c3cc95f27d2447dee1da65c..04f8524b53351b9ef9f39e7d95cfd5db3a7ed3d9 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 09d4aa8ae1d6ee89737c2836a10a2c9f66a8ba32..8f8c25e51194de833aa75e4327100bc93967a01c 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 4b46af3e164d7f9569fb0eb97e246be26a1073d0..681553577ebc6303986cfd16f41c29fa4922a3ba 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 75b548e495a0f22d7d39727322179e9edd58fdf2..bd6a354b9cb570797c8deb832f3dbc74a4cfb840 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 0895e818d3c1efd1bc6049e7fd5597e60239a9d7..e38c59cf18dc348c1e8aac20497869ec927c77d2 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 be9b971f36971d38f41ab73544f61d23635a3069..ee9c24a226f326fab9a3c1b38f883ffd54d7436d 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 4cf9aa25f6180368e280d9f489a8297da37565e0..5db9a81ac7bb54881e75a18aa8696104b7e1e049 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 a50c1dbd5545f210d3d37fa178aafc7ecc7ece49..34bb121919556dcf569b1c804a0a60bfd60daa08 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 9c233c56558ce86fce37d1980cf7cc43f4c5cd5a..23c2e0bb0a2c5ad4c1ab2c364af107d271b77d1e 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>;
index f43e4a206282fdd2a4da4d221def00b6103ee55f..424bc80bde688fcdf3601879e5c8fbf02003ef5c 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 ef0349d1c3d0916242566f8fb295eb77178fe6dd..e413a51c2d085b51e0069027136b89232d8f17a6 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 17e568853eb64bee509a8690e9d13f68e9bc9086..eec3192c063191f8465c30cc272c0bdb73e4523e 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 0ce46ec5cdc318f21987c610a8407c3961ed39db..2013718532f3705bec5e00c1ad4eec5fa7f897d6 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 238a83e5b8c69ae008228ef8b5ae5bed0b3f75ee..8bf7f7ecebaa1b8e4e45fdc37c8b6ac44892425f 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 e22c5e77fecdc233cb5df7c6a78a089bc9925111..5a8d85a7d1612d44ce0fcc3ffeb31e731f50a811 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 50a72cda4727341640d57ba6b041e0d0fb36c5a6..a863022529ac5d997fccf008ff1b0c43a72aa4fa 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 5baf060acf936e5f22ba337b119aa89c91f095c4..0bb2f28a0441455989a4f6fdc5b4c1bdc939b59e 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 d5cdd77e5a95906e157b478a91c591dea4d8f364..5627dd7734f38f6c7b7d0f3900826d3e7d6ab137 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 21200cbf71617fb1f4df2b9d9dd3e0aa1a2b7998..ca3d5a90d6d4a8ae966e7f716f978941afb504c1 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 0085e83adf65eadd6b2dbd4c4649fc2db67cda46..feab604322cf3e48a70289f87ef54a292128b8c3 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 d3f03dcbb8c381c5a083bb0cc2f4e163ccb8e59e..ef6c8967533efa45216dde21fe07063507d5b2fb 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 f476b7d8b056a80a229acaf5658d347f8d76b7e9..421d879013d7ffece57a077a3a8a44e15839aad0 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 4ba1e0499dfda4c24a61fb3d164d99c96312d171..d76f1c42f3fa504aef468e3e02d70c26686d3011 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 2ecfa90f5e28e16cf107e88b026a8ff4978fc9ce..4d721197d837e10948e6dcbd8403925efb1d5b56 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 47ea854720ce833697ced965e126ddc4659569f8..6680fb2a6dc92332eb1340e8073aa79adbbf8e54 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 a1644ceed154b60ea4bac95914da7d8d567c5e8e..9f5ff1ffe7d5ea901fd4898f2a5389987850abeb 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 a79f42a9618ec55f94c8b5e972535e41663c37d4..82a1c448837861988feb0b9570db6aef544e2c89 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 f338a886d8117d58886636621d21ad35d14c9c0c..03266bd90a06baa86204491021f6b08a9806a3c8 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 c42b966f7a645cbe505c9ce39c8e39d258c5cbae..7d6317d95b131795a92cec2e899529cee1744b58 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 b40148d728ea94ade4adcf7e47db1654b4aef8de..9e6170d9394e41b81a9ea8b214ba63a3c408a0ce 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 92eaf4ef45638a5b17b1c53f92f708eeac28f4a1..c97f4e06ae5f304831a2f2e40af4253521f7ee87 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 ac1fe1530ac75b05da7dee6b7d1d6e3c274582b9..d643381417f1cac7e77406c47ab781028b974c8d 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 00f86cada30d29a2c6903a643ecbe656d10fa5d2..66a0d103c90fa73308c84b362c1cecc457ae6aa2 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 24737e89038a48907ca8f5b6ed905cab35915ce0..35fb929e7bccecef9d739844fd616054d55743a0 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 407ab4592b4c877ff0e6ca0d156b5e24c3d0416e..6dc5eda2d2561af30ff169bfa4ba20d289bb617e 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 a7dae9bd4c118e1d28b71c63d97f393254a0a9dd..a65761a53f238fecba646f9f585cb3cb9b8370aa 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 eafa88d980b327776d326ccb88d75bb9c03f06a6..d1b4582f44c4d79230cd2f85c23cbf0527a97caa 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 1bf070473829244d87dbaccb6eee38bd46698515..afb90f59c83c5df18fa78e35fc409c621e6501b9 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 02f37dcda7eda4b062174321e08e4ba0e6e4e1cb..9e82069c941fa6ac78f6daeb4168e1e6e001813b 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 d1f6cccfa00d000578d891ac8bce738858fbb9e3..261c36540079320dd8ecaad0760e3b54930e95b1 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 f61c48776cf394e0512f8ef3714f37686b4f8d34..3ed7021a487cf11e4b5533b4b9bf512815adcb7c 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 367a232675aaca19818699c210628ea4845b7a8a..636f8602b979cd5a99a04b4f6c3abbdf0cb82bbd 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 e41e1d56f980d511e2ddfa58a9e7b6c31fb432ee..0c71b740a3166fbaa187439665ea58bcc20b87ad 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 9a4de739e6a2a1356e61c53412961d3be02c4da9..f6b017ab5f53590d319bbcdf111e6c2405a6a726 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 fb17e329cd370101ff2be87d68d19a6960681655..c5987bdbb383cac59f7f1ca1ef303af3ea1a8b36 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 410d0d5e6f1e524a5d0d5ffd974db6f953e2f9ac..fe178b7d063cbac3340f20c6363ab65d89667cc2 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 99fed35168ebc93ba00b785767219d015ec51677..82387b9cb8000c6c37d074b3950591dfd70f488d 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 b86f188a440dce35a16ce7e231cdcede2e7181d5..6445c6b90b5bb8bc1577b3233be65416508b0333 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 587e55aaa57bb971bd9715b6faae45eb67806356..9eec8a7eecfc880b11d9c7e00a13ba9785802de2 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 f70fb32b96b0c7ff6c761948847dcea3bd972686..9dda2a1554c3284890cf56ef62e8a3449225418f 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 2222ef7b3eab72666ece98b7f01167307a6f88a7..4e05120c62d410255563eba50422868360beb97a 100644 (file)
        status = "okay";
 
        usbhub: usbhub@2c {
-               compatible ="microchip,usb2513b";
+               compatible = "microchip,usb2513b";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_usbhub>;
                reg = <0x2c>;
index 49eadb081b19860eec1d33292c255f37ecf9f48d..e9f0cdd10ab620e1eb456d6c0557d74ddedc9216 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 4f767012f1f508836f7f6a2d8b9d3e7274169991..c9c2b6536233b1755e8c3c9bf9dd67cef62f8e30 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 144fc9e82da751c62ce047a121e40283ec3c8acf..a08e70fb7c7abb8443f5d2eebc98fd260ea35522 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 a79ae33cbad21927523bda75b97e0ce9a20ff501..f4ea18bb95abfe3cbfb336095e221990fd895811 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 09f7364dd1d05a114d2bc22caa75c63d3dd73f72..60c1b018bf03db0ed9ea1ac5201129229d336b86 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 c2f0f1a1566c56071dc63823178660e0f2bd6939..104bdd4e437a7c11cbd83024b17b2714792bb929 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 f68580dc87d8b25cb2d8847fe4f1b2acdcc3bacf..0192a01bf8520803944058df8cb25d059e93e6b7 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 6b3057a09251a4c420326c0e18e5cc216f30962e..8343d0cedde3371ca16e08307ffce810b13f33c3 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 3125c3869c6958f1f9306db27a021c038805c685..886b93c5893a09b8e2e7bf22ee8afba3a5f9a045 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 3df2afb2f63796fb2f702ba88e093d3f9c4b0a1a..629e604aa28194aa8036b260eb0a100c92cd4ab0 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 40f3e00ac832663eee4822efc1c12e33a47e0b96..c4eaebbb448f5c6bf55e2d8a3e33b208a45eebe4 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 70d7732dd348552d0c19c8794c505501fda5f3bd..2f8b03b0d36537caf82f5ca0ab53dc9c6fd22fa7 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 6baf6a686450ee281fb2a0384dac8a5ed2c4686b..1a16662f8867ba1e0212752e2313a10f22e08866 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 caccb0334adab73248c5cf9b13c32645970513f2..7bbec8aafa628d365c7dc7036d42c57015450255 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 bec97480a960a5051558856077b0980d7588470c..78ae73d0cf3650bfd9792fac97a6368927a6e34b 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 ada3d4dc6305c0c618b674f999d25ffd07cf6a27..2173316573bee530e09ea631cc63f5bc26bcde9a 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 1c794cdcb8e65f03705b112a805447ae6edec813..b6d493e34dc57665e04e304efa023f89bb11fb21 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 caf9c8529fcafcc4e6dfe6dac63fc147b7b24a2e..de8d0cfa4cb42a2ae24ca63bbf91b27c2c38995f 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 39a8e5e99d7999ab0d9ec9cd0382f80c9817292d..b9ba7c452a77ed46ef430b2c1fbdad777734b7eb 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 871f84b4a6ed02dba8de7b24f13710b02742653b..15f6ca4df1215cf2265f1c4579d90e23b50feedf 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 779cf167c33e2630207e96621d2f1ea614133698..c0389dd17340aa5c1e573ea77578cb6bbf177f45 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 74bed79e4f5ed333764c3f1cd7aeff7e20d371da..cf868e0bbb9c62c2ffe7b4f13520aadf162cd475 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 7e20987253a381e46c60e2fbf82913a8b3b38580..f58402eb9536103ec9c5c14277aba8724c4de70f 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 c7d4636a2cb7929263b36255f6c687795184c42b..af362a085a027d4a3d942eb26a980df60ec484b4 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 11aa135aa0f3b69d685774d5f505aa87e592736b..9b1af9c8013085871a7f1530b7092f0aab287b7f 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 623eb3beabf2a0e69efe2f6ff2071100a3ee8f07..4797537cb368355128f59a1a9d0362cf959fdb68 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 c85659d0ff5df9e31560b4c3d4073ba8f84085ca..d3bce9429e9b7fda9464a21ba77499aca55c4d19 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 2b9bf8dd14ecc08c0cd9b8f4a6e8e9ee210a9d79..d3f9eab2b78449b136e898a81851d209386d272b 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 596c073d8b05da25825c3cffbe140c1180ee1691..36722cabe626e6252a37f7d777ac18efb1e50d16 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 dbcee8b4d8d8f8f9a2f7b5453b3774568a9a0643..146e18b5b1f46a7f72e5adcb9ea040a34a6a0efb 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 d2636a0ed152e6620e35dceee3e31a94ee84b452..e3a407d03551fec7c66243ce8f1439d54b514806 100644 (file)
@@ -57,8 +57,8 @@
        };
 
        psci {
-               compatible  = "arm,psci-0.2";
-               method      = "smc";
+               compatible = "arm,psci-0.2";
+               method = "smc";
        };
 
        reserved-memory {
index 44f6149c130720b28a06c0209ece44ea23182ab2..28433b94f7c71a01b537cb72a0148df0f0789348 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 9c75fbb31f98593f8950ac710a0958122f9735b7..e21feb85d822b264a1baba7014ceb98a48658ddd 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 4fa1e93302c7514c1a0dc8eeaed72f6f784f6f20..0b5f154007be8ffa6ed19849d156bdac62dd5a2f 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 40d7b47fc52e8a83a9ecac0c9e4287e1f44dd2f8..f35111724363991a28664a2844c584c6d1e279d1 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 f3fd3cca23e9ce0ffe204c0e320d20cbb0f9e741..52dc4a50e34d324193464e663fac2232081bea46 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 2d7a193272aea01280924a3e7b1bca3cc728572b..3ac83be536274538d32048eefcae92e0080e85d3 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 28966a65391b092086dc2ec8823329a32158ae55..50a0dd36b5fb3010bfb2d968a283d03205a7552d 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 8d5bf73a909968c521bd0ea46a4e1c4bc72c59be..b4b86bb1f1a7d479b9a63c652995e6dc1ae87d04 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 afeb5cd37826a9fb9477809835d37e936df0aaa5..530e0c9ce0c9eb9052fcaa5ea682536f0b6c0a4f 100644 (file)
        vmmc-supply = <&mt6358_vmch_reg>;
        vqmmc-supply = <&mt6358_vmc_reg>;
        keep-power-in-suspend;
-       enable-sdio-wakeup;
+       wakeup-source;
        non-removable;
 };
 
index 01e650251928855814c469b632d8c34a550bb039..9d32871973a29e75b720891451a82d3684dc5bea 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 733aec2e7f77eb5de22048bc7bf7d21a653a1a4f..cbae5a5ee4a0b93278aa4747a3fd9b746fd83c45 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 db25a515e42022a2e45687fa2f70588d36017864..690dc7717f2c9d087af9c20931e18c2feeddfcd1 100644 (file)
 };
 
 &u3phy0 {
-       status="okay";
+       status = "okay";
 };
 
 &u3phy1 {
-       status="okay";
+       status = "okay";
 };
 
 &u3phy2 {
-       status="okay";
+       status = "okay";
 };
 
 &u3phy3 {
-       status="okay";
+       status = "okay";
 };
 
 &uart0 {
index b57e620c2c7280fc4dfd9393868c6f18de524306..066c14989708aadd74ea9ea600c750b33f904a27 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 7a717f926929676fe849c5690afe8d35bfb5005d..8ee1529683a34321191dbb9f917092199d8a459d 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 699256f1b9d8c069cdc642e1cb340834b02980a1..bf12be5e8d84b3a258743b34c6778b5f7efb6e9f 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 d10a9172b529e0e7bea65bca6eda3daabdfb5244..ec90bda7ed6aa25dc31fa51771ef54422c860527 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>;
        };
 };
 
diff --git a/arch/arm64/boot/dts/nuvoton/Makefile b/arch/arm64/boot/dts/nuvoton/Makefile
new file mode 100644 (file)
index 0000000..a99dab9
--- /dev/null
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+dtb-$(CONFIG_ARCH_NPCM) += nuvoton-npcm845-evb.dtb
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-common-npcm8xx.dtsi
new file mode 100644 (file)
index 0000000..aa7aac8
--- /dev/null
@@ -0,0 +1,170 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2021 Nuvoton Technology tomer.maimon@nuvoton.com
+
+#include <dt-bindings/clock/nuvoton,npcm845-clk.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <2>;
+       interrupt-parent = <&gic>;
+
+       soc {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               compatible = "simple-bus";
+               interrupt-parent = <&gic>;
+               ranges;
+
+               gcr: system-controller@f0800000 {
+                       compatible = "nuvoton,npcm845-gcr", "syscon";
+                       reg = <0x0 0xf0800000 0x0 0x1000>;
+               };
+
+               gic: interrupt-controller@dfff9000 {
+                       compatible = "arm,gic-400";
+                       reg = <0x0 0xdfff9000 0x0 0x1000>,
+                             <0x0 0xdfffa000 0x0 0x2000>,
+                             <0x0 0xdfffc000 0x0 0x2000>,
+                             <0x0 0xdfffe000 0x0 0x2000>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
+                       #interrupt-cells = <3>;
+                       interrupt-controller;
+                       #address-cells = <0>;
+                       ppi-partitions {
+                               ppi_cluster0: interrupt-partition-0 {
+                                       affinity = <&cpu0 &cpu1 &cpu2 &cpu3>;
+                               };
+                       };
+               };
+       };
+
+       ahb {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               compatible = "simple-bus";
+               interrupt-parent = <&gic>;
+               ranges;
+
+               rstc: reset-controller@f0801000 {
+                       compatible = "nuvoton,npcm845-reset";
+                       reg = <0x0 0xf0801000 0x0 0x78>;
+                       #reset-cells = <2>;
+                       nuvoton,sysgcr = <&gcr>;
+               };
+
+               clk: clock-controller@f0801000 {
+                       compatible = "nuvoton,npcm845-clk";
+                       #clock-cells = <1>;
+                       reg = <0x0 0xf0801000 0x0 0x1000>;
+               };
+
+               apb {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       compatible = "simple-bus";
+                       interrupt-parent = <&gic>;
+                       ranges = <0x0 0x0 0xf0000000 0x00300000>,
+                               <0xfff00000 0x0 0xfff00000 0x00016000>;
+
+                       timer0: timer@8000 {
+                               compatible = "nuvoton,npcm845-timer";
+                               interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x8000 0x1C>;
+                               clocks = <&clk NPCM8XX_CLK_REFCLK>;
+                               clock-names = "refclk";
+                       };
+
+                       serial0: serial@0 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x0 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       serial1: serial@1000 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x1000 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       serial2: serial@2000 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x2000 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       serial3: serial@3000 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x3000 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       serial4: serial@4000 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x4000 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       serial5: serial@5000 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x5000 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       serial6: serial@6000 {
+                               compatible = "nuvoton,npcm845-uart", "nuvoton,npcm750-uart";
+                               reg = <0x6000 0x1000>;
+                               clocks = <&clk NPCM8XX_CLK_UART>;
+                               interrupts = <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-shift = <2>;
+                               status = "disabled";
+                       };
+
+                       watchdog0: watchdog@801c {
+                               compatible = "nuvoton,npcm845-wdt", "nuvoton,npcm750-wdt";
+                               interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x801c 0x4>;
+                               status = "disabled";
+                               clocks = <&clk NPCM8XX_CLK_REFCLK>;
+                               syscon = <&gcr>;
+                       };
+
+                       watchdog1: watchdog@901c {
+                               compatible = "nuvoton,npcm845-wdt", "nuvoton,npcm750-wdt";
+                               interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0x901c 0x4>;
+                               status = "disabled";
+                               clocks = <&clk NPCM8XX_CLK_REFCLK>;
+                               syscon = <&gcr>;
+                       };
+
+                       watchdog2: watchdog@a01c {
+                               compatible = "nuvoton,npcm845-wdt", "nuvoton,npcm750-wdt";
+                               interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>;
+                               reg = <0xa01c 0x4>;
+                               status = "disabled";
+                               clocks = <&clk NPCM8XX_CLK_REFCLK>;
+                               syscon = <&gcr>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845-evb.dts
new file mode 100644 (file)
index 0000000..a5ab2bc
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2021 Nuvoton Technology tomer.maimon@nuvoton.com
+
+/dts-v1/;
+#include "nuvoton-npcm845.dtsi"
+
+/ {
+       model = "Nuvoton npcm845 Development Board (Device Tree)";
+       compatible = "nuvoton,npcm845-evb", "nuvoton,npcm845";
+
+       aliases {
+               serial0 = &serial0;
+       };
+
+       chosen {
+               stdout-path = &serial0;
+       };
+
+       memory {
+               reg = <0x0 0x0 0x0 0x40000000>;
+       };
+};
+
+&serial0 {
+       status = "okay";
+};
+
+&watchdog1 {
+       status = "okay";
+};
diff --git a/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi b/arch/arm64/boot/dts/nuvoton/nuvoton-npcm845.dtsi
new file mode 100644 (file)
index 0000000..12118b7
--- /dev/null
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: GPL-2.0
+// Copyright (c) 2021 Nuvoton Technology tomer.maimon@nuvoton.com
+
+#include "nuvoton-common-npcm8xx.dtsi"
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       cpus {
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35";
+                       clocks = <&clk NPCM8XX_CLK_CPU>;
+                       reg = <0x0 0x0>;
+                       next-level-cache = <&l2>;
+                       enable-method = "psci";
+               };
+
+               cpu1: cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35";
+                       clocks = <&clk NPCM8XX_CLK_CPU>;
+                       reg = <0x0 0x1>;
+                       next-level-cache = <&l2>;
+                       enable-method = "psci";
+               };
+
+               cpu2: cpu@2 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35";
+                       clocks = <&clk NPCM8XX_CLK_CPU>;
+                       reg = <0x0 0x2>;
+                       next-level-cache = <&l2>;
+                       enable-method = "psci";
+               };
+
+               cpu3: cpu@3 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a35";
+                       clocks = <&clk NPCM8XX_CLK_CPU>;
+                       reg = <0x0 0x3>;
+                       next-level-cache = <&l2>;
+                       enable-method = "psci";
+               };
+
+               l2: l2-cache {
+                       compatible = "cache";
+               };
+       };
+
+       arm-pmu {
+               compatible = "arm,cortex-a35-pmu";
+               interrupts = <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
+                            <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>;
+               interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
+       };
+
+       psci {
+               compatible      = "arm,psci-1.0";
+               method          = "smc";
+       };
+
+       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)>;
+       };
+};
index f16acb4cabaab4b2e9c34444efca86fd834c70a0..d461da0b80492ff9bf09c76c87ac3895aa991fd9 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 70737a09a9b8676c91df31c3d64705f1adf8dc8b..47cf2013afcc3dba22b5cb844393a8038f9625b3 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 7e9aad9ff1777072e4235d142a72d91c81551c3d..3e83a4d52eb1e7dba6eacf2132f7c3bb01759e7a 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 0e9afc3e2f2689d7f47e8b8d6ebce23b7b01045e..59a10fb184f8258cbfffa2841cda424e301f6815 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 a7d7cfd66379f305173a5d81e59c1421f85ae93e..b0f9393dd39cc78bb615ec29d970ae05a2cccf99 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 bce518ace6a009e82eb8d8a77050389e67b8764c..bc1041d11f6dc4c6e96c386b28c7ab0661833a24 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 7acc32dd290a291939ede760c95c4e8a6ea0ef57..273a1ef716b60b7f1bcee69dce1c5879416e7b66 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 d1f8248c00f41bfc6b373d9fdc0b6092bb5e8172..d0ed55e5c8607b16f478f9814e8a992452d64839 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 328fbfec4ee8d72a9324533e4ab212385e6a75d8..1e26ca91a94498e96fa6e845772af82348094faf 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 4b43b89a9651defc3a9a82551f21b1fd5a79469c..a44c56c1e56e5bbba140db680f33428a67dc4645 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 10347b6e6e8478f9130b5952b1b8d2a8bde40e6f..8e657b10569d6c4c749f09fb11133d2cf8bea984 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 746bd52ea3f7cde8477d792f4c9c758181dd5b67..37678c337a34cb86f51981ffaf20166075da5797 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 a263d51882ee766ac6061eb6c812a4075458d915..5f3a1c56b2eb83615205cea2dd24545df0075892 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 4f0e51f1a3430d4ed03c8ca6a3e75611e43290b9..724e874506057cada8bcf58587f1c6b5524a5308 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 eaf1994abb0458e46133eb441f13ed46ff8ec3ed..02a10bb38562bd681278b75cd364560579319db9 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 cb3af539e4770249883553d8815b3b59169a8746..81a0f599685f94e14efb923875b9e073bc5c0c8b 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 2f8aec2cc6db633f128e3cea8b1315122bd412f3..1d86a33de528c6cf1a8dbbcd3e31da6cecad5626 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
@@ -107,6 +129,7 @@ dtb-$(CONFIG_ARCH_QCOM)     += sdm845-sony-xperia-tama-akari.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-sony-xperia-tama-akatsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-sony-xperia-tama-apollo.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-xiaomi-beryllium.dtb
+dtb-$(CONFIG_ARCH_QCOM)        += sdm845-xiaomi-polaris.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm845-shift-axolotl.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm850-lenovo-yoga-c630.dtb
 dtb-$(CONFIG_ARCH_QCOM)        += sdm850-samsung-w737.dtb
index 7c1eab605c15a197e1d02a683e48864fb6689e54..1b613098fb4a0b140a1c212f7e19b6387c5cf4fd 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 49afbb1a066a3a79f718003fec980a1ebfe45d7a..c1cb1ba5173cc4d62a1d382d71d1a9102bc0b9e8 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 821cb7c0c183a860280cae354a93a16ebe52e16b..1ba2eca33c7b6ada5731064472915c9a0aa5d51c 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 c89499e366d3089105b9d18718e0861f6f22c899..aaad7d9059f648374bd3fd8f0a08889fddaadfd4 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 de20cb98acd342a5eb20e3d683fc773f5ad8457f..81dc3a0bcd7d8c80fb272dac129bb3705af72605 100644 (file)
@@ -5,11 +5,8 @@
 #include "ipq8074.dtsi"
 
 / {
-       #address-cells = <0x2>;
-       #size-cells = <0x2>;
        model = "Qualcomm Technologies, Inc. IPQ8074-HK01";
        compatible = "qcom,ipq8074-hk01", "qcom,ipq8074";
-       interrupt-parent = <&intc>;
 
        aliases {
                serial0 = &blsp1_uart5;
index ce86d9b10d69c2ab33ae0dac46ffb52bf1d2c7a6..40415d988e4ab81ee161ff9a19ba80d7fab24102 100644 (file)
@@ -7,11 +7,6 @@
 #include "ipq8074.dtsi"
 
 / {
-       #address-cells = <0x2>;
-       #size-cells = <0x2>;
-
-       interrupt-parent = <&intc>;
-
        aliases {
                serial0 = &blsp1_uart5;
        };
index 4c38b15c6fd4170108d14d958da0a3b46ee22dfa..d53675fc15959ab385e6bc7f8b1c5bf1814caa70 100644 (file)
@@ -7,8 +7,12 @@
 #include <dt-bindings/clock/qcom,gcc-ipq8074.h>
 
 / {
+       #address-cells = <2>;
+       #size-cells = <2>;
+
        model = "Qualcomm Technologies, Inc. IPQ8074";
        compatible = "qcom,ipq8074";
+       interrupt-parent = <&intc>;
 
        clocks {
                sleep_clk: sleep_clk {
                                <&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>;
                        timeout-sec = <30>;
                };
 
+               apcs_glb: mailbox@b111000 {
+                       compatible = "qcom,ipq8074-apcs-apps-global";
+                       reg = <0x0b111000 0x6000>;
+
+                       #clock-cells = <1>;
+                       #mbox-cells = <1>;
+               };
+
                timer@b120000 {
                        #address-cells = <1>;
                        #size-cells = <1>;
                        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 265e539e7e99efcc1ecb6808686a1f163d842de4..3dc9619fde6ef5872332075007e42b4d6af4bc49 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 d4d33dd3584a77add131f7486a4b4263f7636cf1..dd92070a12116ed4485b16dd6234934cae65cbd3 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 00488afb413dd9643c30b1dd12268a5a40a054e1..9e470c67274e5269a21c5320bb6c6af41e2bf29d 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 b3836dde8a5480636b2b44397f9478ed93bfe5c7..d85e7f7c0835abbb04c2548b8fbf01195f5489ce 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 f9ce123471d4337029bd483ccf2cd432736375fb..b4812f093b1763ada06f0ec1ebcfe5fb3c09e93a 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 9b4b7de7cec2d6f9da3c745c7570abb618fdce07..10f6509a87095fdfbfe521b165c5f9f3667452f6 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 4ba11b020f9b9cefe53bc73a4bfe5a2e8f51e042..bc198a2eea25d1f3002dcd62b2cf948a98d49bca 100644 (file)
                drive-strength = <2>;
                bias-disable;
        };
-
-       ts_int_default: ts-int-default {
-               pins = "gpio13";
-               function = "gpio";
-
-               drive-strength = <2>;
-               bias-disable;
-       };
 };
index d978c9ac179d4b0d6e9fe536d7e2b496c38aaa1d..7f2ab1891d91c39daee6150ded58a2032ca1b7c0 100644 (file)
                drive-strength = <2>;
                bias-disable;
        };
-
-       ts_int_default: ts-int-default {
-               pins = "gpio13";
-               function = "gpio";
-
-               drive-strength = <2>;
-               bias-disable;
-       };
 };
index 6c408d61de75ad435a1c9e8e87f4452bb8fb0ce9..eabeed18cfaa4abd655a3472695924e61f536386 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 58dfbfff4c7d430946db5b745d0ed7c0fceff247..439e89cf7878852b6b52691586eaf700a46975ff 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 69a44c6f57fc237b7f00ddb8c816fe7f88675c0d..84a352dcf9a2a058e5407c84b3a4c8f55bc6522d 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 05472510e29d57976be4d7c9da1ab6661312d966..48bc2e09128d92e3aebd254b71586b926f8241d2 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 ffc3ec2cd3bcbd79f8c657ca0ae874ec9991eb5b..8416a45ca4fd4dbcc13663fb7a599874591c0788 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 afa91ca9a3dcd423b6e8b6cba5bb3745735536c5..cbe11c060df93647efad4fda8c19426659d4559d 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>;
index cc038f9b641fa1261fd535c8ff9d88018c1d4d57..61ec905025b074782da28e70fae175ef1ef9f39e 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 e5a45af0bd12c5e5b7c07b3a1902a86f7858aebb..f430d797196f5210ca2da26d7d7ee8b452623dea 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 1ac2913b182ccdfb45cef036314ec87c8c400914..8bc6c070e3066f19af54ceb11c43b3f3d29eceba 100644 (file)
                        };
                };
 
-               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 ca3c633f5a4509aea23b00dc60d4dff344378812..e165b5e890a09bca5a3cb8851d7b91709e13a1c4 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 a7090befc16f6ea44e0cd912833958e9fc440f20..6276499798912b110a8a911813b7000ddd6cc37f 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 22978d06f85bfbf2c698874287c52116c97f51ee..25f30ec277c127c52a98656a6eed4d85a18c80af 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 1e2dd6763ad15efc34cee1ca915a503fdf9b26c4..30a9e4bed4af4e3720200f0092c7441f87320533 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 9932186f7ceb072d7e1647526c4fdcdfe3b8eecb..742eac4ce9b3537d089be71077fb76931a4ab3a7 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 e204b7050441a2472dac4826fc3810bbba4421f8..102f3e9a79a106c8a8903de45479882e1d3209c0 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 b3b352530d76e2fb60d9ebd6e1ee339d80482cac..7928b819747498d5f3e8ceeeb40c00179b3cbde8 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 dc5b9b274df3b3f05b275b4fe1e9f2f72aad88ae..429ba57e20f711073c69132bf93f12527cdeddb5 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 1eb406b43fd741d71efea1923e29f88a07a953b5..38389c6a3f68276be46add4fcdcf6f5e88c8a774 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 f55f6f3e3e5d441eb84ef3d141deb11444d352da..cf81c33a9d7e9adc806772c1c1cdd8766d3e9ec1 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 66540d2ca13b05656ec5fa729abc6920d4973999..a3ca58100aee76569e4ab17533defd7d8e998415 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 9563eb62db88a47c851e46c45f2310171b8e4d82..ef2a88a64d32a45533d38c10fb1e60b7cff70117 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 dbaea360bffcc411ec2f8caf1a6b74974c34b09d..62bda23791bb2b36fe8ba54211bd2e5d766c24e8 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 caacb7c28402c8b45cee35ad7347545b87349da1..fcaefc1b1e2f0adc7ba42dd73a949710c7f29671 100644 (file)
@@ -29,3 +29,7 @@
        regulator-min-microvolt = <2800000>;
        regulator-max-microvolt = <2800000>;
 };
+
+&vreg_lvs1a_1p8 {
+       status = "disabled";
+};
index 978495a8a6b9a2a77083d588bc5207293377a8a1..20fe0394a3c16c3b257bccdb51d3c398ac4d1fba 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 4a1f98a210319d38c1de20939cb1914f0b6583ec..c21333aa73c2990df39838f736485884b754efc9 100644 (file)
 };
 
 &vreg_l18a_2p85 {
-       regulator-min-microvolt = <2850000>;
-       regulator-max-microvolt = <2850000>;
+       /* Note: Round-down from 2850000 to be a multiple of PLDO step-size 8000 */
+       regulator-min-microvolt = <2848000>;
+       regulator-max-microvolt = <2848000>;
 };
 
 &vreg_l22a_2p85 {
-       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>;
 };
index 47488a1aecaef2b8be4b1fb5a97da4bab042f06f..d08639082247629bac84904fa2508b344136f92d 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 758c45bbbe781dbd3d4e1cfeda9e63d05b65a434..02d21bff21980a04feafdd5575254638ab857f4e 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 c5d85064562bb27668f79d208652027487b090cb..ecf9b99191828c40006473696bfef74af0414cfd 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 c482663aad569562112d908857b17ff528614055..d0eefbb516634162526137d742132fe0efca6ffe 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 cfef423536116bf6ffdbdaa410232eff3e9d430d..c7945470ffee8c777d92bc0c3b8d3733323b25c1 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 3f97607d8baa89ab1e16a0044c4feacf187bde46..50fb6c753bf81731dff54f7f932a5e1a1a7c7675 100644 (file)
@@ -28,5 +28,9 @@
                reg = <0x5 SPMI_USID>;
                #address-cells = <1>;
                #size-cells = <0>;
+
+               pm8005_regulators: regulators {
+                       compatible = "qcom,pm8005-regulators";
+               };
        };
 };
index b126d7e7e4fb67b33d35e2fb668e266afd297e12..0c2c424be0eacdcce0ebd7d967950780521f987c 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 0df76f7b1cc11fedc685eafb0a3201401c342bc6..fd8434215924e605a1d5308b6ed6739e16af57c8 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 058cc5107c75410d4c81ebb0e3829fc4783e039f..5d1ec3a6cc3c534e9e468ab9d17547143c8f602d 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 52f094a2b713aaa6a4f78bc67cddb41b6de95bc5..c62d023b39a2603ae3ea0a14d096338e143c22c2 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 b10f33afa5e31fc8f431f807472c9741bf63682a..2dfeb99300d7472f2f9e86a30a06bcf5f745bbc1 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 f1d1d4c8edf8f927295dff2ed5ff7cd70f923292..f1c7bd9d079c20390821d1c919e409e7622d90bd 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 d58902432812802219132af6ff00f01a7e0697a0..606c2a6d1f0fcf2d3e29f74f6cbf1b9b4a8fcf9c 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 5ab46117d737d0be6802795a7b976adbda0b3e57..ab342397fcd8ff2b18ecdbbe2c8bbda42ef7f374 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 6e7c252568e65707a5a6c47e5a122088579c7d2a..84c44912ec938a85b4ead64eeb0b09703b5d1bb6 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 0fef5f113f05e461a42b60f2c96906ca8317b1fc..6d3d212560c18ed7d49a97e567dda165ad7528c2 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 7072e5a2e73f5e6fbc0a11af13c42c9c6931c5f4..68e9122363aec9bfccf7262a7e491263fd2f5c90 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 72075964fbb910dfa1905d7ba083f0869dd71b19..c307fc6625118ed1ac0fc6be315335fa357c11c1 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 604324188603ff8f37e81a89971270d83d2d406b..ec24c4478005ad606d63f493835db44893cd07b6 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 98d173a377d5eded86586700332d8e29738bff70..634b0681d04ca5fcb693a1aa33382743edd60634 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 2f3104a84417c91a2f6170e6521f1004a38a4d79..1721ebe5759b9f64ca0070409110968a20f89656 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 d912166b7552a97ed8679feb63541583d3515062..9ab9900615223f381774c7dc519c13623eba8327 100644 (file)
                };
 
                qfprom: qfprom@a4000 {
-                       compatible = "qcom,qfprom";
+                       compatible = "qcom,qcs404-qfprom", "qcom,qfprom";
                        reg = <0x000a4000 0x1000>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                                compatible = "snps,dwc3";
                                reg = <0x07580000 0xcd00>;
                                interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
-                               phys = <&usb2_phy_sec>, <&usb3_phy>;
+                               phys = <&usb2_phy_prim>, <&usb3_phy>;
                                phy-names = "usb2-phy", "usb3-phy";
                                snps,has-lpm-erratum;
                                snps,hird-threshold = /bits/ 8 <0x10>;
                                compatible = "snps,dwc3";
                                reg = <0x078c0000 0xcc00>;
                                interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
-                               phys = <&usb2_phy_prim>;
+                               phys = <&usb2_phy_sec>;
                                phy-names = "usb2-phy";
                                snps,has-lpm-erratum;
                                snps,hird-threshold = /bits/ 8 <0x10>;
                        };
 
                        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 0e63f707b9115f9f1920d8399dabb9eede3b3d56..bf8077a1cf9a786fb40218c830b95192aa171e97 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>
        leds {
                compatible = "gpio-leds";
 
-               user4 {
+               led-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";
                };
 
-               wlan {
+               led-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";
                };
 
-               bt {
+               led-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";
                };
-
        };
 
        lt9611_1v2: lt9611-vdd12-regulator {
                "NC",
                "PM3003A_MODE";
 
-       lt9611_rst_pin: lt9611-rst-pin {
+       lt9611_rst_pin: lt9611-rst-state {
                pins = "gpio5";
                function = "normal";
 
        };
 };
 
+&pm8150l_lpg {
+       status = "okay";
+
+       #address-cells = <1>;
+       #size-cells = <0>;
+
+       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 acdb36f4479fcc27ad65ef17380bda73140d48e4..9dee131b1e2459c39c9225c07c0695083bd1ff90 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 8ac1f1e610063f66f6314bc39ab5f1e4359bd428..7ee407f7b6bb5fb52b9f8ba6a6e5052ffea549a6 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 d1e2df5164eaab4befb4e741d21b02908f1e9df7..1bd6c7dcd9e91784e80bd51f9080039da280ee41 100644 (file)
@@ -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 88f6a7d4d0203a708fe9a8d0f49eb85139b135cb..2cf7d5212c61c38be457ec056faa118f4d13349f 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 /* 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 3df4920295ad777ded60d583968802c46817c756..a7582fb547eea22e663f3543aa873fcc7f7b8d57 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 352827e5740a9d973004ea4bde396ea83a910056..59a23d0e96517ed10e53d65a2a0effdf96ad6268 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 e55dbaa6dc1287ad64d973885d012f0d26ebcc5f..b5f534db135a6fed6e867aa9a2f8c2070c8f1708 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 5dcaac23a1381681cef77d6f760c459fcb9a6035..b82c335c25affe79f279ab8eb75db71c589b302e 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>;
 
                        status = "disabled";
 
-                       mdp: mdp@ae01000 {
+                       mdp: display-controller@ae01000 {
                                compatible = "qcom,sc7180-dpu";
                                reg = <0 0x0ae01000 0 0x8f000>,
                                      <0 0x0aeb0000 0 0x2008>;
                                         <&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 {
                                compatible = "qcom,sc7180-dp";
                                status = "disabled";
 
-                               reg = <0 0x0ae90000 0 0x1400>;
+                               reg = <0 0xae90000 0 0x200>,
+                                     <0 0xae90200 0 0x200>,
+                                     <0 0xae90400 0 0xc00>,
+                                     <0 0xae91000 0 0x400>,
+                                     <0 0xae91400 0 0x400>;
 
                                interrupt-parent = <&mdss>;
                                interrupts = <12>;
                                         <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK>;
                                clock-names = "core_iface", "core_aux", "ctrl_link",
                                              "ctrl_link_iface", "stream_pixel";
-                               #clock-cells = <1>;
                                assigned-clocks = <&dispcc DISP_CC_MDSS_DP_LINK_CLK_SRC>,
                                                  <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
                                assigned-clock-parents = <&dp_phy 0>, <&dp_phy 1>;
                };
 
                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 9f4a9c263c3515793f433a8e522f2258abc95ee5..cfe2741456a1a39285aeb72eea9f02561d3fe7b7 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..859faaa
--- /dev/null
@@ -0,0 +1,84 @@
+// 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.
+ */
+
+/* PINCTRL */
+
+&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>;
+};
index a4ac33c4fd59a4dca8ded231d1dedc0de5327a22..7881bbc641a0ba2c1f2ad0c92bd8239b2ad0ccd7 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 */
 
 /*
index b69ca09d9bfb25ca4104a1a519df403e845e6ad7..c1647a85a371a4ff389861598907f578a70d2ab7 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 d3d6ffad4eff221a8bcc4260dfd9c42fd3644871..2cacafd8faa8dab1f3020b69049fa2c6227ec625 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 9cb1bc8ed6b5ca25e69cd16d4748af2e291a0717..3f8996c00b053bac0162dc6aeccff066470db62f 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,13 @@ ap_i2c_tpm: &i2c14 {
        status = "okay";
 };
 
+&mdss_dp {
+       status = "okay";
+       pinctrl-names = "default";
+       pinctrl-0 = <&dp_hot_plug_det>;
+       data-lanes = <0 1>;
+};
+
 &mdss_mdp {
        status = "okay";
 };
@@ -476,6 +484,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 5eb668991e24926e8becfa74d404e8878e96df6e..a74e0b730db613e217bdc380b283b410c2f8baf8 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 d59002d4492efe0c2d6c5dbb2330add8033c4a36..7adf31bb98272a39c630c5029d894b9575a790bb 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:
 
 /* NOTE: Not all Qcards have eDP connector stuffed */
 &mdss_edp {
-       vdda-0p9-supply = <&vdd_a_edp_0_0p9>;
-       vdda-1p2-supply = <&vdd_a_edp_0_1p2>;
-
        aux-bus {
                edp_panel: panel {
                        compatible = "edp-panel";
@@ -517,7 +520,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 +530,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 +607,6 @@ mos_bt_uart: &uart7 {
        ts_rst_conn: ts-rst-conn {
                pins = "gpio54";
                function = "gpio";
-               bias-pull-up;
                drive-strength = <2>;
        };
 };
index e66fc67de206a8aff303a4c0fd110af481d6434d..13d7f267b2891a2c916e147aba99863f7b04cca2 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";
                        assigned-clock-rates = <19200000>, <200000000>;
 
                        interrupts-extended = <&intc GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
-                                    <&pdc 13 IRQ_TYPE_EDGE_RISING>,
-                                    <&pdc 12 IRQ_TYPE_EDGE_RISING>;
+                                             <&pdc 12 IRQ_TYPE_EDGE_RISING>,
+                                             <&pdc 13 IRQ_TYPE_EDGE_RISING>;
                        interrupt-names = "hs_phy_irq",
-                                         "dm_hs_phy_irq", "dp_hs_phy_irq";
+                                         "dp_hs_phy_irq",
+                                         "dm_hs_phy_irq";
 
                        power-domains = <&gcc GCC_USB30_SEC_GDSC>;
 
                        assigned-clock-rates = <19200000>, <200000000>;
 
                        interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-                                             <&pdc 17 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 14 IRQ_TYPE_LEVEL_HIGH>,
                                              <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
-                                             <&pdc 14 IRQ_TYPE_LEVEL_HIGH>;
+                                             <&pdc 17 IRQ_TYPE_EDGE_BOTH>;
                        interrupt-names = "hs_phy_irq",
-                                         "ss_phy_irq",
+                                         "dp_hs_phy_irq",
                                          "dm_hs_phy_irq",
-                                         "dp_hs_phy_irq";
+                                         "ss_phy_irq";
 
                        power-domains = <&gcc GCC_USB30_PRIM_GDSC>;
 
                                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>;
                                interrupt-parent = <&mdss>;
                                interrupts = <14>;
 
-                               clocks = <&rpmhcc RPMH_CXO_CLK>,
-                                        <&gcc GCC_EDP_CLKREF_EN>,
-                                        <&dispcc DISP_CC_MDSS_AHB_CLK>,
+                               clocks = <&dispcc DISP_CC_MDSS_AHB_CLK>,
                                         <&dispcc DISP_CC_MDSS_EDP_AUX_CLK>,
                                         <&dispcc DISP_CC_MDSS_EDP_LINK_CLK>,
                                         <&dispcc DISP_CC_MDSS_EDP_LINK_INTF_CLK>,
                                         <&dispcc DISP_CC_MDSS_EDP_PIXEL_CLK>;
-                               clock-names = "core_xo",
-                                             "core_ref",
-                                             "core_iface",
+                               clock-names = "core_iface",
                                              "core_aux",
                                              "ctrl_link",
                                              "ctrl_link_iface",
                                              "stream_pixel";
-                               #clock-cells = <1>;
                                assigned-clocks = <&dispcc DISP_CC_MDSS_EDP_LINK_CLK_SRC>,
                                                  <&dispcc DISP_CC_MDSS_EDP_PIXEL_CLK_SRC>;
                                assigned-clock-parents = <&mdss_edp_phy 0>, <&mdss_edp_phy 1>;
                                operating-points-v2 = <&edp_opp_table>;
                                power-domains = <&rpmhpd SC7280_CX>;
 
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-
                                status = "disabled";
 
                                ports {
                        mdss_dp: displayport-controller@ae90000 {
                                compatible = "qcom,sc7280-dp";
 
-                               reg = <0 0x0ae90000 0 0x1400>;
+                               reg = <0 0xae90000 0 0x200>,
+                                     <0 0xae90200 0 0x200>,
+                                     <0 0xae90400 0 0xc00>,
+                                     <0 0xae91000 0 0x400>,
+                                     <0 0xae91400 0 0x400>;
 
                                interrupt-parent = <&mdss>;
                                interrupts = <12>;
                                         <&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",
                                                "stream_pixel";
-                               #clock-cells = <1>;
                                assigned-clocks = <&dispcc DISP_CC_MDSS_DP_LINK_CLK_SRC>,
                                                  <&dispcc DISP_CC_MDSS_DP_PIXEL_CLK_SRC>;
                                assigned-clock-parents = <&dp_phy 0>, <&dp_phy 1>;
                };
 
                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..49ea8b5
--- /dev/null
@@ -0,0 +1,2147 @@
+// 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-300000000 {
+                       opp-hz = /bits/ 64 <300000000>;
+               };
+               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 7 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_CFG_NOC_USB3_PRIM_AXI_CLK>,
+                                <&gcc GCC_USB30_PRIM_MASTER_CLK>,
+                                <&gcc GCC_AGGRE_USB3_PRIM_AXI_CLK>,
+                                <&gcc GCC_USB30_PRIM_SLEEP_CLK>,
+                                <&gcc GCC_USB30_PRIM_MOCK_UTMI_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 = "cfg_noc", "core", "iface", "sleep", "mock_utmi",
+                                     "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 = "pwr_event",
+                                         "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_CFG_NOC_USB3_SEC_AXI_CLK>,
+                                <&gcc GCC_USB30_SEC_MASTER_CLK>,
+                                <&gcc GCC_AGGRE_USB3_SEC_AXI_CLK>,
+                                <&gcc GCC_USB30_SEC_SLEEP_CLK>,
+                                <&gcc GCC_USB30_SEC_MOCK_UTMI_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 = "cfg_noc", "core", "iface", "sleep", "mock_utmi",
+                                     "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 811 IRQ_TYPE_LEVEL_HIGH>,
+                                             <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 13 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 136 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "pwr_event",
+                                         "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 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 696 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>;
+                       ranges = <0x0 0x0 0x0 0x20000000>;
+
+                       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 42af1fade461bdfacf153f3cde88f6bab4b3be7d..09c07800793a058302f248e2f9fc3fc08afc2aef 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 b72e8e6c52f355d1bd0539a2f32ab6dea9c66f74..1bc9091cad2a8a1acbdf5a000093056358c4cfdd 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 8b815b2a60a7b0da6c94707795772ef1595dcdd6..891e314bc782b237afb48279afe5c4ccfc0d772f 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 b96da53f2f1ee23247ff7d1c0c52cf6e011de93a..58f687fc49e04da11f799f9fd4c1ea0249b15fba 100644 (file)
@@ -19,7 +19,7 @@
 };
 
 &sdc2_state_on {
-       pinconf-clk {
+       clk {
                drive-strength = <14>;
        };
 };
index dcbaacf18f66d17c0acaa5090d5a4d353b9aa1e9..a3559f6e34a5e70db290961edf7ab55425bfbe0a 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 1d748c5305f4d2ff595ef17cd1e5fdeac9e4bdb4..43220af1b685e1ad28973d7726a5a2ec521523d2 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 e7e4cc5936aab96b3c8b28a22f73c7013c48194f..b5eb8f7eca1d5f8d48442fc1afe17b617d0795ee 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 194ebeb3259cb9c7a1f14856ae12ccc715280959..c6e2c571b45270600d61190b6e842da410f74edd 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";
        status = "okay";
 };
 
+&gpi_dma1 {
+       status = "okay";
+};
+
 &gpu {
        status = "okay";
        zap-shader {
 
 &i2c11 {
        /* On Low speed expansion */
+       clock-frequency = <100000>;
        label = "LS-I2C1";
        status = "okay";
 };
 
 &i2c14 {
        /* On Low speed expansion */
+       clock-frequency = <100000>;
        label = "LS-I2C0";
        status = "okay";
 };
                "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 07b729f9fec5e68958b99c00034eaec9f8e30549..392461c29e76ea724b113584536c79e28d53f550 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 103cc40816fd3779027c334deb854f1dcd39cf88..83261c9bb4f235fbd0657bc457306636ab2cd846 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 8a0d94e7f59856a1a7bd48b2c44a958812874b2d..2f5e12deaadab1e3f02b0e79765c950e547cbff2 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 281fe6dea62a90c4c4dce2f6b48a87dc43e086d3..51ee42e3c995c2caff291141cb9b2469d6d6ca3b 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 d88dc07205f7b3a73395bddb1f2dab2bac2247ae..82c27f90d300d26715d6ac67f5ba018238ceffd7 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>;
                };
        };
 
diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
new file mode 100644 (file)
index 0000000..7747081
--- /dev/null
@@ -0,0 +1,762 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2020, Xilin Wu <strongtz@yeah.net>
+ * Copyright (c) 2022, Molly Sophia <mollysophia379@gmail.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
+#include "sdm845.dtsi"
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
+#include "pm8005.dtsi"
+
+/*
+ * Delete following upstream (sdm845.dtsi) reserved
+ * memory mappings which are different in this device.
+ */
+/delete-node/ &rmtfs_mem;
+/delete-node/ &adsp_mem;
+/delete-node/ &wlan_msa_mem;
+/delete-node/ &mpss_region;
+/delete-node/ &venus_mem;
+/delete-node/ &cdsp_mem;
+/delete-node/ &mba_region;
+/delete-node/ &slpi_mem;
+/delete-node/ &spss_mem;
+
+/ {
+       model = "Xiaomi Mi MIX 2S";
+       compatible = "xiaomi,polaris", "qcom,sdm845";
+       chassis-type = "handset";
+
+       /* required for bootloader to select correct board */
+       qcom,msm-id = <0x141 0x20001>;
+       qcom,board-id = <0x2a 0x0>;
+
+       aliases {
+               serial0 = &uart9;
+               serial1 = &uart6;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+               autorepeat;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&volume_up_gpio>;
+
+               key-vol-up {
+                       label = "Volume Up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <15>;
+               };
+       };
+
+       reserved-memory {
+               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 0x7800000>;
+                       no-map;
+               };
+
+               venus_mem: memory@95c00000 {
+                       reg = <0 0x95c00000 0 0x500000>;
+                       no-map;
+               };
+
+               cdsp_mem: memory@96100000 {
+                       reg = <0 0x96100000 0 0x800000>;
+                       no-map;
+               };
+
+               mba_region: memory@96900000 {
+                       reg = <0 0x96900000 0 0x200000>;
+                       no-map;
+               };
+
+               slpi_mem: memory@96b00000 {
+                       reg = <0 0x96b00000 0 0x1400000>;
+                       no-map;
+               };
+
+               spss_mem: memory@97f00000 {
+                       reg = <0 0x97f00000 0 0x100000>;
+                       no-map;
+               };
+
+               rmtfs_mem: memory@f6301000 {
+                       compatible = "qcom,rmtfs-mem";
+                       reg = <0 0xf6301000 0 0x200000>;
+                       no-map;
+
+                       qcom,client-id = <1>;
+                       qcom,vmid = <15>;
+               };
+       };
+
+       battery: battery {
+               compatible = "simple-battery";
+
+               charge-full-design-microamp-hours = <3400000>;
+               voltage-min-design-microvolt = <3400000>;
+               voltage-max-design-microvolt = <4400000>;
+       };
+
+       vreg_tp_vddio: vreg-tp-vddio {
+               compatible = "regulator-fixed";
+               regulator-name = "vreg_tp_vddio";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               gpio = <&tlmm 23 0>;
+               regulator-always-on;
+               regulator-boot-on;
+               enable-active-high;
+       };
+
+       vreg_s4a_1p8: vreg-s4a-1p8 {
+               compatible = "regulator-fixed";
+               regulator-name = "vreg_s4a_1p8";
+
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-always-on;
+       };
+};
+
+&apps_rsc {
+       pm8998-rpmh-regulators {
+               compatible = "qcom,pm8998-rpmh-regulators";
+               qcom,pmic-id = "a";
+
+               vreg_s2a_1p1: 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>;
+               };
+
+               vdda_mipi_dsi0_pll:
+               vdda_ufs1_core:
+               vreg_l1a_0p875: ldo1 {
+                       regulator-min-microvolt = <880000>;
+                       regulator-max-microvolt = <880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               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>;
+               };
+
+               vreg_l5a_0p8: ldo5 {
+                       regulator-min-microvolt = <800000>;
+                       regulator-max-microvolt = <800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               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_2p95: ldo10 {
+                       regulator-min-microvolt = <1704000>;
+                       regulator-max-microvolt = <2928000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l11a_1p05: ldo11 {
+                       regulator-min-microvolt = <1000000>;
+                       regulator-max-microvolt = <1048000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l12a_1p8: ldo12 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l13a_2p95: ldo13 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l14a_1p8: ldo14 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1880000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-always-on;
+               };
+
+               vreg_l15a_1p8: ldo15 {
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l16a_2p7: ldo16 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2704000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l17a_1p3: ldo17 {
+                       regulator-min-microvolt = <1304000>;
+                       regulator-max-microvolt = <1304000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-always-on;
+               };
+
+               vreg_l18a_2p9: ldo18 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l19a_3p1: ldo19 {
+                       regulator-min-microvolt = <2856000>;
+                       regulator-max-microvolt = <3104000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l20a_2p95: ldo20 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l21a_2p95: ldo21 {
+                       regulator-min-microvolt = <2704000>;
+                       regulator-max-microvolt = <2960000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l22a_3p3: ldo22 {
+                       regulator-min-microvolt = <2864000>;
+                       regulator-max-microvolt = <3312000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l23a_3p3: ldo23 {
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3312000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               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>;
+                       regulator-always-on;
+               };
+
+               vdda_mipi_dsi0_1p2:
+               vdda_ufs1_1p2:
+               vreg_l26a_1p2: ldo26 {
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+               };
+
+               vreg_l28a_3p0: ldo28 {
+                       regulator-min-microvolt = <2856000>;
+                       regulator-max-microvolt = <3008000>;
+                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+                       regulator-always-on;
+               };
+
+               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";
+
+               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";
+
+               vreg_smp3c_0p6: smps3 {
+                       regulator-min-microvolt = <600000>;
+                       regulator-max-microvolt = <600000>;
+                       regulator-always-on;
+               };
+       };
+};
+
+&cdsp_pas {
+       firmware-name = "qcom/sdm845/polaris/cdsp.mbn";
+       status = "okay";
+};
+
+&dsi0 {
+       vdda-supply = <&vdda_mipi_dsi0_1p2>;
+       status = "okay";
+
+       display_panel: panel@0 {
+               compatible = "jdi,fhd-nt35596s";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0>;
+
+               reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
+               vddio-supply = <&vreg_l14a_1p8>;
+               backlight = <&pmi8998_wled>;
+               vddpos-supply = <&lab>;
+               vddneg-supply = <&ibb>;
+
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&sde_dsi_active>;
+               pinctrl-1 = <&sde_dsi_suspend>;
+
+               port {
+                       panel_in: endpoint {
+                               remote-endpoint = <&dsi0_out>;
+                       };
+               };
+       };
+};
+
+&dsi0_out {
+       remote-endpoint = <&panel_in>;
+       data-lanes = <0 1 2 3>;
+};
+
+&dsi0_phy {
+       vdds-supply = <&vdda_mipi_dsi0_pll>;
+       status = "okay";
+};
+
+&gcc {
+       protected-clocks = <GCC_QSPI_CORE_CLK>,
+                               <GCC_QSPI_CORE_CLK_SRC>,
+                               <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
+                               <GCC_LPASS_Q6_AXI_CLK>,
+                               <GCC_LPASS_SWAY_CLK>;
+};
+
+&gmu {
+       status = "okay";
+};
+
+&gpi_dma0 {
+       status = "okay";
+};
+
+&gpi_dma1 {
+       status = "okay";
+};
+
+&gpu {
+       status = "okay";
+
+       zap-shader {
+               memory-region = <&gpu_mem>;
+               firmware-name = "qcom/sdm845/polaris/a630_zap.mbn";
+       };
+};
+
+&ibb {
+       regulator-min-microvolt = <4600000>;
+       regulator-max-microvolt = <6000000>;
+       regulator-over-current-protection;
+       regulator-pull-down;
+       regulator-soft-start;
+       qcom,discharge-resistor-kohms = <300>;
+};
+
+&ipa {
+       memory-region = <&ipa_fw_mem>;
+       firmware-name = "qcom/sdm845/polaris/ipa_fws.mbn";
+       status = "okay";
+};
+
+&i2c14 {
+       clock-frequency = <400000>;
+       dmas = <&gpi_dma1 0 6 QCOM_GPI_I2C>,
+                  <&gpi_dma1 1 6 QCOM_GPI_I2C>;
+       dma-names = "tx", "rx";
+       status = "okay";
+
+       touchscreen@20 {
+               compatible = "syna,rmi4-i2c";
+               reg = <0x20>;
+               #address-cells = <1>;
+               #size-cells = <0>;
+               interrupts-extended = <&tlmm 125 0x2008>;
+
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&ts_int_default &ts_reset_default>;
+               pinctrl-1 = <&ts_int_sleep &ts_reset_sleep>;
+
+               vdd-supply = <&vreg_l28a_3p0>;
+               vio-supply = <&vreg_tp_vddio>;
+
+               syna,startup-delay-ms = <0xc8>;
+               syna,reset-delay-ms = <0xc8>;
+
+               rmi4-f01@1 {
+                       syna,nosleep-mode = <0x1>;
+                       reg = <0x1>;
+               };
+
+               rmi4-f12@12 {
+                       syna,rezero-wait-ms = <0xc8>;
+                       syna,clip-x-high = <0x438>;
+                       syna,clip-y-high = <0x870>;
+                       syna,sensor-type = <0x1>;
+                       syna,clip-x-low = <0x0>;
+                       syna,clip-y-low = <0x0>;
+               };
+       };
+};
+
+&lab {
+       regulator-min-microvolt = <4600000>;
+       regulator-max-microvolt = <6000000>;
+       regulator-soft-start;
+       regulator-pull-down;
+};
+
+&mdss {
+       status = "okay";
+};
+
+&mss_pil {
+       firmware-name = "qcom/sdm845/polaris/mba.mbn", "qcom/sdm845/polaris/modem.mbn";
+       status = "okay";
+};
+
+&pmi8998_wled {
+       qcom,current-limit-microamp = <20000>;
+       qcom,current-boost-limit = <970>;
+       qcom,ovp-millivolt = <19600>;
+       qcom,switching-freq = <600>;
+       qcom,num-strings = <4>;
+       qcom,cabc;
+
+       status = "okay";
+};
+
+&pm8998_gpio {
+       volume_up_gpio: pm8998_gpio6 {
+               pinconf {
+                       qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+                       function = "normal";
+                       pins = "gpio6";
+                       input-enable;
+                       bias-pull-up;
+               };
+       };
+};
+
+&pm8998_pon {
+       resin {
+               interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+               compatible = "qcom,pm8941-resin";
+               linux,code = <KEY_VOLUMEDOWN>;
+               debounce = <15625>;
+               bias-pull-up;
+       };
+};
+
+&q6afedai {
+       qi2s@22 {
+               reg = <22>;
+               qcom,sd-lines = <0>;
+       };
+};
+
+&q6asmdai {
+       dai@0 {
+               reg = <0>;
+       };
+
+       dai@1 {
+               reg = <1>;
+       };
+
+       dai@2 {
+               reg = <2>;
+       };
+};
+
+&qupv3_id_0 {
+       status = "okay";
+};
+
+&qupv3_id_1 {
+       status = "okay";
+};
+
+&qup_i2c14_default {
+       pinconf {
+               pins = "gpio33", "gpio34";
+               drive-strength = <2>;
+               bias-disable;
+       };
+};
+
+&tlmm {
+       gpio-reserved-ranges = <0 4>, <81 4>;
+
+       ts_reset_default: ts-reset-default {
+               pins = "gpio99";
+               function = "gpio";
+               drive-strength = <16>;
+               output-high;
+       };
+
+       ts_int_default: ts-int-default {
+               pins = "gpio125";
+               function = "gpio";
+               bias-pull-down;
+               drive-strength = <16>;
+               input-enable;
+       };
+
+       ts_reset_sleep: ts-reset-sleep {
+               pins = "gpio99";
+               function = "gpio";
+               bias-disable;
+               drive-strength = <2>;
+       };
+
+       ts_int_sleep: ts-int-sleep {
+               pins = "gpio125";
+               function = "gpio";
+               bias-pull-down;
+               drive-strength = <2>;
+               input-enable;
+       };
+
+       sde_dsi_active: sde-dsi-active {
+               pins = "gpio6", "gpio10";
+               function = "gpio";
+               drive-strength = <8>;
+               bias-disable = <0>;
+       };
+
+       sde_dsi_suspend: sde-dsi-suspend {
+               pins = "gpio6", "gpio10";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-pull-down;
+       };
+
+       wcd_intr_default: wcd-intr-default {
+               pins = "goui54";
+               function = "gpio";
+               input-enable;
+               bias-pull-down;
+               drive-strength = <2>;
+       };
+};
+
+&uart6 {
+       status = "okay";
+
+       bluetooth {
+               compatible = "qcom,wcn3990-bt";
+
+               /* This path is relative to the qca/ subdir under lib/firmware. */
+               firmware-name = "polaris/crnv21.bin";
+
+               vddio-supply = <&vreg_s4a_1p8>;
+               vddxo-supply = <&vreg_l7a_1p8>;
+               vddrf-supply = <&vreg_l17a_1p3>;
+               vddch0-supply = <&vreg_l25a_3p3>;
+               max-speed = <3200000>;
+       };
+};
+
+&usb_1 {
+       /* We'll use this as USB 2.0 only */
+       qcom,select-utmi-as-pipe-clk;
+       status = "okay";
+};
+
+&usb_1_dwc3 {
+       dr_mode = "peripheral";
+
+       /* Fastest mode for USB 2 */
+       maximum-speed = "high-speed";
+
+       /* Remove USB3 phy */
+       phys = <&usb_1_hsphy>;
+       phy-names = "usb2-phy";
+};
+
+&usb_1_hsphy {
+       vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
+       vdda-pll-supply = <&vreg_l12a_1p8>;
+       vdd-supply = <&vreg_l1a_0p875>;
+
+       qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
+       qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
+       qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
+       qcom,imp-res-offset-value = <8>;
+
+       status = "okay";
+};
+
+&usb_1_qmpphy {
+       vdda-pll-supply = <&vreg_l1a_0p875>;
+       vdda-phy-supply = <&vreg_l26a_1p2>;
+       status = "okay";
+};
+
+&ufs_mem_hc {
+       reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
+       vcc-supply = <&vreg_l20a_2p95>;
+       vcc-max-microamp = <800000>;
+       status = "okay";
+};
+
+&ufs_mem_phy {
+       vdda-phy-supply = <&vdda_ufs1_core>;
+       vdda-pll-supply = <&vdda_ufs1_1p2>;
+       status = "okay";
+};
+
+&venus {
+       firmware-name = "qcom/sdm845/polaris/venus.mbn";
+       status = "okay";
+};
+
+&wcd9340 {
+       pinctrl-0 = <&wcd_intr_default>;
+       pinctrl-names = "default";
+       clock-names = "extclk";
+       clocks = <&rpmhcc RPMH_LN_BB_CLK2>;
+       reset-gpios = <&tlmm 64 0>;
+       vdd-buck-sido-supply = <&vreg_s4a_1p8>;
+       vdd-buck-supply = <&vreg_s4a_1p8>;
+       vdd-tx-supply = <&vreg_s4a_1p8>;
+       vdd-rx-supply = <&vreg_s4a_1p8>;
+       vdd-io-supply = <&vreg_s4a_1p8>;
+
+       qcom,micbias1-microvolt = <2700000>;
+       qcom,micbias2-microvolt = <1800000>;
+       qcom,micbias3-microvolt = <2700000>;
+       qcom,micbias4-microvolt = <2700000>;
+};
+
+&wifi {
+       vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
+       vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
+       vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
+       vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
+       vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
+
+       qcom,snoc-host-cap-skip-quirk;
+       status = "okay";
+};
+
+/* PINCTRL - additions to nodes defined in sdm845.dtsi */
+
+&qup_uart6_default {
+       pinmux {
+                pins = "gpio45", "gpio46", "gpio47", "gpio48";
+                function = "qup6";
+       };
+
+       cts {
+               pins = "gpio45";
+               bias-disable;
+       };
+
+       rts-tx {
+               pins = "gpio46", "gpio47";
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       rx {
+               pins = "gpio48";
+               bias-pull-up;
+       };
+};
index 038538c8c6141686dcb0d6d8dda20afa7ffe052b..f0e286715d1bdbe643510b4b8dbc0b0da1dad0dd 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 {
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 0 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 0 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 1 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 1 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 1 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 1 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 2 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 2 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 2 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 2 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 3 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 3 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 3 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 3 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 4 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 4 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 4 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 4 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 5 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 5 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 5 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 5 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&aggre1_noc MASTER_QUP_1 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma0 0 6 QCOM_GPI_I2C>,
+                                      <&gpi_dma0 1 6 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 6 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 6 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre1_noc MASTER_QUP_1 0 &config_noc SLAVE_BLSP_1 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_1 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma0 0 7 QCOM_GPI_SPI>,
+                                      <&gpi_dma0 1 7 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 0 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 0 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 0 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 0 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 1 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 1 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 1 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 1 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 2 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 2 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 2 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 2 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 3 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 3 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 3 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 3 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 4 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 4 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 4 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 4 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 5 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 5 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 5 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 5 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 6 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 6 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 6 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 6 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&aggre2_noc MASTER_QUP_2 0 &mem_noc SLAVE_EBI1 0>;
                                interconnect-names = "qup-core", "qup-config", "qup-memory";
+                               dmas = <&gpi_dma1 0 7 QCOM_GPI_I2C>,
+                                      <&gpi_dma1 1 7 QCOM_GPI_I2C>;
+                               dma-names = "tx", "rx";
                        };
 
                        spi15: spi@a9c000 {
                                interconnects = <&aggre2_noc MASTER_QUP_2 0 &config_noc SLAVE_BLSP_2 0>,
                                                <&gladiator_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_BLSP_2 0>;
                                interconnect-names = "qup-core", "qup-config";
+                               dmas = <&gpi_dma1 0 7 QCOM_GPI_SPI>,
+                                      <&gpi_dma1 1 7 QCOM_GPI_SPI>;
+                               dma-names = "tx", "rx";
                                status = "disabled";
                        };
 
                        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 {
                                 <&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>;
                        #size-cells = <2>;
                        ranges;
 
-                       mdss_mdp: mdp@ae01000 {
+                       mdss_mdp: display-controller@ae01000 {
                                compatible = "qcom,sdm845-dpu";
                                reg = <0 0x0ae01000 0 0x8f000>,
                                      <0 0x0aeb0000 0 0x2008>;
                                         <&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 f1619b3f97ef80d059ced01196aadbec5809a3a6..a7af1bed431296e2c091d68ce49099b459a8f1ed 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 2a552d817b03dbe2f8a3fcf36a51bd6dd909187f..b0315eeb132054c3fd352742c9e6b5ecc9ceb7ae 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 b1c2cf566c7a43453e2060895293d6d9bcf1b394..da9f6fbe32f6cda5f85d9bc36767c5f195764e7d 100644 (file)
@@ -16,6 +16,5 @@
        cpu4_opp34: opp-2956800000 {
                opp-hz = /bits/ 64 <2956800000>;
                opp-peak-kBps = <7216000 25497600>;
-               turbo-mode;
        };
 };
index 871ccbba445bbec599febd91eaad76dcc6a79dbb..0aad2e94e757518df7dead5a0e491b1d67698161 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 135e6e0da27ac7e9360d0dd251fc0f716ae2a73b..8c582a9e4ada4f0bef8f066fa71d4129ff1c3b84 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 d4f8f33f3f0caa857a6e3a63bdbb0ba55b5178c7..d06aefdf3d9edff5063d4f8ac0921a7866a79317 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>,
                        clock-names = "iface", "core", "xo";
                        qcom,dll-config = <0x000f642c>;
                        qcom,ddr-config = <0x80040868>;
-                       power-domains = <&rpmhpd 0>;
+                       power-domains = <&rpmhpd SM6350_CX>;
                        operating-points-v2 = <&sdhc1_opp_table>;
                        bus-width = <8>;
                        non-removable;
 
                        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>;
 
                        clock-names = "iface", "core", "xo";
                        qcom,dll-config = <0x0007642c>;
                        qcom,ddr-config = <0x80040868>;
-                       power-domains = <&rpmhpd 0>;
+                       power-domains = <&rpmhpd SM6350_CX>;
                        operating-points-v2 = <&sdhc2_opp_table>;
                        bus-width = <4>;
 
                        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 61925216f5e3bcf4c849fbb5a19c3851e5f3b09c..c76abe7587b4f9f340c3be9f8bb40058a023ff20 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 37ddca0f02234335a9f273de09b92cf737b0ad78..3331ee957d64890917552982ea534c590384d9ad 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 a73317e1a824e7b634d37e724399873ea7af1225..bb278ecac3faff79dac95d818d4de76f3d35ced3 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 8ea44c4b56b42298dd85e2b3d68a6beda8cbb950..7d509ecd44dabcdcbe032c7d6fb95bd11a69934b 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 3b082472062b96e7c5fb573878059ad12ebc2e31..632e98193d27caa46fb9b21adc23e583ceb9bcd1 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 e819b5b773637e2aaccb53120418cd45fd576ea6..549e0a2aa9fe4ff29d9a56d6dfeff183b53a5e77 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 cf0c97bd5ad3e763e7d14e6fb99c99f8b451c0c5..bc773e210023cba0ea1ce5f4aa426de1de60eec6 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 {
                        assigned-clock-rates = <19200000>, <200000000>;
 
                        interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-                                             <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
                                              <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
-                                             <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
-                       interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-                                         "dm_hs_phy_irq", "ss_phy_irq";
+                                             <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "hs_phy_irq",
+                                         "ss_phy_irq",
+                                         "dm_hs_phy_irq",
+                                         "dp_hs_phy_irq";
 
                        power-domains = <&gcc USB30_PRIM_GDSC>;
 
                        assigned-clock-rates = <19200000>, <200000000>;
 
                        interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
-                                             <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 16 IRQ_TYPE_LEVEL_HIGH>,
                                              <&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";
+                                             <&pdc 12 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "hs_phy_irq",
+                                         "ss_phy_irq",
+                                         "dm_hs_phy_irq",
+                                         "dp_hs_phy_irq";
 
                        power-domains = <&gcc USB30_SEC_GDSC>;
 
                                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>;
                        #size-cells = <2>;
                        ranges;
 
-                       mdss_mdp: mdp@ae01000 {
+                       mdss_mdp: display-controller@ae01000 {
                                compatible = "qcom,sm8250-dpu";
                                reg = <0 0x0ae01000 0 0x8f000>,
                                      <0 0x0aeb0000 0 0x2008>;
                                         <&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 9a6faa9393dce5a5530086fa2fd7c465eac80ab2..9c4cfd995ff298683aac72345bbde81fbf04008a 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 90b13cbe2fa631e1a210b529e1c47b4d39b44b92..cb9bbd234b7bc1ee928cd8ef1ff18c35b6406cec 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 743cba9b683cdc6cf433c3cff5d900e4b3563817..e72a04411888cb011eb18ac6374275e65fdcfbe3 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";
                        assigned-clock-rates = <19200000>, <200000000>;
 
                        interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-                                             <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
                                              <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
-                                             <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
-                       interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-                                         "dm_hs_phy_irq", "ss_phy_irq";
+                                             <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "hs_phy_irq",
+                                         "ss_phy_irq",
+                                         "dm_hs_phy_irq",
+                                         "dp_hs_phy_irq";
 
                        power-domains = <&gcc USB30_PRIM_GDSC>;
 
                        assigned-clock-rates = <19200000>, <200000000>;
 
                        interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
-                                             <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+                                             <&pdc 16 IRQ_TYPE_LEVEL_HIGH>,
                                              <&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";
+                                             <&pdc 12 IRQ_TYPE_EDGE_BOTH>;
+                       interrupt-names = "hs_phy_irq",
+                                         "ss_phy_irq",
+                                         "dm_hs_phy_irq",
+                                         "dp_hs_phy_irq";
 
                        power-domains = <&gcc USB30_SEC_GDSC>;
 
                        };
                };
 
+               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 4e51a9d6af985bd4eec432ecb38dae0097ca630d..38ccd44620d02c3269393d6956fc2d1610ca7c91 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 236e53974fdd286a7478a7bc2f0e05148253c0c1..e58fc73997997824676705ba8629bcf94fb1aa80 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 b87756bf1ce4481a6440182df05d362892bc7988..4978c5ba5dd0858025f262880d92587e5ad97cb7 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 {
 
                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";
                        };
                };
                                      <0 0x01d87800 0 0x108>,
                                      <0 0x01d87a00 0 0x1e0>;
                                #phy-cells = <0>;
-                               #clock-cells = <0>;
                        };
                };
 
index e66d76d42e52559a4f078e250b56ab0e979a8c15..7a647860ef355582001b054c890e292c23fc1919 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 142e7ffbd2bd42817abe6eb0942149c2a54de059..63e7a39e100e367c87d0102214b35678a17b8557 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 877d076ffcc9bf92cd0937a092184c4aeca6250b..f5c1d74b738b9344dc620ed10233c4798cbfe288 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 7231f820d601137ec66a592f4b2d36b6d27d1b27..ef3bb835d5c0512758fc46fd51e83755ab7a9403 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 72f359efa23e78d86269e71e7799a524e66db581..8fc03491a11c431ef7ae6ace91ad080f9f006a4d 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 935d06515aa6130bc191acaaee8a23c884028a1b..b062f41ee270124b9927a4e54392ee4395d58b47 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 b6aeb22e883645879529207fd29c81a59e571266..c563d26a7a71cc3347951fd28a1a04b1ead9c9d3 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 d3302120263762f111d473e5541b67510097a0b5..565e9d85946e6f7ff9b3da4db27c2163df8e9268 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 b9731504b7cd5e7fa159fcf55548b141736e8fdf..3d668709d8a8d09f5bae98d23007809e05444d86 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 41aa8591b3b1b548429a88b20ed112a654e9bc1e..28fbf7bc1eb4df20f0d625ec3e197f10face202b 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 2e3b719cc749492d4acb7beebcb2f77028d04dc6..7a7c8ffba7118a1f61bae97d6d5290ef0ae7602b 100644 (file)
@@ -15,6 +15,7 @@
 
        aliases {
                serial0 = &scif3;
+               serial1 = &scif0;
        };
 
        chosen {
index df46fb87cffc5553de14f1f7efa7fe7eae688be3..384817ffa4deb73c8f88e95ca474d7462845a7bc 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 752440b0c40f7c2250325b6585cedd4089b1f591..750bd8ccdb7f19470c28d24c4b547160f8b050db 100644 (file)
@@ -10,3 +10,8 @@
 / {
        compatible = "renesas,r8a779m8", "renesas,r8a7795";
 };
+
+&cluster0_opp {
+       /delete-node/ opp-1600000000;
+       /delete-node/ opp-1700000000;
+};
index b31fb713ae4d7fd8f3ee99274f5e85e9228a685e..40201a16d653c4bb02158d1ac7c2ca55a694500f 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 2d740bd420ca95faf478f2154a0f00db1fbb8b8f..121e55282d1818572a79a1672338ba83d0f6ec29 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 4e07e1a0fb668754e0c25dab65bb6e041a124d85..3d01a4cf0fbe74efa9ae37b09a42cc6151bbfa94 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 c207d8ce5523408f6bea983ce02652b1e04e6242..c3a52fa0b16ecbfc8e892845d6afb284ffe9cead 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 27810f4ad4cb4fc5db979caa3199e989e9b54e0e..d4cc5459fbb76d62149f19e70836fcbe39bf8ba6 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 aeacd22e9eb019a360a6adefb9c0b3eda581d5e2..9410796c8ad6b72de1d159bd2a48223399f3ab5f 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 959a0ad1d3671063e7c85b3083195f3592742735..78e6e2376b015ab8f097f5168994b16ddf8399c1 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 aa170492dd2b428caba04aa060e91660d6d8c601..6be25a8a28db7b803d121c1843112b0335143940 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 a663115f5aae616a99c0fd3326e46b6688f4131a..cf3b3d118ef170ceae53ef8e83b92fad2dfa980c 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 0051634d7b1c4fb5d1639a5ee80cc11e6401da85..f9835c12023e063ce2e455546423e3aebfda353e 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 31837fcd7bf0659bc0d436ad6c9919140c57c7e6..b7c7911858b2c742d192ba60473be39abf105ab8 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 5bcb84403ef6827d5193b85584e4e99f400fd211..408871c2859d144dc23904723b4317b2eea3695f 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 90a4c0629d240fdb2130b921b6fa50ea62023b8d..0772dfe4adffeebeb3cafe274b97748fbd47b2a0 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 18d00eae3072accb14b22b60c84d9bf7f0364827..ef79a672804a1ebceb26a6d01a02dcc9ada836c8 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 56dfbb2e2fa66440af6f57b608e8f19a3e6b7d8d..214f94fea3dca4db87e5a541579e723283c53481 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 9b4f855ea5d426927e9310a5d26ceca9ab947132..9fe9b0d11003a8681b8317c2166ba24e14f0fedf 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 ea0695b51ecd73652ec719a09c74fb868d1bd2b9..415aa9ff8bd482ad43e6530e733dba6575ec72f6 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 3857d487ab84cfcd7aadec403a259f8a266987eb..1445b879ac7abd8f6deec6c39d63900b67d8f6f0 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 15d1fc541c38e8a03c28dec0578061842947c42c..083452c6771197f1f9114ea49a7a14d0e5aeb59b 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 62aa97a0b8c9f3d1b094d54d9f24d387a7d4700f..be06e6e64d1831d7c49c5ee100f183f4c14d0d36 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 3ebe15e03cf4dea50ccd9bbefcabade5972065a2..7f5bba0c600146f09b0e1b6ded04ca16b9e84375 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 5ccaa5f7a370b57b6d3d3b9273509cfe0b73103c..29df84b81552ead53272573a34600fcc4b8e2b21 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 959d3cc801f2b16381892c5665bcb88db1d7fa90..38d757c00548823ac83e13c610e1d583ba431346 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 4f0b5feaa5e617d0d273dcda5f6e181a75fbbc94..a4c5aaf1f4579484acac1d406d0ea85b0777de50 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 7b717ebec8ffa0f5565035e23ec1f8c709a3b916..3d1e126b553f93f4a93f33289ee7b0221a082183 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 b340c9e246c442184d6028f97b92feaa1e5406d2..c5db64f3e12413c5fe0259735b37c321d3bac00b 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 50d459ee4831c1bffec209aaaa8796e6a6ec2848..cd074641884bfe51cd12293954eb83000e54d95d 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 6863689df06ffa3658df19ff95bffd088a762c97..2cc9b3386c16ff613a5343c8817a612ccbe14c92 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 1977103a5ef44c20074466a589ac037b4b691853..40d4053fba80dfe94c88537ed28a7d4491f2f3b1 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 46c4581deb8d50ddfca91c27518e1e329ffe157b..2a332763c35cd4130816a2dee9ae8976cda5d039 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 cef4d18b599dd10b161a33f9b3a15702534757b6..fe5b526100107ac029ea8a801438aaeed26d5588 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 248ad41a976b301f6385fb2b9e972b6a575f87bd..278123b4f911195f579ff657cfa537d54af6369f 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 ed856bfcfc33dd372c612cdcbc1a50bed7c6ad11..9e2e246e0bab7ced29257394bbcb41c2d009d924 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 d6b68d77d63a5f2d1ea77e6df8fb9f5f631c4ed8..194e48c755f6bc19d33f0736a0423d6205859450 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 3ae5d727e36745425288311d14073aefe1117f25..04c752f49be98dfb7db9662b3acbfd8e1a83eedd 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 0e45cc2d195b70ef1ba01696c8d445b189943375..acb174d3a8c5fffdaa216aa55bea68d1bda815b8 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 45e77f86d3294067dd47adbc955af280658198bb..78157521e94493c32b74c27b7694a734027ec37e 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 f6b2199a42bdac0c9e810affea66afa76a39ea92..13927e7d0724ebb7995ce75a8f8a685fcbd38c32 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 2aa0fad8f893f402b45ab82bb057e2fd6ed40005..e6ac292ce6458be4ee43dc1657fc2d2dff7c61b1 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 01d1a75c8b4d3b7b042816bfd386b0a0edd8a613..935b8c68a71d6c60db9c8d8b9070809c852d8b27 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 e01668e6e5f90472692c4a6626d7d52a68e8e5d0..0d45868132b9d7e0da91405f0d346cc8514bc13a 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 fa953b73664218328882b8dd7c559a9afea2f935..d943559b157cec08d62dbc2cc4748f033131e5a6 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 0b957068ff8991c6003da13fbd09bc63bb705e6f..6c4b17d27bdc526ffacc1d991a09f3982434e9f3 100644 (file)
@@ -29,3 +29,7 @@
        extcon = <&usb2phy0>;
        maximum-speed = "high-speed";
 };
+
+&vop {
+       compatible = "rockchip,rk3566-vop";
+};
index 40cf2236c0b610f19df7c7c635b3321cdc11d88e..1d3ffbf3cde89faa2c20b59fcff88cee500a6383 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 622be8be9813d9a774ed003d98dcd27159a7e72e..6ff89ff95ad1c9ff00ca3855af6e7be3fc8e8bd9 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 0813c0c5abdedd5826ea2ee9f501ba05f749487f..6b5093a1a6cf5ca242309eb635b7adac49a4185e 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 5eafddf62edc786d82697abc213d0943a67336e6..2bdf8c7e9765b54e8dd294696cc39d91bfd677f2 100644 (file)
        phys = <&usb2phy0_otg>, <&combphy0 PHY_TYPE_USB3>;
        phy-names = "usb2-phy", "usb3-phy";
 };
+
+&vop {
+       compatible = "rockchip,rk3568-vop";
+};
index 914f13c0d399ad946ef49bc646ae47690c976e7e..319981c3e9f72a12c73a4784c122a24afe1b5263 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 231436be0e3f6895c57f398350729682affafd6e..8bb8a70966d2096a85bbb35d10c28bd7bf090d07 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 8cf4a6575980894fa6a87b319e8b9bb82ed34e51..22d81ace740a0f4ed8159b059282e20dacbf70c1 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 89d91abbd5d1991e01e4740394cc277437240427..fece49704b5c505fb5f224db80c76afc8615a3ba 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 5af560c1b5e6ace174921107ad09d14fa99fa140..1db6ddf03f01ec8fa36755b345d7222a33b0cbce 100644 (file)
@@ -37,3 +37,7 @@
 &serial_0 {
        status = "okay";
 };
+
+&ufs {
+       status = "okay";
+};
index d4d0cb0057122a722b31e84c0bef3ca30b3a69a3..d0abb9aa0e9edc4e690cb58674f7a567f370896b 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 af39655331decccfd5646b9e745469cbdd83e135..f35bc5a288c291638ff8ed9ec45a9e66369dec52 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 d08abad0bcf4e58c36ff7cb5e46e39884c8f7234..12ab7548dc7721a560d64b097e126adf012304f5 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 39fb1d7630375a92d753ab53c51f74a3a0463c3e..9b4dbae9d4aadfdc7384c541b2ca81561dd8eef9 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 cdb530597c5ebf9dd6b7e795c375caeae0c1d517..ada00575f0f2e743236f3b7c94857b63adc12aa7 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>;
                      <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 8e7893e58b03ea0ceb8392b801107bf92266e962..ad150c704623581b2b7ef06cbd755e4ecf06f3c1 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 59f506cbd275feebedd2a0cbb7962616e1a54a6f..2620469a75179f22a9ddef9f72411ee89b49ff77 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 6e41f2fa044af9f3b4dcca0cecab14f60ef81307..32b7972375811e998362771c2525c70476c1ae45 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 e749343accedd41795eabf3a1e264d9061e26614..8919fede3cd76fc97f93a149eff7de777201ccb9 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 9c69d0917f69ac9c77d2230ce9a88c114e135138..fa11d7142006a72a8273a6c0e492ccf69bb8e33d 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 57497cb1ed68ecb399d02dd9bd3feaab280aec03..5850582dd4edfbd14270dacec4aa11e9eeafca2a 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 1044ec6c4b0d4b10819fd7c04a0224895d22ed7d..ff13bbeed30c91e657c9d935cdae8077ed18ef72 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 2bc26a2964964758d62977ec783eb59eb61ad725..b1691ac3442dc77a211d755625a49cc1ed0be1f3 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 b4972dfb7da815a0a800a01d581fa0ab8d75136d..df08724bbf1c51c35912532a9fe17e3a78841269 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 19966f72c5b387b3ad403fba90c79154812a3fd7..34e7d577ae13b3deb474844bd023414c8b975554 100644 (file)
                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 6c5c02edb375db328df02ce698b17f6874c0ecbf..4d1bfabd1313a560471436110998fc3927e4be88 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 8493dd7d5f1f8f756504be7de4508e28b5fe42c9..e172fa05c9a008cbc1d9ac3ec8074c9918595185 100644 (file)
        clocks = <&zynqmp_clk LPD_WDT>;
 };
 
+&xilinx_ams {
+       clocks = <&zynqmp_clk AMS_REF>;
+};
+
 &zynqmp_dpdma {
        clocks = <&zynqmp_clk DPDMA_REF>;
 };
index 550b389153e6d22d2b84adb8585600dd11374616..20e83ca47b5dba9e6ef9ddd761e396d8987a5a06 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 f6aad4159ccd3b6b30a30d6a07b390f525472325..d61a297a20907abb0a477607afe37faf7fb4915b 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 7b9a88b125d1b28c11554225f43fadf6005828a1..5fd6b70a154a9af74da89c584c1b40686c0b9aa2 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 20b7c75bb1d3d03e8e5e273b88c43953bc73d34e..e2dd72fe33ce810b371e819db40e76ac89f9948c 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 e36df6adbeeebc21359237add0f722d2c006bb80..d685d8fbc36a1a853d18b9ccb714fc0581d14f1c 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 c715a18368c20e6644519b258e94784a79d06cd2..a549265e55f6e7d7d0cb18c45ce97228101102bd 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 7d1105343bc2aa80eec6c344679c911847174df5..d5b2d2dd49043d26aaa71a7e996c083fc75963df 100644 (file)
@@ -28,7 +28,6 @@ CONFIG_USER_NS=y
 CONFIG_SCHED_AUTOGROUP=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
-# CONFIG_COMPAT_BRK is not set
 CONFIG_PROFILING=y
 CONFIG_ARCH_ACTIONS=y
 CONFIG_ARCH_SUNXI=y
@@ -36,6 +35,7 @@ CONFIG_ARCH_ALPINE=y
 CONFIG_ARCH_APPLE=y
 CONFIG_ARCH_BCM2835=y
 CONFIG_ARCH_BCM4908=y
+CONFIG_ARCH_BCMBCA=y
 CONFIG_ARCH_BCM_IPROC=y
 CONFIG_ARCH_BERLIN=y
 CONFIG_ARCH_BRCMSTB=y
@@ -49,6 +49,7 @@ CONFIG_ARCH_MEDIATEK=y
 CONFIG_ARCH_MESON=y
 CONFIG_ARCH_MVEBU=y
 CONFIG_ARCH_MXC=y
+CONFIG_ARCH_NPCM=y
 CONFIG_ARCH_QCOM=y
 CONFIG_ARCH_RENESAS=y
 CONFIG_ARCH_ROCKCHIP=y
@@ -93,12 +94,12 @@ CONFIG_ARM_ALLWINNER_SUN50I_CPUFREQ_NVMEM=m
 CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
 CONFIG_ARM_SCPI_CPUFREQ=y
 CONFIG_ARM_IMX_CPUFREQ_DT=m
+CONFIG_ARM_MEDIATEK_CPUFREQ=y
 CONFIG_ARM_QCOM_CPUFREQ_NVMEM=y
 CONFIG_ARM_QCOM_CPUFREQ_HW=y
 CONFIG_ARM_RASPBERRYPI_CPUFREQ=m
 CONFIG_ARM_SCMI_CPUFREQ=y
 CONFIG_ARM_TEGRA186_CPUFREQ=y
-CONFIG_ARM_MEDIATEK_CPUFREQ=y
 CONFIG_QORIQ_CPUFREQ=y
 CONFIG_ACPI=y
 CONFIG_ACPI_APEI=y
@@ -121,10 +122,10 @@ CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
 CONFIG_CRYPTO_CHACHA20_NEON=m
 CONFIG_CRYPTO_AES_ARM64_BS=m
 CONFIG_JUMP_LABEL=y
-CONFIG_SECCOMP=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_COMPAT_BRK is not set
 CONFIG_KSM=y
 CONFIG_MEMORY_FAILURE=y
 CONFIG_TRANSPARENT_HUGEPAGE=y
@@ -174,7 +175,6 @@ CONFIG_NET_CLS_ACT=y
 CONFIG_NET_ACT_GACT=m
 CONFIG_NET_ACT_MIRRED=m
 CONFIG_NET_ACT_GATE=m
-CONFIG_QRTR=m
 CONFIG_QRTR_SMD=m
 CONFIG_QRTR_TUN=m
 CONFIG_CAN=m
@@ -264,9 +264,9 @@ CONFIG_MTD_PHYSMAP_OF=y
 CONFIG_MTD_DATAFLASH=y
 CONFIG_MTD_SST25L=y
 CONFIG_MTD_RAW_NAND=y
-CONFIG_MTD_NAND_BRCMNAND=m
 CONFIG_MTD_NAND_DENALI_DT=y
 CONFIG_MTD_NAND_MARVELL=y
+CONFIG_MTD_NAND_BRCMNAND=m
 CONFIG_MTD_NAND_FSL_IFC=y
 CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NOR=y
@@ -288,11 +288,6 @@ CONFIG_SCSI_HISI_SAS=y
 CONFIG_SCSI_HISI_SAS_PCI=y
 CONFIG_MEGARAID_SAS=y
 CONFIG_SCSI_MPT3SAS=m
-CONFIG_SCSI_UFSHCD=y
-CONFIG_SCSI_UFSHCD_PLATFORM=y
-CONFIG_SCSI_UFS_QCOM=m
-CONFIG_SCSI_UFS_HISI=y
-CONFIG_SCSI_UFS_EXYNOS=y
 CONFIG_ATA=y
 CONFIG_SATA_AHCI=y
 CONFIG_SATA_AHCI_PLATFORM=y
@@ -322,8 +317,8 @@ CONFIG_AMD_XGBE=y
 CONFIG_NET_XGENE=y
 CONFIG_ATL1C=m
 CONFIG_BCMGENET=m
-CONFIG_SYSTEMPORT=m
 CONFIG_BNX2X=m
+CONFIG_SYSTEMPORT=m
 CONFIG_MACB=y
 CONFIG_THUNDER_NIC_PF=y
 CONFIG_FEC=y
@@ -375,7 +370,6 @@ CONFIG_DP83867_PHY=y
 CONFIG_VITESSE_PHY=y
 CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y
 CONFIG_MDIO_BUS_MUX_MMIOREG=y
-CONFIG_USB_BRCMSTB=m
 CONFIG_USB_PEGASUS=m
 CONFIG_USB_RTL8150=m
 CONFIG_USB_RTL8152=m
@@ -425,10 +419,10 @@ CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_SERIAL_8250_BCM2835AUX=y
 CONFIG_SERIAL_8250_DW=y
+CONFIG_SERIAL_8250_EM=y
 CONFIG_SERIAL_8250_OMAP=y
 CONFIG_SERIAL_8250_MT6577=y
 CONFIG_SERIAL_8250_UNIPHIER=y
-CONFIG_SERIAL_8250_EM=y
 CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
@@ -464,6 +458,7 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
 CONFIG_I2C_BCM2835=m
+CONFIG_I2C_CADENCE=m
 CONFIG_I2C_DESIGNWARE_PLATFORM=y
 CONFIG_I2C_GPIO=m
 CONFIG_I2C_IMX=y
@@ -485,7 +480,6 @@ CONFIG_I2C_TEGRA=y
 CONFIG_I2C_UNIPHIER_F=y
 CONFIG_I2C_RCAR=y
 CONFIG_I2C_CROS_EC_TUNNEL=y
-CONFIG_I2C_CADENCE=m
 CONFIG_SPI=y
 CONFIG_SPI_ARMADA_3700=y
 CONFIG_SPI_BCM2835=m
@@ -527,6 +521,7 @@ CONFIG_PINCTRL_IMX8QM=y
 CONFIG_PINCTRL_IMX8QXP=y
 CONFIG_PINCTRL_IMX8DXL=y
 CONFIG_PINCTRL_IMX8ULP=y
+CONFIG_PINCTRL_IMX93=y
 CONFIG_PINCTRL_MSM=y
 CONFIG_PINCTRL_IPQ8074=y
 CONFIG_PINCTRL_IPQ6018=y
@@ -539,6 +534,7 @@ CONFIG_PINCTRL_QDF2XXX=y
 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
 CONFIG_PINCTRL_SC7180=y
 CONFIG_PINCTRL_SC7280=y
+CONFIG_PINCTRL_SC8280XP=y
 CONFIG_PINCTRL_SDM845=y
 CONFIG_PINCTRL_SM8150=y
 CONFIG_PINCTRL_SM8250=y
@@ -577,6 +573,7 @@ CONFIG_CHARGER_BQ25890=m
 CONFIG_CHARGER_BQ25980=m
 CONFIG_SENSORS_ARM_SCMI=y
 CONFIG_SENSORS_ARM_SCPI=y
+CONFIG_SENSORS_GPIO_FAN=m
 CONFIG_SENSORS_JC42=m
 CONFIG_SENSORS_LM75=m
 CONFIG_SENSORS_LM90=m
@@ -604,16 +601,15 @@ CONFIG_EXYNOS_THERMAL=y
 CONFIG_TEGRA_SOCTHERM=m
 CONFIG_TEGRA_BPMP_THERMAL=m
 CONFIG_QCOM_TSENS=y
+CONFIG_QCOM_SPMI_ADC_TM5=m
 CONFIG_QCOM_SPMI_TEMP_ALARM=m
 CONFIG_QCOM_LMH=m
-CONFIG_QCOM_SPMI_ADC_TM5=m
 CONFIG_UNIPHIER_THERMAL=y
 CONFIG_WATCHDOG=y
 CONFIG_SL28CPLD_WATCHDOG=m
 CONFIG_ARM_SP805_WATCHDOG=y
 CONFIG_ARM_SBSA_WATCHDOG=y
 CONFIG_S3C2410_WATCHDOG=y
-CONFIG_BCM7038_WDT=m
 CONFIG_DW_WATCHDOG=y
 CONFIG_SUNXI_WATCHDOG=m
 CONFIG_IMX2_WDT=y
@@ -627,6 +623,8 @@ CONFIG_RENESAS_RZG2LWDT=y
 CONFIG_UNIPHIER_WATCHDOG=y
 CONFIG_PM8916_WATCHDOG=m
 CONFIG_BCM2835_WDT=y
+CONFIG_BCM7038_WDT=m
+CONFIG_NPCM7XX_WATCHDOG=y
 CONFIG_MFD_ALTERA_SYSMGR=y
 CONFIG_MFD_BD9571MWV=y
 CONFIG_MFD_AXP20X_I2C=y
@@ -684,21 +682,21 @@ CONFIG_MEDIA_PLATFORM_SUPPORT=y
 CONFIG_MEDIA_USB_SUPPORT=y
 CONFIG_USB_VIDEO_CLASS=m
 CONFIG_V4L_PLATFORM_DRIVERS=y
+CONFIG_SDR_PLATFORM_DRIVERS=y
+CONFIG_V4L_MEM2MEM_DRIVERS=y
 CONFIG_VIDEO_QCOM_CAMSS=m
+CONFIG_VIDEO_QCOM_VENUS=m
+CONFIG_VIDEO_RCAR_ISP=m
 CONFIG_VIDEO_RCAR_CSI2=m
 CONFIG_VIDEO_RCAR_VIN=m
-CONFIG_VIDEO_SUN6I_CSI=m
-CONFIG_VIDEO_RCAR_ISP=m
-CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
-CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
-CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
-CONFIG_VIDEO_RENESAS_FDP1=m
 CONFIG_VIDEO_RENESAS_FCP=m
+CONFIG_VIDEO_RENESAS_FDP1=m
 CONFIG_VIDEO_RENESAS_VSP1=m
-CONFIG_VIDEO_QCOM_VENUS=m
-CONFIG_SDR_PLATFORM_DRIVERS=y
 CONFIG_VIDEO_RCAR_DRIF=m
+CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC=m
+CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
+CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
+CONFIG_VIDEO_SUN6I_CSI=m
 CONFIG_VIDEO_IMX219=m
 CONFIG_VIDEO_OV5640=m
 CONFIG_VIDEO_OV5645=m
@@ -754,6 +752,7 @@ CONFIG_DRM_CDNS_MHDP8546=m
 CONFIG_DRM_DW_HDMI_AHB_AUDIO=m
 CONFIG_DRM_DW_HDMI_CEC=m
 CONFIG_DRM_IMX_DCSS=m
+CONFIG_DRM_V3D=m
 CONFIG_DRM_VC4=m
 CONFIG_DRM_ETNAVIV=m
 CONFIG_DRM_HISI_HIBMC=m
@@ -802,12 +801,16 @@ CONFIG_SND_SOC_RK3399_GRU_SOUND=m
 CONFIG_SND_SOC_SAMSUNG=y
 CONFIG_SND_SOC_RCAR=m
 CONFIG_SND_SOC_RZ=m
+CONFIG_SND_SUN8I_CODEC=m
+CONFIG_SND_SUN8I_CODEC_ANALOG=m
+CONFIG_SND_SUN50I_CODEC_ANALOG=m
 CONFIG_SND_SUN4I_I2S=m
 CONFIG_SND_SUN4I_SPDIF=m
 CONFIG_SND_SOC_TEGRA=m
 CONFIG_SND_SOC_TEGRA210_AHUB=m
 CONFIG_SND_SOC_TEGRA210_DMIC=m
 CONFIG_SND_SOC_TEGRA210_I2S=m
+CONFIG_SND_SOC_TEGRA210_OPE=m
 CONFIG_SND_SOC_TEGRA186_ASRC=m
 CONFIG_SND_SOC_TEGRA186_DSPK=m
 CONFIG_SND_SOC_TEGRA210_ADMAIF=m
@@ -853,6 +856,7 @@ CONFIG_USB_OTG=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_PCI_RENESAS=m
 CONFIG_USB_XHCI_TEGRA=y
+CONFIG_USB_BRCMSTB=m
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_EXYNOS=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
@@ -931,13 +935,20 @@ CONFIG_MMC_MTK=y
 CONFIG_MMC_SDHCI_XENON=y
 CONFIG_MMC_SDHCI_AM654=y
 CONFIG_MMC_OWL=y
+CONFIG_SCSI_UFSHCD=y
+CONFIG_SCSI_UFSHCD_PLATFORM=y
+CONFIG_SCSI_UFS_QCOM=m
+CONFIG_SCSI_UFS_HISI=y
+CONFIG_SCSI_UFS_EXYNOS=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_CLASS_MULTICOLOR=m
 CONFIG_LEDS_LM3692X=m
 CONFIG_LEDS_PCA9532=m
 CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_PWM=y
 CONFIG_LEDS_SYSCON=y
+CONFIG_LEDS_QCOM_LPG=m
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_DISK=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
@@ -972,8 +983,8 @@ CONFIG_RTC_DRV_PM8XXX=m
 CONFIG_RTC_DRV_TEGRA=y
 CONFIG_RTC_DRV_SNVS=m
 CONFIG_RTC_DRV_IMX_SC=m
-CONFIG_RTC_DRV_XGENE=y
 CONFIG_RTC_DRV_MT6397=m
+CONFIG_RTC_DRV_XGENE=y
 CONFIG_DMADEVICES=y
 CONFIG_DMA_BCM2835=y
 CONFIG_DMA_SUN6I=m
@@ -1021,6 +1032,7 @@ CONFIG_COMMON_CLK_FSL_SAI=y
 CONFIG_COMMON_CLK_S2MPS11=y
 CONFIG_COMMON_CLK_PWM=y
 CONFIG_COMMON_CLK_VC5=y
+CONFIG_COMMON_CLK_NPCM8XX=y
 CONFIG_COMMON_CLK_BD718XX=m
 CONFIG_CLK_RASPBERRYPI=m
 CONFIG_CLK_IMX8MM=y
@@ -1029,6 +1041,7 @@ CONFIG_CLK_IMX8MP=y
 CONFIG_CLK_IMX8MQ=y
 CONFIG_CLK_IMX8QXP=y
 CONFIG_CLK_IMX8ULP=y
+CONFIG_CLK_IMX93=y
 CONFIG_TI_SCI_CLK=y
 CONFIG_COMMON_CLK_QCOM=y
 CONFIG_QCOM_A53PLL=y
@@ -1045,15 +1058,16 @@ CONFIG_MSM_GCC_8998=y
 CONFIG_QCS_GCC_404=y
 CONFIG_SC_GCC_7180=y
 CONFIG_SC_GCC_7280=y
+CONFIG_SC_GCC_8280XP=y
 CONFIG_SDM_CAMCC_845=m
 CONFIG_SDM_GPUCC_845=y
 CONFIG_SDM_VIDEOCC_845=y
 CONFIG_SDM_DISPCC_845=y
+CONFIG_SM_DISPCC_8250=y
 CONFIG_SM_GCC_8350=y
 CONFIG_SM_GCC_8450=y
 CONFIG_SM_GPUCC_8150=y
 CONFIG_SM_GPUCC_8250=y
-CONFIG_SM_DISPCC_8250=y
 CONFIG_SM_VIDEOCC_8250=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_CLK_GFM_LPASS_SM8250=m
@@ -1091,7 +1105,6 @@ CONFIG_FSL_MC_DPIO=y
 CONFIG_FSL_RCPM=y
 CONFIG_MTK_DEVAPC=m
 CONFIG_MTK_PMIC_WRAP=y
-CONFIG_MAILBOX=y
 CONFIG_QCOM_AOSS_QMP=y
 CONFIG_QCOM_COMMAND_DB=y
 CONFIG_QCOM_CPR=y
@@ -1108,6 +1121,7 @@ CONFIG_QCOM_SOCINFO=m
 CONFIG_QCOM_STATS=m
 CONFIG_QCOM_WCNSS_CTRL=m
 CONFIG_QCOM_APR=m
+CONFIG_QCOM_ICC_BWMON=m
 CONFIG_ARCH_R8A77995=y
 CONFIG_ARCH_R8A77990=y
 CONFIG_ARCH_R8A77950=y
@@ -1119,6 +1133,7 @@ CONFIG_ARCH_R8A779F0=y
 CONFIG_ARCH_R8A77980=y
 CONFIG_ARCH_R8A77970=y
 CONFIG_ARCH_R8A779A0=y
+CONFIG_ARCH_R8A779G0=y
 CONFIG_ARCH_R8A774C0=y
 CONFIG_ARCH_R8A774E1=y
 CONFIG_ARCH_R8A774A1=y
@@ -1195,8 +1210,10 @@ CONFIG_PHY_MTK_TPHY=y
 CONFIG_PHY_QCOM_PCIE2=m
 CONFIG_PHY_QCOM_QMP=m
 CONFIG_PHY_QCOM_QUSB2=m
-CONFIG_PHY_QCOM_USB_HS=y
-CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=y
+CONFIG_PHY_QCOM_USB_HS=m
+CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=m
+CONFIG_PHY_QCOM_USB_HS_28NM=m
+CONFIG_PHY_QCOM_USB_SS=m
 CONFIG_PHY_RCAR_GEN3_PCIE=y
 CONFIG_PHY_RCAR_GEN3_USB2=y
 CONFIG_PHY_RCAR_GEN3_USB3=m
@@ -1247,8 +1264,12 @@ CONFIG_INTERCONNECT_IMX8MN=m
 CONFIG_INTERCONNECT_IMX8MQ=m
 CONFIG_INTERCONNECT_QCOM=y
 CONFIG_INTERCONNECT_QCOM_MSM8916=m
+CONFIG_INTERCONNECT_QCOM_MSM8996=m
 CONFIG_INTERCONNECT_QCOM_OSM_L3=m
+CONFIG_INTERCONNECT_QCOM_QCS404=m
+CONFIG_INTERCONNECT_QCOM_SC7180=m
 CONFIG_INTERCONNECT_QCOM_SC7280=y
+CONFIG_INTERCONNECT_QCOM_SC8280XP=y
 CONFIG_INTERCONNECT_QCOM_SDM845=y
 CONFIG_INTERCONNECT_QCOM_SM8150=m
 CONFIG_INTERCONNECT_QCOM_SM8250=m
@@ -1296,11 +1317,11 @@ CONFIG_CRYPTO_DEV_HISI_HPRE=m
 CONFIG_CRYPTO_DEV_HISI_TRNG=m
 CONFIG_CMA_SIZE_MBYTES=32
 CONFIG_PRINTK_TIME=y
-CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_DEBUG_INFO_REDUCED=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
-CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 # CONFIG_FTRACE is not set
index c39f2437e08ebcd592201a09d9cd34170a68e3d6..980d1dd8e1a32bfc249af74a8719bc56dfee4111 100644 (file)
@@ -2,12 +2,27 @@
 #ifndef __ASM_ASM_EXTABLE_H
 #define __ASM_ASM_EXTABLE_H
 
+#include <linux/bits.h>
+#include <asm/gpr-num.h>
+
 #define EX_TYPE_NONE                   0
-#define EX_TYPE_FIXUP                  1
-#define EX_TYPE_BPF                    2
-#define EX_TYPE_UACCESS_ERR_ZERO       3
+#define EX_TYPE_BPF                    1
+#define EX_TYPE_UACCESS_ERR_ZERO       2
+#define EX_TYPE_KACCESS_ERR_ZERO       3
 #define EX_TYPE_LOAD_UNALIGNED_ZEROPAD 4
 
+/* Data fields for EX_TYPE_UACCESS_ERR_ZERO */
+#define EX_DATA_REG_ERR_SHIFT  0
+#define EX_DATA_REG_ERR                GENMASK(4, 0)
+#define EX_DATA_REG_ZERO_SHIFT 5
+#define EX_DATA_REG_ZERO       GENMASK(9, 5)
+
+/* Data fields for EX_TYPE_LOAD_UNALIGNED_ZEROPAD */
+#define EX_DATA_REG_DATA_SHIFT 0
+#define EX_DATA_REG_DATA       GENMASK(4, 0)
+#define EX_DATA_REG_ADDR_SHIFT 5
+#define EX_DATA_REG_ADDR       GENMASK(9, 5)
+
 #ifdef __ASSEMBLY__
 
 #define __ASM_EXTABLE_RAW(insn, fixup, type, data)     \
        .short          (data);                         \
        .popsection;
 
+#define EX_DATA_REG(reg, gpr)  \
+       (.L__gpr_num_##gpr << EX_DATA_REG_##reg##_SHIFT)
+
+#define _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, err, zero)          \
+       __ASM_EXTABLE_RAW(insn, fixup,                                  \
+                         EX_TYPE_UACCESS_ERR_ZERO,                     \
+                         (                                             \
+                           EX_DATA_REG(ERR, err) |                     \
+                           EX_DATA_REG(ZERO, zero)                     \
+                         ))
+
+#define _ASM_EXTABLE_UACCESS_ERR(insn, fixup, err)                     \
+       _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, err, wzr)
+
+#define _ASM_EXTABLE_UACCESS(insn, fixup)                              \
+       _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, wzr, wzr)
+
 /*
- * Create an exception table entry for `insn`, which will branch to `fixup`
+ * Create an exception table entry for uaccess `insn`, which will branch to `fixup`
  * when an unhandled fault is taken.
  */
-       .macro          _asm_extable, insn, fixup
-       __ASM_EXTABLE_RAW(\insn, \fixup, EX_TYPE_FIXUP, 0)
+       .macro          _asm_extable_uaccess, insn, fixup
+       _ASM_EXTABLE_UACCESS(\insn, \fixup)
        .endm
 
 /*
  * Create an exception table entry for `insn` if `fixup` is provided. Otherwise
  * do nothing.
  */
-       .macro          _cond_extable, insn, fixup
-       .ifnc           \fixup,
-       _asm_extable    \insn, \fixup
+       .macro          _cond_uaccess_extable, insn, fixup
+       .ifnc                   \fixup,
+       _asm_extable_uaccess    \insn, \fixup
        .endif
        .endm
 
 #else /* __ASSEMBLY__ */
 
-#include <linux/bits.h>
 #include <linux/stringify.h>
 
-#include <asm/gpr-num.h>
-
 #define __ASM_EXTABLE_RAW(insn, fixup, type, data)     \
        ".pushsection   __ex_table, \"a\"\n"            \
        ".align         2\n"                            \
        ".short         (" data ")\n"                   \
        ".popsection\n"
 
-#define _ASM_EXTABLE(insn, fixup) \
-       __ASM_EXTABLE_RAW(#insn, #fixup, __stringify(EX_TYPE_FIXUP), "0")
-
-#define EX_DATA_REG_ERR_SHIFT  0
-#define EX_DATA_REG_ERR                GENMASK(4, 0)
-#define EX_DATA_REG_ZERO_SHIFT 5
-#define EX_DATA_REG_ZERO       GENMASK(9, 5)
-
 #define EX_DATA_REG(reg, gpr)                                          \
        "((.L__gpr_num_" #gpr ") << " __stringify(EX_DATA_REG_##reg##_SHIFT) ")"
 
                            EX_DATA_REG(ZERO, zero)                     \
                          ")")
 
+#define _ASM_EXTABLE_KACCESS_ERR_ZERO(insn, fixup, err, zero)          \
+       __DEFINE_ASM_GPR_NUMS                                           \
+       __ASM_EXTABLE_RAW(#insn, #fixup,                                \
+                         __stringify(EX_TYPE_KACCESS_ERR_ZERO),        \
+                         "("                                           \
+                           EX_DATA_REG(ERR, err) " | "                 \
+                           EX_DATA_REG(ZERO, zero)                     \
+                         ")")
+
 #define _ASM_EXTABLE_UACCESS_ERR(insn, fixup, err)                     \
        _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, err, wzr)
 
-#define EX_DATA_REG_DATA_SHIFT 0
-#define EX_DATA_REG_DATA       GENMASK(4, 0)
-#define EX_DATA_REG_ADDR_SHIFT 5
-#define EX_DATA_REG_ADDR       GENMASK(9, 5)
+#define _ASM_EXTABLE_UACCESS(insn, fixup)                              \
+       _ASM_EXTABLE_UACCESS_ERR_ZERO(insn, fixup, wzr, wzr)
+
+#define _ASM_EXTABLE_KACCESS_ERR(insn, fixup, err)                     \
+       _ASM_EXTABLE_KACCESS_ERR_ZERO(insn, fixup, err, wzr)
 
 #define _ASM_EXTABLE_LOAD_UNALIGNED_ZEROPAD(insn, fixup, data, addr)           \
        __DEFINE_ASM_GPR_NUMS                                                   \
index 0557af834e036958e1555097beafe55042b1d7b4..75b211c98dead5e6863718bb12f6584d8d4a2243 100644 (file)
@@ -61,7 +61,7 @@ alternative_else_nop_endif
 
 #define USER(l, x...)                          \
 9999:  x;                                      \
-       _asm_extable    9999b, l
+       _asm_extable_uaccess    9999b, l
 
 /*
  * Generate the assembly for LDTR/STTR with exception table entries.
@@ -73,8 +73,8 @@ alternative_else_nop_endif
 8889:          ldtr    \reg2, [\addr, #8];
                add     \addr, \addr, \post_inc;
 
-               _asm_extable    8888b,\l;
-               _asm_extable    8889b,\l;
+               _asm_extable_uaccess    8888b, \l;
+               _asm_extable_uaccess    8889b, \l;
        .endm
 
        .macro user_stp l, reg1, reg2, addr, post_inc
@@ -82,14 +82,14 @@ alternative_else_nop_endif
 8889:          sttr    \reg2, [\addr, #8];
                add     \addr, \addr, \post_inc;
 
-               _asm_extable    8888b,\l;
-               _asm_extable    8889b,\l;
+               _asm_extable_uaccess    8888b,\l;
+               _asm_extable_uaccess    8889b,\l;
        .endm
 
        .macro user_ldst l, inst, reg, addr, post_inc
 8888:          \inst           \reg, [\addr];
                add             \addr, \addr, \post_inc;
 
-               _asm_extable    8888b,\l;
+               _asm_extable_uaccess    8888b, \l;
        .endm
 #endif
index ead62f7dd2694b9390f9af92f1068a22b50e2201..13ecc79854ee2312dd25989072a5f78843c6bf20 100644 (file)
@@ -59,9 +59,9 @@ alternative_else_nop_endif
 
        .macro __ptrauth_keys_init_cpu tsk, tmp1, tmp2, tmp3
        mrs     \tmp1, id_aa64isar1_el1
-       ubfx    \tmp1, \tmp1, #ID_AA64ISAR1_APA_SHIFT, #8
+       ubfx    \tmp1, \tmp1, #ID_AA64ISAR1_EL1_APA_SHIFT, #8
        mrs_s   \tmp2, SYS_ID_AA64ISAR2_EL1
-       ubfx    \tmp2, \tmp2, #ID_AA64ISAR2_APA3_SHIFT, #4
+       ubfx    \tmp2, \tmp2, #ID_AA64ISAR2_EL1_APA3_SHIFT, #4
        orr     \tmp1, \tmp1, \tmp2
        cbz     \tmp1, .Lno_addr_auth\@
        mov_q   \tmp1, (SCTLR_ELx_ENIA | SCTLR_ELx_ENIB | \
index 8c5a61aeaf8e754fe819caac37cdf22f43dce3af..5846145be523c64c4e5c5be4e57cd9e9c2104ad0 100644 (file)
@@ -359,6 +359,20 @@ alternative_cb_end
        bfi     \valreg, \t1sz, #TCR_T1SZ_OFFSET, #TCR_TxSZ_WIDTH
        .endm
 
+/*
+ * idmap_get_t0sz - get the T0SZ value needed to cover the ID map
+ *
+ * Calculate the maximum allowed value for TCR_EL1.T0SZ so that the
+ * entire ID map region can be mapped. As T0SZ == (64 - #bits used),
+ * this number conveniently equals the number of leading zeroes in
+ * the physical address of _end.
+ */
+       .macro  idmap_get_t0sz, reg
+       adrp    \reg, _end
+       orr     \reg, \reg, #(1 << VA_BITS_MIN) - 1
+       clz     \reg, \reg
+       .endm
+
 /*
  * tcr_compute_pa_size - set TCR.(I)PS to the highest supported
  * ID_AA64MMFR0_EL1.PARange value
@@ -423,7 +437,7 @@ alternative_endif
        b.lo    .Ldcache_op\@
        dsb     \domain
 
-       _cond_extable .Ldcache_op\@, \fixup
+       _cond_uaccess_extable .Ldcache_op\@, \fixup
        .endm
 
 /*
@@ -462,7 +476,19 @@ alternative_endif
        dsb     ish
        isb
 
-       _cond_extable .Licache_op\@, \fixup
+       _cond_uaccess_extable .Licache_op\@, \fixup
+       .endm
+
+/*
+ * load_ttbr1 - install @pgtbl as a TTBR1 page table
+ * pgtbl preserved
+ * tmp1/tmp2 clobbered, either may overlap with pgtbl
+ */
+       .macro          load_ttbr1, pgtbl, tmp1, tmp2
+       phys_to_ttbr    \tmp1, \pgtbl
+       offset_ttbr1    \tmp1, \tmp2
+       msr             ttbr1_el1, \tmp1
+       isb
        .endm
 
 /*
@@ -478,10 +504,7 @@ alternative_endif
        isb
        tlbi    vmalle1
        dsb     nsh
-       phys_to_ttbr \tmp, \page_table
-       offset_ttbr1 \tmp, \tmp2
-       msr     ttbr1_el1, \tmp
-       isb
+       load_ttbr1 \page_table, \tmp, \tmp2
        .endm
 
 /*
index 9f3e2c3d2ca0f0ed2b24d4ba5ee7b5547c5b17cc..2cfc4245d2e2da2789ed4fb9f9284e60a8ce77f0 100644 (file)
 #define pmr_sync()     do {} while (0)
 #endif
 
-#define mb()           dsb(sy)
-#define rmb()          dsb(ld)
-#define wmb()          dsb(st)
+#define __mb()         dsb(sy)
+#define __rmb()                dsb(ld)
+#define __wmb()                dsb(st)
 
-#define dma_mb()       dmb(osh)
-#define dma_rmb()      dmb(oshld)
-#define dma_wmb()      dmb(oshst)
+#define __dma_mb()     dmb(osh)
+#define __dma_rmb()    dmb(oshld)
+#define __dma_wmb()    dmb(oshst)
 
 #define io_stop_wc()   dgh()
 
index 7c2181c721168416e5eb9bb8c6ca817c8bce1b13..ca9b487112ccbfa6c1c2d55dea2a781004356bdc 100644 (file)
@@ -5,34 +5,9 @@
 #ifndef __ASM_CACHE_H
 #define __ASM_CACHE_H
 
-#include <asm/cputype.h>
-#include <asm/mte-def.h>
-
-#define CTR_L1IP_SHIFT         14
-#define CTR_L1IP_MASK          3
-#define CTR_DMINLINE_SHIFT     16
-#define CTR_IMINLINE_SHIFT     0
-#define CTR_IMINLINE_MASK      0xf
-#define CTR_ERG_SHIFT          20
-#define CTR_CWG_SHIFT          24
-#define CTR_CWG_MASK           15
-#define CTR_IDC_SHIFT          28
-#define CTR_DIC_SHIFT          29
-
-#define CTR_CACHE_MINLINE_MASK \
-       (0xf << CTR_DMINLINE_SHIFT | CTR_IMINLINE_MASK << CTR_IMINLINE_SHIFT)
-
-#define CTR_L1IP(ctr)          (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK)
-
-#define ICACHE_POLICY_VPIPT    0
-#define ICACHE_POLICY_RESERVED 1
-#define ICACHE_POLICY_VIPT     2
-#define ICACHE_POLICY_PIPT     3
-
 #define L1_CACHE_SHIFT         (6)
 #define L1_CACHE_BYTES         (1 << L1_CACHE_SHIFT)
 
-
 #define CLIDR_LOUU_SHIFT       27
 #define CLIDR_LOC_SHIFT                24
 #define CLIDR_LOUIS_SHIFT      21
 #include <linux/bitops.h>
 #include <linux/kasan-enabled.h>
 
+#include <asm/cputype.h>
+#include <asm/mte-def.h>
+#include <asm/sysreg.h>
+
 #ifdef CONFIG_KASAN_SW_TAGS
 #define ARCH_SLAB_MINALIGN     (1ULL << KASAN_SHADOW_SCALE_SHIFT)
 #elif defined(CONFIG_KASAN_HW_TAGS)
@@ -66,6 +45,12 @@ static inline unsigned int arch_slab_minalign(void)
 #define arch_slab_minalign() arch_slab_minalign()
 #endif
 
+#define CTR_CACHE_MINLINE_MASK \
+       (0xf << CTR_EL0_DMINLINE_SHIFT | \
+        CTR_EL0_IMINLINE_MASK << CTR_EL0_IMINLINE_SHIFT)
+
+#define CTR_L1IP(ctr)          SYS_FIELD_GET(CTR_EL0, L1Ip, ctr)
+
 #define ICACHEF_ALIASING       0
 #define ICACHEF_VPIPT          1
 extern unsigned long __icache_flags;
@@ -86,7 +71,7 @@ static __always_inline int icache_is_vpipt(void)
 
 static inline u32 cache_type_cwg(void)
 {
-       return (read_cpuid_cachetype() >> CTR_CWG_SHIFT) & CTR_CWG_MASK;
+       return (read_cpuid_cachetype() >> CTR_EL0_CWG_SHIFT) & CTR_EL0_CWG_MASK;
 }
 
 #define __read_mostly __section(".data..read_mostly")
@@ -120,12 +105,12 @@ static inline u32 __attribute_const__ read_cpuid_effective_cachetype(void)
 {
        u32 ctr = read_cpuid_cachetype();
 
-       if (!(ctr & BIT(CTR_IDC_SHIFT))) {
+       if (!(ctr & BIT(CTR_EL0_IDC_SHIFT))) {
                u64 clidr = read_sysreg(clidr_el1);
 
                if (CLIDR_LOC(clidr) == 0 ||
                    (CLIDR_LOUIS(clidr) == 0 && CLIDR_LOUU(clidr) == 0))
-                       ctr |= BIT(CTR_IDC_SHIFT);
+                       ctr |= BIT(CTR_EL0_IDC_SHIFT);
        }
 
        return ctr;
index 5a228e203ef997439c251bf393c96b172b0b7d4f..37185e978aeb200893d2d51e447ee38db30a47e1 100644 (file)
@@ -104,13 +104,6 @@ static inline void flush_icache_range(unsigned long start, unsigned long end)
 }
 #define flush_icache_range flush_icache_range
 
-/*
- * Cache maintenance functions used by the DMA API. No to be used directly.
- */
-extern void __dma_map_area(const void *, size_t, int);
-extern void __dma_unmap_area(const void *, size_t, int);
-extern void __dma_flush_area(const void *, size_t);
-
 /*
  * Copy user data from/to a page which is mapped into a different
  * processes address space.  Really, we want to allow our "user
index 115cdec1ae878202a1ed668555c38b559746d661..fd7a92219eea99697a64b0cbcc794c275ef5241c 100644 (file)
@@ -46,6 +46,7 @@ struct cpuinfo_arm64 {
        u64             reg_midr;
        u64             reg_revidr;
        u64             reg_gmid;
+       u64             reg_smidr;
 
        u64             reg_id_aa64dfr0;
        u64             reg_id_aa64dfr1;
index e95c4df839115d34a3168128ec745d109e3de9be..a444c8915e886397d9cf117b0b6982fbd453d806 100644 (file)
  * @cpu_die:   Makes a cpu leave the kernel. Must not fail. Called from the
  *             cpu being killed.
  * @cpu_kill:  Ensures a cpu has left the kernel. Called from another cpu.
- * @cpu_init_idle: Reads any data necessary to initialize CPU idle states for
- *                a proposed logical id.
- * @cpu_suspend: Suspends a cpu and saves the required context. May fail owing
- *               to wrong parameters or error conditions. Called from the
- *               CPU being suspended. Must be called with IRQs disabled.
  */
 struct cpu_operations {
        const char      *name;
@@ -49,10 +44,6 @@ struct cpu_operations {
        void            (*cpu_die)(unsigned int cpu);
        int             (*cpu_kill)(unsigned int cpu);
 #endif
-#ifdef CONFIG_CPU_IDLE
-       int             (*cpu_init_idle)(unsigned int);
-       int             (*cpu_suspend)(unsigned long);
-#endif
 };
 
 int __init init_cpu_ops(int cpu);
index 14a8f3d93addf76d67bd4d13814b5202b7437fae..fd7d75a275f6c1c8c66110312d457b26501d9d5e 100644 (file)
@@ -11,7 +11,7 @@
 #include <asm/hwcap.h>
 #include <asm/sysreg.h>
 
-#define MAX_CPU_FEATURES       64
+#define MAX_CPU_FEATURES       128
 #define cpu_feature(x)         KERNEL_HWCAP_ ## x
 
 #ifndef __ASSEMBLY__
@@ -673,7 +673,7 @@ static inline bool supports_clearbhb(int scope)
                isar2 = read_sanitised_ftr_reg(SYS_ID_AA64ISAR2_EL1);
 
        return cpuid_feature_extract_unsigned_field(isar2,
-                                                   ID_AA64ISAR2_CLEARBHB_SHIFT);
+                                                   ID_AA64ISAR2_EL1_BC_SHIFT);
 }
 
 const struct cpumask *system_32bit_el0_cpumask(void);
@@ -908,7 +908,10 @@ static inline unsigned int get_vmid_bits(u64 mmfr1)
 }
 
 extern struct arm64_ftr_override id_aa64mmfr1_override;
+extern struct arm64_ftr_override id_aa64pfr0_override;
 extern struct arm64_ftr_override id_aa64pfr1_override;
+extern struct arm64_ftr_override id_aa64zfr0_override;
+extern struct arm64_ftr_override id_aa64smfr0_override;
 extern struct arm64_ftr_override id_aa64isar1_override;
 extern struct arm64_ftr_override id_aa64isar2_override;
 
index 14a19d1141bd22de1f854bc69fc00fba37ea30e2..2047713e097d34f671565d90a5352f06c6bd1197 100644 (file)
@@ -4,21 +4,6 @@
 
 #include <asm/proc-fns.h>
 
-#ifdef CONFIG_CPU_IDLE
-extern int arm_cpuidle_init(unsigned int cpu);
-extern int arm_cpuidle_suspend(int index);
-#else
-static inline int arm_cpuidle_init(unsigned int cpu)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline int arm_cpuidle_suspend(int index)
-{
-       return -EOPNOTSUPP;
-}
-#endif
-
 #ifdef CONFIG_ARM64_PSEUDO_NMI
 #include <asm/arch_gicv3.h>
 
index 34ceff08cac46b6dbdfaa41662b47a9f91c481f4..2630faa5bc08fc5879cb6595fb39f8fd2d44ab42 100644 (file)
        msr     cptr_el2, x0                    // Disable copro. traps to EL2
 .endm
 
-/* SVE register access */
-.macro __init_el2_nvhe_sve
-       mrs     x1, id_aa64pfr0_el1
-       ubfx    x1, x1, #ID_AA64PFR0_SVE_SHIFT, #4
-       cbz     x1, .Lskip_sve_\@
-
-       bic     x0, x0, #CPTR_EL2_TZ            // Also disable SVE traps
-       msr     cptr_el2, x0                    // Disable copro. traps to EL2
-       isb
-       mov     x1, #ZCR_ELx_LEN_MASK           // SVE: Enable full vector
-       msr_s   SYS_ZCR_EL2, x1                 // length for EL1.
-.Lskip_sve_\@:
-.endm
-
-/* SME register access and priority mapping */
-.macro __init_el2_nvhe_sme
-       mrs     x1, id_aa64pfr1_el1
-       ubfx    x1, x1, #ID_AA64PFR1_SME_SHIFT, #4
-       cbz     x1, .Lskip_sme_\@
-
-       bic     x0, x0, #CPTR_EL2_TSM           // Also disable SME traps
-       msr     cptr_el2, x0                    // Disable copro. traps to EL2
-       isb
-
-       mrs     x1, sctlr_el2
-       orr     x1, x1, #SCTLR_ELx_ENTP2        // Disable TPIDR2 traps
-       msr     sctlr_el2, x1
-       isb
-
-       mov     x1, #0                          // SMCR controls
-
-       mrs_s   x2, SYS_ID_AA64SMFR0_EL1
-       ubfx    x2, x2, #ID_AA64SMFR0_FA64_SHIFT, #1 // Full FP in SM?
-       cbz     x2, .Lskip_sme_fa64_\@
-
-       orr     x1, x1, SMCR_ELx_FA64_MASK
-.Lskip_sme_fa64_\@:
-
-       orr     x1, x1, #SMCR_ELx_LEN_MASK      // Enable full SME vector
-       msr_s   SYS_SMCR_EL2, x1                // length for EL1.
-
-       mrs_s   x1, SYS_SMIDR_EL1               // Priority mapping supported?
-       ubfx    x1, x1, #SMIDR_EL1_SMPS_SHIFT, #1
-       cbz     x1, .Lskip_sme_\@
-
-       msr_s   SYS_SMPRIMAP_EL2, xzr           // Make all priorities equal
-
-       mrs     x1, id_aa64mmfr1_el1            // HCRX_EL2 present?
-       ubfx    x1, x1, #ID_AA64MMFR1_HCX_SHIFT, #4
-       cbz     x1, .Lskip_sme_\@
-
-       mrs_s   x1, SYS_HCRX_EL2
-       orr     x1, x1, #HCRX_EL2_SMPME_MASK    // Enable priority mapping
-       msr_s   SYS_HCRX_EL2, x1
-
-.Lskip_sme_\@:
-.endm
-
 /* Disable any fine grained traps */
 .macro __init_el2_fgt
        mrs     x1, id_aa64mmfr0_el1
        __init_el2_hstr
        __init_el2_nvhe_idregs
        __init_el2_nvhe_cptr
-       __init_el2_nvhe_sve
-       __init_el2_nvhe_sme
        __init_el2_fgt
        __init_el2_nvhe_prepare_eret
 .endm
index daff882883f92c956775b3a8cf15f560f2de2d56..71ed5fdf718bd0fdc49cda4dde69e43d0339547f 100644 (file)
@@ -62,10 +62,12 @@ enum fixed_addresses {
 #endif /* CONFIG_ACPI_APEI_GHES */
 
 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+#ifdef CONFIG_RELOCATABLE
+       FIX_ENTRY_TRAMP_TEXT4,  /* one extra slot for the data page */
+#endif
        FIX_ENTRY_TRAMP_TEXT3,
        FIX_ENTRY_TRAMP_TEXT2,
        FIX_ENTRY_TRAMP_TEXT1,
-       FIX_ENTRY_TRAMP_DATA,
 #define TRAMP_VALIAS           (__fix_to_virt(FIX_ENTRY_TRAMP_TEXT1))
 #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
        __end_of_permanent_fixed_addresses,
index aa443d8f8cfb0938c933d0b1f8237f276505dae5..cef4ae7a3d8b1f7191dd310e6ffd17b10555baec 100644 (file)
@@ -85,7 +85,7 @@
 #define KERNEL_HWCAP_PACA              __khwcap_feature(PACA)
 #define KERNEL_HWCAP_PACG              __khwcap_feature(PACG)
 
-#define __khwcap2_feature(x)           (const_ilog2(HWCAP2_ ## x) + 32)
+#define __khwcap2_feature(x)           (const_ilog2(HWCAP2_ ## x) + 64)
 #define KERNEL_HWCAP_DCPODP            __khwcap2_feature(DCPODP)
 #define KERNEL_HWCAP_SVE2              __khwcap2_feature(SVE2)
 #define KERNEL_HWCAP_SVEAES            __khwcap2_feature(SVEAES)
 #define KERNEL_HWCAP_SME_F32F32                __khwcap2_feature(SME_F32F32)
 #define KERNEL_HWCAP_SME_FA64          __khwcap2_feature(SME_FA64)
 #define KERNEL_HWCAP_WFXT              __khwcap2_feature(WFXT)
+#define KERNEL_HWCAP_EBF16             __khwcap2_feature(EBF16)
 
 /*
  * This yields a mask that user programs can use to figure out what
index 3995652daf81a0af14bba4da469fcfa4a633887d..87dd42d74afee13e7c540e361ef3e77d70386798 100644 (file)
@@ -163,13 +163,16 @@ extern void __memset_io(volatile void __iomem *, int, size_t);
 /*
  * I/O memory mapping functions.
  */
-extern void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot);
-extern void iounmap(volatile void __iomem *addr);
-extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
 
-#define ioremap(addr, size)            __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
-#define ioremap_wc(addr, size)         __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
-#define ioremap_np(addr, size)         __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
+bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot);
+#define ioremap_allowed ioremap_allowed
+
+#define _PAGE_IOREMAP PROT_DEVICE_nGnRE
+
+#define ioremap_wc(addr, size) \
+       ioremap_prot((addr), (size), PROT_NORMAL_NC)
+#define ioremap_np(addr, size) \
+       ioremap_prot((addr), (size), PROT_DEVICE_nGnRnE)
 
 /*
  * io{read,write}{16,32,64}be() macros
@@ -184,6 +187,15 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
 
 #include <asm-generic/io.h>
 
+#define ioremap_cache ioremap_cache
+static inline void __iomem *ioremap_cache(phys_addr_t addr, size_t size)
+{
+       if (pfn_is_map_memory(__phys_to_pfn(addr)))
+               return (void __iomem *)__phys_to_virt(addr);
+
+       return ioremap_prot(addr, size, PROT_NORMAL);
+}
+
 /*
  * More restrictive address range checking than the default implementation
  * (PHYS_OFFSET and PHYS_MASK taken into account).
index 96dc0f7da258d9628a2e5a06557e3376f4089bd4..02e59fa8f2930c8fa81d54311c4fefe55277d001 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef __ASM_KERNEL_PGTABLE_H
 #define __ASM_KERNEL_PGTABLE_H
 
+#include <asm/boot.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/sparsemem.h>
 
  */
 #if ARM64_KERNEL_USES_PMD_MAPS
 #define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS - 1)
-#define IDMAP_PGTABLE_LEVELS   (ARM64_HW_PGTABLE_LEVELS(PHYS_MASK_SHIFT) - 1)
 #else
 #define SWAPPER_PGTABLE_LEVELS (CONFIG_PGTABLE_LEVELS)
-#define IDMAP_PGTABLE_LEVELS   (ARM64_HW_PGTABLE_LEVELS(PHYS_MASK_SHIFT))
 #endif
 
 
                        + EARLY_PUDS((vstart), (vend))  /* each PUD needs a next level page table */    \
                        + EARLY_PMDS((vstart), (vend))) /* each PMD needs a next level page table */
 #define INIT_DIR_SIZE (PAGE_SIZE * EARLY_PAGES(KIMAGE_VADDR, _end))
-#define IDMAP_DIR_SIZE         (IDMAP_PGTABLE_LEVELS * PAGE_SIZE)
+
+/* the initial ID map may need two extra pages if it needs to be extended */
+#if VA_BITS < 48
+#define INIT_IDMAP_DIR_SIZE    ((INIT_IDMAP_DIR_PAGES + 2) * PAGE_SIZE)
+#else
+#define INIT_IDMAP_DIR_SIZE    (INIT_IDMAP_DIR_PAGES * PAGE_SIZE)
+#endif
+#define INIT_IDMAP_DIR_PAGES   EARLY_PAGES(KIMAGE_VADDR, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE)
 
 /* Initial memory map size */
 #if ARM64_KERNEL_USES_PMD_MAPS
 #define SWAPPER_PMD_FLAGS      (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S)
 
 #if ARM64_KERNEL_USES_PMD_MAPS
-#define SWAPPER_MM_MMUFLAGS    (PMD_ATTRINDX(MT_NORMAL) | SWAPPER_PMD_FLAGS)
+#define SWAPPER_RW_MMUFLAGS    (PMD_ATTRINDX(MT_NORMAL) | SWAPPER_PMD_FLAGS)
+#define SWAPPER_RX_MMUFLAGS    (SWAPPER_RW_MMUFLAGS | PMD_SECT_RDONLY)
 #else
-#define SWAPPER_MM_MMUFLAGS    (PTE_ATTRINDX(MT_NORMAL) | SWAPPER_PTE_FLAGS)
+#define SWAPPER_RW_MMUFLAGS    (PTE_ATTRINDX(MT_NORMAL) | SWAPPER_PTE_FLAGS)
+#define SWAPPER_RX_MMUFLAGS    (SWAPPER_RW_MMUFLAGS | PTE_RDONLY)
 #endif
 
 /*
index 0af70d9abede3d9d65163101da185b4f9d749fa8..227d256cd4b9f7a23a47d15ae28c03822e2e492a 100644 (file)
 #include <linux/types.h>
 #include <asm/bug.h>
 
+#if VA_BITS > 48
 extern u64                     vabits_actual;
+#else
+#define vabits_actual          ((u64)VA_BITS)
+#endif
 
 extern s64                     memstart_addr;
 /* PHYS_OFFSET - the physical address of the start of memory. */
@@ -351,6 +355,11 @@ static inline void *phys_to_virt(phys_addr_t x)
 })
 
 void dump_mem_limit(void);
+
+static inline bool defer_reserve_crashkernel(void)
+{
+       return IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32);
+}
 #endif /* !ASSEMBLY */
 
 /*
index 6770667b34a31dcf983b371f26e9a9f86eb52a2e..c7ccd82db1d24bb3b8a3dfe7b95ff25bde59dc70 100644 (file)
@@ -60,8 +60,7 @@ static inline void cpu_switch_mm(pgd_t *pgd, struct mm_struct *mm)
  * TCR_T0SZ(VA_BITS), unless system RAM is positioned very high in
  * physical memory, in which case it will be smaller.
  */
-extern u64 idmap_t0sz;
-extern u64 idmap_ptrs_per_pgd;
+extern int idmap_t0sz;
 
 /*
  * Ensure TCR.T0SZ is set to the provided value.
@@ -106,13 +105,18 @@ static inline void cpu_uninstall_idmap(void)
                cpu_switch_mm(mm->pgd, mm);
 }
 
-static inline void cpu_install_idmap(void)
+static inline void __cpu_install_idmap(pgd_t *idmap)
 {
        cpu_set_reserved_ttbr0();
        local_flush_tlb_all();
        cpu_set_idmap_tcr_t0sz();
 
-       cpu_switch_mm(lm_alias(idmap_pg_dir), &init_mm);
+       cpu_switch_mm(lm_alias(idmap), &init_mm);
+}
+
+static inline void cpu_install_idmap(void)
+{
+       __cpu_install_idmap(idmap_pg_dir);
 }
 
 /*
@@ -143,7 +147,7 @@ static inline void cpu_install_ttbr0(phys_addr_t ttbr0, unsigned long t0sz)
  * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD,
  * avoiding the possibility of conflicting TLB entries being allocated.
  */
-static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp)
+static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap)
 {
        typedef void (ttbr_replace_func)(phys_addr_t);
        extern ttbr_replace_func idmap_cpu_replace_ttbr1;
@@ -166,7 +170,7 @@ static inline void __nocfi cpu_replace_ttbr1(pgd_t *pgdp)
 
        replace_phys = (void *)__pa_symbol(function_nocfi(idmap_cpu_replace_ttbr1));
 
-       cpu_install_idmap();
+       __cpu_install_idmap(idmap);
        replace_phys(ttbr1);
        cpu_uninstall_idmap();
 }
index dd3d12bce07b2f5c336ae4286e448be4481228b0..5ab8d163198fd99a75d6f4bfce4202c09f02df88 100644 (file)
  */
 #ifdef CONFIG_ARM64_PA_BITS_52
 /*
- * This should be GENMASK_ULL(47, 2).
  * TTBR_ELx[1] is RES0 in this configuration.
  */
-#define TTBR_BADDR_MASK_52     (((UL(1) << 46) - 1) << 2)
+#define TTBR_BADDR_MASK_52     GENMASK_ULL(47, 2)
 #endif
 
 #ifdef CONFIG_ARM64_VA_BITS_52
index 0b6632f18364435ddce6da4be70b4825c5957cd2..b5df82aa99e64ba30cafa436c4ae5181cd6894eb 100644 (file)
        __flush_tlb_range(vma, addr, end, PUD_SIZE, false, 1)
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
+static inline bool arch_thp_swp_supported(void)
+{
+       return !system_supports_mte();
+}
+#define arch_thp_swp_supported arch_thp_swp_supported
+
 /*
  * Outside of a few very special situations (e.g. hibernation), we always
  * use broadcast TLB invalidation instructions, therefore a spurious page
@@ -427,6 +433,16 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
        return clear_pte_bit(pte, __pgprot(PTE_SWP_EXCLUSIVE));
 }
 
+/*
+ * Select all bits except the pfn
+ */
+static inline pgprot_t pte_pgprot(pte_t pte)
+{
+       unsigned long pfn = pte_pfn(pte);
+
+       return __pgprot(pte_val(pfn_pte(pfn, __pgprot(0))) ^ pte_val(pte));
+}
+
 #ifdef CONFIG_NUMA_BALANCING
 /*
  * See the comment in include/linux/pgtable.h
index 9e58749db21df445d85777df99a33fd034ea9e0a..86eb0bfe3b380a562299216e8862a58edf2ca9b7 100644 (file)
@@ -272,8 +272,9 @@ void tls_preserve_current_state(void);
 
 static inline void start_thread_common(struct pt_regs *regs, unsigned long pc)
 {
+       s32 previous_syscall = regs->syscallno;
        memset(regs, 0, sizeof(*regs));
-       forget_syscall(regs);
+       regs->syscallno = previous_syscall;
        regs->pc = pc;
 
        if (system_uses_irq_prio_masking())
index 42ff95dba6da41a95785188df0b6e94b484c7e29..7c71358d44c4ab811fc05af7ff6d405aa737d4cf 100644 (file)
 
 #define SYS_ID_AA64PFR0_EL1            sys_reg(3, 0, 0, 4, 0)
 #define SYS_ID_AA64PFR1_EL1            sys_reg(3, 0, 0, 4, 1)
-#define SYS_ID_AA64ZFR0_EL1            sys_reg(3, 0, 0, 4, 4)
-#define SYS_ID_AA64SMFR0_EL1           sys_reg(3, 0, 0, 4, 5)
 
 #define SYS_ID_AA64DFR0_EL1            sys_reg(3, 0, 0, 5, 0)
 #define SYS_ID_AA64DFR1_EL1            sys_reg(3, 0, 0, 5, 1)
 #define SYS_ID_AA64AFR0_EL1            sys_reg(3, 0, 0, 5, 4)
 #define SYS_ID_AA64AFR1_EL1            sys_reg(3, 0, 0, 5, 5)
 
-#define SYS_ID_AA64ISAR1_EL1           sys_reg(3, 0, 0, 6, 1)
-#define SYS_ID_AA64ISAR2_EL1           sys_reg(3, 0, 0, 6, 2)
-
 #define SYS_ID_AA64MMFR0_EL1           sys_reg(3, 0, 0, 7, 0)
 #define SYS_ID_AA64MMFR1_EL1           sys_reg(3, 0, 0, 7, 1)
 #define SYS_ID_AA64MMFR2_EL1           sys_reg(3, 0, 0, 7, 2)
 #define SYS_MAIR_EL1                   sys_reg(3, 0, 10, 2, 0)
 #define SYS_AMAIR_EL1                  sys_reg(3, 0, 10, 3, 0)
 
-#define SYS_LORSA_EL1                  sys_reg(3, 0, 10, 4, 0)
-#define SYS_LOREA_EL1                  sys_reg(3, 0, 10, 4, 1)
-#define SYS_LORN_EL1                   sys_reg(3, 0, 10, 4, 2)
-#define SYS_LORC_EL1                   sys_reg(3, 0, 10, 4, 3)
-#define SYS_LORID_EL1                  sys_reg(3, 0, 10, 4, 7)
-
 #define SYS_VBAR_EL1                   sys_reg(3, 0, 12, 0, 0)
 #define SYS_DISR_EL1                   sys_reg(3, 0, 12, 1, 1)
 
 #define SYS_CNTKCTL_EL1                        sys_reg(3, 0, 14, 1, 0)
 
 #define SYS_CCSIDR_EL1                 sys_reg(3, 1, 0, 0, 0)
-#define SYS_GMID_EL1                   sys_reg(3, 1, 0, 0, 4)
 #define SYS_AIDR_EL1                   sys_reg(3, 1, 0, 0, 7)
 
 #define SMIDR_EL1_IMPLEMENTER_SHIFT    24
 #define SMIDR_EL1_SMPS_SHIFT   15
 #define SMIDR_EL1_AFFINITY_SHIFT       0
 
-#define SYS_CTR_EL0                    sys_reg(3, 3, 0, 0, 1)
-#define SYS_DCZID_EL0                  sys_reg(3, 3, 0, 0, 7)
-
 #define SYS_RNDR_EL0                   sys_reg(3, 3, 2, 4, 0)
 #define SYS_RNDRRS_EL0                 sys_reg(3, 3, 2, 4, 1)
 
 /* Position the attr at the correct index */
 #define MAIR_ATTRIDX(attr, idx)                ((attr) << ((idx) * 8))
 
-/* id_aa64isar1 */
-#define ID_AA64ISAR1_I8MM_SHIFT                52
-#define ID_AA64ISAR1_DGH_SHIFT         48
-#define ID_AA64ISAR1_BF16_SHIFT                44
-#define ID_AA64ISAR1_SPECRES_SHIFT     40
-#define ID_AA64ISAR1_SB_SHIFT          36
-#define ID_AA64ISAR1_FRINTTS_SHIFT     32
-#define ID_AA64ISAR1_GPI_SHIFT         28
-#define ID_AA64ISAR1_GPA_SHIFT         24
-#define ID_AA64ISAR1_LRCPC_SHIFT       20
-#define ID_AA64ISAR1_FCMA_SHIFT                16
-#define ID_AA64ISAR1_JSCVT_SHIFT       12
-#define ID_AA64ISAR1_API_SHIFT         8
-#define ID_AA64ISAR1_APA_SHIFT         4
-#define ID_AA64ISAR1_DPB_SHIFT         0
-
-#define ID_AA64ISAR1_APA_NI                    0x0
-#define ID_AA64ISAR1_APA_ARCHITECTED           0x1
-#define ID_AA64ISAR1_APA_ARCH_EPAC             0x2
-#define ID_AA64ISAR1_APA_ARCH_EPAC2            0x3
-#define ID_AA64ISAR1_APA_ARCH_EPAC2_FPAC       0x4
-#define ID_AA64ISAR1_APA_ARCH_EPAC2_FPAC_CMB   0x5
-#define ID_AA64ISAR1_API_NI                    0x0
-#define ID_AA64ISAR1_API_IMP_DEF               0x1
-#define ID_AA64ISAR1_API_IMP_DEF_EPAC          0x2
-#define ID_AA64ISAR1_API_IMP_DEF_EPAC2         0x3
-#define ID_AA64ISAR1_API_IMP_DEF_EPAC2_FPAC    0x4
-#define ID_AA64ISAR1_API_IMP_DEF_EPAC2_FPAC_CMB        0x5
-#define ID_AA64ISAR1_GPA_NI                    0x0
-#define ID_AA64ISAR1_GPA_ARCHITECTED           0x1
-#define ID_AA64ISAR1_GPI_NI                    0x0
-#define ID_AA64ISAR1_GPI_IMP_DEF               0x1
-
-/* id_aa64isar2 */
-#define ID_AA64ISAR2_CLEARBHB_SHIFT    28
-#define ID_AA64ISAR2_APA3_SHIFT                12
-#define ID_AA64ISAR2_GPA3_SHIFT                8
-#define ID_AA64ISAR2_RPRES_SHIFT       4
-#define ID_AA64ISAR2_WFXT_SHIFT                0
-
-#define ID_AA64ISAR2_RPRES_8BIT                0x0
-#define ID_AA64ISAR2_RPRES_12BIT       0x1
-/*
- * Value 0x1 has been removed from the architecture, and is
- * reserved, but has not yet been removed from the ARM ARM
- * as of ARM DDI 0487G.b.
- */
-#define ID_AA64ISAR2_WFXT_NI           0x0
-#define ID_AA64ISAR2_WFXT_SUPPORTED    0x2
-
-#define ID_AA64ISAR2_APA3_NI                   0x0
-#define ID_AA64ISAR2_APA3_ARCHITECTED          0x1
-#define ID_AA64ISAR2_APA3_ARCH_EPAC            0x2
-#define ID_AA64ISAR2_APA3_ARCH_EPAC2           0x3
-#define ID_AA64ISAR2_APA3_ARCH_EPAC2_FPAC      0x4
-#define ID_AA64ISAR2_APA3_ARCH_EPAC2_FPAC_CMB  0x5
-
-#define ID_AA64ISAR2_GPA3_NI                   0x0
-#define ID_AA64ISAR2_GPA3_ARCHITECTED          0x1
-
 /* id_aa64pfr0 */
 #define ID_AA64PFR0_CSV3_SHIFT         60
 #define ID_AA64PFR0_CSV2_SHIFT         56
 #define ID_AA64PFR1_MTE                        0x2
 #define ID_AA64PFR1_MTE_ASYMM          0x3
 
-/* id_aa64zfr0 */
-#define ID_AA64ZFR0_F64MM_SHIFT                56
-#define ID_AA64ZFR0_F32MM_SHIFT                52
-#define ID_AA64ZFR0_I8MM_SHIFT         44
-#define ID_AA64ZFR0_SM4_SHIFT          40
-#define ID_AA64ZFR0_SHA3_SHIFT         32
-#define ID_AA64ZFR0_BF16_SHIFT         20
-#define ID_AA64ZFR0_BITPERM_SHIFT      16
-#define ID_AA64ZFR0_AES_SHIFT          4
-#define ID_AA64ZFR0_SVEVER_SHIFT       0
-
-#define ID_AA64ZFR0_F64MM              0x1
-#define ID_AA64ZFR0_F32MM              0x1
-#define ID_AA64ZFR0_I8MM               0x1
-#define ID_AA64ZFR0_BF16               0x1
-#define ID_AA64ZFR0_SM4                        0x1
-#define ID_AA64ZFR0_SHA3               0x1
-#define ID_AA64ZFR0_BITPERM            0x1
-#define ID_AA64ZFR0_AES                        0x1
-#define ID_AA64ZFR0_AES_PMULL          0x2
-#define ID_AA64ZFR0_SVEVER_SVE2                0x1
-
-/* id_aa64smfr0 */
-#define ID_AA64SMFR0_FA64_SHIFT                63
-#define ID_AA64SMFR0_I16I64_SHIFT      52
-#define ID_AA64SMFR0_F64F64_SHIFT      48
-#define ID_AA64SMFR0_I8I32_SHIFT       36
-#define ID_AA64SMFR0_F16F32_SHIFT      35
-#define ID_AA64SMFR0_B16F32_SHIFT      34
-#define ID_AA64SMFR0_F32F32_SHIFT      32
-
-#define ID_AA64SMFR0_FA64              0x1
-#define ID_AA64SMFR0_I16I64            0xf
-#define ID_AA64SMFR0_F64F64            0x1
-#define ID_AA64SMFR0_I8I32             0xf
-#define ID_AA64SMFR0_F16F32            0x1
-#define ID_AA64SMFR0_B16F32            0x1
-#define ID_AA64SMFR0_F32F32            0x1
-
 /* id_aa64mmfr0 */
 #define ID_AA64MMFR0_ECV_SHIFT         60
 #define ID_AA64MMFR0_FGT_SHIFT         56
 
 /* id_aa64mmfr1 */
 #define ID_AA64MMFR1_ECBHB_SHIFT       60
+#define ID_AA64MMFR1_TIDCP1_SHIFT      52
 #define ID_AA64MMFR1_HCX_SHIFT         40
 #define ID_AA64MMFR1_AFP_SHIFT         44
 #define ID_AA64MMFR1_ETS_SHIFT         36
 #define ID_AA64MMFR1_VMIDBITS_8                0
 #define ID_AA64MMFR1_VMIDBITS_16       2
 
+#define ID_AA64MMFR1_TIDCP1_NI         0
+#define ID_AA64MMFR1_TIDCP1_IMP                1
+
 /* id_aa64mmfr2 */
 #define ID_AA64MMFR2_E0PD_SHIFT                60
 #define ID_AA64MMFR2_EVT_SHIFT         56
 #define MVFR2_FPMISC_SHIFT             4
 #define MVFR2_SIMDMISC_SHIFT           0
 
-#define DCZID_DZP_SHIFT                        4
-#define DCZID_BS_SHIFT                 0
-
 #define CPACR_EL1_FPEN_EL1EN   (BIT(20)) /* enable EL1 access */
 #define CPACR_EL1_FPEN_EL0EN   (BIT(21)) /* enable EL0 access, if EL1EN set */
 
 #define SYS_RGSR_EL1_SEED_MASK 0xffffUL
 
 /* GMID_EL1 field definitions */
-#define SYS_GMID_EL1_BS_SHIFT  0
-#define SYS_GMID_EL1_BS_SIZE   4
+#define GMID_EL1_BS_SHIFT      0
+#define GMID_EL1_BS_SIZE       4
 
 /* TFSR{,E0}_EL1 bit definitions */
 #define SYS_TFSR_EL1_TF0_SHIFT 0
 
 #endif
 
+#define SYS_FIELD_GET(reg, field, val)         \
+                FIELD_GET(reg##_##field##_MASK, val)
+
 #define SYS_FIELD_PREP(reg, field, val)                \
                 FIELD_PREP(reg##_##field##_MASK, val)
 
index 63f9c828f1a7103a39aa43d7db0b0c08cf940a52..2fc9f0861769a76e9ee835ab1007be4547a930c8 100644 (file)
@@ -232,34 +232,34 @@ static inline void __user *__uaccess_mask_ptr(const void __user *ptr)
  * The "__xxx_error" versions set the third argument to -EFAULT if an error
  * occurs, and leave it unchanged on success.
  */
-#define __get_mem_asm(load, reg, x, addr, err)                         \
+#define __get_mem_asm(load, reg, x, addr, err, type)                   \
        asm volatile(                                                   \
        "1:     " load "        " reg "1, [%2]\n"                       \
        "2:\n"                                                          \
-       _ASM_EXTABLE_UACCESS_ERR_ZERO(1b, 2b, %w0, %w1)                 \
+       _ASM_EXTABLE_##type##ACCESS_ERR_ZERO(1b, 2b, %w0, %w1)          \
        : "+r" (err), "=&r" (x)                                         \
        : "r" (addr))
 
-#define __raw_get_mem(ldr, x, ptr, err)                                        \
-do {                                                                   \
-       unsigned long __gu_val;                                         \
-       switch (sizeof(*(ptr))) {                                       \
-       case 1:                                                         \
-               __get_mem_asm(ldr "b", "%w", __gu_val, (ptr), (err));   \
-               break;                                                  \
-       case 2:                                                         \
-               __get_mem_asm(ldr "h", "%w", __gu_val, (ptr), (err));   \
-               break;                                                  \
-       case 4:                                                         \
-               __get_mem_asm(ldr, "%w", __gu_val, (ptr), (err));       \
-               break;                                                  \
-       case 8:                                                         \
-               __get_mem_asm(ldr, "%x",  __gu_val, (ptr), (err));      \
-               break;                                                  \
-       default:                                                        \
-               BUILD_BUG();                                            \
-       }                                                               \
-       (x) = (__force __typeof__(*(ptr)))__gu_val;                     \
+#define __raw_get_mem(ldr, x, ptr, err, type)                                  \
+do {                                                                           \
+       unsigned long __gu_val;                                                 \
+       switch (sizeof(*(ptr))) {                                               \
+       case 1:                                                                 \
+               __get_mem_asm(ldr "b", "%w", __gu_val, (ptr), (err), type);     \
+               break;                                                          \
+       case 2:                                                                 \
+               __get_mem_asm(ldr "h", "%w", __gu_val, (ptr), (err), type);     \
+               break;                                                          \
+       case 4:                                                                 \
+               __get_mem_asm(ldr, "%w", __gu_val, (ptr), (err), type);         \
+               break;                                                          \
+       case 8:                                                                 \
+               __get_mem_asm(ldr, "%x",  __gu_val, (ptr), (err), type);        \
+               break;                                                          \
+       default:                                                                \
+               BUILD_BUG();                                                    \
+       }                                                                       \
+       (x) = (__force __typeof__(*(ptr)))__gu_val;                             \
 } while (0)
 
 /*
@@ -274,7 +274,7 @@ do {                                                                        \
        __chk_user_ptr(ptr);                                            \
                                                                        \
        uaccess_ttbr0_enable();                                         \
-       __raw_get_mem("ldtr", __rgu_val, __rgu_ptr, err);               \
+       __raw_get_mem("ldtr", __rgu_val, __rgu_ptr, err, U);            \
        uaccess_ttbr0_disable();                                        \
                                                                        \
        (x) = __rgu_val;                                                \
@@ -314,40 +314,40 @@ do {                                                                      \
                                                                        \
        __uaccess_enable_tco_async();                                   \
        __raw_get_mem("ldr", *((type *)(__gkn_dst)),                    \
-                     (__force type *)(__gkn_src), __gkn_err);          \
+                     (__force type *)(__gkn_src), __gkn_err, K);       \
        __uaccess_disable_tco_async();                                  \
                                                                        \
        if (unlikely(__gkn_err))                                        \
                goto err_label;                                         \
 } while (0)
 
-#define __put_mem_asm(store, reg, x, addr, err)                                \
+#define __put_mem_asm(store, reg, x, addr, err, type)                  \
        asm volatile(                                                   \
        "1:     " store "       " reg "1, [%2]\n"                       \
        "2:\n"                                                          \
-       _ASM_EXTABLE_UACCESS_ERR(1b, 2b, %w0)                           \
+       _ASM_EXTABLE_##type##ACCESS_ERR(1b, 2b, %w0)                    \
        : "+r" (err)                                                    \
        : "r" (x), "r" (addr))
 
-#define __raw_put_mem(str, x, ptr, err)                                        \
-do {                                                                   \
-       __typeof__(*(ptr)) __pu_val = (x);                              \
-       switch (sizeof(*(ptr))) {                                       \
-       case 1:                                                         \
-               __put_mem_asm(str "b", "%w", __pu_val, (ptr), (err));   \
-               break;                                                  \
-       case 2:                                                         \
-               __put_mem_asm(str "h", "%w", __pu_val, (ptr), (err));   \
-               break;                                                  \
-       case 4:                                                         \
-               __put_mem_asm(str, "%w", __pu_val, (ptr), (err));       \
-               break;                                                  \
-       case 8:                                                         \
-               __put_mem_asm(str, "%x", __pu_val, (ptr), (err));       \
-               break;                                                  \
-       default:                                                        \
-               BUILD_BUG();                                            \
-       }                                                               \
+#define __raw_put_mem(str, x, ptr, err, type)                                  \
+do {                                                                           \
+       __typeof__(*(ptr)) __pu_val = (x);                                      \
+       switch (sizeof(*(ptr))) {                                               \
+       case 1:                                                                 \
+               __put_mem_asm(str "b", "%w", __pu_val, (ptr), (err), type);     \
+               break;                                                          \
+       case 2:                                                                 \
+               __put_mem_asm(str "h", "%w", __pu_val, (ptr), (err), type);     \
+               break;                                                          \
+       case 4:                                                                 \
+               __put_mem_asm(str, "%w", __pu_val, (ptr), (err), type);         \
+               break;                                                          \
+       case 8:                                                                 \
+               __put_mem_asm(str, "%x", __pu_val, (ptr), (err), type);         \
+               break;                                                          \
+       default:                                                                \
+               BUILD_BUG();                                                    \
+       }                                                                       \
 } while (0)
 
 /*
@@ -362,7 +362,7 @@ do {                                                                        \
        __chk_user_ptr(__rpu_ptr);                                      \
                                                                        \
        uaccess_ttbr0_enable();                                         \
-       __raw_put_mem("sttr", __rpu_val, __rpu_ptr, err);               \
+       __raw_put_mem("sttr", __rpu_val, __rpu_ptr, err, U);            \
        uaccess_ttbr0_disable();                                        \
 } while (0)
 
@@ -400,7 +400,7 @@ do {                                                                        \
                                                                        \
        __uaccess_enable_tco_async();                                   \
        __raw_put_mem("str", *((type *)(__pkn_src)),                    \
-                     (__force type *)(__pkn_dst), __pkn_err);          \
+                     (__force type *)(__pkn_dst), __pkn_err, K);       \
        __uaccess_disable_tco_async();                                  \
                                                                        \
        if (unlikely(__pkn_err))                                        \
index 0e80db4327b604c3613890289fc07e01ed6df6ae..4eb601e7de507615de61e1925c460f8856b5b00d 100644 (file)
@@ -36,9 +36,9 @@
 #define HVC_RESET_VECTORS 2
 
 /*
- * HVC_VHE_RESTART - Upgrade the CPU from EL1 to EL2, if possible
+ * HVC_FINALISE_EL2 - Upgrade the CPU from EL1 to EL2, if possible
  */
-#define HVC_VHE_RESTART        3
+#define HVC_FINALISE_EL2       3
 
 /* Max number of HYP stub hypercalls */
 #define HVC_STUB_HCALL_NR 4
 #define BOOT_CPU_MODE_EL1      (0xe11)
 #define BOOT_CPU_MODE_EL2      (0xe12)
 
+/*
+ * Flags returned together with the boot mode, but not preserved in
+ * __boot_cpu_mode. Used by the idreg override code to work out the
+ * boot state.
+ */
+#define BOOT_CPU_FLAG_E2H      BIT_ULL(32)
+
 #ifndef __ASSEMBLY__
 
 #include <asm/ptrace.h>
index 4bb2cc8ac4466596ac624f9cba9ffd94a2b14728..1ad2568a2569f481d1cb52042c4c5e7f70f4935f 100644 (file)
@@ -19,6 +19,9 @@
 
 /*
  * HWCAP flags - for AT_HWCAP
+ *
+ * Bits 62 and 63 are reserved for use by libc.
+ * Bits 32-61 are unallocated for potential use by libc.
  */
 #define HWCAP_FP               (1 << 0)
 #define HWCAP_ASIMD            (1 << 1)
@@ -88,5 +91,6 @@
 #define HWCAP2_SME_F32F32      (1 << 29)
 #define HWCAP2_SME_FA64                (1 << 30)
 #define HWCAP2_WFXT            (1UL << 31)
+#define HWCAP2_EBF16           (1UL << 32)
 
 #endif /* _UAPI__ASM_HWCAP_H */
index fa7981d0d9170057fda37d96f49e6ad0e6f33c2c..1add7b01efa72ed016fbfacd88f80bd5289ce39d 100644 (file)
@@ -14,6 +14,11 @@ CFLAGS_REMOVE_return_address.o = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_syscall.o         = -fstack-protector -fstack-protector-strong
 CFLAGS_syscall.o       += -fno-stack-protector
 
+# When KASAN is enabled, a stack trace is recorded for every alloc/free, which
+# can significantly impact performance. Avoid instrumenting the stack trace
+# collection code to minimize this impact.
+KASAN_SANITIZE_stacktrace.o := n
+
 # It's not safe to invoke KCOV when portions of the kernel environment aren't
 # available or are out-of-sync with HW state. Since `noinstr` doesn't always
 # inhibit KCOV instrumentation, disable it for the entire compilation unit.
@@ -59,7 +64,7 @@ obj-$(CONFIG_ACPI)                    += acpi.o
 obj-$(CONFIG_ACPI_NUMA)                        += acpi_numa.o
 obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL)      += acpi_parking_protocol.o
 obj-$(CONFIG_PARAVIRT)                 += paravirt.o
-obj-$(CONFIG_RANDOMIZE_BASE)           += kaslr.o
+obj-$(CONFIG_RANDOMIZE_BASE)           += kaslr.o pi/
 obj-$(CONFIG_HIBERNATION)              += hibernate.o hibernate-asm.o
 obj-$(CONFIG_ELF_CORE)                 += elfcore.o
 obj-$(CONFIG_KEXEC_CORE)               += machine_kexec.o relocate_kernel.o    \
index e4dea8db6924cc60906b434dbf521c21071c583c..a5a256e3f9fe440c60c01836af5098912e602409 100644 (file)
@@ -351,7 +351,7 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
                                prot = __acpi_get_writethrough_mem_attribute();
                }
        }
-       return __ioremap(phys, size, prot);
+       return ioremap_prot(phys, size, pgprot_val(prot));
 }
 
 /*
index fdfecf0991ced52e1b9216462e5618be33061bdb..e51535a5f939a9f6fb6ad29839fdd6b722009f2f 100644 (file)
@@ -109,7 +109,7 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa)
        pxm = pa->proximity_domain;
        node = acpi_map_pxm_to_node(pxm);
 
-       if (node == NUMA_NO_NODE || node >= MAX_NUMNODES) {
+       if (node == NUMA_NO_NODE) {
                pr_err("SRAT: Too many proximity domains %d\n", pxm);
                bad_srat();
                return;
index 7bbf5104b7b7bd9985849a774051abb591d07b0d..9bcaa5eacf16cf1ccf76d64f1886f52c54caef77 100644 (file)
@@ -121,7 +121,7 @@ static void clean_dcache_range_nopatch(u64 start, u64 end)
 
        ctr_el0 = read_sanitised_ftr_reg(SYS_CTR_EL0);
        d_size = 4 << cpuid_feature_extract_unsigned_field(ctr_el0,
-                                                          CTR_DMINLINE_SHIFT);
+                                                          CTR_EL0_DminLine_SHIFT);
        cur = start & ~(d_size - 1);
        do {
                /*
index 6875a16b09d290bdaceb980ea770ac96e71b496b..fb0e7c7b2e209de13623c97ce3cc41b77d5829ab 100644 (file)
@@ -59,6 +59,7 @@ struct insn_emulation {
 static LIST_HEAD(insn_emulation);
 static int nr_insn_emulated __initdata;
 static DEFINE_RAW_SPINLOCK(insn_emulation_lock);
+static DEFINE_MUTEX(insn_emulation_mutex);
 
 static void register_emulation_hooks(struct insn_emulation_ops *ops)
 {
@@ -207,10 +208,10 @@ static int emulation_proc_handler(struct ctl_table *table, int write,
                                  loff_t *ppos)
 {
        int ret = 0;
-       struct insn_emulation *insn = (struct insn_emulation *) table->data;
+       struct insn_emulation *insn = container_of(table->data, struct insn_emulation, current_mode);
        enum insn_emulation_mode prev_mode = insn->current_mode;
 
-       table->data = &insn->current_mode;
+       mutex_lock(&insn_emulation_mutex);
        ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
 
        if (ret || !write || prev_mode == insn->current_mode)
@@ -223,7 +224,7 @@ static int emulation_proc_handler(struct ctl_table *table, int write,
                update_insn_emulation_mode(insn, INSN_UNDEF);
        }
 ret:
-       table->data = insn;
+       mutex_unlock(&insn_emulation_mutex);
        return ret;
 }
 
@@ -247,7 +248,7 @@ static void __init register_insn_emulation_sysctl(void)
                sysctl->maxlen = sizeof(int);
 
                sysctl->procname = insn->ops->name;
-               sysctl->data = insn;
+               sysctl->data = &insn->current_mode;
                sysctl->extra1 = &insn->min;
                sysctl->extra2 = &insn->max;
                sysctl->proc_handler = emulation_proc_handler;
index c05cc3b6162e921a3cc28d42adc14dcf4f33650e..7e6289e709fc898f983967e0cb7b067deb257b47 100644 (file)
@@ -187,7 +187,7 @@ has_neoverse_n1_erratum_1542419(const struct arm64_cpu_capabilities *entry,
                                int scope)
 {
        u32 midr = read_cpuid_id();
-       bool has_dic = read_cpuid_cachetype() & BIT(CTR_DIC_SHIFT);
+       bool has_dic = read_cpuid_cachetype() & BIT(CTR_EL0_DIC_SHIFT);
        const struct midr_range range = MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1);
 
        WARN_ON(scope != SCOPE_LOCAL_CPU || preemptible());
@@ -211,6 +211,12 @@ static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = {
                /* Kryo4xx Gold (rcpe to rfpe) => (r0p0 to r3p0) */
                ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe),
        },
+#endif
+#ifdef CONFIG_ARM64_ERRATUM_2441009
+       {
+               /* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */
+               ERRATA_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1),
+       },
 #endif
        {},
 };
@@ -395,6 +401,14 @@ static struct midr_range trbe_write_out_of_range_cpus[] = {
 };
 #endif /* CONFIG_ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE */
 
+#ifdef CONFIG_ARM64_ERRATUM_1742098
+static struct midr_range broken_aarch32_aes[] = {
+       MIDR_RANGE(MIDR_CORTEX_A57, 0, 1, 0xf, 0xf),
+       MIDR_ALL_VERSIONS(MIDR_CORTEX_A72),
+       {},
+};
+#endif /* CONFIG_ARM64_WORKAROUND_TRBE_WRITE_OUT_OF_RANGE */
+
 const struct arm64_cpu_capabilities arm64_errata[] = {
 #ifdef CONFIG_ARM64_WORKAROUND_CLEAN_CACHE
        {
@@ -480,7 +494,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
 #endif
 #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI
        {
-               .desc = "Qualcomm erratum 1009, or ARM erratum 1286807",
+               .desc = "Qualcomm erratum 1009, or ARM erratum 1286807, 2441009",
                .capability = ARM64_WORKAROUND_REPEAT_TLBI,
                .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
                .matches = cpucap_multi_entry_cap_matches,
@@ -657,6 +671,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
                /* Cortex-A510 r0p0 - r0p1 */
                ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 1)
        },
+#endif
+#ifdef CONFIG_ARM64_ERRATUM_1742098
+       {
+               .desc = "ARM erratum 1742098",
+               .capability = ARM64_WORKAROUND_1742098,
+               CAP_MIDR_RANGE_LIST(broken_aarch32_aes),
+               .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
+       },
 #endif
        {
        }
index 8d88433de81da0a0ecf890f8328433fa4a0c4d9a..ad64cab0a2bad1c1ea8e7a7bacf0eb8fde3b102b 100644 (file)
@@ -79,6 +79,7 @@
 #include <asm/cpufeature.h>
 #include <asm/cpu_ops.h>
 #include <asm/fpsimd.h>
+#include <asm/hwcap.h>
 #include <asm/insn.h>
 #include <asm/kvm_host.h>
 #include <asm/mmu_context.h>
@@ -91,7 +92,7 @@
 #include <asm/virt.h>
 
 /* Kernel representation of AT_HWCAP and AT_HWCAP2 */
-static unsigned long elf_hwcap __read_mostly;
+static DECLARE_BITMAP(elf_hwcap, MAX_CPU_FEATURES) __read_mostly;
 
 #ifdef CONFIG_COMPAT
 #define COMPAT_ELF_HWCAP_DEFAULT       \
@@ -209,35 +210,35 @@ static const struct arm64_ftr_bits ftr_id_aa64isar0[] = {
 };
 
 static const struct arm64_ftr_bits ftr_id_aa64isar1[] = {
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_I8MM_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_DGH_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_BF16_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_SPECRES_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_SB_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_FRINTTS_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_I8MM_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_DGH_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_BF16_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_SPECRES_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_SB_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_FRINTTS_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_GPI_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_GPI_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_GPA_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_LRCPC_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_FCMA_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_JSCVT_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_GPA_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_LRCPC_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_FCMA_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_JSCVT_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
-                      FTR_STRICT, FTR_EXACT, ID_AA64ISAR1_API_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64ISAR1_EL1_API_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
-                      FTR_STRICT, FTR_EXACT, ID_AA64ISAR1_APA_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_DPB_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64ISAR1_EL1_APA_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR1_EL1_DPB_SHIFT, 4, 0),
        ARM64_FTR_END,
 };
 
 static const struct arm64_ftr_bits ftr_id_aa64isar2[] = {
-       ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_HIGHER_SAFE, ID_AA64ISAR2_CLEARBHB_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_HIGHER_SAFE, ID_AA64ISAR2_EL1_BC_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
-                      FTR_STRICT, FTR_EXACT, ID_AA64ISAR2_APA3_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64ISAR2_EL1_APA3_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_PTR_AUTH),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_GPA3_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_RPRES_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_WFXT_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_EL1_GPA3_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_EL1_RPRES_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64ISAR2_EL1_WFxT_SHIFT, 4, 0),
        ARM64_FTR_END,
 };
 
@@ -276,41 +277,41 @@ static const struct arm64_ftr_bits ftr_id_aa64pfr1[] = {
 
 static const struct arm64_ftr_bits ftr_id_aa64zfr0[] = {
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_F64MM_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_F64MM_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_F32MM_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_F32MM_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_I8MM_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_I8MM_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_SM4_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_SM4_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_SHA3_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_SHA3_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_BF16_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_BF16_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_BITPERM_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_BitPerm_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_AES_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_AES_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SVE),
-                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_SVEVER_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_LOWER_SAFE, ID_AA64ZFR0_EL1_SVEver_SHIFT, 4, 0),
        ARM64_FTR_END,
 };
 
 static const struct arm64_ftr_bits ftr_id_aa64smfr0[] = {
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_FA64_SHIFT, 1, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_FA64_SHIFT, 1, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_I16I64_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_I16I64_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_F64F64_SHIFT, 1, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_F64F64_SHIFT, 1, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_I8I32_SHIFT, 4, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_I8I32_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_F16F32_SHIFT, 1, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_F16F32_SHIFT, 1, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_B16F32_SHIFT, 1, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_B16F32_SHIFT, 1, 0),
        ARM64_FTR_BITS(FTR_VISIBLE_IF_IS_ENABLED(CONFIG_ARM64_SME),
-                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_F32F32_SHIFT, 1, 0),
+                      FTR_STRICT, FTR_EXACT, ID_AA64SMFR0_EL1_F32F32_SHIFT, 1, 0),
        ARM64_FTR_END,
 };
 
@@ -361,6 +362,7 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr0[] = {
 };
 
 static const struct arm64_ftr_bits ftr_id_aa64mmfr1[] = {
+       ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_TIDCP1_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_AFP_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_ETS_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR1_TWED_SHIFT, 4, 0),
@@ -396,18 +398,18 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr2[] = {
 
 static const struct arm64_ftr_bits ftr_ctr[] = {
        ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DIC_SHIFT, 1, 1),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IDC_SHIFT, 1, 1),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_CWG_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_ERG_SHIFT, 4, 0),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DMINLINE_SHIFT, 4, 1),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_EL0_DIC_SHIFT, 1, 1),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_EL0_IDC_SHIFT, 1, 1),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_EL0_CWG_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_OR_ZERO_SAFE, CTR_EL0_ERG_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_EL0_DminLine_SHIFT, 4, 1),
        /*
         * Linux can handle differing I-cache policies. Userspace JITs will
         * make use of *minLine.
         * If we have differing I-cache policies, report it as the weakest - VIPT.
         */
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, CTR_L1IP_SHIFT, 2, ICACHE_POLICY_VIPT),   /* L1Ip */
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IMINLINE_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, CTR_EL0_L1Ip_SHIFT, 2, CTR_EL0_L1Ip_VIPT),        /* L1Ip */
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_EL0_IminLine_SHIFT, 4, 0),
        ARM64_FTR_END,
 };
 
@@ -453,13 +455,13 @@ static const struct arm64_ftr_bits ftr_mvfr2[] = {
 };
 
 static const struct arm64_ftr_bits ftr_dczid[] = {
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, DCZID_DZP_SHIFT, 1, 1),
-       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, DCZID_BS_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, DCZID_EL0_DZP_SHIFT, 1, 1),
+       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, DCZID_EL0_BS_SHIFT, 4, 0),
        ARM64_FTR_END,
 };
 
 static const struct arm64_ftr_bits ftr_gmid[] = {
-       ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, SYS_GMID_EL1_BS_SHIFT, 4, 0),
+       ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, GMID_EL1_BS_SHIFT, 4, 0),
        ARM64_FTR_END,
 };
 
@@ -561,7 +563,7 @@ static const struct arm64_ftr_bits ftr_id_pfr2[] = {
 
 static const struct arm64_ftr_bits ftr_id_dfr0[] = {
        /* [31:28] TraceFilt */
-       S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_DFR0_PERFMON_SHIFT, 4, 0xf),
+       S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_EXACT, ID_DFR0_PERFMON_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_DFR0_MPROFDBG_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_DFR0_MMAPTRC_SHIFT, 4, 0),
        ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_DFR0_COPTRC_SHIFT, 4, 0),
@@ -631,7 +633,10 @@ static const struct arm64_ftr_bits ftr_raz[] = {
        __ARM64_FTR_REG_OVERRIDE(#id, id, table, &no_override)
 
 struct arm64_ftr_override __ro_after_init id_aa64mmfr1_override;
+struct arm64_ftr_override __ro_after_init id_aa64pfr0_override;
 struct arm64_ftr_override __ro_after_init id_aa64pfr1_override;
+struct arm64_ftr_override __ro_after_init id_aa64zfr0_override;
+struct arm64_ftr_override __ro_after_init id_aa64smfr0_override;
 struct arm64_ftr_override __ro_after_init id_aa64isar1_override;
 struct arm64_ftr_override __ro_after_init id_aa64isar2_override;
 
@@ -668,11 +673,14 @@ static const struct __ftr_reg_entry {
        ARM64_FTR_REG(SYS_ID_MMFR5_EL1, ftr_id_mmfr5),
 
        /* Op1 = 0, CRn = 0, CRm = 4 */
-       ARM64_FTR_REG(SYS_ID_AA64PFR0_EL1, ftr_id_aa64pfr0),
+       ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64PFR0_EL1, ftr_id_aa64pfr0,
+                              &id_aa64pfr0_override),
        ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64PFR1_EL1, ftr_id_aa64pfr1,
                               &id_aa64pfr1_override),
-       ARM64_FTR_REG(SYS_ID_AA64ZFR0_EL1, ftr_id_aa64zfr0),
-       ARM64_FTR_REG(SYS_ID_AA64SMFR0_EL1, ftr_id_aa64smfr0),
+       ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64ZFR0_EL1, ftr_id_aa64zfr0,
+                              &id_aa64zfr0_override),
+       ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64SMFR0_EL1, ftr_id_aa64smfr0,
+                              &id_aa64smfr0_override),
 
        /* Op1 = 0, CRn = 0, CRm = 5 */
        ARM64_FTR_REG(SYS_ID_AA64DFR0_EL1, ftr_id_aa64dfr0),
@@ -993,15 +1001,24 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info)
        if (id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0))
                init_32bit_cpu_features(&info->aarch32);
 
-       if (id_aa64pfr0_sve(info->reg_id_aa64pfr0)) {
+       if (IS_ENABLED(CONFIG_ARM64_SVE) &&
+           id_aa64pfr0_sve(read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1))) {
+               info->reg_zcr = read_zcr_features();
                init_cpu_ftr_reg(SYS_ZCR_EL1, info->reg_zcr);
                vec_init_vq_map(ARM64_VEC_SVE);
        }
 
-       if (id_aa64pfr1_sme(info->reg_id_aa64pfr1)) {
+       if (IS_ENABLED(CONFIG_ARM64_SME) &&
+           id_aa64pfr1_sme(read_sanitised_ftr_reg(SYS_ID_AA64PFR1_EL1))) {
+               info->reg_smcr = read_smcr_features();
+               /*
+                * We mask out SMPS since even if the hardware
+                * supports priorities the kernel does not at present
+                * and we block access to them.
+                */
+               info->reg_smidr = read_cpuid(SMIDR_EL1) & ~SMIDR_EL1_SMPS;
                init_cpu_ftr_reg(SYS_SMCR_EL1, info->reg_smcr);
-               if (IS_ENABLED(CONFIG_ARM64_SME))
-                       vec_init_vq_map(ARM64_VEC_SME);
+               vec_init_vq_map(ARM64_VEC_SME);
        }
 
        if (id_aa64pfr1_mte(info->reg_id_aa64pfr1))
@@ -1233,23 +1250,31 @@ void update_cpu_features(int cpu,
        taint |= check_update_ftr_reg(SYS_ID_AA64SMFR0_EL1, cpu,
                                      info->reg_id_aa64smfr0, boot->reg_id_aa64smfr0);
 
-       if (id_aa64pfr0_sve(info->reg_id_aa64pfr0)) {
+       if (IS_ENABLED(CONFIG_ARM64_SVE) &&
+           id_aa64pfr0_sve(read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1))) {
+               info->reg_zcr = read_zcr_features();
                taint |= check_update_ftr_reg(SYS_ZCR_EL1, cpu,
                                        info->reg_zcr, boot->reg_zcr);
 
-               /* Probe vector lengths, unless we already gave up on SVE */
-               if (id_aa64pfr0_sve(read_sanitised_ftr_reg(SYS_ID_AA64PFR0_EL1)) &&
-                   !system_capabilities_finalized())
+               /* Probe vector lengths */
+               if (!system_capabilities_finalized())
                        vec_update_vq_map(ARM64_VEC_SVE);
        }
 
-       if (id_aa64pfr1_sme(info->reg_id_aa64pfr1)) {
+       if (IS_ENABLED(CONFIG_ARM64_SME) &&
+           id_aa64pfr1_sme(read_sanitised_ftr_reg(SYS_ID_AA64PFR1_EL1))) {
+               info->reg_smcr = read_smcr_features();
+               /*
+                * We mask out SMPS since even if the hardware
+                * supports priorities the kernel does not at present
+                * and we block access to them.
+                */
+               info->reg_smidr = read_cpuid(SMIDR_EL1) & ~SMIDR_EL1_SMPS;
                taint |= check_update_ftr_reg(SYS_SMCR_EL1, cpu,
                                        info->reg_smcr, boot->reg_smcr);
 
-               /* Probe vector lengths, unless we already gave up on SME */
-               if (id_aa64pfr1_sme(read_sanitised_ftr_reg(SYS_ID_AA64PFR1_EL1)) &&
-                   !system_capabilities_finalized())
+               /* Probe vector lengths */
+               if (!system_capabilities_finalized())
                        vec_update_vq_map(ARM64_VEC_SME);
        }
 
@@ -1480,7 +1505,7 @@ static bool has_cache_idc(const struct arm64_cpu_capabilities *entry,
        else
                ctr = read_cpuid_effective_cachetype();
 
-       return ctr & BIT(CTR_IDC_SHIFT);
+       return ctr & BIT(CTR_EL0_IDC_SHIFT);
 }
 
 static void cpu_emulate_effective_ctr(const struct arm64_cpu_capabilities *__unused)
@@ -1491,7 +1516,7 @@ static void cpu_emulate_effective_ctr(const struct arm64_cpu_capabilities *__unu
         * to the CTR_EL0 on this CPU and emulate it with the real/safe
         * value.
         */
-       if (!(read_cpuid_cachetype() & BIT(CTR_IDC_SHIFT)))
+       if (!(read_cpuid_cachetype() & BIT(CTR_EL0_IDC_SHIFT)))
                sysreg_clear_set(sctlr_el1, SCTLR_EL1_UCT, 0);
 }
 
@@ -1505,7 +1530,7 @@ static bool has_cache_dic(const struct arm64_cpu_capabilities *entry,
        else
                ctr = read_cpuid_cachetype();
 
-       return ctr & BIT(CTR_DIC_SHIFT);
+       return ctr & BIT(CTR_EL0_DIC_SHIFT);
 }
 
 static bool __maybe_unused
@@ -1645,14 +1670,34 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry,
 }
 
 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+#define KPTI_NG_TEMP_VA                (-(1UL << PMD_SHIFT))
+
+extern
+void create_kpti_ng_temp_pgd(pgd_t *pgdir, phys_addr_t phys, unsigned long virt,
+                            phys_addr_t size, pgprot_t prot,
+                            phys_addr_t (*pgtable_alloc)(int), int flags);
+
+static phys_addr_t kpti_ng_temp_alloc;
+
+static phys_addr_t kpti_ng_pgd_alloc(int shift)
+{
+       kpti_ng_temp_alloc -= PAGE_SIZE;
+       return kpti_ng_temp_alloc;
+}
+
 static void __nocfi
 kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
 {
-       typedef void (kpti_remap_fn)(int, int, phys_addr_t);
+       typedef void (kpti_remap_fn)(int, int, phys_addr_t, unsigned long);
        extern kpti_remap_fn idmap_kpti_install_ng_mappings;
        kpti_remap_fn *remap_fn;
 
        int cpu = smp_processor_id();
+       int levels = CONFIG_PGTABLE_LEVELS;
+       int order = order_base_2(levels);
+       u64 kpti_ng_temp_pgd_pa = 0;
+       pgd_t *kpti_ng_temp_pgd;
+       u64 alloc = 0;
 
        if (__this_cpu_read(this_cpu_vector) == vectors) {
                const char *v = arm64_get_bp_hardening_vector(EL1_VECTOR_KPTI);
@@ -1670,12 +1715,40 @@ kpti_install_ng_mappings(const struct arm64_cpu_capabilities *__unused)
 
        remap_fn = (void *)__pa_symbol(function_nocfi(idmap_kpti_install_ng_mappings));
 
+       if (!cpu) {
+               alloc = __get_free_pages(GFP_ATOMIC | __GFP_ZERO, order);
+               kpti_ng_temp_pgd = (pgd_t *)(alloc + (levels - 1) * PAGE_SIZE);
+               kpti_ng_temp_alloc = kpti_ng_temp_pgd_pa = __pa(kpti_ng_temp_pgd);
+
+               //
+               // Create a minimal page table hierarchy that permits us to map
+               // the swapper page tables temporarily as we traverse them.
+               //
+               // The physical pages are laid out as follows:
+               //
+               // +--------+-/-------+-/------ +-\\--------+
+               // :  PTE[] : | PMD[] : | PUD[] : || PGD[]  :
+               // +--------+-\-------+-\------ +-//--------+
+               //      ^
+               // The first page is mapped into this hierarchy at a PMD_SHIFT
+               // aligned virtual address, so that we can manipulate the PTE
+               // level entries while the mapping is active. The first entry
+               // covers the PTE[] page itself, the remaining entries are free
+               // to be used as a ad-hoc fixmap.
+               //
+               create_kpti_ng_temp_pgd(kpti_ng_temp_pgd, __pa(alloc),
+                                       KPTI_NG_TEMP_VA, PAGE_SIZE, PAGE_KERNEL,
+                                       kpti_ng_pgd_alloc, 0);
+       }
+
        cpu_install_idmap();
-       remap_fn(cpu, num_online_cpus(), __pa_symbol(swapper_pg_dir));
+       remap_fn(cpu, num_online_cpus(), kpti_ng_temp_pgd_pa, KPTI_NG_TEMP_VA);
        cpu_uninstall_idmap();
 
-       if (!cpu)
+       if (!cpu) {
+               free_pages(alloc, order);
                arm64_use_ng_mappings = true;
+       }
 }
 #else
 static void
@@ -1971,6 +2044,14 @@ static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap)
 }
 #endif /* CONFIG_ARM64_MTE */
 
+static void elf_hwcap_fixup(void)
+{
+#ifdef CONFIG_ARM64_ERRATUM_1742098
+       if (cpus_have_const_cap(ARM64_WORKAROUND_1742098))
+               compat_elf_hwcap2 &= ~COMPAT_HWCAP2_AES;
+#endif /* ARM64_ERRATUM_1742098 */
+}
+
 #ifdef CONFIG_KVM
 static bool is_kvm_protected_mode(const struct arm64_cpu_capabilities *entry, int __unused)
 {
@@ -1978,6 +2059,11 @@ static bool is_kvm_protected_mode(const struct arm64_cpu_capabilities *entry, in
 }
 #endif /* CONFIG_KVM */
 
+static void cpu_trap_el0_impdef(const struct arm64_cpu_capabilities *__unused)
+{
+       sysreg_clear_set(sctlr_el1, 0, SCTLR_EL1_TIDCP);
+}
+
 /* Internal helper functions to match cpu capability type */
 static bool
 cpucap_late_cpu_optional(const struct arm64_cpu_capabilities *cap)
@@ -2132,7 +2218,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .matches = has_cpuid_feature,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
-               .field_pos = ID_AA64ISAR1_DPB_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_DPB_SHIFT,
                .field_width = 4,
                .min_field_value = 1,
        },
@@ -2143,7 +2229,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .matches = has_cpuid_feature,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR1_DPB_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_DPB_SHIFT,
                .field_width = 4,
                .min_field_value = 2,
        },
@@ -2303,7 +2389,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .matches = has_cpuid_feature,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
-               .field_pos = ID_AA64ISAR1_SB_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_SB_SHIFT,
                .field_width = 4,
                .sign = FTR_UNSIGNED,
                .min_field_value = 1,
@@ -2315,9 +2401,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_BOOT_CPU_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR1_APA_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_APA_SHIFT,
                .field_width = 4,
-               .min_field_value = ID_AA64ISAR1_APA_ARCHITECTED,
+               .min_field_value = ID_AA64ISAR1_EL1_APA_PAuth,
                .matches = has_address_auth_cpucap,
        },
        {
@@ -2326,9 +2412,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_BOOT_CPU_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR2_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR2_APA3_SHIFT,
+               .field_pos = ID_AA64ISAR2_EL1_APA3_SHIFT,
                .field_width = 4,
-               .min_field_value = ID_AA64ISAR2_APA3_ARCHITECTED,
+               .min_field_value = ID_AA64ISAR2_EL1_APA3_PAuth,
                .matches = has_address_auth_cpucap,
        },
        {
@@ -2337,9 +2423,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_BOOT_CPU_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR1_API_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_API_SHIFT,
                .field_width = 4,
-               .min_field_value = ID_AA64ISAR1_API_IMP_DEF,
+               .min_field_value = ID_AA64ISAR1_EL1_API_PAuth,
                .matches = has_address_auth_cpucap,
        },
        {
@@ -2353,9 +2439,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR1_GPA_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_GPA_SHIFT,
                .field_width = 4,
-               .min_field_value = ID_AA64ISAR1_GPA_ARCHITECTED,
+               .min_field_value = ID_AA64ISAR1_EL1_GPA_IMP,
                .matches = has_cpuid_feature,
        },
        {
@@ -2364,9 +2450,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR2_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR2_GPA3_SHIFT,
+               .field_pos = ID_AA64ISAR2_EL1_GPA3_SHIFT,
                .field_width = 4,
-               .min_field_value = ID_AA64ISAR2_GPA3_ARCHITECTED,
+               .min_field_value = ID_AA64ISAR2_EL1_GPA3_IMP,
                .matches = has_cpuid_feature,
        },
        {
@@ -2375,9 +2461,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR1_GPI_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_GPI_SHIFT,
                .field_width = 4,
-               .min_field_value = ID_AA64ISAR1_GPI_IMP_DEF,
+               .min_field_value = ID_AA64ISAR1_EL1_GPI_IMP,
                .matches = has_cpuid_feature,
        },
        {
@@ -2478,7 +2564,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR1_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR1_LRCPC_SHIFT,
+               .field_pos = ID_AA64ISAR1_EL1_LRCPC_SHIFT,
                .field_width = 4,
                .matches = has_cpuid_feature,
                .min_field_value = 1,
@@ -2503,9 +2589,9 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .capability = ARM64_SME_FA64,
                .sys_reg = SYS_ID_AA64SMFR0_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64SMFR0_FA64_SHIFT,
+               .field_pos = ID_AA64SMFR0_EL1_FA64_SHIFT,
                .field_width = 1,
-               .min_field_value = ID_AA64SMFR0_FA64,
+               .min_field_value = ID_AA64SMFR0_EL1_FA64_IMP,
                .matches = has_cpuid_feature,
                .cpu_enable = fa64_kernel_enable,
        },
@@ -2516,10 +2602,22 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
                .type = ARM64_CPUCAP_SYSTEM_FEATURE,
                .sys_reg = SYS_ID_AA64ISAR2_EL1,
                .sign = FTR_UNSIGNED,
-               .field_pos = ID_AA64ISAR2_WFXT_SHIFT,
+               .field_pos = ID_AA64ISAR2_EL1_WFxT_SHIFT,
                .field_width = 4,
                .matches = has_cpuid_feature,
-               .min_field_value = ID_AA64ISAR2_WFXT_SUPPORTED,
+               .min_field_value = ID_AA64ISAR2_EL1_WFxT_IMP,
+       },
+       {
+               .desc = "Trap EL0 IMPLEMENTATION DEFINED functionality",
+               .capability = ARM64_HAS_TIDCP1,
+               .type = ARM64_CPUCAP_SYSTEM_FEATURE,
+               .sys_reg = SYS_ID_AA64MMFR1_EL1,
+               .sign = FTR_UNSIGNED,
+               .field_pos = ID_AA64MMFR1_TIDCP1_SHIFT,
+               .field_width = 4,
+               .min_field_value = ID_AA64MMFR1_TIDCP1_IMP,
+               .matches = has_cpuid_feature,
+               .cpu_enable = cpu_trap_el0_impdef,
        },
        {},
 };
@@ -2560,33 +2658,33 @@ static const struct arm64_cpu_capabilities arm64_features[] = {
 #ifdef CONFIG_ARM64_PTR_AUTH
 static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = {
        {
-               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_APA_SHIFT,
+               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_APA_SHIFT,
                                  4, FTR_UNSIGNED,
-                                 ID_AA64ISAR1_APA_ARCHITECTED)
+                                 ID_AA64ISAR1_EL1_APA_PAuth)
        },
        {
-               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_APA3_SHIFT,
-                                 4, FTR_UNSIGNED, ID_AA64ISAR2_APA3_ARCHITECTED)
+               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_EL1_APA3_SHIFT,
+                                 4, FTR_UNSIGNED, ID_AA64ISAR2_EL1_APA3_PAuth)
        },
        {
-               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_API_SHIFT,
-                                 4, FTR_UNSIGNED, ID_AA64ISAR1_API_IMP_DEF)
+               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_API_SHIFT,
+                                 4, FTR_UNSIGNED, ID_AA64ISAR1_EL1_API_PAuth)
        },
        {},
 };
 
 static const struct arm64_cpu_capabilities ptr_auth_hwcap_gen_matches[] = {
        {
-               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_GPA_SHIFT,
-                                 4, FTR_UNSIGNED, ID_AA64ISAR1_GPA_ARCHITECTED)
+               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_GPA_SHIFT,
+                                 4, FTR_UNSIGNED, ID_AA64ISAR1_EL1_GPA_IMP)
        },
        {
-               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_GPA3_SHIFT,
-                                 4, FTR_UNSIGNED, ID_AA64ISAR2_GPA3_ARCHITECTED)
+               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_EL1_GPA3_SHIFT,
+                                 4, FTR_UNSIGNED, ID_AA64ISAR2_EL1_GPA3_IMP)
        },
        {
-               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_GPI_SHIFT,
-                                 4, FTR_UNSIGNED, ID_AA64ISAR1_GPI_IMP_DEF)
+               HWCAP_CPUID_MATCH(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_GPI_SHIFT,
+                                 4, FTR_UNSIGNED, ID_AA64ISAR1_EL1_GPI_IMP)
        },
        {},
 };
@@ -2614,30 +2712,31 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_ASIMD_SHIFT, 4, FTR_SIGNED, 0, CAP_HWCAP, KERNEL_HWCAP_ASIMD),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_ASIMD_SHIFT, 4, FTR_SIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ASIMDHP),
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_DIT_SHIFT, 4, FTR_SIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DIT),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_DPB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DCPOP),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_DPB_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_DCPODP),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_JSCVT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_JSCVT),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_FCMA_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FCMA),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_LRCPC_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_LRCPC),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_LRCPC_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_ILRCPC),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_FRINTTS_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FRINT),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_SB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_SB),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_BF16_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_BF16),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_DGH_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DGH),
-       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_I8MM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_I8MM),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_DPB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DCPOP),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_DPB_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_DCPODP),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_JSCVT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_JSCVT),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_FCMA_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FCMA),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_LRCPC_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_LRCPC),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_LRCPC_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_ILRCPC),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_FRINTTS_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FRINT),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_SB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_SB),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_BF16_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_BF16),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_BF16_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_EBF16),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_DGH_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DGH),
+       HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_I8MM_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_I8MM),
        HWCAP_CAP(SYS_ID_AA64MMFR2_EL1, ID_AA64MMFR2_AT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_USCAT),
 #ifdef CONFIG_ARM64_SVE
        HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_SVE_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR0_SVE, CAP_HWCAP, KERNEL_HWCAP_SVE),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_SVEVER_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_SVEVER_SVE2, CAP_HWCAP, KERNEL_HWCAP_SVE2),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_AES_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_AES, CAP_HWCAP, KERNEL_HWCAP_SVEAES),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_AES_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_AES_PMULL, CAP_HWCAP, KERNEL_HWCAP_SVEPMULL),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_BITPERM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_BITPERM, CAP_HWCAP, KERNEL_HWCAP_SVEBITPERM),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_BF16_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_BF16, CAP_HWCAP, KERNEL_HWCAP_SVEBF16),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_SHA3_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_SHA3, CAP_HWCAP, KERNEL_HWCAP_SVESHA3),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_SM4_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_SM4, CAP_HWCAP, KERNEL_HWCAP_SVESM4),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_I8MM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_I8MM, CAP_HWCAP, KERNEL_HWCAP_SVEI8MM),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_F32MM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_F32MM, CAP_HWCAP, KERNEL_HWCAP_SVEF32MM),
-       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_F64MM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_F64MM, CAP_HWCAP, KERNEL_HWCAP_SVEF64MM),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_SVEver_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_SVEver_SVE2, CAP_HWCAP, KERNEL_HWCAP_SVE2),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_AES_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_AES_IMP, CAP_HWCAP, KERNEL_HWCAP_SVEAES),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_AES_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_AES_PMULL128, CAP_HWCAP, KERNEL_HWCAP_SVEPMULL),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_BitPerm_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_BitPerm_IMP, CAP_HWCAP, KERNEL_HWCAP_SVEBITPERM),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_BF16_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_BF16_IMP, CAP_HWCAP, KERNEL_HWCAP_SVEBF16),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_SHA3_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_SHA3_IMP, CAP_HWCAP, KERNEL_HWCAP_SVESHA3),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_SM4_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_SM4_IMP, CAP_HWCAP, KERNEL_HWCAP_SVESM4),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_I8MM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_I8MM_IMP, CAP_HWCAP, KERNEL_HWCAP_SVEI8MM),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_F32MM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_F32MM_IMP, CAP_HWCAP, KERNEL_HWCAP_SVEF32MM),
+       HWCAP_CAP(SYS_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_F64MM_SHIFT, 4, FTR_UNSIGNED, ID_AA64ZFR0_EL1_F64MM_IMP, CAP_HWCAP, KERNEL_HWCAP_SVEF64MM),
 #endif
        HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_SSBS_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_SSBS_PSTATE_INSNS, CAP_HWCAP, KERNEL_HWCAP_SSBS),
 #ifdef CONFIG_ARM64_BTI
@@ -2653,17 +2752,17 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = {
 #endif /* CONFIG_ARM64_MTE */
        HWCAP_CAP(SYS_ID_AA64MMFR0_EL1, ID_AA64MMFR0_ECV_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ECV),
        HWCAP_CAP(SYS_ID_AA64MMFR1_EL1, ID_AA64MMFR1_AFP_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_AFP),
-       HWCAP_CAP(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_RPRES_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_RPRES),
-       HWCAP_CAP(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_WFXT_SHIFT, 4, FTR_UNSIGNED, ID_AA64ISAR2_WFXT_SUPPORTED, CAP_HWCAP, KERNEL_HWCAP_WFXT),
+       HWCAP_CAP(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_EL1_RPRES_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_RPRES),
+       HWCAP_CAP(SYS_ID_AA64ISAR2_EL1, ID_AA64ISAR2_EL1_WFxT_SHIFT, 4, FTR_UNSIGNED, ID_AA64ISAR2_EL1_WFxT_IMP, CAP_HWCAP, KERNEL_HWCAP_WFXT),
 #ifdef CONFIG_ARM64_SME
        HWCAP_CAP(SYS_ID_AA64PFR1_EL1, ID_AA64PFR1_SME_SHIFT, 4, FTR_UNSIGNED, ID_AA64PFR1_SME, CAP_HWCAP, KERNEL_HWCAP_SME),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_FA64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_FA64, CAP_HWCAP, KERNEL_HWCAP_SME_FA64),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_I16I64_SHIFT, 4, FTR_UNSIGNED, ID_AA64SMFR0_I16I64, CAP_HWCAP, KERNEL_HWCAP_SME_I16I64),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_F64F64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_F64F64, CAP_HWCAP, KERNEL_HWCAP_SME_F64F64),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_I8I32_SHIFT, 4, FTR_UNSIGNED, ID_AA64SMFR0_I8I32, CAP_HWCAP, KERNEL_HWCAP_SME_I8I32),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_F16F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_F16F32, CAP_HWCAP, KERNEL_HWCAP_SME_F16F32),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_B16F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_B16F32, CAP_HWCAP, KERNEL_HWCAP_SME_B16F32),
-       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_F32F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_F32F32, CAP_HWCAP, KERNEL_HWCAP_SME_F32F32),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_FA64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_FA64_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_FA64),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_I16I64_SHIFT, 4, FTR_UNSIGNED, ID_AA64SMFR0_EL1_I16I64_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_I16I64),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_F64F64_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_F64F64_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_F64F64),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_I8I32_SHIFT, 4, FTR_UNSIGNED, ID_AA64SMFR0_EL1_I8I32_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_I8I32),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_F16F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_F16F32_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_F16F32),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_B16F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_B16F32_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_B16F32),
+       HWCAP_CAP(SYS_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_F32F32_SHIFT, 1, FTR_UNSIGNED, ID_AA64SMFR0_EL1_F32F32_IMP, CAP_HWCAP, KERNEL_HWCAP_SME_F32F32),
 #endif /* CONFIG_ARM64_SME */
        {},
 };
@@ -3098,14 +3197,12 @@ static bool __maybe_unused __system_matches_cap(unsigned int n)
 
 void cpu_set_feature(unsigned int num)
 {
-       WARN_ON(num >= MAX_CPU_FEATURES);
-       elf_hwcap |= BIT(num);
+       set_bit(num, elf_hwcap);
 }
 
 bool cpu_have_feature(unsigned int num)
 {
-       WARN_ON(num >= MAX_CPU_FEATURES);
-       return elf_hwcap & BIT(num);
+       return test_bit(num, elf_hwcap);
 }
 EXPORT_SYMBOL_GPL(cpu_have_feature);
 
@@ -3116,12 +3213,12 @@ unsigned long cpu_get_elf_hwcap(void)
         * note that for userspace compatibility we guarantee that bits 62
         * and 63 will always be returned as 0.
         */
-       return lower_32_bits(elf_hwcap);
+       return elf_hwcap[0];
 }
 
 unsigned long cpu_get_elf_hwcap2(void)
 {
-       return upper_32_bits(elf_hwcap);
+       return elf_hwcap[1];
 }
 
 static void __init setup_system_capabilities(void)
@@ -3143,8 +3240,10 @@ void __init setup_cpu_features(void)
        setup_system_capabilities();
        setup_elf_hwcaps(arm64_elf_hwcaps);
 
-       if (system_supports_32bit_el0())
+       if (system_supports_32bit_el0()) {
                setup_elf_hwcaps(compat_elf_hwcaps);
+               elf_hwcap_fixup();
+       }
 
        if (system_uses_ttbr0_pan())
                pr_info("emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching\n");
@@ -3197,6 +3296,7 @@ static int enable_mismatched_32bit_el0(unsigned int cpu)
                                                         cpu_active_mask);
        get_cpu_device(lucky_winner)->offline_disabled = true;
        setup_elf_hwcaps(compat_elf_hwcaps);
+       elf_hwcap_fixup();
        pr_info("Asymmetric 32-bit EL0 support detected on CPU %u; CPU hot-unplug disabled on CPU %u\n",
                cpu, lucky_winner);
        return 0;
@@ -3218,7 +3318,7 @@ subsys_initcall_sync(init_32bit_el0_mask);
 
 static void __maybe_unused cpu_enable_cnp(struct arm64_cpu_capabilities const *cap)
 {
-       cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
+       cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir);
 }
 
 /*
index 3006f43248084bf1736033c822e89951b4795b34..4150e308e99c0a6a367de92c04c431056ef4ffc7 100644 (file)
 #include <linux/of_device.h>
 #include <linux/psci.h>
 
-#include <asm/cpuidle.h>
-#include <asm/cpu_ops.h>
-
-int arm_cpuidle_init(unsigned int cpu)
-{
-       const struct cpu_operations *ops = get_cpu_ops(cpu);
-       int ret = -EOPNOTSUPP;
-
-       if (ops && ops->cpu_suspend && ops->cpu_init_idle)
-               ret = ops->cpu_init_idle(cpu);
-
-       return ret;
-}
-
-/**
- * arm_cpuidle_suspend() - function to enter a low-power idle state
- * @index: argument to pass to CPU suspend operations
- *
- * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU
- * operations back-end error code otherwise.
- */
-int arm_cpuidle_suspend(int index)
-{
-       int cpu = smp_processor_id();
-       const struct cpu_operations *ops = get_cpu_ops(cpu);
-
-       return ops->cpu_suspend(index);
-}
-
 #ifdef CONFIG_ACPI
 
 #include <acpi/processor.h>
index 8eff0a34ffd47547e0f3684a6b79745764e25d44..d7702f39b4d338eafe96f0c68e58f8bad0a693ca 100644 (file)
 DEFINE_PER_CPU(struct cpuinfo_arm64, cpu_data);
 static struct cpuinfo_arm64 boot_cpu_data;
 
-static const char *icache_policy_str[] = {
-       [ICACHE_POLICY_VPIPT]           = "VPIPT",
-       [ICACHE_POLICY_RESERVED]        = "RESERVED/UNKNOWN",
-       [ICACHE_POLICY_VIPT]            = "VIPT",
-       [ICACHE_POLICY_PIPT]            = "PIPT",
-};
+static inline const char *icache_policy_str(int l1ip)
+{
+       switch (l1ip) {
+       case CTR_EL0_L1Ip_VPIPT:
+               return "VPIPT";
+       case CTR_EL0_L1Ip_VIPT:
+               return "VIPT";
+       case CTR_EL0_L1Ip_PIPT:
+               return "PIPT";
+       default:
+               return "RESERVED/UNKNOWN";
+       }
+}
 
 unsigned long __icache_flags;
 
@@ -107,6 +114,7 @@ static const char *const hwcap_str[] = {
        [KERNEL_HWCAP_SME_F32F32]       = "smef32f32",
        [KERNEL_HWCAP_SME_FA64]         = "smefa64",
        [KERNEL_HWCAP_WFXT]             = "wfxt",
+       [KERNEL_HWCAP_EBF16]            = "ebf16",
 };
 
 #ifdef CONFIG_COMPAT
@@ -267,6 +275,7 @@ static struct kobj_type cpuregs_kobj_type = {
 
 CPUREGS_ATTR_RO(midr_el1, midr);
 CPUREGS_ATTR_RO(revidr_el1, revidr);
+CPUREGS_ATTR_RO(smidr_el1, smidr);
 
 static struct attribute *cpuregs_id_attrs[] = {
        &cpuregs_attr_midr_el1.attr,
@@ -279,6 +288,16 @@ static const struct attribute_group cpuregs_attr_group = {
        .name = "identification"
 };
 
+static struct attribute *sme_cpuregs_id_attrs[] = {
+       &cpuregs_attr_smidr_el1.attr,
+       NULL
+};
+
+static const struct attribute_group sme_cpuregs_attr_group = {
+       .attrs = sme_cpuregs_id_attrs,
+       .name = "identification"
+};
+
 static int cpuid_cpu_online(unsigned int cpu)
 {
        int rc;
@@ -296,6 +315,8 @@ static int cpuid_cpu_online(unsigned int cpu)
        rc = sysfs_create_group(&info->kobj, &cpuregs_attr_group);
        if (rc)
                kobject_del(&info->kobj);
+       if (system_supports_sme())
+               rc = sysfs_merge_group(&info->kobj, &sme_cpuregs_attr_group);
 out:
        return rc;
 }
@@ -342,19 +363,19 @@ static void cpuinfo_detect_icache_policy(struct cpuinfo_arm64 *info)
        u32 l1ip = CTR_L1IP(info->reg_ctr);
 
        switch (l1ip) {
-       case ICACHE_POLICY_PIPT:
+       case CTR_EL0_L1Ip_PIPT:
                break;
-       case ICACHE_POLICY_VPIPT:
+       case CTR_EL0_L1Ip_VPIPT:
                set_bit(ICACHEF_VPIPT, &__icache_flags);
                break;
-       case ICACHE_POLICY_RESERVED:
-       case ICACHE_POLICY_VIPT:
+       case CTR_EL0_L1Ip_VIPT:
+       default:
                /* Assume aliasing */
                set_bit(ICACHEF_ALIASING, &__icache_flags);
                break;
        }
 
-       pr_info("Detected %s I-cache on CPU%d\n", icache_policy_str[l1ip], cpu);
+       pr_info("Detected %s I-cache on CPU%d\n", icache_policy_str(l1ip), cpu);
 }
 
 static void __cpuinfo_store_cpu_32bit(struct cpuinfo_32bit *info)
@@ -418,14 +439,6 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info)
        if (id_aa64pfr0_32bit_el0(info->reg_id_aa64pfr0))
                __cpuinfo_store_cpu_32bit(&info->aarch32);
 
-       if (IS_ENABLED(CONFIG_ARM64_SVE) &&
-           id_aa64pfr0_sve(info->reg_id_aa64pfr0))
-               info->reg_zcr = read_zcr_features();
-
-       if (IS_ENABLED(CONFIG_ARM64_SME) &&
-           id_aa64pfr1_sme(info->reg_id_aa64pfr1))
-               info->reg_smcr = read_smcr_features();
-
        cpuinfo_detect_icache_policy(info);
 }
 
index 5b82b9292400539a627918eb41acae0b866357a9..254fe31c03a07d048c41e2156a95aff997d68d06 100644 (file)
@@ -636,18 +636,28 @@ alternative_else_nop_endif
         */
        .endm
 
-       .macro tramp_data_page  dst
-       adr_l   \dst, .entry.tramp.text
-       sub     \dst, \dst, PAGE_SIZE
-       .endm
-
-       .macro tramp_data_read_var      dst, var
-#ifdef CONFIG_RANDOMIZE_BASE
-       tramp_data_page         \dst
-       add     \dst, \dst, #:lo12:__entry_tramp_data_\var
-       ldr     \dst, [\dst]
+       .macro          tramp_data_read_var     dst, var
+#ifdef CONFIG_RELOCATABLE
+       ldr             \dst, .L__tramp_data_\var
+       .ifndef         .L__tramp_data_\var
+       .pushsection    ".entry.tramp.rodata", "a", %progbits
+       .align          3
+.L__tramp_data_\var:
+       .quad           \var
+       .popsection
+       .endif
 #else
-       ldr     \dst, =\var
+       /*
+        * As !RELOCATABLE implies !RANDOMIZE_BASE the address is always a
+        * compile time constant (and hence not secret and not worth hiding).
+        *
+        * As statically allocated kernel code and data always live in the top
+        * 47 bits of the address space we can sign-extend bit 47 and avoid an
+        * instruction to load the upper 16 bits (which must be 0xFFFF).
+        */
+       movz            \dst, :abs_g2_s:\var
+       movk            \dst, :abs_g1_nc:\var
+       movk            \dst, :abs_g0_nc:\var
 #endif
        .endm
 
@@ -695,7 +705,7 @@ alternative_else_nop_endif
        msr     vbar_el1, x30
        isb
        .else
-       ldr     x30, =vectors
+       adr_l   x30, vectors
        .endif // \kpti == 1
 
        .if     \bhb == BHB_MITIGATION_FW
@@ -764,24 +774,7 @@ SYM_CODE_END(tramp_exit_native)
 SYM_CODE_START(tramp_exit_compat)
        tramp_exit      32
 SYM_CODE_END(tramp_exit_compat)
-
-       .ltorg
        .popsection                             // .entry.tramp.text
-#ifdef CONFIG_RANDOMIZE_BASE
-       .pushsection ".rodata", "a"
-       .align PAGE_SHIFT
-SYM_DATA_START(__entry_tramp_data_start)
-__entry_tramp_data_vectors:
-       .quad   vectors
-#ifdef CONFIG_ARM_SDE_INTERFACE
-__entry_tramp_data___sdei_asm_handler:
-       .quad   __sdei_asm_handler
-#endif /* CONFIG_ARM_SDE_INTERFACE */
-__entry_tramp_data_this_cpu_vector:
-       .quad   this_cpu_vector
-SYM_DATA_END(__entry_tramp_data_start)
-       .popsection                             // .rodata
-#endif /* CONFIG_RANDOMIZE_BASE */
 #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
 
 /*
@@ -932,7 +925,6 @@ NOKPROBE(call_on_irq_stack)
  * This clobbers x4, __sdei_handler() will restore this from firmware's
  * copy.
  */
-.ltorg
 .pushsection ".entry.tramp.text", "ax"
 SYM_CODE_START(__sdei_asm_entry_trampoline)
        mrs     x4, ttbr1_el1
@@ -967,7 +959,6 @@ SYM_CODE_START(__sdei_asm_exit_trampoline)
 1:     sdei_handler_exit exit_mode=x2
 SYM_CODE_END(__sdei_asm_exit_trampoline)
 NOKPROBE(__sdei_asm_exit_trampoline)
-       .ltorg
 .popsection            // .entry.tramp.text
 #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
 
index aecf3071efdddfbe9301ed7984610cc2335a49ca..dd63ffc3a2fa2782823fec804c8327405c69a4cd 100644 (file)
@@ -445,7 +445,6 @@ static void fpsimd_save(void)
 
        if (system_supports_sme()) {
                u64 *svcr = last->svcr;
-               *svcr = read_sysreg_s(SYS_SVCR);
 
                *svcr = read_sysreg_s(SYS_SVCR);
 
index 6a98f1a38c29a14035be461293b52f2f1cf4b48f..cefe6a73ee546c26e8971bce4abf4b01f6e5f96d 100644 (file)
@@ -37,8 +37,6 @@
 
 #include "efi-header.S"
 
-#define __PHYS_OFFSET  KERNEL_START
-
 #if (PAGE_OFFSET & 0x1fffff) != 0
 #error PAGE_OFFSET must be at least 2MB aligned
 #endif
@@ -51,9 +49,6 @@
  *   MMU = off, D-cache = off, I-cache = on or off,
  *   x0 = physical address to the FDT blob.
  *
- * This code is mostly position independent so you call this at
- * __pa(PAGE_OFFSET).
- *
  * Note that the callee-saved registers are used for storing variables
  * that are useful before the MMU is enabled. The allocations are described
  * in the entry routines.
         * primary lowlevel boot path:
         *
         *  Register   Scope                      Purpose
+        *  x20        primary_entry() .. __primary_switch()    CPU boot mode
         *  x21        primary_entry() .. start_kernel()        FDT pointer passed at boot in x0
+        *  x22        create_idmap() .. start_kernel()         ID map VA of the DT blob
         *  x23        primary_entry() .. start_kernel()        physical misalignment/KASLR offset
-        *  x28        __create_page_tables()                   callee preserved temp register
-        *  x19/x20    __primary_switch()                       callee preserved temp registers
-        *  x24        __primary_switch() .. relocate_kernel()  current RELR displacement
+        *  x24        __primary_switch()                       linear map KASLR seed
+        *  x25        primary_entry() .. start_kernel()        supported VA size
+        *  x28        create_idmap()                           callee preserved temp register
         */
 SYM_CODE_START(primary_entry)
        bl      preserve_boot_args
        bl      init_kernel_el                  // w0=cpu_boot_mode
-       adrp    x23, __PHYS_OFFSET
-       and     x23, x23, MIN_KIMG_ALIGN - 1    // KASLR offset, defaults to 0
-       bl      set_cpu_boot_mode_flag
-       bl      __create_page_tables
+       mov     x20, x0
+       bl      create_idmap
+
        /*
         * The following calls CPU setup code, see arch/arm64/mm/proc.S for
         * details.
         * On return, the CPU will be ready for the MMU to be turned on and
         * the TCR will have been set.
         */
+#if VA_BITS > 48
+       mrs_s   x0, SYS_ID_AA64MMFR2_EL1
+       tst     x0, #0xf << ID_AA64MMFR2_LVA_SHIFT
+       mov     x0, #VA_BITS
+       mov     x25, #VA_BITS_MIN
+       csel    x25, x25, x0, eq
+       mov     x0, x25
+#endif
        bl      __cpu_setup                     // initialise processor
        b       __primary_switch
 SYM_CODE_END(primary_entry)
@@ -122,28 +126,16 @@ SYM_CODE_START_LOCAL(preserve_boot_args)
        b       dcache_inval_poc                // tail call
 SYM_CODE_END(preserve_boot_args)
 
-/*
- * Macro to create a table entry to the next page.
- *
- *     tbl:    page table address
- *     virt:   virtual address
- *     shift:  #imm page table shift
- *     ptrs:   #imm pointers per table page
- *
- * Preserves:  virt
- * Corrupts:   ptrs, tmp1, tmp2
- * Returns:    tbl -> next level table page address
- */
-       .macro  create_table_entry, tbl, virt, shift, ptrs, tmp1, tmp2
-       add     \tmp1, \tbl, #PAGE_SIZE
-       phys_to_pte \tmp2, \tmp1
-       orr     \tmp2, \tmp2, #PMD_TYPE_TABLE   // address of next table and entry type
-       lsr     \tmp1, \virt, #\shift
-       sub     \ptrs, \ptrs, #1
-       and     \tmp1, \tmp1, \ptrs             // table index
-       str     \tmp2, [\tbl, \tmp1, lsl #3]
-       add     \tbl, \tbl, #PAGE_SIZE          // next level table page
-       .endm
+SYM_FUNC_START_LOCAL(clear_page_tables)
+       /*
+        * Clear the init page tables.
+        */
+       adrp    x0, init_pg_dir
+       adrp    x1, init_pg_end
+       sub     x2, x1, x0
+       mov     x1, xzr
+       b       __pi_memset                     // tail call
+SYM_FUNC_END(clear_page_tables)
 
 /*
  * Macro to populate page table entries, these entries can be pointers to the next level
@@ -179,31 +171,20 @@ SYM_CODE_END(preserve_boot_args)
  *     vstart: virtual address of start of range
  *     vend:   virtual address of end of range - we map [vstart, vend]
  *     shift:  shift used to transform virtual address into index
- *     ptrs:   number of entries in page table
+ *     order:  #imm 2log(number of entries in page table)
  *     istart: index in table corresponding to vstart
  *     iend:   index in table corresponding to vend
  *     count:  On entry: how many extra entries were required in previous level, scales
  *                       our end index.
  *             On exit: returns how many extra entries required for next page table level
  *
- * Preserves:  vstart, vend, shift, ptrs
+ * Preserves:  vstart, vend
  * Returns:    istart, iend, count
  */
-       .macro compute_indices, vstart, vend, shift, ptrs, istart, iend, count
-       lsr     \iend, \vend, \shift
-       mov     \istart, \ptrs
-       sub     \istart, \istart, #1
-       and     \iend, \iend, \istart   // iend = (vend >> shift) & (ptrs - 1)
-       mov     \istart, \ptrs
-       mul     \istart, \istart, \count
-       add     \iend, \iend, \istart   // iend += count * ptrs
-                                       // our entries span multiple tables
-
-       lsr     \istart, \vstart, \shift
-       mov     \count, \ptrs
-       sub     \count, \count, #1
-       and     \istart, \istart, \count
-
+       .macro compute_indices, vstart, vend, shift, order, istart, iend, count
+       ubfx    \istart, \vstart, \shift, \order
+       ubfx    \iend, \vend, \shift, \order
+       add     \iend, \iend, \count, lsl \order
        sub     \count, \iend, \istart
        .endm
 
@@ -218,119 +199,116 @@ SYM_CODE_END(preserve_boot_args)
  *     vend:   virtual address of end of range - we map [vstart, vend - 1]
  *     flags:  flags to use to map last level entries
  *     phys:   physical address corresponding to vstart - physical memory is contiguous
- *     pgds:   the number of pgd entries
+ *     order:  #imm 2log(number of entries in PGD table)
+ *
+ * If extra_shift is set, an extra level will be populated if the end address does
+ * not fit in 'extra_shift' bits. This assumes vend is in the TTBR0 range.
  *
  * Temporaries:        istart, iend, tmp, count, sv - these need to be different registers
  * Preserves:  vstart, flags
  * Corrupts:   tbl, rtbl, vend, istart, iend, tmp, count, sv
  */
-       .macro map_memory, tbl, rtbl, vstart, vend, flags, phys, pgds, istart, iend, tmp, count, sv
+       .macro map_memory, tbl, rtbl, vstart, vend, flags, phys, order, istart, iend, tmp, count, sv, extra_shift
        sub \vend, \vend, #1
        add \rtbl, \tbl, #PAGE_SIZE
-       mov \sv, \rtbl
        mov \count, #0
-       compute_indices \vstart, \vend, #PGDIR_SHIFT, \pgds, \istart, \iend, \count
+
+       .ifnb   \extra_shift
+       tst     \vend, #~((1 << (\extra_shift)) - 1)
+       b.eq    .L_\@
+       compute_indices \vstart, \vend, #\extra_shift, #(PAGE_SHIFT - 3), \istart, \iend, \count
+       mov \sv, \rtbl
        populate_entries \tbl, \rtbl, \istart, \iend, #PMD_TYPE_TABLE, #PAGE_SIZE, \tmp
        mov \tbl, \sv
+       .endif
+.L_\@:
+       compute_indices \vstart, \vend, #PGDIR_SHIFT, #\order, \istart, \iend, \count
        mov \sv, \rtbl
+       populate_entries \tbl, \rtbl, \istart, \iend, #PMD_TYPE_TABLE, #PAGE_SIZE, \tmp
+       mov \tbl, \sv
 
 #if SWAPPER_PGTABLE_LEVELS > 3
-       compute_indices \vstart, \vend, #PUD_SHIFT, #PTRS_PER_PUD, \istart, \iend, \count
+       compute_indices \vstart, \vend, #PUD_SHIFT, #(PAGE_SHIFT - 3), \istart, \iend, \count
+       mov \sv, \rtbl
        populate_entries \tbl, \rtbl, \istart, \iend, #PMD_TYPE_TABLE, #PAGE_SIZE, \tmp
        mov \tbl, \sv
-       mov \sv, \rtbl
 #endif
 
 #if SWAPPER_PGTABLE_LEVELS > 2
-       compute_indices \vstart, \vend, #SWAPPER_TABLE_SHIFT, #PTRS_PER_PMD, \istart, \iend, \count
+       compute_indices \vstart, \vend, #SWAPPER_TABLE_SHIFT, #(PAGE_SHIFT - 3), \istart, \iend, \count
+       mov \sv, \rtbl
        populate_entries \tbl, \rtbl, \istart, \iend, #PMD_TYPE_TABLE, #PAGE_SIZE, \tmp
        mov \tbl, \sv
 #endif
 
-       compute_indices \vstart, \vend, #SWAPPER_BLOCK_SHIFT, #PTRS_PER_PTE, \istart, \iend, \count
-       bic \count, \phys, #SWAPPER_BLOCK_SIZE - 1
-       populate_entries \tbl, \count, \istart, \iend, \flags, #SWAPPER_BLOCK_SIZE, \tmp
+       compute_indices \vstart, \vend, #SWAPPER_BLOCK_SHIFT, #(PAGE_SHIFT - 3), \istart, \iend, \count
+       bic \rtbl, \phys, #SWAPPER_BLOCK_SIZE - 1
+       populate_entries \tbl, \rtbl, \istart, \iend, \flags, #SWAPPER_BLOCK_SIZE, \tmp
        .endm
 
 /*
- * Setup the initial page tables. We only setup the barest amount which is
- * required to get the kernel running. The following sections are required:
- *   - identity mapping to enable the MMU (low address, TTBR0)
- *   - first few MB of the kernel linear mapping to jump to once the MMU has
- *     been enabled
+ * Remap a subregion created with the map_memory macro with modified attributes
+ * or output address. The entire remapped region must have been covered in the
+ * invocation of map_memory.
+ *
+ * x0: last level table address (returned in first argument to map_memory)
+ * x1: start VA of the existing mapping
+ * x2: start VA of the region to update
+ * x3: end VA of the region to update (exclusive)
+ * x4: start PA associated with the region to update
+ * x5: attributes to set on the updated region
+ * x6: order of the last level mappings
  */
-SYM_FUNC_START_LOCAL(__create_page_tables)
-       mov     x28, lr
+SYM_FUNC_START_LOCAL(remap_region)
+       sub     x3, x3, #1              // make end inclusive
 
-       /*
-        * Invalidate the init page tables to avoid potential dirty cache lines
-        * being evicted. Other page tables are allocated in rodata as part of
-        * the kernel image, and thus are clean to the PoC per the boot
-        * protocol.
-        */
-       adrp    x0, init_pg_dir
-       adrp    x1, init_pg_end
-       bl      dcache_inval_poc
+       // Get the index offset for the start of the last level table
+       lsr     x1, x1, x6
+       bfi     x1, xzr, #0, #PAGE_SHIFT - 3
 
-       /*
-        * Clear the init page tables.
-        */
-       adrp    x0, init_pg_dir
-       adrp    x1, init_pg_end
-       sub     x1, x1, x0
-1:     stp     xzr, xzr, [x0], #16
-       stp     xzr, xzr, [x0], #16
-       stp     xzr, xzr, [x0], #16
-       stp     xzr, xzr, [x0], #16
-       subs    x1, x1, #64
-       b.ne    1b
+       // Derive the start and end indexes into the last level table
+       // associated with the provided region
+       lsr     x2, x2, x6
+       lsr     x3, x3, x6
+       sub     x2, x2, x1
+       sub     x3, x3, x1
 
-       mov     x7, SWAPPER_MM_MMUFLAGS
+       mov     x1, #1
+       lsl     x6, x1, x6              // block size at this level
 
-       /*
-        * Create the identity mapping.
-        */
-       adrp    x0, idmap_pg_dir
-       adrp    x3, __idmap_text_start          // __pa(__idmap_text_start)
-
-#ifdef CONFIG_ARM64_VA_BITS_52
-       mrs_s   x6, SYS_ID_AA64MMFR2_EL1
-       and     x6, x6, #(0xf << ID_AA64MMFR2_LVA_SHIFT)
-       mov     x5, #52
-       cbnz    x6, 1f
-#endif
-       mov     x5, #VA_BITS_MIN
-1:
-       adr_l   x6, vabits_actual
-       str     x5, [x6]
-       dmb     sy
-       dc      ivac, x6                // Invalidate potentially stale cache line
+       populate_entries x0, x4, x2, x3, x5, x6, x7
+       ret
+SYM_FUNC_END(remap_region)
 
+SYM_FUNC_START_LOCAL(create_idmap)
+       mov     x28, lr
        /*
-        * VA_BITS may be too small to allow for an ID mapping to be created
-        * that covers system RAM if that is located sufficiently high in the
-        * physical address space. So for the ID map, use an extended virtual
-        * range in that case, and configure an additional translation level
-        * if needed.
+        * The ID map carries a 1:1 mapping of the physical address range
+        * covered by the loaded image, which could be anywhere in DRAM. This
+        * means that the required size of the VA (== PA) space is decided at
+        * boot time, and could be more than the configured size of the VA
+        * space for ordinary kernel and user space mappings.
+        *
+        * There are three cases to consider here:
+        * - 39 <= VA_BITS < 48, and the ID map needs up to 48 VA bits to cover
+        *   the placement of the image. In this case, we configure one extra
+        *   level of translation on the fly for the ID map only. (This case
+        *   also covers 42-bit VA/52-bit PA on 64k pages).
         *
-        * Calculate the maximum allowed value for TCR_EL1.T0SZ so that the
-        * entire ID map region can be mapped. As T0SZ == (64 - #bits used),
-        * this number conveniently equals the number of leading zeroes in
-        * the physical address of __idmap_text_end.
+        * - VA_BITS == 48, and the ID map needs more than 48 VA bits. This can
+        *   only happen when using 64k pages, in which case we need to extend
+        *   the root level table rather than add a level. Note that we can
+        *   treat this case as 'always extended' as long as we take care not
+        *   to program an unsupported T0SZ value into the TCR register.
+        *
+        * - Combinations that would require two additional levels of
+        *   translation are not supported, e.g., VA_BITS==36 on 16k pages, or
+        *   VA_BITS==39/4k pages with 5-level paging, where the input address
+        *   requires more than 47 or 48 bits, respectively.
         */
-       adrp    x5, __idmap_text_end
-       clz     x5, x5
-       cmp     x5, TCR_T0SZ(VA_BITS_MIN) // default T0SZ small enough?
-       b.ge    1f                      // .. then skip VA range extension
-
-       adr_l   x6, idmap_t0sz
-       str     x5, [x6]
-       dmb     sy
-       dc      ivac, x6                // Invalidate potentially stale cache line
-
 #if (VA_BITS < 48)
+#define IDMAP_PGD_ORDER        (VA_BITS - PGDIR_SHIFT)
 #define EXTRA_SHIFT    (PGDIR_SHIFT + PAGE_SHIFT - 3)
-#define EXTRA_PTRS     (1 << (PHYS_MASK_SHIFT - EXTRA_SHIFT))
 
        /*
         * If VA_BITS < 48, we have to configure an additional table level.
@@ -342,36 +320,40 @@ SYM_FUNC_START_LOCAL(__create_page_tables)
 #if VA_BITS != EXTRA_SHIFT
 #error "Mismatch between VA_BITS and page size/number of translation levels"
 #endif
-
-       mov     x4, EXTRA_PTRS
-       create_table_entry x0, x3, EXTRA_SHIFT, x4, x5, x6
 #else
+#define IDMAP_PGD_ORDER        (PHYS_MASK_SHIFT - PGDIR_SHIFT)
+#define EXTRA_SHIFT
        /*
         * If VA_BITS == 48, we don't have to configure an additional
         * translation level, but the top-level table has more entries.
         */
-       mov     x4, #1 << (PHYS_MASK_SHIFT - PGDIR_SHIFT)
-       str_l   x4, idmap_ptrs_per_pgd, x5
 #endif
-1:
-       ldr_l   x4, idmap_ptrs_per_pgd
-       adr_l   x6, __idmap_text_end            // __pa(__idmap_text_end)
-
-       map_memory x0, x1, x3, x6, x7, x3, x4, x10, x11, x12, x13, x14
-
-       /*
-        * Map the kernel image (starting with PHYS_OFFSET).
-        */
-       adrp    x0, init_pg_dir
-       mov_q   x5, KIMAGE_VADDR                // compile time __va(_text)
-       add     x5, x5, x23                     // add KASLR displacement
-       mov     x4, PTRS_PER_PGD
-       adrp    x6, _end                        // runtime __pa(_end)
-       adrp    x3, _text                       // runtime __pa(_text)
-       sub     x6, x6, x3                      // _end - _text
-       add     x6, x6, x5                      // runtime __va(_end)
-
-       map_memory x0, x1, x5, x6, x7, x3, x4, x10, x11, x12, x13, x14
+       adrp    x0, init_idmap_pg_dir
+       adrp    x3, _text
+       adrp    x6, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE
+       mov     x7, SWAPPER_RX_MMUFLAGS
+
+       map_memory x0, x1, x3, x6, x7, x3, IDMAP_PGD_ORDER, x10, x11, x12, x13, x14, EXTRA_SHIFT
+
+       /* Remap the kernel page tables r/w in the ID map */
+       adrp    x1, _text
+       adrp    x2, init_pg_dir
+       adrp    x3, init_pg_end
+       bic     x4, x2, #SWAPPER_BLOCK_SIZE - 1
+       mov     x5, SWAPPER_RW_MMUFLAGS
+       mov     x6, #SWAPPER_BLOCK_SHIFT
+       bl      remap_region
+
+       /* Remap the FDT after the kernel image */
+       adrp    x1, _text
+       adrp    x22, _end + SWAPPER_BLOCK_SIZE
+       bic     x2, x22, #SWAPPER_BLOCK_SIZE - 1
+       bfi     x22, x21, #0, #SWAPPER_BLOCK_SHIFT              // remapped FDT address
+       add     x3, x2, #MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE
+       bic     x4, x21, #SWAPPER_BLOCK_SIZE - 1
+       mov     x5, SWAPPER_RW_MMUFLAGS
+       mov     x6, #SWAPPER_BLOCK_SHIFT
+       bl      remap_region
 
        /*
         * Since the page tables have been populated with non-cacheable
@@ -380,16 +362,27 @@ SYM_FUNC_START_LOCAL(__create_page_tables)
         */
        dmb     sy
 
-       adrp    x0, idmap_pg_dir
-       adrp    x1, idmap_pg_end
+       adrp    x0, init_idmap_pg_dir
+       adrp    x1, init_idmap_pg_end
        bl      dcache_inval_poc
+       ret     x28
+SYM_FUNC_END(create_idmap)
 
+SYM_FUNC_START_LOCAL(create_kernel_mapping)
        adrp    x0, init_pg_dir
-       adrp    x1, init_pg_end
-       bl      dcache_inval_poc
+       mov_q   x5, KIMAGE_VADDR                // compile time __va(_text)
+       add     x5, x5, x23                     // add KASLR displacement
+       adrp    x6, _end                        // runtime __pa(_end)
+       adrp    x3, _text                       // runtime __pa(_text)
+       sub     x6, x6, x3                      // _end - _text
+       add     x6, x6, x5                      // runtime __va(_end)
+       mov     x7, SWAPPER_RW_MMUFLAGS
 
-       ret     x28
-SYM_FUNC_END(__create_page_tables)
+       map_memory x0, x1, x5, x6, x7, x3, (VA_BITS - PGDIR_SHIFT), x10, x11, x12, x13, x14
+
+       dsb     ishst                           // sync with page table walker
+       ret
+SYM_FUNC_END(create_kernel_mapping)
 
        /*
         * Initialize CPU registers with task-specific and cpu-specific context.
@@ -420,7 +413,7 @@ SYM_FUNC_END(__create_page_tables)
 /*
  * The following fragment of code is executed with the MMU enabled.
  *
- *   x0 = __PHYS_OFFSET
+ *   x0 = __pa(KERNEL_START)
  */
 SYM_FUNC_START_LOCAL(__primary_switched)
        adr_l   x4, init_task
@@ -439,6 +432,9 @@ SYM_FUNC_START_LOCAL(__primary_switched)
        sub     x4, x4, x0                      // the kernel virtual and
        str_l   x4, kimage_voffset, x5          // physical mappings
 
+       mov     x0, x20
+       bl      set_cpu_boot_mode_flag
+
        // Clear BSS
        adr_l   x0, __bss_start
        mov     x1, xzr
@@ -447,35 +443,30 @@ SYM_FUNC_START_LOCAL(__primary_switched)
        bl      __pi_memset
        dsb     ishst                           // Make zero page visible to PTW
 
+#if VA_BITS > 48
+       adr_l   x8, vabits_actual               // Set this early so KASAN early init
+       str     x25, [x8]                       // ... observes the correct value
+       dc      civac, x8                       // Make visible to booting secondaries
+#endif
+
+#ifdef CONFIG_RANDOMIZE_BASE
+       adrp    x5, memstart_offset_seed        // Save KASLR linear map seed
+       strh    w24, [x5, :lo12:memstart_offset_seed]
+#endif
 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
        bl      kasan_early_init
 #endif
        mov     x0, x21                         // pass FDT address in x0
        bl      early_fdt_map                   // Try mapping the FDT early
+       mov     x0, x20                         // pass the full boot status
        bl      init_feature_override           // Parse cpu feature overrides
-#ifdef CONFIG_RANDOMIZE_BASE
-       tst     x23, ~(MIN_KIMG_ALIGN - 1)      // already running randomized?
-       b.ne    0f
-       bl      kaslr_early_init                // parse FDT for KASLR options
-       cbz     x0, 0f                          // KASLR disabled? just proceed
-       orr     x23, x23, x0                    // record KASLR offset
-       ldp     x29, x30, [sp], #16             // we must enable KASLR, return
-       ret                                     // to __primary_switch()
-0:
-#endif
-       bl      switch_to_vhe                   // Prefer VHE if possible
+       mov     x0, x20
+       bl      finalise_el2                    // Prefer VHE if possible
        ldp     x29, x30, [sp], #16
        bl      start_kernel
        ASM_BUG()
 SYM_FUNC_END(__primary_switched)
 
-       .pushsection ".rodata", "a"
-SYM_DATA_START(kimage_vaddr)
-       .quad           _text
-SYM_DATA_END(kimage_vaddr)
-EXPORT_SYMBOL(kimage_vaddr)
-       .popsection
-
 /*
  * end early head section, begin head code that is also used for
  * hotplug and needs to have the same protections as the text region
@@ -490,8 +481,9 @@ EXPORT_SYMBOL(kimage_vaddr)
  * Since we cannot always rely on ERET synchronizing writes to sysregs (e.g. if
  * SCTLR_ELx.EOS is clear), we place an ISB prior to ERET.
  *
- * Returns either BOOT_CPU_MODE_EL1 or BOOT_CPU_MODE_EL2 in w0 if
- * booted in EL1 or EL2 respectively.
+ * Returns either BOOT_CPU_MODE_EL1 or BOOT_CPU_MODE_EL2 in x0 if
+ * booted in EL1 or EL2 respectively, with the top 32 bits containing
+ * potential context flags. These flags are *not* stored in __boot_cpu_mode.
  */
 SYM_FUNC_START(init_kernel_el)
        mrs     x0, CurrentEL
@@ -520,6 +512,8 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL)
        msr     vbar_el2, x0
        isb
 
+       mov_q   x1, INIT_SCTLR_EL1_MMU_OFF
+
        /*
         * Fruity CPUs seem to have HCR_EL2.E2H set to RES1,
         * making it impossible to start in nVHE mode. Is that
@@ -529,34 +523,19 @@ SYM_INNER_LABEL(init_el2, SYM_L_LOCAL)
        and     x0, x0, #HCR_E2H
        cbz     x0, 1f
 
-       /* Switching to VHE requires a sane SCTLR_EL1 as a start */
-       mov_q   x0, INIT_SCTLR_EL1_MMU_OFF
-       msr_s   SYS_SCTLR_EL12, x0
-
-       /*
-        * Force an eret into a helper "function", and let it return
-        * to our original caller... This makes sure that we have
-        * initialised the basic PSTATE state.
-        */
-       mov     x0, #INIT_PSTATE_EL2
-       msr     spsr_el1, x0
-       adr     x0, __cpu_stick_to_vhe
-       msr     elr_el1, x0
-       eret
+       /* Set a sane SCTLR_EL1, the VHE way */
+       msr_s   SYS_SCTLR_EL12, x1
+       mov     x2, #BOOT_CPU_FLAG_E2H
+       b       2f
 
 1:
-       mov_q   x0, INIT_SCTLR_EL1_MMU_OFF
-       msr     sctlr_el1, x0
-
+       msr     sctlr_el1, x1
+       mov     x2, xzr
+2:
        msr     elr_el2, lr
        mov     w0, #BOOT_CPU_MODE_EL2
+       orr     x0, x0, x2
        eret
-
-__cpu_stick_to_vhe:
-       mov     x0, #HVC_VHE_RESTART
-       hvc     #0
-       mov     x0, #BOOT_CPU_MODE_EL2
-       ret
 SYM_FUNC_END(init_kernel_el)
 
 /*
@@ -569,52 +548,21 @@ SYM_FUNC_START_LOCAL(set_cpu_boot_mode_flag)
        b.ne    1f
        add     x1, x1, #4
 1:     str     w0, [x1]                        // Save CPU boot mode
-       dmb     sy
-       dc      ivac, x1                        // Invalidate potentially stale cache line
        ret
 SYM_FUNC_END(set_cpu_boot_mode_flag)
 
-/*
- * These values are written with the MMU off, but read with the MMU on.
- * Writers will invalidate the corresponding address, discarding up to a
- * 'Cache Writeback Granule' (CWG) worth of data. The linker script ensures
- * sufficient alignment that the CWG doesn't overlap another section.
- */
-       .pushsection ".mmuoff.data.write", "aw"
-/*
- * We need to find out the CPU boot mode long after boot, so we need to
- * store it in a writable variable.
- *
- * This is not in .bss, because we set it sufficiently early that the boot-time
- * zeroing of .bss would clobber it.
- */
-SYM_DATA_START(__boot_cpu_mode)
-       .long   BOOT_CPU_MODE_EL2
-       .long   BOOT_CPU_MODE_EL1
-SYM_DATA_END(__boot_cpu_mode)
-/*
- * The booting CPU updates the failed status @__early_cpu_boot_status,
- * with MMU turned off.
- */
-SYM_DATA_START(__early_cpu_boot_status)
-       .quad   0
-SYM_DATA_END(__early_cpu_boot_status)
-
-       .popsection
-
        /*
         * This provides a "holding pen" for platforms to hold all secondary
         * cores are held until we're ready for them to initialise.
         */
 SYM_FUNC_START(secondary_holding_pen)
        bl      init_kernel_el                  // w0=cpu_boot_mode
-       bl      set_cpu_boot_mode_flag
-       mrs     x0, mpidr_el1
+       mrs     x2, mpidr_el1
        mov_q   x1, MPIDR_HWID_BITMASK
-       and     x0, x0, x1
+       and     x2, x2, x1
        adr_l   x3, secondary_holding_pen_release
 pen:   ldr     x4, [x3]
-       cmp     x4, x0
+       cmp     x4, x2
        b.eq    secondary_startup
        wfe
        b       pen
@@ -626,7 +574,6 @@ SYM_FUNC_END(secondary_holding_pen)
         */
 SYM_FUNC_START(secondary_entry)
        bl      init_kernel_el                  // w0=cpu_boot_mode
-       bl      set_cpu_boot_mode_flag
        b       secondary_startup
 SYM_FUNC_END(secondary_entry)
 
@@ -634,16 +581,24 @@ SYM_FUNC_START_LOCAL(secondary_startup)
        /*
         * Common entry point for secondary CPUs.
         */
-       bl      switch_to_vhe
+       mov     x20, x0                         // preserve boot mode
+       bl      finalise_el2
        bl      __cpu_secondary_check52bitva
+#if VA_BITS > 48
+       ldr_l   x0, vabits_actual
+#endif
        bl      __cpu_setup                     // initialise processor
        adrp    x1, swapper_pg_dir
+       adrp    x2, idmap_pg_dir
        bl      __enable_mmu
        ldr     x8, =__secondary_switched
        br      x8
 SYM_FUNC_END(secondary_startup)
 
 SYM_FUNC_START_LOCAL(__secondary_switched)
+       mov     x0, x20
+       bl      set_cpu_boot_mode_flag
+       str_l   xzr, __early_cpu_boot_status, x3
        adr_l   x5, vectors
        msr     vbar_el1, x5
        isb
@@ -691,6 +646,7 @@ SYM_FUNC_END(__secondary_too_slow)
  *
  *  x0  = SCTLR_EL1 value for turning on the MMU.
  *  x1  = TTBR1_EL1 value
+ *  x2  = ID map root table address
  *
  * Returns to the caller via x30/lr. This requires the caller to be covered
  * by the .idmap.text section.
@@ -699,20 +655,15 @@ SYM_FUNC_END(__secondary_too_slow)
  * If it isn't, park the CPU
  */
 SYM_FUNC_START(__enable_mmu)
-       mrs     x2, ID_AA64MMFR0_EL1
-       ubfx    x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4
-       cmp     x2, #ID_AA64MMFR0_TGRAN_SUPPORTED_MIN
+       mrs     x3, ID_AA64MMFR0_EL1
+       ubfx    x3, x3, #ID_AA64MMFR0_TGRAN_SHIFT, 4
+       cmp     x3, #ID_AA64MMFR0_TGRAN_SUPPORTED_MIN
        b.lt    __no_granule_support
-       cmp     x2, #ID_AA64MMFR0_TGRAN_SUPPORTED_MAX
+       cmp     x3, #ID_AA64MMFR0_TGRAN_SUPPORTED_MAX
        b.gt    __no_granule_support
-       update_early_cpu_boot_status 0, x2, x3
-       adrp    x2, idmap_pg_dir
-       phys_to_ttbr x1, x1
        phys_to_ttbr x2, x2
        msr     ttbr0_el1, x2                   // load TTBR0
-       offset_ttbr1 x1, x3
-       msr     ttbr1_el1, x1                   // load TTBR1
-       isb
+       load_ttbr1 x1, x1, x3
 
        set_sctlr_el1   x0
 
@@ -720,7 +671,7 @@ SYM_FUNC_START(__enable_mmu)
 SYM_FUNC_END(__enable_mmu)
 
 SYM_FUNC_START(__cpu_secondary_check52bitva)
-#ifdef CONFIG_ARM64_VA_BITS_52
+#if VA_BITS > 48
        ldr_l   x0, vabits_actual
        cmp     x0, #52
        b.ne    2f
@@ -755,13 +706,10 @@ SYM_FUNC_START_LOCAL(__relocate_kernel)
         * Iterate over each entry in the relocation table, and apply the
         * relocations in place.
         */
-       ldr     w9, =__rela_offset              // offset to reloc table
-       ldr     w10, =__rela_size               // size of reloc table
-
+       adr_l   x9, __rela_start
+       adr_l   x10, __rela_end
        mov_q   x11, KIMAGE_VADDR               // default virtual offset
        add     x11, x11, x23                   // actual virtual offset
-       add     x9, x9, x11                     // __va(.rela)
-       add     x10, x9, x10                    // __va(.rela) + sizeof(.rela)
 
 0:     cmp     x9, x10
        b.hs    1f
@@ -804,21 +752,9 @@ SYM_FUNC_START_LOCAL(__relocate_kernel)
         * entry in x9, the address being relocated by the current address or
         * bitmap entry in x13 and the address being relocated by the current
         * bit in x14.
-        *
-        * Because addends are stored in place in the binary, RELR relocations
-        * cannot be applied idempotently. We use x24 to keep track of the
-        * currently applied displacement so that we can correctly relocate if
-        * __relocate_kernel is called twice with non-zero displacements (i.e.
-        * if there is both a physical misalignment and a KASLR displacement).
         */
-       ldr     w9, =__relr_offset              // offset to reloc table
-       ldr     w10, =__relr_size               // size of reloc table
-       add     x9, x9, x11                     // __va(.relr)
-       add     x10, x9, x10                    // __va(.relr) + sizeof(.relr)
-
-       sub     x15, x23, x24                   // delta from previous offset
-       cbz     x15, 7f                         // nothing to do if unchanged
-       mov     x24, x23                        // save new offset
+       adr_l   x9, __relr_start
+       adr_l   x10, __relr_end
 
 2:     cmp     x9, x10
        b.hs    7f
@@ -826,7 +762,7 @@ SYM_FUNC_START_LOCAL(__relocate_kernel)
        tbnz    x11, #0, 3f                     // branch to handle bitmaps
        add     x13, x11, x23
        ldr     x12, [x13]                      // relocate address entry
-       add     x12, x12, x15
+       add     x12, x12, x23
        str     x12, [x13], #8                  // adjust to start of bitmap
        b       2b
 
@@ -835,7 +771,7 @@ SYM_FUNC_START_LOCAL(__relocate_kernel)
        cbz     x11, 6f
        tbz     x11, #0, 5f                     // skip bit if not set
        ldr     x12, [x14]                      // relocate bit
-       add     x12, x12, x15
+       add     x12, x12, x23
        str     x12, [x14]
 
 5:     add     x14, x14, #8                    // move to next bit's address
@@ -856,43 +792,32 @@ SYM_FUNC_END(__relocate_kernel)
 #endif
 
 SYM_FUNC_START_LOCAL(__primary_switch)
+       adrp    x1, reserved_pg_dir
+       adrp    x2, init_idmap_pg_dir
+       bl      __enable_mmu
+#ifdef CONFIG_RELOCATABLE
+       adrp    x23, KERNEL_START
+       and     x23, x23, MIN_KIMG_ALIGN - 1
 #ifdef CONFIG_RANDOMIZE_BASE
-       mov     x19, x0                         // preserve new SCTLR_EL1 value
-       mrs     x20, sctlr_el1                  // preserve old SCTLR_EL1 value
+       mov     x0, x22
+       adrp    x1, init_pg_end
+       mov     sp, x1
+       mov     x29, xzr
+       bl      __pi_kaslr_early_init
+       and     x24, x0, #SZ_2M - 1             // capture memstart offset seed
+       bic     x0, x0, #SZ_2M - 1
+       orr     x23, x23, x0                    // record kernel offset
+#endif
 #endif
+       bl      clear_page_tables
+       bl      create_kernel_mapping
 
        adrp    x1, init_pg_dir
-       bl      __enable_mmu
+       load_ttbr1 x1, x1, x2
 #ifdef CONFIG_RELOCATABLE
-#ifdef CONFIG_RELR
-       mov     x24, #0                         // no RELR displacement yet
-#endif
        bl      __relocate_kernel
-#ifdef CONFIG_RANDOMIZE_BASE
-       ldr     x8, =__primary_switched
-       adrp    x0, __PHYS_OFFSET
-       blr     x8
-
-       /*
-        * If we return here, we have a KASLR displacement in x23 which we need
-        * to take into account by discarding the current kernel mapping and
-        * creating a new one.
-        */
-       pre_disable_mmu_workaround
-       msr     sctlr_el1, x20                  // disable the MMU
-       isb
-       bl      __create_page_tables            // recreate kernel mapping
-
-       tlbi    vmalle1                         // Remove any stale TLB entries
-       dsb     nsh
-       isb
-
-       set_sctlr_el1   x19                     // re-enable the MMU
-
-       bl      __relocate_kernel
-#endif
 #endif
        ldr     x8, =__primary_switched
-       adrp    x0, __PHYS_OFFSET
+       adrp    x0, KERNEL_START                // __pa(KERNEL_START)
        br      x8
 SYM_FUNC_END(__primary_switch)
index 2e248342476eaff93a95160aa80abfb3d1c6f63e..af5df48ba915b9274211f66c33f4e61fcbe89a1e 100644 (file)
@@ -300,11 +300,6 @@ static void swsusp_mte_restore_tags(void)
                unsigned long pfn = xa_state.xa_index;
                struct page *page = pfn_to_online_page(pfn);
 
-               /*
-                * It is not required to invoke page_kasan_tag_reset(page)
-                * at this point since the tags stored in page->flags are
-                * already restored.
-                */
                mte_restore_page_tags(page_address(page), tags);
 
                mte_free_tag_storage(tags);
index 43d212618834dd849bfa7adc1e1a810254928b93..12c7fad02ae517a1c17f999ce52a01669afedd8d 100644 (file)
 #include <asm/ptrace.h>
 #include <asm/virt.h>
 
+// Warning, hardcoded register allocation
+// This will clobber x1 and x2, and expect x1 to contain
+// the id register value as read from the HW
+.macro __check_override idreg, fld, width, pass, fail
+       ubfx    x1, x1, #\fld, #\width
+       cbz     x1, \fail
+
+       adr_l   x1, \idreg\()_override
+       ldr     x2, [x1, FTR_OVR_VAL_OFFSET]
+       ldr     x1, [x1, FTR_OVR_MASK_OFFSET]
+       ubfx    x2, x2, #\fld, #\width
+       ubfx    x1, x1, #\fld, #\width
+       cmp     x1, xzr
+       and     x2, x2, x1
+       csinv   x2, x2, xzr, ne
+       cbnz    x2, \pass
+       b       \fail
+.endm
+
+.macro check_override idreg, fld, pass, fail
+       mrs     x1, \idreg\()_el1
+       __check_override \idreg \fld 4 \pass \fail
+.endm
+
        .text
        .pushsection    .hyp.text, "ax"
 
@@ -51,8 +75,8 @@ SYM_CODE_START_LOCAL(elx_sync)
        msr     vbar_el2, x1
        b       9f
 
-1:     cmp     x0, #HVC_VHE_RESTART
-       b.eq    mutate_to_vhe
+1:     cmp     x0, #HVC_FINALISE_EL2
+       b.eq    __finalise_el2
 
 2:     cmp     x0, #HVC_SOFT_RESTART
        b.ne    3f
@@ -73,27 +97,67 @@ SYM_CODE_START_LOCAL(elx_sync)
        eret
 SYM_CODE_END(elx_sync)
 
-// nVHE? No way! Give me the real thing!
-SYM_CODE_START_LOCAL(mutate_to_vhe)
+SYM_CODE_START_LOCAL(__finalise_el2)
+       check_override id_aa64pfr0 ID_AA64PFR0_SVE_SHIFT .Linit_sve .Lskip_sve
+
+.Linit_sve:    /* SVE register access */
+       mrs     x0, cptr_el2                    // Disable SVE traps
+       bic     x0, x0, #CPTR_EL2_TZ
+       msr     cptr_el2, x0
+       isb
+       mov     x1, #ZCR_ELx_LEN_MASK           // SVE: Enable full vector
+       msr_s   SYS_ZCR_EL2, x1                 // length for EL1.
+
+.Lskip_sve:
+       check_override id_aa64pfr1 ID_AA64PFR1_SME_SHIFT .Linit_sme .Lskip_sme
+
+.Linit_sme:    /* SME register access and priority mapping */
+       mrs     x0, cptr_el2                    // Disable SME traps
+       bic     x0, x0, #CPTR_EL2_TSM
+       msr     cptr_el2, x0
+       isb
+
+       mrs     x1, sctlr_el2
+       orr     x1, x1, #SCTLR_ELx_ENTP2        // Disable TPIDR2 traps
+       msr     sctlr_el2, x1
+       isb
+
+       mov     x0, #0                          // SMCR controls
+
+       // Full FP in SM?
+       mrs_s   x1, SYS_ID_AA64SMFR0_EL1
+       __check_override id_aa64smfr0 ID_AA64SMFR0_EL1_FA64_SHIFT 1 .Linit_sme_fa64 .Lskip_sme_fa64
+
+.Linit_sme_fa64:
+       orr     x0, x0, SMCR_ELx_FA64_MASK
+.Lskip_sme_fa64:
+
+       orr     x0, x0, #SMCR_ELx_LEN_MASK      // Enable full SME vector
+       msr_s   SYS_SMCR_EL2, x0                // length for EL1.
+
+       mrs_s   x1, SYS_SMIDR_EL1               // Priority mapping supported?
+       ubfx    x1, x1, #SMIDR_EL1_SMPS_SHIFT, #1
+       cbz     x1, .Lskip_sme
+
+       msr_s   SYS_SMPRIMAP_EL2, xzr           // Make all priorities equal
+
+       mrs     x1, id_aa64mmfr1_el1            // HCRX_EL2 present?
+       ubfx    x1, x1, #ID_AA64MMFR1_HCX_SHIFT, #4
+       cbz     x1, .Lskip_sme
+
+       mrs_s   x1, SYS_HCRX_EL2
+       orr     x1, x1, #HCRX_EL2_SMPME_MASK    // Enable priority mapping
+       msr_s   SYS_HCRX_EL2, x1
+
+.Lskip_sme:
+
+       // nVHE? No way! Give me the real thing!
        // Sanity check: MMU *must* be off
        mrs     x1, sctlr_el2
        tbnz    x1, #0, 1f
 
        // Needs to be VHE capable, obviously
-       mrs     x1, id_aa64mmfr1_el1
-       ubfx    x1, x1, #ID_AA64MMFR1_VHE_SHIFT, #4
-       cbz     x1, 1f
-
-       // Check whether VHE is disabled from the command line
-       adr_l   x1, id_aa64mmfr1_override
-       ldr     x2, [x1, FTR_OVR_VAL_OFFSET]
-       ldr     x1, [x1, FTR_OVR_MASK_OFFSET]
-       ubfx    x2, x2, #ID_AA64MMFR1_VHE_SHIFT, #4
-       ubfx    x1, x1, #ID_AA64MMFR1_VHE_SHIFT, #4
-       cmp     x1, xzr
-       and     x2, x2, x1
-       csinv   x2, x2, xzr, ne
-       cbnz    x2, 2f
+       check_override id_aa64mmfr1 ID_AA64MMFR1_VHE_SHIFT 2f 1f
 
 1:     mov_q   x0, HVC_STUB_ERR
        eret
@@ -140,10 +204,10 @@ SYM_CODE_START_LOCAL(mutate_to_vhe)
        msr     spsr_el1, x0
 
        b       enter_vhe
-SYM_CODE_END(mutate_to_vhe)
+SYM_CODE_END(__finalise_el2)
 
        // At the point where we reach enter_vhe(), we run with
-       // the MMU off (which is enforced by mutate_to_vhe()).
+       // the MMU off (which is enforced by __finalise_el2()).
        // We thus need to be in the idmap, or everything will
        // explode when enabling the MMU.
 
@@ -222,12 +286,12 @@ SYM_FUNC_START(__hyp_reset_vectors)
 SYM_FUNC_END(__hyp_reset_vectors)
 
 /*
- * Entry point to switch to VHE if deemed capable
+ * Entry point to finalise EL2 and switch to VHE if deemed capable
+ *
+ * w0: boot mode, as returned by init_kernel_el()
  */
-SYM_FUNC_START(switch_to_vhe)
+SYM_FUNC_START(finalise_el2)
        // Need to have booted at EL2
-       adr_l   x1, __boot_cpu_mode
-       ldr     w0, [x1]
        cmp     w0, #BOOT_CPU_MODE_EL2
        b.ne    1f
 
@@ -236,9 +300,8 @@ SYM_FUNC_START(switch_to_vhe)
        cmp     x0, #CurrentEL_EL1
        b.ne    1f
 
-       // Turn the world upside down
-       mov     x0, #HVC_VHE_RESTART
+       mov     x0, #HVC_FINALISE_EL2
        hvc     #0
 1:
        ret
-SYM_FUNC_END(switch_to_vhe)
+SYM_FUNC_END(finalise_el2)
index 8a2ceb591686398f78ce4d3ff6331be820514bb8..1b0542c69738eca272afbd899965d247a8393526 100644 (file)
 #define FTR_ALIAS_NAME_LEN     30
 #define FTR_ALIAS_OPTION_LEN   116
 
+static u64 __boot_status __initdata;
+
 struct ftr_set_desc {
        char                            name[FTR_DESC_NAME_LEN];
        struct arm64_ftr_override       *override;
        struct {
                char                    name[FTR_DESC_FIELD_LEN];
                u8                      shift;
+               u8                      width;
                bool                    (*filter)(u64 val);
        }                               fields[];
 };
 
+#define FIELD(n, s, f) { .name = n, .shift = s, .width = 4, .filter = f }
+
 static bool __init mmfr1_vh_filter(u64 val)
 {
        /*
@@ -37,24 +42,65 @@ static bool __init mmfr1_vh_filter(u64 val)
         * the user was trying to force nVHE on us, proceed with
         * attitude adjustment.
         */
-       return !(is_kernel_in_hyp_mode() && val == 0);
+       return !(__boot_status == (BOOT_CPU_FLAG_E2H | BOOT_CPU_MODE_EL2) &&
+                val == 0);
 }
 
 static const struct ftr_set_desc mmfr1 __initconst = {
        .name           = "id_aa64mmfr1",
        .override       = &id_aa64mmfr1_override,
        .fields         = {
-               { "vh", ID_AA64MMFR1_VHE_SHIFT, mmfr1_vh_filter },
+               FIELD("vh", ID_AA64MMFR1_VHE_SHIFT, mmfr1_vh_filter),
+               {}
+       },
+};
+
+static bool __init pfr0_sve_filter(u64 val)
+{
+       /*
+        * Disabling SVE also means disabling all the features that
+        * are associated with it. The easiest way to do it is just to
+        * override id_aa64zfr0_el1 to be 0.
+        */
+       if (!val) {
+               id_aa64zfr0_override.val = 0;
+               id_aa64zfr0_override.mask = GENMASK(63, 0);
+       }
+
+       return true;
+}
+
+static const struct ftr_set_desc pfr0 __initconst = {
+       .name           = "id_aa64pfr0",
+       .override       = &id_aa64pfr0_override,
+       .fields         = {
+               FIELD("sve", ID_AA64PFR0_SVE_SHIFT, pfr0_sve_filter),
                {}
        },
 };
 
+static bool __init pfr1_sme_filter(u64 val)
+{
+       /*
+        * Similarly to SVE, disabling SME also means disabling all
+        * the features that are associated with it. Just set
+        * id_aa64smfr0_el1 to 0 and don't look back.
+        */
+       if (!val) {
+               id_aa64smfr0_override.val = 0;
+               id_aa64smfr0_override.mask = GENMASK(63, 0);
+       }
+
+       return true;
+}
+
 static const struct ftr_set_desc pfr1 __initconst = {
        .name           = "id_aa64pfr1",
        .override       = &id_aa64pfr1_override,
        .fields         = {
-               { "bt", ID_AA64PFR1_BT_SHIFT },
-               { "mte", ID_AA64PFR1_MTE_SHIFT},
+               FIELD("bt", ID_AA64PFR1_BT_SHIFT, NULL ),
+               FIELD("mte", ID_AA64PFR1_MTE_SHIFT, NULL),
+               FIELD("sme", ID_AA64PFR1_SME_SHIFT, pfr1_sme_filter),
                {}
        },
 };
@@ -63,10 +109,10 @@ static const struct ftr_set_desc isar1 __initconst = {
        .name           = "id_aa64isar1",
        .override       = &id_aa64isar1_override,
        .fields         = {
-               { "gpi", ID_AA64ISAR1_GPI_SHIFT },
-               { "gpa", ID_AA64ISAR1_GPA_SHIFT },
-               { "api", ID_AA64ISAR1_API_SHIFT },
-               { "apa", ID_AA64ISAR1_APA_SHIFT },
+               FIELD("gpi", ID_AA64ISAR1_EL1_GPI_SHIFT, NULL),
+               FIELD("gpa", ID_AA64ISAR1_EL1_GPA_SHIFT, NULL),
+               FIELD("api", ID_AA64ISAR1_EL1_API_SHIFT, NULL),
+               FIELD("apa", ID_AA64ISAR1_EL1_APA_SHIFT, NULL),
                {}
        },
 };
@@ -75,8 +121,18 @@ static const struct ftr_set_desc isar2 __initconst = {
        .name           = "id_aa64isar2",
        .override       = &id_aa64isar2_override,
        .fields         = {
-               { "gpa3", ID_AA64ISAR2_GPA3_SHIFT },
-               { "apa3", ID_AA64ISAR2_APA3_SHIFT },
+               FIELD("gpa3", ID_AA64ISAR2_EL1_GPA3_SHIFT, NULL),
+               FIELD("apa3", ID_AA64ISAR2_EL1_APA3_SHIFT, NULL),
+               {}
+       },
+};
+
+static const struct ftr_set_desc smfr0 __initconst = {
+       .name           = "id_aa64smfr0",
+       .override       = &id_aa64smfr0_override,
+       .fields         = {
+               /* FA64 is a one bit field... :-/ */
+               { "fa64", ID_AA64SMFR0_EL1_FA64_SHIFT, 1, },
                {}
        },
 };
@@ -89,16 +145,18 @@ static const struct ftr_set_desc kaslr __initconst = {
        .override       = &kaslr_feature_override,
 #endif
        .fields         = {
-               { "disabled", 0 },
+               FIELD("disabled", 0, NULL),
                {}
        },
 };
 
 static const struct ftr_set_desc * const regs[] __initconst = {
        &mmfr1,
+       &pfr0,
        &pfr1,
        &isar1,
        &isar2,
+       &smfr0,
        &kaslr,
 };
 
@@ -108,6 +166,8 @@ static const struct {
 } aliases[] __initconst = {
        { "kvm-arm.mode=nvhe",          "id_aa64mmfr1.vh=0" },
        { "kvm-arm.mode=protected",     "id_aa64mmfr1.vh=0" },
+       { "arm64.nosve",                "id_aa64pfr0.sve=0 id_aa64pfr1.sme=0" },
+       { "arm64.nosme",                "id_aa64pfr1.sme=0" },
        { "arm64.nobti",                "id_aa64pfr1.bt=0" },
        { "arm64.nopauth",
          "id_aa64isar1.gpi=0 id_aa64isar1.gpa=0 "
@@ -144,7 +204,8 @@ static void __init match_options(const char *cmdline)
 
                for (f = 0; strlen(regs[i]->fields[f].name); f++) {
                        u64 shift = regs[i]->fields[f].shift;
-                       u64 mask = 0xfUL << shift;
+                       u64 width = regs[i]->fields[f].width ?: 4;
+                       u64 mask = GENMASK_ULL(shift + width - 1, shift);
                        u64 v;
 
                        if (find_field(cmdline, regs[i], f, &v))
@@ -152,7 +213,7 @@ static void __init match_options(const char *cmdline)
 
                        /*
                         * If an override gets filtered out, advertise
-                        * it by setting the value to 0xf, but
+                        * it by setting the value to the all-ones while
                         * clearing the mask... Yes, this is fragile.
                         */
                        if (regs[i]->fields[f].filter &&
@@ -234,9 +295,9 @@ static __init void parse_cmdline(void)
 }
 
 /* Keep checkers quiet */
-void init_feature_override(void);
+void init_feature_override(u64 boot_status);
 
-asmlinkage void __init init_feature_override(void)
+asmlinkage void __init init_feature_override(u64 boot_status)
 {
        int i;
 
@@ -247,6 +308,8 @@ asmlinkage void __init init_feature_override(void)
                }
        }
 
+       __boot_status = boot_status;
+
        parse_cmdline();
 
        for (i = 0; i < ARRAY_SIZE(regs); i++) {
index 241c86b67d01792e309d1fecd2efc7a9f697483f..afa69e04e75eddfb5b303efb61dedb22679f6620 100644 (file)
 #error This file should only be included in vmlinux.lds.S
 #endif
 
-#ifdef CONFIG_EFI
-
-__efistub_kernel_size          = _edata - _text;
-__efistub_primary_entry_offset = primary_entry - _text;
-
+PROVIDE(__efistub_kernel_size          = _edata - _text);
+PROVIDE(__efistub_primary_entry_offset = primary_entry - _text);
 
 /*
  * The EFI stub has its own symbol namespace prefixed by __efistub_, to
@@ -25,31 +22,37 @@ __efistub_primary_entry_offset      = primary_entry - _text;
  * linked at. The routines below are all implemented in assembler in a
  * position independent manner
  */
-__efistub_memcmp               = __pi_memcmp;
-__efistub_memchr               = __pi_memchr;
-__efistub_memcpy               = __pi_memcpy;
-__efistub_memmove              = __pi_memmove;
-__efistub_memset               = __pi_memset;
-__efistub_strlen               = __pi_strlen;
-__efistub_strnlen              = __pi_strnlen;
-__efistub_strcmp               = __pi_strcmp;
-__efistub_strncmp              = __pi_strncmp;
-__efistub_strrchr              = __pi_strrchr;
-__efistub_dcache_clean_poc = __pi_dcache_clean_poc;
-
-#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
-__efistub___memcpy             = __pi_memcpy;
-__efistub___memmove            = __pi_memmove;
-__efistub___memset             = __pi_memset;
-#endif
+PROVIDE(__efistub_memcmp               = __pi_memcmp);
+PROVIDE(__efistub_memchr               = __pi_memchr);
+PROVIDE(__efistub_memcpy               = __pi_memcpy);
+PROVIDE(__efistub_memmove              = __pi_memmove);
+PROVIDE(__efistub_memset               = __pi_memset);
+PROVIDE(__efistub_strlen               = __pi_strlen);
+PROVIDE(__efistub_strnlen              = __pi_strnlen);
+PROVIDE(__efistub_strcmp               = __pi_strcmp);
+PROVIDE(__efistub_strncmp              = __pi_strncmp);
+PROVIDE(__efistub_strrchr              = __pi_strrchr);
+PROVIDE(__efistub_dcache_clean_poc     = __pi_dcache_clean_poc);
+
+PROVIDE(__efistub__text                        = _text);
+PROVIDE(__efistub__end                 = _end);
+PROVIDE(__efistub__edata               = _edata);
+PROVIDE(__efistub_screen_info          = screen_info);
+PROVIDE(__efistub__ctype               = _ctype);
 
-__efistub__text                        = _text;
-__efistub__end                 = _end;
-__efistub__edata               = _edata;
-__efistub_screen_info          = screen_info;
-__efistub__ctype               = _ctype;
+/*
+ * The __ prefixed memcpy/memset/memmove symbols are provided by KASAN, which
+ * instruments the conventional ones. Therefore, any references from the EFI
+ * stub or other position independent, low level C code should be redirected to
+ * the non-instrumented versions as well.
+ */
+PROVIDE(__efistub___memcpy             = __pi_memcpy);
+PROVIDE(__efistub___memmove            = __pi_memmove);
+PROVIDE(__efistub___memset             = __pi_memset);
 
-#endif
+PROVIDE(__pi___memcpy                  = __pi_memcpy);
+PROVIDE(__pi___memmove                 = __pi_memmove);
+PROVIDE(__pi___memset                  = __pi_memset);
 
 #ifdef CONFIG_KVM
 
index fc98037e122056057b15693f647d4628feb8229a..faf88ec9c48e8a91487329fffb7f9d20fd3b6854 100644 (file)
@@ -26,14 +26,3 @@ void arch_jump_label_transform(struct jump_entry *entry,
 
        aarch64_insn_patch_text_nosync(addr, insn);
 }
-
-void arch_jump_label_transform_static(struct jump_entry *entry,
-                                     enum jump_label_type type)
-{
-       /*
-        * We use the architected A64 NOP in arch_static_branch, so there's no
-        * need to patch an identical A64 NOP over the top of it here. The core
-        * will call arch_jump_label_transform from a module notifier if the
-        * NOP needs to be replaced by a branch.
-        */
-}
index 418b2bba1521b48078106861851ebbcbda8ea02a..325455d16dbcb31a1808768374376a2cbe941665 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/pgtable.h>
 #include <linux/random.h>
 
-#include <asm/cacheflush.h>
 #include <asm/fixmap.h>
 #include <asm/kernel-pgtable.h>
 #include <asm/memory.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 
-enum kaslr_status {
-       KASLR_ENABLED,
-       KASLR_DISABLED_CMDLINE,
-       KASLR_DISABLED_NO_SEED,
-       KASLR_DISABLED_FDT_REMAP,
-};
-
-static enum kaslr_status __initdata kaslr_status;
 u64 __ro_after_init module_alloc_base;
 u16 __initdata memstart_offset_seed;
 
-static __init u64 get_kaslr_seed(void *fdt)
-{
-       int node, len;
-       fdt64_t *prop;
-       u64 ret;
-
-       node = fdt_path_offset(fdt, "/chosen");
-       if (node < 0)
-               return 0;
-
-       prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len);
-       if (!prop || len != sizeof(u64))
-               return 0;
-
-       ret = fdt64_to_cpu(*prop);
-       *prop = 0;
-       return ret;
-}
-
 struct arm64_ftr_override kaslr_feature_override __initdata;
 
-/*
- * This routine will be executed with the kernel mapped at its default virtual
- * address, and if it returns successfully, the kernel will be remapped, and
- * start_kernel() will be executed from a randomized virtual offset. The
- * relocation will result in all absolute references (e.g., static variables
- * containing function pointers) to be reinitialized, and zero-initialized
- * .bss variables will be reset to 0.
- */
-u64 __init kaslr_early_init(void)
+static int __init kaslr_init(void)
 {
-       void *fdt;
-       u64 seed, offset, mask, module_range;
-       unsigned long raw;
+       u64 module_range;
+       u32 seed;
 
        /*
         * Set a reasonable default for module_alloc_base in case
         * we end up running with module randomization disabled.
         */
        module_alloc_base = (u64)_etext - MODULES_VSIZE;
-       dcache_clean_inval_poc((unsigned long)&module_alloc_base,
-                           (unsigned long)&module_alloc_base +
-                                   sizeof(module_alloc_base));
-
-       /*
-        * Try to map the FDT early. If this fails, we simply bail,
-        * and proceed with KASLR disabled. We will make another
-        * attempt at mapping the FDT in setup_machine()
-        */
-       fdt = get_early_fdt_ptr();
-       if (!fdt) {
-               kaslr_status = KASLR_DISABLED_FDT_REMAP;
-               return 0;
-       }
 
-       /*
-        * Retrieve (and wipe) the seed from the FDT
-        */
-       seed = get_kaslr_seed(fdt);
-
-       /*
-        * Check if 'nokaslr' appears on the command line, and
-        * return 0 if that is the case.
-        */
        if (kaslr_feature_override.val & kaslr_feature_override.mask & 0xf) {
-               kaslr_status = KASLR_DISABLED_CMDLINE;
+               pr_info("KASLR disabled on command line\n");
                return 0;
        }
 
-       /*
-        * Mix in any entropy obtainable architecturally if enabled
-        * and supported.
-        */
-
-       if (arch_get_random_seed_long_early(&raw))
-               seed ^= raw;
-
-       if (!seed) {
-               kaslr_status = KASLR_DISABLED_NO_SEED;
+       if (!kaslr_offset()) {
+               pr_warn("KASLR disabled due to lack of seed\n");
                return 0;
        }
 
+       pr_info("KASLR enabled\n");
+
        /*
-        * OK, so we are proceeding with KASLR enabled. Calculate a suitable
-        * kernel image offset from the seed. Let's place the kernel in the
-        * middle half of the VMALLOC area (VA_BITS_MIN - 2), and stay clear of
-        * the lower and upper quarters to avoid colliding with other
-        * allocations.
-        * Even if we could randomize at page granularity for 16k and 64k pages,
-        * let's always round to 2 MB so we don't interfere with the ability to
-        * map using contiguous PTEs
+        * KASAN without KASAN_VMALLOC does not expect the module region to
+        * intersect the vmalloc region, since shadow memory is allocated for
+        * each module at load time, whereas the vmalloc region will already be
+        * shadowed by KASAN zero pages.
         */
-       mask = ((1UL << (VA_BITS_MIN - 2)) - 1) & ~(SZ_2M - 1);
-       offset = BIT(VA_BITS_MIN - 3) + (seed & mask);
+       BUILD_BUG_ON((IS_ENABLED(CONFIG_KASAN_GENERIC) ||
+                     IS_ENABLED(CONFIG_KASAN_SW_TAGS)) &&
+                    !IS_ENABLED(CONFIG_KASAN_VMALLOC));
 
-       /* use the top 16 bits to randomize the linear region */
-       memstart_offset_seed = seed >> 48;
-
-       if (!IS_ENABLED(CONFIG_KASAN_VMALLOC) &&
-           (IS_ENABLED(CONFIG_KASAN_GENERIC) ||
-            IS_ENABLED(CONFIG_KASAN_SW_TAGS)))
-               /*
-                * KASAN without KASAN_VMALLOC does not expect the module region
-                * to intersect the vmalloc region, since shadow memory is
-                * allocated for each module at load time, whereas the vmalloc
-                * region is shadowed by KASAN zero pages. So keep modules
-                * out of the vmalloc region if KASAN is enabled without
-                * KASAN_VMALLOC, and put the kernel well within 4 GB of the
-                * module region.
-                */
-               return offset % SZ_2G;
+       seed = get_random_u32();
 
        if (IS_ENABLED(CONFIG_RANDOMIZE_MODULE_REGION_FULL)) {
                /*
@@ -154,8 +70,7 @@ u64 __init kaslr_early_init(void)
                 * resolved normally.)
                 */
                module_range = SZ_2G - (u64)(_end - _stext);
-               module_alloc_base = max((u64)_end + offset - SZ_2G,
-                                       (u64)MODULES_VADDR);
+               module_alloc_base = max((u64)_end - SZ_2G, (u64)MODULES_VADDR);
        } else {
                /*
                 * Randomize the module region by setting module_alloc_base to
@@ -167,40 +82,12 @@ u64 __init kaslr_early_init(void)
                 * when ARM64_MODULE_PLTS is enabled.
                 */
                module_range = MODULES_VSIZE - (u64)(_etext - _stext);
-               module_alloc_base = (u64)_etext + offset - MODULES_VSIZE;
        }
 
        /* use the lower 21 bits to randomize the base of the module region */
        module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21;
        module_alloc_base &= PAGE_MASK;
 
-       dcache_clean_inval_poc((unsigned long)&module_alloc_base,
-                           (unsigned long)&module_alloc_base +
-                                   sizeof(module_alloc_base));
-       dcache_clean_inval_poc((unsigned long)&memstart_offset_seed,
-                           (unsigned long)&memstart_offset_seed +
-                                   sizeof(memstart_offset_seed));
-
-       return offset;
-}
-
-static int __init kaslr_init(void)
-{
-       switch (kaslr_status) {
-       case KASLR_ENABLED:
-               pr_info("KASLR enabled\n");
-               break;
-       case KASLR_DISABLED_CMDLINE:
-               pr_info("KASLR disabled on command line\n");
-               break;
-       case KASLR_DISABLED_NO_SEED:
-               pr_warn("KASLR disabled due to lack of seed\n");
-               break;
-       case KASLR_DISABLED_FDT_REMAP:
-               pr_warn("KASLR disabled due to FDT remapping failure\n");
-               break;
-       }
-
        return 0;
 }
-core_initcall(kaslr_init)
+subsys_initcall(kaslr_init)
index 42bd8c0c60e09d66fbd53aa73db820d38d18d1e0..692e9d2e31e5d8eeb912ae603d83a27012904f5b 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <asm/unistd.h>
 
+       .section .rodata
        .align  5
        .globl  __kuser_helper_start
 __kuser_helper_start:
index f6b00743c3994a19f78be4b81b52a6c570800ec3..b2b730233274b72f4e1c619d39a0e68d22835f13 100644 (file)
@@ -48,15 +48,6 @@ static void mte_sync_page_tags(struct page *page, pte_t old_pte,
        if (!pte_is_tagged)
                return;
 
-       page_kasan_tag_reset(page);
-       /*
-        * We need smp_wmb() in between setting the flags and clearing the
-        * tags because if another thread reads page->flags and builds a
-        * tagged address out of it, there is an actual dependency to the
-        * memory access, but on the current thread we do not guarantee that
-        * the new page->flags are visible before the tags were updated.
-        */
-       smp_wmb();
        mte_clear_page_tags(page_address(page));
 }
 
diff --git a/arch/arm64/kernel/pi/Makefile b/arch/arm64/kernel/pi/Makefile
new file mode 100644 (file)
index 0000000..8392914
--- /dev/null
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright 2022 Google LLC
+
+KBUILD_CFLAGS  := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) -fpie \
+                  -Os -DDISABLE_BRANCH_PROFILING $(DISABLE_STACKLEAK_PLUGIN) \
+                  $(call cc-option,-mbranch-protection=none) \
+                  -I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
+                  -include $(srctree)/include/linux/hidden.h \
+                  -D__DISABLE_EXPORTS -ffreestanding -D__NO_FORTIFY \
+                  $(call cc-option,-fno-addrsig)
+
+# remove SCS flags from all objects in this directory
+KBUILD_CFLAGS  := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
+# disable LTO
+KBUILD_CFLAGS  := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
+
+GCOV_PROFILE   := n
+KASAN_SANITIZE := n
+KCSAN_SANITIZE := n
+UBSAN_SANITIZE := n
+KCOV_INSTRUMENT        := n
+
+$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
+                              --remove-section=.note.gnu.property \
+                              --prefix-alloc-sections=.init
+$(obj)/%.pi.o: $(obj)/%.o FORCE
+       $(call if_changed,objcopy)
+
+$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
+       $(call if_changed_rule,cc_o_c)
+
+obj-y          := kaslr_early.pi.o lib-fdt.pi.o lib-fdt_ro.pi.o
+extra-y                := $(patsubst %.pi.o,%.o,$(obj-y))
diff --git a/arch/arm64/kernel/pi/kaslr_early.c b/arch/arm64/kernel/pi/kaslr_early.c
new file mode 100644 (file)
index 0000000..6c3855e
--- /dev/null
@@ -0,0 +1,112 @@
+// SPDX-License-Identifier: GPL-2.0-only
+// Copyright 2022 Google LLC
+// Author: Ard Biesheuvel <ardb@google.com>
+
+// NOTE: code in this file runs *very* early, and is not permitted to use
+// global variables or anything that relies on absolute addressing.
+
+#include <linux/libfdt.h>
+#include <linux/init.h>
+#include <linux/linkage.h>
+#include <linux/types.h>
+#include <linux/sizes.h>
+#include <linux/string.h>
+
+#include <asm/archrandom.h>
+#include <asm/memory.h>
+
+/* taken from lib/string.c */
+static char *__strstr(const char *s1, const char *s2)
+{
+       size_t l1, l2;
+
+       l2 = strlen(s2);
+       if (!l2)
+               return (char *)s1;
+       l1 = strlen(s1);
+       while (l1 >= l2) {
+               l1--;
+               if (!memcmp(s1, s2, l2))
+                       return (char *)s1;
+               s1++;
+       }
+       return NULL;
+}
+static bool cmdline_contains_nokaslr(const u8 *cmdline)
+{
+       const u8 *str;
+
+       str = __strstr(cmdline, "nokaslr");
+       return str == cmdline || (str > cmdline && *(str - 1) == ' ');
+}
+
+static bool is_kaslr_disabled_cmdline(void *fdt)
+{
+       if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) {
+               int node;
+               const u8 *prop;
+
+               node = fdt_path_offset(fdt, "/chosen");
+               if (node < 0)
+                       goto out;
+
+               prop = fdt_getprop(fdt, node, "bootargs", NULL);
+               if (!prop)
+                       goto out;
+
+               if (cmdline_contains_nokaslr(prop))
+                       return true;
+
+               if (IS_ENABLED(CONFIG_CMDLINE_EXTEND))
+                       goto out;
+
+               return false;
+       }
+out:
+       return cmdline_contains_nokaslr(CONFIG_CMDLINE);
+}
+
+static u64 get_kaslr_seed(void *fdt)
+{
+       int node, len;
+       fdt64_t *prop;
+       u64 ret;
+
+       node = fdt_path_offset(fdt, "/chosen");
+       if (node < 0)
+               return 0;
+
+       prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len);
+       if (!prop || len != sizeof(u64))
+               return 0;
+
+       ret = fdt64_to_cpu(*prop);
+       *prop = 0;
+       return ret;
+}
+
+asmlinkage u64 kaslr_early_init(void *fdt)
+{
+       u64 seed;
+
+       if (is_kaslr_disabled_cmdline(fdt))
+               return 0;
+
+       seed = get_kaslr_seed(fdt);
+       if (!seed) {
+#ifdef CONFIG_ARCH_RANDOM
+                if (!__early_cpu_has_rndr() ||
+                    !__arm64_rndr((unsigned long *)&seed))
+#endif
+               return 0;
+       }
+
+       /*
+        * OK, so we are proceeding with KASLR enabled. Calculate a suitable
+        * kernel image offset from the seed. Let's place the kernel in the
+        * middle half of the VMALLOC area (VA_BITS_MIN - 2), and stay clear of
+        * the lower and upper quarters to avoid colliding with other
+        * allocations.
+        */
+       return BIT(VA_BITS_MIN - 3) + (seed & GENMASK(VA_BITS_MIN - 3, 0));
+}
index b0980fbb6bc7f2df7b64e056d9d0e04e2546b67a..3e6d0352d7d36469d85853af6059a9523a5fa8e4 100644 (file)
@@ -280,6 +280,9 @@ static int restore_sve_fpsimd_context(struct user_ctxs *user)
 
                vl = task_get_sme_vl(current);
        } else {
+               if (!system_supports_sve())
+                       return -EINVAL;
+
                vl = task_get_sve_vl(current);
        }
 
@@ -342,9 +345,14 @@ fpsimd_only:
 
 #else /* ! CONFIG_ARM64_SVE */
 
-/* Turn any non-optimised out attempts to use these into a link error: */
+static int restore_sve_fpsimd_context(struct user_ctxs *user)
+{
+       WARN_ON_ONCE(1);
+       return -EINVAL;
+}
+
+/* Turn any non-optimised out attempts to use this into a link error: */
 extern int preserve_sve_context(void __user *ctx);
-extern int restore_sve_fpsimd_context(struct user_ctxs *user);
 
 #endif /* ! CONFIG_ARM64_SVE */
 
@@ -649,14 +657,10 @@ static int restore_sigframe(struct pt_regs *regs,
                if (!user.fpsimd)
                        return -EINVAL;
 
-               if (user.sve) {
-                       if (!system_supports_sve())
-                               return -EINVAL;
-
+               if (user.sve)
                        err = restore_sve_fpsimd_context(&user);
-               } else {
+               else
                        err = restore_fpsimd_context(user.fpsimd);
-               }
        }
 
        if (err == 0 && system_supports_sme() && user.za)
index 475d30d471ac1634364bab74e7f3d58c0dfc1fb6..ccbd4aab4ba44117984c86bfc802409aca2090f6 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <asm/unistd.h>
 
+       .section .rodata
        .globl __aarch32_sigret_code_start
 __aarch32_sigret_code_start:
 
index 4ea9392f86e017a4a509a4324ade8177caf977ff..617f78ad43a185c277f9d0193252039f216dba7d 100644 (file)
@@ -100,10 +100,11 @@ SYM_FUNC_END(__cpu_suspend_enter)
        .pushsection ".idmap.text", "awx"
 SYM_CODE_START(cpu_resume)
        bl      init_kernel_el
-       bl      switch_to_vhe
+       bl      finalise_el2
        bl      __cpu_setup
        /* enable the MMU early - so we can access sleep_save_stash by va */
        adrp    x1, swapper_pg_dir
+       adrp    x2, idmap_pg_dir
        bl      __enable_mmu
        ldr     x8, =_cpu_resume
        br      x8
index 0467cb79f080a9a727b452177be01fe6501dd57e..fcaa151b81f19ff8cb8463805d04fc8814a04eaf 100644 (file)
@@ -38,6 +38,8 @@
  * @kr_cur:      When KRETPROBES is selected, holds the kretprobe instance
  *               associated with the most recently encountered replacement lr
  *               value.
+ *
+ * @task:        The task being unwound.
  */
 struct unwind_state {
        unsigned long fp;
@@ -48,13 +50,13 @@ struct unwind_state {
 #ifdef CONFIG_KRETPROBES
        struct llist_node *kr_cur;
 #endif
+       struct task_struct *task;
 };
 
-static notrace void unwind_init(struct unwind_state *state, unsigned long fp,
-                               unsigned long pc)
+static void unwind_init_common(struct unwind_state *state,
+                              struct task_struct *task)
 {
-       state->fp = fp;
-       state->pc = pc;
+       state->task = task;
 #ifdef CONFIG_KRETPROBES
        state->kr_cur = NULL;
 #endif
@@ -72,7 +74,57 @@ static notrace void unwind_init(struct unwind_state *state, unsigned long fp,
        state->prev_fp = 0;
        state->prev_type = STACK_TYPE_UNKNOWN;
 }
-NOKPROBE_SYMBOL(unwind_init);
+
+/*
+ * Start an unwind from a pt_regs.
+ *
+ * The unwind will begin at the PC within the regs.
+ *
+ * The regs must be on a stack currently owned by the calling task.
+ */
+static inline void unwind_init_from_regs(struct unwind_state *state,
+                                        struct pt_regs *regs)
+{
+       unwind_init_common(state, current);
+
+       state->fp = regs->regs[29];
+       state->pc = regs->pc;
+}
+
+/*
+ * Start an unwind from a caller.
+ *
+ * The unwind will begin at the caller of whichever function this is inlined
+ * into.
+ *
+ * The function which invokes this must be noinline.
+ */
+static __always_inline void unwind_init_from_caller(struct unwind_state *state)
+{
+       unwind_init_common(state, current);
+
+       state->fp = (unsigned long)__builtin_frame_address(1);
+       state->pc = (unsigned long)__builtin_return_address(0);
+}
+
+/*
+ * Start an unwind from a blocked task.
+ *
+ * The unwind will begin at the blocked tasks saved PC (i.e. the caller of
+ * cpu_switch_to()).
+ *
+ * The caller should ensure the task is blocked in cpu_switch_to() for the
+ * duration of the unwind, or the unwind will be bogus. It is never valid to
+ * call this for the current task.
+ */
+static inline void unwind_init_from_task(struct unwind_state *state,
+                                        struct task_struct *task)
+{
+       unwind_init_common(state, task);
+
+       state->fp = thread_saved_fp(task);
+       state->pc = thread_saved_pc(task);
+}
 
 /*
  * Unwind from one frame record (A) to the next frame record (B).
@@ -81,9 +133,9 @@ NOKPROBE_SYMBOL(unwind_init);
  * records (e.g. a cycle), determined based on the location and fp value of A
  * and the location (but not the fp value) of B.
  */
-static int notrace unwind_next(struct task_struct *tsk,
-                              struct unwind_state *state)
+static int notrace unwind_next(struct unwind_state *state)
 {
+       struct task_struct *tsk = state->task;
        unsigned long fp = state->fp;
        struct stack_info info;
 
@@ -117,15 +169,15 @@ static int notrace unwind_next(struct task_struct *tsk,
                if (fp <= state->prev_fp)
                        return -EINVAL;
        } else {
-               set_bit(state->prev_type, state->stacks_done);
+               __set_bit(state->prev_type, state->stacks_done);
        }
 
        /*
         * Record this frame record's values and location. The prev_fp and
         * prev_type are only meaningful to the next unwind_next() invocation.
         */
-       state->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp));
-       state->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8));
+       state->fp = READ_ONCE(*(unsigned long *)(fp));
+       state->pc = READ_ONCE(*(unsigned long *)(fp + 8));
        state->prev_fp = fp;
        state->prev_type = info.type;
 
@@ -157,8 +209,7 @@ static int notrace unwind_next(struct task_struct *tsk,
 }
 NOKPROBE_SYMBOL(unwind_next);
 
-static void notrace unwind(struct task_struct *tsk,
-                          struct unwind_state *state,
+static void notrace unwind(struct unwind_state *state,
                           stack_trace_consume_fn consume_entry, void *cookie)
 {
        while (1) {
@@ -166,7 +217,7 @@ static void notrace unwind(struct task_struct *tsk,
 
                if (!consume_entry(cookie, state->pc))
                        break;
-               ret = unwind_next(tsk, state);
+               ret = unwind_next(state);
                if (ret < 0)
                        break;
        }
@@ -212,15 +263,15 @@ noinline notrace void arch_stack_walk(stack_trace_consume_fn consume_entry,
 {
        struct unwind_state state;
 
-       if (regs)
-               unwind_init(&state, regs->regs[29], regs->pc);
-       else if (task == current)
-               unwind_init(&state,
-                               (unsigned long)__builtin_frame_address(1),
-                               (unsigned long)__builtin_return_address(0));
-       else
-               unwind_init(&state, thread_saved_fp(task),
-                               thread_saved_pc(task));
-
-       unwind(task, &state, consume_entry, cookie);
+       if (regs) {
+               if (task != current)
+                       return;
+               unwind_init_from_regs(&state, regs);
+       } else if (task == current) {
+               unwind_init_from_caller(&state);
+       } else {
+               unwind_init_from_task(&state, task);
+       }
+
+       unwind(&state, consume_entry, cookie);
 }
index 2b0887e58a7c4df64cf6cedf7968fd305cf99283..9135fe0f3df536f4fe77832f2758ed5815c877b1 100644 (file)
@@ -52,7 +52,7 @@ void notrace __cpu_suspend_exit(void)
 
        /* Restore CnP bit in TTBR1_EL1 */
        if (system_supports_cnp())
-               cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
+               cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir);
 
        /*
         * PSTATE was not saved over suspend/resume, re-enable any detected
index 9ac7a81b79be853e6344f8a565bd3be9bcc10c2c..b7fed33981f7b7683900f7e7f961d67fed6c51bc 100644 (file)
@@ -579,11 +579,11 @@ static void ctr_read_handler(unsigned long esr, struct pt_regs *regs)
 
        if (cpus_have_const_cap(ARM64_WORKAROUND_1542419)) {
                /* Hide DIC so that we can trap the unnecessary maintenance...*/
-               val &= ~BIT(CTR_DIC_SHIFT);
+               val &= ~BIT(CTR_EL0_DIC_SHIFT);
 
                /* ... and fake IminLine to reduce the number of traps. */
-               val &= ~CTR_IMINLINE_MASK;
-               val |= (PAGE_SHIFT - 2) & CTR_IMINLINE_MASK;
+               val &= ~CTR_EL0_IminLine_MASK;
+               val |= (PAGE_SHIFT - 2) & CTR_EL0_IminLine_MASK;
        }
 
        pt_regs_write_reg(regs, rt, val);
index f6e25d7c346aba02c838a922fd5df6026319ef76..bafbf78fab772d62286b895ba1823d366593b914 100644 (file)
@@ -24,7 +24,13 @@ btildflags-$(CONFIG_ARM64_BTI_KERNEL) += -z force-bti
 # routines, as x86 does (see 6f121e548f83 ("x86, vdso: Reimplement vdso.so
 # preparation in build-time C")).
 ldflags-y := -shared -soname=linux-vdso.so.1 --hash-style=sysv \
-            -Bsymbolic --build-id=sha1 -n $(btildflags-y) -T
+            -Bsymbolic --build-id=sha1 -n $(btildflags-y)
+
+ifdef CONFIG_LD_ORPHAN_WARN
+  ldflags-y += --orphan-handling=warn
+endif
+
+ldflags-y += -T
 
 ccflags-y := -fno-common -fno-builtin -fno-stack-protector -ffixed-x18
 ccflags-y += -DDISABLE_BRANCH_PROFILING -DBUILD_VDSO
index a5e61e09ea927e3020f73e92f96d70c1b90591a2..e69fb4aaaf3ece102ba619cd2c6c403dc6f1b3cb 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/const.h>
 #include <asm/page.h>
 #include <asm/vdso.h>
+#include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-bigaarch64", "elf64-littleaarch64")
 OUTPUT_ARCH(aarch64)
@@ -49,11 +50,24 @@ SECTIONS
 
        .dynamic        : { *(.dynamic) }               :text   :dynamic
 
-       .rodata         : { *(.rodata*) }               :text
+       .rela.dyn       : ALIGN(8) { *(.rela .rela*) }
+
+       .rodata         : {
+               *(.rodata*)
+               *(.got)
+               *(.got.plt)
+               *(.plt)
+               *(.plt.*)
+               *(.iplt)
+               *(.igot .igot.plt)
+       }                                               :text
 
        _end = .;
        PROVIDE(end = .);
 
+       DWARF_DEBUG
+       ELF_DETAILS
+
        /DISCARD/       : {
                *(.data .data.* .gnu.linkonce.d.* .sdata*)
                *(.bss .sbss .dynbss .dynsbss)
index 05ba1aae1b6f24017fb5e5c732f260d6accd7958..36c8f66cad251ac3711f73f5b94d353311bde0b7 100644 (file)
@@ -104,6 +104,7 @@ VDSO_AFLAGS += -D__ASSEMBLY__
 VDSO_LDFLAGS += -Bsymbolic --no-undefined -soname=linux-vdso.so.1
 VDSO_LDFLAGS += -z max-page-size=4096 -z common-page-size=4096
 VDSO_LDFLAGS += -shared --hash-style=sysv --build-id=sha1
+VDSO_LDFLAGS += --orphan-handling=warn
 
 
 # Borrow vdsomunge.c from the arm vDSO
index 3348ce5ea306d0fc8bea1f4b178eb8a3d3bab3b9..8d95d7d35057d27835dcd0643bb6a40adfcd8d5b 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/const.h>
 #include <asm/page.h>
 #include <asm/vdso.h>
+#include <asm-generic/vmlinux.lds.h>
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
@@ -35,12 +36,30 @@ SECTIONS
 
        .dynamic        : { *(.dynamic) }               :text   :dynamic
 
-       .rodata         : { *(.rodata*) }               :text
+       .rodata         : {
+               *(.rodata*)
+               *(.got)
+               *(.got.plt)
+               *(.plt)
+               *(.rel.iplt)
+               *(.iplt)
+               *(.igot.plt)
+       }                                               :text
 
-       .text           : { *(.text*) }                 :text   =0xe7f001f2
+       .text           : {
+               *(.text*)
+               *(.glue_7)
+               *(.glue_7t)
+               *(.vfp11_veneer)
+               *(.v4_bx)
+       }                                               :text   =0xe7f001f2
 
-       .got            : { *(.got) }
-       .rel.plt        : { *(.rel.plt) }
+       .rel.dyn        : { *(.rel*) }
+
+       .ARM.exidx : { *(.ARM.exidx*) }
+       DWARF_DEBUG
+       ELF_DETAILS
+       .ARM.attributes 0 : { *(.ARM.attributes) }
 
        /DISCARD/       : {
                *(.note.GNU-stack)
index 2d4a8f99517533777371d6ec951ad3c0d7f10eca..45131e354e27f1f8fc6607e173638c65c2d40f5b 100644 (file)
@@ -115,7 +115,8 @@ jiffies = jiffies_64;
        __entry_tramp_text_start = .;                   \
        *(.entry.tramp.text)                            \
        . = ALIGN(PAGE_SIZE);                           \
-       __entry_tramp_text_end = .;
+       __entry_tramp_text_end = .;                     \
+       *(.entry.tramp.rodata)
 #else
 #define TRAMP_TEXT
 #endif
@@ -198,8 +199,7 @@ SECTIONS
        }
 
        idmap_pg_dir = .;
-       . += IDMAP_DIR_SIZE;
-       idmap_pg_end = .;
+       . += PAGE_SIZE;
 
 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
        tramp_pg_dir = .;
@@ -235,6 +235,10 @@ SECTIONS
        __inittext_end = .;
        __initdata_begin = .;
 
+       init_idmap_pg_dir = .;
+       . += INIT_IDMAP_DIR_SIZE;
+       init_idmap_pg_end = .;
+
        .init.data : {
                INIT_DATA
                INIT_SETUP(16)
@@ -253,21 +257,17 @@ SECTIONS
        HYPERVISOR_RELOC_SECTION
 
        .rela.dyn : ALIGN(8) {
+               __rela_start = .;
                *(.rela .rela*)
+               __rela_end = .;
        }
 
-       __rela_offset   = ABSOLUTE(ADDR(.rela.dyn) - KIMAGE_VADDR);
-       __rela_size     = SIZEOF(.rela.dyn);
-
-#ifdef CONFIG_RELR
        .relr.dyn : ALIGN(8) {
+               __relr_start = .;
                *(.relr.dyn)
+               __relr_end = .;
        }
 
-       __relr_offset   = ABSOLUTE(ADDR(.relr.dyn) - KIMAGE_VADDR);
-       __relr_size     = SIZEOF(.relr.dyn);
-#endif
-
        . = ALIGN(SEGMENT_ALIGN);
        __initdata_end = .;
        __init_end = .;
index fd55014b34975795dbe35bd2abbeee2bbf50e9c1..fa6e466ed57f60640d5a502aac53517bbad2d592 100644 (file)
        )
 
 #define PVM_ID_AA64ISAR1_ALLOW (\
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_DPB) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_APA) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_API) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_JSCVT) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_FCMA) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_LRCPC) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_GPA) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_GPI) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_FRINTTS) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_SB) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_SPECRES) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_BF16) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_DGH) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR1_I8MM) \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_DPB) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_API) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_JSCVT) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_FCMA) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_LRCPC) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPA) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPI) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_FRINTTS) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_SB) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_SPECRES) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_BF16) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_DGH) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_I8MM) \
        )
 
 #define PVM_ID_AA64ISAR2_ALLOW (\
-       ARM64_FEATURE_MASK(ID_AA64ISAR2_GPA3) | \
-       ARM64_FEATURE_MASK(ID_AA64ISAR2_APA3) \
+       ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3) | \
+       ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3) \
        )
 
 u64 pvm_read_id_reg(const struct kvm_vcpu *vcpu, u32 id);
index 35a4331ba5f31e6be1ebdcf8b87e65910346c023..6b94c3e6ff26831d09d1826818d30f290e845962 100644 (file)
@@ -173,10 +173,10 @@ static u64 get_pvm_id_aa64isar1(const struct kvm_vcpu *vcpu)
        u64 allow_mask = PVM_ID_AA64ISAR1_ALLOW;
 
        if (!vcpu_has_ptrauth(vcpu))
-               allow_mask &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR1_APA) |
-                               ARM64_FEATURE_MASK(ID_AA64ISAR1_API) |
-                               ARM64_FEATURE_MASK(ID_AA64ISAR1_GPA) |
-                               ARM64_FEATURE_MASK(ID_AA64ISAR1_GPI));
+               allow_mask &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA) |
+                               ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_API) |
+                               ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPA) |
+                               ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPI));
 
        return id_aa64isar1_el1_sys_val & allow_mask;
 }
@@ -186,8 +186,8 @@ static u64 get_pvm_id_aa64isar2(const struct kvm_vcpu *vcpu)
        u64 allow_mask = PVM_ID_AA64ISAR2_ALLOW;
 
        if (!vcpu_has_ptrauth(vcpu))
-               allow_mask &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR2_APA3) |
-                               ARM64_FEATURE_MASK(ID_AA64ISAR2_GPA3));
+               allow_mask &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3) |
+                               ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3));
 
        return id_aa64isar2_el1_sys_val & allow_mask;
 }
index c06c0477fab526deb0f89ee2148d605446f34691..c4fb3874b5e2da6558f1928a0bb5c316268b5af8 100644 (file)
@@ -1136,17 +1136,17 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu,
                break;
        case SYS_ID_AA64ISAR1_EL1:
                if (!vcpu_has_ptrauth(vcpu))
-                       val &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR1_APA) |
-                                ARM64_FEATURE_MASK(ID_AA64ISAR1_API) |
-                                ARM64_FEATURE_MASK(ID_AA64ISAR1_GPA) |
-                                ARM64_FEATURE_MASK(ID_AA64ISAR1_GPI));
+                       val &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_APA) |
+                                ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_API) |
+                                ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPA) |
+                                ARM64_FEATURE_MASK(ID_AA64ISAR1_EL1_GPI));
                break;
        case SYS_ID_AA64ISAR2_EL1:
                if (!vcpu_has_ptrauth(vcpu))
-                       val &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR2_APA3) |
-                                ARM64_FEATURE_MASK(ID_AA64ISAR2_GPA3));
+                       val &= ~(ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_APA3) |
+                                ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_GPA3));
                if (!cpus_have_final_cap(ARM64_HAS_WFXT))
-                       val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_WFXT);
+                       val &= ~ARM64_FEATURE_MASK(ID_AA64ISAR2_EL1_WFxT);
                break;
        case SYS_ID_AA64DFR0_EL1:
                /* Limit debug to ARMv8.0 */
index eeb9e45bcce82d2d11636938d8641724b784fa5d..1b7c93ae7e6306c4b31c5c6d3f7e3563217579e6 100644 (file)
@@ -18,7 +18,7 @@
  */
        .macro  multitag_transfer_size, reg, tmp
        mrs_s   \reg, SYS_GMID_EL1
-       ubfx    \reg, \reg, #SYS_GMID_EL1_BS_SHIFT, #SYS_GMID_EL1_BS_SIZE
+       ubfx    \reg, \reg, #GMID_EL1_BS_SHIFT, #GMID_EL1_BS_SIZE
        mov     \tmp, #4
        lsl     \reg, \tmp, \reg
        .endm
index 21c907987080f60d4b25ef70f438332a6c1c24cc..081058d4e4366edbcdfba226f692e1b6c6401c81 100644 (file)
@@ -194,44 +194,3 @@ SYM_FUNC_START(__pi_dcache_clean_pop)
        ret
 SYM_FUNC_END(__pi_dcache_clean_pop)
 SYM_FUNC_ALIAS(dcache_clean_pop, __pi_dcache_clean_pop)
-
-/*
- *     __dma_flush_area(start, size)
- *
- *     clean & invalidate D / U line
- *
- *     - start   - virtual start address of region
- *     - size    - size in question
- */
-SYM_FUNC_START(__pi___dma_flush_area)
-       add     x1, x0, x1
-       dcache_by_line_op civac, sy, x0, x1, x2, x3
-       ret
-SYM_FUNC_END(__pi___dma_flush_area)
-SYM_FUNC_ALIAS(__dma_flush_area, __pi___dma_flush_area)
-
-/*
- *     __dma_map_area(start, size, dir)
- *     - start - kernel virtual start address
- *     - size  - size of region
- *     - dir   - DMA direction
- */
-SYM_FUNC_START(__pi___dma_map_area)
-       add     x1, x0, x1
-       b       __pi_dcache_clean_poc
-SYM_FUNC_END(__pi___dma_map_area)
-SYM_FUNC_ALIAS(__dma_map_area, __pi___dma_map_area)
-
-/*
- *     __dma_unmap_area(start, size, dir)
- *     - start - kernel virtual start address
- *     - size  - size of region
- *     - dir   - DMA direction
- */
-SYM_FUNC_START(__pi___dma_unmap_area)
-       add     x1, x0, x1
-       cmp     w2, #DMA_TO_DEVICE
-       b.ne    __pi_dcache_inval_poc
-       ret
-SYM_FUNC_END(__pi___dma_unmap_area)
-SYM_FUNC_ALIAS(__dma_unmap_area, __pi___dma_unmap_area)
index 0dea80bf6de469e6ab3d5b584d451cf100e77e94..24913271e898c121a9083610144ec640804f02c0 100644 (file)
@@ -23,15 +23,6 @@ void copy_highpage(struct page *to, struct page *from)
 
        if (system_supports_mte() && test_bit(PG_mte_tagged, &from->flags)) {
                set_bit(PG_mte_tagged, &to->flags);
-               page_kasan_tag_reset(to);
-               /*
-                * We need smp_wmb() in between setting the flags and clearing the
-                * tags because if another thread reads page->flags and builds a
-                * tagged address out of it, there is an actual dependency to the
-                * memory access, but on the current thread we do not guarantee that
-                * the new page->flags are visible before the tags were updated.
-                */
-               smp_wmb();
                mte_copy_page_tags(kto, kfrom);
        }
 }
index 6099c81b9322372b27b1c15fdc80d7a5418001a7..599cf81f568514123a3ee5874c2802f082a837a1 100644 (file)
 #include <asm/xen/xen-ops.h>
 
 void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
-               enum dma_data_direction dir)
+                             enum dma_data_direction dir)
 {
-       __dma_map_area(phys_to_virt(paddr), size, dir);
+       unsigned long start = (unsigned long)phys_to_virt(paddr);
+
+       dcache_clean_poc(start, start + size);
 }
 
 void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
-               enum dma_data_direction dir)
+                          enum dma_data_direction dir)
 {
-       __dma_unmap_area(phys_to_virt(paddr), size, dir);
+       unsigned long start = (unsigned long)phys_to_virt(paddr);
+
+       if (dir == DMA_TO_DEVICE)
+               return;
+
+       dcache_inval_poc(start, start + size);
 }
 
 void arch_dma_prep_coherent(struct page *page, size_t size)
 {
-       __dma_flush_area(page_address(page), size);
+       unsigned long start = (unsigned long)page_address(page);
+
+       dcache_clean_inval_poc(start, start + size);
 }
 
 #ifdef CONFIG_IOMMU_DMA
index 4894553096951f326944207737d28fdddb4b1e4c..228d681a871594f05acea36f572b31363f8000c6 100644 (file)
@@ -16,13 +16,6 @@ get_ex_fixup(const struct exception_table_entry *ex)
        return ((unsigned long)&ex->fixup + ex->fixup);
 }
 
-static bool ex_handler_fixup(const struct exception_table_entry *ex,
-                            struct pt_regs *regs)
-{
-       regs->pc = get_ex_fixup(ex);
-       return true;
-}
-
 static bool ex_handler_uaccess_err_zero(const struct exception_table_entry *ex,
                                        struct pt_regs *regs)
 {
@@ -72,11 +65,10 @@ bool fixup_exception(struct pt_regs *regs)
                return false;
 
        switch (ex->type) {
-       case EX_TYPE_FIXUP:
-               return ex_handler_fixup(ex, regs);
        case EX_TYPE_BPF:
                return ex_handler_bpf(ex, regs);
        case EX_TYPE_UACCESS_ERR_ZERO:
+       case EX_TYPE_KACCESS_ERR_ZERO:
                return ex_handler_uaccess_err_zero(ex, regs);
        case EX_TYPE_LOAD_UNALIGNED_ZEROPAD:
                return ex_handler_load_unaligned_zeropad(ex, regs);
index c5e11768e5c141ae854ef3b71cfbf8a1ca17d907..cdf3ffa0c22340e6bcb91077a4363d74e75ef82f 100644 (file)
@@ -927,6 +927,5 @@ struct page *alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma,
 void tag_clear_highpage(struct page *page)
 {
        mte_zero_clear_page_tags(page_address(page));
-       page_kasan_tag_reset(page);
        set_bit(PG_mte_tagged, &page->flags);
 }
index 3618ef3f6d8181efd61a59081e41d886cb4b34e3..5307ffdefb8debc8ab10d77cf5eac5eb097528a9 100644 (file)
@@ -100,16 +100,6 @@ int pud_huge(pud_t pud)
 #endif
 }
 
-/*
- * Select all bits except the pfn
- */
-static inline pgprot_t pte_pgprot(pte_t pte)
-{
-       unsigned long pfn = pte_pfn(pte);
-
-       return __pgprot(pte_val(pfn_pte(pfn, __pgprot(0))) ^ pte_val(pte));
-}
-
 static int find_num_contig(struct mm_struct *mm, unsigned long addr,
                           pte_t *ptep, size_t *pgsize)
 {
index 339ee84e5a61a0bf97e8d49ccd2bca824e467396..b6ef26fc8ebe8a21520ce4cb931f6d282b2b5d1c 100644 (file)
@@ -389,7 +389,7 @@ void __init arm64_memblock_init(void)
 
        early_init_fdt_scan_reserved_mem();
 
-       if (!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32))
+       if (!defer_reserve_crashkernel())
                reserve_crashkernel();
 
        high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
@@ -438,7 +438,7 @@ void __init bootmem_init(void)
         * request_standard_resources() depends on crashkernel's memory being
         * reserved, so do it here.
         */
-       if (IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32))
+       if (defer_reserve_crashkernel())
                reserve_crashkernel();
 
        memblock_dump_all();
index b21f91cd830db4fdbcf4f52f2477c3c96a875e0f..c5af103d4ad4687fd47a3bc5616159614bfd21ba 100644 (file)
@@ -1,96 +1,22 @@
 // SPDX-License-Identifier: GPL-2.0-only
-/*
- * Based on arch/arm/mm/ioremap.c
- *
- * (C) Copyright 1995 1996 Linus Torvalds
- * Hacked for ARM by Phil Blundell <philb@gnu.org>
- * Hacked to allow all architectures to build, and various cleanups
- * by Russell King
- * Copyright (C) 2012 ARM Ltd.
- */
 
-#include <linux/export.h>
 #include <linux/mm.h>
-#include <linux/vmalloc.h>
 #include <linux/io.h>
 
-#include <asm/fixmap.h>
-#include <asm/tlbflush.h>
-
-static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size,
-                                     pgprot_t prot, void *caller)
+bool ioremap_allowed(phys_addr_t phys_addr, size_t size, unsigned long prot)
 {
-       unsigned long last_addr;
-       unsigned long offset = phys_addr & ~PAGE_MASK;
-       int err;
-       unsigned long addr;
-       struct vm_struct *area;
+       unsigned long last_addr = phys_addr + size - 1;
 
-       /*
-        * Page align the mapping address and size, taking account of any
-        * offset.
-        */
-       phys_addr &= PAGE_MASK;
-       size = PAGE_ALIGN(size + offset);
+       /* Don't allow outside PHYS_MASK */
+       if (last_addr & ~PHYS_MASK)
+               return false;
 
-       /*
-        * Don't allow wraparound, zero size or outside PHYS_MASK.
-        */
-       last_addr = phys_addr + size - 1;
-       if (!size || last_addr < phys_addr || (last_addr & ~PHYS_MASK))
-               return NULL;
-
-       /*
-        * Don't allow RAM to be mapped.
-        */
+       /* Don't allow RAM to be mapped. */
        if (WARN_ON(pfn_is_map_memory(__phys_to_pfn(phys_addr))))
-               return NULL;
-
-       area = get_vm_area_caller(size, VM_IOREMAP, caller);
-       if (!area)
-               return NULL;
-       addr = (unsigned long)area->addr;
-       area->phys_addr = phys_addr;
-
-       err = ioremap_page_range(addr, addr + size, phys_addr, prot);
-       if (err) {
-               vunmap((void *)addr);
-               return NULL;
-       }
-
-       return (void __iomem *)(offset + addr);
-}
-
-void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot)
-{
-       return __ioremap_caller(phys_addr, size, prot,
-                               __builtin_return_address(0));
-}
-EXPORT_SYMBOL(__ioremap);
-
-void iounmap(volatile void __iomem *io_addr)
-{
-       unsigned long addr = (unsigned long)io_addr & PAGE_MASK;
-
-       /*
-        * We could get an address outside vmalloc range in case
-        * of ioremap_cache() reusing a RAM mapping.
-        */
-       if (is_vmalloc_addr((void *)addr))
-               vunmap((void *)addr);
-}
-EXPORT_SYMBOL(iounmap);
-
-void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
-{
-       /* For normal memory we already have a cacheable mapping. */
-       if (pfn_is_map_memory(__phys_to_pfn(phys_addr)))
-               return (void __iomem *)__phys_to_virt(phys_addr);
+               return false;
 
-       return __ioremap_caller(phys_addr, size, __pgprot(PROT_NORMAL),
-                               __builtin_return_address(0));
+       return true;
 }
-EXPORT_SYMBOL(ioremap_cache);
 
 /*
  * Must be called after early_fixmap_init
index c12cd700598f50252ae79fc7c0d2bf2e3d004a62..e969e68de005fd2abf0aee91d51a03fc4e2eeebd 100644 (file)
@@ -236,7 +236,7 @@ static void __init kasan_init_shadow(void)
         */
        memcpy(tmp_pg_dir, swapper_pg_dir, sizeof(tmp_pg_dir));
        dsb(ishst);
-       cpu_replace_ttbr1(lm_alias(tmp_pg_dir));
+       cpu_replace_ttbr1(lm_alias(tmp_pg_dir), idmap_pg_dir);
 
        clear_pgds(KASAN_SHADOW_START, KASAN_SHADOW_END);
 
@@ -280,7 +280,7 @@ static void __init kasan_init_shadow(void)
                                PAGE_KERNEL_RO));
 
        memset(kasan_early_shadow_page, KASAN_SHADOW_INIT, PAGE_SIZE);
-       cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
+       cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir);
 }
 
 static void __init kasan_init_depth(void)
index 626ec32873c6c36bb6d21085bc7340dd73b055c6..db7c4e6ae57bbe02774748c9e050d246486b4f9f 100644 (file)
 #define NO_CONT_MAPPINGS       BIT(1)
 #define NO_EXEC_MAPPINGS       BIT(2)  /* assumes FEAT_HPDS is not used */
 
-u64 idmap_t0sz = TCR_T0SZ(VA_BITS_MIN);
-u64 idmap_ptrs_per_pgd = PTRS_PER_PGD;
+int idmap_t0sz __ro_after_init;
 
-u64 __section(".mmuoff.data.write") vabits_actual;
+#if VA_BITS > 48
+u64 vabits_actual __ro_after_init = VA_BITS_MIN;
 EXPORT_SYMBOL(vabits_actual);
+#endif
+
+u64 kimage_vaddr __ro_after_init = (u64)&_text;
+EXPORT_SYMBOL(kimage_vaddr);
 
 u64 kimage_voffset __ro_after_init;
 EXPORT_SYMBOL(kimage_voffset);
 
+u32 __boot_cpu_mode[] = { BOOT_CPU_MODE_EL2, BOOT_CPU_MODE_EL1 };
+
+/*
+ * The booting CPU updates the failed status @__early_cpu_boot_status,
+ * with MMU turned off.
+ */
+long __section(".mmuoff.data.write") __early_cpu_boot_status;
+
 /*
  * Empty_zero_page is a special page that is used for zero-initialized data
  * and COW.
@@ -388,6 +400,13 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
        } while (pgdp++, addr = next, addr != end);
 }
 
+#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+extern __alias(__create_pgd_mapping)
+void create_kpti_ng_temp_pgd(pgd_t *pgdir, phys_addr_t phys, unsigned long virt,
+                            phys_addr_t size, pgprot_t prot,
+                            phys_addr_t (*pgtable_alloc)(int), int flags);
+#endif
+
 static phys_addr_t __pgd_pgtable_alloc(int shift)
 {
        void *ptr = (void *)__get_free_page(GFP_PGTABLE_KERNEL);
@@ -529,8 +548,7 @@ static void __init map_mem(pgd_t *pgdp)
 
 #ifdef CONFIG_KEXEC_CORE
        if (crash_mem_map) {
-               if (IS_ENABLED(CONFIG_ZONE_DMA) ||
-                   IS_ENABLED(CONFIG_ZONE_DMA32))
+               if (defer_reserve_crashkernel())
                        flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
                else if (crashk_res.end)
                        memblock_mark_nomap(crashk_res.start,
@@ -571,8 +589,7 @@ static void __init map_mem(pgd_t *pgdp)
         * through /sys/kernel/kexec_crash_size interface.
         */
 #ifdef CONFIG_KEXEC_CORE
-       if (crash_mem_map &&
-           !IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32)) {
+       if (crash_mem_map && !defer_reserve_crashkernel()) {
                if (crashk_res.end) {
                        __map_memblock(pgdp, crashk_res.start,
                                       crashk_res.end + 1,
@@ -665,13 +682,9 @@ static int __init map_entry_trampoline(void)
                __set_fixmap(FIX_ENTRY_TRAMP_TEXT1 - i,
                             pa_start + i * PAGE_SIZE, prot);
 
-       if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) {
-               extern char __entry_tramp_data_start[];
-
-               __set_fixmap(FIX_ENTRY_TRAMP_DATA,
-                            __pa_symbol(__entry_tramp_data_start),
-                            PAGE_KERNEL_RO);
-       }
+       if (IS_ENABLED(CONFIG_RELOCATABLE))
+               __set_fixmap(FIX_ENTRY_TRAMP_TEXT1 - i,
+                            pa_start + i * PAGE_SIZE, PAGE_KERNEL_RO);
 
        return 0;
 }
@@ -762,22 +775,57 @@ static void __init map_kernel(pgd_t *pgdp)
        kasan_copy_shadow(pgdp);
 }
 
+static void __init create_idmap(void)
+{
+       u64 start = __pa_symbol(__idmap_text_start);
+       u64 size = __pa_symbol(__idmap_text_end) - start;
+       pgd_t *pgd = idmap_pg_dir;
+       u64 pgd_phys;
+
+       /* check if we need an additional level of translation */
+       if (VA_BITS < 48 && idmap_t0sz < (64 - VA_BITS_MIN)) {
+               pgd_phys = early_pgtable_alloc(PAGE_SHIFT);
+               set_pgd(&idmap_pg_dir[start >> VA_BITS],
+                       __pgd(pgd_phys | P4D_TYPE_TABLE));
+               pgd = __va(pgd_phys);
+       }
+       __create_pgd_mapping(pgd, start, start, size, PAGE_KERNEL_ROX,
+                            early_pgtable_alloc, 0);
+
+       if (IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0)) {
+               extern u32 __idmap_kpti_flag;
+               u64 pa = __pa_symbol(&__idmap_kpti_flag);
+
+               /*
+                * The KPTI G-to-nG conversion code needs a read-write mapping
+                * of its synchronization flag in the ID map.
+                */
+               __create_pgd_mapping(pgd, pa, pa, sizeof(u32), PAGE_KERNEL,
+                                    early_pgtable_alloc, 0);
+       }
+}
+
 void __init paging_init(void)
 {
        pgd_t *pgdp = pgd_set_fixmap(__pa_symbol(swapper_pg_dir));
+       extern pgd_t init_idmap_pg_dir[];
+
+       idmap_t0sz = 63UL - __fls(__pa_symbol(_end) | GENMASK(VA_BITS_MIN - 1, 0));
 
        map_kernel(pgdp);
        map_mem(pgdp);
 
        pgd_clear_fixmap();
 
-       cpu_replace_ttbr1(lm_alias(swapper_pg_dir));
+       cpu_replace_ttbr1(lm_alias(swapper_pg_dir), init_idmap_pg_dir);
        init_mm.pgd = swapper_pg_dir;
 
        memblock_phys_free(__pa_symbol(init_pg_dir),
                           __pa_symbol(init_pg_end) - __pa_symbol(init_pg_dir));
 
        memblock_allow_resize();
+
+       create_idmap();
 }
 
 /*
index a9e50e930484aa3ce7e09f3d9344f7a72b08de6a..4334dec93bd441eb285d27b97d2b86cfdf1d00c0 100644 (file)
@@ -53,15 +53,6 @@ bool mte_restore_tags(swp_entry_t entry, struct page *page)
        if (!tags)
                return false;
 
-       page_kasan_tag_reset(page);
-       /*
-        * We need smp_wmb() in between setting the flags and clearing the
-        * tags because if another thread reads page->flags and builds a
-        * tagged address out of it, there is an actual dependency to the
-        * memory access, but on the current thread we do not guarantee that
-        * the new page->flags are visible before the tags were updated.
-        */
-       smp_wmb();
        mte_restore_page_tags(page_address(page), tags);
 
        return true;
index 50bbed947bec7e0521da145e0e878201ec89d9ec..7837a69524c530deead50aab490ccadd686d19f9 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/asm_pointer_auth.h>
 #include <asm/hwcap.h>
+#include <asm/kernel-pgtable.h>
 #include <asm/pgtable-hwdef.h>
 #include <asm/cpufeature.h>
 #include <asm/alternative.h>
@@ -200,34 +201,64 @@ SYM_FUNC_END(idmap_cpu_replace_ttbr1)
        .popsection
 
 #ifdef CONFIG_UNMAP_KERNEL_AT_EL0
+
+#define KPTI_NG_PTE_FLAGS      (PTE_ATTRINDX(MT_NORMAL) | SWAPPER_PTE_FLAGS)
+
        .pushsection ".idmap.text", "awx"
 
-       .macro  __idmap_kpti_get_pgtable_ent, type
-       dc      cvac, cur_\()\type\()p          // Ensure any existing dirty
-       dmb     sy                              // lines are written back before
-       ldr     \type, [cur_\()\type\()p]       // loading the entry
-       tbz     \type, #0, skip_\()\type        // Skip invalid and
-       tbnz    \type, #11, skip_\()\type       // non-global entries
+       .macro  kpti_mk_tbl_ng, type, num_entries
+       add     end_\type\()p, cur_\type\()p, #\num_entries * 8
+.Ldo_\type:
+       ldr     \type, [cur_\type\()p]          // Load the entry
+       tbz     \type, #0, .Lnext_\type         // Skip invalid and
+       tbnz    \type, #11, .Lnext_\type        // non-global entries
+       orr     \type, \type, #PTE_NG           // Same bit for blocks and pages
+       str     \type, [cur_\type\()p]          // Update the entry
+       .ifnc   \type, pte
+       tbnz    \type, #1, .Lderef_\type
+       .endif
+.Lnext_\type:
+       add     cur_\type\()p, cur_\type\()p, #8
+       cmp     cur_\type\()p, end_\type\()p
+       b.ne    .Ldo_\type
        .endm
 
-       .macro __idmap_kpti_put_pgtable_ent_ng, type
-       orr     \type, \type, #PTE_NG           // Same bit for blocks and pages
-       str     \type, [cur_\()\type\()p]       // Update the entry and ensure
-       dmb     sy                              // that it is visible to all
-       dc      civac, cur_\()\type\()p         // CPUs.
+       /*
+        * Dereference the current table entry and map it into the temporary
+        * fixmap slot associated with the current level.
+        */
+       .macro  kpti_map_pgtbl, type, level
+       str     xzr, [temp_pte, #8 * (\level + 1)]      // break before make
+       dsb     nshst
+       add     pte, temp_pte, #PAGE_SIZE * (\level + 1)
+       lsr     pte, pte, #12
+       tlbi    vaae1, pte
+       dsb     nsh
+       isb
+
+       phys_to_pte pte, cur_\type\()p
+       add     cur_\type\()p, temp_pte, #PAGE_SIZE * (\level + 1)
+       orr     pte, pte, pte_flags
+       str     pte, [temp_pte, #8 * (\level + 1)]
+       dsb     nshst
        .endm
 
 /*
- * void __kpti_install_ng_mappings(int cpu, int num_cpus, phys_addr_t swapper)
+ * void __kpti_install_ng_mappings(int cpu, int num_secondaries, phys_addr_t temp_pgd,
+ *                                unsigned long temp_pte_va)
  *
  * Called exactly once from stop_machine context by each CPU found during boot.
  */
-__idmap_kpti_flag:
-       .long   1
+       .pushsection    ".data", "aw", %progbits
+SYM_DATA(__idmap_kpti_flag, .long 1)
+       .popsection
+
 SYM_FUNC_START(idmap_kpti_install_ng_mappings)
        cpu             .req    w0
+       temp_pte        .req    x0
        num_cpus        .req    w1
-       swapper_pa      .req    x2
+       pte_flags       .req    x1
+       temp_pgd_phys   .req    x2
        swapper_ttb     .req    x3
        flag_ptr        .req    x4
        cur_pgdp        .req    x5
@@ -235,17 +266,16 @@ SYM_FUNC_START(idmap_kpti_install_ng_mappings)
        pgd             .req    x7
        cur_pudp        .req    x8
        end_pudp        .req    x9
-       pud             .req    x10
        cur_pmdp        .req    x11
        end_pmdp        .req    x12
-       pmd             .req    x13
        cur_ptep        .req    x14
        end_ptep        .req    x15
        pte             .req    x16
+       valid           .req    x17
 
+       mov     x5, x3                          // preserve temp_pte arg
        mrs     swapper_ttb, ttbr1_el1
-       restore_ttbr1   swapper_ttb
-       adr     flag_ptr, __idmap_kpti_flag
+       adr_l   flag_ptr, __idmap_kpti_flag
 
        cbnz    cpu, __idmap_kpti_secondary
 
@@ -256,98 +286,71 @@ SYM_FUNC_START(idmap_kpti_install_ng_mappings)
        eor     w17, w17, num_cpus
        cbnz    w17, 1b
 
-       /* We need to walk swapper, so turn off the MMU. */
-       pre_disable_mmu_workaround
-       mrs     x17, sctlr_el1
-       bic     x17, x17, #SCTLR_ELx_M
-       msr     sctlr_el1, x17
+       /* Switch to the temporary page tables on this CPU only */
+       __idmap_cpu_set_reserved_ttbr1 x8, x9
+       offset_ttbr1 temp_pgd_phys, x8
+       msr     ttbr1_el1, temp_pgd_phys
        isb
 
+       mov     temp_pte, x5
+       mov     pte_flags, #KPTI_NG_PTE_FLAGS
+
        /* Everybody is enjoying the idmap, so we can rewrite swapper. */
        /* PGD */
-       mov     cur_pgdp, swapper_pa
-       add     end_pgdp, cur_pgdp, #(PTRS_PER_PGD * 8)
-do_pgd:        __idmap_kpti_get_pgtable_ent    pgd
-       tbnz    pgd, #1, walk_puds
-next_pgd:
-       __idmap_kpti_put_pgtable_ent_ng pgd
-skip_pgd:
-       add     cur_pgdp, cur_pgdp, #8
-       cmp     cur_pgdp, end_pgdp
-       b.ne    do_pgd
-
-       /* Publish the updated tables and nuke all the TLBs */
-       dsb     sy
-       tlbi    vmalle1is
-       dsb     ish
-       isb
+       adrp            cur_pgdp, swapper_pg_dir
+       kpti_map_pgtbl  pgd, 0
+       kpti_mk_tbl_ng  pgd, PTRS_PER_PGD
 
-       /* We're done: fire up the MMU again */
-       mrs     x17, sctlr_el1
-       orr     x17, x17, #SCTLR_ELx_M
-       set_sctlr_el1   x17
+       /* Ensure all the updated entries are visible to secondary CPUs */
+       dsb     ishst
+
+       /* We're done: fire up swapper_pg_dir again */
+       __idmap_cpu_set_reserved_ttbr1 x8, x9
+       msr     ttbr1_el1, swapper_ttb
+       isb
 
        /* Set the flag to zero to indicate that we're all done */
        str     wzr, [flag_ptr]
        ret
 
+.Lderef_pgd:
        /* PUD */
-walk_puds:
-       .if CONFIG_PGTABLE_LEVELS > 3
+       .if             CONFIG_PGTABLE_LEVELS > 3
+       pud             .req    x10
        pte_to_phys     cur_pudp, pgd
-       add     end_pudp, cur_pudp, #(PTRS_PER_PUD * 8)
-do_pud:        __idmap_kpti_get_pgtable_ent    pud
-       tbnz    pud, #1, walk_pmds
-next_pud:
-       __idmap_kpti_put_pgtable_ent_ng pud
-skip_pud:
-       add     cur_pudp, cur_pudp, 8
-       cmp     cur_pudp, end_pudp
-       b.ne    do_pud
-       b       next_pgd
-       .else /* CONFIG_PGTABLE_LEVELS <= 3 */
-       mov     pud, pgd
-       b       walk_pmds
-next_pud:
-       b       next_pgd
+       kpti_map_pgtbl  pud, 1
+       kpti_mk_tbl_ng  pud, PTRS_PER_PUD
+       b               .Lnext_pgd
+       .else           /* CONFIG_PGTABLE_LEVELS <= 3 */
+       pud             .req    pgd
+       .set            .Lnext_pud, .Lnext_pgd
        .endif
 
+.Lderef_pud:
        /* PMD */
-walk_pmds:
-       .if CONFIG_PGTABLE_LEVELS > 2
+       .if             CONFIG_PGTABLE_LEVELS > 2
+       pmd             .req    x13
        pte_to_phys     cur_pmdp, pud
-       add     end_pmdp, cur_pmdp, #(PTRS_PER_PMD * 8)
-do_pmd:        __idmap_kpti_get_pgtable_ent    pmd
-       tbnz    pmd, #1, walk_ptes
-next_pmd:
-       __idmap_kpti_put_pgtable_ent_ng pmd
-skip_pmd:
-       add     cur_pmdp, cur_pmdp, #8
-       cmp     cur_pmdp, end_pmdp
-       b.ne    do_pmd
-       b       next_pud
-       .else /* CONFIG_PGTABLE_LEVELS <= 2 */
-       mov     pmd, pud
-       b       walk_ptes
-next_pmd:
-       b       next_pud
+       kpti_map_pgtbl  pmd, 2
+       kpti_mk_tbl_ng  pmd, PTRS_PER_PMD
+       b               .Lnext_pud
+       .else           /* CONFIG_PGTABLE_LEVELS <= 2 */
+       pmd             .req    pgd
+       .set            .Lnext_pmd, .Lnext_pgd
        .endif
 
+.Lderef_pmd:
        /* PTE */
-walk_ptes:
        pte_to_phys     cur_ptep, pmd
-       add     end_ptep, cur_ptep, #(PTRS_PER_PTE * 8)
-do_pte:        __idmap_kpti_get_pgtable_ent    pte
-       __idmap_kpti_put_pgtable_ent_ng pte
-skip_pte:
-       add     cur_ptep, cur_ptep, #8
-       cmp     cur_ptep, end_ptep
-       b.ne    do_pte
-       b       next_pmd
+       kpti_map_pgtbl  pte, 3
+       kpti_mk_tbl_ng  pte, PTRS_PER_PTE
+       b               .Lnext_pmd
 
        .unreq  cpu
+       .unreq  temp_pte
        .unreq  num_cpus
-       .unreq  swapper_pa
+       .unreq  pte_flags
+       .unreq  temp_pgd_phys
        .unreq  cur_pgdp
        .unreq  end_pgdp
        .unreq  pgd
@@ -360,6 +363,7 @@ skip_pte:
        .unreq  cur_ptep
        .unreq  end_ptep
        .unreq  pte
+       .unreq  valid
 
        /* Secondary CPUs end up here */
 __idmap_kpti_secondary:
@@ -379,7 +383,6 @@ __idmap_kpti_secondary:
        cbnz    w16, 1b
 
        /* All done, act like nothing happened */
-       offset_ttbr1 swapper_ttb, x16
        msr     ttbr1_el1, swapper_ttb
        isb
        ret
@@ -395,6 +398,8 @@ SYM_FUNC_END(idmap_kpti_install_ng_mappings)
  *
  *     Initialise the processor for turning the MMU on.
  *
+ * Input:
+ *     x0 - actual number of VA bits (ignored unless VA_BITS > 48)
  * Output:
  *     Return in x0 the value of the SCTLR_EL1 register.
  */
@@ -464,12 +469,11 @@ SYM_FUNC_START(__cpu_setup)
        tcr_clear_errata_bits tcr, x9, x5
 
 #ifdef CONFIG_ARM64_VA_BITS_52
-       ldr_l           x9, vabits_actual
-       sub             x9, xzr, x9
+       sub             x9, xzr, x0
        add             x9, x9, #64
        tcr_set_t1sz    tcr, x9
 #else
-       ldr_l           x9, idmap_t0sz
+       idmap_get_t0sz  x9
 #endif
        tcr_set_t0sz    tcr, x9
 
index 507b20373953950c9dca2adb9e7d3033074803cb..779653771507a03c5d83960c8d687d132161da62 100644 (file)
@@ -36,6 +36,7 @@ HAS_RNG
 HAS_SB
 HAS_STAGE2_FWB
 HAS_SYSREG_GIC_CPUIF
+HAS_TIDCP1
 HAS_TLB_RANGE
 HAS_VIRT_HOST_EXTN
 HAS_WFXT
@@ -61,6 +62,7 @@ WORKAROUND_1418040
 WORKAROUND_1463225
 WORKAROUND_1508412
 WORKAROUND_1542419
+WORKAROUND_1742098
 WORKAROUND_1902691
 WORKAROUND_2038923
 WORKAROUND_2064142
index 5c55509eb43f5d33a14a880d976bbf718f76ffed..db461921d256bf85613456dd94faac719cb0fbb1 100755 (executable)
@@ -88,7 +88,7 @@ END {
 
 # skip blank lines and comment lines
 /^$/ { next }
-/^#/ { next }
+/^[\t ]*#/ { next }
 
 /^SysregFields/ {
        change_block("SysregFields", "None", "SysregFields")
index ff5e552f7420973f51aa08a11bda711fd35a9f29..9ae483ec1e56ecdafbf42cbccb1b14da517d3b86 100644 (file)
 # feature that introduces them (eg, FEAT_LS64_ACCDATA introduces enumeration
 # item ACCDATA) though it may be more taseful to do something else.
 
+Sysreg ID_AA64ZFR0_EL1 3       0       0       4       4
+Res0   63:60
+Enum   59:56   F64MM
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   55:52   F32MM
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Res0   51:48
+Enum   47:44   I8MM
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   43:40   SM4
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Res0   39:36
+Enum   35:32   SHA3
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Res0   31:24
+Enum   23:20   BF16
+       0b0000  NI
+       0b0001  IMP
+       0b0010  EBF16
+EndEnum
+Enum   19:16   BitPerm
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Res0   15:8
+Enum   7:4     AES
+       0b0000  NI
+       0b0001  IMP
+       0b0010  PMULL128
+EndEnum
+Enum   3:0     SVEver
+       0b0000  IMP
+       0b0001  SVE2
+EndEnum
+EndSysreg
+
+Sysreg ID_AA64SMFR0_EL1        3       0       0       4       5
+Enum   63      FA64
+       0b0     NI
+       0b1     IMP
+EndEnum
+Res0   62:60
+Field  59:56   SMEver
+Enum   55:52   I16I64
+       0b0000  NI
+       0b1111  IMP
+EndEnum
+Res0   51:49
+Enum   48      F64F64
+       0b0     NI
+       0b1     IMP
+EndEnum
+Res0   47:40
+Enum   39:36   I8I32
+       0b0000  NI
+       0b1111  IMP
+EndEnum
+Enum   35      F16F32
+       0b0     NI
+       0b1     IMP
+EndEnum
+Enum   34      B16F32
+       0b0     NI
+       0b1     IMP
+EndEnum
+Res0   33
+Enum   32      F32F32
+       0b0     NI
+       0b1     IMP
+EndEnum
+Res0   31:0
+EndSysreg
+
 Sysreg ID_AA64ISAR0_EL1        3       0       0       6       0
 Enum   63:60   RNDR
        0b0000  NI
@@ -114,6 +197,122 @@ EndEnum
 Res0   3:0
 EndSysreg
 
+Sysreg ID_AA64ISAR1_EL1        3       0       0       6       1
+Enum   63:60   LS64
+       0b0000  NI
+       0b0001  LS64
+       0b0010  LS64_V
+       0b0011  LS64_ACCDATA
+EndEnum
+Enum   59:56   XS
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   55:52   I8MM
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   51:48   DGH
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   47:44   BF16
+       0b0000  NI
+       0b0001  IMP
+       0b0010  EBF16
+EndEnum
+Enum   43:40   SPECRES
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   39:36   SB
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   35:32   FRINTTS
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   31:28   GPI
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   27:24   GPA
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   23:20   LRCPC
+       0b0000  NI
+       0b0001  IMP
+       0b0010  LRCPC2
+EndEnum
+Enum   19:16   FCMA
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   15:12   JSCVT
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   11:8    API
+       0b0000  NI
+       0b0001  PAuth
+       0b0010  EPAC
+       0b0011  PAuth2
+       0b0100  FPAC
+       0b0101  FPACCOMBINE
+EndEnum
+Enum   7:4     APA
+       0b0000  NI
+       0b0001  PAuth
+       0b0010  EPAC
+       0b0011  PAuth2
+       0b0100  FPAC
+       0b0101  FPACCOMBINE
+EndEnum
+Enum   3:0     DPB
+       0b0000  NI
+       0b0001  IMP
+       0b0010  DPB2
+EndEnum
+EndSysreg
+
+Sysreg ID_AA64ISAR2_EL1        3       0       0       6       2
+Res0   63:28
+Enum   27:24   PAC_frac
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   23:20   BC
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   19:16   MOPS
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   15:12   APA3
+       0b0000  NI
+       0b0001  PAuth
+       0b0010  EPAC
+       0b0011  PAuth2
+       0b0100  FPAC
+       0b0101  FPACCOMBINE
+EndEnum
+Enum   11:8    GPA3
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   7:4     RPRES
+       0b0000  NI
+       0b0001  IMP
+EndEnum
+Enum   3:0     WFxT
+       0b0000  NI
+       0b0010  IMP
+EndEnum
+EndSysreg
+
 Sysreg SCTLR_EL1       3       0       1       0       0
 Field  63      TIDCP
 Field  62      SPINMASK
@@ -257,6 +456,11 @@ Field      5:3     Ctype2
 Field  2:0     Ctype1
 EndSysreg
 
+Sysreg GMID_EL1        3       1       0       0       4
+Res0   63:4
+Field  3:0     BS
+EndSysreg
+
 Sysreg SMIDR_EL1       3       1       0       0       6
 Res0   63:32
 Field  31:24   IMPLEMENTER
@@ -273,6 +477,33 @@ Field      3:1     Level
 Field  0       InD
 EndSysreg
 
+Sysreg CTR_EL0 3       3       0       0       1
+Res0   63:38
+Field  37:32   TminLine
+Res1   31
+Res0   30
+Field  29      DIC
+Field  28      IDC
+Field  27:24   CWG
+Field  23:20   ERG
+Field  19:16   DminLine
+Enum   15:14   L1Ip
+       0b00    VPIPT
+       # This is named as AIVIVT in the ARM but documented as reserved
+       0b01    RESERVED
+       0b10    VIPT
+       0b11    PIPT
+EndEnum
+Res0   13:4
+Field  3:0     IminLine
+EndSysreg
+
+Sysreg DCZID_EL0       3       3       0       0       7
+Res0   63:5
+Field  4       DZP
+Field  3:0     BS
+EndSysreg
+
 Sysreg SVCR    3       3       4       2       2
 Res0   63:2
 Field  1       ZA
@@ -367,3 +598,36 @@ EndSysreg
 Sysreg TTBR1_EL1       3       0       2       0       1
 Fields TTBRx_EL1
 EndSysreg
+
+Sysreg LORSA_EL1       3       0       10      4       0
+Res0   63:52
+Field  51:16   SA
+Res0   15:1
+Field  0       Valid
+EndSysreg
+
+Sysreg LOREA_EL1       3       0       10      4       1
+Res0   63:52
+Field  51:48   EA_51_48
+Field  47:16   EA_47_16
+Res0   15:0
+EndSysreg
+
+Sysreg LORN_EL1        3       0       10      4       2
+Res0   63:8
+Field  7:0     Num
+EndSysreg
+
+Sysreg LORC_EL1        3       0       10      4       3
+Res0   63:10
+Field  9:2     DS
+Res0   1
+Field  0       EN
+EndSysreg
+
+Sysreg LORID_EL1       3       0       10      4       7
+Res0   63:24
+Field  23:16   LD
+Res0   15:8
+Field  7:0     LR
+EndSysreg
index 35adcf89035ad61776d8ef34034b676fafc5fc92..99300850abc193bef1ca26106e38321471f0d62c 100644 (file)
@@ -834,7 +834,7 @@ iosapic_unregister_intr (unsigned int gsi)
        if (iosapic_intr_info[irq].count == 0) {
 #ifdef CONFIG_SMP
                /* Clear affinity */
-               cpumask_setall(irq_get_affinity_mask(irq));
+               irq_data_update_affinity(irq_get_irq_data(irq), cpu_all_mask);
 #endif
                /* Clear the interrupt information */
                iosapic_intr_info[irq].dest = 0;
index ecef17c7c35b10d042a6dce5ea48188765a39668..275b9ea58c643e69610cd084aac38b6a15b97b1e 100644 (file)
@@ -57,8 +57,8 @@ static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };
 void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
 {
        if (irq < NR_IRQS) {
-               cpumask_copy(irq_get_affinity_mask(irq),
-                            cpumask_of(cpu_logical_id(hwid)));
+               irq_data_update_affinity(irq_get_irq_data(irq),
+                                        cpumask_of(cpu_logical_id(hwid)));
                irq_redir[irq] = (char) (redir & 0xff);
        }
 }
index df5c28f252e3d7d0868b1bb8f4eeaa338af1d8be..025e5133c860ce6dd07d19a3d615c6e135ea4f01 100644 (file)
@@ -37,7 +37,7 @@ static int ia64_set_msi_irq_affinity(struct irq_data *idata,
        msg.data = data;
 
        pci_write_msi_msg(irq, &msg);
-       cpumask_copy(irq_data_get_affinity_mask(idata), cpumask_of(cpu));
+       irq_data_update_affinity(idata, cpumask_of(cpu));
 
        return 0;
 }
@@ -132,7 +132,7 @@ static int dmar_msi_set_affinity(struct irq_data *data,
        msg.address_lo |= MSI_ADDR_DEST_ID_CPU(cpu_physical_id(cpu));
 
        dmar_msi_write(irq, &msg);
-       cpumask_copy(irq_data_get_affinity_mask(data), mask);
+       irq_data_update_affinity(data, mask);
 
        return 0;
 }
index b57daee98b89c0988f200b7d0217350d939fb1f2..83fe390f84496f35275ac2e534302538f6e76742 100644 (file)
@@ -2,6 +2,7 @@
 config LOONGARCH
        bool
        default y
+       select ACPI_GENERIC_GSI if ACPI
        select ACPI_SYSTEM_POWER_STATES_SUPPORT if ACPI
        select ARCH_BINFMT_ELF_STATE
        select ARCH_ENABLE_MEMORY_HOTPLUG
@@ -69,7 +70,6 @@ config LOONGARCH
        select GENERIC_TIME_VSYSCALL
        select GPIOLIB
        select HAVE_ARCH_AUDITSYSCALL
-       select HAVE_ARCH_COMPILER_H
        select HAVE_ARCH_MMAP_RND_BITS if MMU
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
index 62044cd5b7bc54458cc98881c86c1f3ff0aa52a0..c5108213876cf1d479dc3f0b35f3e112cdaf8d85 100644 (file)
@@ -31,6 +31,148 @@ static inline bool acpi_has_cpu_in_madt(void)
 
 extern struct list_head acpi_wakeup_device_list;
 
+/*
+ * Temporary definitions until the core ACPICA code gets updated (see
+ * 1656837932-18257-1-git-send-email-lvjianmin@loongson.cn and its
+ * follow-ups for the "rationale").
+ *
+ * Once the "legal reasons" are cleared and that the code is merged,
+ * this can be dropped entierely.
+ */
+#if (ACPI_CA_VERSION == 0x20220331 && !defined(LOONGARCH_ACPICA_EXT))
+
+#define LOONGARCH_ACPICA_EXT   1
+
+#define        ACPI_MADT_TYPE_CORE_PIC         17
+#define        ACPI_MADT_TYPE_LIO_PIC          18
+#define        ACPI_MADT_TYPE_HT_PIC           19
+#define        ACPI_MADT_TYPE_EIO_PIC          20
+#define        ACPI_MADT_TYPE_MSI_PIC          21
+#define        ACPI_MADT_TYPE_BIO_PIC          22
+#define        ACPI_MADT_TYPE_LPC_PIC          23
+
+/* Values for Version field above */
+
+enum acpi_madt_core_pic_version {
+       ACPI_MADT_CORE_PIC_VERSION_NONE = 0,
+       ACPI_MADT_CORE_PIC_VERSION_V1 = 1,
+       ACPI_MADT_CORE_PIC_VERSION_RESERVED = 2 /* 2 and greater are reserved */
+};
+
+enum acpi_madt_lio_pic_version {
+       ACPI_MADT_LIO_PIC_VERSION_NONE = 0,
+       ACPI_MADT_LIO_PIC_VERSION_V1 = 1,
+       ACPI_MADT_LIO_PIC_VERSION_RESERVED = 2  /* 2 and greater are reserved */
+};
+
+enum acpi_madt_eio_pic_version {
+       ACPI_MADT_EIO_PIC_VERSION_NONE = 0,
+       ACPI_MADT_EIO_PIC_VERSION_V1 = 1,
+       ACPI_MADT_EIO_PIC_VERSION_RESERVED = 2  /* 2 and greater are reserved */
+};
+
+enum acpi_madt_ht_pic_version {
+       ACPI_MADT_HT_PIC_VERSION_NONE = 0,
+       ACPI_MADT_HT_PIC_VERSION_V1 = 1,
+       ACPI_MADT_HT_PIC_VERSION_RESERVED = 2   /* 2 and greater are reserved */
+};
+
+enum acpi_madt_bio_pic_version {
+       ACPI_MADT_BIO_PIC_VERSION_NONE = 0,
+       ACPI_MADT_BIO_PIC_VERSION_V1 = 1,
+       ACPI_MADT_BIO_PIC_VERSION_RESERVED = 2  /* 2 and greater are reserved */
+};
+
+enum acpi_madt_msi_pic_version {
+       ACPI_MADT_MSI_PIC_VERSION_NONE = 0,
+       ACPI_MADT_MSI_PIC_VERSION_V1 = 1,
+       ACPI_MADT_MSI_PIC_VERSION_RESERVED = 2  /* 2 and greater are reserved */
+};
+
+enum acpi_madt_lpc_pic_version {
+       ACPI_MADT_LPC_PIC_VERSION_NONE = 0,
+       ACPI_MADT_LPC_PIC_VERSION_V1 = 1,
+       ACPI_MADT_LPC_PIC_VERSION_RESERVED = 2  /* 2 and greater are reserved */
+};
+
+#pragma pack(1)
+
+/* Core Interrupt Controller */
+
+struct acpi_madt_core_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u32 processor_id;
+       u32 core_id;
+       u32 flags;
+};
+
+/* Legacy I/O Interrupt Controller */
+
+struct acpi_madt_lio_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u64 address;
+       u16 size;
+       u8 cascade[2];
+       u32 cascade_map[2];
+};
+
+/* Extend I/O Interrupt Controller */
+
+struct acpi_madt_eio_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u8 cascade;
+       u8 node;
+       u64 node_map;
+};
+
+/* HT Interrupt Controller */
+
+struct acpi_madt_ht_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u64 address;
+       u16 size;
+       u8 cascade[8];
+};
+
+/* Bridge I/O Interrupt Controller */
+
+struct acpi_madt_bio_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u64 address;
+       u16 size;
+       u16 id;
+       u16 gsi_base;
+};
+
+/* MSI Interrupt Controller */
+
+struct acpi_madt_msi_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u64 msg_address;
+       u32 start;
+       u32 count;
+};
+
+/* LPC Interrupt Controller */
+
+struct acpi_madt_lpc_pic {
+       struct acpi_subtable_header header;
+       u8 version;
+       u64 address;
+       u16 size;
+       u8 cascade;
+};
+
+#pragma pack()
+
+#endif
+
 #endif /* !CONFIG_ACPI */
 
 #define ACPI_TABLE_UPGRADE_MAX_PHYS ARCH_LOW_ADDRESS_LIMIT
index a1a04083bd670cffe57908db86efe8563ca81d80..be037a40580d4b017725564e59ec0c511373228a 100644 (file)
        nor     \dst, \src, zero
 .endm
 
-.macro bgt r0 r1 label
-       blt     \r1, \r0, \label
-.endm
-
-.macro bltz r0 label
-       blt     \r0, zero, \label
-.endm
-
-.macro bgez r0 label
-       bge     \r0, zero, \label
-.endm
-
 #endif /* _ASM_ASMMACRO_H */
index 979367ad4e2c6dc80c77bc7d44323f9723b8ed31..6b9aca9ab6e9f284e64d57d1d43f61b97726c166 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/types.h>
 #include <asm/barrier.h>
 #include <asm/cmpxchg.h>
-#include <asm/compiler.h>
 
 #if __SIZEOF_LONG__ == 4
 #define __LL           "ll.w   "
@@ -157,27 +156,25 @@ static inline int arch_atomic_sub_if_positive(int i, atomic_t *v)
                __asm__ __volatile__(
                "1:     ll.w    %1, %2          # atomic_sub_if_positive\n"
                "       addi.w  %0, %1, %3                              \n"
-               "       or      %1, %0, $zero                           \n"
-               "       blt     %0, $zero, 2f                           \n"
+               "       move    %1, %0                                  \n"
+               "       bltz    %0, 2f                                  \n"
                "       sc.w    %1, %2                                  \n"
-               "       beq     $zero, %1, 1b                           \n"
+               "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "I" (-i));
        } else {
                __asm__ __volatile__(
                "1:     ll.w    %1, %2          # atomic_sub_if_positive\n"
                "       sub.w   %0, %1, %3                              \n"
-               "       or      %1, %0, $zero                           \n"
-               "       blt     %0, $zero, 2f                           \n"
+               "       move    %1, %0                                  \n"
+               "       bltz    %0, 2f                                  \n"
                "       sc.w    %1, %2                                  \n"
-               "       beq     $zero, %1, 1b                           \n"
+               "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "r" (i));
        }
 
@@ -320,27 +317,25 @@ static inline long arch_atomic64_sub_if_positive(long i, atomic64_t *v)
                __asm__ __volatile__(
                "1:     ll.d    %1, %2  # atomic64_sub_if_positive      \n"
                "       addi.d  %0, %1, %3                              \n"
-               "       or      %1, %0, $zero                           \n"
-               "       blt     %0, $zero, 2f                           \n"
+               "       move    %1, %0                                  \n"
+               "       bltz    %0, 2f                                  \n"
                "       sc.d    %1, %2                                  \n"
-               "       beq     %1, $zero, 1b                           \n"
+               "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "I" (-i));
        } else {
                __asm__ __volatile__(
                "1:     ll.d    %1, %2  # atomic64_sub_if_positive      \n"
                "       sub.d   %0, %1, %3                              \n"
-               "       or      %1, %0, $zero                           \n"
-               "       blt     %0, $zero, 2f                           \n"
+               "       move    %1, %0                                  \n"
+               "       bltz    %0, 2f                                  \n"
                "       sc.d    %1, %2                                  \n"
-               "       beq     %1, $zero, 1b                           \n"
+               "       beqz    %1, 1b                                  \n"
                "2:                                                     \n"
                __WEAK_LLSC_MB
-               : "=&r" (result), "=&r" (temp),
-                 "+" GCC_OFF_SMALL_ASM() (v->counter)
+               : "=&r" (result), "=&r" (temp), "+ZC" (v->counter)
                : "r" (i));
        }
 
index b6517eeeb141d29387883ec3862d5550a9f0cd6b..cda9776758544e5e72f8f42b9bf4862a67ce8a1a 100644 (file)
@@ -48,9 +48,9 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
        __asm__ __volatile__(
                "sltu   %0, %1, %2\n\t"
 #if (__SIZEOF_LONG__ == 4)
-               "sub.w  %0, $r0, %0\n\t"
+               "sub.w  %0, $zero, %0\n\t"
 #elif (__SIZEOF_LONG__ == 8)
-               "sub.d  %0, $r0, %0\n\t"
+               "sub.d  %0, $zero, %0\n\t"
 #endif
                : "=r" (mask)
                : "r" (index), "r" (size)
index 75b3a4478652f8db44be275b663de4ceff54245b..0a9b0fac1eeeb6115bfcd444d35b1975f45a1277 100644 (file)
@@ -55,9 +55,9 @@ static inline unsigned long __xchg(volatile void *ptr, unsigned long x,
        __asm__ __volatile__(                                           \
        "1:     " ld "  %0, %2          # __cmpxchg_asm \n"             \
        "       bne     %0, %z3, 2f                     \n"             \
-       "       or      $t0, %z4, $zero                 \n"             \
+       "       move    $t0, %z4                        \n"             \
        "       " st "  $t0, %1                         \n"             \
-       "       beq     $zero, $t0, 1b                  \n"             \
+       "       beqz    $t0, 1b                         \n"             \
        "2:                                             \n"             \
        __WEAK_LLSC_MB                                                  \
        : "=&r" (__ret), "=ZB"(*m)                                      \
diff --git a/arch/loongarch/include/asm/compiler.h b/arch/loongarch/include/asm/compiler.h
deleted file mode 100644 (file)
index 657cebe..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
- */
-#ifndef _ASM_COMPILER_H
-#define _ASM_COMPILER_H
-
-#define GCC_OFF_SMALL_ASM() "ZC"
-
-#define LOONGARCH_ISA_LEVEL "loongarch"
-#define LOONGARCH_ISA_ARCH_LEVEL "arch=loongarch"
-#define LOONGARCH_ISA_LEVEL_RAW loongarch
-#define LOONGARCH_ISA_ARCH_LEVEL_RAW LOONGARCH_ISA_LEVEL_RAW
-
-#endif /* _ASM_COMPILER_H */
index f3960b18a90e9baf41f45a5570050885a0b7b240..5f3ff4781fda83fd9e861a862f1a4ea8611d8619 100644 (file)
@@ -288,8 +288,6 @@ struct arch_elf_state {
        .interp_fp_abi = LOONGARCH_ABI_FP_ANY,  \
 }
 
-#define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT)
-
 extern int arch_elf_pt_proc(void *ehdr, void *phdr, struct file *elf,
                            bool is_interp, struct arch_elf_state *state);
 
index 9de8231694ec2df65c7c6804703edfbd4c5b08a4..feb6658c84ff8b04e18a684ee9cddca18bfb1c33 100644 (file)
@@ -8,7 +8,6 @@
 #include <linux/futex.h>
 #include <linux/uaccess.h>
 #include <asm/barrier.h>
-#include <asm/compiler.h>
 #include <asm/errno.h>
 
 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)             \
@@ -17,7 +16,7 @@
        "1:     ll.w    %1, %4 # __futex_atomic_op\n"           \
        "       " insn  "                               \n"     \
        "2:     sc.w    $t0, %2                         \n"     \
-       "       beq     $t0, $zero, 1b                  \n"     \
+       "       beqz    $t0, 1b                         \n"     \
        "3:                                             \n"     \
        "       .section .fixup,\"ax\"                  \n"     \
        "4:     li.w    %0, %6                          \n"     \
@@ -82,9 +81,9 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newv
        "# futex_atomic_cmpxchg_inatomic                        \n"
        "1:     ll.w    %1, %3                                  \n"
        "       bne     %1, %z4, 3f                             \n"
-       "       or      $t0, %z5, $zero                         \n"
+       "       move    $t0, %z5                                \n"
        "2:     sc.w    $t0, %2                                 \n"
-       "       beq     $zero, $t0, 1b                          \n"
+       "       beqz    $t0, 1b                                 \n"
        "3:                                                     \n"
        __WEAK_LLSC_MB
        "       .section .fixup,\"ax\"                          \n"
@@ -95,8 +94,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval, u32 newv
        "       "__UA_ADDR "\t1b, 4b                            \n"
        "       "__UA_ADDR "\t2b, 4b                            \n"
        "       .previous                                       \n"
-       : "+r" (ret), "=&r" (val), "=" GCC_OFF_SMALL_ASM() (*uaddr)
-       : GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval),
+       : "+r" (ret), "=&r" (val), "=ZC" (*uaddr)
+       : "ZC" (*uaddr), "Jr" (oldval), "Jr" (newval),
          "i" (-EFAULT)
        : "memory", "t0");
 
index ace3ea6da72ea8be0eebc473b4c384237421c33b..149b2123e7f4ff239537bcdc79b4d28d742f9a0a 100644 (file)
@@ -35,9 +35,6 @@ static inline bool on_irq_stack(int cpu, unsigned long sp)
        return (low <= sp && sp <= high);
 }
 
-int get_ipi_irq(void);
-int get_pmc_irq(void);
-int get_timer_irq(void);
 void spurious_interrupt(void);
 
 #define NR_IRQS_LEGACY 16
@@ -48,6 +45,14 @@ void arch_trigger_cpumask_backtrace(const struct cpumask *mask, bool exclude_sel
 #define MAX_IO_PICS 2
 #define NR_IRQS        (64 + (256 * MAX_IO_PICS))
 
+struct acpi_vector_group {
+       int node;
+       int pci_segment;
+       struct irq_domain *parent;
+};
+extern struct acpi_vector_group pch_group[MAX_IO_PICS];
+extern struct acpi_vector_group msi_group[MAX_IO_PICS];
+
 #define CORES_PER_EIO_NODE     4
 
 #define LOONGSON_CPU_UART0_VEC         10 /* CPU UART0 */
@@ -79,15 +84,6 @@ void arch_trigger_cpumask_backtrace(const struct cpumask *mask, bool exclude_sel
 extern int find_pch_pic(u32 gsi);
 extern int eiointc_get_node(int id);
 
-static inline void eiointc_enable(void)
-{
-       uint64_t misc;
-
-       misc = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
-       misc |= IOCSR_MISC_FUNC_EXT_IOI_EN;
-       iocsr_write64(misc, LOONGARCH_IOCSR_MISC_FUNC);
-}
-
 struct acpi_madt_lio_pic;
 struct acpi_madt_eio_pic;
 struct acpi_madt_ht_pic;
@@ -95,21 +91,29 @@ struct acpi_madt_bio_pic;
 struct acpi_madt_msi_pic;
 struct acpi_madt_lpc_pic;
 
-struct irq_domain *loongarch_cpu_irq_init(void);
-
-struct irq_domain *liointc_acpi_init(struct irq_domain *parent,
+int liointc_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_lio_pic *acpi_liointc);
-struct irq_domain *eiointc_acpi_init(struct irq_domain *parent,
+int eiointc_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_eio_pic *acpi_eiointc);
 
 struct irq_domain *htvec_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_ht_pic *acpi_htvec);
-struct irq_domain *pch_lpc_acpi_init(struct irq_domain *parent,
+int pch_lpc_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_lpc_pic *acpi_pchlpc);
-struct irq_domain *pch_msi_acpi_init(struct irq_domain *parent,
+#if IS_ENABLED(CONFIG_LOONGSON_PCH_MSI)
+int pch_msi_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_msi_pic *acpi_pchmsi);
-struct irq_domain *pch_pic_acpi_init(struct irq_domain *parent,
+#else
+static inline int pch_msi_acpi_init(struct irq_domain *parent,
+                                       struct acpi_madt_msi_pic *acpi_pchmsi)
+{
+       return 0;
+}
+#endif
+int pch_pic_acpi_init(struct irq_domain *parent,
                                        struct acpi_madt_bio_pic *acpi_pchpic);
+int find_pch_pic(u32 gsi);
+struct fwnode_handle *get_pch_msi_handle(int pci_segment);
 
 extern struct acpi_madt_lio_pic *acpi_liointc;
 extern struct acpi_madt_eio_pic *acpi_eiointc[MAX_IO_PICS];
@@ -119,11 +123,10 @@ extern struct acpi_madt_lpc_pic *acpi_pchlpc;
 extern struct acpi_madt_msi_pic *acpi_pchmsi[MAX_IO_PICS];
 extern struct acpi_madt_bio_pic *acpi_pchpic[MAX_IO_PICS];
 
-extern struct irq_domain *cpu_domain;
-extern struct irq_domain *liointc_domain;
-extern struct irq_domain *pch_lpc_domain;
-extern struct irq_domain *pch_msi_domain[MAX_IO_PICS];
-extern struct irq_domain *pch_pic_domain[MAX_IO_PICS];
+extern struct fwnode_handle *cpuintc_handle;
+extern struct fwnode_handle *liointc_handle;
+extern struct fwnode_handle *pch_lpc_handle;
+extern struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
 
 extern irqreturn_t loongson3_ipi_interrupt(int irq, void *dev);
 
index 52121cd791fe1a0081e38829fef5cb8ff8ae514d..319a8c616f1f5b60097c30a24f9f24682b9282cc 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/compiler.h>
 #include <linux/stringify.h>
-#include <asm/compiler.h>
 #include <asm/loongarch.h>
 
 static inline void arch_local_irq_enable(void)
index 2052a2267337d7bb1d3628e040ae3010e39e9d94..65fbbae9fc4da7b82f02d97499b40285491a2f44 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/bitops.h>
 #include <linux/atomic.h>
 #include <asm/cmpxchg.h>
-#include <asm/compiler.h>
 
 typedef struct {
        atomic_long_t a;
index 6a8038725ba77f530dc6c3f586f7bd645b9e40fa..6e8f6972ceb614c9cd96b3814063006507d71064 100644 (file)
@@ -39,18 +39,6 @@ extern const struct plat_smp_ops loongson3_smp_ops;
 
 #define MAX_PACKAGES 16
 
-/* Chip Config register of each physical cpu package */
-extern u64 loongson_chipcfg[MAX_PACKAGES];
-#define LOONGSON_CHIPCFG(id) (*(volatile u32 *)(loongson_chipcfg[id]))
-
-/* Chip Temperature register of each physical cpu package */
-extern u64 loongson_chiptemp[MAX_PACKAGES];
-#define LOONGSON_CHIPTEMP(id) (*(volatile u32 *)(loongson_chiptemp[id]))
-
-/* Freq Control register of each physical cpu package */
-extern u64 loongson_freqctrl[MAX_PACKAGES];
-#define LOONGSON_FREQCTRL(id) (*(volatile u32 *)(loongson_freqctrl[id]))
-
 #define xconf_readl(addr) readl(addr)
 #define xconf_readq(addr) readq(addr)
 
@@ -58,7 +46,7 @@ static inline void xconf_writel(u32 val, volatile void __iomem *addr)
 {
        asm volatile (
        "       st.w    %[v], %[hw], 0  \n"
-       "       ld.b    $r0, %[hw], 0   \n"
+       "       ld.b    $zero, %[hw], 0 \n"
        :
        : [hw] "r" (addr), [v] "r" (val)
        );
@@ -68,7 +56,7 @@ static inline void xconf_writeq(u64 val64, volatile void __iomem *addr)
 {
        asm volatile (
        "       st.d    %[v], %[hw], 0  \n"
-       "       ld.b    $r0, %[hw], 0   \n"
+       "       ld.b    $zero, %[hw], 0 \n"
        :
        : [hw] "r" (addr),  [v] "r" (val64)
        );
index 26483e396ad12c386e6e615ac23d100822e0fb80..6b5c2a7aa706688328d48943cb886715fb1fbda6 100644 (file)
 static __always_inline void prepare_frametrace(struct pt_regs *regs)
 {
        __asm__ __volatile__(
-               /* Save $r1 */
+               /* Save $ra */
                STORE_ONE_REG(1)
-               /* Use $r1 to save PC */
-               "pcaddi $r1, 0\n\t"
-               STR_LONG_S " $r1, %0\n\t"
-               /* Restore $r1 */
-               STR_LONG_L " $r1, %1, "STR_LONGSIZE"\n\t"
+               /* Use $ra to save PC */
+               "pcaddi $ra, 0\n\t"
+               STR_LONG_S " $ra, %0\n\t"
+               /* Restore $ra */
+               STR_LONG_L " $ra, %1, "STR_LONGSIZE"\n\t"
                STORE_ONE_REG(2)
                STORE_ONE_REG(3)
                STORE_ONE_REG(4)
index 99beb11c2fa80a99e67e60cb41e9167038280b7d..b7dd9f19a5a9c04eb6c3a92c312bb3d2eeec8023 100644 (file)
@@ -44,14 +44,14 @@ struct thread_info {
 }
 
 /* How to get the thread information struct from C. */
-register struct thread_info *__current_thread_info __asm__("$r2");
+register struct thread_info *__current_thread_info __asm__("$tp");
 
 static inline struct thread_info *current_thread_info(void)
 {
        return __current_thread_info;
 }
 
-register unsigned long current_stack_pointer __asm__("$r3");
+register unsigned long current_stack_pointer __asm__("$sp");
 
 #endif /* !__ASSEMBLY__ */
 
index 217c6a3727b129d33993700468cd79643c743a05..2b44edc604a282ba3ed3b26a7843b1f713ed1be1 100644 (file)
@@ -162,7 +162,7 @@ do {                                                                        \
        "2:                                                     \n"     \
        "       .section .fixup,\"ax\"                          \n"     \
        "3:     li.w    %0, %3                                  \n"     \
-       "       or      %1, $r0, $r0                            \n"     \
+       "       move    %1, $zero                               \n"     \
        "       b       2b                                      \n"     \
        "       .previous                                       \n"     \
        "       .section __ex_table,\"a\"                       \n"     \
index bb729ee8a23701391283f472369c9333ea9225b0..03aa14581d0a2a5ce2bf958033350a1949a6f7a4 100644 (file)
@@ -25,7 +25,6 @@ EXPORT_SYMBOL(acpi_pci_disabled);
 int acpi_strict = 1; /* We have no workarounds on LoongArch */
 int num_processors;
 int disabled_cpus;
-enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
 
 u64 acpi_saved_sp;
 
@@ -33,70 +32,6 @@ u64 acpi_saved_sp;
 
 #define PREFIX                 "ACPI: "
 
-int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
-{
-       if (irqp != NULL)
-               *irqp = acpi_register_gsi(NULL, gsi, -1, -1);
-       return (*irqp >= 0) ? 0 : -EINVAL;
-}
-EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
-
-int acpi_isa_irq_to_gsi(unsigned int isa_irq, u32 *gsi)
-{
-       if (gsi)
-               *gsi = isa_irq;
-       return 0;
-}
-
-/*
- * success: return IRQ number (>=0)
- * failure: return < 0
- */
-int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
-{
-       struct irq_fwspec fwspec;
-
-       switch (gsi) {
-       case GSI_MIN_CPU_IRQ ... GSI_MAX_CPU_IRQ:
-               fwspec.fwnode = liointc_domain->fwnode;
-               fwspec.param[0] = gsi - GSI_MIN_CPU_IRQ;
-               fwspec.param_count = 1;
-
-               return irq_create_fwspec_mapping(&fwspec);
-
-       case GSI_MIN_LPC_IRQ ... GSI_MAX_LPC_IRQ:
-               if (!pch_lpc_domain)
-                       return -EINVAL;
-
-               fwspec.fwnode = pch_lpc_domain->fwnode;
-               fwspec.param[0] = gsi - GSI_MIN_LPC_IRQ;
-               fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity);
-               fwspec.param_count = 2;
-
-               return irq_create_fwspec_mapping(&fwspec);
-
-       case GSI_MIN_PCH_IRQ ... GSI_MAX_PCH_IRQ:
-               if (!pch_pic_domain[0])
-                       return -EINVAL;
-
-               fwspec.fwnode = pch_pic_domain[0]->fwnode;
-               fwspec.param[0] = gsi - GSI_MIN_PCH_IRQ;
-               fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
-               fwspec.param_count = 2;
-
-               return irq_create_fwspec_mapping(&fwspec);
-       }
-
-       return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(acpi_register_gsi);
-
-void acpi_unregister_gsi(u32 gsi)
-{
-
-}
-EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
-
 void __init __iomem * __acpi_map_table(unsigned long phys, unsigned long size)
 {
 
index b38f5489d0945fd56f19128cb2192ec7eea7671e..4662b06269f42eea27830bd2439fc693b4e487b5 100644 (file)
@@ -4,8 +4,9 @@
  *
  * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  */
-#include <asm/cpu-info.h>
 #include <linux/cacheinfo.h>
+#include <asm/bootinfo.h>
+#include <asm/cpu-info.h>
 
 /* Populates leaf and increments to next leaf */
 #define populate_cache(cache, leaf, c_level, c_type)           \
@@ -17,6 +18,8 @@ do {                                                          \
        leaf->ways_of_associativity = c->cache.ways;            \
        leaf->size = c->cache.linesz * c->cache.sets *          \
                c->cache.ways;                                  \
+       if (leaf->level > 2)                                    \
+               leaf->size *= nodes_per_package;                \
        leaf++;                                                 \
 } while (0)
 
@@ -95,11 +98,15 @@ static void cache_cpumap_setup(unsigned int cpu)
 
 int populate_cache_leaves(unsigned int cpu)
 {
-       int level = 1;
+       int level = 1, nodes_per_package = 1;
        struct cpuinfo_loongarch *c = &current_cpu_data;
        struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
        struct cacheinfo *this_leaf = this_cpu_ci->info_list;
 
+       if (loongson_sysconf.nr_nodes > 1)
+               nodes_per_package = loongson_sysconf.cores_per_package
+                                       / loongson_sysconf.cores_per_node;
+
        if (c->icache.waysize) {
                populate_cache(dcache, this_leaf, level, CACHE_TYPE_DATA);
                populate_cache(icache, this_leaf, level++, CACHE_TYPE_INST);
index d5b3dbcf5425205e87f8c3a6e817693ca5ae6aca..d53b631c90227cc4bbaf06192b90404afcc53493 100644 (file)
@@ -27,7 +27,7 @@ SYM_FUNC_START(handle_syscall)
 
        addi.d  sp, sp, -PT_SIZE
        cfi_st  t2, PT_R3
-       cfi_rel_offset  sp, PT_R3
+       cfi_rel_offset  sp, PT_R3
        st.d    zero, sp, PT_R0
        csrrd   t2, LOONGARCH_CSR_PRMD
        st.d    t2, sp, PT_PRMD
@@ -50,7 +50,7 @@ SYM_FUNC_START(handle_syscall)
        cfi_st  a7, PT_R11
        csrrd   ra, LOONGARCH_CSR_ERA
        st.d    ra, sp, PT_ERA
-       cfi_rel_offset ra, PT_ERA
+       cfi_rel_offset  ra, PT_ERA
 
        cfi_st  tp, PT_R2
        cfi_st  u0, PT_R21
index 467946ecf4513d0b21a2c81dd8066504dfc6f509..82b478a5c665746e90ed72dc17b00d6c6089807e 100644 (file)
@@ -17,21 +17,6 @@ u64 efi_system_table;
 struct loongson_system_configuration loongson_sysconf;
 EXPORT_SYMBOL(loongson_sysconf);
 
-u64 loongson_chipcfg[MAX_PACKAGES];
-u64 loongson_chiptemp[MAX_PACKAGES];
-u64 loongson_freqctrl[MAX_PACKAGES];
-unsigned long long smp_group[MAX_PACKAGES];
-
-static void __init register_addrs_set(u64 *registers, const u64 addr, int num)
-{
-       u64 i;
-
-       for (i = 0; i < num; i++) {
-               *registers = (i << 44) | addr;
-               registers++;
-       }
-}
-
 void __init init_environ(void)
 {
        int efi_boot = fw_arg0;
@@ -50,11 +35,6 @@ void __init init_environ(void)
        efi_memmap_init_early(&data);
        memblock_reserve(data.phys_map & PAGE_MASK,
                         PAGE_ALIGN(data.size + (data.phys_map & ~PAGE_MASK)));
-
-       register_addrs_set(smp_group, TO_UNCACHE(0x1fe01000), 16);
-       register_addrs_set(loongson_chipcfg, TO_UNCACHE(0x1fe00180), 16);
-       register_addrs_set(loongson_chiptemp, TO_UNCACHE(0x1fe0019c), 16);
-       register_addrs_set(loongson_freqctrl, TO_UNCACHE(0x1fe001d0), 16);
 }
 
 static int __init init_cpu_fullname(void)
index a631a7137667bfce45c6adfdc2666c180abb0b0b..576b3370a296da0e0db3b710df2f682e6b628a12 100644 (file)
        .endm
 
        .macro sc_save_fp base
-       EX      fst.d $f0,  \base, (0 * FPU_REG_WIDTH)
-       EX      fst.d $f1,  \base, (1 * FPU_REG_WIDTH)
-       EX      fst.d $f2,  \base, (2 * FPU_REG_WIDTH)
-       EX      fst.d $f3,  \base, (3 * FPU_REG_WIDTH)
-       EX      fst.d $f4,  \base, (4 * FPU_REG_WIDTH)
-       EX      fst.d $f5,  \base, (5 * FPU_REG_WIDTH)
-       EX      fst.d $f6,  \base, (6 * FPU_REG_WIDTH)
-       EX      fst.d $f7,  \base, (7 * FPU_REG_WIDTH)
-       EX      fst.d $f8,  \base, (8 * FPU_REG_WIDTH)
-       EX      fst.d $f9,  \base, (9 * FPU_REG_WIDTH)
-       EX      fst.d $f10, \base, (10 * FPU_REG_WIDTH)
-       EX      fst.d $f11, \base, (11 * FPU_REG_WIDTH)
-       EX      fst.d $f12, \base, (12 * FPU_REG_WIDTH)
-       EX      fst.d $f13, \base, (13 * FPU_REG_WIDTH)
-       EX      fst.d $f14, \base, (14 * FPU_REG_WIDTH)
-       EX      fst.d $f15, \base, (15 * FPU_REG_WIDTH)
-       EX      fst.d $f16, \base, (16 * FPU_REG_WIDTH)
-       EX      fst.d $f17, \base, (17 * FPU_REG_WIDTH)
-       EX      fst.d $f18, \base, (18 * FPU_REG_WIDTH)
-       EX      fst.d $f19, \base, (19 * FPU_REG_WIDTH)
-       EX      fst.d $f20, \base, (20 * FPU_REG_WIDTH)
-       EX      fst.d $f21, \base, (21 * FPU_REG_WIDTH)
-       EX      fst.d $f22, \base, (22 * FPU_REG_WIDTH)
-       EX      fst.d $f23, \base, (23 * FPU_REG_WIDTH)
-       EX      fst.d $f24, \base, (24 * FPU_REG_WIDTH)
-       EX      fst.d $f25, \base, (25 * FPU_REG_WIDTH)
-       EX      fst.d $f26, \base, (26 * FPU_REG_WIDTH)
-       EX      fst.d $f27, \base, (27 * FPU_REG_WIDTH)
-       EX      fst.d $f28, \base, (28 * FPU_REG_WIDTH)
-       EX      fst.d $f29, \base, (29 * FPU_REG_WIDTH)
-       EX      fst.d $f30, \base, (30 * FPU_REG_WIDTH)
-       EX      fst.d $f31, \base, (31 * FPU_REG_WIDTH)
+       EX      fst.d   $f0,  \base, (0 * FPU_REG_WIDTH)
+       EX      fst.d   $f1,  \base, (1 * FPU_REG_WIDTH)
+       EX      fst.d   $f2,  \base, (2 * FPU_REG_WIDTH)
+       EX      fst.d   $f3,  \base, (3 * FPU_REG_WIDTH)
+       EX      fst.d   $f4,  \base, (4 * FPU_REG_WIDTH)
+       EX      fst.d   $f5,  \base, (5 * FPU_REG_WIDTH)
+       EX      fst.d   $f6,  \base, (6 * FPU_REG_WIDTH)
+       EX      fst.d   $f7,  \base, (7 * FPU_REG_WIDTH)
+       EX      fst.d   $f8,  \base, (8 * FPU_REG_WIDTH)
+       EX      fst.d   $f9,  \base, (9 * FPU_REG_WIDTH)
+       EX      fst.d   $f10, \base, (10 * FPU_REG_WIDTH)
+       EX      fst.d   $f11, \base, (11 * FPU_REG_WIDTH)
+       EX      fst.d   $f12, \base, (12 * FPU_REG_WIDTH)
+       EX      fst.d   $f13, \base, (13 * FPU_REG_WIDTH)
+       EX      fst.d   $f14, \base, (14 * FPU_REG_WIDTH)
+       EX      fst.d   $f15, \base, (15 * FPU_REG_WIDTH)
+       EX      fst.d   $f16, \base, (16 * FPU_REG_WIDTH)
+       EX      fst.d   $f17, \base, (17 * FPU_REG_WIDTH)
+       EX      fst.d   $f18, \base, (18 * FPU_REG_WIDTH)
+       EX      fst.d   $f19, \base, (19 * FPU_REG_WIDTH)
+       EX      fst.d   $f20, \base, (20 * FPU_REG_WIDTH)
+       EX      fst.d   $f21, \base, (21 * FPU_REG_WIDTH)
+       EX      fst.d   $f22, \base, (22 * FPU_REG_WIDTH)
+       EX      fst.d   $f23, \base, (23 * FPU_REG_WIDTH)
+       EX      fst.d   $f24, \base, (24 * FPU_REG_WIDTH)
+       EX      fst.d   $f25, \base, (25 * FPU_REG_WIDTH)
+       EX      fst.d   $f26, \base, (26 * FPU_REG_WIDTH)
+       EX      fst.d   $f27, \base, (27 * FPU_REG_WIDTH)
+       EX      fst.d   $f28, \base, (28 * FPU_REG_WIDTH)
+       EX      fst.d   $f29, \base, (29 * FPU_REG_WIDTH)
+       EX      fst.d   $f30, \base, (30 * FPU_REG_WIDTH)
+       EX      fst.d   $f31, \base, (31 * FPU_REG_WIDTH)
        .endm
 
        .macro sc_restore_fp base
-       EX      fld.d $f0,  \base, (0 * FPU_REG_WIDTH)
-       EX      fld.d $f1,  \base, (1 * FPU_REG_WIDTH)
-       EX      fld.d $f2,  \base, (2 * FPU_REG_WIDTH)
-       EX      fld.d $f3,  \base, (3 * FPU_REG_WIDTH)
-       EX      fld.d $f4,  \base, (4 * FPU_REG_WIDTH)
-       EX      fld.d $f5,  \base, (5 * FPU_REG_WIDTH)
-       EX      fld.d $f6,  \base, (6 * FPU_REG_WIDTH)
-       EX      fld.d $f7,  \base, (7 * FPU_REG_WIDTH)
-       EX      fld.d $f8,  \base, (8 * FPU_REG_WIDTH)
-       EX      fld.d $f9,  \base, (9 * FPU_REG_WIDTH)
-       EX      fld.d $f10, \base, (10 * FPU_REG_WIDTH)
-       EX      fld.d $f11, \base, (11 * FPU_REG_WIDTH)
-       EX      fld.d $f12, \base, (12 * FPU_REG_WIDTH)
-       EX      fld.d $f13, \base, (13 * FPU_REG_WIDTH)
-       EX      fld.d $f14, \base, (14 * FPU_REG_WIDTH)
-       EX      fld.d $f15, \base, (15 * FPU_REG_WIDTH)
-       EX      fld.d $f16, \base, (16 * FPU_REG_WIDTH)
-       EX      fld.d $f17, \base, (17 * FPU_REG_WIDTH)
-       EX      fld.d $f18, \base, (18 * FPU_REG_WIDTH)
-       EX      fld.d $f19, \base, (19 * FPU_REG_WIDTH)
-       EX      fld.d $f20, \base, (20 * FPU_REG_WIDTH)
-       EX      fld.d $f21, \base, (21 * FPU_REG_WIDTH)
-       EX      fld.d $f22, \base, (22 * FPU_REG_WIDTH)
-       EX      fld.d $f23, \base, (23 * FPU_REG_WIDTH)
-       EX      fld.d $f24, \base, (24 * FPU_REG_WIDTH)
-       EX      fld.d $f25, \base, (25 * FPU_REG_WIDTH)
-       EX      fld.d $f26, \base, (26 * FPU_REG_WIDTH)
-       EX      fld.d $f27, \base, (27 * FPU_REG_WIDTH)
-       EX      fld.d $f28, \base, (28 * FPU_REG_WIDTH)
-       EX      fld.d $f29, \base, (29 * FPU_REG_WIDTH)
-       EX      fld.d $f30, \base, (30 * FPU_REG_WIDTH)
-       EX      fld.d $f31, \base, (31 * FPU_REG_WIDTH)
+       EX      fld.d   $f0,  \base, (0 * FPU_REG_WIDTH)
+       EX      fld.d   $f1,  \base, (1 * FPU_REG_WIDTH)
+       EX      fld.d   $f2,  \base, (2 * FPU_REG_WIDTH)
+       EX      fld.d   $f3,  \base, (3 * FPU_REG_WIDTH)
+       EX      fld.d   $f4,  \base, (4 * FPU_REG_WIDTH)
+       EX      fld.d   $f5,  \base, (5 * FPU_REG_WIDTH)
+       EX      fld.d   $f6,  \base, (6 * FPU_REG_WIDTH)
+       EX      fld.d   $f7,  \base, (7 * FPU_REG_WIDTH)
+       EX      fld.d   $f8,  \base, (8 * FPU_REG_WIDTH)
+       EX      fld.d   $f9,  \base, (9 * FPU_REG_WIDTH)
+       EX      fld.d   $f10, \base, (10 * FPU_REG_WIDTH)
+       EX      fld.d   $f11, \base, (11 * FPU_REG_WIDTH)
+       EX      fld.d   $f12, \base, (12 * FPU_REG_WIDTH)
+       EX      fld.d   $f13, \base, (13 * FPU_REG_WIDTH)
+       EX      fld.d   $f14, \base, (14 * FPU_REG_WIDTH)
+       EX      fld.d   $f15, \base, (15 * FPU_REG_WIDTH)
+       EX      fld.d   $f16, \base, (16 * FPU_REG_WIDTH)
+       EX      fld.d   $f17, \base, (17 * FPU_REG_WIDTH)
+       EX      fld.d   $f18, \base, (18 * FPU_REG_WIDTH)
+       EX      fld.d   $f19, \base, (19 * FPU_REG_WIDTH)
+       EX      fld.d   $f20, \base, (20 * FPU_REG_WIDTH)
+       EX      fld.d   $f21, \base, (21 * FPU_REG_WIDTH)
+       EX      fld.d   $f22, \base, (22 * FPU_REG_WIDTH)
+       EX      fld.d   $f23, \base, (23 * FPU_REG_WIDTH)
+       EX      fld.d   $f24, \base, (24 * FPU_REG_WIDTH)
+       EX      fld.d   $f25, \base, (25 * FPU_REG_WIDTH)
+       EX      fld.d   $f26, \base, (26 * FPU_REG_WIDTH)
+       EX      fld.d   $f27, \base, (27 * FPU_REG_WIDTH)
+       EX      fld.d   $f28, \base, (28 * FPU_REG_WIDTH)
+       EX      fld.d   $f29, \base, (29 * FPU_REG_WIDTH)
+       EX      fld.d   $f30, \base, (30 * FPU_REG_WIDTH)
+       EX      fld.d   $f31, \base, (31 * FPU_REG_WIDTH)
        .endm
 
        .macro sc_save_fcc base, tmp0, tmp1
        movcf2gr        \tmp0, $fcc0
-       move    \tmp1, \tmp0
+       move            \tmp1, \tmp0
        movcf2gr        \tmp0, $fcc1
        bstrins.d       \tmp1, \tmp0, 15, 8
        movcf2gr        \tmp0, $fcc2
        bstrins.d       \tmp1, \tmp0, 55, 48
        movcf2gr        \tmp0, $fcc7
        bstrins.d       \tmp1, \tmp0, 63, 56
-       EX      st.d \tmp1, \base, 0
+       EX      st.d    \tmp1, \base, 0
        .endm
 
        .macro sc_restore_fcc base, tmp0, tmp1
-       EX      ld.d \tmp0, \base, 0
+       EX      ld.d    \tmp0, \base, 0
        bstrpick.d      \tmp1, \tmp0, 7, 0
        movgr2cf        $fcc0, \tmp1
        bstrpick.d      \tmp1, \tmp0, 15, 8
 
        .macro sc_save_fcsr base, tmp0
        movfcsr2gr      \tmp0, fcsr0
-       EX      st.w \tmp0, \base, 0
+       EX      st.w    \tmp0, \base, 0
        .endm
 
        .macro sc_restore_fcsr base, tmp0
-       EX      ld.w \tmp0, \base, 0
+       EX      ld.w    \tmp0, \base, 0
        movgr2fcsr      fcsr0, \tmp0
        .endm
 
  */
 SYM_FUNC_START(_save_fp)
        fpu_save_csr    a0 t1
-       fpu_save_double a0 t1                   # clobbers t1
+       fpu_save_double a0 t1                   # clobbers t1
        fpu_save_cc     a0 t1 t2                # clobbers t1, t2
-       jirl zero, ra, 0
+       jr              ra
 SYM_FUNC_END(_save_fp)
 EXPORT_SYMBOL(_save_fp)
 
@@ -161,10 +161,10 @@ EXPORT_SYMBOL(_save_fp)
  * Restore a thread's fp context.
  */
 SYM_FUNC_START(_restore_fp)
-       fpu_restore_double a0 t1                # clobbers t1
-       fpu_restore_csr a0 t1
-       fpu_restore_cc  a0 t1 t2                # clobbers t1, t2
-       jirl zero, ra, 0
+       fpu_restore_double      a0 t1           # clobbers t1
+       fpu_restore_csr         a0 t1
+       fpu_restore_cc          a0 t1 t2        # clobbers t1, t2
+       jr                      ra
 SYM_FUNC_END(_restore_fp)
 
 /*
@@ -216,7 +216,7 @@ SYM_FUNC_START(_init_fpu)
        movgr2fr.d      $f30, t1
        movgr2fr.d      $f31, t1
 
-       jirl zero, ra, 0
+       jr      ra
 SYM_FUNC_END(_init_fpu)
 
 /*
@@ -225,11 +225,11 @@ SYM_FUNC_END(_init_fpu)
  * a2: fcsr
  */
 SYM_FUNC_START(_save_fp_context)
-       sc_save_fcc a1 t1 t2
-       sc_save_fcsr a2 t1
-       sc_save_fp a0
-       li.w    a0, 0                                   # success
-       jirl zero, ra, 0
+       sc_save_fcc     a1 t1 t2
+       sc_save_fcsr    a2 t1
+       sc_save_fp      a0
+       li.w            a0, 0                           # success
+       jr              ra
 SYM_FUNC_END(_save_fp_context)
 
 /*
@@ -238,14 +238,14 @@ SYM_FUNC_END(_save_fp_context)
  * a2: fcsr
  */
 SYM_FUNC_START(_restore_fp_context)
-       sc_restore_fp a0
-       sc_restore_fcc a1 t1 t2
-       sc_restore_fcsr a2 t1
-       li.w    a0, 0                                   # success
-       jirl zero, ra, 0
+       sc_restore_fp   a0
+       sc_restore_fcc  a1 t1 t2
+       sc_restore_fcsr a2 t1
+       li.w            a0, 0                           # success
+       jr              ra
 SYM_FUNC_END(_restore_fp_context)
 
 SYM_FUNC_START(fault)
        li.w    a0, -EFAULT                             # failure
-       jirl zero, ra, 0
+       jr      ra
 SYM_FUNC_END(fault)
index 93496852b3cc610d211fca7abb3fccc73efe1b74..75e5be807a0d5004feb5f1e6eb42f8bcc9efef5f 100644 (file)
@@ -28,23 +28,23 @@ SYM_FUNC_START(__arch_cpu_idle)
        nop
        idle    0
        /* end of rollback region */
-1:     jirl    zero, ra, 0
+1:     jr      ra
 SYM_FUNC_END(__arch_cpu_idle)
 
 SYM_FUNC_START(handle_vint)
        BACKUP_T0T1
        SAVE_ALL
        la.abs  t1, __arch_cpu_idle
-       LONG_L  t0, sp, PT_ERA
+       LONG_L  t0, sp, PT_ERA
        /* 32 byte rollback region */
        ori     t0, t0, 0x1f
        xori    t0, t0, 0x1f
        bne     t0, t1, 1f
-       LONG_S  t0, sp, PT_ERA
+       LONG_S  t0, sp, PT_ERA
 1:     move    a0, sp
        move    a1, sp
        la.abs  t0, do_vint
-       jirl    ra, t0, 0
+       jirl    ra, t0, 0
        RESTORE_ALL_AND_RET
 SYM_FUNC_END(handle_vint)
 
@@ -72,7 +72,7 @@ SYM_FUNC_END(except_vec_cex)
        build_prep_\prep
        move    a0, sp
        la.abs  t0, do_\handler
-       jirl    ra, t0, 0
+       jirl    ra, t0, 0
        RESTORE_ALL_AND_RET
        SYM_FUNC_END(handle_\exception)
        .endm
@@ -91,5 +91,5 @@ SYM_FUNC_END(except_vec_cex)
 
 SYM_FUNC_START(handle_sys)
        la.abs  t0, handle_syscall
-       jirl    zero, t0, 0
+       jr      t0
 SYM_FUNC_END(handle_sys)
index d01e62dd414f20b73985eb9a5a8ef2b9eb788e09..7062cdf0e33e598f6e9b62dc0c530c179ba62cab 100644 (file)
@@ -32,7 +32,7 @@ SYM_CODE_START(kernel_entry)                  # kernel entry point
        /* We might not get launched at the address the kernel is linked to,
           so we jump there.  */
        la.abs          t0, 0f
-       jirl            zero, t0, 0
+       jr              t0
 0:
        la              t0, __bss_start         # clear .bss
        st.d            zero, t0, 0
@@ -50,7 +50,7 @@ SYM_CODE_START(kernel_entry)                  # kernel entry point
        /* KSave3 used for percpu base, initialized as 0 */
        csrwr           zero, PERCPU_BASE_KS
        /* GPR21 used for percpu base (runtime), initialized as 0 */
-       or              u0, zero, zero
+       move            u0, zero
 
        la              tp, init_thread_union
        /* Set the SP after an empty pt_regs.  */
@@ -85,8 +85,8 @@ SYM_CODE_START(smpboot_entry)
        ld.d            sp, t0, CPU_BOOT_STACK
        ld.d            tp, t0, CPU_BOOT_TINFO
 
-       la.abs  t0, 0f
-       jirl    zero, t0, 0
+       la.abs          t0, 0f
+       jr              t0
 0:
        bl              start_secondary
 SYM_CODE_END(smpboot_entry)
index b34b8d792aa4d2dc2f3545d881484256b650cbec..1ba19c76563e9bd7fe0381f54bde68f67f7a7768 100644 (file)
@@ -25,12 +25,8 @@ 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;
-struct irq_domain *pch_lpc_domain;
-struct irq_domain *pch_msi_domain[MAX_IO_PICS];
-struct irq_domain *pch_pic_domain[MAX_IO_PICS];
-
+struct acpi_vector_group pch_group[MAX_IO_PICS];
+struct acpi_vector_group msi_group[MAX_IO_PICS];
 /*
  * 'what should we do if we get a hw irq event on an illegal vector'.
  * each architecture has to answer this themselves.
@@ -56,6 +52,51 @@ int arch_show_interrupts(struct seq_file *p, int prec)
        return 0;
 }
 
+static int __init early_pci_mcfg_parse(struct acpi_table_header *header)
+{
+       struct acpi_table_mcfg *mcfg;
+       struct acpi_mcfg_allocation *mptr;
+       int i, n;
+
+       if (header->length < sizeof(struct acpi_table_mcfg))
+               return -EINVAL;
+
+       n = (header->length - sizeof(struct acpi_table_mcfg)) /
+                                       sizeof(struct acpi_mcfg_allocation);
+       mcfg = (struct acpi_table_mcfg *)header;
+       mptr = (struct acpi_mcfg_allocation *) &mcfg[1];
+
+       for (i = 0; i < n; i++, mptr++) {
+               msi_group[i].pci_segment = mptr->pci_segment;
+               pch_group[i].node = msi_group[i].node = (mptr->address >> 44) & 0xf;
+       }
+
+       return 0;
+}
+
+static void __init init_vec_parent_group(void)
+{
+       int i;
+
+       for (i = 0; i < MAX_IO_PICS; i++) {
+               msi_group[i].pci_segment = -1;
+               msi_group[i].node = -1;
+               pch_group[i].node = -1;
+       }
+
+       acpi_table_parse(ACPI_SIG_MCFG, early_pci_mcfg_parse);
+}
+
+static int __init get_ipi_irq(void)
+{
+       struct irq_domain *d = irq_find_matching_fwnode(cpuintc_handle, DOMAIN_BUS_ANY);
+
+       if (d)
+               return irq_create_mapping(d, EXCCODE_IPI - EXCCODE_INT_START);
+
+       return -EINVAL;
+}
+
 void __init init_IRQ(void)
 {
        int i;
@@ -69,9 +110,12 @@ void __init init_IRQ(void)
        clear_csr_ecfg(ECFG0_IM);
        clear_csr_estat(ESTATF_IP);
 
+       init_vec_parent_group();
        irqchip_init();
 #ifdef CONFIG_SMP
-       ipi_irq = EXCCODE_IPI - EXCCODE_INT_START;
+       ipi_irq = get_ipi_irq();
+       if (ipi_irq < 0)
+               panic("IPI IRQ mapping failed\n");
        irq_set_percpu_devid(ipi_irq);
        r = request_percpu_irq(ipi_irq, loongson3_ipi_interrupt, "IPI", &ipi_dummy_dev);
        if (r < 0)
index e6ab87948e1d3e4d975da6e54db0be18f96a0bb8..dc2b82ea894cd26c1c3d662e488145d82d1fba0d 100644 (file)
@@ -193,7 +193,7 @@ static int fpr_set(struct task_struct *target,
                   const void *kbuf, const void __user *ubuf)
 {
        const int fcc_start = NUM_FPU_REGS * sizeof(elf_fpreg_t);
-       const int fcc_end = fcc_start + sizeof(u64);
+       const int fcsr_start = fcc_start + sizeof(u64);
        int err;
 
        BUG_ON(count % sizeof(elf_fpreg_t));
@@ -209,10 +209,12 @@ static int fpr_set(struct task_struct *target,
        if (err)
                return err;
 
-       if (count > 0)
-               err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf,
-                                         &target->thread.fpu.fcc,
-                                         fcc_start, fcc_end);
+       err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                 &target->thread.fpu.fcc, fcc_start,
+                                 fcc_start + sizeof(u64));
+       err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                 &target->thread.fpu.fcsr, fcsr_start,
+                                 fcsr_start + sizeof(u32));
 
        return err;
 }
index 2b86469e471859ad0f1c595ce460e675a41d6924..800c965a17eaa81dc5b5d94064e7df5a802c4b1f 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/console.h>
 
 #include <acpi/reboot.h>
-#include <asm/compiler.h>
 #include <asm/idle.h>
 #include <asm/loongarch.h>
 #include <asm/reboot.h>
index c74860b53375a51ddab0b9ea4bf5787f7202ac38..8f5c2f9a1a835de4435cec1a5e92439387017697 100644 (file)
@@ -126,7 +126,7 @@ static void __init parse_bios_table(const struct dmi_header *dm)
        char *dmi_data = (char *)dm;
 
        bios_extern = *(dmi_data + SMBIOS_BIOSEXTERN_OFFSET);
-       b_info.bios_size = *(dmi_data + SMBIOS_BIOSSIZE_OFFSET);
+       b_info.bios_size = (*(dmi_data + SMBIOS_BIOSSIZE_OFFSET) + 1) << 6;
 
        if (bios_extern & LOONGSON_EFI_ENABLE)
                set_bit(EFI_BOOT, &efi.flags);
index 73cec62504fbef69542af392c2edc36bd849604e..09743103d9b3eb5549c764ac7f7975737f3dd66b 100644 (file)
@@ -278,116 +278,29 @@ void loongson3_cpu_die(unsigned int cpu)
        mb();
 }
 
-/*
- * The target CPU should go to XKPRANGE (uncached area) and flush
- * ICache/DCache/VCache before the control CPU can safely disable its clock.
- */
-static void loongson3_play_dead(int *state_addr)
+void play_dead(void)
 {
-       register int val;
-       register void *addr;
+       register uint64_t addr;
        register void (*init_fn)(void);
 
-       __asm__ __volatile__(
-               "   li.d %[addr], 0x8000000000000000\n"
-               "1: cacop 0x8, %[addr], 0           \n" /* flush ICache */
-               "   cacop 0x8, %[addr], 1           \n"
-               "   cacop 0x8, %[addr], 2           \n"
-               "   cacop 0x8, %[addr], 3           \n"
-               "   cacop 0x9, %[addr], 0           \n" /* flush DCache */
-               "   cacop 0x9, %[addr], 1           \n"
-               "   cacop 0x9, %[addr], 2           \n"
-               "   cacop 0x9, %[addr], 3           \n"
-               "   addi.w %[sets], %[sets], -1     \n"
-               "   addi.d %[addr], %[addr], 0x40   \n"
-               "   bnez %[sets], 1b                \n"
-               "   li.d %[addr], 0x8000000000000000\n"
-               "2: cacop 0xa, %[addr], 0           \n" /* flush VCache */
-               "   cacop 0xa, %[addr], 1           \n"
-               "   cacop 0xa, %[addr], 2           \n"
-               "   cacop 0xa, %[addr], 3           \n"
-               "   cacop 0xa, %[addr], 4           \n"
-               "   cacop 0xa, %[addr], 5           \n"
-               "   cacop 0xa, %[addr], 6           \n"
-               "   cacop 0xa, %[addr], 7           \n"
-               "   cacop 0xa, %[addr], 8           \n"
-               "   cacop 0xa, %[addr], 9           \n"
-               "   cacop 0xa, %[addr], 10          \n"
-               "   cacop 0xa, %[addr], 11          \n"
-               "   cacop 0xa, %[addr], 12          \n"
-               "   cacop 0xa, %[addr], 13          \n"
-               "   cacop 0xa, %[addr], 14          \n"
-               "   cacop 0xa, %[addr], 15          \n"
-               "   addi.w %[vsets], %[vsets], -1   \n"
-               "   addi.d %[addr], %[addr], 0x40   \n"
-               "   bnez   %[vsets], 2b             \n"
-               "   li.w   %[val], 0x7              \n" /* *state_addr = CPU_DEAD; */
-               "   st.w   %[val], %[state_addr], 0 \n"
-               "   dbar 0                          \n"
-               "   cacop 0x11, %[state_addr], 0    \n" /* flush entry of *state_addr */
-               : [addr] "=&r" (addr), [val] "=&r" (val)
-               : [state_addr] "r" (state_addr),
-                 [sets] "r" (cpu_data[smp_processor_id()].dcache.sets),
-                 [vsets] "r" (cpu_data[smp_processor_id()].vcache.sets));
-
+       idle_task_exit();
        local_irq_enable();
-       change_csr_ecfg(ECFG0_IM, ECFGF_IPI);
+       set_csr_ecfg(ECFGF_IPI);
+       __this_cpu_write(cpu_state, CPU_DEAD);
+
+       __smp_mb();
+       do {
+               __asm__ __volatile__("idle 0\n\t");
+               addr = iocsr_read64(LOONGARCH_IOCSR_MBUF0);
+       } while (addr == 0);
 
-       __asm__ __volatile__(
-               "   idle      0                     \n"
-               "   li.w      $t0, 0x1020           \n"
-               "   iocsrrd.d %[init_fn], $t0       \n" /* Get init PC */
-               : [init_fn] "=&r" (addr)
-               : /* No Input */
-               : "a0");
-       init_fn = __va(addr);
+       init_fn = (void *)TO_CACHE(addr);
+       iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_CLEAR);
 
        init_fn();
        unreachable();
 }
 
-void play_dead(void)
-{
-       int *state_addr;
-       unsigned int cpu = smp_processor_id();
-       void (*play_dead_uncached)(int *s);
-
-       idle_task_exit();
-       play_dead_uncached = (void *)TO_UNCACHE(__pa((unsigned long)loongson3_play_dead));
-       state_addr = &per_cpu(cpu_state, cpu);
-       mb();
-       play_dead_uncached(state_addr);
-}
-
-static int loongson3_enable_clock(unsigned int cpu)
-{
-       uint64_t core_id = cpu_data[cpu].core;
-       uint64_t package_id = cpu_data[cpu].package;
-
-       LOONGSON_FREQCTRL(package_id) |= 1 << (core_id * 4 + 3);
-
-       return 0;
-}
-
-static int loongson3_disable_clock(unsigned int cpu)
-{
-       uint64_t core_id = cpu_data[cpu].core;
-       uint64_t package_id = cpu_data[cpu].package;
-
-       LOONGSON_FREQCTRL(package_id) &= ~(1 << (core_id * 4 + 3));
-
-       return 0;
-}
-
-static int register_loongson3_notifier(void)
-{
-       return cpuhp_setup_state_nocalls(CPUHP_LOONGARCH_SOC_PREPARE,
-                                        "loongarch/loongson:prepare",
-                                        loongson3_enable_clock,
-                                        loongson3_disable_clock);
-}
-early_initcall(register_loongson3_notifier);
-
 #endif
 
 /*
index 53e2fa8e580e96d283b44d6e4755fb92963edcc1..37e84ac8ffc24d66ee6ff1855dad476fe3c80a22 100644 (file)
@@ -24,8 +24,8 @@ SYM_FUNC_START(__switch_to)
        move    tp, a2
        cpu_restore_nonscratch a1
 
-       li.w    t0, _THREAD_SIZE - 32
-       PTR_ADD t0, t0, tp
+       li.w            t0, _THREAD_SIZE - 32
+       PTR_ADD         t0, t0, tp
        set_saved_sp    t0, t1, t2
 
        ldptr.d t1, a1, THREAD_CSRPRMD
index fe6823875895ba80ea37ee947e0a95447cdc4ee8..79dc5eddf504adb943a6dc21e83c1ec3fd4a480b 100644 (file)
@@ -123,6 +123,16 @@ void sync_counter(void)
        csr_write64(-init_timeval, LOONGARCH_CSR_CNTC);
 }
 
+static int get_timer_irq(void)
+{
+       struct irq_domain *d = irq_find_matching_fwnode(cpuintc_handle, DOMAIN_BUS_ANY);
+
+       if (d)
+               return irq_create_mapping(d, EXCCODE_TIMER - EXCCODE_INT_START);
+
+       return -EINVAL;
+}
+
 int constant_clockevent_init(void)
 {
        unsigned int irq;
@@ -132,7 +142,9 @@ int constant_clockevent_init(void)
        struct clock_event_device *cd;
        static int timer_irq_installed = 0;
 
-       irq = EXCCODE_TIMER - EXCCODE_INT_START;
+       irq = get_timer_irq();
+       if (irq < 0)
+               pr_err("Failed to map irq %d (timer)\n", irq);
 
        cd = &per_cpu(constant_clockevent_device, cpu);
 
index 25d9be5fbb19415099142ea98fa56610a73f209c..16ba2b8dd68ad9f601030c9e9c3ac40f202ca118 100644 (file)
@@ -32,7 +32,7 @@ SYM_FUNC_START(__clear_user)
 1:     st.b    zero, a0, 0
        addi.d  a0, a0, 1
        addi.d  a1, a1, -1
-       bgt     a1, zero, 1b
+       bgtz    a1, 1b
 
 2:     move    a0, a1
        jr      ra
index 9ae507f851b5ea661fe3da91192ba525f1af9017..97d20327a69eeb1b91ec64d990583c314730a5f8 100644 (file)
@@ -35,7 +35,7 @@ SYM_FUNC_START(__copy_user)
        addi.d  a0, a0, 1
        addi.d  a1, a1, 1
        addi.d  a2, a2, -1
-       bgt     a2, zero, 1b
+       bgtz    a2, 1b
 
 3:     move    a0, a2
        jr      ra
index 5d856694fcfe1091784959a89386a10fb2b90375..831d4761f385a48dc59041baed79025b111d5c49 100644 (file)
@@ -7,7 +7,6 @@
 #include <linux/smp.h>
 #include <linux/timex.h>
 
-#include <asm/compiler.h>
 #include <asm/processor.h>
 
 void __delay(unsigned long cycles)
index ddc78ab33c7b1d47add3635daf895aa1ae03e027..4c874a7af0ad6a5415816ac47a59dc33a984fdcf 100644 (file)
 
        .align 5
 SYM_FUNC_START(clear_page)
-       lu12i.w  t0, 1 << (PAGE_SHIFT - 12)
-       add.d    t0, t0, a0
+       lu12i.w t0, 1 << (PAGE_SHIFT - 12)
+       add.d   t0, t0, a0
 1:
-       st.d     zero, a0, 0
-       st.d     zero, a0, 8
-       st.d     zero, a0, 16
-       st.d     zero, a0, 24
-       st.d     zero, a0, 32
-       st.d     zero, a0, 40
-       st.d     zero, a0, 48
-       st.d     zero, a0, 56
-       addi.d   a0,   a0, 128
-       st.d     zero, a0, -64
-       st.d     zero, a0, -56
-       st.d     zero, a0, -48
-       st.d     zero, a0, -40
-       st.d     zero, a0, -32
-       st.d     zero, a0, -24
-       st.d     zero, a0, -16
-       st.d     zero, a0, -8
-       bne      t0,   a0, 1b
+       st.d    zero, a0, 0
+       st.d    zero, a0, 8
+       st.d    zero, a0, 16
+       st.d    zero, a0, 24
+       st.d    zero, a0, 32
+       st.d    zero, a0, 40
+       st.d    zero, a0, 48
+       st.d    zero, a0, 56
+       addi.d  a0,   a0, 128
+       st.d    zero, a0, -64
+       st.d    zero, a0, -56
+       st.d    zero, a0, -48
+       st.d    zero, a0, -40
+       st.d    zero, a0, -32
+       st.d    zero, a0, -24
+       st.d    zero, a0, -16
+       st.d    zero, a0, -8
+       bne     t0,   a0, 1b
 
-       jirl     $r0, ra, 0
+       jr      ra
 SYM_FUNC_END(clear_page)
 EXPORT_SYMBOL(clear_page)
 
 .align 5
 SYM_FUNC_START(copy_page)
-       lu12i.w  t8, 1 << (PAGE_SHIFT - 12)
-       add.d    t8, t8, a0
+       lu12i.w t8, 1 << (PAGE_SHIFT - 12)
+       add.d   t8, t8, a0
 1:
-       ld.d     t0, a1,  0
-       ld.d     t1, a1,  8
-       ld.d     t2, a1,  16
-       ld.d     t3, a1,  24
-       ld.d     t4, a1,  32
-       ld.d     t5, a1,  40
-       ld.d     t6, a1,  48
-       ld.d     t7, a1,  56
+       ld.d    t0, a1, 0
+       ld.d    t1, a1, 8
+       ld.d    t2, a1, 16
+       ld.d    t3, a1, 24
+       ld.d    t4, a1, 32
+       ld.d    t5, a1, 40
+       ld.d    t6, a1, 48
+       ld.d    t7, a1, 56
 
-       st.d     t0, a0,  0
-       st.d     t1, a0,  8
-       ld.d     t0, a1,  64
-       ld.d     t1, a1,  72
-       st.d     t2, a0,  16
-       st.d     t3, a0,  24
-       ld.d     t2, a1,  80
-       ld.d     t3, a1,  88
-       st.d     t4, a0,  32
-       st.d     t5, a0,  40
-       ld.d     t4, a1,  96
-       ld.d     t5, a1,  104
-       st.d     t6, a0,  48
-       st.d     t7, a0,  56
-       ld.d     t6, a1,  112
-       ld.d     t7, a1,  120
-       addi.d   a0, a0,  128
-       addi.d   a1, a1,  128
+       st.d    t0, a0, 0
+       st.d    t1, a0, 8
+       ld.d    t0, a1, 64
+       ld.d    t1, a1, 72
+       st.d    t2, a0, 16
+       st.d    t3, a0, 24
+       ld.d    t2, a1, 80
+       ld.d    t3, a1, 88
+       st.d    t4, a0, 32
+       st.d    t5, a0, 40
+       ld.d    t4, a1, 96
+       ld.d    t5, a1, 104
+       st.d    t6, a0, 48
+       st.d    t7, a0, 56
+       ld.d    t6, a1, 112
+       ld.d    t7, a1, 120
+       addi.d  a0, a0, 128
+       addi.d  a1, a1, 128
 
-       st.d     t0, a0,  -64
-       st.d     t1, a0,  -56
-       st.d     t2, a0,  -48
-       st.d     t3, a0,  -40
-       st.d     t4, a0,  -32
-       st.d     t5, a0,  -24
-       st.d     t6, a0,  -16
-       st.d     t7, a0,  -8
+       st.d    t0, a0, -64
+       st.d    t1, a0, -56
+       st.d    t2, a0, -48
+       st.d    t3, a0, -40
+       st.d    t4, a0, -32
+       st.d    t5, a0, -24
+       st.d    t6, a0, -16
+       st.d    t7, a0, -8
 
-       bne      t8, a0, 1b
-       jirl     $r0, ra, 0
+       bne     t8, a0, 1b
+       jr      ra
 SYM_FUNC_END(copy_page)
 EXPORT_SYMBOL(copy_page)
index 7eee402715774772992fe99c277d92f8f74921cf..de19fa2d7f0d3782ca46bbbb2403a213d059933b 100644 (file)
@@ -18,7 +18,7 @@
        REG_S   a2, sp, PT_BVADDR
        li.w    a1, \write
        la.abs  t0, do_page_fault
-       jirl    ra, t0, 0
+       jirl    ra, t0, 0
        RESTORE_ALL_AND_RET
        SYM_FUNC_END(tlb_do_page_fault_\write)
        .endm
@@ -34,7 +34,7 @@ SYM_FUNC_START(handle_tlb_protect)
        csrrd   a2, LOONGARCH_CSR_BADV
        REG_S   a2, sp, PT_BVADDR
        la.abs  t0, do_page_fault
-       jirl    ra, t0, 0
+       jirl    ra, t0, 0
        RESTORE_ALL_AND_RET
 SYM_FUNC_END(handle_tlb_protect)
 
@@ -47,7 +47,7 @@ SYM_FUNC_START(handle_tlb_load)
         * The vmalloc handling is not in the hotpath.
         */
        csrrd   t0, LOONGARCH_CSR_BADV
-       blt     t0, $r0, vmalloc_load
+       bltz    t0, vmalloc_load
        csrrd   t1, LOONGARCH_CSR_PGDL
 
 vmalloc_done_load:
@@ -80,7 +80,7 @@ vmalloc_done_load:
         * see if we need to jump to huge tlb processing.
         */
        andi    t0, ra, _PAGE_HUGE
-       bne     t0, $r0, tlb_huge_update_load
+       bnez    t0, tlb_huge_update_load
 
        csrrd   t0, LOONGARCH_CSR_BADV
        srli.d  t0, t0, (PAGE_SHIFT + PTE_ORDER)
@@ -100,12 +100,12 @@ smp_pgtable_change_load:
 
        srli.d  ra, t0, _PAGE_PRESENT_SHIFT
        andi    ra, ra, 1
-       beq     ra, $r0, nopage_tlb_load
+       beqz    ra, nopage_tlb_load
 
        ori     t0, t0, _PAGE_VALID
 #ifdef CONFIG_SMP
        sc.d    t0, t1, 0
-       beq     t0, $r0, smp_pgtable_change_load
+       beqz    t0, smp_pgtable_change_load
 #else
        st.d    t0, t1, 0
 #endif
@@ -139,23 +139,23 @@ tlb_huge_update_load:
 #endif
        srli.d  ra, t0, _PAGE_PRESENT_SHIFT
        andi    ra, ra, 1
-       beq     ra, $r0, nopage_tlb_load
+       beqz    ra, nopage_tlb_load
        tlbsrch
 
        ori     t0, t0, _PAGE_VALID
 #ifdef CONFIG_SMP
        sc.d    t0, t1, 0
-       beq     t0, $r0, tlb_huge_update_load
+       beqz    t0, tlb_huge_update_load
        ld.d    t0, t1, 0
 #else
        st.d    t0, t1, 0
 #endif
-       addu16i.d       t1, $r0, -(CSR_TLBIDX_EHINV >> 16)
-       addi.d  ra, t1, 0
-       csrxchg ra, t1, LOONGARCH_CSR_TLBIDX
+       addu16i.d       t1, zero, -(CSR_TLBIDX_EHINV >> 16)
+       addi.d          ra, t1, 0
+       csrxchg         ra, t1, LOONGARCH_CSR_TLBIDX
        tlbwr
 
-       csrxchg $r0, t1, LOONGARCH_CSR_TLBIDX
+       csrxchg zero, t1, LOONGARCH_CSR_TLBIDX
 
        /*
         * A huge PTE describes an area the size of the
@@ -178,27 +178,27 @@ tlb_huge_update_load:
        addi.d  t0, ra, 0
 
        /* Convert to entrylo1 */
-       addi.d  t1, $r0, 1
+       addi.d  t1, zero, 1
        slli.d  t1, t1, (HPAGE_SHIFT - 1)
        add.d   t0, t0, t1
        csrwr   t0, LOONGARCH_CSR_TLBELO1
 
        /* Set huge page tlb entry size */
-       addu16i.d       t0, $r0, (CSR_TLBIDX_PS >> 16)
-       addu16i.d       t1, $r0, (PS_HUGE_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
+       addu16i.d       t0, zero, (CSR_TLBIDX_PS >> 16)
+       addu16i.d       t1, zero, (PS_HUGE_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
        csrxchg         t1, t0, LOONGARCH_CSR_TLBIDX
 
        tlbfill
 
-       addu16i.d       t0, $r0, (CSR_TLBIDX_PS >> 16)
-       addu16i.d       t1, $r0, (PS_DEFAULT_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
+       addu16i.d       t0, zero, (CSR_TLBIDX_PS >> 16)
+       addu16i.d       t1, zero, (PS_DEFAULT_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
        csrxchg         t1, t0, LOONGARCH_CSR_TLBIDX
 
 nopage_tlb_load:
        dbar    0
        csrrd   ra, EXCEPTION_KS2
        la.abs  t0, tlb_do_page_fault_0
-       jirl    $r0, t0, 0
+       jr      t0
 SYM_FUNC_END(handle_tlb_load)
 
 SYM_FUNC_START(handle_tlb_store)
@@ -210,7 +210,7 @@ SYM_FUNC_START(handle_tlb_store)
         * The vmalloc handling is not in the hotpath.
         */
        csrrd   t0, LOONGARCH_CSR_BADV
-       blt     t0, $r0, vmalloc_store
+       bltz    t0, vmalloc_store
        csrrd   t1, LOONGARCH_CSR_PGDL
 
 vmalloc_done_store:
@@ -244,7 +244,7 @@ vmalloc_done_store:
         * see if we need to jump to huge tlb processing.
         */
        andi    t0, ra, _PAGE_HUGE
-       bne     t0, $r0, tlb_huge_update_store
+       bnez    t0, tlb_huge_update_store
 
        csrrd   t0, LOONGARCH_CSR_BADV
        srli.d  t0, t0, (PAGE_SHIFT + PTE_ORDER)
@@ -265,12 +265,12 @@ smp_pgtable_change_store:
        srli.d  ra, t0, _PAGE_PRESENT_SHIFT
        andi    ra, ra, ((_PAGE_PRESENT | _PAGE_WRITE) >> _PAGE_PRESENT_SHIFT)
        xori    ra, ra, ((_PAGE_PRESENT | _PAGE_WRITE) >> _PAGE_PRESENT_SHIFT)
-       bne     ra, $r0, nopage_tlb_store
+       bnez    ra, nopage_tlb_store
 
        ori     t0, t0, (_PAGE_VALID | _PAGE_DIRTY | _PAGE_MODIFIED)
 #ifdef CONFIG_SMP
        sc.d    t0, t1, 0
-       beq     t0, $r0, smp_pgtable_change_store
+       beqz    t0, smp_pgtable_change_store
 #else
        st.d    t0, t1, 0
 #endif
@@ -306,24 +306,24 @@ tlb_huge_update_store:
        srli.d  ra, t0, _PAGE_PRESENT_SHIFT
        andi    ra, ra, ((_PAGE_PRESENT | _PAGE_WRITE) >> _PAGE_PRESENT_SHIFT)
        xori    ra, ra, ((_PAGE_PRESENT | _PAGE_WRITE) >> _PAGE_PRESENT_SHIFT)
-       bne     ra, $r0, nopage_tlb_store
+       bnez    ra, nopage_tlb_store
 
        tlbsrch
        ori     t0, t0, (_PAGE_VALID | _PAGE_DIRTY | _PAGE_MODIFIED)
 
 #ifdef CONFIG_SMP
        sc.d    t0, t1, 0
-       beq     t0, $r0, tlb_huge_update_store
+       beqz    t0, tlb_huge_update_store
        ld.d    t0, t1, 0
 #else
        st.d    t0, t1, 0
 #endif
-       addu16i.d       t1, $r0, -(CSR_TLBIDX_EHINV >> 16)
-       addi.d  ra, t1, 0
-       csrxchg ra, t1, LOONGARCH_CSR_TLBIDX
+       addu16i.d       t1, zero, -(CSR_TLBIDX_EHINV >> 16)
+       addi.d          ra, t1, 0
+       csrxchg         ra, t1, LOONGARCH_CSR_TLBIDX
        tlbwr
 
-       csrxchg $r0, t1, LOONGARCH_CSR_TLBIDX
+       csrxchg zero, t1, LOONGARCH_CSR_TLBIDX
        /*
         * A huge PTE describes an area the size of the
         * configured huge page size. This is twice the
@@ -345,28 +345,28 @@ tlb_huge_update_store:
        addi.d  t0, ra, 0
 
        /* Convert to entrylo1 */
-       addi.d  t1, $r0, 1
+       addi.d  t1, zero, 1
        slli.d  t1, t1, (HPAGE_SHIFT - 1)
        add.d   t0, t0, t1
        csrwr   t0, LOONGARCH_CSR_TLBELO1
 
        /* Set huge page tlb entry size */
-       addu16i.d       t0, $r0, (CSR_TLBIDX_PS >> 16)
-       addu16i.d       t1, $r0, (PS_HUGE_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
+       addu16i.d       t0, zero, (CSR_TLBIDX_PS >> 16)
+       addu16i.d       t1, zero, (PS_HUGE_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
        csrxchg         t1, t0, LOONGARCH_CSR_TLBIDX
 
        tlbfill
 
        /* Reset default page size */
-       addu16i.d       t0, $r0, (CSR_TLBIDX_PS >> 16)
-       addu16i.d       t1, $r0, (PS_DEFAULT_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
+       addu16i.d       t0, zero, (CSR_TLBIDX_PS >> 16)
+       addu16i.d       t1, zero, (PS_DEFAULT_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
        csrxchg         t1, t0, LOONGARCH_CSR_TLBIDX
 
 nopage_tlb_store:
        dbar    0
        csrrd   ra, EXCEPTION_KS2
        la.abs  t0, tlb_do_page_fault_1
-       jirl    $r0, t0, 0
+       jr      t0
 SYM_FUNC_END(handle_tlb_store)
 
 SYM_FUNC_START(handle_tlb_modify)
@@ -378,7 +378,7 @@ SYM_FUNC_START(handle_tlb_modify)
         * The vmalloc handling is not in the hotpath.
         */
        csrrd   t0, LOONGARCH_CSR_BADV
-       blt     t0, $r0, vmalloc_modify
+       bltz    t0, vmalloc_modify
        csrrd   t1, LOONGARCH_CSR_PGDL
 
 vmalloc_done_modify:
@@ -411,7 +411,7 @@ vmalloc_done_modify:
         * see if we need to jump to huge tlb processing.
         */
        andi    t0, ra, _PAGE_HUGE
-       bne     t0, $r0, tlb_huge_update_modify
+       bnez    t0, tlb_huge_update_modify
 
        csrrd   t0, LOONGARCH_CSR_BADV
        srli.d  t0, t0, (PAGE_SHIFT + PTE_ORDER)
@@ -431,12 +431,12 @@ smp_pgtable_change_modify:
 
        srli.d  ra, t0, _PAGE_WRITE_SHIFT
        andi    ra, ra, 1
-       beq     ra, $r0, nopage_tlb_modify
+       beqz    ra, nopage_tlb_modify
 
        ori     t0, t0, (_PAGE_VALID | _PAGE_DIRTY | _PAGE_MODIFIED)
 #ifdef CONFIG_SMP
        sc.d    t0, t1, 0
-       beq     t0, $r0, smp_pgtable_change_modify
+       beqz    t0, smp_pgtable_change_modify
 #else
        st.d    t0, t1, 0
 #endif
@@ -454,7 +454,7 @@ leave_modify:
        ertn
 #ifdef CONFIG_64BIT
 vmalloc_modify:
-       la.abs  t1, swapper_pg_dir
+       la.abs  t1, swapper_pg_dir
        b       vmalloc_done_modify
 #endif
 
@@ -471,14 +471,14 @@ tlb_huge_update_modify:
 
        srli.d  ra, t0, _PAGE_WRITE_SHIFT
        andi    ra, ra, 1
-       beq     ra, $r0, nopage_tlb_modify
+       beqz    ra, nopage_tlb_modify
 
        tlbsrch
        ori     t0, t0, (_PAGE_VALID | _PAGE_DIRTY | _PAGE_MODIFIED)
 
 #ifdef CONFIG_SMP
        sc.d    t0, t1, 0
-       beq     t0, $r0, tlb_huge_update_modify
+       beqz    t0, tlb_huge_update_modify
        ld.d    t0, t1, 0
 #else
        st.d    t0, t1, 0
@@ -504,28 +504,28 @@ tlb_huge_update_modify:
        addi.d  t0, ra, 0
 
        /* Convert to entrylo1 */
-       addi.d  t1, $r0, 1
+       addi.d  t1, zero, 1
        slli.d  t1, t1, (HPAGE_SHIFT - 1)
        add.d   t0, t0, t1
        csrwr   t0, LOONGARCH_CSR_TLBELO1
 
        /* Set huge page tlb entry size */
-       addu16i.d       t0, $r0, (CSR_TLBIDX_PS >> 16)
-       addu16i.d       t1, $r0, (PS_HUGE_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
-       csrxchg t1, t0, LOONGARCH_CSR_TLBIDX
+       addu16i.d       t0, zero, (CSR_TLBIDX_PS >> 16)
+       addu16i.d       t1, zero, (PS_HUGE_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
+       csrxchg         t1, t0, LOONGARCH_CSR_TLBIDX
 
        tlbwr
 
        /* Reset default page size */
-       addu16i.d       t0, $r0, (CSR_TLBIDX_PS >> 16)
-       addu16i.d       t1, $r0, (PS_DEFAULT_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
-       csrxchg t1, t0, LOONGARCH_CSR_TLBIDX
+       addu16i.d       t0, zero, (CSR_TLBIDX_PS >> 16)
+       addu16i.d       t1, zero, (PS_DEFAULT_SIZE << (CSR_TLBIDX_PS_SHIFT - 16))
+       csrxchg         t1, t0, LOONGARCH_CSR_TLBIDX
 
 nopage_tlb_modify:
        dbar    0
        csrrd   ra, EXCEPTION_KS2
        la.abs  t0, tlb_do_page_fault_1
-       jirl    $r0, t0, 0
+       jr      t0
 SYM_FUNC_END(handle_tlb_modify)
 
 SYM_FUNC_START(handle_tlb_refill)
index f3aa44156969b523554d24f46733b979a1d4b391..e0e9e31339c1250dce4ea39d95540689186533a2 100644 (file)
@@ -155,7 +155,7 @@ config M520x
        select COLDFIRE_PIT_TIMER
        select HAVE_CACHE_SPLIT
        help
-          Freescale Coldfire 5207/5208 processor support.
+         Freescale Coldfire 5207/5208 processor support.
 
 config M523x
        bool "MCF523x"
@@ -322,7 +322,6 @@ config COLDFIRE_SLTIMERS
 
 endif # COLDFIRE
 
-
 comment "Processor Specific Options"
 
 config M68KFPU_EMU
@@ -522,7 +521,7 @@ config CACHE_BOTH
          Split the ColdFire CPU cache, and use half as an instruction cache
          and half as a data cache.
 endchoice
-endif
+endif # HAVE_CACHE_SPLIT
 
 if HAVE_CACHE_CB
 choice
@@ -539,4 +538,4 @@ config CACHE_COPYBACK
        help
          The ColdFire CPU cache is set into Copy-back mode.
 endchoice
-endif
+endif # HAVE_CACHE_CB
index 11b306bdd7886a1a96c31bc31bb5d197aedf0443..465e28be0ce46a6976674a3bcd49eb51421841a7 100644 (file)
@@ -1,11 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 
 config BOOTPARAM
-       bool 'Compiled-in Kernel Boot Parameter'
+       bool "Compiled-in Kernel Boot Parameter"
 
 config BOOTPARAM_STRING
-       string 'Kernel Boot Parameter'
-       default 'console=ttyS0,19200'
+       string "Kernel Boot Parameter"
+       default "console=ttyS0,19200"
        depends on BOOTPARAM
 
 config EARLY_PRINTK
index a1042568b9ad1590231b4e5cd488b79131bee24f..53c45ccda5647b5d553b6a7ac914e668d7ecf343 100644 (file)
@@ -161,10 +161,11 @@ config VIRT
        select RTC_CLASS
        select RTC_DRV_GOLDFISH
        select TTY
+       select VIRTIO_MENU
        select VIRTIO_MMIO
        help
          This options enable a pure virtual machine based on m68k,
-         VIRTIO MMIO devices and GOLDFISH interfaces (TTY, RTC, PIC)
+         VIRTIO MMIO devices and GOLDFISH interfaces (TTY, RTC, PIC).
 
 config PILOT
        bool
@@ -492,4 +493,4 @@ config ROMKERNEL
 
 endchoice
 
-endif
+endif # !MMU || COLDFIRE
index c181030218bf29db12d3c4616a24a7ae1f2fff30..a6a886a89be28382533966173a447f1c75f04200 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68020=y
@@ -43,8 +41,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -310,6 +309,7 @@ CONFIG_PARPORT_MFC3=m
 CONFIG_PARPORT_1284=y
 CONFIG_AMIGA_FLOPPY=y
 CONFIG_AMIGA_Z2RAM=y
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -580,7 +580,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -595,7 +595,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -648,11 +648,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 40755648fb6ce7a70d30a82793ab0ec395b62f52..bffd24c2755e711716066174ea13881edf2671c2 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68020=y
@@ -39,8 +37,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -300,6 +299,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -537,7 +537,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -552,7 +552,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -604,11 +604,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index be0d9155fc5b8a34f94363d692f69ffcc8780cac..0013425b1e08ed4b4261a03012cfc50b7d99873f 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68020=y
@@ -46,8 +44,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -311,6 +310,7 @@ CONFIG_PARPORT=m
 CONFIG_PARPORT_ATARI=m
 CONFIG_PARPORT_1284=y
 CONFIG_ATARI_FLOPPY=y
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -557,7 +557,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -572,7 +572,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -625,11 +625,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 9af0e2d0d153be633821262e1f5a0b5ec3eeafb5..42d969697f7f0352332fb241df30293e75bef33d 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68040=y
@@ -36,8 +34,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -297,6 +296,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -529,7 +529,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -544,7 +544,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -596,11 +596,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 49341d66feb6a6b552fc3da55c4275f38afb1e51..97d6d9acb39520ab07ae8cf44532b933a43b92ec 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68020=y
@@ -38,8 +36,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -299,6 +298,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -539,7 +539,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -554,7 +554,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -606,11 +606,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 92b33d5ffab190f742d2b0a5fdc3b7902d7406ed..8cbfc1c659a311b60a6da3b870e5af0fcec05ebd 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68020=y
@@ -37,8 +35,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -302,6 +301,7 @@ CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
 CONFIG_BLK_DEV_SWIM=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -559,7 +559,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -574,7 +574,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -627,11 +627,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 6aaa947bc8491a58e6116dc20faf2e9e1d869963..9f45fe60757fab1cdf07c845955ec467b6add4d1 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68020=y
@@ -57,8 +55,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -331,6 +330,7 @@ CONFIG_AMIGA_FLOPPY=y
 CONFIG_ATARI_FLOPPY=y
 CONFIG_BLK_DEV_SWIM=m
 CONFIG_AMIGA_Z2RAM=y
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -645,7 +645,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -660,7 +660,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -713,11 +713,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index b62d65e5993838aa0f1a4c4c252c36a5e5f67906..4736cfacf6a2801cdcebdf745900fb2a011d94d7 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68030=y
@@ -35,8 +33,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -296,6 +295,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -528,7 +528,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -543,7 +543,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -595,11 +595,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 8ecf261487d4262e1864f478302b0365b525b1cc..638cd38aa7d2730328915e6674b8365a09cd45df 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68040=y
@@ -36,8 +34,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -297,6 +296,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -529,7 +529,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -544,7 +544,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -596,11 +596,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 7540d908897bca8310f6557c0fe0383e00b29175..ec8b6bb70ebdcaf35f0e6b9e1062ca4d4a572cfd 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_M68040=y
@@ -37,8 +35,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -301,6 +300,7 @@ CONFIG_CONNECTOR=m
 CONFIG_PARPORT=m
 CONFIG_PARPORT_PC=m
 CONFIG_PARPORT_1284=y
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -546,7 +546,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -561,7 +561,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -614,11 +614,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 832b45944617c6c3948e40b9dd818c68ec419c5d..7d8dc578d59c6ffb306312b7ff7196c9142e5dbe 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_SUN3=y
@@ -33,8 +31,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -294,6 +293,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -528,7 +528,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -543,7 +543,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -594,11 +594,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 9171b687e565e2f11a278fd0ede62e55b9574476..96290aee530211e30af2abd55ca8007e5ca64f87 100644 (file)
@@ -10,8 +10,6 @@ CONFIG_LOG_BUF_SHIFT=16
 # CONFIG_NET_NS is not set
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
-CONFIG_USERFAULTFD=y
-CONFIG_SLAB=y
 CONFIG_KEXEC=y
 CONFIG_BOOTINFO_PROC=y
 CONFIG_SUN3X=y
@@ -33,8 +31,9 @@ CONFIG_MQ_IOSCHED_KYBER=m
 CONFIG_IOSCHED_BFQ=m
 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
 CONFIG_BINFMT_MISC=m
+CONFIG_SLAB=y
 # CONFIG_COMPACTION is not set
-CONFIG_ZPOOL=m
+CONFIG_USERFAULTFD=y
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_PACKET_DIAG=m
@@ -294,6 +293,7 @@ CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_TEST_ASYNC_DRIVER_PROBE=m
 CONFIG_CONNECTOR=m
+CONFIG_ZRAM=m
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
@@ -527,7 +527,7 @@ CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_RMD160=m
 CONFIG_CRYPTO_SHA3=m
-CONFIG_CRYPTO_SM3=m
+CONFIG_CRYPTO_SM3_GENERIC=m
 CONFIG_CRYPTO_WP512=m
 CONFIG_CRYPTO_AES=y
 CONFIG_CRYPTO_AES_TI=m
@@ -542,7 +542,7 @@ CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_SERPENT=m
-CONFIG_CRYPTO_SM4=m
+CONFIG_CRYPTO_SM4_GENERIC=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_LZO=m
@@ -594,11 +594,7 @@ CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
-CONFIG_BITFIELD_KUNIT=m
-CONFIG_RESOURCE_KUNIT_TEST=m
 CONFIG_LINEAR_RANGES_TEST=m
-CONFIG_CMDLINE_KUNIT_TEST=m
-CONFIG_BITS_TEST=m
 CONFIG_TEST_UDELAY=m
 CONFIG_TEST_STATIC_KEYS=m
 CONFIG_TEST_KMOD=m
index 51283db53667f416ccae5356bb94609edbf301dc..87c2cd66a9ce4b0510073517a6d4c07f4bf44c2c 100644 (file)
@@ -510,7 +510,7 @@ static inline int fls(unsigned int x)
        return 32 - cnt;
 }
 
-static inline int __fls(int x)
+static inline unsigned long __fls(unsigned long x)
 {
        return fls(x) - 1;
 }
index ffeda9aa526a54206ad85129b33e2d3b19982bd8..d86b4009880b4e790c4abeb4cda8fbc38be7e238 100644 (file)
@@ -151,6 +151,7 @@ static inline void release_thread(struct task_struct *dead_task)
 }
 
 unsigned long __get_wchan(struct task_struct *p);
+void show_registers(struct pt_regs *regs);
 
 #define        KSTK_EIP(tsk)   \
     ({                 \
index e4db7e2213abc795418b2a6f7c66dbd96aea3899..b091ee9b06e05ba4dec172fa47fed5a29dc1d687 100644 (file)
 #define BI_VIRT_VIRTIO_BASE    0x8004
 #define BI_VIRT_CTRL_BASE      0x8005
 
+/*
+ * A random seed used to initialize the RNG. Record format:
+ *
+ *   - length       [ 2 bytes, 16-bit big endian ]
+ *   - seed data    [ `length` bytes, padded to preserve 2-byte alignment ]
+ */
+#define BI_VIRT_RNG_SEED       0x8006
+
 #define VIRT_BOOTI_VERSION     MK_BI_VERSION(2, 0)
 
 #endif /* _UAPI_ASM_M68K_BOOTINFO_MAC_H */
index 59fc63feb0dcce8a7ea22e4516c9d598a600a28b..5c8cba0efc63e580d924d6ad667220d927dbb637 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/uaccess.h>
 #include <asm/traps.h>
 #include <asm/machdep.h>
+#include <asm/processor.h>
 #include <asm/siginfo.h>
 #include <asm/tlbflush.h>
 
index de156a027f5b9dd6701080f1e2b8491e42a5645d..010b3b5ae8e8584a01aceab6103bbd4793af19db 100644 (file)
@@ -25,7 +25,7 @@
  *               check this.)
  * 990605 (jmt) - Rearranged things a bit wrt IOP detection; iop_present is
  *               gone, IOP base addresses are now in an array and the
- *               globally-visible functions take an IOP number instead of an
+ *               globally-visible functions take an IOP number instead of
  *               an actual base address.
  * 990610 (jmt) - Finished the message passing framework and it seems to work.
  *               Sending _definitely_ works; my adb-bus.c mods can send
@@ -66,7 +66,7 @@
  * a shared memory area in the IOP RAM. Each IOP has seven "channels"; each
  * channel is connected to a specific software driver on the IOP. For example
  * on the SCC IOP there is one channel for each serial port. Each channel has
- * an incoming and and outgoing message queue with a depth of one.
+ * an incoming and an outgoing message queue with a depth of one.
  *
  * A message is 32 bytes plus a state byte for the channel (MSG_IDLE, MSG_NEW,
  * MSG_RCVD, MSG_COMPLETE). To send a message you copy the message into the
index e3575388cd05a8ccc3e7e0ad23581460a1b23410..5cbaf6e9497c698a132bb4fc0e117966e698bc2f 100644 (file)
 #include <asm/mac_baboon.h>
 #include <asm/hwtest.h>
 #include <asm/irq_regs.h>
-
-extern void show_registers(struct pt_regs *);
-
-irqreturn_t mac_nmi_handler(int, void *);
+#include <asm/processor.h>
 
 static unsigned int mac_irq_startup(struct irq_data *);
 static void mac_irq_shutdown(struct irq_data *);
@@ -142,6 +139,21 @@ static struct irq_chip mac_irq_chip = {
        .irq_shutdown   = mac_irq_shutdown,
 };
 
+static irqreturn_t mac_nmi_handler(int irq, void *dev_id)
+{
+       static volatile int in_nmi;
+
+       if (in_nmi)
+               return IRQ_HANDLED;
+       in_nmi = 1;
+
+       pr_info("Non-Maskable Interrupt\n");
+       show_registers(get_irq_regs());
+
+       in_nmi = 0;
+       return IRQ_HANDLED;
+}
+
 void __init mac_init_IRQ(void)
 {
        m68k_setup_irq_controller(&mac_irq_chip, handle_simple_irq, IRQ_USER,
@@ -254,18 +266,3 @@ static void mac_irq_shutdown(struct irq_data *data)
        else
                mac_irq_disable(data);
 }
-
-static volatile int in_nmi;
-
-irqreturn_t mac_nmi_handler(int irq, void *dev_id)
-{
-       if (in_nmi)
-               return IRQ_HANDLED;
-       in_nmi = 1;
-
-       pr_info("Non-Maskable Interrupt\n");
-       show_registers(get_irq_regs());
-
-       in_nmi = 0;
-       return IRQ_HANDLED;
-}
index 6886a5d0007b1eab15a77b1947c1937d2e5b93e7..d15057d34e56da9c46426e524314d02ad7e94718 100644 (file)
@@ -32,7 +32,7 @@
  *            33   : frame int (50/200 Hz periodic timer)
  *            34   : sample int (10/20 KHz periodic timer)
  *
-*/
+ */
 
 static void q40_irq_handler(unsigned int, struct pt_regs *fp);
 static void q40_irq_enable(struct irq_data *data);
index 7ec20817c0c9eaffe487a5347aecd1c280866b03..7321b3b76283c7c9ccc9852c19b844facddd7ab9 100644 (file)
@@ -211,7 +211,7 @@ void clear_context(unsigned long context)
 
      if(context) {
             if(!ctx_alloc[context])
-                    panic("clear_context: context not allocated\n");
+                    panic("%s: context not allocated\n", __func__);
 
             ctx_alloc[context]->context = SUN3_INVALID_CONTEXT;
             ctx_alloc[context] = (struct mm_struct *)0;
@@ -261,7 +261,7 @@ unsigned long get_free_context(struct mm_struct *mm)
                }
                // check to make sure one was really free...
                if(new == CONTEXTS_NUM)
-                       panic("get_free_context: failed to find free context");
+                       panic("%s: failed to find free context", __func__);
        }
 
        ctx_alloc[new] = mm;
@@ -369,16 +369,15 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
        }
 
 #ifdef DEBUG_MMU_EMU
-       pr_info("mmu_emu_handle_fault: vaddr=%lx type=%s crp=%p\n",
-               vaddr, read_flag ? "read" : "write", crp);
+       pr_info("%s: vaddr=%lx type=%s crp=%p\n", __func__, vaddr,
+               read_flag ? "read" : "write", crp);
 #endif
 
        segment = (vaddr >> SUN3_PMEG_SIZE_BITS) & 0x7FF;
        offset  = (vaddr >> SUN3_PTE_SIZE_BITS) & 0xF;
 
 #ifdef DEBUG_MMU_EMU
-       pr_info("mmu_emu_handle_fault: segment=%lx offset=%lx\n", segment,
-               offset);
+       pr_info("%s: segment=%lx offset=%lx\n", __func__, segment, offset);
 #endif
 
        pte = (pte_t *) pgd_val (*(crp + segment));
index 632ba200ad425245eb22f0f73b15307e523b0cd5..4ab22946ff68fec81b8f2fc45b029b99fa51b179 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <linux/reboot.h>
 #include <linux/serial_core.h>
+#include <linux/random.h>
 #include <clocksource/timer-goldfish.h>
 
 #include <asm/bootinfo.h>
@@ -92,6 +93,16 @@ int __init virt_parse_bootinfo(const struct bi_record *record)
                data += 4;
                virt_bi_data.virtio.irq = be32_to_cpup(data);
                break;
+       case BI_VIRT_RNG_SEED: {
+               u16 len = be16_to_cpup(data);
+               add_bootloader_randomness(data + 2, len);
+               /*
+                * Zero the data to preserve forward secrecy, and zero the
+                * length to prevent kexec from using it.
+                */
+               memzero_explicit((void *)data, len + 2);
+               break;
+       }
        default:
                unknown = 1;
                break;
index 95818f901ebe322d714d93f60b63b4a3d2dfba03..896aa6eb8bcc6f3daf5fa516d5f6b71637faeca5 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/hwtest.h>
 #include <asm/irq.h>
 #include <asm/irq_regs.h>
+#include <asm/processor.h>
 #include <asm/virt.h>
 
 #define GFPIC_REG_IRQ_PENDING           0x04
@@ -19,8 +20,6 @@
 #define GFPIC_REG_IRQ_DISABLE           0x0c
 #define GFPIC_REG_IRQ_ENABLE            0x10
 
-extern void show_registers(struct pt_regs *regs);
-
 static struct resource picres[6];
 static const char *picname[6] = {
        "goldfish_pic.0",
index cb820f19a221907b93d91deb601beb2a99187b10..1560c4140ab91d3ed01f50ca45d690ddbca7d9cb 100644 (file)
@@ -8,20 +8,15 @@
 
 #define VIRTIO_BUS_NB  128
 
-static int __init virt_virtio_init(unsigned int id)
+static struct platform_device * __init virt_virtio_init(unsigned int id)
 {
        const struct resource res[] = {
                DEFINE_RES_MEM(virt_bi_data.virtio.mmio + id * 0x200, 0x200),
                DEFINE_RES_IRQ(virt_bi_data.virtio.irq + id),
        };
-       struct platform_device *pdev;
 
-       pdev = platform_device_register_simple("virtio-mmio", id,
+       return platform_device_register_simple("virtio-mmio", id,
                                               res, ARRAY_SIZE(res));
-       if (IS_ERR(pdev))
-               return PTR_ERR(pdev);
-
-       return 0;
 }
 
 static int __init virt_platform_init(void)
@@ -35,8 +30,10 @@ static int __init virt_platform_init(void)
                DEFINE_RES_MEM(virt_bi_data.rtc.mmio + 0x1000, 0x1000),
                DEFINE_RES_IRQ(virt_bi_data.rtc.irq + 1),
        };
-       struct platform_device *pdev;
+       struct platform_device *pdev1, *pdev2;
+       struct platform_device *pdevs[VIRTIO_BUS_NB];
        unsigned int i;
+       int ret = 0;
 
        if (!MACH_IS_VIRT)
                return -ENODEV;
@@ -44,29 +41,40 @@ static int __init virt_platform_init(void)
        /* We need this to have DMA'able memory provided to goldfish-tty */
        min_low_pfn = 0;
 
-       pdev = platform_device_register_simple("goldfish_tty",
-                                              PLATFORM_DEVID_NONE,
-                                              goldfish_tty_res,
-                                              ARRAY_SIZE(goldfish_tty_res));
-       if (IS_ERR(pdev))
-               return PTR_ERR(pdev);
+       pdev1 = platform_device_register_simple("goldfish_tty",
+                                               PLATFORM_DEVID_NONE,
+                                               goldfish_tty_res,
+                                               ARRAY_SIZE(goldfish_tty_res));
+       if (IS_ERR(pdev1))
+               return PTR_ERR(pdev1);
 
-       pdev = platform_device_register_simple("goldfish_rtc",
-                                              PLATFORM_DEVID_NONE,
-                                              goldfish_rtc_res,
-                                              ARRAY_SIZE(goldfish_rtc_res));
-       if (IS_ERR(pdev))
-               return PTR_ERR(pdev);
+       pdev2 = platform_device_register_simple("goldfish_rtc",
+                                               PLATFORM_DEVID_NONE,
+                                               goldfish_rtc_res,
+                                               ARRAY_SIZE(goldfish_rtc_res));
+       if (IS_ERR(pdev2)) {
+               ret = PTR_ERR(pdev2);
+               goto err_unregister_tty;
+       }
 
        for (i = 0; i < VIRTIO_BUS_NB; i++) {
-               int err;
-
-               err = virt_virtio_init(i);
-               if (err)
-                       return err;
+               pdevs[i] = virt_virtio_init(i);
+               if (IS_ERR(pdevs[i])) {
+                       ret = PTR_ERR(pdevs[i]);
+                       goto err_unregister_rtc_virtio;
+               }
        }
 
        return 0;
+
+err_unregister_rtc_virtio:
+       while (i > 0)
+               platform_device_unregister(pdevs[--i]);
+       platform_device_unregister(pdev2);
+err_unregister_tty:
+       platform_device_unregister(pdev1);
+
+       return ret;
 }
 
 arch_initcall(virt_platform_init);
index 6cdcbf4de7632fa0a8065b5e79f2460d8ef871c5..9cb9ed44bcafa149c18e08fb35bbbcd663ae0d96 100644 (file)
@@ -263,7 +263,7 @@ static int next_cpu_for_irq(struct irq_data *data)
 
 #ifdef CONFIG_SMP
        int cpu;
-       struct cpumask *mask = irq_data_get_affinity_mask(data);
+       const struct cpumask *mask = irq_data_get_affinity_mask(data);
        int weight = cpumask_weight(mask);
        struct octeon_ciu_chip_data *cd = irq_data_get_irq_chip_data(data);
 
@@ -758,7 +758,7 @@ static void octeon_irq_cpu_offline_ciu(struct irq_data *data)
 {
        int cpu = smp_processor_id();
        cpumask_t new_affinity;
-       struct cpumask *mask = irq_data_get_affinity_mask(data);
+       const struct cpumask *mask = irq_data_get_affinity_mask(data);
 
        if (!cpumask_test_cpu(cpu, mask))
                return;
index 3185fd3220ec217d73d320a710f7bd2c5902b757..c5c6864e64bc430a98b2acfce5e4eb13b16dee0a 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef _ASM_MIPS_JUMP_LABEL_H
 #define _ASM_MIPS_JUMP_LABEL_H
 
+#define arch_jump_label_transform_static arch_jump_label_transform
+
 #ifndef __ASSEMBLY__
 
 #include <linux/types.h>
index 98ea977cf0b858ef3e115dba21c95ee05e265d2f..67c15f320f933ba9fd170108ca8959d38e90d8fe 100644 (file)
@@ -7,8 +7,9 @@
 #define NR_MIPS_CPU_IRQS       8
 #define NR_MAX_CHAINED_IRQS    40 /* Chained IRQs means those not directly used by devices */
 #define NR_IRQS                        (NR_IRQS_LEGACY + NR_MIPS_CPU_IRQS + NR_MAX_CHAINED_IRQS + 256)
-
+#define MAX_IO_PICS            1
 #define MIPS_CPU_IRQ_BASE      NR_IRQS_LEGACY
+#define GSI_MIN_CPU_IRQ                0
 
 #include <asm/mach-generic/irq.h>
 
index 662c8db9f45ba96bc3caeb3126aaa2f102f27ae5..71a882c8c6eb15bddbcafff2df73235a2f75567a 100644 (file)
@@ -88,3 +88,22 @@ void arch_jump_label_transform(struct jump_entry *e,
 
        mutex_unlock(&text_mutex);
 }
+
+#ifdef CONFIG_MODULES
+void jump_label_apply_nops(struct module *mod)
+{
+       struct jump_entry *iter_start = mod->jump_entries;
+       struct jump_entry *iter_stop = iter_start + mod->num_jump_entries;
+       struct jump_entry *iter;
+
+       /* if the module doesn't have jump label entries, just return */
+       if (iter_start == iter_stop)
+               return;
+
+       for (iter = iter_start; iter < iter_stop; iter++) {
+               /* Only write NOPs for arch_branch_static(). */
+               if (jump_label_init_type(iter) == JUMP_LABEL_NOP)
+                       arch_jump_label_transform(iter, JUMP_LABEL_NOP);
+       }
+}
+#endif
index 14f46d17500a64d174f650e966067dfc8a84f8e5..0c936cbf20c53449f5b041446bb4c640b18ff3fb 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/spinlock.h>
 #include <linux/jump_label.h>
 
+extern void jump_label_apply_nops(struct module *mod);
 
 struct mips_hi16 {
        struct mips_hi16 *next;
@@ -428,8 +429,8 @@ int module_finalize(const Elf_Ehdr *hdr,
        const Elf_Shdr *s;
        char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
 
-       /* Make jump label nops. */
-       jump_label_apply_nops(me);
+       if (IS_ENABLED(CONFIG_JUMP_LABEL))
+               jump_label_apply_nops(me);
 
        INIT_LIST_HEAD(&me->arch.dbe_list);
        for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) {
index 0fe2d79fb123fa76f4ef0ad916f7707e462c8561..5ebb1771b4ab6ddde12a5d5ad6dc361dc8609d6c 100644 (file)
@@ -315,7 +315,7 @@ unsigned long txn_affinity_addr(unsigned int irq, int cpu)
 {
 #ifdef CONFIG_SMP
        struct irq_data *d = irq_get_irq_data(irq);
-       cpumask_copy(irq_data_get_affinity_mask(d), cpumask_of(cpu));
+       irq_data_update_affinity(d, cpumask_of(cpu));
 #endif
 
        return per_cpu(cpu_data, cpu).txn_addr;
index d2f3cb12e282030303cf690937650db6c778b18f..e253b134500d1319b576464ddc2a78493ee236d5 100644 (file)
@@ -42,14 +42,3 @@ void arch_jump_label_transform(struct jump_entry *entry,
 
        patch_text(addr, insn);
 }
-
-void arch_jump_label_transform_static(struct jump_entry *entry,
-                                     enum jump_label_type type)
-{
-       /*
-        * We use the architected NOP in arch_static_branch, so there's no
-        * need to patch an identical NOP over the top of it here. The core
-        * will call arch_jump_label_transform from a module notifier if the
-        * NOP needs to be replaced by a branch.
-        */
-}
index c235648fae23afd14393a24859927b52012a7ee9..4d8f26c1399bedc9a450a88785db149b7daa5210 100644 (file)
@@ -282,6 +282,10 @@ config PPC
        # Please keep this list sorted alphabetically.
        #
 
+config PPC_LONG_DOUBLE_128
+       depends on PPC64
+       def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1)
+
 config PPC_BARRIER_NOSPEC
        bool
        default y
index f91f0f29a566acf4cc3430eb84a9ead48287937c..c8cf924bf9c0de98fad9f02b3f2f8927debe16a4 100644 (file)
@@ -20,6 +20,7 @@ CFLAGS_prom.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
 CFLAGS_prom_init.o += -fno-stack-protector
 CFLAGS_prom_init.o += -DDISABLE_BRANCH_PROFILING
 CFLAGS_prom_init.o += -ffreestanding
+CFLAGS_prom_init.o += $(call cc-option, -ftrivial-auto-var-init=uninitialized)
 
 ifdef CONFIG_FUNCTION_TRACER
 # Do not trace early boot code
index a4c46a03d2e26109eb4d74ab6c08d0f3d7bb9e16..81029d40a6727a887d4cb142d0ad5e8659b82b98 100644 (file)
@@ -111,7 +111,7 @@ PHONY += vdso_install
 vdso_install:
        $(Q)$(MAKE) $(build)=arch/riscv/kernel/vdso $@
        $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
-               $(build)=arch/riscv/kernel/compat_vdso $@)
+               $(build)=arch/riscv/kernel/compat_vdso compat_$@)
 
 ifeq ($(KBUILD_EXTMOD),)
 ifeq ($(CONFIG_MMU),y)
index 20e09056d141f5d15783daa8dc7037372bb4c1dd..e6694759dbd010f9d8b98a31d854a19a3491e10a 100644 (file)
@@ -39,15 +39,3 @@ void arch_jump_label_transform(struct jump_entry *entry,
        patch_text_nosync(addr, &insn, sizeof(insn));
        mutex_unlock(&text_mutex);
 }
-
-void arch_jump_label_transform_static(struct jump_entry *entry,
-                                     enum jump_label_type type)
-{
-       /*
-        * We use the same instructions in the arch_static_branch and
-        * arch_static_branch_jump inline functions, so there's no
-        * need to patch them up here.
-        * The core will call arch_jump_label_transform  when those
-        * instructions need to be replaced.
-        */
-}
index 2c6e1c6ecbe780284c2374d7ee0d4394b1a66fda..4120c428dc378ffdc0a656eb69535338af47dc9a 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Kernel interface for the s390 arch_random_* functions
  *
- * Copyright IBM Corp. 2017, 2020
+ * Copyright IBM Corp. 2017, 2022
  *
  * Author: Harald Freudenberger <freude@de.ibm.com>
  *
@@ -14,6 +14,7 @@
 #ifdef CONFIG_ARCH_RANDOM
 
 #include <linux/static_key.h>
+#include <linux/preempt.h>
 #include <linux/atomic.h>
 #include <asm/cpacf.h>
 
@@ -32,7 +33,8 @@ static inline bool __must_check arch_get_random_int(unsigned int *v)
 
 static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
 {
-       if (static_branch_likely(&s390_arch_random_available)) {
+       if (static_branch_likely(&s390_arch_random_available) &&
+           in_task()) {
                cpacf_trng(NULL, 0, (u8 *)v, sizeof(*v));
                atomic64_add(sizeof(*v), &s390_arch_random_counter);
                return true;
@@ -42,7 +44,8 @@ static inline bool __must_check arch_get_random_seed_long(unsigned long *v)
 
 static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
 {
-       if (static_branch_likely(&s390_arch_random_available)) {
+       if (static_branch_likely(&s390_arch_random_available) &&
+           in_task()) {
                cpacf_trng(NULL, 0, (u8 *)v, sizeof(*v));
                atomic64_add(sizeof(*v), &s390_arch_random_counter);
                return true;
index 916cfcb36d8ac91278a3f11b6de0624f0ce911ed..895f774bbcc55353cc7a3d302b009796a799446f 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/stringify.h>
 
 #define JUMP_LABEL_NOP_SIZE 6
-#define JUMP_LABEL_NOP_OFFSET 2
 
 #ifdef CONFIG_CC_IS_CLANG
 #define JUMP_LABEL_STATIC_KEY_CONSTRAINT "i"
 #endif
 
 /*
- * We use a brcl 0,2 instruction for jump labels at compile time so it
+ * We use a brcl 0,<offset> instruction for jump labels so it
  * can be easily distinguished from a hotpatch generated instruction.
  */
 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
 {
-       asm_volatile_goto("0:   brcl    0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n"
+       asm_volatile_goto("0:   brcl 0,%l[label]\n"
                          ".pushsection __jump_table,\"aw\"\n"
                          ".balign      8\n"
                          ".long        0b-.,%l[label]-.\n"
index 6bec000c6c1c73015bb3e251b36793976fe44e78..e808bb8bc0da4d02a3cda5c94808d814a0c68d32 100644 (file)
@@ -44,14 +44,8 @@ static void jump_label_bug(struct jump_entry *entry, struct insn *expected,
        panic("Corrupted kernel text");
 }
 
-static struct insn orignop = {
-       .opcode = 0xc004,
-       .offset = JUMP_LABEL_NOP_OFFSET >> 1,
-};
-
 static void jump_label_transform(struct jump_entry *entry,
-                                enum jump_label_type type,
-                                int init)
+                                enum jump_label_type type)
 {
        void *code = (void *)jump_entry_code(entry);
        struct insn old, new;
@@ -63,27 +57,22 @@ static void jump_label_transform(struct jump_entry *entry,
                jump_label_make_branch(entry, &old);
                jump_label_make_nop(entry, &new);
        }
-       if (init) {
-               if (memcmp(code, &orignop, sizeof(orignop)))
-                       jump_label_bug(entry, &orignop, &new);
-       } else {
-               if (memcmp(code, &old, sizeof(old)))
-                       jump_label_bug(entry, &old, &new);
-       }
+       if (memcmp(code, &old, sizeof(old)))
+               jump_label_bug(entry, &old, &new);
        s390_kernel_write(code, &new, sizeof(new));
 }
 
 void arch_jump_label_transform(struct jump_entry *entry,
                               enum jump_label_type type)
 {
-       jump_label_transform(entry, type, 0);
+       jump_label_transform(entry, type);
        text_poke_sync();
 }
 
 bool arch_jump_label_transform_queue(struct jump_entry *entry,
                                     enum jump_label_type type)
 {
-       jump_label_transform(entry, type, 0);
+       jump_label_transform(entry, type);
        return true;
 }
 
@@ -91,10 +80,3 @@ void arch_jump_label_transform_apply(void)
 {
        text_poke_sync();
 }
-
-void __init_or_module arch_jump_label_transform_static(struct jump_entry *entry,
-                                                      enum jump_label_type type)
-{
-       jump_label_transform(entry, type, 1);
-       text_poke_sync();
-}
index 26125a9c436d23f130c36f383b06a553a24031be..2d159b32885bc8434d0ddbd6443c47a12b57e0c4 100644 (file)
@@ -548,6 +548,5 @@ int module_finalize(const Elf_Ehdr *hdr,
 #endif /* CONFIG_FUNCTION_TRACER */
        }
 
-       jump_label_apply_nops(me);
        return 0;
 }
index d90d29d444691d23473dd9c024427c7cfba7ddc8..e699e2e041284313a1e49dd5587fb8bfd42c04f0 100644 (file)
@@ -29,8 +29,6 @@ CONFIG_IP_PNP_DHCP=y
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_IPV6 is not set
-CONFIG_IRDA=y
-CONFIG_SH_SIR=y
 CONFIG_MTD=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_BLOCK=y
index ef0f0827cf5756beb32e38d887520efe7edae6ff..56269c2c3414478b9f622c256e08302e5a25a7ac 100644 (file)
@@ -230,16 +230,17 @@ void migrate_irqs(void)
                struct irq_data *data = irq_get_irq_data(irq);
 
                if (irq_data_get_node(data) == cpu) {
-                       struct cpumask *mask = irq_data_get_affinity_mask(data);
+                       const struct cpumask *mask = irq_data_get_affinity_mask(data);
                        unsigned int newcpu = cpumask_any_and(mask,
                                                              cpu_online_mask);
                        if (newcpu >= nr_cpu_ids) {
                                pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n",
                                                    irq, cpu);
 
-                               cpumask_setall(mask);
+                               irq_set_affinity(irq, cpu_all_mask);
+                       } else {
+                               irq_set_affinity(irq, mask);
                        }
-                       irq_set_affinity(irq, mask);
                }
        }
 }
index df39580f398d3a6171fba5868b611d84bba7b8c6..66c45a2764bc893e204cadd120338613c7bfe63d 100644 (file)
@@ -208,9 +208,6 @@ int module_finalize(const Elf_Ehdr *hdr,
                    const Elf_Shdr *sechdrs,
                    struct module *me)
 {
-       /* make jump label nops */
-       jump_label_apply_nops(me);
-
        do_patch_sections(hdr, sechdrs);
 
        /* Cheetah's I-cache is fully coherent.  */
index 677111acbaa3ce9ea766680c3e437470dab573f5..f2e1d6c347fbdd6dc4b9f0eb2da9aa8e56e39549 100644 (file)
@@ -3,6 +3,4 @@ boot/compressed/vmlinux
 tools/test_get_len
 tools/insn_sanity
 tools/insn_decoder_test
-purgatory/kexec-purgatory.c
 purgatory/purgatory.ro
-
index 52a7f91527fe03fb1930d6a7cb7ae76269cacc06..5aa4c2ecf5c7b73be4df4e533d7ace49e9c4c7d2 100644 (file)
@@ -278,6 +278,7 @@ config X86
        select SYSCTL_EXCEPTION_TRACE
        select THREAD_INFO_IN_TASK
        select TRACE_IRQFLAGS_SUPPORT
+       select TRACE_IRQFLAGS_NMI_SUPPORT
        select USER_STACKTRACE_SUPPORT
        select VIRT_TO_BUS
        select HAVE_ARCH_KCSAN                  if X86_64
@@ -392,8 +393,8 @@ config PGTABLE_LEVELS
 
 config CC_HAS_SANE_STACKPROTECTOR
        bool
-       default $(success,$(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC)) if 64BIT
-       default $(success,$(srctree)/scripts/gcc-x86_32-has-stack-protector.sh $(CC))
+       default $(success,$(srctree)/scripts/gcc-x86_64-has-stack-protector.sh $(CC) $(CLANG_FLAGS)) if 64BIT
+       default $(success,$(srctree)/scripts/gcc-x86_32-has-stack-protector.sh $(CC) $(CLANG_FLAGS))
        help
          We have to make sure stack protector is unconditionally disabled if
          the compiler produces broken code or if it does not let us control
@@ -2010,7 +2011,7 @@ config KEXEC
 config KEXEC_FILE
        bool "kexec file based system call"
        select KEXEC_CORE
-       select BUILD_BIN2C
+       select HAVE_IMA_KEXEC if IMA
        depends on X86_64
        depends on CRYPTO=y
        depends on CRYPTO_SHA256=y
index 340399f699544fec5b28e2ef4274113f8f44cf76..bdfe08f1a9304f8c7c8df77de4665fc07a63c21c 100644 (file)
@@ -1,8 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-config TRACE_IRQFLAGS_NMI_SUPPORT
-       def_bool y
-
 config EARLY_PRINTK_USB
        bool
 
index 0d04414b97d2d498cc3c6bb928be5072f4724777..d568afc705d2e9226791a2bf8304bbb76e5d16ee 100644 (file)
@@ -21,7 +21,6 @@
 #define NUM_COUNTERS_NB                4
 #define NUM_COUNTERS_L2                4
 #define NUM_COUNTERS_L3                6
-#define MAX_COUNTERS           6
 
 #define RDPMC_BASE_NB          6
 #define RDPMC_BASE_LLC         10
@@ -31,6 +30,7 @@
 #undef pr_fmt
 #define pr_fmt(fmt)    "amd_uncore: " fmt
 
+static int pmu_version;
 static int num_counters_llc;
 static int num_counters_nb;
 static bool l3_mask;
@@ -46,7 +46,7 @@ struct amd_uncore {
        u32 msr_base;
        cpumask_t *active_mask;
        struct pmu *pmu;
-       struct perf_event *events[MAX_COUNTERS];
+       struct perf_event **events;
        struct hlist_node node;
 };
 
@@ -158,6 +158,16 @@ out:
        hwc->event_base_rdpmc = uncore->rdpmc_base + hwc->idx;
        hwc->state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
 
+       /*
+        * The first four DF counters are accessible via RDPMC index 6 to 9
+        * followed by the L3 counters from index 10 to 15. For processors
+        * with more than four DF counters, the DF RDPMC assignments become
+        * discontiguous as the additional counters are accessible starting
+        * from index 16.
+        */
+       if (is_nb_event(event) && hwc->idx >= NUM_COUNTERS_NB)
+               hwc->event_base_rdpmc += NUM_COUNTERS_L3;
+
        if (flags & PERF_EF_START)
                amd_uncore_start(event, PERF_EF_RELOAD);
 
@@ -209,10 +219,14 @@ static int amd_uncore_event_init(struct perf_event *event)
 {
        struct amd_uncore *uncore;
        struct hw_perf_event *hwc = &event->hw;
+       u64 event_mask = AMD64_RAW_EVENT_MASK_NB;
 
        if (event->attr.type != event->pmu->type)
                return -ENOENT;
 
+       if (pmu_version >= 2 && is_nb_event(event))
+               event_mask = AMD64_PERFMON_V2_RAW_EVENT_MASK_NB;
+
        /*
         * NB and Last level cache counters (MSRs) are shared across all cores
         * that share the same NB / Last level cache.  On family 16h and below,
@@ -221,7 +235,7 @@ static int amd_uncore_event_init(struct perf_event *event)
         * out. So we do not support sampling and per-thread events via
         * CAP_NO_INTERRUPT, and we do not enable counter overflow interrupts:
         */
-       hwc->config = event->attr.config & AMD64_RAW_EVENT_MASK_NB;
+       hwc->config = event->attr.config & event_mask;
        hwc->idx = -1;
 
        if (event->cpu < 0)
@@ -247,6 +261,19 @@ static int amd_uncore_event_init(struct perf_event *event)
        return 0;
 }
 
+static umode_t
+amd_f17h_uncore_is_visible(struct kobject *kobj, struct attribute *attr, int i)
+{
+       return boot_cpu_data.x86 >= 0x17 && boot_cpu_data.x86 < 0x19 ?
+              attr->mode : 0;
+}
+
+static umode_t
+amd_f19h_uncore_is_visible(struct kobject *kobj, struct attribute *attr, int i)
+{
+       return boot_cpu_data.x86 >= 0x19 ? attr->mode : 0;
+}
+
 static ssize_t amd_uncore_attr_show_cpumask(struct device *dev,
                                            struct device_attribute *attr,
                                            char *buf)
@@ -287,8 +314,10 @@ static struct device_attribute format_attr_##_var =                        \
 
 DEFINE_UNCORE_FORMAT_ATTR(event12,     event,          "config:0-7,32-35");
 DEFINE_UNCORE_FORMAT_ATTR(event14,     event,          "config:0-7,32-35,59-60"); /* F17h+ DF */
+DEFINE_UNCORE_FORMAT_ATTR(event14v2,   event,          "config:0-7,32-37");       /* PerfMonV2 DF */
 DEFINE_UNCORE_FORMAT_ATTR(event8,      event,          "config:0-7");             /* F17h+ L3 */
-DEFINE_UNCORE_FORMAT_ATTR(umask,       umask,          "config:8-15");
+DEFINE_UNCORE_FORMAT_ATTR(umask8,      umask,          "config:8-15");
+DEFINE_UNCORE_FORMAT_ATTR(umask12,     umask,          "config:8-15,24-27");      /* PerfMonV2 DF */
 DEFINE_UNCORE_FORMAT_ATTR(coreid,      coreid,         "config:42-44");           /* F19h L3 */
 DEFINE_UNCORE_FORMAT_ATTR(slicemask,   slicemask,      "config:48-51");           /* F17h L3 */
 DEFINE_UNCORE_FORMAT_ATTR(threadmask8, threadmask,     "config:56-63");           /* F17h L3 */
@@ -297,20 +326,33 @@ DEFINE_UNCORE_FORMAT_ATTR(enallslices,    enallslices,    "config:46");              /* F19h L3
 DEFINE_UNCORE_FORMAT_ATTR(enallcores,  enallcores,     "config:47");              /* F19h L3 */
 DEFINE_UNCORE_FORMAT_ATTR(sliceid,     sliceid,        "config:48-50");           /* F19h L3 */
 
+/* Common DF and NB attributes */
 static struct attribute *amd_uncore_df_format_attr[] = {
-       &format_attr_event12.attr, /* event14 if F17h+ */
-       &format_attr_umask.attr,
+       &format_attr_event12.attr,      /* event */
+       &format_attr_umask8.attr,       /* umask */
        NULL,
 };
 
+/* Common L2 and L3 attributes */
 static struct attribute *amd_uncore_l3_format_attr[] = {
-       &format_attr_event12.attr, /* event8 if F17h+ */
-       &format_attr_umask.attr,
-       NULL, /* slicemask if F17h,     coreid if F19h */
-       NULL, /* threadmask8 if F17h,   enallslices if F19h */
-       NULL, /*                        enallcores if F19h */
-       NULL, /*                        sliceid if F19h */
-       NULL, /*                        threadmask2 if F19h */
+       &format_attr_event12.attr,      /* event */
+       &format_attr_umask8.attr,       /* umask */
+       NULL,                           /* threadmask */
+       NULL,
+};
+
+/* F17h unique L3 attributes */
+static struct attribute *amd_f17h_uncore_l3_format_attr[] = {
+       &format_attr_slicemask.attr,    /* slicemask */
+       NULL,
+};
+
+/* F19h unique L3 attributes */
+static struct attribute *amd_f19h_uncore_l3_format_attr[] = {
+       &format_attr_coreid.attr,       /* coreid */
+       &format_attr_enallslices.attr,  /* enallslices */
+       &format_attr_enallcores.attr,   /* enallcores */
+       &format_attr_sliceid.attr,      /* sliceid */
        NULL,
 };
 
@@ -324,6 +366,18 @@ static struct attribute_group amd_uncore_l3_format_group = {
        .attrs = amd_uncore_l3_format_attr,
 };
 
+static struct attribute_group amd_f17h_uncore_l3_format_group = {
+       .name = "format",
+       .attrs = amd_f17h_uncore_l3_format_attr,
+       .is_visible = amd_f17h_uncore_is_visible,
+};
+
+static struct attribute_group amd_f19h_uncore_l3_format_group = {
+       .name = "format",
+       .attrs = amd_f19h_uncore_l3_format_attr,
+       .is_visible = amd_f19h_uncore_is_visible,
+};
+
 static const struct attribute_group *amd_uncore_df_attr_groups[] = {
        &amd_uncore_attr_group,
        &amd_uncore_df_format_group,
@@ -336,6 +390,12 @@ static const struct attribute_group *amd_uncore_l3_attr_groups[] = {
        NULL,
 };
 
+static const struct attribute_group *amd_uncore_l3_attr_update[] = {
+       &amd_f17h_uncore_l3_format_group,
+       &amd_f19h_uncore_l3_format_group,
+       NULL,
+};
+
 static struct pmu amd_nb_pmu = {
        .task_ctx_nr    = perf_invalid_context,
        .attr_groups    = amd_uncore_df_attr_groups,
@@ -353,6 +413,7 @@ static struct pmu amd_nb_pmu = {
 static struct pmu amd_llc_pmu = {
        .task_ctx_nr    = perf_invalid_context,
        .attr_groups    = amd_uncore_l3_attr_groups,
+       .attr_update    = amd_uncore_l3_attr_update,
        .name           = "amd_l2",
        .event_init     = amd_uncore_event_init,
        .add            = amd_uncore_add,
@@ -370,11 +431,19 @@ static struct amd_uncore *amd_uncore_alloc(unsigned int cpu)
                        cpu_to_node(cpu));
 }
 
+static inline struct perf_event **
+amd_uncore_events_alloc(unsigned int num, unsigned int cpu)
+{
+       return kzalloc_node(sizeof(struct perf_event *) * num, GFP_KERNEL,
+                           cpu_to_node(cpu));
+}
+
 static int amd_uncore_cpu_up_prepare(unsigned int cpu)
 {
-       struct amd_uncore *uncore_nb = NULL, *uncore_llc;
+       struct amd_uncore *uncore_nb = NULL, *uncore_llc = NULL;
 
        if (amd_uncore_nb) {
+               *per_cpu_ptr(amd_uncore_nb, cpu) = NULL;
                uncore_nb = amd_uncore_alloc(cpu);
                if (!uncore_nb)
                        goto fail;
@@ -384,11 +453,15 @@ static int amd_uncore_cpu_up_prepare(unsigned int cpu)
                uncore_nb->msr_base = MSR_F15H_NB_PERF_CTL;
                uncore_nb->active_mask = &amd_nb_active_mask;
                uncore_nb->pmu = &amd_nb_pmu;
+               uncore_nb->events = amd_uncore_events_alloc(num_counters_nb, cpu);
+               if (!uncore_nb->events)
+                       goto fail;
                uncore_nb->id = -1;
                *per_cpu_ptr(amd_uncore_nb, cpu) = uncore_nb;
        }
 
        if (amd_uncore_llc) {
+               *per_cpu_ptr(amd_uncore_llc, cpu) = NULL;
                uncore_llc = amd_uncore_alloc(cpu);
                if (!uncore_llc)
                        goto fail;
@@ -398,6 +471,9 @@ static int amd_uncore_cpu_up_prepare(unsigned int cpu)
                uncore_llc->msr_base = MSR_F16H_L2I_PERF_CTL;
                uncore_llc->active_mask = &amd_llc_active_mask;
                uncore_llc->pmu = &amd_llc_pmu;
+               uncore_llc->events = amd_uncore_events_alloc(num_counters_llc, cpu);
+               if (!uncore_llc->events)
+                       goto fail;
                uncore_llc->id = -1;
                *per_cpu_ptr(amd_uncore_llc, cpu) = uncore_llc;
        }
@@ -405,9 +481,16 @@ static int amd_uncore_cpu_up_prepare(unsigned int cpu)
        return 0;
 
 fail:
-       if (amd_uncore_nb)
-               *per_cpu_ptr(amd_uncore_nb, cpu) = NULL;
-       kfree(uncore_nb);
+       if (uncore_nb) {
+               kfree(uncore_nb->events);
+               kfree(uncore_nb);
+       }
+
+       if (uncore_llc) {
+               kfree(uncore_llc->events);
+               kfree(uncore_llc);
+       }
+
        return -ENOMEM;
 }
 
@@ -540,8 +623,11 @@ static void uncore_dead(unsigned int cpu, struct amd_uncore * __percpu *uncores)
        if (cpu == uncore->cpu)
                cpumask_clear_cpu(cpu, uncore->active_mask);
 
-       if (!--uncore->refcnt)
+       if (!--uncore->refcnt) {
+               kfree(uncore->events);
                kfree(uncore);
+       }
+
        *per_cpu_ptr(uncores, cpu) = NULL;
 }
 
@@ -560,6 +646,7 @@ static int __init amd_uncore_init(void)
 {
        struct attribute **df_attr = amd_uncore_df_format_attr;
        struct attribute **l3_attr = amd_uncore_l3_format_attr;
+       union cpuid_0x80000022_ebx ebx;
        int ret = -ENODEV;
 
        if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD &&
@@ -569,6 +656,9 @@ static int __init amd_uncore_init(void)
        if (!boot_cpu_has(X86_FEATURE_TOPOEXT))
                return -ENODEV;
 
+       if (boot_cpu_has(X86_FEATURE_PERFMON_V2))
+               pmu_version = 2;
+
        num_counters_nb = NUM_COUNTERS_NB;
        num_counters_llc = NUM_COUNTERS_L2;
        if (boot_cpu_data.x86 >= 0x17) {
@@ -585,8 +675,12 @@ static int __init amd_uncore_init(void)
        }
 
        if (boot_cpu_has(X86_FEATURE_PERFCTR_NB)) {
-               if (boot_cpu_data.x86 >= 0x17)
+               if (pmu_version >= 2) {
+                       *df_attr++ = &format_attr_event14v2.attr;
+                       *df_attr++ = &format_attr_umask12.attr;
+               } else if (boot_cpu_data.x86 >= 0x17) {
                        *df_attr = &format_attr_event14.attr;
+               }
 
                amd_uncore_nb = alloc_percpu(struct amd_uncore *);
                if (!amd_uncore_nb) {
@@ -597,6 +691,11 @@ static int __init amd_uncore_init(void)
                if (ret)
                        goto fail_nb;
 
+               if (pmu_version >= 2) {
+                       ebx.full = cpuid_ebx(EXT_PERFMON_DEBUG_FEATURES);
+                       num_counters_nb = ebx.split.num_df_pmc;
+               }
+
                pr_info("%d %s %s counters detected\n", num_counters_nb,
                        boot_cpu_data.x86_vendor == X86_VENDOR_HYGON ?  "HYGON" : "",
                        amd_nb_pmu.name);
@@ -607,16 +706,11 @@ static int __init amd_uncore_init(void)
        if (boot_cpu_has(X86_FEATURE_PERFCTR_LLC)) {
                if (boot_cpu_data.x86 >= 0x19) {
                        *l3_attr++ = &format_attr_event8.attr;
-                       *l3_attr++ = &format_attr_umask.attr;
-                       *l3_attr++ = &format_attr_coreid.attr;
-                       *l3_attr++ = &format_attr_enallslices.attr;
-                       *l3_attr++ = &format_attr_enallcores.attr;
-                       *l3_attr++ = &format_attr_sliceid.attr;
+                       *l3_attr++ = &format_attr_umask8.attr;
                        *l3_attr++ = &format_attr_threadmask2.attr;
                } else if (boot_cpu_data.x86 >= 0x17) {
                        *l3_attr++ = &format_attr_event8.attr;
-                       *l3_attr++ = &format_attr_umask.attr;
-                       *l3_attr++ = &format_attr_slicemask.attr;
+                       *l3_attr++ = &format_attr_umask8.attr;
                        *l3_attr++ = &format_attr_threadmask8.attr;
                }
 
index 45024abd929f0aba75664f24be3898edb6325ed9..bd8b98857609705ae4e04e2815be53e255aba4d2 100644 (file)
@@ -4141,6 +4141,8 @@ tnt_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
 {
        struct event_constraint *c;
 
+       c = intel_get_event_constraints(cpuc, idx, event);
+
        /*
         * :ppp means to do reduced skid PEBS,
         * which is available on PMC0 and fixed counter 0.
@@ -4153,8 +4155,6 @@ tnt_get_event_constraints(struct cpu_hw_events *cpuc, int idx,
                return &counter0_constraint;
        }
 
-       c = intel_get_event_constraints(cpuc, idx, event);
-
        return c;
 }
 
@@ -6241,7 +6241,8 @@ __init int intel_pmu_init(void)
                x86_pmu.flags |= PMU_FL_INSTR_LATENCY;
                x86_pmu.flags |= PMU_FL_MEM_LOADS_AUX;
                x86_pmu.lbr_pt_coexist = true;
-               intel_pmu_pebs_data_source_skl(false);
+               intel_pmu_pebs_data_source_adl();
+               x86_pmu.pebs_latency_data = adl_latency_data_small;
                x86_pmu.num_topdown_events = 8;
                x86_pmu.update_topdown_event = adl_update_topdown_event;
                x86_pmu.set_topdown_event_period = adl_set_topdown_event_period;
index 376cc3d66094ce05d9804f2fdc64834551912857..ba60427caa6d36553672509c22a292ea7e2b7d1e 100644 (file)
@@ -94,15 +94,40 @@ void __init intel_pmu_pebs_data_source_nhm(void)
        pebs_data_source[0x07] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HITM);
 }
 
-void __init intel_pmu_pebs_data_source_skl(bool pmem)
+static void __init __intel_pmu_pebs_data_source_skl(bool pmem, u64 *data_source)
 {
        u64 pmem_or_l4 = pmem ? LEVEL(PMEM) : LEVEL(L4);
 
-       pebs_data_source[0x08] = OP_LH | pmem_or_l4 | P(SNOOP, HIT);
-       pebs_data_source[0x09] = OP_LH | pmem_or_l4 | REM | P(SNOOP, HIT);
-       pebs_data_source[0x0b] = OP_LH | LEVEL(RAM) | REM | P(SNOOP, NONE);
-       pebs_data_source[0x0c] = OP_LH | LEVEL(ANY_CACHE) | REM | P(SNOOPX, FWD);
-       pebs_data_source[0x0d] = OP_LH | LEVEL(ANY_CACHE) | REM | P(SNOOP, HITM);
+       data_source[0x08] = OP_LH | pmem_or_l4 | P(SNOOP, HIT);
+       data_source[0x09] = OP_LH | pmem_or_l4 | REM | P(SNOOP, HIT);
+       data_source[0x0b] = OP_LH | LEVEL(RAM) | REM | P(SNOOP, NONE);
+       data_source[0x0c] = OP_LH | LEVEL(ANY_CACHE) | REM | P(SNOOPX, FWD);
+       data_source[0x0d] = OP_LH | LEVEL(ANY_CACHE) | REM | P(SNOOP, HITM);
+}
+
+void __init intel_pmu_pebs_data_source_skl(bool pmem)
+{
+       __intel_pmu_pebs_data_source_skl(pmem, pebs_data_source);
+}
+
+static void __init intel_pmu_pebs_data_source_grt(u64 *data_source)
+{
+       data_source[0x05] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HIT);
+       data_source[0x06] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOP, HITM);
+       data_source[0x08] = OP_LH | P(LVL, L3) | LEVEL(L3) | P(SNOOPX, FWD);
+}
+
+void __init intel_pmu_pebs_data_source_adl(void)
+{
+       u64 *data_source;
+
+       data_source = x86_pmu.hybrid_pmu[X86_HYBRID_PMU_CORE_IDX].pebs_data_source;
+       memcpy(data_source, pebs_data_source, sizeof(pebs_data_source));
+       __intel_pmu_pebs_data_source_skl(false, data_source);
+
+       data_source = x86_pmu.hybrid_pmu[X86_HYBRID_PMU_ATOM_IDX].pebs_data_source;
+       memcpy(data_source, pebs_data_source, sizeof(pebs_data_source));
+       intel_pmu_pebs_data_source_grt(data_source);
 }
 
 static u64 precise_store_data(u64 status)
@@ -171,7 +196,50 @@ static u64 precise_datala_hsw(struct perf_event *event, u64 status)
        return dse.val;
 }
 
-static u64 load_latency_data(u64 status)
+static inline void pebs_set_tlb_lock(u64 *val, bool tlb, bool lock)
+{
+       /*
+        * TLB access
+        * 0 = did not miss 2nd level TLB
+        * 1 = missed 2nd level TLB
+        */
+       if (tlb)
+               *val |= P(TLB, MISS) | P(TLB, L2);
+       else
+               *val |= P(TLB, HIT) | P(TLB, L1) | P(TLB, L2);
+
+       /* locked prefix */
+       if (lock)
+               *val |= P(LOCK, LOCKED);
+}
+
+/* Retrieve the latency data for e-core of ADL */
+u64 adl_latency_data_small(struct perf_event *event, u64 status)
+{
+       union intel_x86_pebs_dse dse;
+       u64 val;
+
+       WARN_ON_ONCE(hybrid_pmu(event->pmu)->cpu_type == hybrid_big);
+
+       dse.val = status;
+
+       val = hybrid_var(event->pmu, pebs_data_source)[dse.ld_dse];
+
+       /*
+        * For the atom core on ADL,
+        * bit 4: lock, bit 5: TLB access.
+        */
+       pebs_set_tlb_lock(&val, dse.ld_locked, dse.ld_stlb_miss);
+
+       if (dse.ld_data_blk)
+               val |= P(BLK, DATA);
+       else
+               val |= P(BLK, NA);
+
+       return val;
+}
+
+static u64 load_latency_data(struct perf_event *event, u64 status)
 {
        union intel_x86_pebs_dse dse;
        u64 val;
@@ -181,7 +249,7 @@ static u64 load_latency_data(u64 status)
        /*
         * use the mapping table for bit 0-3
         */
-       val = pebs_data_source[dse.ld_dse];
+       val = hybrid_var(event->pmu, pebs_data_source)[dse.ld_dse];
 
        /*
         * Nehalem models do not support TLB, Lock infos
@@ -190,21 +258,8 @@ static u64 load_latency_data(u64 status)
                val |= P(TLB, NA) | P(LOCK, NA);
                return val;
        }
-       /*
-        * bit 4: TLB access
-        * 0 = did not miss 2nd level TLB
-        * 1 = missed 2nd level TLB
-        */
-       if (dse.ld_stlb_miss)
-               val |= P(TLB, MISS) | P(TLB, L2);
-       else
-               val |= P(TLB, HIT) | P(TLB, L1) | P(TLB, L2);
 
-       /*
-        * bit 5: locked prefix
-        */
-       if (dse.ld_locked)
-               val |= P(LOCK, LOCKED);
+       pebs_set_tlb_lock(&val, dse.ld_stlb_miss, dse.ld_locked);
 
        /*
         * Ice Lake and earlier models do not support block infos.
@@ -233,7 +288,7 @@ static u64 load_latency_data(u64 status)
        return val;
 }
 
-static u64 store_latency_data(u64 status)
+static u64 store_latency_data(struct perf_event *event, u64 status)
 {
        union intel_x86_pebs_dse dse;
        u64 val;
@@ -243,23 +298,9 @@ static u64 store_latency_data(u64 status)
        /*
         * use the mapping table for bit 0-3
         */
-       val = pebs_data_source[dse.st_lat_dse];
+       val = hybrid_var(event->pmu, pebs_data_source)[dse.st_lat_dse];
 
-       /*
-        * bit 4: TLB access
-        * 0 = did not miss 2nd level TLB
-        * 1 = missed 2nd level TLB
-        */
-       if (dse.st_lat_stlb_miss)
-               val |= P(TLB, MISS) | P(TLB, L2);
-       else
-               val |= P(TLB, HIT) | P(TLB, L1) | P(TLB, L2);
-
-       /*
-        * bit 5: locked prefix
-        */
-       if (dse.st_lat_locked)
-               val |= P(LOCK, LOCKED);
+       pebs_set_tlb_lock(&val, dse.st_lat_stlb_miss, dse.st_lat_locked);
 
        val |= P(BLK, NA);
 
@@ -781,8 +822,8 @@ struct event_constraint intel_glm_pebs_event_constraints[] = {
 
 struct event_constraint intel_grt_pebs_event_constraints[] = {
        /* Allow all events as PEBS with no flags */
-       INTEL_PLD_CONSTRAINT(0x5d0, 0xf),
-       INTEL_PSD_CONSTRAINT(0x6d0, 0xf),
+       INTEL_HYBRID_LAT_CONSTRAINT(0x5d0, 0xf),
+       INTEL_HYBRID_LAT_CONSTRAINT(0x6d0, 0xf),
        EVENT_CONSTRAINT_END
 };
 
@@ -1443,9 +1484,11 @@ static u64 get_data_src(struct perf_event *event, u64 aux)
        bool fst = fl & (PERF_X86_EVENT_PEBS_ST | PERF_X86_EVENT_PEBS_HSW_PREC);
 
        if (fl & PERF_X86_EVENT_PEBS_LDLAT)
-               val = load_latency_data(aux);
+               val = load_latency_data(event, aux);
        else if (fl & PERF_X86_EVENT_PEBS_STLAT)
-               val = store_latency_data(aux);
+               val = store_latency_data(event, aux);
+       else if (fl & PERF_X86_EVENT_PEBS_LAT_HYBRID)
+               val = x86_pmu.pebs_latency_data(event, aux);
        else if (fst && (fl & PERF_X86_EVENT_PEBS_HSW_PREC))
                val = precise_datala_hsw(event, aux);
        else if (fst)
index 21a5482bcf8458c29a62fb6670a4eadaa4aaa683..ca2f8bfe6ff106d5b8d2dcb86de97f9944ceed6a 100644 (file)
@@ -84,6 +84,7 @@ static inline bool constraint_match(struct event_constraint *c, u64 ecode)
 #define PERF_X86_EVENT_TOPDOWN         0x04000 /* Count Topdown slots/metrics events */
 #define PERF_X86_EVENT_PEBS_STLAT      0x08000 /* st+stlat data address sampling */
 #define PERF_X86_EVENT_AMD_BRS         0x10000 /* AMD Branch Sampling */
+#define PERF_X86_EVENT_PEBS_LAT_HYBRID 0x20000 /* ld and st lat for hybrid */
 
 static inline bool is_topdown_count(struct perf_event *event)
 {
@@ -136,7 +137,8 @@ struct amd_nb {
        PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | \
        PERF_SAMPLE_TRANSACTION | PERF_SAMPLE_PHYS_ADDR | \
        PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER | \
-       PERF_SAMPLE_PERIOD | PERF_SAMPLE_CODE_PAGE_SIZE)
+       PERF_SAMPLE_PERIOD | PERF_SAMPLE_CODE_PAGE_SIZE | \
+       PERF_SAMPLE_WEIGHT_TYPE)
 
 #define PEBS_GP_REGS                   \
        ((1ULL << PERF_REG_X86_AX)    | \
@@ -460,6 +462,10 @@ struct cpu_hw_events {
        __EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK|X86_ALL_EVENT_FLAGS, \
                          HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_ST)
 
+#define INTEL_HYBRID_LAT_CONSTRAINT(c, n)      \
+       __EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK|X86_ALL_EVENT_FLAGS, \
+                         HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_LAT_HYBRID)
+
 /* Event constraint, but match on all event flags too. */
 #define INTEL_FLAGS_EVENT_CONSTRAINT(c, n) \
        EVENT_CONSTRAINT(c, n, ARCH_PERFMON_EVENTSEL_EVENT|X86_ALL_EVENT_FLAGS)
@@ -638,6 +644,8 @@ enum {
        x86_lbr_exclusive_max,
 };
 
+#define PERF_PEBS_DATA_SOURCE_MAX      0x10
+
 struct x86_hybrid_pmu {
        struct pmu                      pmu;
        const char                      *name;
@@ -665,6 +673,8 @@ struct x86_hybrid_pmu {
        unsigned int                    late_ack        :1,
                                        mid_ack         :1,
                                        enabled_ack     :1;
+
+       u64                             pebs_data_source[PERF_PEBS_DATA_SOURCE_MAX];
 };
 
 static __always_inline struct x86_hybrid_pmu *hybrid_pmu(struct pmu *pmu)
@@ -825,6 +835,7 @@ struct x86_pmu {
        void            (*drain_pebs)(struct pt_regs *regs, struct perf_sample_data *data);
        struct event_constraint *pebs_constraints;
        void            (*pebs_aliases)(struct perf_event *event);
+       u64             (*pebs_latency_data)(struct perf_event *event, u64 status);
        unsigned long   large_pebs_flags;
        u64             rtm_abort_event;
 
@@ -1392,6 +1403,8 @@ void intel_pmu_disable_bts(void);
 
 int intel_pmu_drain_bts_buffer(void);
 
+u64 adl_latency_data_small(struct perf_event *event, u64 status);
+
 extern struct event_constraint intel_core2_pebs_event_constraints[];
 
 extern struct event_constraint intel_atom_pebs_event_constraints[];
@@ -1499,6 +1512,8 @@ void intel_pmu_pebs_data_source_nhm(void);
 
 void intel_pmu_pebs_data_source_skl(bool pmem);
 
+void intel_pmu_pebs_data_source_adl(void);
+
 int intel_pmu_setup_lbr_filter(struct perf_event *event);
 
 void intel_pt_interrupt(void);
index 7e0f6bedc248c4f5d22c2558539c1ddf39024a97..42c70d28ef272dd3de0c07cbf47efced041b43aa 100644 (file)
@@ -192,7 +192,7 @@ static void hv_irq_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
        struct pci_dev *dev;
        struct hv_interrupt_entry out_entry, *stored_entry;
        struct irq_cfg *cfg = irqd_cfg(data);
-       cpumask_t *affinity;
+       const cpumask_t *affinity;
        int cpu;
        u64 status;
 
index aabdbb5ab92008a67e6501563c85f8278e836084..f3eb098d63d4bcf8e3d84fadd561d21f7d0f16f3 100644 (file)
@@ -29,7 +29,10 @@ union ibs_fetch_ctl {
                        rand_en:1,      /* 57: random tagging enable */
                        fetch_l2_miss:1,/* 58: L2 miss for sampled fetch
                                         *      (needs IbsFetchComp) */
-                       reserved:5;     /* 59-63: reserved */
+                       l3_miss_only:1, /* 59: Collect L3 miss samples only */
+                       fetch_oc_miss:1,/* 60: Op cache miss for the sampled fetch */
+                       fetch_l3_miss:1,/* 61: L3 cache miss for the sampled fetch */
+                       reserved:2;     /* 62-63: reserved */
        };
 };
 
@@ -38,14 +41,14 @@ union ibs_op_ctl {
        __u64 val;
        struct {
                __u64   opmaxcnt:16,    /* 0-15: periodic op max. count */
-                       reserved0:1,    /* 16: reserved */
+                       l3_miss_only:1, /* 16: Collect L3 miss samples only */
                        op_en:1,        /* 17: op sampling enable */
                        op_val:1,       /* 18: op sample valid */
                        cnt_ctl:1,      /* 19: periodic op counter control */
                        opmaxcnt_ext:7, /* 20-26: upper 7 bits of periodic op maximum count */
-                       reserved1:5,    /* 27-31: reserved */
+                       reserved0:5,    /* 27-31: reserved */
                        opcurcnt:27,    /* 32-58: periodic op counter current count */
-                       reserved2:5;    /* 59-63: reserved */
+                       reserved1:5;    /* 59-63: reserved */
        };
 };
 
@@ -71,11 +74,12 @@ union ibs_op_data {
 union ibs_op_data2 {
        __u64 val;
        struct {
-               __u64   data_src:3,     /* 0-2: data source */
+               __u64   data_src_lo:3,  /* 0-2: data source low */
                        reserved0:1,    /* 3: reserved */
                        rmt_node:1,     /* 4: destination node */
                        cache_hit_st:1, /* 5: cache hit state */
-                       reserved1:57;   /* 5-63: reserved */
+                       data_src_hi:2,  /* 6-7: data source high */
+                       reserved1:56;   /* 8-63: reserved */
        };
 };
 
index a77b915d36a8ed8885f4c33e11597a3950102747..5fe7f6c8a7a4142d614ab1ae313ace314275978b 100644 (file)
 #define X86_FEATURE_IBRS               ( 7*32+25) /* Indirect Branch Restricted Speculation */
 #define X86_FEATURE_IBPB               ( 7*32+26) /* Indirect Branch Prediction Barrier */
 #define X86_FEATURE_STIBP              ( 7*32+27) /* Single Thread Indirect Branch Predictors */
-#define X86_FEATURE_ZEN                        ( 7*32+28) /* "" CPU is AMD family 0x17 or above (Zen) */
+#define X86_FEATURE_ZEN                        (7*32+28) /* "" CPU based on Zen microarchitecture */
 #define X86_FEATURE_L1TF_PTEINV                ( 7*32+29) /* "" L1TF workaround PTE inversion */
 #define X86_FEATURE_IBRS_ENHANCED      ( 7*32+30) /* Enhanced IBRS */
 #define X86_FEATURE_MSR_IA32_FEAT_CTL  ( 7*32+31) /* "" MSR IA32_FEAT_CTL configured */
index 6b0f31fb53f7e27e6d21a2076914a808b24c0685..503a577814b2e5a7b47c1f5069a76c3e568ff6b7 100644 (file)
@@ -164,4 +164,6 @@ static inline bool fpstate_is_confidential(struct fpu_guest *gfpu)
 /* prctl */
 extern long fpu_xstate_prctl(int option, unsigned long arg2);
 
+extern void fpu_idle_fpregs(void);
+
 #endif /* _ASM_X86_FPU_API_H */
index 29dd27b5a339db16cfb1b40aa68004cf7b2bac0c..3a8fdf881313d8aad8d722e592db34b0d651f72a 100644 (file)
@@ -13,6 +13,7 @@
 #define MWAIT_SUBSTATE_SIZE            4
 #define MWAIT_HINT2CSTATE(hint)                (((hint) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK)
 #define MWAIT_HINT2SUBSTATE(hint)      ((hint) & MWAIT_CSTATE_MASK)
+#define MWAIT_C1_SUBSTATE_MASK  0xf0
 
 #define CPUID_MWAIT_LEAF               5
 #define CPUID5_ECX_EXTENSIONS_SUPPORTED 0x1
index 38a3e86e665ef25310ac60bca516f58d84201680..cba942006ffe4385615cdce64797bc1ddba4cb34 100644 (file)
 #endif
 .endm
 
+/*
+ * Equivalent to -mindirect-branch-cs-prefix; emit the 5 byte jmp/call
+ * to the retpoline thunk with a CS prefix when the register requires
+ * a RAX prefix byte to encode. Also see apply_retpolines().
+ */
+.macro __CS_PREFIX reg:req
+       .irp rs,r8,r9,r10,r11,r12,r13,r14,r15
+       .ifc \reg,\rs
+       .byte 0x2e
+       .endif
+       .endr
+.endm
+
 /*
  * JMP_NOSPEC and CALL_NOSPEC macros can be used instead of a simple
  * indirect jmp/call which may be susceptible to the Spectre variant 2
  */
 .macro JMP_NOSPEC reg:req
 #ifdef CONFIG_RETPOLINE
-       ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; jmp *%\reg), \
-                     __stringify(jmp __x86_indirect_thunk_\reg), X86_FEATURE_RETPOLINE, \
-                     __stringify(lfence; ANNOTATE_RETPOLINE_SAFE; jmp *%\reg), X86_FEATURE_RETPOLINE_LFENCE
+       __CS_PREFIX \reg
+       jmp     __x86_indirect_thunk_\reg
 #else
        jmp     *%\reg
+       int3
 #endif
 .endm
 
 .macro CALL_NOSPEC reg:req
 #ifdef CONFIG_RETPOLINE
-       ALTERNATIVE_2 __stringify(ANNOTATE_RETPOLINE_SAFE; call *%\reg), \
-                     __stringify(call __x86_indirect_thunk_\reg), X86_FEATURE_RETPOLINE, \
-                     __stringify(lfence; ANNOTATE_RETPOLINE_SAFE; call *%\reg), X86_FEATURE_RETPOLINE_LFENCE
+       __CS_PREFIX \reg
+       call    __x86_indirect_thunk_\reg
 #else
        call    *%\reg
 #endif
index 409725e86f42c4453306c6d446ff04207e1b594d..34348ae41cdbd4042ab314df637f1e2b6c7ebeb9 100644 (file)
 #define AMD64_RAW_EVENT_MASK_NB                \
        (AMD64_EVENTSEL_EVENT        |  \
         ARCH_PERFMON_EVENTSEL_UMASK)
+
+#define AMD64_PERFMON_V2_EVENTSEL_EVENT_NB     \
+       (AMD64_EVENTSEL_EVENT   |               \
+        GENMASK_ULL(37, 36))
+
+#define AMD64_PERFMON_V2_EVENTSEL_UMASK_NB     \
+       (ARCH_PERFMON_EVENTSEL_UMASK    |       \
+        GENMASK_ULL(27, 24))
+
+#define AMD64_PERFMON_V2_RAW_EVENT_MASK_NB             \
+       (AMD64_PERFMON_V2_EVENTSEL_EVENT_NB     |       \
+        AMD64_PERFMON_V2_EVENTSEL_UMASK_NB)
+
 #define AMD64_NUM_COUNTERS                             4
 #define AMD64_NUM_COUNTERS_CORE                                6
 #define AMD64_NUM_COUNTERS_NB                          4
@@ -194,6 +207,9 @@ union cpuid_0x80000022_ebx {
        struct {
                /* Number of Core Performance Counters */
                unsigned int    num_core_pmc:4;
+               unsigned int    reserved:6;
+               /* Number of Data Fabric Counters */
+               unsigned int    num_df_pmc:6;
        } split;
        unsigned int            full;
 };
index 19514524f0f8bac6ae0add43b0ba4f054126a840..4a23e52fe0ee1632eb64fb1ed6ab183c5b7bb81f 100644 (file)
@@ -72,7 +72,6 @@ static inline u64 lower_bits(u64 val, unsigned int bits)
 
 struct real_mode_header;
 enum stack_type;
-struct ghcb;
 
 /* Early IDT entry points for #VC handler */
 extern void vc_no_ghcb(void);
@@ -156,11 +155,7 @@ static __always_inline void sev_es_nmi_complete(void)
                __sev_es_nmi_complete();
 }
 extern int __init sev_es_efi_map_ghcbs(pgd_t *pgd);
-extern enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
-                                         bool set_ghcb_msr,
-                                         struct es_em_ctxt *ctxt,
-                                         u64 exit_code, u64 exit_info_1,
-                                         u64 exit_info_2);
+
 static inline int rmpadjust(unsigned long vaddr, bool rmp_psize, unsigned long attrs)
 {
        int rc;
index 45b18eb94fa1a854933f78ed6df4371d4855bb4d..35f709f619fb4fc2278ddbe09c3ef72f20e1cfcb 100644 (file)
@@ -295,6 +295,15 @@ static inline int enqcmds(void __iomem *dst, const void *src)
        return 0;
 }
 
+static inline void tile_release(void)
+{
+       /*
+        * Instruction opcode for TILERELEASE; supported in binutils
+        * version >= 2.36.
+        */
+       asm volatile(".byte 0xc4, 0xe2, 0x78, 0x49, 0xc0");
+}
+
 #endif /* __KERNEL__ */
 
 #endif /* _ASM_X86_SPECIAL_INSNS_H */
index 4af5579c7ef7c6a8399469909b74223b2d94d8b2..cda3118f3b27d2228f6e9eeb1e7fb85a65fc0f9e 100644 (file)
@@ -16,6 +16,7 @@
 void __flush_tlb_all(void);
 
 #define TLB_FLUSH_ALL  -1UL
+#define TLB_GENERATION_INVALID 0
 
 void cr4_update_irqsoff(unsigned long set, unsigned long clear);
 unsigned long cr4_read_shadow(void);
index e02a8a8ef23cec816ab256135623baa11b0de2f3..342290624040186026c7555d4934bb018e2c3156 100644 (file)
 #define SETUP_APPLE_PROPERTIES         5
 #define SETUP_JAILHOUSE                        6
 #define SETUP_CC_BLOB                  7
+#define SETUP_IMA                      8
+#define SETUP_RNG_SEED                 9
+#define SETUP_ENUM_MAX                 SETUP_RNG_SEED
 
 #define SETUP_INDIRECT                 (1<<31)
-
-/* SETUP_INDIRECT | max(SETUP_*) */
-#define SETUP_TYPE_MAX                 (SETUP_INDIRECT | SETUP_CC_BLOB)
+#define SETUP_TYPE_MAX                 (SETUP_ENUM_MAX | SETUP_INDIRECT)
 
 /* ram_size flags */
 #define RAMDISK_IMAGE_START_MASK       0x07FF
@@ -172,6 +173,14 @@ struct jailhouse_setup_data {
        } __attribute__((packed)) v2;
 } __attribute__((packed));
 
+/*
+ * IMA buffer setup data information from the previous kernel during kexec
+ */
+struct ima_setup_data {
+       __u64 addr;
+       __u64 size;
+} __attribute__((packed));
+
 /* The so-called "zeropage" */
 struct boot_params {
        struct screen_info screen_info;                 /* 0x000 */
index 4c8b6ae802ac397dca639fae33b8e24538618892..a20a5ebfacd73f772249b986c55f3e5f5e15a044 100644 (file)
@@ -34,8 +34,6 @@ KASAN_SANITIZE_sev.o                                  := n
 # by several compilation units. To be safe, disable all instrumentation.
 KCSAN_SANITIZE := n
 
-OBJECT_FILES_NON_STANDARD_test_nx.o                    := y
-
 # 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 190e0f76337559f27e3b42f246f4b06f12a23ddc..4266b64631a46af574c7592fa8e17e4d8fda0f7a 100644 (file)
 #define PCI_DEVICE_ID_AMD_17H_M10H_ROOT        0x15d0
 #define PCI_DEVICE_ID_AMD_17H_M30H_ROOT        0x1480
 #define PCI_DEVICE_ID_AMD_17H_M60H_ROOT        0x1630
+#define PCI_DEVICE_ID_AMD_17H_MA0H_ROOT        0x14b5
 #define PCI_DEVICE_ID_AMD_19H_M10H_ROOT        0x14a4
+#define PCI_DEVICE_ID_AMD_19H_M60H_ROOT        0x14d8
+#define PCI_DEVICE_ID_AMD_19H_M70H_ROOT        0x14e8
 #define PCI_DEVICE_ID_AMD_17H_DF_F4    0x1464
 #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F4 0x15ec
 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F4 0x1494
 #define PCI_DEVICE_ID_AMD_17H_M60H_DF_F4 0x144c
 #define PCI_DEVICE_ID_AMD_17H_M70H_DF_F4 0x1444
+#define PCI_DEVICE_ID_AMD_17H_MA0H_DF_F4 0x1728
 #define PCI_DEVICE_ID_AMD_19H_DF_F4    0x1654
 #define PCI_DEVICE_ID_AMD_19H_M10H_DF_F4 0x14b1
 #define PCI_DEVICE_ID_AMD_19H_M40H_ROOT        0x14b5
 #define PCI_DEVICE_ID_AMD_19H_M40H_DF_F4 0x167d
 #define PCI_DEVICE_ID_AMD_19H_M50H_DF_F4 0x166e
+#define PCI_DEVICE_ID_AMD_19H_M60H_DF_F4 0x14e4
+#define PCI_DEVICE_ID_AMD_19H_M70H_DF_F4 0x14f4
 
 /* Protect the PCI config register pairs used for SMN. */
 static DEFINE_MUTEX(smn_mutex);
@@ -41,8 +47,11 @@ static const struct pci_device_id amd_root_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_ROOT) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_ROOT) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_MA0H_ROOT) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_ROOT) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_ROOT) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_ROOT) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_ROOT) },
        {}
 };
 
@@ -61,12 +70,15 @@ static const struct pci_device_id amd_nb_misc_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M10H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
        {}
 };
 
@@ -81,6 +93,7 @@ static const struct pci_device_id amd_nb_link_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F4) },
+       { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_DF_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F4) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F4) },
index 6454bc767f0fdfa3d69497b1fc54c624098ef091..6761668100b9f302efeed2e8d0bee5dfa544e3a5 100644 (file)
@@ -1520,6 +1520,7 @@ static void __init spectre_v2_select_mitigation(void)
         * enable IBRS around firmware calls.
         */
        if (boot_cpu_has_bug(X86_BUG_RETBLEED) &&
+           boot_cpu_has(X86_FEATURE_IBPB) &&
            (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
             boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)) {
 
index fd5dead8371cc0446f11974f23af7a3ca802ad0f..663f6e6dd288650b198ebf89c95f4257e862f715 100644 (file)
@@ -682,9 +682,9 @@ static void init_intel(struct cpuinfo_x86 *c)
                unsigned int l1, l2;
 
                rdmsr(MSR_IA32_MISC_ENABLE, l1, l2);
-               if (!(l1 & (1<<11)))
+               if (!(l1 & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL))
                        set_cpu_cap(c, X86_FEATURE_BTS);
-               if (!(l1 & (1<<12)))
+               if (!(l1 & MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL))
                        set_cpu_cap(c, X86_FEATURE_PEBS);
        }
 
index 5fbd7ffb32334dc0097e5eede469cabcf3f060f4..12cf2e7ca33cc45765c3370bf1ded405d3d23f50 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "internal.h"
 
+static bool hw_injection_possible = true;
+
 /*
  * Collect all the MCi_XXX settings
  */
@@ -339,6 +341,8 @@ static int __set_inj(const char *buf)
 
        for (i = 0; i < N_INJ_TYPES; i++) {
                if (!strncmp(flags_options[i], buf, strlen(flags_options[i]))) {
+                       if (i > SW_INJ && !hw_injection_possible)
+                               continue;
                        inj_type = i;
                        return 0;
                }
@@ -717,11 +721,54 @@ static void __init debugfs_init(void)
                                    &i_mce, dfs_fls[i].fops);
 }
 
+static void check_hw_inj_possible(void)
+{
+       int cpu;
+       u8 bank;
+
+       /*
+        * This behavior exists only on SMCA systems though its not directly
+        * related to SMCA.
+        */
+       if (!cpu_feature_enabled(X86_FEATURE_SMCA))
+               return;
+
+       cpu = get_cpu();
+
+       for (bank = 0; bank < MAX_NR_BANKS; ++bank) {
+               u64 status = MCI_STATUS_VAL, ipid;
+
+               /* Check whether bank is populated */
+               rdmsrl(MSR_AMD64_SMCA_MCx_IPID(bank), ipid);
+               if (!ipid)
+                       continue;
+
+               toggle_hw_mce_inject(cpu, true);
+
+               wrmsrl_safe(mca_msr_reg(bank, MCA_STATUS), status);
+               rdmsrl_safe(mca_msr_reg(bank, MCA_STATUS), &status);
+
+               if (!status) {
+                       hw_injection_possible = false;
+                       pr_warn("Platform does not allow *hardware* error injection."
+                               "Try using APEI EINJ instead.\n");
+               }
+
+               toggle_hw_mce_inject(cpu, false);
+
+               break;
+       }
+
+       put_cpu();
+}
+
 static int __init inject_init(void)
 {
        if (!alloc_cpumask_var(&mce_inject_cpumask, GFP_KERNEL))
                return -ENOMEM;
 
+       check_hw_inj_possible();
+
        debugfs_init();
 
        register_nmi_handler(NMI_LOCAL, mce_raise_notify, 0, "mce_notify");
index 4ae0e603f7fa895c01b2081210237752e5fdb668..7e03f5b7f6bd7d32641ef5ef083f1dcd33bc7733 100644 (file)
@@ -211,7 +211,7 @@ noinstr u64 mce_rdmsrl(u32 msr);
 
 static __always_inline u32 mca_msr_reg(int bank, enum mca_msr reg)
 {
-       if (mce_flags.smca) {
+       if (cpu_feature_enabled(X86_FEATURE_SMCA)) {
                switch (reg) {
                case MCA_CTL:    return MSR_AMD64_SMCA_MCx_CTL(bank);
                case MCA_ADDR:   return MSR_AMD64_SMCA_MCx_ADDR(bank);
index c04b933f48d38257e1ca241875a10581b1c92121..02039ec3597d72474b797a5ef47c5abe6e1a9065 100644 (file)
@@ -476,8 +476,8 @@ static bool __init vmware_legacy_x2apic_available(void)
 {
        uint32_t eax, ebx, ecx, edx;
        VMWARE_CMD(GETVCPU_INFO, eax, ebx, ecx, edx);
-       return (eax & (1 << VMWARE_CMD_VCPU_RESERVED)) == 0 &&
-              (eax & (1 << VMWARE_CMD_LEGACY_X2APIC)) != 0;
+       return !(eax & BIT(VMWARE_CMD_VCPU_RESERVED)) &&
+               (eax & BIT(VMWARE_CMD_LEGACY_X2APIC));
 }
 
 #ifdef CONFIG_AMD_MEM_ENCRYPT
index f267205f2d5a419e68b66c4053b6cbdedb4273ef..9dac24680ff8ea1ffdb37aa1f957b7b8df7005c8 100644 (file)
@@ -1017,10 +1017,10 @@ void __init e820__reserve_setup_data(void)
                e820__range_update(pa_data, sizeof(*data)+data->len, E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
 
                /*
-                * SETUP_EFI is supplied by kexec and does not need to be
-                * reserved.
+                * SETUP_EFI and SETUP_IMA are supplied by kexec and do not need
+                * to be reserved.
                 */
-               if (data->type != SETUP_EFI)
+               if (data->type != SETUP_EFI && data->type != SETUP_IMA)
                        e820__range_update_kexec(pa_data,
                                                 sizeof(*data) + data->len,
                                                 E820_TYPE_RAM, E820_TYPE_RESERVED_KERN);
index 0531d6a06df5fc57bd96ddcaf27d9371fed996fb..3b28c5b25e12ce754d899cbfb90eb93aa8a42a9e 100644 (file)
@@ -851,3 +851,17 @@ int fpu__exception_code(struct fpu *fpu, int trap_nr)
         */
        return 0;
 }
+
+/*
+ * Initialize register state that may prevent from entering low-power idle.
+ * This function will be invoked from the cpuidle driver only when needed.
+ */
+void fpu_idle_fpregs(void)
+{
+       /* Note: AMX_TILE being enabled implies XGETBV1 support */
+       if (cpu_feature_enabled(X86_FEATURE_AMX_TILE) &&
+           (xfeatures_in_use() & XFEATURE_MASK_XTILE)) {
+               tile_release();
+               fpregs_deactivate(&current->thread.fpu);
+       }
+}
index 68f091ba84434bb2ef075bcedebb4ef0c4f59e6b..f5b8ef02d172c1740f4c22a622b188da379f13d9 100644 (file)
@@ -146,16 +146,3 @@ void arch_jump_label_transform_apply(void)
        text_poke_finish();
        mutex_unlock(&text_mutex);
 }
-
-static enum {
-       JL_STATE_START,
-       JL_STATE_NO_UPDATE,
-       JL_STATE_UPDATE,
-} jlstate __initdata_or_module = JL_STATE_START;
-
-__init_or_module void arch_jump_label_transform_static(struct jump_entry *entry,
-                                     enum jump_label_type type)
-{
-       if (jlstate == JL_STATE_UPDATE)
-               jump_label_transform(entry, type, 1);
-}
index 170d0fd68b1f4054df423a7acc31776aad3d55fe..b9bdb40364a62d1a89b791f8edbb576e14cb48f0 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/mm.h>
 #include <linux/efi.h>
 #include <linux/verification.h>
+#include <linux/random.h>
 
 #include <asm/bootparam.h>
 #include <asm/setup.h>
@@ -110,6 +111,26 @@ static int setup_e820_entries(struct boot_params *params)
        return 0;
 }
 
+enum { RNG_SEED_LENGTH = 32 };
+
+static void
+setup_rng_seed(struct boot_params *params, unsigned long params_load_addr,
+              unsigned int rng_seed_setup_data_offset)
+{
+       struct setup_data *sd = (void *)params + rng_seed_setup_data_offset;
+       unsigned long setup_data_phys;
+
+       if (!rng_is_initialized())
+               return;
+
+       sd->type = SETUP_RNG_SEED;
+       sd->len = RNG_SEED_LENGTH;
+       get_random_bytes(sd->data, RNG_SEED_LENGTH);
+       setup_data_phys = params_load_addr + rng_seed_setup_data_offset;
+       sd->next = params->hdr.setup_data;
+       params->hdr.setup_data = setup_data_phys;
+}
+
 #ifdef CONFIG_EFI
 static int setup_efi_info_memmap(struct boot_params *params,
                                  unsigned long params_load_addr,
@@ -186,11 +207,38 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
 }
 #endif /* CONFIG_EFI */
 
+static void
+setup_ima_state(const struct kimage *image, struct boot_params *params,
+               unsigned long params_load_addr,
+               unsigned int ima_setup_data_offset)
+{
+#ifdef CONFIG_IMA_KEXEC
+       struct setup_data *sd = (void *)params + ima_setup_data_offset;
+       unsigned long setup_data_phys;
+       struct ima_setup_data *ima;
+
+       if (!image->ima_buffer_size)
+               return;
+
+       sd->type = SETUP_IMA;
+       sd->len = sizeof(*ima);
+
+       ima = (void *)sd + sizeof(struct setup_data);
+       ima->addr = image->ima_buffer_addr;
+       ima->size = image->ima_buffer_size;
+
+       /* Add setup data */
+       setup_data_phys = params_load_addr + ima_setup_data_offset;
+       sd->next = params->hdr.setup_data;
+       params->hdr.setup_data = setup_data_phys;
+#endif /* CONFIG_IMA_KEXEC */
+}
+
 static int
 setup_boot_parameters(struct kimage *image, struct boot_params *params,
                      unsigned long params_load_addr,
                      unsigned int efi_map_offset, unsigned int efi_map_sz,
-                     unsigned int efi_setup_data_offset)
+                     unsigned int setup_data_offset)
 {
        unsigned int nr_e820_entries;
        unsigned long long mem_k, start, end;
@@ -245,8 +293,22 @@ setup_boot_parameters(struct kimage *image, struct boot_params *params,
 #ifdef CONFIG_EFI
        /* Setup EFI state */
        setup_efi_state(params, params_load_addr, efi_map_offset, efi_map_sz,
-                       efi_setup_data_offset);
+                       setup_data_offset);
+       setup_data_offset += sizeof(struct setup_data) +
+                       sizeof(struct efi_setup_data);
 #endif
+
+       if (IS_ENABLED(CONFIG_IMA_KEXEC)) {
+               /* Setup IMA log buffer state */
+               setup_ima_state(image, params, params_load_addr,
+                               setup_data_offset);
+               setup_data_offset += sizeof(struct setup_data) +
+                                    sizeof(struct ima_setup_data);
+       }
+
+       /* Setup RNG seed */
+       setup_rng_seed(params, params_load_addr, setup_data_offset);
+
        /* Setup EDD info */
        memcpy(params->eddbuf, boot_params.eddbuf,
                                EDDMAXNR * sizeof(struct edd_info));
@@ -401,7 +463,13 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
        params_cmdline_sz = ALIGN(params_cmdline_sz, 16);
        kbuf.bufsz = params_cmdline_sz + ALIGN(efi_map_sz, 16) +
                                sizeof(struct setup_data) +
-                               sizeof(struct efi_setup_data);
+                               sizeof(struct efi_setup_data) +
+                               sizeof(struct setup_data) +
+                               RNG_SEED_LENGTH;
+
+       if (IS_ENABLED(CONFIG_IMA_KEXEC))
+               kbuf.bufsz += sizeof(struct setup_data) +
+                             sizeof(struct ima_setup_data);
 
        params = kzalloc(kbuf.bufsz, GFP_KERNEL);
        if (!params)
index 67828d97338902b7fe3aca46bf297b369c00ee01..b1abf663417cdef7eff8f58fbbdfa3732a8ff6c9 100644 (file)
@@ -310,9 +310,6 @@ int module_finalize(const Elf_Ehdr *hdr,
                                            tseg, tseg + text->sh_size);
        }
 
-       /* make jump label nops */
-       jump_label_apply_nops(me);
-
        if (orc && orc_ip)
                unwind_module_init(me, (void *)orc_ip->sh_addr, orc_ip->sh_size,
                                   (void *)orc->sh_addr, orc->sh_size);
index 6b07faaa157980915e42dc71bdc392a7c5a704e0..23154d24b1173df04b1731aa99779fd9f3931f83 100644 (file)
@@ -27,6 +27,11 @@ static __init int register_e820_pmem(void)
         * simply here to trigger the module to load on demand.
         */
        pdev = platform_device_alloc("e820_pmem", -1);
-       return platform_device_add(pdev);
+
+       rc = platform_device_add(pdev);
+       if (rc)
+               platform_device_put(pdev);
+
+       return rc;
 }
 device_initcall(register_e820_pmem);
index d456ce21c255269a49b70f387d8e0580f85dea11..58a6ea472db92b4efdb7ddaf5eea68034525bbb7 100644 (file)
@@ -810,24 +810,43 @@ static void amd_e400_idle(void)
 }
 
 /*
- * Intel Core2 and older machines prefer MWAIT over HALT for C1.
- * We can't rely on cpuidle installing MWAIT, because it will not load
- * on systems that support only C1 -- so the boot default must be MWAIT.
+ * Prefer MWAIT over HALT if MWAIT is supported, MWAIT_CPUID leaf
+ * exists and whenever MONITOR/MWAIT extensions are present there is at
+ * least one C1 substate.
  *
- * Some AMD machines are the opposite, they depend on using HALT.
- *
- * So for default C1, which is used during boot until cpuidle loads,
- * use MWAIT-C1 on Intel HW that has it, else use HALT.
+ * Do not prefer MWAIT if MONITOR instruction has a bug or idle=nomwait
+ * is passed to kernel commandline parameter.
  */
 static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c)
 {
-       if (c->x86_vendor != X86_VENDOR_INTEL)
+       u32 eax, ebx, ecx, edx;
+
+       /* User has disallowed the use of MWAIT. Fallback to HALT */
+       if (boot_option_idle_override == IDLE_NOMWAIT)
                return 0;
 
-       if (!cpu_has(c, X86_FEATURE_MWAIT) || boot_cpu_has_bug(X86_BUG_MONITOR))
+       /* MWAIT is not supported on this platform. Fallback to HALT */
+       if (!cpu_has(c, X86_FEATURE_MWAIT))
                return 0;
 
-       return 1;
+       /* Monitor has a bug. Fallback to HALT */
+       if (boot_cpu_has_bug(X86_BUG_MONITOR))
+               return 0;
+
+       cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
+
+       /*
+        * If MWAIT extensions are not available, it is safe to use MWAIT
+        * with EAX=0, ECX=0.
+        */
+       if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED))
+               return 1;
+
+       /*
+        * If MWAIT extensions are available, there should be at least one
+        * MWAIT C1 substate present.
+        */
+       return (edx & MWAIT_C1_SUBSTATE_MASK);
 }
 
 /*
@@ -932,9 +951,8 @@ static int __init idle_setup(char *str)
        } else if (!strcmp(str, "nomwait")) {
                /*
                 * If the boot option of "idle=nomwait" is added,
-                * it means that mwait will be disabled for CPU C2/C3
-                * states. In such case it won't touch the variable
-                * of boot_option_idle_override.
+                * it means that mwait will be disabled for CPU C1/C2/C3
+                * states.
                 */
                boot_option_idle_override = IDLE_NOMWAIT;
        } else
index bd6c6fd373aeed4301018a11decaec7271e28e11..216fee7144eefd4f76eca0d34df9bc84c2754bbc 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/dma-map-ops.h>
 #include <linux/dmi.h>
 #include <linux/efi.h>
+#include <linux/ima.h>
 #include <linux/init_ohci1394_dma.h>
 #include <linux/initrd.h>
 #include <linux/iscsi_ibft.h>
@@ -23,6 +24,7 @@
 #include <linux/usb/xhci-dbgp.h>
 #include <linux/static_call.h>
 #include <linux/swiotlb.h>
+#include <linux/random.h>
 
 #include <uapi/linux/mount.h>
 
@@ -140,6 +142,11 @@ __visible unsigned long mmu_cr4_features __ro_after_init;
 __visible unsigned long mmu_cr4_features __ro_after_init = X86_CR4_PAE;
 #endif
 
+#ifdef CONFIG_IMA
+static phys_addr_t ima_kexec_buffer_phys;
+static size_t ima_kexec_buffer_size;
+#endif
+
 /* Boot loader ID and version as integers, for the benefit of proc_dointvec */
 int bootloader_type, bootloader_version;
 
@@ -330,6 +337,60 @@ static void __init reserve_initrd(void)
 }
 #endif /* CONFIG_BLK_DEV_INITRD */
 
+static void __init add_early_ima_buffer(u64 phys_addr)
+{
+#ifdef CONFIG_IMA
+       struct ima_setup_data *data;
+
+       data = early_memremap(phys_addr + sizeof(struct setup_data), sizeof(*data));
+       if (!data) {
+               pr_warn("setup: failed to memremap ima_setup_data entry\n");
+               return;
+       }
+
+       if (data->size) {
+               memblock_reserve(data->addr, data->size);
+               ima_kexec_buffer_phys = data->addr;
+               ima_kexec_buffer_size = data->size;
+       }
+
+       early_memunmap(data, sizeof(*data));
+#else
+       pr_warn("Passed IMA kexec data, but CONFIG_IMA not set. Ignoring.\n");
+#endif
+}
+
+#if defined(CONFIG_HAVE_IMA_KEXEC) && !defined(CONFIG_OF_FLATTREE)
+int __init ima_free_kexec_buffer(void)
+{
+       int rc;
+
+       if (!ima_kexec_buffer_size)
+               return -ENOENT;
+
+       rc = memblock_phys_free(ima_kexec_buffer_phys,
+                               ima_kexec_buffer_size);
+       if (rc)
+               return rc;
+
+       ima_kexec_buffer_phys = 0;
+       ima_kexec_buffer_size = 0;
+
+       return 0;
+}
+
+int __init ima_get_kexec_buffer(void **addr, size_t *size)
+{
+       if (!ima_kexec_buffer_size)
+               return -ENOENT;
+
+       *addr = __va(ima_kexec_buffer_phys);
+       *size = ima_kexec_buffer_size;
+
+       return 0;
+}
+#endif
+
 static void __init parse_setup_data(void)
 {
        struct setup_data *data;
@@ -355,6 +416,18 @@ static void __init parse_setup_data(void)
                case SETUP_EFI:
                        parse_efi_setup(pa_data, data_len);
                        break;
+               case SETUP_IMA:
+                       add_early_ima_buffer(pa_data);
+                       break;
+               case SETUP_RNG_SEED:
+                       data = early_memremap(pa_data, data_len);
+                       add_bootloader_randomness(data->data, data->len);
+                       /* Zero seed for forward secrecy. */
+                       memzero_explicit(data->data, data->len);
+                       /* Zero length in case we find ourselves back here by accident. */
+                       memzero_explicit(&data->len, sizeof(data->len));
+                       early_memunmap(data, data_len);
+                       break;
                default:
                        break;
                }
index b478edf43bec2a8f9eb50c2f68316f71aca3605a..3a5b0c9c4fccc2b3cb861f4774eaa80ff6f1418d 100644 (file)
@@ -219,9 +219,10 @@ static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt
        return ES_VMM_ERROR;
 }
 
-enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, bool set_ghcb_msr,
-                                  struct es_em_ctxt *ctxt, u64 exit_code,
-                                  u64 exit_info_1, u64 exit_info_2)
+static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
+                                         struct es_em_ctxt *ctxt,
+                                         u64 exit_code, u64 exit_info_1,
+                                         u64 exit_info_2)
 {
        /* Fill in protocol and format specifiers */
        ghcb->protocol_version = ghcb_version;
@@ -231,14 +232,7 @@ enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, bool set_ghcb_msr,
        ghcb_set_sw_exit_info_1(ghcb, exit_info_1);
        ghcb_set_sw_exit_info_2(ghcb, exit_info_2);
 
-       /*
-        * Hyper-V unenlightened guests use a paravisor for communicating and
-        * GHCB pages are being allocated and set up by that paravisor. Linux
-        * should not change the GHCB page's physical address.
-        */
-       if (set_ghcb_msr)
-               sev_es_wr_ghcb_msr(__pa(ghcb));
-
+       sev_es_wr_ghcb_msr(__pa(ghcb));
        VMGEXIT();
 
        return verify_exception_info(ghcb, ctxt);
@@ -795,7 +789,7 @@ static enum es_result vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
                 */
                sw_scratch = __pa(ghcb) + offsetof(struct ghcb, shared_buffer);
                ghcb_set_sw_scratch(ghcb, sw_scratch);
-               ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_IOIO,
+               ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_IOIO,
                                          exit_info_1, exit_info_2);
                if (ret != ES_OK)
                        return ret;
@@ -837,8 +831,7 @@ static enum es_result vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
 
                ghcb_set_rax(ghcb, rax);
 
-               ret = sev_es_ghcb_hv_call(ghcb, true, ctxt,
-                                         SVM_EXIT_IOIO, exit_info_1, 0);
+               ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_IOIO, exit_info_1, 0);
                if (ret != ES_OK)
                        return ret;
 
@@ -894,7 +887,7 @@ static enum es_result vc_handle_cpuid(struct ghcb *ghcb,
                /* xgetbv will cause #GP - use reset value for xcr0 */
                ghcb_set_xcr0(ghcb, 1);
 
-       ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_CPUID, 0, 0);
+       ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_CPUID, 0, 0);
        if (ret != ES_OK)
                return ret;
 
@@ -919,7 +912,7 @@ static enum es_result vc_handle_rdtsc(struct ghcb *ghcb,
        bool rdtscp = (exit_code == SVM_EXIT_RDTSCP);
        enum es_result ret;
 
-       ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, exit_code, 0, 0);
+       ret = sev_es_ghcb_hv_call(ghcb, ctxt, exit_code, 0, 0);
        if (ret != ES_OK)
                return ret;
 
index c05f0124c41096d948fa2be351f92f4c266c2cbe..63dc626627a03ed1a4d0df7b5fb19fa9021b10b0 100644 (file)
@@ -786,7 +786,7 @@ static int vmgexit_psc(struct snp_psc_desc *desc)
                ghcb_set_sw_scratch(ghcb, (u64)__pa(data));
 
                /* This will advance the shared buffer data points to. */
-               ret = sev_es_ghcb_hv_call(ghcb, true, &ctxt, SVM_VMGEXIT_PSC, 0, 0);
+               ret = sev_es_ghcb_hv_call(ghcb, &ctxt, SVM_VMGEXIT_PSC, 0, 0);
 
                /*
                 * Page State Change VMGEXIT can pass error code through
@@ -1212,8 +1212,7 @@ static enum es_result vc_handle_msr(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
                ghcb_set_rdx(ghcb, regs->dx);
        }
 
-       ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_MSR,
-                                 exit_info_1, 0);
+       ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_MSR, exit_info_1, 0);
 
        if ((ret == ES_OK) && (!exit_info_1)) {
                regs->ax = ghcb->save.rax;
@@ -1452,7 +1451,7 @@ static enum es_result vc_do_mmio(struct ghcb *ghcb, struct es_em_ctxt *ctxt,
 
        ghcb_set_sw_scratch(ghcb, ghcb_pa + offsetof(struct ghcb, shared_buffer));
 
-       return sev_es_ghcb_hv_call(ghcb, true, ctxt, exit_code, exit_info_1, exit_info_2);
+       return sev_es_ghcb_hv_call(ghcb, ctxt, exit_code, exit_info_1, exit_info_2);
 }
 
 /*
@@ -1628,7 +1627,7 @@ static enum es_result vc_handle_dr7_write(struct ghcb *ghcb,
 
        /* Using a value of 0 for ExitInfo1 means RAX holds the value */
        ghcb_set_rax(ghcb, val);
-       ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_WRITE_DR7, 0, 0);
+       ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_WRITE_DR7, 0, 0);
        if (ret != ES_OK)
                return ret;
 
@@ -1658,7 +1657,7 @@ static enum es_result vc_handle_dr7_read(struct ghcb *ghcb,
 static enum es_result vc_handle_wbinvd(struct ghcb *ghcb,
                                       struct es_em_ctxt *ctxt)
 {
-       return sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_WBINVD, 0, 0);
+       return sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_WBINVD, 0, 0);
 }
 
 static enum es_result vc_handle_rdpmc(struct ghcb *ghcb, struct es_em_ctxt *ctxt)
@@ -1667,7 +1666,7 @@ static enum es_result vc_handle_rdpmc(struct ghcb *ghcb, struct es_em_ctxt *ctxt
 
        ghcb_set_rcx(ghcb, ctxt->regs->cx);
 
-       ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_RDPMC, 0, 0);
+       ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_RDPMC, 0, 0);
        if (ret != ES_OK)
                return ret;
 
@@ -1708,7 +1707,7 @@ static enum es_result vc_handle_vmmcall(struct ghcb *ghcb,
        if (x86_platform.hyper.sev_es_hcall_prepare)
                x86_platform.hyper.sev_es_hcall_prepare(ghcb, ctxt->regs);
 
-       ret = sev_es_ghcb_hv_call(ghcb, true, ctxt, SVM_EXIT_VMMCALL, 0, 0);
+       ret = sev_es_ghcb_hv_call(ghcb, ctxt, SVM_EXIT_VMMCALL, 0, 0);
        if (ret != ES_OK)
                return ret;
 
@@ -2197,7 +2196,7 @@ int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, unsigned
                ghcb_set_rbx(ghcb, input->data_npages);
        }
 
-       ret = sev_es_ghcb_hv_call(ghcb, true, &ctxt, exit_code, input->req_gpa, input->resp_gpa);
+       ret = sev_es_ghcb_hv_call(ghcb, &ctxt, exit_code, input->req_gpa, input->resp_gpa);
        if (ret)
                goto e_put;
 
index dba2197c05c30e5c8191541b360f7189afb05282..331310c2934920eab927e45f58d5f1ca7fc5dcac 100644 (file)
@@ -94,16 +94,18 @@ static bool ex_handler_copy(const struct exception_table_entry *fixup,
 static bool ex_handler_msr(const struct exception_table_entry *fixup,
                           struct pt_regs *regs, bool wrmsr, bool safe, int reg)
 {
-       if (!safe && wrmsr &&
-           pr_warn_once("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pS)\n",
-                        (unsigned int)regs->cx, (unsigned int)regs->dx,
-                        (unsigned int)regs->ax,  regs->ip, (void *)regs->ip))
+       if (__ONCE_LITE_IF(!safe && wrmsr)) {
+               pr_warn("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pS)\n",
+                       (unsigned int)regs->cx, (unsigned int)regs->dx,
+                       (unsigned int)regs->ax,  regs->ip, (void *)regs->ip);
                show_stack_regs(regs);
+       }
 
-       if (!safe && !wrmsr &&
-           pr_warn_once("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pS)\n",
-                        (unsigned int)regs->cx, regs->ip, (void *)regs->ip))
+       if (__ONCE_LITE_IF(!safe && !wrmsr)) {
+               pr_warn("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pS)\n",
+                       (unsigned int)regs->cx, regs->ip, (void *)regs->ip);
                show_stack_regs(regs);
+       }
 
        if (!wrmsr) {
                /* Pretend that the read succeeded and returned 0. */
index 57ba5502aecf97196d9e40ac28dfbabb8b95b15b..82a042c0382480d56817dd686be79b131139607b 100644 (file)
@@ -856,7 +856,7 @@ int devmem_is_allowed(unsigned long pagenr)
 
        /*
         * This must follow RAM test, since System RAM is considered a
-        * restricted resource under CONFIG_STRICT_IOMEM.
+        * restricted resource under CONFIG_STRICT_DEVMEM.
         */
        if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) {
                /* Low 1MB bypasses iomem restrictions. */
index e44e938885b709f267d135e9530c7c88d9566cbb..7418c367e3281cfab653b677c21759f2e3afcc8a 100644 (file)
@@ -110,7 +110,7 @@ int __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey
        return vma_pkey(vma);
 }
 
-#define PKRU_AD_KEY(pkey)      (PKRU_AD_BIT << ((pkey) * PKRU_BITS_PER_PKEY))
+#define PKRU_AD_MASK(pkey)     (PKRU_AD_BIT << ((pkey) * PKRU_BITS_PER_PKEY))
 
 /*
  * Make the default PKRU value (at execve() time) as restrictive
@@ -118,11 +118,14 @@ int __arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey
  * in the process's lifetime will not accidentally get access
  * to data which is pkey-protected later on.
  */
-u32 init_pkru_value = PKRU_AD_KEY( 1) | PKRU_AD_KEY( 2) | PKRU_AD_KEY( 3) |
-                     PKRU_AD_KEY( 4) | PKRU_AD_KEY( 5) | PKRU_AD_KEY( 6) |
-                     PKRU_AD_KEY( 7) | PKRU_AD_KEY( 8) | PKRU_AD_KEY( 9) |
-                     PKRU_AD_KEY(10) | PKRU_AD_KEY(11) | PKRU_AD_KEY(12) |
-                     PKRU_AD_KEY(13) | PKRU_AD_KEY(14) | PKRU_AD_KEY(15);
+u32 init_pkru_value = PKRU_AD_MASK( 1) | PKRU_AD_MASK( 2) |
+                     PKRU_AD_MASK( 3) | PKRU_AD_MASK( 4) |
+                     PKRU_AD_MASK( 5) | PKRU_AD_MASK( 6) |
+                     PKRU_AD_MASK( 7) | PKRU_AD_MASK( 8) |
+                     PKRU_AD_MASK( 9) | PKRU_AD_MASK(10) |
+                     PKRU_AD_MASK(11) | PKRU_AD_MASK(12) |
+                     PKRU_AD_MASK(13) | PKRU_AD_MASK(14) |
+                     PKRU_AD_MASK(15);
 
 static ssize_t init_pkru_read_file(struct file *file, char __user *user_buf,
                             size_t count, loff_t *ppos)
index d400b6d9d246b93c5a274a579997a3054a5b2e22..c1e31e9a85d76d70e4c8eb0121c2df2391424890 100644 (file)
@@ -734,10 +734,10 @@ static void flush_tlb_func(void *info)
        const struct flush_tlb_info *f = info;
        struct mm_struct *loaded_mm = this_cpu_read(cpu_tlbstate.loaded_mm);
        u32 loaded_mm_asid = this_cpu_read(cpu_tlbstate.loaded_mm_asid);
-       u64 mm_tlb_gen = atomic64_read(&loaded_mm->context.tlb_gen);
        u64 local_tlb_gen = this_cpu_read(cpu_tlbstate.ctxs[loaded_mm_asid].tlb_gen);
        bool local = smp_processor_id() == f->initiating_cpu;
        unsigned long nr_invalidate = 0;
+       u64 mm_tlb_gen;
 
        /* This code cannot presently handle being reentered. */
        VM_WARN_ON(!irqs_disabled());
@@ -771,6 +771,23 @@ static void flush_tlb_func(void *info)
                return;
        }
 
+       if (unlikely(f->new_tlb_gen != TLB_GENERATION_INVALID &&
+                    f->new_tlb_gen <= local_tlb_gen)) {
+               /*
+                * The TLB is already up to date in respect to f->new_tlb_gen.
+                * While the core might be still behind mm_tlb_gen, checking
+                * mm_tlb_gen unnecessarily would have negative caching effects
+                * so avoid it.
+                */
+               return;
+       }
+
+       /*
+        * Defer mm_tlb_gen reading as long as possible to avoid cache
+        * contention.
+        */
+       mm_tlb_gen = atomic64_read(&loaded_mm->context.tlb_gen);
+
        if (unlikely(local_tlb_gen == mm_tlb_gen)) {
                /*
                 * There's nothing to do: we're already up to date.  This can
@@ -827,6 +844,12 @@ static void flush_tlb_func(void *info)
                /* Partial flush */
                unsigned long addr = f->start;
 
+               /* Partial flush cannot have invalid generations */
+               VM_WARN_ON(f->new_tlb_gen == TLB_GENERATION_INVALID);
+
+               /* Partial flush must have valid mm */
+               VM_WARN_ON(f->mm == NULL);
+
                nr_invalidate = (f->end - f->start) >> f->stride_shift;
 
                while (addr < f->end) {
@@ -1029,7 +1052,8 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
                struct flush_tlb_info *info;
 
                preempt_disable();
-               info = get_flush_tlb_info(NULL, start, end, 0, false, 0);
+               info = get_flush_tlb_info(NULL, start, end, 0, false,
+                                         TLB_GENERATION_INVALID);
 
                on_each_cpu(do_kernel_range_flush, info, 1);
 
@@ -1198,7 +1222,8 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch)
 
        int cpu = get_cpu();
 
-       info = get_flush_tlb_info(NULL, 0, TLB_FLUSH_ALL, 0, false, 0);
+       info = get_flush_tlb_info(NULL, 0, TLB_FLUSH_ALL, 0, false,
+                                 TLB_GENERATION_INVALID);
        /*
         * flush_tlb_multi() is not optimized for the common case in which only
         * a local TLB flush is needed. Optimize this use-case by calling
index ae53d54d79593387ae6411a51ef8dc62e6cd1f4e..31c634a228183e31d16d3c27ba5634e51796bc3f 100644 (file)
@@ -73,12 +73,6 @@ $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
 $(obj)/purgatory.chk: $(obj)/purgatory.ro FORCE
                $(call if_changed,ld)
 
-targets += kexec-purgatory.c
+$(obj)/kexec-purgatory.o: $(obj)/purgatory.ro $(obj)/purgatory.chk
 
-quiet_cmd_bin2c = BIN2C   $@
-      cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@
-
-$(obj)/kexec-purgatory.c: $(obj)/purgatory.ro $(obj)/purgatory.chk FORCE
-       $(call if_changed,bin2c)
-
-obj-$(CONFIG_KEXEC_FILE)       += kexec-purgatory.o
+obj-y += kexec-purgatory.o
diff --git a/arch/x86/purgatory/kexec-purgatory.S b/arch/x86/purgatory/kexec-purgatory.S
new file mode 100644 (file)
index 0000000..8530fe9
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+       .section .rodata, "a"
+
+       .align  8
+kexec_purgatory:
+       .globl  kexec_purgatory
+       .incbin "arch/x86/purgatory/purgatory.ro"
+.Lkexec_purgatory_end:
+
+       .align  8
+kexec_purgatory_size:
+       .globl  kexec_purgatory_size
+       .quad   .Lkexec_purgatory_end - kexec_purgatory
index 529fe9245821948823bc42883c6535f21ffbeb2b..42f106004400ca0b9047610052b79aad9717ca6c 100644 (file)
@@ -169,7 +169,7 @@ void migrate_irqs(void)
 
        for_each_active_irq(i) {
                struct irq_data *data = irq_get_irq_data(i);
-               struct cpumask *mask;
+               const struct cpumask *mask;
                unsigned int newcpu;
 
                if (irqd_is_per_cpu(data))
@@ -185,9 +185,10 @@ void migrate_irqs(void)
                        pr_info_ratelimited("IRQ%u no longer affine to CPU%u\n",
                                            i, cpu);
 
-                       cpumask_setall(mask);
+                       irq_set_affinity(i, cpu_all_mask);
+               } else {
+                       irq_set_affinity(i, mask);
                }
-               irq_set_affinity(i, mask);
        }
 }
 #endif /* CONFIG_HOTPLUG_CPU */
index 1e34f846508fbc9787b874e7de43879f14e5af78..9b51c565b19f7c3e2b0cf823caa0b333d4123415 100644 (file)
@@ -210,7 +210,7 @@ config ACPI_TINY_POWER_BUTTON_SIGNAL
 
 config ACPI_VIDEO
        tristate "Video"
-       depends on X86 && BACKLIGHT_CLASS_DEVICE
+       depends on BACKLIGHT_CLASS_DEVICE
        depends on INPUT
        select THERMAL
        help
@@ -255,7 +255,6 @@ config ACPI_DOCK
 
 config ACPI_CPU_FREQ_PSS
        bool
-       select THERMAL
 
 config ACPI_PROCESSOR_CSTATE
        def_bool y
@@ -287,6 +286,7 @@ config ACPI_PROCESSOR
        depends on X86 || IA64 || ARM64 || LOONGARCH
        select ACPI_PROCESSOR_IDLE
        select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
+       select THERMAL
        default y
        help
          This driver adds support for the ACPI Processor package. It is required
index b5a8d3e00a52be430772f673851327ede14d8ede..0002eecbf870a074ec4bb07bba33aeeef9c6ee89 100644 (file)
@@ -109,10 +109,9 @@ obj-$(CONFIG_ACPI_PPTT)    += pptt.o
 obj-$(CONFIG_ACPI_PFRUT)       += pfr_update.o pfr_telemetry.o
 
 # processor has its own "processor." module_param namespace
-processor-y                    := processor_driver.o
+processor-y                    := processor_driver.o processor_thermal.o
 processor-$(CONFIG_ACPI_PROCESSOR_IDLE) += processor_idle.o
-processor-$(CONFIG_ACPI_CPU_FREQ_PSS)  += processor_throttling.o       \
-       processor_thermal.o
+processor-$(CONFIG_ACPI_CPU_FREQ_PSS)  += processor_throttling.o
 processor-$(CONFIG_CPU_FREQ)   += processor_perflib.o
 
 obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o
index 48e5059d67cabdd88cb4bc655e03b6194294fa70..50540d4d4948e8806db1b6384d0a582451eb270a 100644 (file)
@@ -109,17 +109,11 @@ static void lpit_update_residency(struct lpit_residency_info *info,
                if (!info->iomem_addr)
                        return;
 
-               if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
-                       return;
-
                /* Silently fail, if cpuidle attribute group is not present */
                sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
                                        &dev_attr_low_power_idle_system_residency_us.attr,
                                        "cpuidle");
        } else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) {
-               if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
-                       return;
-
                /* Silently fail, if cpuidle attribute group is not present */
                sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj,
                                        &dev_attr_low_power_idle_cpu_residency_us.attr,
index fbe0756259c5a72bc962a06363fb201b77a1e0eb..c4d4d21391d7b11e8d072d8e6fd16cf067df94ac 100644 (file)
@@ -422,6 +422,9 @@ static int register_device_clock(struct acpi_device *adev,
        if (!lpss_clk_dev)
                lpt_register_clock_device();
 
+       if (IS_ERR(lpss_clk_dev))
+               return PTR_ERR(lpss_clk_dev);
+
        clk_data = platform_get_drvdata(lpss_clk_dev);
        if (!clk_data)
                return -ENODEV;
index eaea733b368aeb7cd6ee44a80fce5b1f64d1d841..5cbe2196176db409e1f0c84407dceb27c9a40a18 100644 (file)
@@ -1150,24 +1150,25 @@ acpi_video_get_device_type(struct acpi_video_bus *video,
        return 0;
 }
 
-static int
-acpi_video_bus_get_one_device(struct acpi_device *device,
-                             struct acpi_video_bus *video)
+static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
 {
-       unsigned long long device_id;
-       int status, device_type;
-       struct acpi_video_device *data;
+       struct acpi_video_bus *video = arg;
        struct acpi_video_device_attrib *attribute;
+       struct acpi_video_device *data;
+       unsigned long long device_id;
+       acpi_status status;
+       int device_type;
 
-       status =
-           acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
-       /* Some device omits _ADR, we skip them instead of fail */
+       status = acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
+       /* Skip devices without _ADR instead of failing. */
        if (ACPI_FAILURE(status))
-               return 0;
+               goto exit;
 
        data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
-       if (!data)
+       if (!data) {
+               dev_dbg(&device->dev, "Cannot attach\n");
                return -ENOMEM;
+       }
 
        strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
@@ -1230,7 +1231,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
        list_add_tail(&data->entry, &video->video_device_list);
        mutex_unlock(&video->device_list_lock);
 
-       return status;
+exit:
+       video->child_count++;
+       return 0;
 }
 
 /*
@@ -1542,9 +1545,6 @@ static int
 acpi_video_bus_get_devices(struct acpi_video_bus *video,
                           struct acpi_device *device)
 {
-       int status = 0;
-       struct acpi_device *dev;
-
        /*
         * There are systems where video module known to work fine regardless
         * of broken _DOD and ignoring returned value here doesn't cause
@@ -1552,16 +1552,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
         */
        acpi_video_device_enumerate(video);
 
-       list_for_each_entry(dev, &device->children, node) {
-
-               status = acpi_video_bus_get_one_device(dev, video);
-               if (status) {
-                       dev_err(&dev->dev, "Can't attach device\n");
-                       break;
-               }
-               video->child_count++;
-       }
-       return status;
+       return acpi_dev_for_each_child(device, acpi_video_bus_get_one_device, video);
 }
 
 /* acpi_video interface */
index 33b7fbbeda82ee60f9f573d3f825f637b07802d2..9f49272cad392b69e973a6555029438d373e0c3e 100644 (file)
@@ -3,7 +3,7 @@
  * apei-base.c - ACPI Platform Error Interface (APEI) supporting
  * infrastructure
  *
- * APEI allows to report errors (for example from the chipset) to the
+ * APEI allows to report errors (for example from the chipset) to
  * the operating system. This improves NMI handling especially. In
  * addition it supports error serialization and error injection.
  *
index 598fd19b65fa489d1cc4d44da8db7ee072612e1a..45973aa6e06d487815acaf48a4c3d90dcede7a90 100644 (file)
 
 #undef pr_fmt
 #define pr_fmt(fmt) "BERT: " fmt
+
+#define ACPI_BERT_PRINT_MAX_RECORDS 5
 #define ACPI_BERT_PRINT_MAX_LEN 1024
 
 static int bert_disable;
 
+/*
+ * Print "all" the error records in the BERT table, but avoid huge spam to
+ * the console if the BIOS included oversize records, or too many records.
+ * Skipping some records here does not lose anything because the full
+ * data is available to user tools in:
+ *     /sys/firmware/acpi/tables/data/BERT
+ */
 static void __init bert_print_all(struct acpi_bert_region *region,
                                  unsigned int region_len)
 {
        struct acpi_hest_generic_status *estatus =
                (struct acpi_hest_generic_status *)region;
        int remain = region_len;
+       int printed = 0, skipped = 0;
        u32 estatus_len;
 
        while (remain >= sizeof(struct acpi_bert_region)) {
@@ -46,24 +56,26 @@ static void __init bert_print_all(struct acpi_bert_region *region,
                if (remain < estatus_len) {
                        pr_err(FW_BUG "Truncated status block (length: %u).\n",
                               estatus_len);
-                       return;
+                       break;
                }
 
                /* No more error records. */
                if (!estatus->block_status)
-                       return;
+                       break;
 
                if (cper_estatus_check(estatus)) {
                        pr_err(FW_BUG "Invalid error record.\n");
-                       return;
+                       break;
                }
 
-               pr_info_once("Error records from previous boot:\n");
-               if (region_len < ACPI_BERT_PRINT_MAX_LEN)
+               if (estatus_len < ACPI_BERT_PRINT_MAX_LEN &&
+                   printed < ACPI_BERT_PRINT_MAX_RECORDS) {
+                       pr_info_once("Error records from previous boot:\n");
                        cper_estatus_print(KERN_INFO HW_ERR, estatus);
-               else
-                       pr_info_once("Max print length exceeded, table data is available at:\n"
-                                    "/sys/firmware/acpi/tables/data/BERT");
+                       printed++;
+               } else {
+                       skipped++;
+               }
 
                /*
                 * Because the boot error source is "one-time polled" type,
@@ -75,6 +87,9 @@ static void __init bert_print_all(struct acpi_bert_region *region,
                estatus = (void *)estatus + estatus_len;
                remain -= estatus_len;
        }
+
+       if (skipped)
+               pr_info(HW_ERR "Skipped %d error records\n", skipped);
 }
 
 static int __init setup_bert_disable(char *str)
index d4326ec12d29620f9f343b4ec18649a4e883eabe..6b583373c58a246819e46c8e8715fdaf3c608289 100644 (file)
@@ -546,6 +546,8 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
                                != REGION_INTERSECTS) &&
             (region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_PERSISTENT_MEMORY)
                                != REGION_INTERSECTS) &&
+            (region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_SOFT_RESERVED)
+                               != REGION_INTERSECTS) &&
             !arch_is_platform_page(base_addr)))
                return -EINVAL;
 
index e2db1bdd9dd2580d73a86e0552daae5f8f4ed4fb..c0d20d997891c34d69c6397f3f1fcfcc96ab0220 100644 (file)
@@ -464,7 +464,6 @@ out_free:
 static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
 {
        struct acpi_device *adev;
-       struct acpi_driver *driver;
        u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
        bool hotplug_event = false;
 
@@ -516,10 +515,13 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
        if (!adev)
                goto err;
 
-       driver = adev->driver;
-       if (driver && driver->ops.notify &&
-           (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
-               driver->ops.notify(adev, type);
+       if (adev->dev.driver) {
+               struct acpi_driver *driver = to_acpi_driver(adev->dev.driver);
+
+               if (driver && driver->ops.notify &&
+                   (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
+                       driver->ops.notify(adev, type);
+       }
 
        if (!hotplug_event) {
                acpi_bus_put_acpi_device(adev);
@@ -538,8 +540,9 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
 static void acpi_notify_device(acpi_handle handle, u32 event, void *data)
 {
        struct acpi_device *device = data;
+       struct acpi_driver *acpi_drv = to_acpi_driver(device->dev.driver);
 
-       device->driver->ops.notify(device, event);
+       acpi_drv->ops.notify(device, event);
 }
 
 static void acpi_notify_device_fixed(void *data)
@@ -1032,8 +1035,6 @@ static int acpi_device_probe(struct device *dev)
        if (ret)
                return ret;
 
-       acpi_dev->driver = acpi_drv;
-
        pr_debug("Driver [%s] successfully bound to device [%s]\n",
                 acpi_drv->name, acpi_dev->pnp.bus_id);
 
@@ -1043,7 +1044,6 @@ static int acpi_device_probe(struct device *dev)
                        if (acpi_drv->ops.remove)
                                acpi_drv->ops.remove(acpi_dev);
 
-                       acpi_dev->driver = NULL;
                        acpi_dev->driver_data = NULL;
                        return ret;
                }
@@ -1059,15 +1059,14 @@ static int acpi_device_probe(struct device *dev)
 static void acpi_device_remove(struct device *dev)
 {
        struct acpi_device *acpi_dev = to_acpi_device(dev);
-       struct acpi_driver *acpi_drv = acpi_dev->driver;
+       struct acpi_driver *acpi_drv = to_acpi_driver(dev->driver);
+
+       if (acpi_drv->ops.notify)
+               acpi_device_remove_notify_handler(acpi_dev);
+
+       if (acpi_drv->ops.remove)
+               acpi_drv->ops.remove(acpi_dev);
 
-       if (acpi_drv) {
-               if (acpi_drv->ops.notify)
-                       acpi_device_remove_notify_handler(acpi_dev);
-               if (acpi_drv->ops.remove)
-                       acpi_drv->ops.remove(acpi_dev);
-       }
-       acpi_dev->driver = NULL;
        acpi_dev->driver_data = NULL;
 
        put_device(dev);
@@ -1101,6 +1100,7 @@ static int acpi_dev_for_one_check(struct device *dev, void *context)
 
        return adwc->fn(to_acpi_device(dev), adwc->data);
 }
+EXPORT_SYMBOL_GPL(acpi_dev_for_each_child);
 
 int acpi_dev_for_each_child(struct acpi_device *adev,
                            int (*fn)(struct acpi_device *, void *), void *data)
@@ -1113,6 +1113,18 @@ int acpi_dev_for_each_child(struct acpi_device *adev,
        return device_for_each_child(&adev->dev, &adwc, acpi_dev_for_one_check);
 }
 
+int acpi_dev_for_each_child_reverse(struct acpi_device *adev,
+                                   int (*fn)(struct acpi_device *, void *),
+                                   void *data)
+{
+       struct acpi_dev_walk_context adwc = {
+               .fn = fn,
+               .data = data,
+       };
+
+       return device_for_each_child_reverse(&adev->dev, &adwc, acpi_dev_for_one_check);
+}
+
 /* --------------------------------------------------------------------------
                              Initialization/Cleanup
    -------------------------------------------------------------------------- */
@@ -1144,6 +1156,9 @@ static int __init acpi_bus_init_irq(void)
        case ACPI_IRQ_MODEL_PLATFORM:
                message = "platform specific model";
                break;
+       case ACPI_IRQ_MODEL_LPIC:
+               message = "LPIC";
+               break;
        default:
                pr_info("Unknown interrupt routing model\n");
                return -ENODEV;
@@ -1399,6 +1414,7 @@ static int __init acpi_init(void)
 
        pci_mmcfg_late_init();
        acpi_iort_init();
+       acpi_viot_early_init();
        acpi_hest_init();
        acpi_ghes_init();
        acpi_scan_init();
index ccaa647ac3d42fb2abb55e4bf77566d0ee6a510e..5b7e3b9ae3707a83adcfb1a2ffefe37252fec734 100644 (file)
@@ -23,17 +23,18 @@ static const struct acpi_device_id container_device_ids[] = {
 
 #ifdef CONFIG_ACPI_CONTAINER
 
-static int acpi_container_offline(struct container_dev *cdev)
+static int check_offline(struct acpi_device *adev, void *not_used)
 {
-       struct acpi_device *adev = ACPI_COMPANION(&cdev->dev);
-       struct acpi_device *child;
+       if (acpi_scan_is_offline(adev, false))
+               return 0;
 
-       /* Check all of the dependent devices' physical companions. */
-       list_for_each_entry(child, &adev->children, node)
-               if (!acpi_scan_is_offline(child, false))
-                       return -EBUSY;
+       return -EBUSY;
+}
 
-       return 0;
+static int acpi_container_offline(struct container_dev *cdev)
+{
+       /* Check all of the dependent devices' physical companions. */
+       return acpi_dev_for_each_child(ACPI_COMPANION(&cdev->dev), check_offline, NULL);
 }
 
 static void acpi_container_release(struct device *dev)
index 3c6d4ef87be0f178d0d9f0e99abaac7cb4ecd9ec..1e15a9f25ae97153c780ed9a9f8996e5db76119e 100644 (file)
@@ -618,33 +618,6 @@ static int pcc_data_alloc(int pcc_ss_id)
        return 0;
 }
 
-/* Check if CPPC revision + num_ent combination is supported */
-static bool is_cppc_supported(int revision, int num_ent)
-{
-       int expected_num_ent;
-
-       switch (revision) {
-       case CPPC_V2_REV:
-               expected_num_ent = CPPC_V2_NUM_ENT;
-               break;
-       case CPPC_V3_REV:
-               expected_num_ent = CPPC_V3_NUM_ENT;
-               break;
-       default:
-               pr_debug("Firmware exports unsupported CPPC revision: %d\n",
-                       revision);
-               return false;
-       }
-
-       if (expected_num_ent != num_ent) {
-               pr_debug("Firmware exports %d entries. Expected: %d for CPPC rev:%d\n",
-                       num_ent, expected_num_ent, revision);
-               return false;
-       }
-
-       return true;
-}
-
 /*
  * An example CPC table looks like the following.
  *
@@ -733,7 +706,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
                         cpc_obj->type, pr->id);
                goto out_free;
        }
-       cpc_ptr->num_entries = num_ent;
 
        /* Second entry should be revision. */
        cpc_obj = &out_obj->package.elements[1];
@@ -744,10 +716,32 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
                         cpc_obj->type, pr->id);
                goto out_free;
        }
-       cpc_ptr->version = cpc_rev;
 
-       if (!is_cppc_supported(cpc_rev, num_ent))
+       if (cpc_rev < CPPC_V2_REV) {
+               pr_debug("Unsupported _CPC Revision (%d) for CPU:%d\n", cpc_rev,
+                        pr->id);
+               goto out_free;
+       }
+
+       /*
+        * Disregard _CPC if the number of entries in the return pachage is not
+        * as expected, but support future revisions being proper supersets of
+        * the v3 and only causing more entries to be returned by _CPC.
+        */
+       if ((cpc_rev == CPPC_V2_REV && num_ent != CPPC_V2_NUM_ENT) ||
+           (cpc_rev == CPPC_V3_REV && num_ent != CPPC_V3_NUM_ENT) ||
+           (cpc_rev > CPPC_V3_REV && num_ent <= CPPC_V3_NUM_ENT)) {
+               pr_debug("Unexpected number of _CPC return package entries (%d) for CPU:%d\n",
+                        num_ent, pr->id);
                goto out_free;
+       }
+       if (cpc_rev > CPPC_V3_REV) {
+               num_ent = CPPC_V3_NUM_ENT;
+               cpc_rev = CPPC_V3_REV;
+       }
+
+       cpc_ptr->num_entries = num_ent;
+       cpc_ptr->version = cpc_rev;
 
        /* Iterate through remaining entries in _CPC */
        for (i = 2; i < num_ent; i++) {
index 130b5f4a50a3d9d17f563e22eb70df0086a10555..9dce1245689ca2512240b20c6e544ce09b19621c 100644 (file)
@@ -369,6 +369,28 @@ int acpi_device_fix_up_power(struct acpi_device *device)
 }
 EXPORT_SYMBOL_GPL(acpi_device_fix_up_power);
 
+static int fix_up_power_if_applicable(struct acpi_device *adev, void *not_used)
+{
+       if (adev->status.present && adev->status.enabled)
+               acpi_device_fix_up_power(adev);
+
+       return 0;
+}
+
+/**
+ * acpi_device_fix_up_power_extended - Force device and its children into D0.
+ * @adev: Parent device object whose power state is to be fixed up.
+ *
+ * Call acpi_device_fix_up_power() for @adev and its children so long as they
+ * are reported as present and enabled.
+ */
+void acpi_device_fix_up_power_extended(struct acpi_device *adev)
+{
+       acpi_device_fix_up_power(adev);
+       acpi_dev_for_each_child(adev, fix_up_power_if_applicable, NULL);
+}
+EXPORT_SYMBOL_GPL(acpi_device_fix_up_power_extended);
+
 int acpi_device_update_power(struct acpi_device *device, int *state_p)
 {
        int state;
index d5d6403ba07bce89929ced1df6d478e14b55b42f..120873dad2cc56addea2edad6135a2d055a848f9 100644 (file)
@@ -376,7 +376,7 @@ eject_store(struct device *d, struct device_attribute *attr,
                return -EINVAL;
 
        if ((!acpi_device->handler || !acpi_device->handler->hotplug.enabled)
-           && !acpi_device->driver)
+           && !d->driver)
                return -ENODEV;
 
        status = acpi_get_type(acpi_device->handle, &not_used);
index a1b871a418f8796d80810b31a0750493481ae13a..c95e535035a04adaed3d88b954655dbf23859dd2 100644 (file)
@@ -180,7 +180,6 @@ static struct workqueue_struct *ec_wq;
 static struct workqueue_struct *ec_query_wq;
 
 static int EC_FLAGS_CORRECT_ECDT; /* Needs ECDT port address correction */
-static int EC_FLAGS_IGNORE_DSDT_GPE; /* Needs ECDT GPE as correction setting */
 static int EC_FLAGS_TRUST_DSDT_GPE; /* Needs DSDT GPE as correction setting */
 static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
 
@@ -1407,24 +1406,16 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
        if (ec->data_addr == 0 || ec->command_addr == 0)
                return AE_OK;
 
-       if (boot_ec && boot_ec_is_ecdt && EC_FLAGS_IGNORE_DSDT_GPE) {
-               /*
-                * Always inherit the GPE number setting from the ECDT
-                * EC.
-                */
-               ec->gpe = boot_ec->gpe;
-       } else {
-               /* Get GPE bit assignment (EC events). */
-               /* TODO: Add support for _GPE returning a package */
-               status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp);
-               if (ACPI_SUCCESS(status))
-                       ec->gpe = tmp;
+       /* Get GPE bit assignment (EC events). */
+       /* TODO: Add support for _GPE returning a package */
+       status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp);
+       if (ACPI_SUCCESS(status))
+               ec->gpe = tmp;
+       /*
+        * Errors are non-fatal, allowing for ACPI Reduced Hardware
+        * platforms which use GpioInt instead of GPE.
+        */
 
-               /*
-                * Errors are non-fatal, allowing for ACPI Reduced Hardware
-                * platforms which use GpioInt instead of GPE.
-                */
-       }
        /* Use the global lock for all EC transactions? */
        tmp = 0;
        acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
@@ -1626,15 +1617,18 @@ static int acpi_ec_add(struct acpi_device *device)
                }
 
                if (boot_ec && ec->command_addr == boot_ec->command_addr &&
-                   ec->data_addr == boot_ec->data_addr &&
-                   !EC_FLAGS_TRUST_DSDT_GPE) {
+                   ec->data_addr == boot_ec->data_addr) {
                        /*
-                        * Trust PNP0C09 namespace location rather than
-                        * ECDT ID. But trust ECDT GPE rather than _GPE
-                        * because of ASUS quirks, so do not change
-                        * boot_ec->gpe to ec->gpe.
+                        * Trust PNP0C09 namespace location rather than ECDT ID.
+                        * But trust ECDT GPE rather than _GPE because of ASUS
+                        * quirks. So do not change boot_ec->gpe to ec->gpe,
+                        * except when the TRUST_DSDT_GPE quirk is set.
                         */
                        boot_ec->handle = ec->handle;
+
+                       if (EC_FLAGS_TRUST_DSDT_GPE)
+                               boot_ec->gpe = ec->gpe;
+
                        acpi_handle_debug(ec->handle, "duplicated.\n");
                        acpi_ec_free(ec);
                        ec = boot_ec;
@@ -1862,68 +1856,40 @@ static int ec_honor_dsdt_gpe(const struct dmi_system_id *id)
        return 0;
 }
 
-/*
- * Some DSDTs contain wrong GPE setting.
- * Asus FX502VD/VE, GL702VMK, X550VXK, X580VD
- * https://bugzilla.kernel.org/show_bug.cgi?id=195651
- */
-static int ec_honor_ecdt_gpe(const struct dmi_system_id *id)
-{
-       pr_debug("Detected system needing ignore DSDT GPE setting.\n");
-       EC_FLAGS_IGNORE_DSDT_GPE = 1;
-       return 0;
-}
-
 static const struct dmi_system_id ec_dmi_table[] __initconst = {
        {
-       ec_correct_ecdt, "MSI MS-171F", {
-       DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"),
-       DMI_MATCH(DMI_PRODUCT_NAME, "MS-171F"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUS FX502VD", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "FX502VD"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUS FX502VE", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "FX502VE"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUS GL702VMK", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "GL702VMK"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X505BA", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "X505BA"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X505BP", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "X505BP"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X542BA", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "X542BA"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUSTeK COMPUTER INC. X542BP", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "X542BP"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUS X550VXK", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "X550VXK"),}, NULL},
-       {
-       ec_honor_ecdt_gpe, "ASUS X580VD", {
-       DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
-       DMI_MATCH(DMI_PRODUCT_NAME, "X580VD"),}, NULL},
+               /*
+                * MSI MS-171F
+                * https://bugzilla.kernel.org/show_bug.cgi?id=12461
+                */
+               .callback = ec_correct_ecdt,
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "MS-171F"),
+               },
+       },
        {
-       /* https://bugzilla.kernel.org/show_bug.cgi?id=209989 */
-       ec_honor_dsdt_gpe, "HP Pavilion Gaming Laptop 15-cx0xxx", {
-       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
-       DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),}, NULL},
+               /*
+                * HP Pavilion Gaming Laptop 15-cx0xxx
+                * https://bugzilla.kernel.org/show_bug.cgi?id=209989
+                */
+               .callback = ec_honor_dsdt_gpe,
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),
+               },
+       },
        {
-       ec_clear_on_resume, "Samsung hardware", {
-       DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD.")}, NULL},
-       {},
+               /*
+                * Samsung hardware
+                * https://bugzilla.kernel.org/show_bug.cgi?id=44161
+                */
+               .callback = ec_clear_on_resume,
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
+               },
+       },
+       {}
 };
 
 void __init acpi_ec_ecdt_probe(void)
@@ -2201,28 +2167,18 @@ static int acpi_ec_init_workqueues(void)
 
 static const struct dmi_system_id acpi_ec_no_wakeup[] = {
        {
-               .ident = "Thinkpad X1 Carbon 6th",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
                        DMI_MATCH(DMI_PRODUCT_FAMILY, "Thinkpad X1 Carbon 6th"),
                },
        },
        {
-               .ident = "ThinkPad X1 Carbon 6th",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
-                       DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Carbon 6th"),
-               },
-       },
-       {
-               .ident = "ThinkPad X1 Yoga 3rd",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
                        DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Yoga 3rd"),
                },
        },
        {
-               .ident = "HP ZHAN 66 Pro",
                .matches = {
                        DMI_MATCH(DMI_SYS_VENDOR, "HP"),
                        DMI_MATCH(DMI_PRODUCT_FAMILY, "103C_5336AN HP ZHAN 66 Pro"),
index 8d769114a0487013e6635e88139ce8fb96aaa5bf..204fe94c7e458c725627422f4eb7bea9a110cf1e 100644 (file)
@@ -77,12 +77,22 @@ static struct acpi_bus_type *acpi_get_bus_type(struct device *dev)
 #define FIND_CHILD_MIN_SCORE   1
 #define FIND_CHILD_MAX_SCORE   2
 
+static int match_any(struct acpi_device *adev, void *not_used)
+{
+       return 1;
+}
+
+static bool acpi_dev_has_children(struct acpi_device *adev)
+{
+       return acpi_dev_for_each_child(adev, match_any, NULL) > 0;
+}
+
 static int find_child_checks(struct acpi_device *adev, bool check_children)
 {
        unsigned long long sta;
        acpi_status status;
 
-       if (check_children && list_empty(&adev->children))
+       if (check_children && !acpi_dev_has_children(adev))
                return -ENODEV;
 
        status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta);
@@ -105,54 +115,97 @@ static int find_child_checks(struct acpi_device *adev, bool check_children)
        return FIND_CHILD_MAX_SCORE;
 }
 
-struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
-                                          u64 address, bool check_children)
-{
-       struct acpi_device *adev, *ret = NULL;
-       int ret_score = 0;
-
-       if (!parent)
-               return NULL;
+struct find_child_walk_data {
+       struct acpi_device *adev;
+       u64 address;
+       int score;
+       bool check_sta;
+       bool check_children;
+};
 
-       list_for_each_entry(adev, &parent->children, node) {
-               acpi_bus_address addr = acpi_device_adr(adev);
-               int score;
+static int check_one_child(struct acpi_device *adev, void *data)
+{
+       struct find_child_walk_data *wd = data;
+       int score;
 
-               if (!adev->pnp.type.bus_address || addr != address)
-                       continue;
+       if (!adev->pnp.type.bus_address || acpi_device_adr(adev) != wd->address)
+               return 0;
 
-               if (!ret) {
-                       /* This is the first matching object.  Save it. */
-                       ret = adev;
-                       continue;
-               }
+       if (!wd->adev) {
                /*
-                * There is more than one matching device object with the same
-                * _ADR value.  That really is unexpected, so we are kind of
-                * beyond the scope of the spec here.  We have to choose which
-                * one to return, though.
-                *
-                * First, check if the previously found object is good enough
-                * and return it if so.  Second, do the same for the object that
-                * we've just found.
+                * This is the first matching object, so save it.  If it is not
+                * necessary to look for any other matching objects, stop the
+                * search.
                 */
-               if (!ret_score) {
-                       ret_score = find_child_checks(ret, check_children);
-                       if (ret_score == FIND_CHILD_MAX_SCORE)
-                               return ret;
-               }
-               score = find_child_checks(adev, check_children);
-               if (score == FIND_CHILD_MAX_SCORE) {
-                       return adev;
-               } else if (score > ret_score) {
-                       ret = adev;
-                       ret_score = score;
-               }
+               wd->adev = adev;
+               return !(wd->check_sta || wd->check_children);
        }
-       return ret;
+
+       /*
+        * There is more than one matching device object with the same _ADR
+        * value.  That really is unexpected, so we are kind of beyond the scope
+        * of the spec here.  We have to choose which one to return, though.
+        *
+        * First, get the score for the previously found object and terminate
+        * the walk if it is maximum.
+       */
+       if (!wd->score) {
+               score = find_child_checks(wd->adev, wd->check_children);
+               if (score == FIND_CHILD_MAX_SCORE)
+                       return 1;
+
+               wd->score = score;
+       }
+       /*
+        * Second, if the object that has just been found has a better score,
+        * replace the previously found one with it and terminate the walk if
+        * the new score is maximum.
+        */
+       score = find_child_checks(adev, wd->check_children);
+       if (score > wd->score) {
+               wd->adev = adev;
+               if (score == FIND_CHILD_MAX_SCORE)
+                       return 1;
+
+               wd->score = score;
+       }
+
+       /* Continue, because there may be better matches. */
+       return 0;
+}
+
+static struct acpi_device *acpi_find_child(struct acpi_device *parent,
+                                          u64 address, bool check_children,
+                                          bool check_sta)
+{
+       struct find_child_walk_data wd = {
+               .address = address,
+               .check_children = check_children,
+               .check_sta = check_sta,
+               .adev = NULL,
+               .score = 0,
+       };
+
+       if (parent)
+               acpi_dev_for_each_child(parent, check_one_child, &wd);
+
+       return wd.adev;
+}
+
+struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
+                                          u64 address, bool check_children)
+{
+       return acpi_find_child(parent, address, check_children, true);
 }
 EXPORT_SYMBOL_GPL(acpi_find_child_device);
 
+struct acpi_device *acpi_find_child_by_adr(struct acpi_device *adev,
+                                          acpi_bus_address adr)
+{
+       return acpi_find_child(adev, adr, false, false);
+}
+EXPORT_SYMBOL_GPL(acpi_find_child_by_adr);
+
 static void acpi_physnode_link_name(char *buf, unsigned int node_id)
 {
        if (node_id > 0)
index c68e694fca26115119749ad96a5bb268a7e10ffa..dabe45eba055d1f28721138e832ad422650bcf81 100644 (file)
@@ -12,7 +12,8 @@
 
 enum acpi_irq_model_id acpi_irq_model;
 
-static struct fwnode_handle *acpi_gsi_domain_id;
+static struct fwnode_handle *(*acpi_get_gsi_domain_id)(u32 gsi);
+static u32 (*acpi_gsi_to_irq_fallback)(u32 gsi);
 
 /**
  * acpi_gsi_to_irq() - Retrieve the linux irq number for a given GSI
@@ -26,14 +27,18 @@ static struct fwnode_handle *acpi_gsi_domain_id;
  */
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
-       struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
-                                                       DOMAIN_BUS_ANY);
+       struct irq_domain *d;
 
+       d = irq_find_matching_fwnode(acpi_get_gsi_domain_id(gsi),
+                                       DOMAIN_BUS_ANY);
        *irq = irq_find_mapping(d, gsi);
        /*
-        * *irq == 0 means no mapping, that should
-        * be reported as a failure
+        * *irq == 0 means no mapping, that should be reported as a
+        * failure, unless there is an arch-specific fallback handler.
         */
+       if (!*irq && acpi_gsi_to_irq_fallback)
+               *irq = acpi_gsi_to_irq_fallback(gsi);
+
        return (*irq > 0) ? 0 : -EINVAL;
 }
 EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
@@ -53,12 +58,12 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger,
 {
        struct irq_fwspec fwspec;
 
-       if (WARN_ON(!acpi_gsi_domain_id)) {
+       fwspec.fwnode = acpi_get_gsi_domain_id(gsi);
+       if (WARN_ON(!fwspec.fwnode)) {
                pr_warn("GSI: No registered irqchip, giving up\n");
                return -EINVAL;
        }
 
-       fwspec.fwnode = acpi_gsi_domain_id;
        fwspec.param[0] = gsi;
        fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity);
        fwspec.param_count = 2;
@@ -73,13 +78,14 @@ EXPORT_SYMBOL_GPL(acpi_register_gsi);
  */
 void acpi_unregister_gsi(u32 gsi)
 {
-       struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
-                                                       DOMAIN_BUS_ANY);
+       struct irq_domain *d;
        int irq;
 
        if (WARN_ON(acpi_irq_model == ACPI_IRQ_MODEL_GIC && gsi < 16))
                return;
 
+       d = irq_find_matching_fwnode(acpi_get_gsi_domain_id(gsi),
+                                    DOMAIN_BUS_ANY);
        irq = irq_find_mapping(d, gsi);
        irq_dispose_mapping(irq);
 }
@@ -97,7 +103,8 @@ EXPORT_SYMBOL_GPL(acpi_unregister_gsi);
  * The referenced device fwhandle or NULL on failure
  */
 static struct fwnode_handle *
-acpi_get_irq_source_fwhandle(const struct acpi_resource_source *source)
+acpi_get_irq_source_fwhandle(const struct acpi_resource_source *source,
+                            u32 gsi)
 {
        struct fwnode_handle *result;
        struct acpi_device *device;
@@ -105,7 +112,7 @@ acpi_get_irq_source_fwhandle(const struct acpi_resource_source *source)
        acpi_status status;
 
        if (!source->string_length)
-               return acpi_gsi_domain_id;
+               return acpi_get_gsi_domain_id(gsi);
 
        status = acpi_get_handle(NULL, source->string_ptr, &handle);
        if (WARN_ON(ACPI_FAILURE(status)))
@@ -194,7 +201,7 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
                        ctx->index -= irq->interrupt_count;
                        return AE_OK;
                }
-               fwnode = acpi_gsi_domain_id;
+               fwnode = acpi_get_gsi_domain_id(irq->interrupts[ctx->index]);
                acpi_irq_parse_one_match(fwnode, irq->interrupts[ctx->index],
                                         irq->triggering, irq->polarity,
                                         irq->shareable, ctx);
@@ -207,7 +214,8 @@ static acpi_status acpi_irq_parse_one_cb(struct acpi_resource *ares,
                        ctx->index -= eirq->interrupt_count;
                        return AE_OK;
                }
-               fwnode = acpi_get_irq_source_fwhandle(&eirq->resource_source);
+               fwnode = acpi_get_irq_source_fwhandle(&eirq->resource_source,
+                                                     eirq->interrupts[ctx->index]);
                acpi_irq_parse_one_match(fwnode, eirq->interrupts[ctx->index],
                                         eirq->triggering, eirq->polarity,
                                         eirq->shareable, ctx);
@@ -291,10 +299,20 @@ EXPORT_SYMBOL_GPL(acpi_irq_get);
  *          GSI interrupts
  */
 void __init acpi_set_irq_model(enum acpi_irq_model_id model,
-                              struct fwnode_handle *fwnode)
+                              struct fwnode_handle *(*fn)(u32))
 {
        acpi_irq_model = model;
-       acpi_gsi_domain_id = fwnode;
+       acpi_get_gsi_domain_id = fn;
+}
+
+/**
+ * acpi_set_gsi_to_irq_fallback - Register a GSI transfer
+ * callback to fallback to arch specified implementation.
+ * @fn: arch-specific fallback handler
+ */
+void __init acpi_set_gsi_to_irq_fallback(u32 (*fn)(u32))
+{
+       acpi_gsi_to_irq_fallback = fn;
 }
 
 /**
@@ -312,8 +330,14 @@ struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags,
                                             const struct irq_domain_ops *ops,
                                             void *host_data)
 {
-       struct irq_domain *d = irq_find_matching_fwnode(acpi_gsi_domain_id,
-                                                       DOMAIN_BUS_ANY);
+       struct irq_domain *d;
+
+       /* This only works for the GIC model... */
+       if (acpi_irq_model != ACPI_IRQ_MODEL_GIC)
+               return NULL;
+
+       d = irq_find_matching_fwnode(acpi_get_gsi_domain_id(0),
+                                    DOMAIN_BUS_ANY);
 
        if (!d)
                return NULL;
index 58647051c948a8a2fe9daec7491bc05bbf3a092d..aa1038b8aec4ac74bc0eb6239452f4f2c3268581 100644 (file)
@@ -95,7 +95,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
        case ACPI_RESOURCE_TYPE_IRQ:
                {
                        struct acpi_resource_irq *p = &resource->data.irq;
-                       if (!p || !p->interrupt_count) {
+                       if (!p->interrupt_count) {
                                acpi_handle_debug(handle,
                                                  "Blank _PRS IRQ resource\n");
                                return AE_OK;
@@ -121,7 +121,7 @@ static acpi_status acpi_pci_link_check_possible(struct acpi_resource *resource,
                {
                        struct acpi_resource_extended_irq *p =
                            &resource->data.extended_irq;
-                       if (!p || !p->interrupt_count) {
+                       if (!p->interrupt_count) {
                                acpi_handle_debug(handle,
                                                  "Blank _PRS EXT IRQ resource\n");
                                return AE_OK;
@@ -182,7 +182,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
        case ACPI_RESOURCE_TYPE_IRQ:
                {
                        struct acpi_resource_irq *p = &resource->data.irq;
-                       if (!p || !p->interrupt_count) {
+                       if (!p->interrupt_count) {
                                /*
                                 * IRQ descriptors may have no IRQ# bits set,
                                 * particularly those w/ _STA disabled
@@ -197,7 +197,7 @@ static acpi_status acpi_pci_link_check_current(struct acpi_resource *resource,
                {
                        struct acpi_resource_extended_irq *p =
                            &resource->data.extended_irq;
-                       if (!p || !p->interrupt_count) {
+                       if (!p->interrupt_count) {
                                /*
                                 * extended IRQ descriptors must
                                 * return at least 1 IRQ
index 368a9edefd0cbafcae1fdda5fbf568e3d45f254a..1278969eec1f9928ed75dbbd00aefa1620f08575 100644 (file)
@@ -139,75 +139,17 @@ static int acpi_soft_cpu_dead(unsigned int cpu)
 }
 
 #ifdef CONFIG_ACPI_CPU_FREQ_PSS
-static int acpi_pss_perf_init(struct acpi_processor *pr,
-               struct acpi_device *device)
+static void acpi_pss_perf_init(struct acpi_processor *pr)
 {
-       int result = 0;
-
        acpi_processor_ppc_has_changed(pr, 0);
 
        acpi_processor_get_throttling_info(pr);
 
        if (pr->flags.throttling)
                pr->flags.limit = 1;
-
-       pr->cdev = thermal_cooling_device_register("Processor", device,
-                                                  &processor_cooling_ops);
-       if (IS_ERR(pr->cdev)) {
-               result = PTR_ERR(pr->cdev);
-               return result;
-       }
-
-       dev_dbg(&device->dev, "registered as cooling_device%d\n",
-               pr->cdev->id);
-
-       result = sysfs_create_link(&device->dev.kobj,
-                                  &pr->cdev->device.kobj,
-                                  "thermal_cooling");
-       if (result) {
-               dev_err(&device->dev,
-                       "Failed to create sysfs link 'thermal_cooling'\n");
-               goto err_thermal_unregister;
-       }
-
-       result = sysfs_create_link(&pr->cdev->device.kobj,
-                                  &device->dev.kobj,
-                                  "device");
-       if (result) {
-               dev_err(&pr->cdev->device,
-                       "Failed to create sysfs link 'device'\n");
-               goto err_remove_sysfs_thermal;
-       }
-
-       return 0;
-
- err_remove_sysfs_thermal:
-       sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
- err_thermal_unregister:
-       thermal_cooling_device_unregister(pr->cdev);
-
-       return result;
-}
-
-static void acpi_pss_perf_exit(struct acpi_processor *pr,
-               struct acpi_device *device)
-{
-       if (pr->cdev) {
-               sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
-               sysfs_remove_link(&pr->cdev->device.kobj, "device");
-               thermal_cooling_device_unregister(pr->cdev);
-               pr->cdev = NULL;
-       }
 }
 #else
-static inline int acpi_pss_perf_init(struct acpi_processor *pr,
-               struct acpi_device *device)
-{
-       return 0;
-}
-
-static inline void acpi_pss_perf_exit(struct acpi_processor *pr,
-               struct acpi_device *device) {}
+static inline void acpi_pss_perf_init(struct acpi_processor *pr) {}
 #endif /* CONFIG_ACPI_CPU_FREQ_PSS */
 
 static int __acpi_processor_start(struct acpi_device *device)
@@ -229,7 +171,9 @@ static int __acpi_processor_start(struct acpi_device *device)
        if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
                acpi_processor_power_init(pr);
 
-       result = acpi_pss_perf_init(pr, device);
+       acpi_pss_perf_init(pr);
+
+       result = acpi_processor_thermal_init(pr, device);
        if (result)
                goto err_power_exit;
 
@@ -239,7 +183,7 @@ static int __acpi_processor_start(struct acpi_device *device)
                return 0;
 
        result = -ENODEV;
-       acpi_pss_perf_exit(pr, device);
+       acpi_processor_thermal_exit(pr, device);
 
 err_power_exit:
        acpi_processor_power_exit(pr);
@@ -277,10 +221,10 @@ static int acpi_processor_stop(struct device *dev)
                return 0;
        acpi_processor_power_exit(pr);
 
-       acpi_pss_perf_exit(pr, device);
-
        acpi_cppc_processor_exit(pr);
 
+       acpi_processor_thermal_exit(pr, device);
+
        return 0;
 }
 
index 6a5572a1a80ccfba497c95ca96d00ecf6badf4a1..13200969ccf35cbda9311380267a800baf831b87 100644 (file)
@@ -607,7 +607,7 @@ static DEFINE_RAW_SPINLOCK(c3_lock);
  * @cx: Target state context
  * @index: index of target state
  */
-static int acpi_idle_enter_bm(struct cpuidle_driver *drv,
+static int __cpuidle acpi_idle_enter_bm(struct cpuidle_driver *drv,
                               struct acpi_processor *pr,
                               struct acpi_processor_cx *cx,
                               int index)
@@ -664,7 +664,7 @@ static int acpi_idle_enter_bm(struct cpuidle_driver *drv,
        return index;
 }
 
-static int acpi_idle_enter(struct cpuidle_device *dev,
+static int __cpuidle acpi_idle_enter(struct cpuidle_device *dev,
                           struct cpuidle_driver *drv, int index)
 {
        struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
@@ -693,7 +693,7 @@ static int acpi_idle_enter(struct cpuidle_device *dev,
        return index;
 }
 
-static int acpi_idle_enter_s2idle(struct cpuidle_device *dev,
+static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,
                                  struct cpuidle_driver *drv, int index)
 {
        struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
index d8b2dfcd59b5ffa40e0d154a0dedbc3c8cf7f54f..db6ac540e924a75f51b41ba7fd35922d0dfa1f58 100644 (file)
@@ -266,3 +266,57 @@ const struct thermal_cooling_device_ops processor_cooling_ops = {
        .get_cur_state = processor_get_cur_state,
        .set_cur_state = processor_set_cur_state,
 };
+
+int acpi_processor_thermal_init(struct acpi_processor *pr,
+                               struct acpi_device *device)
+{
+       int result = 0;
+
+       pr->cdev = thermal_cooling_device_register("Processor", device,
+                                                  &processor_cooling_ops);
+       if (IS_ERR(pr->cdev)) {
+               result = PTR_ERR(pr->cdev);
+               return result;
+       }
+
+       dev_dbg(&device->dev, "registered as cooling_device%d\n",
+               pr->cdev->id);
+
+       result = sysfs_create_link(&device->dev.kobj,
+                                  &pr->cdev->device.kobj,
+                                  "thermal_cooling");
+       if (result) {
+               dev_err(&device->dev,
+                       "Failed to create sysfs link 'thermal_cooling'\n");
+               goto err_thermal_unregister;
+       }
+
+       result = sysfs_create_link(&pr->cdev->device.kobj,
+                                  &device->dev.kobj,
+                                  "device");
+       if (result) {
+               dev_err(&pr->cdev->device,
+                       "Failed to create sysfs link 'device'\n");
+               goto err_remove_sysfs_thermal;
+       }
+
+       return 0;
+
+err_remove_sysfs_thermal:
+       sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+err_thermal_unregister:
+       thermal_cooling_device_unregister(pr->cdev);
+
+       return result;
+}
+
+void acpi_processor_thermal_exit(struct acpi_processor *pr,
+                                struct acpi_device *device)
+{
+       if (pr->cdev) {
+               sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+               sysfs_remove_link(&pr->cdev->device.kobj, "device");
+               thermal_cooling_device_unregister(pr->cdev);
+               pr->cdev = NULL;
+       }
+}
index f649ae9645c990c4abc9ff5089477030188c2967..7b3ad8ed2f4e6c46ade0eb87ffa7754a0694c0eb 100644 (file)
@@ -1178,6 +1178,22 @@ static int acpi_node_prop_read(const struct fwnode_handle *fwnode,
                                   propname, proptype, val, nval);
 }
 
+static int stop_on_next(struct acpi_device *adev, void *data)
+{
+       struct acpi_device **ret_p = data;
+
+       if (!*ret_p) {
+               *ret_p = adev;
+               return 1;
+       }
+
+       /* Skip until the "previous" object is found. */
+       if (*ret_p == adev)
+               *ret_p = NULL;
+
+       return 0;
+}
+
 /**
  * acpi_get_next_subnode - Return the next child node handle for a fwnode
  * @fwnode: Firmware node to find the next child node for.
@@ -1186,35 +1202,22 @@ static int acpi_node_prop_read(const struct fwnode_handle *fwnode,
 struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
                                            struct fwnode_handle *child)
 {
-       const struct acpi_device *adev = to_acpi_device_node(fwnode);
-       const struct list_head *head;
-       struct list_head *next;
+       struct acpi_device *adev = to_acpi_device_node(fwnode);
 
        if ((!child || is_acpi_device_node(child)) && adev) {
-               struct acpi_device *child_adev;
+               struct acpi_device *child_adev = to_acpi_device_node(child);
 
-               head = &adev->children;
-               if (list_empty(head))
-                       goto nondev;
+               acpi_dev_for_each_child(adev, stop_on_next, &child_adev);
+               if (child_adev)
+                       return acpi_fwnode_handle(child_adev);
 
-               if (child) {
-                       adev = to_acpi_device_node(child);
-                       next = adev->node.next;
-                       if (next == head) {
-                               child = NULL;
-                               goto nondev;
-                       }
-                       child_adev = list_entry(next, struct acpi_device, node);
-               } else {
-                       child_adev = list_first_entry(head, struct acpi_device,
-                                                     node);
-               }
-               return acpi_fwnode_handle(child_adev);
+               child = NULL;
        }
 
- nondev:
        if (!child || is_acpi_data_node(child)) {
                const struct acpi_data_node *data = to_acpi_data_node(fwnode);
+               const struct list_head *head;
+               struct list_head *next;
                struct acpi_data_node *dn;
 
                /*
index c2d4947844250cf003c315067b42686f390d9439..510cdec375c4d88e9bced03c7a2b3d55f91dd895 100644 (file)
@@ -416,6 +416,16 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
 {
        int i;
 
+#ifdef CONFIG_X86
+       /*
+        * IRQ override isn't needed on modern AMD Zen systems and
+        * this override breaks active low IRQs on AMD Ryzen 6000 and
+        * newer systems. Skip it.
+        */
+       if (boot_cpu_has(X86_FEATURE_ZEN))
+               return false;
+#endif
+
        for (i = 0; i < ARRAY_SIZE(skip_override_table); i++) {
                const struct irq_override_cmp *entry = &skip_override_table[i];
 
index 762b61f67e6c6db32ff1edcad58bec823e0aa4ff..b100e6ca9bb427775f60376e9844a637ac2333bc 100644 (file)
@@ -334,10 +334,9 @@ static int acpi_scan_device_check(struct acpi_device *adev)
        return error;
 }
 
-static int acpi_scan_bus_check(struct acpi_device *adev)
+static int acpi_scan_bus_check(struct acpi_device *adev, void *not_used)
 {
        struct acpi_scan_handler *handler = adev->handler;
-       struct acpi_device *child;
        int error;
 
        acpi_bus_get_status(adev);
@@ -353,19 +352,14 @@ static int acpi_scan_bus_check(struct acpi_device *adev)
                dev_warn(&adev->dev, "Namespace scan failure\n");
                return error;
        }
-       list_for_each_entry(child, &adev->children, node) {
-               error = acpi_scan_bus_check(child);
-               if (error)
-                       return error;
-       }
-       return 0;
+       return acpi_dev_for_each_child(adev, acpi_scan_bus_check, NULL);
 }
 
 static int acpi_generic_hotplug_event(struct acpi_device *adev, u32 type)
 {
        switch (type) {
        case ACPI_NOTIFY_BUS_CHECK:
-               return acpi_scan_bus_check(adev);
+               return acpi_scan_bus_check(adev, NULL);
        case ACPI_NOTIFY_DEVICE_CHECK:
                return acpi_scan_device_check(adev);
        case ACPI_NOTIFY_EJECT_REQUEST:
@@ -471,8 +465,6 @@ static void acpi_device_del(struct acpi_device *device)
        struct acpi_device_bus_id *acpi_device_bus_id;
 
        mutex_lock(&acpi_device_lock);
-       if (device->parent)
-               list_del(&device->node);
 
        list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node)
                if (!strcmp(acpi_device_bus_id->bus_id,
@@ -488,6 +480,7 @@ static void acpi_device_del(struct acpi_device *device)
                }
 
        list_del(&device->wakeup_list);
+
        mutex_unlock(&acpi_device_lock);
 
        acpi_power_add_remove_device(device, false);
@@ -680,8 +673,6 @@ static int __acpi_device_add(struct acpi_device *device,
         * -------
         * Link this device to its parent and siblings.
         */
-       INIT_LIST_HEAD(&device->children);
-       INIT_LIST_HEAD(&device->node);
        INIT_LIST_HEAD(&device->wakeup_list);
        INIT_LIST_HEAD(&device->physical_node_list);
        INIT_LIST_HEAD(&device->del_list);
@@ -721,9 +712,6 @@ static int __acpi_device_add(struct acpi_device *device,
                list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
        }
 
-       if (device->parent)
-               list_add_tail(&device->node, &device->parent->children);
-
        if (device->wakeup.flags.valid)
                list_add_tail(&device->wakeup_list, &acpi_wakeup_device_list);
 
@@ -752,9 +740,6 @@ static int __acpi_device_add(struct acpi_device *device,
 err:
        mutex_lock(&acpi_device_lock);
 
-       if (device->parent)
-               list_del(&device->node);
-
        list_del(&device->wakeup_list);
 
 err_unlock:
@@ -2187,9 +2172,8 @@ static int acpi_scan_attach_handler(struct acpi_device *device)
        return ret;
 }
 
-static void acpi_bus_attach(struct acpi_device *device, bool first_pass)
+static int acpi_bus_attach(struct acpi_device *device, void *first_pass)
 {
-       struct acpi_device *child;
        bool skip = !first_pass && device->flags.visited;
        acpi_handle ejd;
        int ret;
@@ -2206,7 +2190,7 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass)
                device->flags.initialized = false;
                acpi_device_clear_enumerated(device);
                device->flags.power_manageable = 0;
-               return;
+               return 0;
        }
        if (device->handler)
                goto ok;
@@ -2224,7 +2208,7 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass)
 
        ret = acpi_scan_attach_handler(device);
        if (ret < 0)
-               return;
+               return 0;
 
        device->flags.match_driver = true;
        if (ret > 0 && !device->flags.enumeration_by_parent) {
@@ -2234,19 +2218,20 @@ static void acpi_bus_attach(struct acpi_device *device, bool first_pass)
 
        ret = device_attach(&device->dev);
        if (ret < 0)
-               return;
+               return 0;
 
        if (device->pnp.type.platform_id || device->flags.enumeration_by_parent)
                acpi_default_enumeration(device);
        else
                acpi_device_set_enumerated(device);
 
- ok:
-       list_for_each_entry(child, &device->children, node)
-               acpi_bus_attach(child, first_pass);
+ok:
+       acpi_dev_for_each_child(device, acpi_bus_attach, first_pass);
 
        if (!skip && device->handler && device->handler->hotplug.notify_online)
                device->handler->hotplug.notify_online(device);
+
+       return 0;
 }
 
 static int acpi_dev_get_first_consumer_dev_cb(struct acpi_dep_data *dep, void *data)
@@ -2274,7 +2259,7 @@ static void acpi_scan_clear_dep_fn(struct work_struct *work)
        cdw = container_of(work, struct acpi_scan_clear_dep_work, work);
 
        acpi_scan_lock_acquire();
-       acpi_bus_attach(cdw->adev, true);
+       acpi_bus_attach(cdw->adev, (void *)true);
        acpi_scan_lock_release();
 
        acpi_dev_put(cdw->adev);
@@ -2432,7 +2417,7 @@ int acpi_bus_scan(acpi_handle handle)
        if (!device)
                return -ENODEV;
 
-       acpi_bus_attach(device, true);
+       acpi_bus_attach(device, (void *)true);
 
        if (!acpi_bus_scan_second_pass)
                return 0;
@@ -2446,25 +2431,17 @@ int acpi_bus_scan(acpi_handle handle)
                                    acpi_bus_check_add_2, NULL, NULL,
                                    (void **)&device);
 
-       acpi_bus_attach(device, false);
+       acpi_bus_attach(device, NULL);
 
        return 0;
 }
 EXPORT_SYMBOL(acpi_bus_scan);
 
-/**
- * acpi_bus_trim - Detach scan handlers and drivers from ACPI device objects.
- * @adev: Root of the ACPI namespace scope to walk.
- *
- * Must be called under acpi_scan_lock.
- */
-void acpi_bus_trim(struct acpi_device *adev)
+static int acpi_bus_trim_one(struct acpi_device *adev, void *not_used)
 {
        struct acpi_scan_handler *handler = adev->handler;
-       struct acpi_device *child;
 
-       list_for_each_entry_reverse(child, &adev->children, node)
-               acpi_bus_trim(child);
+       acpi_dev_for_each_child_reverse(adev, acpi_bus_trim_one, NULL);
 
        adev->flags.match_driver = false;
        if (handler) {
@@ -2482,6 +2459,19 @@ void acpi_bus_trim(struct acpi_device *adev)
        acpi_device_set_power(adev, ACPI_STATE_D3_COLD);
        adev->flags.initialized = false;
        acpi_device_clear_enumerated(adev);
+
+       return 0;
+}
+
+/**
+ * acpi_bus_trim - Detach scan handlers and drivers from ACPI device objects.
+ * @adev: Root of the ACPI namespace scope to walk.
+ *
+ * Must be called under acpi_scan_lock.
+ */
+void acpi_bus_trim(struct acpi_device *adev)
+{
+       acpi_bus_trim_one(adev, NULL);
 }
 EXPORT_SYMBOL_GPL(acpi_bus_trim);
 
index 04ea1569df789c5a56a36d5c7fbdea742f6c7619..ad4b2987b3d6ec0bc71f4d918992576ae28edce4 100644 (file)
@@ -360,6 +360,14 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
                DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
                },
        },
+       {
+       .callback = init_nvs_save_s3,
+       .ident = "Lenovo G40-45",
+       .matches = {
+               DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+               DMI_MATCH(DMI_PRODUCT_NAME, "80E1"),
+               },
+       },
        /*
         * ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using
         * the Low Power S0 Idle firmware interface (see
@@ -816,6 +824,9 @@ static const struct platform_s2idle_ops acpi_s2idle_ops = {
 
 void __weak acpi_s2idle_setup(void)
 {
+       if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)
+               pr_info("Efficient low-power S0 idle declared\n");
+
        s2idle_set_ops(&acpi_s2idle_ops);
 }
 
index becc198e4c2242c94375ab4be8ef8aa50c07df9c..5d7f38016a24311d8669f9c04c4b41670110f568 100644 (file)
@@ -347,6 +347,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
                DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro12,1"),
                },
        },
+       {
+        .callback = video_detect_force_native,
+        /* Dell Inspiron N4010 */
+        .matches = {
+               DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+               DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron N4010"),
+               },
+       },
        {
         .callback = video_detect_force_native,
         /* Dell Vostro V131 */
@@ -430,7 +438,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
        .callback = video_detect_force_native,
        .ident = "Clevo NL5xRU",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
                DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
                },
        },
@@ -438,59 +445,75 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
        .callback = video_detect_force_native,
        .ident = "Clevo NL5xRU",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"),
-               DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
+               DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
+               DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
                },
        },
        {
        .callback = video_detect_force_native,
        .ident = "Clevo NL5xRU",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
-               DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
+               DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
+               DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
                },
        },
        {
        .callback = video_detect_force_native,
-       .ident = "Clevo NL5xRU",
+       .ident = "Clevo NL5xNU",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
-               DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
+               DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
                },
        },
+       /*
+        * The TongFang PF5PU1G, PF4NU1F, PF5NU1G, and PF5LUXG/TUXEDO BA15 Gen10,
+        * Pulse 14/15 Gen1, and Pulse 15 Gen2 have the same problem as the Clevo
+        * NL5xRU and NL5xNU/TUXEDO Aura 15 Gen1 and Gen2. See the description
+        * above.
+        */
        {
        .callback = video_detect_force_native,
-       .ident = "Clevo NL5xRU",
+       .ident = "TongFang PF5PU1G",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
-               DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
+               DMI_MATCH(DMI_BOARD_NAME, "PF5PU1G"),
                },
        },
        {
        .callback = video_detect_force_native,
-       .ident = "Clevo NL5xNU",
+       .ident = "TongFang PF4NU1F",
+       .matches = {
+               DMI_MATCH(DMI_BOARD_NAME, "PF4NU1F"),
+               },
+       },
+       {
+       .callback = video_detect_force_native,
+       .ident = "TongFang PF4NU1F",
        .matches = {
                DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
-               DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
+               DMI_MATCH(DMI_BOARD_NAME, "PULSE1401"),
                },
        },
        {
        .callback = video_detect_force_native,
-       .ident = "Clevo NL5xNU",
+       .ident = "TongFang PF5NU1G",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"),
-               DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
+               DMI_MATCH(DMI_BOARD_NAME, "PF5NU1G"),
                },
        },
        {
        .callback = video_detect_force_native,
-       .ident = "Clevo NL5xNU",
+       .ident = "TongFang PF5NU1G",
        .matches = {
-               DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
-               DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"),
+               DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"),
+               DMI_MATCH(DMI_BOARD_NAME, "PULSE1501"),
+               },
+       },
+       {
+       .callback = video_detect_force_native,
+       .ident = "TongFang PF5LUXG",
+       .matches = {
+               DMI_MATCH(DMI_BOARD_NAME, "PF5LUXG"),
                },
        },
-
        /*
         * Desktops which falsely report a backlight and which our heuristics
         * for this do not catch.
index d2256326c73aea45b35f4e83fd71686c26039780..6132092dab2a57e27c0fc40da3e4513dd26bb042 100644 (file)
@@ -88,7 +88,7 @@ static int __init viot_get_pci_iommu_fwnode(struct viot_iommu *viommu,
                return -ENODEV;
        }
 
-       fwnode = pdev->dev.fwnode;
+       fwnode = dev_fwnode(&pdev->dev);
        if (!fwnode) {
                /*
                 * PCI devices aren't necessarily described by ACPI. Create a
@@ -101,7 +101,7 @@ static int __init viot_get_pci_iommu_fwnode(struct viot_iommu *viommu,
                }
                set_primary_fwnode(&pdev->dev, fwnode);
        }
-       viommu->fwnode = pdev->dev.fwnode;
+       viommu->fwnode = dev_fwnode(&pdev->dev);
        pci_dev_put(pdev);
        return 0;
 }
@@ -248,6 +248,26 @@ err_free:
        return ret;
 }
 
+/**
+ * acpi_viot_early_init - Test the presence of VIOT and enable ACS
+ *
+ * If the VIOT does exist, ACS must be enabled. This cannot be
+ * done in acpi_viot_init() which is called after the bus scan
+ */
+void __init acpi_viot_early_init(void)
+{
+#ifdef CONFIG_PCI
+       acpi_status status;
+       struct acpi_table_header *hdr;
+
+       status = acpi_get_table(ACPI_SIG_VIOT, 0, &hdr);
+       if (ACPI_FAILURE(status))
+               return;
+       pci_request_acs();
+       acpi_put_table(hdr);
+#endif
+}
+
 /**
  * acpi_viot_init - Parse the VIOT table
  *
@@ -294,7 +314,7 @@ static int viot_dev_iommu_init(struct device *dev, struct viot_iommu *viommu,
                return -ENODEV;
 
        /* We're not translating ourself */
-       if (viommu->fwnode == dev->fwnode)
+       if (device_match_fwnode(dev, viommu->fwnode))
                return -EINVAL;
 
        ops = iommu_ops_from_fwnode(viommu->fwnode);
@@ -319,12 +339,6 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data)
                        epid = ((domain_nr - ep->segment_start) << 16) +
                                dev_id - ep->bdf_start + ep->endpoint_id;
 
-                       /*
-                        * If we found a PCI range managed by the viommu, we're
-                        * the one that has to request ACS.
-                        */
-                       pci_request_acs();
-
                        return viot_dev_iommu_init(&pdev->dev, ep->viommu,
                                                   epid);
                }
index 2963229062f85a306b209ca36a681267b2bf91cc..f9ac12b778e6a311183fd1ec7068e2bc61f608d9 100644 (file)
@@ -369,9 +369,6 @@ static int lps0_device_attach(struct acpi_device *adev,
        if (lps0_device_handle)
                return 0;
 
-       if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
-               return 0;
-
        if (acpi_s2idle_vendor_amd()) {
                /* AMD0004, AMD0005, AMDI0005:
                 * - Should use rev_id 0x0
@@ -397,7 +394,9 @@ static int lps0_device_attach(struct acpi_device *adev,
                        lps0_dsm_func_mask = (lps0_dsm_func_mask << 1) | 0x1;
                        acpi_handle_debug(adev->handle, "_DSM UUID %s: Adjusted function mask: 0x%x\n",
                                          ACPI_LPS0_DSM_UUID_AMD, lps0_dsm_func_mask);
-               } else if (lps0_dsm_func_mask_microsoft > 0 && !strcmp(hid, "AMDI0007")) {
+               } else if (lps0_dsm_func_mask_microsoft > 0 &&
+                               (!strcmp(hid, "AMDI0007") ||
+                                !strcmp(hid, "AMDI0008"))) {
                        lps0_dsm_func_mask_microsoft = -EINVAL;
                        acpi_handle_debug(adev->handle, "_DSM Using AMD method\n");
                }
@@ -419,11 +418,15 @@ static int lps0_device_attach(struct acpi_device *adev,
                lpi_device_get_constraints();
 
        /*
-        * Use suspend-to-idle by default if the default suspend mode was not
-        * set from the command line.
+        * Use suspend-to-idle by default if ACPI_FADT_LOW_POWER_S0 is set in
+        * the FADT and the default suspend mode was not set from the command
+        * line.
         */
-       if (mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3)
+       if ((acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) &&
+           mem_sleep_default > PM_SUSPEND_MEM && !acpi_sleep_default_s3) {
                mem_sleep_current = PM_SUSPEND_TO_IDLE;
+               pr_info("Low-power S0 idle used by default for system suspend\n");
+       }
 
        /*
         * Some LPS0 systems, like ASUS Zenbook UX430UNR/i7-8550U, require the
index bb45a9c00514475b994813155045880c6ac219af..1c9f4fb2595dc39ef569acb298ca869628835f25 100644 (file)
@@ -148,7 +148,7 @@ config SATA_AHCI_PLATFORM
 config AHCI_BRCM
        tristate "Broadcom AHCI SATA support"
        depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP || \
-                  ARCH_BCM_63XX || COMPILE_TEST
+                  ARCH_BCMBCA || COMPILE_TEST
        select SATA_HOST
        help
          This option enables support for the AHCI SATA3 controller found on
index d0f5bc8279783adcab51bd42df7775000e1dad67..362e043e26d86792ed44793f251ae2428c5bf426 100644 (file)
@@ -133,6 +133,12 @@ int regcache_init(struct regmap *map, const struct regmap_config *config)
                return -EINVAL;
        }
 
+       if (config->num_reg_defaults && !config->reg_defaults) {
+               dev_err(map->dev,
+                       "Register defaults number are set without the reg!\n");
+               return -EINVAL;
+       }
+
        for (i = 0; i < config->num_reg_defaults; i++)
                if (config->reg_defaults[i].reg % map->reg_stride)
                        return -EINVAL;
@@ -495,7 +501,8 @@ EXPORT_SYMBOL_GPL(regcache_drop_region);
 void regcache_cache_only(struct regmap *map, bool enable)
 {
        map->lock(map->lock_arg);
-       WARN_ON(map->cache_bypass && enable);
+       WARN_ON(map->cache_type != REGCACHE_NONE &&
+               map->cache_bypass && enable);
        map->cache_only = enable;
        trace_regmap_cache_only(map, enable);
        map->unlock(map->lock_arg);
@@ -531,7 +538,7 @@ EXPORT_SYMBOL_GPL(regcache_mark_dirty);
  * @enable: flag if changes should not be written to the cache
  *
  * When a register map is marked with the cache bypass option, writes
- * to the register map API will only update the hardware and not the
+ * to the register map API will only update the hardware and not
  * the cache directly.  This is useful when syncing the cache back to
  * the hardware.
  */
index a6db605707b0007d8b13bbcb891a2a0d4535e24d..4ef9488d05cde46a5d7165c9081f75ac44c51070 100644 (file)
@@ -30,6 +30,9 @@ struct regmap_irq_chip_data {
        int irq;
        int wake_count;
 
+       unsigned int mask_base;
+       unsigned int unmask_base;
+
        void *status_reg_buf;
        unsigned int *main_status_buf;
        unsigned int *status_buf;
@@ -39,33 +42,15 @@ struct regmap_irq_chip_data {
        unsigned int *type_buf;
        unsigned int *type_buf_def;
        unsigned int **virt_buf;
+       unsigned int **config_buf;
 
        unsigned int irq_reg_stride;
-       unsigned int type_reg_stride;
 
-       bool clear_status:1;
-};
+       unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
+                                   unsigned int base, int index);
 
-static int sub_irq_reg(struct regmap_irq_chip_data *data,
-                      unsigned int base_reg, int i)
-{
-       const struct regmap_irq_chip *chip = data->chip;
-       struct regmap *map = data->map;
-       struct regmap_irq_sub_irq_map *subreg;
-       unsigned int offset;
-       int reg = 0;
-
-       if (!chip->sub_reg_offsets || !chip->not_fixed_stride) {
-               /* Assume linear mapping */
-               reg = base_reg + (i * map->reg_stride * data->irq_reg_stride);
-       } else {
-               subreg = &chip->sub_reg_offsets[i];
-               offset = subreg->offset[0];
-               reg = base_reg + offset;
-       }
-
-       return reg;
-}
+       unsigned int clear_status:1;
+};
 
 static inline const
 struct regmap_irq *irq_to_regmap_irq(struct regmap_irq_chip_data *data,
@@ -74,21 +59,25 @@ struct regmap_irq *irq_to_regmap_irq(struct regmap_irq_chip_data *data,
        return &data->chip->irqs[irq];
 }
 
-static void regmap_irq_lock(struct irq_data *data)
+static bool regmap_irq_can_bulk_read_status(struct regmap_irq_chip_data *data)
 {
-       struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
+       struct regmap *map = data->map;
 
-       mutex_lock(&d->lock);
+       /*
+        * While possible that a user-defined ->get_irq_reg() callback might
+        * be linear enough to support bulk reads, most of the time it won't.
+        * Therefore only allow them if the default callback is being used.
+        */
+       return data->irq_reg_stride == 1 && map->reg_stride == 1 &&
+              data->get_irq_reg == regmap_irq_get_irq_reg_linear &&
+              !map->use_single_read;
 }
 
-static int regmap_irq_update_bits(struct regmap_irq_chip_data *d,
-                                 unsigned int reg, unsigned int mask,
-                                 unsigned int val)
+static void regmap_irq_lock(struct irq_data *data)
 {
-       if (d->chip->mask_writeonly)
-               return regmap_write_bits(d->map, reg, mask, val);
-       else
-               return regmap_update_bits(d->map, reg, mask, val);
+       struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
+
+       mutex_lock(&d->lock);
 }
 
 static void regmap_irq_sync_unlock(struct irq_data *data)
@@ -97,7 +86,6 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
        struct regmap *map = d->map;
        int i, j, ret;
        u32 reg;
-       u32 unmask_offset;
        u32 val;
 
        if (d->chip->runtime_pm) {
@@ -109,7 +97,7 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
 
        if (d->clear_status) {
                for (i = 0; i < d->chip->num_regs; i++) {
-                       reg = sub_irq_reg(d, d->chip->status_base, i);
+                       reg = d->get_irq_reg(d, d->chip->status_base, i);
 
                        ret = regmap_read(map, reg, &val);
                        if (ret)
@@ -126,44 +114,32 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
         * suppress pointless writes.
         */
        for (i = 0; i < d->chip->num_regs; i++) {
-               if (!d->chip->mask_base)
-                       continue;
+               if (d->mask_base) {
+                       reg = d->get_irq_reg(d, d->mask_base, i);
+                       ret = regmap_update_bits(d->map, reg,
+                                       d->mask_buf_def[i], d->mask_buf[i]);
+                       if (ret)
+                               dev_err(d->map->dev, "Failed to sync masks in %x\n",
+                                       reg);
+               }
 
-               reg = sub_irq_reg(d, d->chip->mask_base, i);
-               if (d->chip->mask_invert) {
-                       ret = regmap_irq_update_bits(d, reg,
-                                        d->mask_buf_def[i], ~d->mask_buf[i]);
-               } else if (d->chip->unmask_base) {
-                       /* set mask with mask_base register */
-                       ret = regmap_irq_update_bits(d, reg,
+               if (d->unmask_base) {
+                       reg = d->get_irq_reg(d, d->unmask_base, i);
+                       ret = regmap_update_bits(d->map, reg,
                                        d->mask_buf_def[i], ~d->mask_buf[i]);
-                       if (ret < 0)
-                               dev_err(d->map->dev,
-                                       "Failed to sync unmasks in %x\n",
+                       if (ret)
+                               dev_err(d->map->dev, "Failed to sync masks in %x\n",
                                        reg);
-                       unmask_offset = d->chip->unmask_base -
-                                                       d->chip->mask_base;
-                       /* clear mask with unmask_base register */
-                       ret = regmap_irq_update_bits(d,
-                                       reg + unmask_offset,
-                                       d->mask_buf_def[i],
-                                       d->mask_buf[i]);
-               } else {
-                       ret = regmap_irq_update_bits(d, reg,
-                                        d->mask_buf_def[i], d->mask_buf[i]);
                }
-               if (ret != 0)
-                       dev_err(d->map->dev, "Failed to sync masks in %x\n",
-                               reg);
 
-               reg = sub_irq_reg(d, d->chip->wake_base, i);
+               reg = d->get_irq_reg(d, d->chip->wake_base, i);
                if (d->wake_buf) {
                        if (d->chip->wake_invert)
-                               ret = regmap_irq_update_bits(d, reg,
+                               ret = regmap_update_bits(d->map, reg,
                                                         d->mask_buf_def[i],
                                                         ~d->wake_buf[i]);
                        else
-                               ret = regmap_irq_update_bits(d, reg,
+                               ret = regmap_update_bits(d->map, reg,
                                                         d->mask_buf_def[i],
                                                         d->wake_buf[i]);
                        if (ret != 0)
@@ -180,7 +156,7 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
                 * it'll be ignored in irq handler, then may introduce irq storm
                 */
                if (d->mask_buf[i] && (d->chip->ack_base || d->chip->use_ack)) {
-                       reg = sub_irq_reg(d, d->chip->ack_base, i);
+                       reg = d->get_irq_reg(d, d->chip->ack_base, i);
 
                        /* some chips ack by write 0 */
                        if (d->chip->ack_invert)
@@ -204,12 +180,12 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
                for (i = 0; i < d->chip->num_type_reg; i++) {
                        if (!d->type_buf_def[i])
                                continue;
-                       reg = sub_irq_reg(d, d->chip->type_base, i);
+                       reg = d->get_irq_reg(d, d->chip->type_base, i);
                        if (d->chip->type_invert)
-                               ret = regmap_irq_update_bits(d, reg,
+                               ret = regmap_update_bits(d->map, reg,
                                        d->type_buf_def[i], ~d->type_buf[i]);
                        else
-                               ret = regmap_irq_update_bits(d, reg,
+                               ret = regmap_update_bits(d->map, reg,
                                        d->type_buf_def[i], d->type_buf[i]);
                        if (ret != 0)
                                dev_err(d->map->dev, "Failed to sync type in %x\n",
@@ -220,8 +196,8 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
        if (d->chip->num_virt_regs) {
                for (i = 0; i < d->chip->num_virt_regs; i++) {
                        for (j = 0; j < d->chip->num_regs; j++) {
-                               reg = sub_irq_reg(d, d->chip->virt_reg_base[i],
-                                                 j);
+                               reg = d->get_irq_reg(d, d->chip->virt_reg_base[i],
+                                                    j);
                                ret = regmap_write(map, reg, d->virt_buf[i][j]);
                                if (ret != 0)
                                        dev_err(d->map->dev,
@@ -231,6 +207,17 @@ static void regmap_irq_sync_unlock(struct irq_data *data)
                }
        }
 
+       for (i = 0; i < d->chip->num_config_bases; i++) {
+               for (j = 0; j < d->chip->num_config_regs; j++) {
+                       reg = d->get_irq_reg(d, d->chip->config_base[i], j);
+                       ret = regmap_write(map, reg, d->config_buf[i][j]);
+                       if (ret)
+                               dev_err(d->map->dev,
+                                       "Failed to write config %x: %d\n",
+                                       reg, ret);
+               }
+       }
+
        if (d->chip->runtime_pm)
                pm_runtime_put(map->dev);
 
@@ -253,22 +240,19 @@ static void regmap_irq_enable(struct irq_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;
+       unsigned int mask;
 
        /*
         * The type_in_mask flag means that the underlying hardware uses
-        * separate mask bits for rising and falling edge interrupts, but
-        * we want to make them into a single virtual interrupt with
-        * configurable edge.
+        * separate mask bits for each interrupt trigger type, but we want
+        * to have a single logical interrupt with a configurable type.
         *
-        * If the interrupt we're enabling defines the falling or rising
-        * masks then instead of using the regular mask bits for this
-        * interrupt, use the value previously written to the type buffer
-        * at the corresponding offset in regmap_irq_set_type().
+        * If the interrupt we're enabling defines any supported types
+        * then instead of using the regular mask bits for this interrupt,
+        * use the value previously written to the type buffer at the
+        * corresponding offset in regmap_irq_set_type().
         */
-       if (d->chip->type_in_mask && type)
+       if (d->chip->type_in_mask && irq_data->type.types_supported)
                mask = d->type_buf[reg] & irq_data->mask;
        else
                mask = irq_data->mask;
@@ -293,7 +277,7 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
        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);
-       int reg;
+       int reg, ret;
        const struct regmap_irq_type *t = &irq_data->type;
 
        if ((t->types_supported & type) != type)
@@ -333,9 +317,19 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
                return -EINVAL;
        }
 
-       if (d->chip->set_type_virt)
-               return d->chip->set_type_virt(d->virt_buf, type, data->hwirq,
-                                             reg);
+       if (d->chip->set_type_virt) {
+               ret = d->chip->set_type_virt(d->virt_buf, type, data->hwirq,
+                                            reg);
+               if (ret)
+                       return ret;
+       }
+
+       if (d->chip->set_type_config) {
+               ret = d->chip->set_type_config(d->config_buf, type,
+                                              irq_data, reg);
+               if (ret)
+                       return ret;
+       }
 
        return 0;
 }
@@ -376,14 +370,17 @@ static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,
        const struct regmap_irq_chip *chip = data->chip;
        struct regmap *map = data->map;
        struct regmap_irq_sub_irq_map *subreg;
+       unsigned int reg;
        int i, ret = 0;
 
        if (!chip->sub_reg_offsets) {
-               /* Assume linear mapping */
-               ret = regmap_read(map, chip->status_base +
-                                 (b * map->reg_stride * data->irq_reg_stride),
-                                  &data->status_buf[b]);
+               reg = data->get_irq_reg(data, chip->status_base, b);
+               ret = regmap_read(map, reg, &data->status_buf[b]);
        } else {
+               /*
+                * Note we can't use ->get_irq_reg() here because the offsets
+                * in 'subreg' are *not* interchangeable with indices.
+                */
                subreg = &chip->sub_reg_offsets[b];
                for (i = 0; i < subreg->num_regs; i++) {
                        unsigned int offset = subreg->offset[i];
@@ -449,10 +446,18 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
                 * sake of simplicity. and add bulk reads only if needed
                 */
                for (i = 0; i < chip->num_main_regs; i++) {
-                       ret = regmap_read(map, chip->main_status +
-                                 (i * map->reg_stride
-                                  * data->irq_reg_stride),
-                                 &data->main_status_buf[i]);
+                       /*
+                        * For not_fixed_stride, don't use ->get_irq_reg().
+                        * It would produce an incorrect result.
+                        */
+                       if (data->chip->not_fixed_stride)
+                               reg = chip->main_status +
+                                       i * map->reg_stride * data->irq_reg_stride;
+                       else
+                               reg = data->get_irq_reg(data,
+                                                       chip->main_status, i);
+
+                       ret = regmap_read(map, reg, &data->main_status_buf[i]);
                        if (ret) {
                                dev_err(map->dev,
                                        "Failed to read IRQ status %d\n",
@@ -481,8 +486,7 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
                        }
 
                }
-       } else if (!map->use_single_read && map->reg_stride == 1 &&
-                  data->irq_reg_stride == 1) {
+       } else if (regmap_irq_can_bulk_read_status(data)) {
 
                u8 *buf8 = data->status_reg_buf;
                u16 *buf16 = data->status_reg_buf;
@@ -518,7 +522,7 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
 
        } else {
                for (i = 0; i < data->chip->num_regs; i++) {
-                       unsigned int reg = sub_irq_reg(data,
+                       unsigned int reg = data->get_irq_reg(data,
                                        data->chip->status_base, i);
                        ret = regmap_read(map, reg, &data->status_buf[i]);
 
@@ -546,7 +550,7 @@ static irqreturn_t regmap_irq_thread(int irq, void *d)
                data->status_buf[i] &= ~data->mask_buf[i];
 
                if (data->status_buf[i] && (chip->ack_base || chip->use_ack)) {
-                       reg = sub_irq_reg(data, data->chip->ack_base, i);
+                       reg = data->get_irq_reg(data, data->chip->ack_base, i);
 
                        if (chip->ack_invert)
                                ret = regmap_write(map, reg,
@@ -606,6 +610,91 @@ static const struct irq_domain_ops regmap_domain_ops = {
        .xlate  = irq_domain_xlate_onetwocell,
 };
 
+/**
+ * regmap_irq_get_irq_reg_linear() - Linear IRQ register mapping callback.
+ * @data: Data for the &struct regmap_irq_chip
+ * @base: Base register
+ * @index: Register index
+ *
+ * Returns the register address corresponding to the given @base and @index
+ * by the formula ``base + index * regmap_stride * irq_reg_stride``.
+ */
+unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
+                                          unsigned int base, int index)
+{
+       const struct regmap_irq_chip *chip = data->chip;
+       struct regmap *map = data->map;
+
+       /*
+        * FIXME: This is for backward compatibility and should be removed
+        * when not_fixed_stride is dropped (it's only used by qcom-pm8008).
+        */
+       if (chip->not_fixed_stride && chip->sub_reg_offsets) {
+               struct regmap_irq_sub_irq_map *subreg;
+
+               subreg = &chip->sub_reg_offsets[0];
+               return base + subreg->offset[0];
+       }
+
+       return base + index * map->reg_stride * data->irq_reg_stride;
+}
+EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
+
+/**
+ * regmap_irq_set_type_config_simple() - Simple IRQ type configuration callback.
+ * @buf: Buffer containing configuration register values, this is a 2D array of
+ *       `num_config_bases` rows, each of `num_config_regs` elements.
+ * @type: The requested IRQ type.
+ * @irq_data: The IRQ being configured.
+ * @idx: Index of the irq's config registers within each array `buf[i]`
+ *
+ * This is a &struct regmap_irq_chip->set_type_config callback suitable for
+ * chips with one config register. Register values are updated according to
+ * the &struct regmap_irq_type data associated with an IRQ.
+ */
+int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
+                                     const struct regmap_irq *irq_data, int idx)
+{
+       const struct regmap_irq_type *t = &irq_data->type;
+
+       if (t->type_reg_mask)
+               buf[0][idx] &= ~t->type_reg_mask;
+       else
+               buf[0][idx] &= ~(t->type_falling_val |
+                                t->type_rising_val |
+                                t->type_level_low_val |
+                                t->type_level_high_val);
+
+       switch (type) {
+       case IRQ_TYPE_EDGE_FALLING:
+               buf[0][idx] |= t->type_falling_val;
+               break;
+
+       case IRQ_TYPE_EDGE_RISING:
+               buf[0][idx] |= t->type_rising_val;
+               break;
+
+       case IRQ_TYPE_EDGE_BOTH:
+               buf[0][idx] |= (t->type_falling_val |
+                               t->type_rising_val);
+               break;
+
+       case IRQ_TYPE_LEVEL_HIGH:
+               buf[0][idx] |= t->type_level_high_val;
+               break;
+
+       case IRQ_TYPE_LEVEL_LOW:
+               buf[0][idx] |= t->type_level_low_val;
+               break;
+
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(regmap_irq_set_type_config_simple);
+
 /**
  * regmap_add_irq_chip_fwnode() - Use standard regmap IRQ controller handling
  *
@@ -634,7 +723,6 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
        int ret = -ENOMEM;
        int num_type_reg;
        u32 reg;
-       u32 unmask_offset;
 
        if (chip->num_regs <= 0)
                return -EINVAL;
@@ -651,11 +739,19 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
        }
 
        if (chip->not_fixed_stride) {
+               dev_warn(map->dev, "not_fixed_stride is deprecated; use ->get_irq_reg() instead");
+
                for (i = 0; i < chip->num_regs; i++)
                        if (chip->sub_reg_offsets[i].num_regs != 1)
                                return -EINVAL;
        }
 
+       if (chip->num_type_reg)
+               dev_warn(map->dev, "type registers are deprecated; use config registers instead");
+
+       if (chip->num_virt_regs || chip->virt_reg_base || chip->set_type_virt)
+               dev_warn(map->dev, "virtual registers are deprecated; use config registers instead");
+
        if (irq_base) {
                irq_base = irq_alloc_descs(irq_base, 0, chip->num_irqs, 0);
                if (irq_base < 0) {
@@ -671,30 +767,30 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
 
        if (chip->num_main_regs) {
                d->main_status_buf = kcalloc(chip->num_main_regs,
-                                            sizeof(unsigned int),
+                                            sizeof(*d->main_status_buf),
                                             GFP_KERNEL);
 
                if (!d->main_status_buf)
                        goto err_alloc;
        }
 
-       d->status_buf = kcalloc(chip->num_regs, sizeof(unsigned int),
+       d->status_buf = kcalloc(chip->num_regs, sizeof(*d->status_buf),
                                GFP_KERNEL);
        if (!d->status_buf)
                goto err_alloc;
 
-       d->mask_buf = kcalloc(chip->num_regs, sizeof(unsigned int),
+       d->mask_buf = kcalloc(chip->num_regs, sizeof(*d->mask_buf),
                              GFP_KERNEL);
        if (!d->mask_buf)
                goto err_alloc;
 
-       d->mask_buf_def = kcalloc(chip->num_regs, sizeof(unsigned int),
+       d->mask_buf_def = kcalloc(chip->num_regs, sizeof(*d->mask_buf_def),
                                  GFP_KERNEL);
        if (!d->mask_buf_def)
                goto err_alloc;
 
        if (chip->wake_base) {
-               d->wake_buf = kcalloc(chip->num_regs, sizeof(unsigned int),
+               d->wake_buf = kcalloc(chip->num_regs, sizeof(*d->wake_buf),
                                      GFP_KERNEL);
                if (!d->wake_buf)
                        goto err_alloc;
@@ -703,11 +799,11 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
        num_type_reg = chip->type_in_mask ? chip->num_regs : chip->num_type_reg;
        if (num_type_reg) {
                d->type_buf_def = kcalloc(num_type_reg,
-                                         sizeof(unsigned int), GFP_KERNEL);
+                                         sizeof(*d->type_buf_def), GFP_KERNEL);
                if (!d->type_buf_def)
                        goto err_alloc;
 
-               d->type_buf = kcalloc(num_type_reg, sizeof(unsigned int),
+               d->type_buf = kcalloc(num_type_reg, sizeof(*d->type_buf),
                                      GFP_KERNEL);
                if (!d->type_buf)
                        goto err_alloc;
@@ -724,13 +820,31 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
 
                for (i = 0; i < chip->num_virt_regs; i++) {
                        d->virt_buf[i] = kcalloc(chip->num_regs,
-                                                sizeof(unsigned int),
+                                                sizeof(**d->virt_buf),
                                                 GFP_KERNEL);
                        if (!d->virt_buf[i])
                                goto err_alloc;
                }
        }
 
+       if (chip->num_config_bases && chip->num_config_regs) {
+               /*
+                * Create config_buf[num_config_bases][num_config_regs]
+                */
+               d->config_buf = kcalloc(chip->num_config_bases,
+                                       sizeof(*d->config_buf), GFP_KERNEL);
+               if (!d->config_buf)
+                       goto err_alloc;
+
+               for (i = 0; i < chip->num_config_regs; i++) {
+                       d->config_buf[i] = kcalloc(chip->num_config_regs,
+                                                  sizeof(**d->config_buf),
+                                                  GFP_KERNEL);
+                       if (!d->config_buf[i])
+                               goto err_alloc;
+               }
+       }
+
        d->irq_chip = regmap_irq_chip;
        d->irq_chip.name = chip->name;
        d->irq = irq;
@@ -738,18 +852,53 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
        d->chip = chip;
        d->irq_base = irq_base;
 
+       if (chip->mask_base && chip->unmask_base &&
+           !chip->mask_unmask_non_inverted) {
+               /*
+                * Chips that specify both mask_base and unmask_base used to
+                * get inverted mask behavior by default, with no way to ask
+                * for the normal, non-inverted behavior. This "inverted by
+                * default" behavior is deprecated, but we have to support it
+                * until existing drivers have been fixed.
+                *
+                * Existing drivers should be updated by swapping mask_base
+                * and unmask_base and setting mask_unmask_non_inverted=true.
+                * New drivers should always set the flag.
+                */
+               dev_warn(map->dev, "mask_base and unmask_base are inverted, please fix it");
+
+               /* Might as well warn about mask_invert while we're at it... */
+               if (chip->mask_invert)
+                       dev_warn(map->dev, "mask_invert=true ignored");
+
+               d->mask_base = chip->unmask_base;
+               d->unmask_base = chip->mask_base;
+       } else if (chip->mask_invert) {
+               /*
+                * Swap the roles of mask_base and unmask_base if the bits are
+                * inverted. This is deprecated, drivers should use unmask_base
+                * directly.
+                */
+               dev_warn(map->dev, "mask_invert=true is deprecated; please switch to unmask_base");
+
+               d->mask_base = chip->unmask_base;
+               d->unmask_base = chip->mask_base;
+       } else {
+               d->mask_base = chip->mask_base;
+               d->unmask_base = chip->unmask_base;
+       }
+
        if (chip->irq_reg_stride)
                d->irq_reg_stride = chip->irq_reg_stride;
        else
                d->irq_reg_stride = 1;
 
-       if (chip->type_reg_stride)
-               d->type_reg_stride = chip->type_reg_stride;
+       if (chip->get_irq_reg)
+               d->get_irq_reg = chip->get_irq_reg;
        else
-               d->type_reg_stride = 1;
+               d->get_irq_reg = regmap_irq_get_irq_reg_linear;
 
-       if (!map->use_single_read && map->reg_stride == 1 &&
-           d->irq_reg_stride == 1) {
+       if (regmap_irq_can_bulk_read_status(d)) {
                d->status_reg_buf = kmalloc_array(chip->num_regs,
                                                  map->format.val_bytes,
                                                  GFP_KERNEL);
@@ -766,35 +915,34 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
        /* Mask all the interrupts by default */
        for (i = 0; i < chip->num_regs; i++) {
                d->mask_buf[i] = d->mask_buf_def[i];
-               if (!chip->mask_base)
-                       continue;
 
-               reg = sub_irq_reg(d, d->chip->mask_base, i);
+               if (d->mask_base) {
+                       reg = d->get_irq_reg(d, d->mask_base, i);
+                       ret = regmap_update_bits(d->map, reg,
+                                       d->mask_buf_def[i], d->mask_buf[i]);
+                       if (ret) {
+                               dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
+                                       reg, ret);
+                               goto err_alloc;
+                       }
+               }
 
-               if (chip->mask_invert)
-                       ret = regmap_irq_update_bits(d, reg,
-                                        d->mask_buf[i], ~d->mask_buf[i]);
-               else if (d->chip->unmask_base) {
-                       unmask_offset = d->chip->unmask_base -
-                                       d->chip->mask_base;
-                       ret = regmap_irq_update_bits(d,
-                                       reg + unmask_offset,
-                                       d->mask_buf[i],
-                                       d->mask_buf[i]);
-               } else
-                       ret = regmap_irq_update_bits(d, reg,
-                                        d->mask_buf[i], d->mask_buf[i]);
-               if (ret != 0) {
-                       dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
-                               reg, ret);
-                       goto err_alloc;
+               if (d->unmask_base) {
+                       reg = d->get_irq_reg(d, d->unmask_base, i);
+                       ret = regmap_update_bits(d->map, reg,
+                                       d->mask_buf_def[i], ~d->mask_buf[i]);
+                       if (ret) {
+                               dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
+                                       reg, ret);
+                               goto err_alloc;
+                       }
                }
 
                if (!chip->init_ack_masked)
                        continue;
 
                /* Ack masked but set interrupts */
-               reg = sub_irq_reg(d, d->chip->status_base, i);
+               reg = d->get_irq_reg(d, d->chip->status_base, i);
                ret = regmap_read(map, reg, &d->status_buf[i]);
                if (ret != 0) {
                        dev_err(map->dev, "Failed to read IRQ status: %d\n",
@@ -806,7 +954,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
                        d->status_buf[i] = ~d->status_buf[i];
 
                if (d->status_buf[i] && (chip->ack_base || chip->use_ack)) {
-                       reg = sub_irq_reg(d, d->chip->ack_base, i);
+                       reg = d->get_irq_reg(d, d->chip->ack_base, i);
                        if (chip->ack_invert)
                                ret = regmap_write(map, reg,
                                        ~(d->status_buf[i] & d->mask_buf[i]));
@@ -831,14 +979,14 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
        if (d->wake_buf) {
                for (i = 0; i < chip->num_regs; i++) {
                        d->wake_buf[i] = d->mask_buf_def[i];
-                       reg = sub_irq_reg(d, d->chip->wake_base, i);
+                       reg = d->get_irq_reg(d, d->chip->wake_base, i);
 
                        if (chip->wake_invert)
-                               ret = regmap_irq_update_bits(d, reg,
+                               ret = regmap_update_bits(d->map, reg,
                                                         d->mask_buf_def[i],
                                                         0);
                        else
-                               ret = regmap_irq_update_bits(d, reg,
+                               ret = regmap_update_bits(d->map, reg,
                                                         d->mask_buf_def[i],
                                                         d->wake_buf[i]);
                        if (ret != 0) {
@@ -851,7 +999,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
 
        if (chip->num_type_reg && !chip->type_in_mask) {
                for (i = 0; i < chip->num_type_reg; ++i) {
-                       reg = sub_irq_reg(d, d->chip->type_base, i);
+                       reg = d->get_irq_reg(d, d->chip->type_base, i);
 
                        ret = regmap_read(map, reg, &d->type_buf_def[i]);
 
@@ -907,6 +1055,11 @@ err_alloc:
                        kfree(d->virt_buf[i]);
                kfree(d->virt_buf);
        }
+       if (d->config_buf) {
+               for (i = 0; i < chip->num_config_bases; i++)
+                       kfree(d->config_buf[i]);
+               kfree(d->config_buf);
+       }
        kfree(d);
        return ret;
 }
@@ -947,7 +1100,7 @@ EXPORT_SYMBOL_GPL(regmap_add_irq_chip);
 void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)
 {
        unsigned int virq;
-       int hwirq;
+       int i, hwirq;
 
        if (!d)
                return;
@@ -977,6 +1130,11 @@ void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)
        kfree(d->mask_buf);
        kfree(d->status_reg_buf);
        kfree(d->status_buf);
+       if (d->config_buf) {
+               for (i = 0; i < d->chip->num_config_bases; i++)
+                       kfree(d->config_buf[i]);
+               kfree(d->config_buf);
+       }
        kfree(d);
 }
 EXPORT_SYMBOL_GPL(regmap_del_irq_chip);
index c3517ccc315918bbe9c4de099410000bb38688f3..fee221c5008c9f6dfe50982906476b920d90223f 100644 (file)
@@ -882,6 +882,8 @@ struct regmap *__regmap_init(struct device *dev,
 
        if (config && config->read && config->write) {
                map->reg_read  = _regmap_bus_read;
+               if (config->reg_update_bits)
+                       map->reg_update_bits = config->reg_update_bits;
 
                /* Bulk read/write */
                map->read = config->read;
@@ -1298,6 +1300,9 @@ static void regmap_field_init(struct regmap_field *rm_field,
        rm_field->reg = reg_field.reg;
        rm_field->shift = reg_field.lsb;
        rm_field->mask = GENMASK(reg_field.msb, reg_field.lsb);
+
+       WARN_ONCE(rm_field->mask == 0, "invalid empty mask defined\n");
+
        rm_field->id_size = reg_field.id_size;
        rm_field->id_offset = reg_field.id_offset;
 }
@@ -2218,6 +2223,28 @@ int regmap_field_update_bits_base(struct regmap_field *field,
 }
 EXPORT_SYMBOL_GPL(regmap_field_update_bits_base);
 
+/**
+ * regmap_field_test_bits() - Check if all specified bits are set in a
+ *                            register field.
+ *
+ * @field: Register field to operate on
+ * @bits: Bits to test
+ *
+ * Returns -1 if the underlying regmap_field_read() fails, 0 if at least one of the
+ * tested bits is not set and 1 if all tested bits are set.
+ */
+int regmap_field_test_bits(struct regmap_field *field, unsigned int bits)
+{
+       unsigned int val, ret;
+
+       ret = regmap_field_read(field, &val);
+       if (ret)
+               return ret;
+
+       return (val & bits) == bits;
+}
+EXPORT_SYMBOL_GPL(regmap_field_test_bits);
+
 /**
  * regmap_fields_update_bits_base() - Perform a read/modify/write cycle a
  *                                    register field with port ID
index 378f5d62a991271cef7a1ac21db7e689b165c496..2e564803e7869ec83c5f468840e9e39f8e00998e 100644 (file)
@@ -379,7 +379,7 @@ static void hisi_lpc_acpi_fixup_child_resource(struct device *hostdev,
 
 /*
  * hisi_lpc_acpi_set_io_res - set the resources for a child
- * @child: the device node to be updated the I/O resource
+ * @adev: ACPI companion of the device node to be updated the I/O resource
  * @hostdev: the device node associated with host controller
  * @res: double pointer to be set to the address of translated resources
  * @num_res: pointer to variable to hold the number of translated resources
@@ -390,31 +390,24 @@ static void hisi_lpc_acpi_fixup_child_resource(struct device *hostdev,
  * host-relative address resource.  This function will return the translated
  * logical PIO addresses for each child devices resources.
  */
-static int hisi_lpc_acpi_set_io_res(struct device *child,
+static int hisi_lpc_acpi_set_io_res(struct acpi_device *adev,
                                    struct device *hostdev,
                                    const struct resource **res, int *num_res)
 {
-       struct acpi_device *adev;
-       struct acpi_device *host;
+       struct acpi_device *host = to_acpi_device(adev->dev.parent);
        struct resource_entry *rentry;
        LIST_HEAD(resource_list);
        struct resource *resources;
        int count;
        int i;
 
-       if (!child || !hostdev)
-               return -EINVAL;
-
-       host = to_acpi_device(hostdev);
-       adev = to_acpi_device(child);
-
        if (!adev->status.present) {
-               dev_dbg(child, "device is not present\n");
+               dev_dbg(&adev->dev, "device is not present\n");
                return -EIO;
        }
 
        if (acpi_device_enumerated(adev)) {
-               dev_dbg(child, "has been enumerated\n");
+               dev_dbg(&adev->dev, "has been enumerated\n");
                return -EIO;
        }
 
@@ -425,7 +418,7 @@ static int hisi_lpc_acpi_set_io_res(struct device *child,
         */
        count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
        if (count <= 0) {
-               dev_dbg(child, "failed to get resources\n");
+               dev_dbg(&adev->dev, "failed to get resources\n");
                return count ? count : -EIO;
        }
 
@@ -454,7 +447,7 @@ static int hisi_lpc_acpi_set_io_res(struct device *child,
                        continue;
                ret = hisi_lpc_acpi_xlat_io_res(adev, host, &resources[i]);
                if (ret) {
-                       dev_err(child, "translate IO range %pR failed (%d)\n",
+                       dev_err(&adev->dev, "translate IO range %pR failed (%d)\n",
                                &resources[i], ret);
                        return ret;
                }
@@ -471,6 +464,12 @@ static int hisi_lpc_acpi_remove_subdev(struct device *dev, void *unused)
        return 0;
 }
 
+static int hisi_lpc_acpi_clear_enumerated(struct acpi_device *adev, void *not_used)
+{
+       acpi_device_clear_enumerated(adev);
+       return 0;
+}
+
 struct hisi_lpc_acpi_cell {
        const char *hid;
        const char *name;
@@ -480,115 +479,114 @@ struct hisi_lpc_acpi_cell {
 
 static void hisi_lpc_acpi_remove(struct device *hostdev)
 {
-       struct acpi_device *adev = ACPI_COMPANION(hostdev);
-       struct acpi_device *child;
-
        device_for_each_child(hostdev, NULL, hisi_lpc_acpi_remove_subdev);
-
-       list_for_each_entry(child, &adev->children, node)
-               acpi_device_clear_enumerated(child);
+       acpi_dev_for_each_child(ACPI_COMPANION(hostdev),
+                               hisi_lpc_acpi_clear_enumerated, NULL);
 }
 
-/*
- * hisi_lpc_acpi_probe - probe children for ACPI FW
- * @hostdev: LPC host device pointer
- *
- * Returns 0 when successful, and a negative value for failure.
- *
- * Create a platform device per child, fixing up the resources
- * from bus addresses to Logical PIO addresses.
- *
- */
-static int hisi_lpc_acpi_probe(struct device *hostdev)
+static int hisi_lpc_acpi_add_child(struct acpi_device *child, void *data)
 {
-       struct acpi_device *adev = ACPI_COMPANION(hostdev);
-       struct acpi_device *child;
+       const char *hid = acpi_device_hid(child);
+       struct device *hostdev = data;
+       const struct hisi_lpc_acpi_cell *cell;
+       struct platform_device *pdev;
+       const struct resource *res;
+       bool found = false;
+       int num_res;
        int ret;
 
-       /* Only consider the children of the host */
-       list_for_each_entry(child, &adev->children, node) {
-               const char *hid = acpi_device_hid(child);
-               const struct hisi_lpc_acpi_cell *cell;
-               struct platform_device *pdev;
-               const struct resource *res;
-               bool found = false;
-               int num_res;
-
-               ret = hisi_lpc_acpi_set_io_res(&child->dev, &adev->dev, &res,
-                                              &num_res);
-               if (ret) {
-                       dev_warn(hostdev, "set resource fail (%d)\n", ret);
-                       goto fail;
-               }
+       ret = hisi_lpc_acpi_set_io_res(child, hostdev, &res, &num_res);
+       if (ret) {
+               dev_warn(hostdev, "set resource fail (%d)\n", ret);
+               return ret;
+       }
 
-               cell = (struct hisi_lpc_acpi_cell []){
-                       /* ipmi */
-                       {
-                               .hid = "IPI0001",
-                               .name = "hisi-lpc-ipmi",
-                       },
-                       /* 8250-compatible uart */
-                       {
-                               .hid = "HISI1031",
-                               .name = "serial8250",
-                               .pdata = (struct plat_serial8250_port []) {
-                                       {
-                                               .iobase = res->start,
-                                               .uartclk = 1843200,
-                                               .iotype = UPIO_PORT,
-                                               .flags = UPF_BOOT_AUTOCONF,
-                                       },
-                                       {}
+       cell = (struct hisi_lpc_acpi_cell []){
+               /* ipmi */
+               {
+                       .hid = "IPI0001",
+                       .name = "hisi-lpc-ipmi",
+               },
+               /* 8250-compatible uart */
+               {
+                       .hid = "HISI1031",
+                       .name = "serial8250",
+                       .pdata = (struct plat_serial8250_port []) {
+                               {
+                                       .iobase = res->start,
+                                       .uartclk = 1843200,
+                                       .iotype = UPIO_PORT,
+                                       .flags = UPF_BOOT_AUTOCONF,
                                },
-                               .pdata_size = 2 *
-                                       sizeof(struct plat_serial8250_port),
+                               {}
                        },
-                       {}
-               };
-
-               for (; cell && cell->name; cell++) {
-                       if (!strcmp(cell->hid, hid)) {
-                               found = true;
-                               break;
-                       }
-               }
-
-               if (!found) {
-                       dev_warn(hostdev,
-                                "could not find cell for child device (%s), discarding\n",
-                                hid);
-                       continue;
+                       .pdata_size = 2 *
+                               sizeof(struct plat_serial8250_port),
+               },
+               {}
+       };
+
+       for (; cell && cell->name; cell++) {
+               if (!strcmp(cell->hid, hid)) {
+                       found = true;
+                       break;
                }
+       }
 
-               pdev = platform_device_alloc(cell->name, PLATFORM_DEVID_AUTO);
-               if (!pdev) {
-                       ret = -ENOMEM;
-                       goto fail;
-               }
+       if (!found) {
+               dev_warn(hostdev,
+                        "could not find cell for child device (%s), discarding\n",
+                        hid);
+               return 0;
+       }
 
-               pdev->dev.parent = hostdev;
-               ACPI_COMPANION_SET(&pdev->dev, child);
+       pdev = platform_device_alloc(cell->name, PLATFORM_DEVID_AUTO);
+       if (!pdev)
+               return -ENOMEM;
 
-               ret = platform_device_add_resources(pdev, res, num_res);
-               if (ret)
-                       goto fail;
+       pdev->dev.parent = hostdev;
+       ACPI_COMPANION_SET(&pdev->dev, child);
 
-               ret = platform_device_add_data(pdev, cell->pdata,
-                                              cell->pdata_size);
-               if (ret)
-                       goto fail;
+       ret = platform_device_add_resources(pdev, res, num_res);
+       if (ret)
+               goto fail;
 
-               ret = platform_device_add(pdev);
-               if (ret)
-                       goto fail;
+       ret = platform_device_add_data(pdev, cell->pdata, cell->pdata_size);
+       if (ret)
+               goto fail;
 
-               acpi_device_set_enumerated(child);
-       }
+       ret = platform_device_add(pdev);
+       if (ret)
+               goto fail;
 
+       acpi_device_set_enumerated(child);
        return 0;
 
 fail:
-       hisi_lpc_acpi_remove(hostdev);
+       platform_device_put(pdev);
+       return ret;
+}
+
+/*
+ * hisi_lpc_acpi_probe - probe children for ACPI FW
+ * @hostdev: LPC host device pointer
+ *
+ * Returns 0 when successful, and a negative value for failure.
+ *
+ * Create a platform device per child, fixing up the resources
+ * from bus addresses to Logical PIO addresses.
+ *
+ */
+static int hisi_lpc_acpi_probe(struct device *hostdev)
+{
+       int ret;
+
+       /* Only consider the children of the host */
+       ret = acpi_dev_for_each_child(ACPI_COMPANION(hostdev),
+                                     hisi_lpc_acpi_add_child, hostdev);
+       if (ret)
+               hisi_lpc_acpi_remove(hostdev);
+
        return ret;
 }
 
index b3f2d55dc551b38835d631e3c60ebd3761c98767..3da8e85f8aae03c77d546d6dba54f8b9053e9897 100644 (file)
@@ -87,7 +87,7 @@ config HW_RANDOM_BA431
 config HW_RANDOM_BCM2835
        tristate "Broadcom BCM2835/BCM63xx Random Number Generator support"
        depends on ARCH_BCM2835 || ARCH_BCM_NSP || ARCH_BCM_5301X || \
-                  ARCH_BCM_63XX || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
+                  ARCH_BCMBCA || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
        default HW_RANDOM
        help
          This driver provides kernel-side support for the Random Number
index ec738f74a026cf5788b9294716ac10307bdf1094..77266afb1c79a9a2b2cec3c12d89051c6fb71bde 100644 (file)
@@ -22,9 +22,9 @@ config CLK_BCM2835
 
 config CLK_BCM_63XX
        bool "Broadcom BCM63xx clock support"
-       depends on ARCH_BCM_63XX || COMPILE_TEST
+       depends on ARCH_BCMBCA || COMPILE_TEST
        select COMMON_CLK_IPROC
-       default ARCH_BCM_63XX
+       default ARCH_BCMBCA
        help
          Enable common clock framework support for Broadcom BCM63xx DSL SoCs
          based on the ARM architecture
index 29a8c710ae068133aa70bd4ae3bcce63b23c0368..b7962e5149a5d8f5599c897bb6dcd0aa0b94a6d0 100644 (file)
@@ -138,6 +138,7 @@ static struct ccu_common *sun50i_h6_r_ccu_clks[] = {
        &r_apb2_rsb_clk.common,
        &r_apb1_ir_clk.common,
        &r_apb1_w1_clk.common,
+       &r_apb1_rtc_clk.common,
        &ir_clk.common,
        &w1_clk.common,
 };
index 3c0ee102fe73b3463fdfe34c859c01f58fd96bb7..4f2bb7315b67ae9fb8e0e9ac8d63b5fafe8ff2fe 100644 (file)
@@ -22,7 +22,7 @@ config CLKEVT_I8253
 config I8253_LOCK
        bool
 
-config OMAP_DM_TIMER
+config OMAP_DM_SYSTIMER
        bool
        select TIMER_OF
 
@@ -56,6 +56,13 @@ config DIGICOLOR_TIMER
        help
          Enables the support for the digicolor timer driver.
 
+config OMAP_DM_TIMER
+       bool "OMAP dual-mode timer driver" if ARCH_K3 || COMPILE_TEST
+       default y if ARCH_K3
+       select TIMER_OF
+       help
+         Enables the support for the TI dual-mode timer driver.
+
 config DW_APB_TIMER
        bool "DW APB timer driver" if COMPILE_TEST
        help
@@ -150,6 +157,14 @@ config TEGRA_TIMER
        help
          Enables support for the Tegra driver.
 
+config TEGRA186_TIMER
+       bool "NVIDIA Tegra186 timer driver"
+       depends on ARCH_TEGRA || COMPILE_TEST
+       depends on WATCHDOG && WATCHDOG_CORE
+       help
+         Enables support for the timers and watchdogs found on NVIDIA
+         Tegra186 and later SoCs.
+
 config VT8500_TIMER
        bool "VT8500 timer driver" if COMPILE_TEST
        depends on HAS_IOMEM
@@ -367,7 +382,7 @@ config ARM_GT_INITIAL_PRESCALER_VAL
        depends on ARM_GLOBAL_TIMER
        help
          When the ARM global timer initializes, its current rate is declared
-         to the kernel and maintained forever. Should it's parent clock
+         to the kernel and maintained forever. Should its parent clock
          change, the driver tries to fix the timer's internal prescaler.
          On some machs (i.e. Zynq) the initial prescaler value thus poses
          bounds about how much the parent clock is allowed to decrease or
index 6ca640019e10d4e3f48cb373ace65dd73b0fa416..64ab547de97b9ad6bdea001834e50535e919d6a7 100644 (file)
@@ -18,7 +18,7 @@ obj-$(CONFIG_CLKSRC_MMIO)     += mmio.o
 obj-$(CONFIG_DAVINCI_TIMER)    += timer-davinci.o
 obj-$(CONFIG_DIGICOLOR_TIMER)  += timer-digicolor.o
 obj-$(CONFIG_OMAP_DM_TIMER)    += timer-ti-dm.o
-obj-$(CONFIG_OMAP_DM_TIMER)    += timer-ti-dm-systimer.o
+obj-$(CONFIG_OMAP_DM_SYSTIMER) += timer-ti-dm-systimer.o
 obj-$(CONFIG_DW_APB_TIMER)     += dw_apb_timer.o
 obj-$(CONFIG_DW_APB_TIMER_OF)  += dw_apb_timer_of.o
 obj-$(CONFIG_FTTMR010_TIMER)   += timer-fttmr010.o
@@ -36,6 +36,7 @@ obj-$(CONFIG_SUN4I_TIMER)     += timer-sun4i.o
 obj-$(CONFIG_SUN5I_HSTIMER)    += timer-sun5i.o
 obj-$(CONFIG_MESON6_TIMER)     += timer-meson6.o
 obj-$(CONFIG_TEGRA_TIMER)      += timer-tegra.o
+obj-$(CONFIG_TEGRA186_TIMER)   += timer-tegra186.o
 obj-$(CONFIG_VT8500_TIMER)     += timer-vt8500.o
 obj-$(CONFIG_NSPIRE_TIMER)     += timer-zevio.o
 obj-$(CONFIG_BCM_KONA_TIMER)   += bcm_kona_timer.o
index dd0956ad969c17ad026d711fabcba36f07f14b93..64dcb082d4cf641e2c0cb05900bb27976d3e3106 100644 (file)
@@ -981,6 +981,14 @@ static const struct of_device_id sh_cmt_of_table[] __maybe_unused = {
                .compatible = "renesas,rcar-gen3-cmt1",
                .data = &sh_cmt_info[SH_CMT1_RCAR_GEN2]
        },
+       {
+               .compatible = "renesas,rcar-gen4-cmt0",
+               .data = &sh_cmt_info[SH_CMT0_RCAR_GEN2]
+       },
+       {
+               .compatible = "renesas,rcar-gen4-cmt1",
+               .data = &sh_cmt_info[SH_CMT1_RCAR_GEN2]
+       },
        { }
 };
 MODULE_DEVICE_TABLE(of, sh_cmt_of_table);
index 7bcb4a3f26fb0ee7bf2fa3c4a916c9a31f5f4edd..d5b29fd03ca2ae3df0657fa6a3b7d9e13d1a0807 100644 (file)
 
 #define TIMER_SYNC_TICKS        (3)
 
+/* cpux mcusys wrapper */
+#define CPUX_CON_REG           0x0
+#define CPUX_IDX_REG           0x4
+
+/* cpux */
+#define CPUX_IDX_GLOBAL_CTRL   0x0
+ #define CPUX_ENABLE           BIT(0)
+ #define CPUX_CLK_DIV_MASK     GENMASK(10, 8)
+ #define CPUX_CLK_DIV1         BIT(8)
+ #define CPUX_CLK_DIV2         BIT(9)
+ #define CPUX_CLK_DIV4         BIT(10)
+#define CPUX_IDX_GLOBAL_IRQ    0x30
+
 /* gpt */
 #define GPT_IRQ_EN_REG          0x00
 #define GPT_IRQ_ENABLE(val)     BIT((val) - 1)
 
 static void __iomem *gpt_sched_reg __read_mostly;
 
+static u32 mtk_cpux_readl(u32 reg_idx, struct timer_of *to)
+{
+       writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG);
+       return readl(timer_of_base(to) + CPUX_CON_REG);
+}
+
+static void mtk_cpux_writel(u32 val, u32 reg_idx, struct timer_of *to)
+{
+       writel(reg_idx, timer_of_base(to) + CPUX_IDX_REG);
+       writel(val, timer_of_base(to) + CPUX_CON_REG);
+}
+
+static void mtk_cpux_set_irq(struct timer_of *to, bool enable)
+{
+       const unsigned long *irq_mask = cpumask_bits(cpu_possible_mask);
+       u32 val;
+
+       val = mtk_cpux_readl(CPUX_IDX_GLOBAL_IRQ, to);
+
+       if (enable)
+               val |= *irq_mask;
+       else
+               val &= ~(*irq_mask);
+
+       mtk_cpux_writel(val, CPUX_IDX_GLOBAL_IRQ, to);
+}
+
+static int mtk_cpux_clkevt_shutdown(struct clock_event_device *clkevt)
+{
+       /* Clear any irq */
+       mtk_cpux_set_irq(to_timer_of(clkevt), false);
+
+       /*
+        * Disabling CPUXGPT timer will crash the platform, especially
+        * if Trusted Firmware is using it (usually, for sleep states),
+        * so we only mask the IRQ and call it a day.
+        */
+       return 0;
+}
+
+static int mtk_cpux_clkevt_resume(struct clock_event_device *clkevt)
+{
+       mtk_cpux_set_irq(to_timer_of(clkevt), true);
+       return 0;
+}
+
 static void mtk_syst_ack_irq(struct timer_of *to)
 {
        /* Clear and disable interrupt */
@@ -281,6 +340,60 @@ static struct timer_of to = {
        },
 };
 
+static int __init mtk_cpux_init(struct device_node *node)
+{
+       static struct timer_of to_cpux;
+       u32 freq, val;
+       int ret;
+
+       /*
+        * There are per-cpu interrupts for the CPUX General Purpose Timer
+        * but since this timer feeds the AArch64 System Timer we can rely
+        * on the CPU timer PPIs as well, so we don't declare TIMER_OF_IRQ.
+        */
+       to_cpux.flags = TIMER_OF_BASE | TIMER_OF_CLOCK;
+       to_cpux.clkevt.name = "mtk-cpuxgpt";
+       to_cpux.clkevt.rating = 10;
+       to_cpux.clkevt.cpumask = cpu_possible_mask;
+       to_cpux.clkevt.set_state_shutdown = mtk_cpux_clkevt_shutdown;
+       to_cpux.clkevt.tick_resume = mtk_cpux_clkevt_resume;
+
+       /* If this fails, bad things are about to happen... */
+       ret = timer_of_init(node, &to_cpux);
+       if (ret) {
+               WARN(1, "Cannot start CPUX timers.\n");
+               return ret;
+       }
+
+       /*
+        * Check if we're given a clock with the right frequency for this
+        * timer, otherwise warn but keep going with the setup anyway, as
+        * that makes it possible to still boot the kernel, even though
+        * it may not work correctly (random lockups, etc).
+        * The reason behind this is that having an early UART may not be
+        * possible for everyone and this gives a chance to retrieve kmsg
+        * for eventual debugging even on consumer devices.
+        */
+       freq = timer_of_rate(&to_cpux);
+       if (freq > 13000000)
+               WARN(1, "Requested unsupported timer frequency %u\n", freq);
+
+       /* Clock input is 26MHz, set DIV2 to achieve 13MHz clock */
+       val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to_cpux);
+       val &= ~CPUX_CLK_DIV_MASK;
+       val |= CPUX_CLK_DIV2;
+       mtk_cpux_writel(val, CPUX_IDX_GLOBAL_CTRL, &to_cpux);
+
+       /* Enable all CPUXGPT timers */
+       val = mtk_cpux_readl(CPUX_IDX_GLOBAL_CTRL, &to_cpux);
+       mtk_cpux_writel(val | CPUX_ENABLE, CPUX_IDX_GLOBAL_CTRL, &to_cpux);
+
+       clockevents_config_and_register(&to_cpux.clkevt, timer_of_rate(&to_cpux),
+                                       TIMER_SYNC_TICKS, 0xffffffff);
+
+       return 0;
+}
+
 static int __init mtk_syst_init(struct device_node *node)
 {
        int ret;
@@ -339,3 +452,4 @@ static int __init mtk_gpt_init(struct device_node *node)
 }
 TIMER_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_gpt_init);
 TIMER_OF_DECLARE(mtk_mt6765, "mediatek,mt6765-timer", mtk_syst_init);
+TIMER_OF_DECLARE(mtk_mt6795, "mediatek,mt6795-systimer", mtk_cpux_init);
index abce83d2f00bd23b4363ee08755dc3ddcb7ae7a7..d5f1436f33d968cc2685ce6735fc79e16cfe13a1 100644 (file)
@@ -61,7 +61,7 @@ struct mchp_pit64b_timer {
 };
 
 /**
- * mchp_pit64b_clkevt - PIT64B clockevent data structure
+ * struct mchp_pit64b_clkevt - PIT64B clockevent data structure
  * @timer: PIT64B timer
  * @clkevt: clockevent
  */
@@ -75,7 +75,7 @@ struct mchp_pit64b_clkevt {
                struct mchp_pit64b_clkevt, clkevt))
 
 /**
- * mchp_pit64b_clksrc - PIT64B clocksource data structure
+ * struct mchp_pit64b_clksrc - PIT64B clocksource data structure
  * @timer: PIT64B timer
  * @clksrc: clocksource
  */
@@ -173,7 +173,8 @@ static int mchp_pit64b_clkevt_shutdown(struct clock_event_device *cedev)
 {
        struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
 
-       writel_relaxed(MCHP_PIT64B_CR_SWRST, timer->base + MCHP_PIT64B_CR);
+       if (!clockevent_state_detached(cedev))
+               mchp_pit64b_suspend(timer);
 
        return 0;
 }
@@ -182,35 +183,37 @@ static int mchp_pit64b_clkevt_set_periodic(struct clock_event_device *cedev)
 {
        struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
 
+       if (clockevent_state_shutdown(cedev))
+               mchp_pit64b_resume(timer);
+
        mchp_pit64b_reset(timer, mchp_pit64b_ce_cycles, MCHP_PIT64B_MR_CONT,
                          MCHP_PIT64B_IER_PERIOD);
 
        return 0;
 }
 
-static int mchp_pit64b_clkevt_set_next_event(unsigned long evt,
-                                            struct clock_event_device *cedev)
+static int mchp_pit64b_clkevt_set_oneshot(struct clock_event_device *cedev)
 {
        struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
 
-       mchp_pit64b_reset(timer, evt, MCHP_PIT64B_MR_ONE_SHOT,
+       if (clockevent_state_shutdown(cedev))
+               mchp_pit64b_resume(timer);
+
+       mchp_pit64b_reset(timer, mchp_pit64b_ce_cycles, MCHP_PIT64B_MR_ONE_SHOT,
                          MCHP_PIT64B_IER_PERIOD);
 
        return 0;
 }
 
-static void mchp_pit64b_clkevt_suspend(struct clock_event_device *cedev)
+static int mchp_pit64b_clkevt_set_next_event(unsigned long evt,
+                                            struct clock_event_device *cedev)
 {
        struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
 
-       mchp_pit64b_suspend(timer);
-}
-
-static void mchp_pit64b_clkevt_resume(struct clock_event_device *cedev)
-{
-       struct mchp_pit64b_timer *timer = clkevt_to_mchp_pit64b_timer(cedev);
+       mchp_pit64b_reset(timer, evt, MCHP_PIT64B_MR_ONE_SHOT,
+                         MCHP_PIT64B_IER_PERIOD);
 
-       mchp_pit64b_resume(timer);
+       return 0;
 }
 
 static irqreturn_t mchp_pit64b_interrupt(int irq, void *dev_id)
@@ -242,8 +245,10 @@ static void __init mchp_pit64b_pres_compute(u32 *pres, u32 clk_rate,
 }
 
 /**
- * mchp_pit64b_init_mode - prepare PIT64B mode register value to be used at
- *                        runtime; this includes prescaler and SGCLK bit
+ * mchp_pit64b_init_mode() - prepare PIT64B mode register value to be used at
+ *                          runtime; this includes prescaler and SGCLK bit
+ * @timer: pointer to pit64b timer to init
+ * @max_rate: maximum rate that timer's clock could use
  *
  * PIT64B timer may be fed by gclk or pclk. When gclk is used its rate has to
  * be at least 3 times lower that pclk's rate. pclk rate is fixed, gclk rate
@@ -341,6 +346,7 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer,
        if (!cs)
                return -ENOMEM;
 
+       mchp_pit64b_resume(timer);
        mchp_pit64b_reset(timer, ULLONG_MAX, MCHP_PIT64B_MR_CONT, 0);
 
        mchp_pit64b_cs_base = timer->base;
@@ -362,8 +368,7 @@ static int __init mchp_pit64b_init_clksrc(struct mchp_pit64b_timer *timer,
                pr_debug("clksrc: Failed to register PIT64B clocksource!\n");
 
                /* Stop timer. */
-               writel_relaxed(MCHP_PIT64B_CR_SWRST,
-                              timer->base + MCHP_PIT64B_CR);
+               mchp_pit64b_suspend(timer);
                kfree(cs);
 
                return ret;
@@ -395,9 +400,8 @@ static int __init mchp_pit64b_init_clkevt(struct mchp_pit64b_timer *timer,
        ce->clkevt.rating = 150;
        ce->clkevt.set_state_shutdown = mchp_pit64b_clkevt_shutdown;
        ce->clkevt.set_state_periodic = mchp_pit64b_clkevt_set_periodic;
+       ce->clkevt.set_state_oneshot = mchp_pit64b_clkevt_set_oneshot;
        ce->clkevt.set_next_event = mchp_pit64b_clkevt_set_next_event;
-       ce->clkevt.suspend = mchp_pit64b_clkevt_suspend;
-       ce->clkevt.resume = mchp_pit64b_clkevt_resume;
        ce->clkevt.cpumask = cpumask_of(0);
        ce->clkevt.irq = irq;
 
@@ -448,19 +452,10 @@ static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
        if (ret)
                goto irq_unmap;
 
-       ret = clk_prepare_enable(timer.pclk);
-       if (ret)
-               goto irq_unmap;
-
-       if (timer.mode & MCHP_PIT64B_MR_SGCLK) {
-               ret = clk_prepare_enable(timer.gclk);
-               if (ret)
-                       goto pclk_unprepare;
-
+       if (timer.mode & MCHP_PIT64B_MR_SGCLK)
                clk_rate = clk_get_rate(timer.gclk);
-       } else {
+       else
                clk_rate = clk_get_rate(timer.pclk);
-       }
        clk_rate = clk_rate / (MCHP_PIT64B_MODE_TO_PRES(timer.mode) + 1);
 
        if (clkevt)
@@ -469,15 +464,10 @@ static int __init mchp_pit64b_dt_init_timer(struct device_node *node,
                ret = mchp_pit64b_init_clksrc(&timer, clk_rate);
 
        if (ret)
-               goto gclk_unprepare;
+               goto irq_unmap;
 
        return 0;
 
-gclk_unprepare:
-       if (timer.mode & MCHP_PIT64B_MR_SGCLK)
-               clk_disable_unprepare(timer.gclk);
-pclk_unprepare:
-       clk_disable_unprepare(timer.pclk);
 irq_unmap:
        irq_dispose_mapping(irq);
 io_unmap:
index bb6ea6c198295e7fa79423c5672d573ccf3fdbc9..94dc6e42e983d8f6bcb447e89880841d65bf91d5 100644 (file)
@@ -128,7 +128,7 @@ static void sun4i_timer_clear_interrupt(void __iomem *base)
 
 static irqreturn_t sun4i_timer_interrupt(int irq, void *dev_id)
 {
-       struct clock_event_device *evt = (struct clock_event_device *)dev_id;
+       struct clock_event_device *evt = dev_id;
        struct timer_of *to = to_timer_of(evt);
 
        sun4i_timer_clear_interrupt(timer_of_base(to));
index 85900f7fc69f0779889ed0fe4bf2cf827307d918..7d5fa90699061e093ff6795293e8f0993234e94f 100644 (file)
@@ -142,7 +142,7 @@ static int sun5i_clkevt_next_event(unsigned long evt,
 
 static irqreturn_t sun5i_timer_interrupt(int irq, void *dev_id)
 {
-       struct sun5i_timer_clkevt *ce = (struct sun5i_timer_clkevt *)dev_id;
+       struct sun5i_timer_clkevt *ce = dev_id;
 
        writel(0x1, ce->timer.base + TIMER_IRQ_ST_REG);
        ce->clkevt.event_handler(&ce->clkevt);
diff --git a/drivers/clocksource/timer-tegra186.c b/drivers/clocksource/timer-tegra186.c
new file mode 100644 (file)
index 0000000..ea74288
--- /dev/null
@@ -0,0 +1,514 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2019-2020 NVIDIA Corporation. All rights reserved.
+ */
+
+#include <linux/clocksource.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/pm.h>
+#include <linux/watchdog.h>
+
+/* shared registers */
+#define TKETSC0 0x000
+#define TKETSC1 0x004
+#define TKEUSEC 0x008
+#define TKEOSC  0x00c
+
+#define TKEIE(x) (0x100 + ((x) * 4))
+#define  TKEIE_WDT_MASK(x, y) ((y) << (16 + 4 * (x)))
+
+/* timer registers */
+#define TMRCR 0x000
+#define  TMRCR_ENABLE BIT(31)
+#define  TMRCR_PERIODIC BIT(30)
+#define  TMRCR_PTV(x) ((x) & 0x0fffffff)
+
+#define TMRSR 0x004
+#define  TMRSR_INTR_CLR BIT(30)
+
+#define TMRCSSR 0x008
+#define  TMRCSSR_SRC_USEC (0 << 0)
+
+/* watchdog registers */
+#define WDTCR 0x000
+#define  WDTCR_SYSTEM_POR_RESET_ENABLE BIT(16)
+#define  WDTCR_SYSTEM_DEBUG_RESET_ENABLE BIT(15)
+#define  WDTCR_REMOTE_INT_ENABLE BIT(14)
+#define  WDTCR_LOCAL_FIQ_ENABLE BIT(13)
+#define  WDTCR_LOCAL_INT_ENABLE BIT(12)
+#define  WDTCR_PERIOD_MASK (0xff << 4)
+#define  WDTCR_PERIOD(x) (((x) & 0xff) << 4)
+#define  WDTCR_TIMER_SOURCE_MASK 0xf
+#define  WDTCR_TIMER_SOURCE(x) ((x) & 0xf)
+
+#define WDTCMDR 0x008
+#define  WDTCMDR_DISABLE_COUNTER BIT(1)
+#define  WDTCMDR_START_COUNTER BIT(0)
+
+#define WDTUR 0x00c
+#define  WDTUR_UNLOCK_PATTERN 0x0000c45a
+
+struct tegra186_timer_soc {
+       unsigned int num_timers;
+       unsigned int num_wdts;
+};
+
+struct tegra186_tmr {
+       struct tegra186_timer *parent;
+       void __iomem *regs;
+       unsigned int index;
+       unsigned int hwirq;
+};
+
+struct tegra186_wdt {
+       struct watchdog_device base;
+
+       void __iomem *regs;
+       unsigned int index;
+       bool locked;
+
+       struct tegra186_tmr *tmr;
+};
+
+static inline struct tegra186_wdt *to_tegra186_wdt(struct watchdog_device *wdd)
+{
+       return container_of(wdd, struct tegra186_wdt, base);
+}
+
+struct tegra186_timer {
+       const struct tegra186_timer_soc *soc;
+       struct device *dev;
+       void __iomem *regs;
+
+       struct tegra186_wdt *wdt;
+       struct clocksource usec;
+       struct clocksource tsc;
+       struct clocksource osc;
+};
+
+static void tmr_writel(struct tegra186_tmr *tmr, u32 value, unsigned int offset)
+{
+       writel_relaxed(value, tmr->regs + offset);
+}
+
+static void wdt_writel(struct tegra186_wdt *wdt, u32 value, unsigned int offset)
+{
+       writel_relaxed(value, wdt->regs + offset);
+}
+
+static u32 wdt_readl(struct tegra186_wdt *wdt, unsigned int offset)
+{
+       return readl_relaxed(wdt->regs + offset);
+}
+
+static struct tegra186_tmr *tegra186_tmr_create(struct tegra186_timer *tegra,
+                                               unsigned int index)
+{
+       unsigned int offset = 0x10000 + index * 0x10000;
+       struct tegra186_tmr *tmr;
+
+       tmr = devm_kzalloc(tegra->dev, sizeof(*tmr), GFP_KERNEL);
+       if (!tmr)
+               return ERR_PTR(-ENOMEM);
+
+       tmr->parent = tegra;
+       tmr->regs = tegra->regs + offset;
+       tmr->index = index;
+       tmr->hwirq = 0;
+
+       return tmr;
+}
+
+static const struct watchdog_info tegra186_wdt_info = {
+       .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
+       .identity = "NVIDIA Tegra186 WDT",
+};
+
+static void tegra186_wdt_disable(struct tegra186_wdt *wdt)
+{
+       /* unlock and disable the watchdog */
+       wdt_writel(wdt, WDTUR_UNLOCK_PATTERN, WDTUR);
+       wdt_writel(wdt, WDTCMDR_DISABLE_COUNTER, WDTCMDR);
+
+       /* disable timer */
+       tmr_writel(wdt->tmr, 0, TMRCR);
+}
+
+static void tegra186_wdt_enable(struct tegra186_wdt *wdt)
+{
+       struct tegra186_timer *tegra = wdt->tmr->parent;
+       u32 value;
+
+       /* unmask hardware IRQ, this may have been lost across powergate */
+       value = TKEIE_WDT_MASK(wdt->index, 1);
+       writel(value, tegra->regs + TKEIE(wdt->tmr->hwirq));
+
+       /* clear interrupt */
+       tmr_writel(wdt->tmr, TMRSR_INTR_CLR, TMRSR);
+
+       /* select microsecond source */
+       tmr_writel(wdt->tmr, TMRCSSR_SRC_USEC, TMRCSSR);
+
+       /* configure timer (system reset happens on the fifth expiration) */
+       value = TMRCR_PTV(wdt->base.timeout * USEC_PER_SEC / 5) |
+               TMRCR_PERIODIC | TMRCR_ENABLE;
+       tmr_writel(wdt->tmr, value, TMRCR);
+
+       if (!wdt->locked) {
+               value = wdt_readl(wdt, WDTCR);
+
+               /* select the proper timer source */
+               value &= ~WDTCR_TIMER_SOURCE_MASK;
+               value |= WDTCR_TIMER_SOURCE(wdt->tmr->index);
+
+               /* single timer period since that's already configured */
+               value &= ~WDTCR_PERIOD_MASK;
+               value |= WDTCR_PERIOD(1);
+
+               /* enable local interrupt for WDT petting */
+               value |= WDTCR_LOCAL_INT_ENABLE;
+
+               /* enable local FIQ and remote interrupt for debug dump */
+               if (0)
+                       value |= WDTCR_REMOTE_INT_ENABLE |
+                                WDTCR_LOCAL_FIQ_ENABLE;
+
+               /* enable system debug reset (doesn't properly reboot) */
+               if (0)
+                       value |= WDTCR_SYSTEM_DEBUG_RESET_ENABLE;
+
+               /* enable system POR reset */
+               value |= WDTCR_SYSTEM_POR_RESET_ENABLE;
+
+               wdt_writel(wdt, value, WDTCR);
+       }
+
+       wdt_writel(wdt, WDTCMDR_START_COUNTER, WDTCMDR);
+}
+
+static int tegra186_wdt_start(struct watchdog_device *wdd)
+{
+       struct tegra186_wdt *wdt = to_tegra186_wdt(wdd);
+
+       tegra186_wdt_enable(wdt);
+
+       return 0;
+}
+
+static int tegra186_wdt_stop(struct watchdog_device *wdd)
+{
+       struct tegra186_wdt *wdt = to_tegra186_wdt(wdd);
+
+       tegra186_wdt_disable(wdt);
+
+       return 0;
+}
+
+static int tegra186_wdt_ping(struct watchdog_device *wdd)
+{
+       struct tegra186_wdt *wdt = to_tegra186_wdt(wdd);
+
+       tegra186_wdt_disable(wdt);
+       tegra186_wdt_enable(wdt);
+
+       return 0;
+}
+
+static int tegra186_wdt_set_timeout(struct watchdog_device *wdd,
+                                   unsigned int timeout)
+{
+       struct tegra186_wdt *wdt = to_tegra186_wdt(wdd);
+
+       if (watchdog_active(&wdt->base))
+               tegra186_wdt_disable(wdt);
+
+       wdt->base.timeout = timeout;
+
+       if (watchdog_active(&wdt->base))
+               tegra186_wdt_enable(wdt);
+
+       return 0;
+}
+
+static const struct watchdog_ops tegra186_wdt_ops = {
+       .owner = THIS_MODULE,
+       .start = tegra186_wdt_start,
+       .stop = tegra186_wdt_stop,
+       .ping = tegra186_wdt_ping,
+       .set_timeout = tegra186_wdt_set_timeout,
+};
+
+static struct tegra186_wdt *tegra186_wdt_create(struct tegra186_timer *tegra,
+                                               unsigned int index)
+{
+       unsigned int offset = 0x10000, source;
+       struct tegra186_wdt *wdt;
+       u32 value;
+       int err;
+
+       offset += tegra->soc->num_timers * 0x10000 + index * 0x10000;
+
+       wdt = devm_kzalloc(tegra->dev, sizeof(*wdt), GFP_KERNEL);
+       if (!wdt)
+               return ERR_PTR(-ENOMEM);
+
+       wdt->regs = tegra->regs + offset;
+       wdt->index = index;
+
+       /* read the watchdog configuration since it might be locked down */
+       value = wdt_readl(wdt, WDTCR);
+
+       if (value & WDTCR_LOCAL_INT_ENABLE)
+               wdt->locked = true;
+
+       source = value & WDTCR_TIMER_SOURCE_MASK;
+
+       wdt->tmr = tegra186_tmr_create(tegra, source);
+       if (IS_ERR(wdt->tmr))
+               return ERR_CAST(wdt->tmr);
+
+       wdt->base.info = &tegra186_wdt_info;
+       wdt->base.ops = &tegra186_wdt_ops;
+       wdt->base.min_timeout = 1;
+       wdt->base.max_timeout = 255;
+       wdt->base.parent = tegra->dev;
+
+       err = watchdog_init_timeout(&wdt->base, 5, tegra->dev);
+       if (err < 0) {
+               dev_err(tegra->dev, "failed to initialize timeout: %d\n", err);
+               return ERR_PTR(err);
+       }
+
+       err = devm_watchdog_register_device(tegra->dev, &wdt->base);
+       if (err < 0) {
+               dev_err(tegra->dev, "failed to register WDT: %d\n", err);
+               return ERR_PTR(err);
+       }
+
+       return wdt;
+}
+
+static u64 tegra186_timer_tsc_read(struct clocksource *cs)
+{
+       struct tegra186_timer *tegra = container_of(cs, struct tegra186_timer,
+                                                   tsc);
+       u32 hi, lo, ss;
+
+       hi = readl_relaxed(tegra->regs + TKETSC1);
+
+       /*
+        * The 56-bit value of the TSC is spread across two registers that are
+        * not synchronized. In order to read them atomically, ensure that the
+        * high 24 bits match before and after reading the low 32 bits.
+        */
+       do {
+               /* snapshot the high 24 bits */
+               ss = hi;
+
+               lo = readl_relaxed(tegra->regs + TKETSC0);
+               hi = readl_relaxed(tegra->regs + TKETSC1);
+       } while (hi != ss);
+
+       return (u64)hi << 32 | lo;
+}
+
+static int tegra186_timer_tsc_init(struct tegra186_timer *tegra)
+{
+       tegra->tsc.name = "tsc";
+       tegra->tsc.rating = 300;
+       tegra->tsc.read = tegra186_timer_tsc_read;
+       tegra->tsc.mask = CLOCKSOURCE_MASK(56);
+       tegra->tsc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
+
+       return clocksource_register_hz(&tegra->tsc, 31250000);
+}
+
+static u64 tegra186_timer_osc_read(struct clocksource *cs)
+{
+       struct tegra186_timer *tegra = container_of(cs, struct tegra186_timer,
+                                                   osc);
+
+       return readl_relaxed(tegra->regs + TKEOSC);
+}
+
+static int tegra186_timer_osc_init(struct tegra186_timer *tegra)
+{
+       tegra->osc.name = "osc";
+       tegra->osc.rating = 300;
+       tegra->osc.read = tegra186_timer_osc_read;
+       tegra->osc.mask = CLOCKSOURCE_MASK(32);
+       tegra->osc.flags = CLOCK_SOURCE_IS_CONTINUOUS;
+
+       return clocksource_register_hz(&tegra->osc, 38400000);
+}
+
+static u64 tegra186_timer_usec_read(struct clocksource *cs)
+{
+       struct tegra186_timer *tegra = container_of(cs, struct tegra186_timer,
+                                                   usec);
+
+       return readl_relaxed(tegra->regs + TKEUSEC);
+}
+
+static int tegra186_timer_usec_init(struct tegra186_timer *tegra)
+{
+       tegra->usec.name = "usec";
+       tegra->usec.rating = 300;
+       tegra->usec.read = tegra186_timer_usec_read;
+       tegra->usec.mask = CLOCKSOURCE_MASK(32);
+       tegra->usec.flags = CLOCK_SOURCE_IS_CONTINUOUS;
+
+       return clocksource_register_hz(&tegra->usec, USEC_PER_SEC);
+}
+
+static irqreturn_t tegra186_timer_irq(int irq, void *data)
+{
+       struct tegra186_timer *tegra = data;
+
+       if (watchdog_active(&tegra->wdt->base)) {
+               tegra186_wdt_disable(tegra->wdt);
+               tegra186_wdt_enable(tegra->wdt);
+       }
+
+       return IRQ_HANDLED;
+}
+
+static int tegra186_timer_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct tegra186_timer *tegra;
+       unsigned int irq;
+       int err;
+
+       tegra = devm_kzalloc(dev, sizeof(*tegra), GFP_KERNEL);
+       if (!tegra)
+               return -ENOMEM;
+
+       tegra->soc = of_device_get_match_data(dev);
+       dev_set_drvdata(dev, tegra);
+       tegra->dev = dev;
+
+       tegra->regs = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(tegra->regs))
+               return PTR_ERR(tegra->regs);
+
+       err = platform_get_irq(pdev, 0);
+       if (err < 0)
+               return err;
+
+       irq = err;
+
+       /* create a watchdog using a preconfigured timer */
+       tegra->wdt = tegra186_wdt_create(tegra, 0);
+       if (IS_ERR(tegra->wdt)) {
+               err = PTR_ERR(tegra->wdt);
+               dev_err(dev, "failed to create WDT: %d\n", err);
+               return err;
+       }
+
+       err = tegra186_timer_tsc_init(tegra);
+       if (err < 0) {
+               dev_err(dev, "failed to register TSC counter: %d\n", err);
+               return err;
+       }
+
+       err = tegra186_timer_osc_init(tegra);
+       if (err < 0) {
+               dev_err(dev, "failed to register OSC counter: %d\n", err);
+               goto unregister_tsc;
+       }
+
+       err = tegra186_timer_usec_init(tegra);
+       if (err < 0) {
+               dev_err(dev, "failed to register USEC counter: %d\n", err);
+               goto unregister_osc;
+       }
+
+       err = devm_request_irq(dev, irq, tegra186_timer_irq, 0,
+                              "tegra186-timer", tegra);
+       if (err < 0) {
+               dev_err(dev, "failed to request IRQ#%u: %d\n", irq, err);
+               goto unregister_usec;
+       }
+
+       return 0;
+
+unregister_usec:
+       clocksource_unregister(&tegra->usec);
+unregister_osc:
+       clocksource_unregister(&tegra->osc);
+unregister_tsc:
+       clocksource_unregister(&tegra->tsc);
+       return err;
+}
+
+static int tegra186_timer_remove(struct platform_device *pdev)
+{
+       struct tegra186_timer *tegra = platform_get_drvdata(pdev);
+
+       clocksource_unregister(&tegra->usec);
+       clocksource_unregister(&tegra->osc);
+       clocksource_unregister(&tegra->tsc);
+
+       return 0;
+}
+
+static int __maybe_unused tegra186_timer_suspend(struct device *dev)
+{
+       struct tegra186_timer *tegra = dev_get_drvdata(dev);
+
+       if (watchdog_active(&tegra->wdt->base))
+               tegra186_wdt_disable(tegra->wdt);
+
+       return 0;
+}
+
+static int __maybe_unused tegra186_timer_resume(struct device *dev)
+{
+       struct tegra186_timer *tegra = dev_get_drvdata(dev);
+
+       if (watchdog_active(&tegra->wdt->base))
+               tegra186_wdt_enable(tegra->wdt);
+
+       return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(tegra186_timer_pm_ops, tegra186_timer_suspend,
+                        tegra186_timer_resume);
+
+static const struct tegra186_timer_soc tegra186_timer = {
+       .num_timers = 10,
+       .num_wdts = 3,
+};
+
+static const struct tegra186_timer_soc tegra234_timer = {
+       .num_timers = 16,
+       .num_wdts = 3,
+};
+
+static const struct of_device_id tegra186_timer_of_match[] = {
+       { .compatible = "nvidia,tegra186-timer", .data = &tegra186_timer },
+       { .compatible = "nvidia,tegra234-timer", .data = &tegra234_timer },
+       { }
+};
+MODULE_DEVICE_TABLE(of, tegra186_timer_of_match);
+
+static struct platform_driver tegra186_wdt_driver = {
+       .driver = {
+               .name = "tegra186-timer",
+               .pm = &tegra186_timer_pm_ops,
+               .of_match_table = tegra186_timer_of_match,
+       },
+       .probe = tegra186_timer_probe,
+       .remove = tegra186_timer_remove,
+};
+module_platform_driver(tegra186_wdt_driver);
+
+MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
+MODULE_DESCRIPTION("NVIDIA Tegra186 timers driver");
+MODULE_LICENSE("GPL v2");
index c194e8f74e1d04c5cd8cd85800a393c03d9e6daa..469f7c91564b664ffeb0317d5e9b1f29579c30ac 100644 (file)
@@ -44,6 +44,121 @@ enum {
        REQUEST_BY_NODE,
 };
 
+static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,
+                                               int posted)
+{
+       if (posted)
+               while (readl_relaxed(timer->pend) & (reg >> WPSHIFT))
+                       cpu_relax();
+
+       return readl_relaxed(timer->func_base + (reg & 0xff));
+}
+
+static inline void __omap_dm_timer_write(struct omap_dm_timer *timer,
+                                       u32 reg, u32 val, int posted)
+{
+       if (posted)
+               while (readl_relaxed(timer->pend) & (reg >> WPSHIFT))
+                       cpu_relax();
+
+       writel_relaxed(val, timer->func_base + (reg & 0xff));
+}
+
+static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
+{
+       u32 tidr;
+
+       /* Assume v1 ip if bits [31:16] are zero */
+       tidr = readl_relaxed(timer->io_base);
+       if (!(tidr >> 16)) {
+               timer->revision = 1;
+               timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
+               timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
+               timer->irq_dis = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
+               timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET;
+               timer->func_base = timer->io_base;
+       } else {
+               timer->revision = 2;
+               timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
+               timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
+               timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;
+               timer->pend = timer->io_base +
+                       _OMAP_TIMER_WRITE_PEND_OFFSET +
+                               OMAP_TIMER_V2_FUNC_OFFSET;
+               timer->func_base = timer->io_base + OMAP_TIMER_V2_FUNC_OFFSET;
+       }
+}
+
+/*
+ * __omap_dm_timer_enable_posted - enables write posted mode
+ * @timer:      pointer to timer instance handle
+ *
+ * Enables the write posted mode for the timer. When posted mode is enabled
+ * writes to certain timer registers are immediately acknowledged by the
+ * internal bus and hence prevents stalling the CPU waiting for the write to
+ * complete. Enabling this feature can improve performance for writing to the
+ * timer registers.
+ */
+static inline void __omap_dm_timer_enable_posted(struct omap_dm_timer *timer)
+{
+       if (timer->posted)
+               return;
+
+       if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) {
+               timer->posted = OMAP_TIMER_NONPOSTED;
+               __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, 0, 0);
+               return;
+       }
+
+       __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG,
+                             OMAP_TIMER_CTRL_POSTED, 0);
+       timer->context.tsicr = OMAP_TIMER_CTRL_POSTED;
+       timer->posted = OMAP_TIMER_POSTED;
+}
+
+static inline void __omap_dm_timer_stop(struct omap_dm_timer *timer,
+                                       int posted, unsigned long rate)
+{
+       u32 l;
+
+       l = __omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
+       if (l & OMAP_TIMER_CTRL_ST) {
+               l &= ~0x1;
+               __omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, l, posted);
+#ifdef CONFIG_ARCH_OMAP2PLUS
+               /* Readback to make sure write has completed */
+               __omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
+               /*
+                * Wait for functional clock period x 3.5 to make sure that
+                * timer is stopped
+                */
+               udelay(3500000 / rate + 1);
+#endif
+       }
+
+       /* Ack possibly pending interrupt */
+       writel_relaxed(OMAP_TIMER_INT_OVERFLOW, timer->irq_stat);
+}
+
+static inline void __omap_dm_timer_int_enable(struct omap_dm_timer *timer,
+                                               unsigned int value)
+{
+       writel_relaxed(value, timer->irq_ena);
+       __omap_dm_timer_write(timer, OMAP_TIMER_WAKEUP_EN_REG, value, 0);
+}
+
+static inline unsigned int
+__omap_dm_timer_read_counter(struct omap_dm_timer *timer, int posted)
+{
+       return __omap_dm_timer_read(timer, OMAP_TIMER_COUNTER_REG, posted);
+}
+
+static inline void __omap_dm_timer_write_status(struct omap_dm_timer *timer,
+                                               unsigned int value)
+{
+       writel_relaxed(value, timer->irq_stat);
+}
+
 /**
  * omap_dm_timer_read_reg - read timer registers in posted and non-posted mode
  * @timer:      timer pointer over which read operation to perform
@@ -921,6 +1036,10 @@ static const struct dmtimer_platform_data omap3plus_pdata = {
        .timer_ops = &dmtimer_ops,
 };
 
+static const struct dmtimer_platform_data am6_pdata = {
+       .timer_ops = &dmtimer_ops,
+};
+
 static const struct of_device_id omap_timer_match[] = {
        {
                .compatible = "ti,omap2420-timer",
@@ -949,6 +1068,10 @@ static const struct of_device_id omap_timer_match[] = {
                .compatible = "ti,dm816-timer",
                .data = &omap3plus_pdata,
        },
+       {
+               .compatible = "ti,am654-timer",
+               .data = &am6_pdata,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, omap_timer_match);
index be7f512109f793dd81b6c395aa1f257b5c2b241a..747aa537389b92751863dfd23ab026576905f7e3 100644 (file)
@@ -3,7 +3,8 @@
 # ARM CPU Idle drivers
 #
 config ARM_CPUIDLE
-       bool "Generic ARM/ARM64 CPU idle Driver"
+       bool "Generic ARM CPU idle Driver"
+       depends on ARM
        select DT_IDLE_STATES
        select CPU_IDLE_MULTIPLE_DRIVERS
        help
index 59b0bedc9c242ab70cad0a21ad5700f72abaca76..c8fa7dcfdbd0817b8ed2861b06ffd4854bd2a6a8 100644 (file)
@@ -103,9 +103,14 @@ static void dimm_setup_label(struct dimm_info *dimm, u16 handle)
 
        dmi_memdev_name(handle, &bank, &device);
 
-       /* both strings must be non-zero */
-       if (bank && *bank && device && *device)
-               snprintf(dimm->label, sizeof(dimm->label), "%s %s", bank, device);
+       /*
+        * Set to a NULL string when both bank and device are zero. In this case,
+        * the label assigned by default will be preserved.
+        */
+       snprintf(dimm->label, sizeof(dimm->label), "%s%s%s",
+                (bank && *bank) ? bank : "",
+                (bank && *bank && device && *device) ? " " : "",
+                (device && *device) ? device : "");
 }
 
 static void assign_dmi_dimm_info(struct dimm_info *dimm, struct memdev_dmi_entry *entry)
index 1cee64b80a7e085ee0c3503aa71d30a7f3cf4f23..f7d37c28281992b552adfd6893a10d0a4b1a780b 100644 (file)
@@ -514,6 +514,28 @@ static void handle_error(struct mem_ctl_info *mci, struct synps_ecc_status *p)
        memset(p, 0, sizeof(*p));
 }
 
+static void enable_intr(struct synps_edac_priv *priv)
+{
+       /* Enable UE/CE Interrupts */
+       if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)
+               writel(DDR_UE_MASK | DDR_CE_MASK,
+                      priv->baseaddr + ECC_CLR_OFST);
+       else
+               writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
+                      priv->baseaddr + DDR_QOS_IRQ_EN_OFST);
+
+}
+
+static void disable_intr(struct synps_edac_priv *priv)
+{
+       /* Disable UE/CE Interrupts */
+       if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)
+               writel(0x0, priv->baseaddr + ECC_CLR_OFST);
+       else
+               writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
+                      priv->baseaddr + DDR_QOS_IRQ_DB_OFST);
+}
+
 /**
  * intr_handler - Interrupt Handler for ECC interrupts.
  * @irq:        IRQ number.
@@ -555,6 +577,9 @@ static irqreturn_t intr_handler(int irq, void *dev_id)
        /* v3.0 of the controller does not have this register */
        if (!(priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR))
                writel(regval, priv->baseaddr + DDR_QOS_IRQ_STAT_OFST);
+       else
+               enable_intr(priv);
+
        return IRQ_HANDLED;
 }
 
@@ -837,25 +862,6 @@ static void mc_init(struct mem_ctl_info *mci, struct platform_device *pdev)
        init_csrows(mci);
 }
 
-static void enable_intr(struct synps_edac_priv *priv)
-{
-       /* Enable UE/CE Interrupts */
-       if (priv->p_data->quirks & DDR_ECC_INTR_SELF_CLEAR)
-               writel(DDR_UE_MASK | DDR_CE_MASK,
-                      priv->baseaddr + ECC_CLR_OFST);
-       else
-               writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
-                      priv->baseaddr + DDR_QOS_IRQ_EN_OFST);
-
-}
-
-static void disable_intr(struct synps_edac_priv *priv)
-{
-       /* Disable UE/CE Interrupts */
-       writel(DDR_QOSUE_MASK | DDR_QOSCE_MASK,
-                       priv->baseaddr + DDR_QOS_IRQ_DB_OFST);
-}
-
 static int setup_irq(struct mem_ctl_info *mci,
                     struct platform_device *pdev)
 {
index 1e7b7fec97d9e72a3129a2839f24c38b80667292..a14f65444b350257de43354ca4525e17af7ddd56 100644 (file)
@@ -149,4 +149,16 @@ config ARM_SCMI_POWER_DOMAIN
          will be called scmi_pm_domain. Note this may needed early in boot
          before rootfs may be available.
 
+config ARM_SCMI_POWER_CONTROL
+       tristate "SCMI system power control driver"
+       depends on ARM_SCMI_PROTOCOL || (COMPILE_TEST && OF)
+       help
+         This enables System Power control logic which binds system shutdown or
+         reboot actions to SCMI System Power notifications generated by SCP
+         firmware.
+
+         This driver can also be built as a module.  If so, the module will be
+         called scmi_power_control. Note this may needed early in boot to catch
+         early shutdown/reboot SCMI requests.
+
 endmenu
index 8d4afadda38ca08213e18dc2e9d2ebcd132d01b1..9ea86f8cc8f76b5162d89340e367ab7481cd83b4 100644 (file)
@@ -7,11 +7,12 @@ scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_SMC) += smc.o
 scmi-transport-$(CONFIG_ARM_SCMI_HAVE_MSG) += msg.o
 scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_VIRTIO) += virtio.o
 scmi-transport-$(CONFIG_ARM_SCMI_TRANSPORT_OPTEE) += optee.o
-scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o
+scmi-protocols-y = base.o clock.o perf.o power.o reset.o sensors.o system.o voltage.o powercap.o
 scmi-module-objs := $(scmi-bus-y) $(scmi-driver-y) $(scmi-protocols-y) \
                    $(scmi-transport-y)
 obj-$(CONFIG_ARM_SCMI_PROTOCOL) += scmi-module.o
 obj-$(CONFIG_ARM_SCMI_POWER_DOMAIN) += scmi_pm_domain.o
+obj-$(CONFIG_ARM_SCMI_POWER_CONTROL) += scmi_power_control.o
 
 ifeq ($(CONFIG_THUMB2_KERNEL)$(CONFIG_CC_IS_CLANG),yy)
 # The use of R7 in the SMCCC conflicts with the compiler's use of R7 as a frame
index 8b7ac6663d57de6e8824aac6d0aa4e8509670912..609ebedee9cb69527ba6f70189ac08bb63ddf989 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/export.h>
 #include <linux/idr.h>
 #include <linux/io.h>
+#include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/kernel.h>
 #include <linux/ktime.h>
 #include <linux/hashtable.h>
@@ -60,6 +61,11 @@ static atomic_t transfer_last_id;
 static DEFINE_IDR(scmi_requested_devices);
 static DEFINE_MUTEX(scmi_requested_devices_mtx);
 
+/* Track globally the creation of SCMI SystemPower related devices */
+static bool scmi_syspower_registered;
+/* Protect access to scmi_syspower_registered */
+static DEFINE_MUTEX(scmi_syspower_mtx);
+
 struct scmi_requested_dev {
        const struct scmi_device_id *id_table;
        struct list_head node;
@@ -660,6 +666,11 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo,
                smp_store_mb(xfer->priv, priv);
        info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size,
                                            xfer);
+
+       trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "NOTI",
+                           xfer->hdr.seq, xfer->hdr.status,
+                           xfer->rx.buf, xfer->rx.len);
+
        scmi_notify(cinfo->handle, xfer->hdr.protocol_id,
                    xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts);
 
@@ -694,6 +705,12 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
                smp_store_mb(xfer->priv, priv);
        info->desc->ops->fetch_response(cinfo, xfer);
 
+       trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id,
+                           xfer->hdr.type == MSG_TYPE_DELAYED_RESP ?
+                           "DLYD" : "RESP",
+                           xfer->hdr.seq, xfer->hdr.status,
+                           xfer->rx.buf, xfer->rx.len);
+
        trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id,
                           xfer->hdr.protocol_id, xfer->hdr.seq,
                           xfer->hdr.type);
@@ -827,6 +844,12 @@ static int scmi_wait_for_message_response(struct scmi_chan_info *cinfo,
                                xfer->state = SCMI_XFER_RESP_OK;
                        }
                        spin_unlock_irqrestore(&xfer->lock, flags);
+
+                       /* Trace polled replies. */
+                       trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id,
+                                           "RESP",
+                                           xfer->hdr.seq, xfer->hdr.status,
+                                           xfer->rx.buf, xfer->rx.len);
                }
        } else {
                /* And we wait for the response. */
@@ -903,6 +926,10 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
                return ret;
        }
 
+       trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "CMND",
+                           xfer->hdr.seq, xfer->hdr.status,
+                           xfer->tx.buf, xfer->tx.len);
+
        ret = scmi_wait_for_message_response(cinfo, xfer);
        if (!ret && xfer->hdr.status)
                ret = scmi_to_linux_errno(xfer->hdr.status);
@@ -1259,10 +1286,174 @@ out:
        return ret;
 }
 
+struct scmi_msg_get_fc_info {
+       __le32 domain;
+       __le32 message_id;
+};
+
+struct scmi_msg_resp_desc_fc {
+       __le32 attr;
+#define SUPPORTS_DOORBELL(x)           ((x) & BIT(0))
+#define DOORBELL_REG_WIDTH(x)          FIELD_GET(GENMASK(2, 1), (x))
+       __le32 rate_limit;
+       __le32 chan_addr_low;
+       __le32 chan_addr_high;
+       __le32 chan_size;
+       __le32 db_addr_low;
+       __le32 db_addr_high;
+       __le32 db_set_lmask;
+       __le32 db_set_hmask;
+       __le32 db_preserve_lmask;
+       __le32 db_preserve_hmask;
+};
+
+static void
+scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph,
+                            u8 describe_id, u32 message_id, u32 valid_size,
+                            u32 domain, void __iomem **p_addr,
+                            struct scmi_fc_db_info **p_db)
+{
+       int ret;
+       u32 flags;
+       u64 phys_addr;
+       u8 size;
+       void __iomem *addr;
+       struct scmi_xfer *t;
+       struct scmi_fc_db_info *db = NULL;
+       struct scmi_msg_get_fc_info *info;
+       struct scmi_msg_resp_desc_fc *resp;
+       const struct scmi_protocol_instance *pi = ph_to_pi(ph);
+
+       if (!p_addr) {
+               ret = -EINVAL;
+               goto err_out;
+       }
+
+       ret = ph->xops->xfer_get_init(ph, describe_id,
+                                     sizeof(*info), sizeof(*resp), &t);
+       if (ret)
+               goto err_out;
+
+       info = t->tx.buf;
+       info->domain = cpu_to_le32(domain);
+       info->message_id = cpu_to_le32(message_id);
+
+       /*
+        * Bail out on error leaving fc_info addresses zeroed; this includes
+        * the case in which the requested domain/message_id does NOT support
+        * fastchannels at all.
+        */
+       ret = ph->xops->do_xfer(ph, t);
+       if (ret)
+               goto err_xfer;
+
+       resp = t->rx.buf;
+       flags = le32_to_cpu(resp->attr);
+       size = le32_to_cpu(resp->chan_size);
+       if (size != valid_size) {
+               ret = -EINVAL;
+               goto err_xfer;
+       }
+
+       phys_addr = le32_to_cpu(resp->chan_addr_low);
+       phys_addr |= (u64)le32_to_cpu(resp->chan_addr_high) << 32;
+       addr = devm_ioremap(ph->dev, phys_addr, size);
+       if (!addr) {
+               ret = -EADDRNOTAVAIL;
+               goto err_xfer;
+       }
+
+       *p_addr = addr;
+
+       if (p_db && SUPPORTS_DOORBELL(flags)) {
+               db = devm_kzalloc(ph->dev, sizeof(*db), GFP_KERNEL);
+               if (!db) {
+                       ret = -ENOMEM;
+                       goto err_db;
+               }
+
+               size = 1 << DOORBELL_REG_WIDTH(flags);
+               phys_addr = le32_to_cpu(resp->db_addr_low);
+               phys_addr |= (u64)le32_to_cpu(resp->db_addr_high) << 32;
+               addr = devm_ioremap(ph->dev, phys_addr, size);
+               if (!addr) {
+                       ret = -EADDRNOTAVAIL;
+                       goto err_db_mem;
+               }
+
+               db->addr = addr;
+               db->width = size;
+               db->set = le32_to_cpu(resp->db_set_lmask);
+               db->set |= (u64)le32_to_cpu(resp->db_set_hmask) << 32;
+               db->mask = le32_to_cpu(resp->db_preserve_lmask);
+               db->mask |= (u64)le32_to_cpu(resp->db_preserve_hmask) << 32;
+
+               *p_db = db;
+       }
+
+       ph->xops->xfer_put(ph, t);
+
+       dev_dbg(ph->dev,
+               "Using valid FC for protocol %X [MSG_ID:%u / RES_ID:%u]\n",
+               pi->proto->id, message_id, domain);
+
+       return;
+
+err_db_mem:
+       devm_kfree(ph->dev, db);
+
+err_db:
+       *p_addr = NULL;
+
+err_xfer:
+       ph->xops->xfer_put(ph, t);
+
+err_out:
+       dev_warn(ph->dev,
+                "Failed to get FC for protocol %X [MSG_ID:%u / RES_ID:%u] - ret:%d. Using regular messaging.\n",
+                pi->proto->id, message_id, domain, ret);
+}
+
+#define SCMI_PROTO_FC_RING_DB(w)                       \
+do {                                                   \
+       u##w val = 0;                                   \
+                                                       \
+       if (db->mask)                                   \
+               val = ioread##w(db->addr) & db->mask;   \
+       iowrite##w((u##w)db->set | val, db->addr);      \
+} while (0)
+
+static void scmi_common_fastchannel_db_ring(struct scmi_fc_db_info *db)
+{
+       if (!db || !db->addr)
+               return;
+
+       if (db->width == 1)
+               SCMI_PROTO_FC_RING_DB(8);
+       else if (db->width == 2)
+               SCMI_PROTO_FC_RING_DB(16);
+       else if (db->width == 4)
+               SCMI_PROTO_FC_RING_DB(32);
+       else /* db->width == 8 */
+#ifdef CONFIG_64BIT
+               SCMI_PROTO_FC_RING_DB(64);
+#else
+       {
+               u64 val = 0;
+
+               if (db->mask)
+                       val = ioread64_hi_lo(db->addr) & db->mask;
+               iowrite64_hi_lo(db->set | val, db->addr);
+       }
+#endif
+}
+
 static const struct scmi_proto_helpers_ops helpers_ops = {
        .extended_name_get = scmi_common_extended_name_get,
        .iter_response_init = scmi_iterator_init,
        .iter_response_run = scmi_iterator_run,
+       .fastchannel_init = scmi_common_fastchannel_init,
+       .fastchannel_db_ring = scmi_common_fastchannel_db_ring,
 };
 
 /**
@@ -1497,6 +1688,30 @@ static void scmi_devm_release_protocol(struct device *dev, void *res)
        scmi_protocol_release(dres->handle, dres->protocol_id);
 }
 
+static struct scmi_protocol_instance __must_check *
+scmi_devres_protocol_instance_get(struct scmi_device *sdev, u8 protocol_id)
+{
+       struct scmi_protocol_instance *pi;
+       struct scmi_protocol_devres *dres;
+
+       dres = devres_alloc(scmi_devm_release_protocol,
+                           sizeof(*dres), GFP_KERNEL);
+       if (!dres)
+               return ERR_PTR(-ENOMEM);
+
+       pi = scmi_get_protocol_instance(sdev->handle, protocol_id);
+       if (IS_ERR(pi)) {
+               devres_free(dres);
+               return pi;
+       }
+
+       dres->handle = sdev->handle;
+       dres->protocol_id = protocol_id;
+       devres_add(&sdev->dev, dres);
+
+       return pi;
+}
+
 /**
  * scmi_devm_protocol_get  - Devres managed get protocol operations and handle
  * @sdev: A reference to an scmi_device whose embedded struct device is to
@@ -1520,32 +1735,47 @@ scmi_devm_protocol_get(struct scmi_device *sdev, u8 protocol_id,
                       struct scmi_protocol_handle **ph)
 {
        struct scmi_protocol_instance *pi;
-       struct scmi_protocol_devres *dres;
-       struct scmi_handle *handle = sdev->handle;
 
        if (!ph)
                return ERR_PTR(-EINVAL);
 
-       dres = devres_alloc(scmi_devm_release_protocol,
-                           sizeof(*dres), GFP_KERNEL);
-       if (!dres)
-               return ERR_PTR(-ENOMEM);
-
-       pi = scmi_get_protocol_instance(handle, protocol_id);
-       if (IS_ERR(pi)) {
-               devres_free(dres);
+       pi = scmi_devres_protocol_instance_get(sdev, protocol_id);
+       if (IS_ERR(pi))
                return pi;
-       }
-
-       dres->handle = handle;
-       dres->protocol_id = protocol_id;
-       devres_add(&sdev->dev, dres);
 
        *ph = &pi->ph;
 
        return pi->proto->ops;
 }
 
+/**
+ * scmi_devm_protocol_acquire  - Devres managed helper to get hold of a protocol
+ * @sdev: A reference to an scmi_device whose embedded struct device is to
+ *       be used for devres accounting.
+ * @protocol_id: The protocol being requested.
+ *
+ * Get hold of a protocol accounting for its usage, possibly triggering its
+ * initialization but without getting access to its protocol specific operations
+ * and handle.
+ *
+ * Being a devres based managed method, protocol hold will be automatically
+ * released, and possibly de-initialized on last user, once the SCMI driver
+ * owning the scmi_device is unbound from it.
+ *
+ * Return: 0 on SUCCESS
+ */
+static int __must_check scmi_devm_protocol_acquire(struct scmi_device *sdev,
+                                                  u8 protocol_id)
+{
+       struct scmi_protocol_instance *pi;
+
+       pi = scmi_devres_protocol_instance_get(sdev, protocol_id);
+       if (IS_ERR(pi))
+               return PTR_ERR(pi);
+
+       return 0;
+}
+
 static int scmi_devm_protocol_match(struct device *dev, void *res, void *data)
 {
        struct scmi_protocol_devres *dres = res;
@@ -1849,21 +2079,39 @@ scmi_get_protocol_device(struct device_node *np, struct scmi_info *info,
        if (sdev)
                return sdev;
 
+       mutex_lock(&scmi_syspower_mtx);
+       if (prot_id == SCMI_PROTOCOL_SYSTEM && scmi_syspower_registered) {
+               dev_warn(info->dev,
+                        "SCMI SystemPower protocol device must be unique !\n");
+               mutex_unlock(&scmi_syspower_mtx);
+
+               return NULL;
+       }
+
        pr_debug("Creating SCMI device (%s) for protocol %x\n", name, prot_id);
 
        sdev = scmi_device_create(np, info->dev, prot_id, name);
        if (!sdev) {
                dev_err(info->dev, "failed to create %d protocol device\n",
                        prot_id);
+               mutex_unlock(&scmi_syspower_mtx);
+
                return NULL;
        }
 
        if (scmi_txrx_setup(info, &sdev->dev, prot_id)) {
                dev_err(&sdev->dev, "failed to setup transport\n");
                scmi_device_destroy(sdev);
+               mutex_unlock(&scmi_syspower_mtx);
+
                return NULL;
        }
 
+       if (prot_id == SCMI_PROTOCOL_SYSTEM)
+               scmi_syspower_registered = true;
+
+       mutex_unlock(&scmi_syspower_mtx);
+
        return sdev;
 }
 
@@ -2132,6 +2380,7 @@ static int scmi_probe(struct platform_device *pdev)
        handle = &info->handle;
        handle->dev = info->dev;
        handle->version = &info->version;
+       handle->devm_protocol_acquire = scmi_devm_protocol_acquire;
        handle->devm_protocol_get = scmi_devm_protocol_get;
        handle->devm_protocol_put = scmi_devm_protocol_put;
 
@@ -2401,6 +2650,7 @@ static int __init scmi_driver_init(void)
        scmi_sensors_register();
        scmi_voltage_register();
        scmi_system_register();
+       scmi_powercap_register();
 
        return platform_driver_register(&scmi_driver);
 }
@@ -2417,6 +2667,7 @@ static void __exit scmi_driver_exit(void)
        scmi_sensors_unregister();
        scmi_voltage_unregister();
        scmi_system_unregister();
+       scmi_powercap_unregister();
 
        scmi_bus_exit();
 
index bbb0331801ff49274d23f2ea61d582f4f0dbdf7b..64ea2d2f2875e5d95ec60d3c4484ce7518b14c27 100644 (file)
 #include <linux/bits.h>
 #include <linux/of.h>
 #include <linux/io.h>
-#include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
 #include <linux/scmi_protocol.h>
 #include <linux/sort.h>
 
+#include <trace/events/scmi.h>
+
 #include "protocols.h"
 #include "notify.h"
 
@@ -35,6 +36,12 @@ enum scmi_performance_protocol_cmd {
        PERF_DOMAIN_NAME_GET = 0xc,
 };
 
+enum {
+       PERF_FC_LEVEL,
+       PERF_FC_LIMIT,
+       PERF_FC_MAX,
+};
+
 struct scmi_opp {
        u32 perf;
        u32 power;
@@ -115,43 +122,6 @@ struct scmi_msg_resp_perf_describe_levels {
        } opp[];
 };
 
-struct scmi_perf_get_fc_info {
-       __le32 domain;
-       __le32 message_id;
-};
-
-struct scmi_msg_resp_perf_desc_fc {
-       __le32 attr;
-#define SUPPORTS_DOORBELL(x)           ((x) & BIT(0))
-#define DOORBELL_REG_WIDTH(x)          FIELD_GET(GENMASK(2, 1), (x))
-       __le32 rate_limit;
-       __le32 chan_addr_low;
-       __le32 chan_addr_high;
-       __le32 chan_size;
-       __le32 db_addr_low;
-       __le32 db_addr_high;
-       __le32 db_set_lmask;
-       __le32 db_set_hmask;
-       __le32 db_preserve_lmask;
-       __le32 db_preserve_hmask;
-};
-
-struct scmi_fc_db_info {
-       int width;
-       u64 set;
-       u64 mask;
-       void __iomem *addr;
-};
-
-struct scmi_fc_info {
-       void __iomem *level_set_addr;
-       void __iomem *limit_set_addr;
-       void __iomem *level_get_addr;
-       void __iomem *limit_get_addr;
-       struct scmi_fc_db_info *level_set_db;
-       struct scmi_fc_db_info *limit_set_db;
-};
-
 struct perf_dom_info {
        bool set_limits;
        bool set_perf;
@@ -360,40 +330,6 @@ scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph, u32 domain,
        return ret;
 }
 
-#define SCMI_PERF_FC_RING_DB(w)                                \
-do {                                                   \
-       u##w val = 0;                                   \
-                                                       \
-       if (db->mask)                                   \
-               val = ioread##w(db->addr) & db->mask;   \
-       iowrite##w((u##w)db->set | val, db->addr);      \
-} while (0)
-
-static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db)
-{
-       if (!db || !db->addr)
-               return;
-
-       if (db->width == 1)
-               SCMI_PERF_FC_RING_DB(8);
-       else if (db->width == 2)
-               SCMI_PERF_FC_RING_DB(16);
-       else if (db->width == 4)
-               SCMI_PERF_FC_RING_DB(32);
-       else /* db->width == 8 */
-#ifdef CONFIG_64BIT
-               SCMI_PERF_FC_RING_DB(64);
-#else
-       {
-               u64 val = 0;
-
-               if (db->mask)
-                       val = ioread64_hi_lo(db->addr) & db->mask;
-               iowrite64_hi_lo(db->set | val, db->addr);
-       }
-#endif
-}
-
 static int scmi_perf_mb_limits_set(const struct scmi_protocol_handle *ph,
                                   u32 domain, u32 max_perf, u32 min_perf)
 {
@@ -426,10 +362,14 @@ static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph,
        if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3 && !max_perf && !min_perf)
                return -EINVAL;
 
-       if (dom->fc_info && dom->fc_info->limit_set_addr) {
-               iowrite32(max_perf, dom->fc_info->limit_set_addr);
-               iowrite32(min_perf, dom->fc_info->limit_set_addr + 4);
-               scmi_perf_fc_ring_db(dom->fc_info->limit_set_db);
+       if (dom->fc_info && dom->fc_info[PERF_FC_LIMIT].set_addr) {
+               struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LIMIT];
+
+               trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LIMITS_SET,
+                                  domain, min_perf, max_perf);
+               iowrite32(max_perf, fci->set_addr);
+               iowrite32(min_perf, fci->set_addr + 4);
+               ph->hops->fastchannel_db_ring(fci->set_db);
                return 0;
        }
 
@@ -468,9 +408,13 @@ static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
        struct scmi_perf_info *pi = ph->get_priv(ph);
        struct perf_dom_info *dom = pi->dom_info + domain;
 
-       if (dom->fc_info && dom->fc_info->limit_get_addr) {
-               *max_perf = ioread32(dom->fc_info->limit_get_addr);
-               *min_perf = ioread32(dom->fc_info->limit_get_addr + 4);
+       if (dom->fc_info && dom->fc_info[PERF_FC_LIMIT].get_addr) {
+               struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LIMIT];
+
+               *max_perf = ioread32(fci->get_addr);
+               *min_perf = ioread32(fci->get_addr + 4);
+               trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LIMITS_GET,
+                                  domain, *min_perf, *max_perf);
                return 0;
        }
 
@@ -505,9 +449,13 @@ static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,
        struct scmi_perf_info *pi = ph->get_priv(ph);
        struct perf_dom_info *dom = pi->dom_info + domain;
 
-       if (dom->fc_info && dom->fc_info->level_set_addr) {
-               iowrite32(level, dom->fc_info->level_set_addr);
-               scmi_perf_fc_ring_db(dom->fc_info->level_set_db);
+       if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr) {
+               struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LEVEL];
+
+               trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LEVEL_SET,
+                                  domain, level, 0);
+               iowrite32(level, fci->set_addr);
+               ph->hops->fastchannel_db_ring(fci->set_db);
                return 0;
        }
 
@@ -542,8 +490,10 @@ static int scmi_perf_level_get(const struct scmi_protocol_handle *ph,
        struct scmi_perf_info *pi = ph->get_priv(ph);
        struct perf_dom_info *dom = pi->dom_info + domain;
 
-       if (dom->fc_info && dom->fc_info->level_get_addr) {
-               *level = ioread32(dom->fc_info->level_get_addr);
+       if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].get_addr) {
+               *level = ioread32(dom->fc_info[PERF_FC_LEVEL].get_addr);
+               trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LEVEL_GET,
+                                  domain, *level, 0);
                return 0;
        }
 
@@ -572,100 +522,33 @@ static int scmi_perf_level_limits_notify(const struct scmi_protocol_handle *ph,
        return ret;
 }
 
-static bool scmi_perf_fc_size_is_valid(u32 msg, u32 size)
-{
-       if ((msg == PERF_LEVEL_GET || msg == PERF_LEVEL_SET) && size == 4)
-               return true;
-       if ((msg == PERF_LIMITS_GET || msg == PERF_LIMITS_SET) && size == 8)
-               return true;
-       return false;
-}
-
-static void
-scmi_perf_domain_desc_fc(const struct scmi_protocol_handle *ph, u32 domain,
-                        u32 message_id, void __iomem **p_addr,
-                        struct scmi_fc_db_info **p_db)
-{
-       int ret;
-       u32 flags;
-       u64 phys_addr;
-       u8 size;
-       void __iomem *addr;
-       struct scmi_xfer *t;
-       struct scmi_fc_db_info *db;
-       struct scmi_perf_get_fc_info *info;
-       struct scmi_msg_resp_perf_desc_fc *resp;
-
-       if (!p_addr)
-               return;
-
-       ret = ph->xops->xfer_get_init(ph, PERF_DESCRIBE_FASTCHANNEL,
-                                     sizeof(*info), sizeof(*resp), &t);
-       if (ret)
-               return;
-
-       info = t->tx.buf;
-       info->domain = cpu_to_le32(domain);
-       info->message_id = cpu_to_le32(message_id);
-
-       ret = ph->xops->do_xfer(ph, t);
-       if (ret)
-               goto err_xfer;
-
-       resp = t->rx.buf;
-       flags = le32_to_cpu(resp->attr);
-       size = le32_to_cpu(resp->chan_size);
-       if (!scmi_perf_fc_size_is_valid(message_id, size))
-               goto err_xfer;
-
-       phys_addr = le32_to_cpu(resp->chan_addr_low);
-       phys_addr |= (u64)le32_to_cpu(resp->chan_addr_high) << 32;
-       addr = devm_ioremap(ph->dev, phys_addr, size);
-       if (!addr)
-               goto err_xfer;
-       *p_addr = addr;
-
-       if (p_db && SUPPORTS_DOORBELL(flags)) {
-               db = devm_kzalloc(ph->dev, sizeof(*db), GFP_KERNEL);
-               if (!db)
-                       goto err_xfer;
-
-               size = 1 << DOORBELL_REG_WIDTH(flags);
-               phys_addr = le32_to_cpu(resp->db_addr_low);
-               phys_addr |= (u64)le32_to_cpu(resp->db_addr_high) << 32;
-               addr = devm_ioremap(ph->dev, phys_addr, size);
-               if (!addr)
-                       goto err_xfer;
-
-               db->addr = addr;
-               db->width = size;
-               db->set = le32_to_cpu(resp->db_set_lmask);
-               db->set |= (u64)le32_to_cpu(resp->db_set_hmask) << 32;
-               db->mask = le32_to_cpu(resp->db_preserve_lmask);
-               db->mask |= (u64)le32_to_cpu(resp->db_preserve_hmask) << 32;
-               *p_db = db;
-       }
-err_xfer:
-       ph->xops->xfer_put(ph, t);
-}
-
 static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
                                     u32 domain, struct scmi_fc_info **p_fc)
 {
        struct scmi_fc_info *fc;
 
-       fc = devm_kzalloc(ph->dev, sizeof(*fc), GFP_KERNEL);
+       fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL);
        if (!fc)
                return;
 
-       scmi_perf_domain_desc_fc(ph, domain, PERF_LEVEL_SET,
-                                &fc->level_set_addr, &fc->level_set_db);
-       scmi_perf_domain_desc_fc(ph, domain, PERF_LEVEL_GET,
-                                &fc->level_get_addr, NULL);
-       scmi_perf_domain_desc_fc(ph, domain, PERF_LIMITS_SET,
-                                &fc->limit_set_addr, &fc->limit_set_db);
-       scmi_perf_domain_desc_fc(ph, domain, PERF_LIMITS_GET,
-                                &fc->limit_get_addr, NULL);
+       ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
+                                  PERF_LEVEL_SET, 4, domain,
+                                  &fc[PERF_FC_LEVEL].set_addr,
+                                  &fc[PERF_FC_LEVEL].set_db);
+
+       ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
+                                  PERF_LEVEL_GET, 4, domain,
+                                  &fc[PERF_FC_LEVEL].get_addr, NULL);
+
+       ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
+                                  PERF_LIMITS_SET, 8, domain,
+                                  &fc[PERF_FC_LIMIT].set_addr,
+                                  &fc[PERF_FC_LIMIT].set_db);
+
+       ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
+                                  PERF_LIMITS_GET, 8, domain,
+                                  &fc[PERF_FC_LIMIT].get_addr, NULL);
+
        *p_fc = fc;
 }
 
@@ -789,7 +672,7 @@ static bool scmi_fast_switch_possible(const struct scmi_protocol_handle *ph,
 
        dom = pi->dom_info + scmi_dev_domain_id(dev);
 
-       return dom->fc_info && dom->fc_info->level_set_addr;
+       return dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr;
 }
 
 static bool scmi_power_scale_mw_get(const struct scmi_protocol_handle *ph)
diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c
new file mode 100644 (file)
index 0000000..83b90bd
--- /dev/null
@@ -0,0 +1,866 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * System Control and Management Interface (SCMI) Powercap Protocol
+ *
+ * Copyright (C) 2022 ARM Ltd.
+ */
+
+#define pr_fmt(fmt) "SCMI Notifications POWERCAP - " fmt
+
+#include <linux/bitfield.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/scmi_protocol.h>
+
+#include <trace/events/scmi.h>
+
+#include "protocols.h"
+#include "notify.h"
+
+enum scmi_powercap_protocol_cmd {
+       POWERCAP_DOMAIN_ATTRIBUTES = 0x3,
+       POWERCAP_CAP_GET = 0x4,
+       POWERCAP_CAP_SET = 0x5,
+       POWERCAP_PAI_GET = 0x6,
+       POWERCAP_PAI_SET = 0x7,
+       POWERCAP_DOMAIN_NAME_GET = 0x8,
+       POWERCAP_MEASUREMENTS_GET = 0x9,
+       POWERCAP_CAP_NOTIFY = 0xa,
+       POWERCAP_MEASUREMENTS_NOTIFY = 0xb,
+       POWERCAP_DESCRIBE_FASTCHANNEL = 0xc,
+};
+
+enum {
+       POWERCAP_FC_CAP,
+       POWERCAP_FC_PAI,
+       POWERCAP_FC_MAX,
+};
+
+struct scmi_msg_resp_powercap_domain_attributes {
+       __le32 attributes;
+#define SUPPORTS_POWERCAP_CAP_CHANGE_NOTIFY(x)         ((x) & BIT(31))
+#define SUPPORTS_POWERCAP_MEASUREMENTS_CHANGE_NOTIFY(x)        ((x) & BIT(30))
+#define SUPPORTS_ASYNC_POWERCAP_CAP_SET(x)             ((x) & BIT(29))
+#define SUPPORTS_EXTENDED_NAMES(x)                     ((x) & BIT(28))
+#define SUPPORTS_POWERCAP_CAP_CONFIGURATION(x)         ((x) & BIT(27))
+#define SUPPORTS_POWERCAP_MONITORING(x)                        ((x) & BIT(26))
+#define SUPPORTS_POWERCAP_PAI_CONFIGURATION(x)         ((x) & BIT(25))
+#define SUPPORTS_POWERCAP_FASTCHANNELS(x)              ((x) & BIT(22))
+#define POWERCAP_POWER_UNIT(x)                         \
+               (FIELD_GET(GENMASK(24, 23), (x)))
+#define        SUPPORTS_POWER_UNITS_MW(x)                      \
+               (POWERCAP_POWER_UNIT(x) == 0x2)
+#define        SUPPORTS_POWER_UNITS_UW(x)                      \
+               (POWERCAP_POWER_UNIT(x) == 0x1)
+       u8 name[SCMI_SHORT_NAME_MAX_SIZE];
+       __le32 min_pai;
+       __le32 max_pai;
+       __le32 pai_step;
+       __le32 min_power_cap;
+       __le32 max_power_cap;
+       __le32 power_cap_step;
+       __le32 sustainable_power;
+       __le32 accuracy;
+       __le32 parent_id;
+};
+
+struct scmi_msg_powercap_set_cap_or_pai {
+       __le32 domain;
+       __le32 flags;
+#define CAP_SET_ASYNC          BIT(1)
+#define CAP_SET_IGNORE_DRESP   BIT(0)
+       __le32 value;
+};
+
+struct scmi_msg_resp_powercap_cap_set_complete {
+       __le32 domain;
+       __le32 power_cap;
+};
+
+struct scmi_msg_resp_powercap_meas_get {
+       __le32 power;
+       __le32 pai;
+};
+
+struct scmi_msg_powercap_notify_cap {
+       __le32 domain;
+       __le32 notify_enable;
+};
+
+struct scmi_msg_powercap_notify_thresh {
+       __le32 domain;
+       __le32 notify_enable;
+       __le32 power_thresh_low;
+       __le32 power_thresh_high;
+};
+
+struct scmi_powercap_cap_changed_notify_payld {
+       __le32 agent_id;
+       __le32 domain_id;
+       __le32 power_cap;
+       __le32 pai;
+};
+
+struct scmi_powercap_meas_changed_notify_payld {
+       __le32 agent_id;
+       __le32 domain_id;
+       __le32 power;
+};
+
+struct scmi_powercap_state {
+       bool meas_notif_enabled;
+       u64 thresholds;
+#define THRESH_LOW(p, id)                              \
+       (lower_32_bits((p)->states[(id)].thresholds))
+#define THRESH_HIGH(p, id)                             \
+       (upper_32_bits((p)->states[(id)].thresholds))
+};
+
+struct powercap_info {
+       u32 version;
+       int num_domains;
+       struct scmi_powercap_state *states;
+       struct scmi_powercap_info *powercaps;
+};
+
+static enum scmi_powercap_protocol_cmd evt_2_cmd[] = {
+       POWERCAP_CAP_NOTIFY,
+       POWERCAP_MEASUREMENTS_NOTIFY,
+};
+
+static int scmi_powercap_notify(const struct scmi_protocol_handle *ph,
+                               u32 domain, int message_id, bool enable);
+
+static int
+scmi_powercap_attributes_get(const struct scmi_protocol_handle *ph,
+                            struct powercap_info *pi)
+{
+       int ret;
+       struct scmi_xfer *t;
+
+       ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0,
+                                     sizeof(u32), &t);
+       if (ret)
+               return ret;
+
+       ret = ph->xops->do_xfer(ph, t);
+       if (!ret) {
+               u32 attributes;
+
+               attributes = get_unaligned_le32(t->rx.buf);
+               pi->num_domains = FIELD_GET(GENMASK(15, 0), attributes);
+       }
+
+       ph->xops->xfer_put(ph, t);
+       return ret;
+}
+
+static inline int
+scmi_powercap_validate(unsigned int min_val, unsigned int max_val,
+                      unsigned int step_val, bool configurable)
+{
+       if (!min_val || !max_val)
+               return -EPROTO;
+
+       if ((configurable && min_val == max_val) ||
+           (!configurable && min_val != max_val))
+               return -EPROTO;
+
+       if (min_val != max_val && !step_val)
+               return -EPROTO;
+
+       return 0;
+}
+
+static int
+scmi_powercap_domain_attributes_get(const struct scmi_protocol_handle *ph,
+                                   struct powercap_info *pinfo, u32 domain)
+{
+       int ret;
+       u32 flags;
+       struct scmi_xfer *t;
+       struct scmi_powercap_info *dom_info = pinfo->powercaps + domain;
+       struct scmi_msg_resp_powercap_domain_attributes *resp;
+
+       ret = ph->xops->xfer_get_init(ph, POWERCAP_DOMAIN_ATTRIBUTES,
+                                     sizeof(domain), sizeof(*resp), &t);
+       if (ret)
+               return ret;
+
+       put_unaligned_le32(domain, t->tx.buf);
+       resp = t->rx.buf;
+
+       ret = ph->xops->do_xfer(ph, t);
+       if (!ret) {
+               flags = le32_to_cpu(resp->attributes);
+
+               dom_info->id = domain;
+               dom_info->notify_powercap_cap_change =
+                       SUPPORTS_POWERCAP_CAP_CHANGE_NOTIFY(flags);
+               dom_info->notify_powercap_measurement_change =
+                       SUPPORTS_POWERCAP_MEASUREMENTS_CHANGE_NOTIFY(flags);
+               dom_info->async_powercap_cap_set =
+                       SUPPORTS_ASYNC_POWERCAP_CAP_SET(flags);
+               dom_info->powercap_cap_config =
+                       SUPPORTS_POWERCAP_CAP_CONFIGURATION(flags);
+               dom_info->powercap_monitoring =
+                       SUPPORTS_POWERCAP_MONITORING(flags);
+               dom_info->powercap_pai_config =
+                       SUPPORTS_POWERCAP_PAI_CONFIGURATION(flags);
+               dom_info->powercap_scale_mw =
+                       SUPPORTS_POWER_UNITS_MW(flags);
+               dom_info->powercap_scale_uw =
+                       SUPPORTS_POWER_UNITS_UW(flags);
+               dom_info->fastchannels =
+                       SUPPORTS_POWERCAP_FASTCHANNELS(flags);
+
+               strscpy(dom_info->name, resp->name, SCMI_SHORT_NAME_MAX_SIZE);
+
+               dom_info->min_pai = le32_to_cpu(resp->min_pai);
+               dom_info->max_pai = le32_to_cpu(resp->max_pai);
+               dom_info->pai_step = le32_to_cpu(resp->pai_step);
+               ret = scmi_powercap_validate(dom_info->min_pai,
+                                            dom_info->max_pai,
+                                            dom_info->pai_step,
+                                            dom_info->powercap_pai_config);
+               if (ret) {
+                       dev_err(ph->dev,
+                               "Platform reported inconsistent PAI config for domain %d - %s\n",
+                               dom_info->id, dom_info->name);
+                       goto clean;
+               }
+
+               dom_info->min_power_cap = le32_to_cpu(resp->min_power_cap);
+               dom_info->max_power_cap = le32_to_cpu(resp->max_power_cap);
+               dom_info->power_cap_step = le32_to_cpu(resp->power_cap_step);
+               ret = scmi_powercap_validate(dom_info->min_power_cap,
+                                            dom_info->max_power_cap,
+                                            dom_info->power_cap_step,
+                                            dom_info->powercap_cap_config);
+               if (ret) {
+                       dev_err(ph->dev,
+                               "Platform reported inconsistent CAP config for domain %d - %s\n",
+                               dom_info->id, dom_info->name);
+                       goto clean;
+               }
+
+               dom_info->sustainable_power =
+                       le32_to_cpu(resp->sustainable_power);
+               dom_info->accuracy = le32_to_cpu(resp->accuracy);
+
+               dom_info->parent_id = le32_to_cpu(resp->parent_id);
+               if (dom_info->parent_id != SCMI_POWERCAP_ROOT_ZONE_ID &&
+                   (dom_info->parent_id >= pinfo->num_domains ||
+                    dom_info->parent_id == dom_info->id)) {
+                       dev_err(ph->dev,
+                               "Platform reported inconsistent parent ID for domain %d - %s\n",
+                               dom_info->id, dom_info->name);
+                       ret = -ENODEV;
+               }
+       }
+
+clean:
+       ph->xops->xfer_put(ph, t);
+
+       /*
+        * If supported overwrite short name with the extended one;
+        * on error just carry on and use already provided short name.
+        */
+       if (!ret && SUPPORTS_EXTENDED_NAMES(flags))
+               ph->hops->extended_name_get(ph, POWERCAP_DOMAIN_NAME_GET,
+                                           domain, dom_info->name,
+                                           SCMI_MAX_STR_SIZE);
+
+       return ret;
+}
+
+static int scmi_powercap_num_domains_get(const struct scmi_protocol_handle *ph)
+{
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       return pi->num_domains;
+}
+
+static const struct scmi_powercap_info *
+scmi_powercap_dom_info_get(const struct scmi_protocol_handle *ph, u32 domain_id)
+{
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (domain_id >= pi->num_domains)
+               return NULL;
+
+       return pi->powercaps + domain_id;
+}
+
+static int scmi_powercap_xfer_cap_get(const struct scmi_protocol_handle *ph,
+                                     u32 domain_id, u32 *power_cap)
+{
+       int ret;
+       struct scmi_xfer *t;
+
+       ret = ph->xops->xfer_get_init(ph, POWERCAP_CAP_GET, sizeof(u32),
+                                     sizeof(u32), &t);
+       if (ret)
+               return ret;
+
+       put_unaligned_le32(domain_id, t->tx.buf);
+       ret = ph->xops->do_xfer(ph, t);
+       if (!ret)
+               *power_cap = get_unaligned_le32(t->rx.buf);
+
+       ph->xops->xfer_put(ph, t);
+
+       return ret;
+}
+
+static int scmi_powercap_cap_get(const struct scmi_protocol_handle *ph,
+                                u32 domain_id, u32 *power_cap)
+{
+       struct scmi_powercap_info *dom;
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (!power_cap || domain_id >= pi->num_domains)
+               return -EINVAL;
+
+       dom = pi->powercaps + domain_id;
+       if (dom->fc_info && dom->fc_info[POWERCAP_FC_CAP].get_addr) {
+               *power_cap = ioread32(dom->fc_info[POWERCAP_FC_CAP].get_addr);
+               trace_scmi_fc_call(SCMI_PROTOCOL_POWERCAP, POWERCAP_CAP_GET,
+                                  domain_id, *power_cap, 0);
+               return 0;
+       }
+
+       return scmi_powercap_xfer_cap_get(ph, domain_id, power_cap);
+}
+
+static int scmi_powercap_xfer_cap_set(const struct scmi_protocol_handle *ph,
+                                     const struct scmi_powercap_info *pc,
+                                     u32 power_cap, bool ignore_dresp)
+{
+       int ret;
+       struct scmi_xfer *t;
+       struct scmi_msg_powercap_set_cap_or_pai *msg;
+
+       ret = ph->xops->xfer_get_init(ph, POWERCAP_CAP_SET,
+                                     sizeof(*msg), 0, &t);
+       if (ret)
+               return ret;
+
+       msg = t->tx.buf;
+       msg->domain = cpu_to_le32(pc->id);
+       msg->flags =
+               cpu_to_le32(FIELD_PREP(CAP_SET_ASYNC, !!pc->async_powercap_cap_set) |
+                           FIELD_PREP(CAP_SET_IGNORE_DRESP, !!ignore_dresp));
+       msg->value = cpu_to_le32(power_cap);
+
+       if (!pc->async_powercap_cap_set || ignore_dresp) {
+               ret = ph->xops->do_xfer(ph, t);
+       } else {
+               ret = ph->xops->do_xfer_with_response(ph, t);
+               if (!ret) {
+                       struct scmi_msg_resp_powercap_cap_set_complete *resp;
+
+                       resp = t->rx.buf;
+                       if (le32_to_cpu(resp->domain) == pc->id)
+                               dev_dbg(ph->dev,
+                                       "Powercap ID %d CAP set async to %u\n",
+                                       pc->id,
+                                       get_unaligned_le32(&resp->power_cap));
+                       else
+                               ret = -EPROTO;
+               }
+       }
+
+       ph->xops->xfer_put(ph, t);
+       return ret;
+}
+
+static int scmi_powercap_cap_set(const struct scmi_protocol_handle *ph,
+                                u32 domain_id, u32 power_cap,
+                                bool ignore_dresp)
+{
+       const struct scmi_powercap_info *pc;
+
+       pc = scmi_powercap_dom_info_get(ph, domain_id);
+       if (!pc || !pc->powercap_cap_config || !power_cap ||
+           power_cap < pc->min_power_cap ||
+           power_cap > pc->max_power_cap)
+               return -EINVAL;
+
+       if (pc->fc_info && pc->fc_info[POWERCAP_FC_CAP].set_addr) {
+               struct scmi_fc_info *fci = &pc->fc_info[POWERCAP_FC_CAP];
+
+               iowrite32(power_cap, fci->set_addr);
+               ph->hops->fastchannel_db_ring(fci->set_db);
+               trace_scmi_fc_call(SCMI_PROTOCOL_POWERCAP, POWERCAP_CAP_SET,
+                                  domain_id, power_cap, 0);
+               return 0;
+       }
+
+       return scmi_powercap_xfer_cap_set(ph, pc, power_cap, ignore_dresp);
+}
+
+static int scmi_powercap_xfer_pai_get(const struct scmi_protocol_handle *ph,
+                                     u32 domain_id, u32 *pai)
+{
+       int ret;
+       struct scmi_xfer *t;
+
+       ret = ph->xops->xfer_get_init(ph, POWERCAP_PAI_GET, sizeof(u32),
+                                     sizeof(u32), &t);
+       if (ret)
+               return ret;
+
+       put_unaligned_le32(domain_id, t->tx.buf);
+       ret = ph->xops->do_xfer(ph, t);
+       if (!ret)
+               *pai = get_unaligned_le32(t->rx.buf);
+
+       ph->xops->xfer_put(ph, t);
+
+       return ret;
+}
+
+static int scmi_powercap_pai_get(const struct scmi_protocol_handle *ph,
+                                u32 domain_id, u32 *pai)
+{
+       struct scmi_powercap_info *dom;
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (!pai || domain_id >= pi->num_domains)
+               return -EINVAL;
+
+       dom = pi->powercaps + domain_id;
+       if (dom->fc_info && dom->fc_info[POWERCAP_FC_PAI].get_addr) {
+               *pai = ioread32(dom->fc_info[POWERCAP_FC_PAI].get_addr);
+               trace_scmi_fc_call(SCMI_PROTOCOL_POWERCAP, POWERCAP_PAI_GET,
+                                  domain_id, *pai, 0);
+               return 0;
+       }
+
+       return scmi_powercap_xfer_pai_get(ph, domain_id, pai);
+}
+
+static int scmi_powercap_xfer_pai_set(const struct scmi_protocol_handle *ph,
+                                     u32 domain_id, u32 pai)
+{
+       int ret;
+       struct scmi_xfer *t;
+       struct scmi_msg_powercap_set_cap_or_pai *msg;
+
+       ret = ph->xops->xfer_get_init(ph, POWERCAP_PAI_SET,
+                                     sizeof(*msg), 0, &t);
+       if (ret)
+               return ret;
+
+       msg = t->tx.buf;
+       msg->domain = cpu_to_le32(domain_id);
+       msg->flags = cpu_to_le32(0);
+       msg->value = cpu_to_le32(pai);
+
+       ret = ph->xops->do_xfer(ph, t);
+
+       ph->xops->xfer_put(ph, t);
+       return ret;
+}
+
+static int scmi_powercap_pai_set(const struct scmi_protocol_handle *ph,
+                                u32 domain_id, u32 pai)
+{
+       const struct scmi_powercap_info *pc;
+
+       pc = scmi_powercap_dom_info_get(ph, domain_id);
+       if (!pc || !pc->powercap_pai_config || !pai ||
+           pai < pc->min_pai || pai > pc->max_pai)
+               return -EINVAL;
+
+       if (pc->fc_info && pc->fc_info[POWERCAP_FC_PAI].set_addr) {
+               struct scmi_fc_info *fci = &pc->fc_info[POWERCAP_FC_PAI];
+
+               trace_scmi_fc_call(SCMI_PROTOCOL_POWERCAP, POWERCAP_PAI_SET,
+                                  domain_id, pai, 0);
+               iowrite32(pai, fci->set_addr);
+               ph->hops->fastchannel_db_ring(fci->set_db);
+               return 0;
+       }
+
+       return scmi_powercap_xfer_pai_set(ph, domain_id, pai);
+}
+
+static int scmi_powercap_measurements_get(const struct scmi_protocol_handle *ph,
+                                         u32 domain_id, u32 *average_power,
+                                         u32 *pai)
+{
+       int ret;
+       struct scmi_xfer *t;
+       struct scmi_msg_resp_powercap_meas_get *resp;
+       const struct scmi_powercap_info *pc;
+
+       pc = scmi_powercap_dom_info_get(ph, domain_id);
+       if (!pc || !pc->powercap_monitoring || !pai || !average_power)
+               return -EINVAL;
+
+       ret = ph->xops->xfer_get_init(ph, POWERCAP_MEASUREMENTS_GET,
+                                     sizeof(u32), sizeof(*resp), &t);
+       if (ret)
+               return ret;
+
+       resp = t->rx.buf;
+       put_unaligned_le32(domain_id, t->tx.buf);
+       ret = ph->xops->do_xfer(ph, t);
+       if (!ret) {
+               *average_power = le32_to_cpu(resp->power);
+               *pai = le32_to_cpu(resp->pai);
+       }
+
+       ph->xops->xfer_put(ph, t);
+       return ret;
+}
+
+static int
+scmi_powercap_measurements_threshold_get(const struct scmi_protocol_handle *ph,
+                                        u32 domain_id, u32 *power_thresh_low,
+                                        u32 *power_thresh_high)
+{
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (!power_thresh_low || !power_thresh_high ||
+           domain_id >= pi->num_domains)
+               return -EINVAL;
+
+       *power_thresh_low =  THRESH_LOW(pi, domain_id);
+       *power_thresh_high = THRESH_HIGH(pi, domain_id);
+
+       return 0;
+}
+
+static int
+scmi_powercap_measurements_threshold_set(const struct scmi_protocol_handle *ph,
+                                        u32 domain_id, u32 power_thresh_low,
+                                        u32 power_thresh_high)
+{
+       int ret = 0;
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (domain_id >= pi->num_domains ||
+           power_thresh_low > power_thresh_high)
+               return -EINVAL;
+
+       /* Anything to do ? */
+       if (THRESH_LOW(pi, domain_id) == power_thresh_low &&
+           THRESH_HIGH(pi, domain_id) == power_thresh_high)
+               return ret;
+
+       pi->states[domain_id].thresholds =
+               (FIELD_PREP(GENMASK_ULL(31, 0), power_thresh_low) |
+                FIELD_PREP(GENMASK_ULL(63, 32), power_thresh_high));
+
+       /* Update thresholds if notification already enabled */
+       if (pi->states[domain_id].meas_notif_enabled)
+               ret = scmi_powercap_notify(ph, domain_id,
+                                          POWERCAP_MEASUREMENTS_NOTIFY,
+                                          true);
+
+       return ret;
+}
+
+static const struct scmi_powercap_proto_ops powercap_proto_ops = {
+       .num_domains_get = scmi_powercap_num_domains_get,
+       .info_get = scmi_powercap_dom_info_get,
+       .cap_get = scmi_powercap_cap_get,
+       .cap_set = scmi_powercap_cap_set,
+       .pai_get = scmi_powercap_pai_get,
+       .pai_set = scmi_powercap_pai_set,
+       .measurements_get = scmi_powercap_measurements_get,
+       .measurements_threshold_set = scmi_powercap_measurements_threshold_set,
+       .measurements_threshold_get = scmi_powercap_measurements_threshold_get,
+};
+
+static void scmi_powercap_domain_init_fc(const struct scmi_protocol_handle *ph,
+                                        u32 domain, struct scmi_fc_info **p_fc)
+{
+       struct scmi_fc_info *fc;
+
+       fc = devm_kcalloc(ph->dev, POWERCAP_FC_MAX, sizeof(*fc), GFP_KERNEL);
+       if (!fc)
+               return;
+
+       ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
+                                  POWERCAP_CAP_SET, 4, domain,
+                                  &fc[POWERCAP_FC_CAP].set_addr,
+                                  &fc[POWERCAP_FC_CAP].set_db);
+
+       ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
+                                  POWERCAP_CAP_GET, 4, domain,
+                                  &fc[POWERCAP_FC_CAP].get_addr, NULL);
+
+       ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
+                                  POWERCAP_PAI_SET, 4, domain,
+                                  &fc[POWERCAP_FC_PAI].set_addr,
+                                  &fc[POWERCAP_FC_PAI].set_db);
+
+       ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL,
+                                  POWERCAP_PAI_GET, 4, domain,
+                                  &fc[POWERCAP_FC_PAI].get_addr, NULL);
+
+       *p_fc = fc;
+}
+
+static int scmi_powercap_notify(const struct scmi_protocol_handle *ph,
+                               u32 domain, int message_id, bool enable)
+{
+       int ret;
+       struct scmi_xfer *t;
+
+       switch (message_id) {
+       case POWERCAP_CAP_NOTIFY:
+       {
+               struct scmi_msg_powercap_notify_cap *notify;
+
+               ret = ph->xops->xfer_get_init(ph, message_id,
+                                             sizeof(*notify), 0, &t);
+               if (ret)
+                       return ret;
+
+               notify = t->tx.buf;
+               notify->domain = cpu_to_le32(domain);
+               notify->notify_enable = cpu_to_le32(enable ? BIT(0) : 0);
+               break;
+       }
+       case POWERCAP_MEASUREMENTS_NOTIFY:
+       {
+               u32 low, high;
+               struct scmi_msg_powercap_notify_thresh *notify;
+
+               /*
+                * Note that we have to pick the most recently configured
+                * thresholds to build a proper POWERCAP_MEASUREMENTS_NOTIFY
+                * enable request and we fail, complaining, if no thresholds
+                * were ever set, since this is an indication the API has been
+                * used wrongly.
+                */
+               ret = scmi_powercap_measurements_threshold_get(ph, domain,
+                                                              &low, &high);
+               if (ret)
+                       return ret;
+
+               if (enable && !low && !high) {
+                       dev_err(ph->dev,
+                               "Invalid Measurements Notify thresholds: %u/%u\n",
+                               low, high);
+                       return -EINVAL;
+               }
+
+               ret = ph->xops->xfer_get_init(ph, message_id,
+                                             sizeof(*notify), 0, &t);
+               if (ret)
+                       return ret;
+
+               notify = t->tx.buf;
+               notify->domain = cpu_to_le32(domain);
+               notify->notify_enable = cpu_to_le32(enable ? BIT(0) : 0);
+               notify->power_thresh_low = cpu_to_le32(low);
+               notify->power_thresh_high = cpu_to_le32(high);
+               break;
+       }
+       default:
+               return -EINVAL;
+       }
+
+       ret = ph->xops->do_xfer(ph, t);
+
+       ph->xops->xfer_put(ph, t);
+       return ret;
+}
+
+static int
+scmi_powercap_set_notify_enabled(const struct scmi_protocol_handle *ph,
+                                u8 evt_id, u32 src_id, bool enable)
+{
+       int ret, cmd_id;
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (evt_id >= ARRAY_SIZE(evt_2_cmd) || src_id >= pi->num_domains)
+               return -EINVAL;
+
+       cmd_id = evt_2_cmd[evt_id];
+       ret = scmi_powercap_notify(ph, src_id, cmd_id, enable);
+       if (ret)
+               pr_debug("FAIL_ENABLED - evt[%X] dom[%d] - ret:%d\n",
+                        evt_id, src_id, ret);
+       else if (cmd_id == POWERCAP_MEASUREMENTS_NOTIFY)
+               /*
+                * On success save the current notification enabled state, so
+                * as to be able to properly update the notification thresholds
+                * when they are modified on a domain for which measurement
+                * notifications were currently enabled.
+                *
+                * This is needed because the SCMI Notification core machinery
+                * and API does not support passing per-notification custom
+                * arguments at callback registration time.
+                *
+                * Note that this can be done here with a simple flag since the
+                * SCMI core Notifications code takes care of keeping proper
+                * per-domain enables refcounting, so that this helper function
+                * will be called only once (for enables) when the first user
+                * registers a callback on this domain and once more (disable)
+                * when the last user de-registers its callback.
+                */
+               pi->states[src_id].meas_notif_enabled = enable;
+
+       return ret;
+}
+
+static void *
+scmi_powercap_fill_custom_report(const struct scmi_protocol_handle *ph,
+                                u8 evt_id, ktime_t timestamp,
+                                const void *payld, size_t payld_sz,
+                                void *report, u32 *src_id)
+{
+       void *rep = NULL;
+
+       switch (evt_id) {
+       case SCMI_EVENT_POWERCAP_CAP_CHANGED:
+       {
+               const struct scmi_powercap_cap_changed_notify_payld *p = payld;
+               struct scmi_powercap_cap_changed_report *r = report;
+
+               if (sizeof(*p) != payld_sz)
+                       break;
+
+               r->timestamp = timestamp;
+               r->agent_id = le32_to_cpu(p->agent_id);
+               r->domain_id = le32_to_cpu(p->domain_id);
+               r->power_cap = le32_to_cpu(p->power_cap);
+               r->pai = le32_to_cpu(p->pai);
+               *src_id = r->domain_id;
+               rep = r;
+               break;
+       }
+       case SCMI_EVENT_POWERCAP_MEASUREMENTS_CHANGED:
+       {
+               const struct scmi_powercap_meas_changed_notify_payld *p = payld;
+               struct scmi_powercap_meas_changed_report *r = report;
+
+               if (sizeof(*p) != payld_sz)
+                       break;
+
+               r->timestamp = timestamp;
+               r->agent_id = le32_to_cpu(p->agent_id);
+               r->domain_id = le32_to_cpu(p->domain_id);
+               r->power = le32_to_cpu(p->power);
+               *src_id = r->domain_id;
+               rep = r;
+               break;
+       }
+       default:
+               break;
+       }
+
+       return rep;
+}
+
+static int
+scmi_powercap_get_num_sources(const struct scmi_protocol_handle *ph)
+{
+       struct powercap_info *pi = ph->get_priv(ph);
+
+       if (!pi)
+               return -EINVAL;
+
+       return pi->num_domains;
+}
+
+static const struct scmi_event powercap_events[] = {
+       {
+               .id = SCMI_EVENT_POWERCAP_CAP_CHANGED,
+               .max_payld_sz =
+                       sizeof(struct scmi_powercap_cap_changed_notify_payld),
+               .max_report_sz =
+                       sizeof(struct scmi_powercap_cap_changed_report),
+       },
+       {
+               .id = SCMI_EVENT_POWERCAP_MEASUREMENTS_CHANGED,
+               .max_payld_sz =
+                       sizeof(struct scmi_powercap_meas_changed_notify_payld),
+               .max_report_sz =
+                       sizeof(struct scmi_powercap_meas_changed_report),
+       },
+};
+
+static const struct scmi_event_ops powercap_event_ops = {
+       .get_num_sources = scmi_powercap_get_num_sources,
+       .set_notify_enabled = scmi_powercap_set_notify_enabled,
+       .fill_custom_report = scmi_powercap_fill_custom_report,
+};
+
+static const struct scmi_protocol_events powercap_protocol_events = {
+       .queue_sz = SCMI_PROTO_QUEUE_SZ,
+       .ops = &powercap_event_ops,
+       .evts = powercap_events,
+       .num_events = ARRAY_SIZE(powercap_events),
+};
+
+static int
+scmi_powercap_protocol_init(const struct scmi_protocol_handle *ph)
+{
+       int domain, ret;
+       u32 version;
+       struct powercap_info *pinfo;
+
+       ret = ph->xops->version_get(ph, &version);
+       if (ret)
+               return ret;
+
+       dev_dbg(ph->dev, "Powercap Version %d.%d\n",
+               PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version));
+
+       pinfo = devm_kzalloc(ph->dev, sizeof(*pinfo), GFP_KERNEL);
+       if (!pinfo)
+               return -ENOMEM;
+
+       ret = scmi_powercap_attributes_get(ph, pinfo);
+       if (ret)
+               return ret;
+
+       pinfo->powercaps = devm_kcalloc(ph->dev, pinfo->num_domains,
+                                       sizeof(*pinfo->powercaps),
+                                       GFP_KERNEL);
+       if (!pinfo->powercaps)
+               return -ENOMEM;
+
+       /*
+        * Note that any failure in retrieving any domain attribute leads to
+        * the whole Powercap protocol initialization failure: this way the
+        * reported Powercap domains are all assured, when accessed, to be well
+        * formed and correlated by sane parent-child relationship (if any).
+        */
+       for (domain = 0; domain < pinfo->num_domains; domain++) {
+               ret = scmi_powercap_domain_attributes_get(ph, pinfo, domain);
+               if (ret)
+                       return ret;
+
+               if (pinfo->powercaps[domain].fastchannels)
+                       scmi_powercap_domain_init_fc(ph, domain,
+                                                    &pinfo->powercaps[domain].fc_info);
+       }
+
+       pinfo->states = devm_kcalloc(ph->dev, pinfo->num_domains,
+                                    sizeof(*pinfo->states), GFP_KERNEL);
+       if (!pinfo->states)
+               return -ENOMEM;
+
+       pinfo->version = version;
+
+       return ph->set_priv(ph, pinfo);
+}
+
+static const struct scmi_protocol scmi_powercap = {
+       .id = SCMI_PROTOCOL_POWERCAP,
+       .owner = THIS_MODULE,
+       .instance_init = &scmi_powercap_protocol_init,
+       .ops = &powercap_proto_ops,
+       .events = &powercap_protocol_events,
+};
+
+DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(powercap, scmi_powercap)
index 51c31379f9b3e85bb4fae72e7dbf4c36767b9b58..2f3bf691db7c4bf891c8f8a64bcfcf7978af69a6 100644 (file)
@@ -215,6 +215,19 @@ struct scmi_iterator_ops {
                                struct scmi_iterator_state *st, void *priv);
 };
 
+struct scmi_fc_db_info {
+       int width;
+       u64 set;
+       u64 mask;
+       void __iomem *addr;
+};
+
+struct scmi_fc_info {
+       void __iomem *set_addr;
+       void __iomem *get_addr;
+       struct scmi_fc_db_info *set_db;
+};
+
 /**
  * struct scmi_proto_helpers_ops  - References to common protocol helpers
  * @extended_name_get: A common helper function to retrieve extended naming
@@ -230,6 +243,9 @@ struct scmi_iterator_ops {
  *                     provided in @ops.
  * @iter_response_run: A common helper to trigger the run of a previously
  *                    initialized iterator.
+ * @fastchannel_init: A common helper used to initialize FC descriptors by
+ *                   gathering FC descriptions from the SCMI platform server.
+ * @fastchannel_db_ring: A common helper to ring a FC doorbell.
  */
 struct scmi_proto_helpers_ops {
        int (*extended_name_get)(const struct scmi_protocol_handle *ph,
@@ -239,6 +255,12 @@ struct scmi_proto_helpers_ops {
                                    unsigned int max_resources, u8 msg_id,
                                    size_t tx_size, void *priv);
        int (*iter_response_run)(void *iter);
+       void (*fastchannel_init)(const struct scmi_protocol_handle *ph,
+                                u8 describe_id, u32 message_id,
+                                u32 valid_size, u32 domain,
+                                void __iomem **p_addr,
+                                struct scmi_fc_db_info **p_db);
+       void (*fastchannel_db_ring)(struct scmi_fc_db_info *db);
 };
 
 /**
@@ -315,5 +337,6 @@ DECLARE_SCMI_REGISTER_UNREGISTER(reset);
 DECLARE_SCMI_REGISTER_UNREGISTER(sensors);
 DECLARE_SCMI_REGISTER_UNREGISTER(voltage);
 DECLARE_SCMI_REGISTER_UNREGISTER(system);
+DECLARE_SCMI_REGISTER_UNREGISTER(powercap);
 
 #endif /* _SCMI_PROTOCOLS_H */
diff --git a/drivers/firmware/arm_scmi/scmi_power_control.c b/drivers/firmware/arm_scmi/scmi_power_control.c
new file mode 100644 (file)
index 0000000..6eb7d2a
--- /dev/null
@@ -0,0 +1,362 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SCMI Generic SystemPower Control driver.
+ *
+ * Copyright (C) 2020-2022 ARM Ltd.
+ */
+/*
+ * In order to handle platform originated SCMI SystemPower requests (like
+ * shutdowns or cold/warm resets) we register an SCMI Notification notifier
+ * block to react when such SCMI SystemPower events are emitted by platform.
+ *
+ * Once such a notification is received we act accordingly to perform the
+ * required system transition depending on the kind of request.
+ *
+ * Graceful requests are routed to userspace through the same API methods
+ * (orderly_poweroff/reboot()) used by ACPI when handling ACPI Shutdown bus
+ * events.
+ *
+ * Direct forceful requests are not supported since are not meant to be sent
+ * by the SCMI platform to an OSPM like Linux.
+ *
+ * Additionally, graceful request notifications can carry an optional timeout
+ * field stating the maximum amount of time allowed by the platform for
+ * completion after which they are converted to forceful ones: the assumption
+ * here is that even graceful requests can be upper-bound by a maximum final
+ * timeout strictly enforced by the platform itself which can ultimately cut
+ * the power off at will anytime; in order to avoid such extreme scenario, we
+ * track progress of graceful requests through the means of a reboot notifier
+ * converting timed-out graceful requests to forceful ones, so at least we
+ * try to perform a clean sync and shutdown/restart before the power is cut.
+ *
+ * Given the peculiar nature of SCMI SystemPower protocol, that is being in
+ * charge of triggering system wide shutdown/reboot events, there should be
+ * only one SCMI platform actively emitting SystemPower events.
+ * For this reason the SCMI core takes care to enforce the creation of one
+ * single unique device associated to the SCMI System Power protocol; no matter
+ * how many SCMI platforms are defined on the system, only one can be designated
+ * to support System Power: as a consequence this driver will never be probed
+ * more than once.
+ *
+ * For similar reasons as soon as the first valid SystemPower is received by
+ * this driver and the shutdown/reboot is started, any further notification
+ * possibly emitted by the platform will be ignored.
+ */
+
+#include <linux/math.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/printk.h>
+#include <linux/reboot.h>
+#include <linux/scmi_protocol.h>
+#include <linux/slab.h>
+#include <linux/time64.h>
+#include <linux/timer.h>
+#include <linux/types.h>
+#include <linux/workqueue.h>
+
+#ifndef MODULE
+#include <linux/fs.h>
+#endif
+
+enum scmi_syspower_state {
+       SCMI_SYSPOWER_IDLE,
+       SCMI_SYSPOWER_IN_PROGRESS,
+       SCMI_SYSPOWER_REBOOTING
+};
+
+/**
+ * struct scmi_syspower_conf  -  Common configuration
+ *
+ * @dev: A reference device
+ * @state: Current SystemPower state
+ * @state_mtx: @state related mutex
+ * @required_transition: The requested transition as decribed in the received
+ *                      SCMI SystemPower notification
+ * @userspace_nb: The notifier_block registered against the SCMI SystemPower
+ *               notification to start the needed userspace interactions.
+ * @reboot_nb: A notifier_block optionally used to track reboot progress
+ * @forceful_work: A worker used to trigger a forceful transition once a
+ *                graceful has timed out.
+ */
+struct scmi_syspower_conf {
+       struct device *dev;
+       enum scmi_syspower_state state;
+       /* Protect access to state */
+       struct mutex state_mtx;
+       enum scmi_system_events required_transition;
+
+       struct notifier_block userspace_nb;
+       struct notifier_block reboot_nb;
+
+       struct delayed_work forceful_work;
+};
+
+#define userspace_nb_to_sconf(x)       \
+       container_of(x, struct scmi_syspower_conf, userspace_nb)
+
+#define reboot_nb_to_sconf(x)          \
+       container_of(x, struct scmi_syspower_conf, reboot_nb)
+
+#define dwork_to_sconf(x)              \
+       container_of(x, struct scmi_syspower_conf, forceful_work)
+
+/**
+ * scmi_reboot_notifier  - A reboot notifier to catch an ongoing successful
+ * system transition
+ * @nb: Reference to the related notifier block
+ * @reason: The reason for the ongoing reboot
+ * @__unused: The cmd being executed on a restart request (unused)
+ *
+ * When an ongoing system transition is detected, compatible with the one
+ * requested by SCMI, cancel the delayed work.
+ *
+ * Return: NOTIFY_OK in any case
+ */
+static int scmi_reboot_notifier(struct notifier_block *nb,
+                               unsigned long reason, void *__unused)
+{
+       struct scmi_syspower_conf *sc = reboot_nb_to_sconf(nb);
+
+       mutex_lock(&sc->state_mtx);
+       switch (reason) {
+       case SYS_HALT:
+       case SYS_POWER_OFF:
+               if (sc->required_transition == SCMI_SYSTEM_SHUTDOWN)
+                       sc->state = SCMI_SYSPOWER_REBOOTING;
+               break;
+       case SYS_RESTART:
+               if (sc->required_transition == SCMI_SYSTEM_COLDRESET ||
+                   sc->required_transition == SCMI_SYSTEM_WARMRESET)
+                       sc->state = SCMI_SYSPOWER_REBOOTING;
+               break;
+       default:
+               break;
+       }
+
+       if (sc->state == SCMI_SYSPOWER_REBOOTING) {
+               dev_dbg(sc->dev, "Reboot in progress...cancel delayed work.\n");
+               cancel_delayed_work_sync(&sc->forceful_work);
+       }
+       mutex_unlock(&sc->state_mtx);
+
+       return NOTIFY_OK;
+}
+
+/**
+ * scmi_request_forceful_transition  - Request forceful SystemPower transition
+ * @sc: A reference to the configuration data
+ *
+ * Initiates the required SystemPower transition without involving userspace:
+ * just trigger the action at the kernel level after issuing an emergency
+ * sync. (if possible at all)
+ */
+static inline void
+scmi_request_forceful_transition(struct scmi_syspower_conf *sc)
+{
+       dev_dbg(sc->dev, "Serving forceful request:%d\n",
+               sc->required_transition);
+
+#ifndef MODULE
+       emergency_sync();
+#endif
+       switch (sc->required_transition) {
+       case SCMI_SYSTEM_SHUTDOWN:
+               kernel_power_off();
+               break;
+       case SCMI_SYSTEM_COLDRESET:
+       case SCMI_SYSTEM_WARMRESET:
+               kernel_restart(NULL);
+               break;
+       default:
+               break;
+       }
+}
+
+static void scmi_forceful_work_func(struct work_struct *work)
+{
+       struct scmi_syspower_conf *sc;
+       struct delayed_work *dwork;
+
+       if (system_state > SYSTEM_RUNNING)
+               return;
+
+       dwork = to_delayed_work(work);
+       sc = dwork_to_sconf(dwork);
+
+       dev_dbg(sc->dev, "Graceful request timed out...forcing !\n");
+       mutex_lock(&sc->state_mtx);
+       /* avoid deadlock by unregistering reboot notifier first */
+       unregister_reboot_notifier(&sc->reboot_nb);
+       if (sc->state == SCMI_SYSPOWER_IN_PROGRESS)
+               scmi_request_forceful_transition(sc);
+       mutex_unlock(&sc->state_mtx);
+}
+
+/**
+ * scmi_request_graceful_transition  - Request graceful SystemPower transition
+ * @sc: A reference to the configuration data
+ * @timeout_ms: The desired timeout to wait for the shutdown to complete before
+ *             system is forcibly shutdown.
+ *
+ * Initiates the required SystemPower transition, requesting userspace
+ * co-operation: it uses the same orderly_ methods used by ACPI Shutdown event
+ * processing.
+ *
+ * Takes care also to register a reboot notifier and to schedule a delayed work
+ * in order to detect if userspace actions are taking too long and in such a
+ * case to trigger a forceful transition.
+ */
+static void scmi_request_graceful_transition(struct scmi_syspower_conf *sc,
+                                            unsigned int timeout_ms)
+{
+       unsigned int adj_timeout_ms = 0;
+
+       if (timeout_ms) {
+               int ret;
+
+               sc->reboot_nb.notifier_call = &scmi_reboot_notifier;
+               ret = register_reboot_notifier(&sc->reboot_nb);
+               if (!ret) {
+                       /* Wait only up to 75% of the advertised timeout */
+                       adj_timeout_ms = mult_frac(timeout_ms, 3, 4);
+                       INIT_DELAYED_WORK(&sc->forceful_work,
+                                         scmi_forceful_work_func);
+                       schedule_delayed_work(&sc->forceful_work,
+                                             msecs_to_jiffies(adj_timeout_ms));
+               } else {
+                       /* Carry on best effort even without a reboot notifier */
+                       dev_warn(sc->dev,
+                                "Cannot register reboot notifier !\n");
+               }
+       }
+
+       dev_dbg(sc->dev,
+               "Serving graceful req:%d (timeout_ms:%u  adj_timeout_ms:%u)\n",
+               sc->required_transition, timeout_ms, adj_timeout_ms);
+
+       switch (sc->required_transition) {
+       case SCMI_SYSTEM_SHUTDOWN:
+               /*
+                * When triggered early at boot-time the 'orderly' call will
+                * partially fail due to the lack of userspace itself, but
+                * the force=true argument will start anyway a successful
+                * forced shutdown.
+                */
+               orderly_poweroff(true);
+               break;
+       case SCMI_SYSTEM_COLDRESET:
+       case SCMI_SYSTEM_WARMRESET:
+               orderly_reboot();
+               break;
+       default:
+               break;
+       }
+}
+
+/**
+ * scmi_userspace_notifier  - Notifier callback to act on SystemPower
+ * Notifications
+ * @nb: Reference to the related notifier block
+ * @event: The SystemPower notification event id
+ * @data: The SystemPower event report
+ *
+ * This callback is in charge of decoding the received SystemPower report
+ * and act accordingly triggering a graceful or forceful system transition.
+ *
+ * Note that once a valid SCMI SystemPower event starts being served, any
+ * other following SystemPower notification received from the same SCMI
+ * instance (handle) will be ignored.
+ *
+ * Return: NOTIFY_OK once a valid SystemPower event has been successfully
+ * processed.
+ */
+static int scmi_userspace_notifier(struct notifier_block *nb,
+                                  unsigned long event, void *data)
+{
+       struct scmi_system_power_state_notifier_report *er = data;
+       struct scmi_syspower_conf *sc = userspace_nb_to_sconf(nb);
+
+       if (er->system_state >= SCMI_SYSTEM_POWERUP) {
+               dev_err(sc->dev, "Ignoring unsupported system_state: 0x%X\n",
+                       er->system_state);
+               return NOTIFY_DONE;
+       }
+
+       if (!SCMI_SYSPOWER_IS_REQUEST_GRACEFUL(er->flags)) {
+               dev_err(sc->dev, "Ignoring forceful notification.\n");
+               return NOTIFY_DONE;
+       }
+
+       /*
+        * Bail out if system is already shutting down or an SCMI SystemPower
+        * requested is already being served.
+        */
+       if (system_state > SYSTEM_RUNNING)
+               return NOTIFY_DONE;
+       mutex_lock(&sc->state_mtx);
+       if (sc->state != SCMI_SYSPOWER_IDLE) {
+               dev_dbg(sc->dev,
+                       "Transition already in progress...ignore.\n");
+               mutex_unlock(&sc->state_mtx);
+               return NOTIFY_DONE;
+       }
+       sc->state = SCMI_SYSPOWER_IN_PROGRESS;
+       mutex_unlock(&sc->state_mtx);
+
+       sc->required_transition = er->system_state;
+
+       /* Leaving a trace in logs of who triggered the shutdown/reboot. */
+       dev_info(sc->dev, "Serving shutdown/reboot request: %d\n",
+                sc->required_transition);
+
+       scmi_request_graceful_transition(sc, er->timeout);
+
+       return NOTIFY_OK;
+}
+
+static int scmi_syspower_probe(struct scmi_device *sdev)
+{
+       int ret;
+       struct scmi_syspower_conf *sc;
+       struct scmi_handle *handle = sdev->handle;
+
+       if (!handle)
+               return -ENODEV;
+
+       ret = handle->devm_protocol_acquire(sdev, SCMI_PROTOCOL_SYSTEM);
+       if (ret)
+               return ret;
+
+       sc = devm_kzalloc(&sdev->dev, sizeof(*sc), GFP_KERNEL);
+       if (!sc)
+               return -ENOMEM;
+
+       sc->state = SCMI_SYSPOWER_IDLE;
+       mutex_init(&sc->state_mtx);
+       sc->required_transition = SCMI_SYSTEM_MAX;
+       sc->userspace_nb.notifier_call = &scmi_userspace_notifier;
+       sc->dev = &sdev->dev;
+
+       return handle->notify_ops->devm_event_notifier_register(sdev,
+                                                          SCMI_PROTOCOL_SYSTEM,
+                                        SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER,
+                                                      NULL, &sc->userspace_nb);
+}
+
+static const struct scmi_device_id scmi_id_table[] = {
+       { SCMI_PROTOCOL_SYSTEM, "syspower" },
+       { },
+};
+MODULE_DEVICE_TABLE(scmi, scmi_id_table);
+
+static struct scmi_driver scmi_system_power_driver = {
+       .name = "scmi-system-power",
+       .probe = scmi_syspower_probe,
+       .id_table = scmi_id_table,
+};
+module_scmi_driver(scmi_system_power_driver);
+
+MODULE_AUTHOR("Cristian Marussi <cristian.marussi@arm.com>");
+MODULE_DESCRIPTION("ARM SCMI SystemPower Control driver");
+MODULE_LICENSE("GPL");
index 220e399118ad6723ad34bb82efb7e036773d596a..9383d75845393d5bb9a92b1e55461590d55e09fa 100644 (file)
@@ -27,10 +27,12 @@ struct scmi_system_power_state_notifier_payld {
        __le32 agent_id;
        __le32 flags;
        __le32 system_state;
+       __le32 timeout;
 };
 
 struct scmi_system_info {
        u32 version;
+       bool graceful_timeout_supported;
 };
 
 static int scmi_system_request_notify(const struct scmi_protocol_handle *ph,
@@ -72,17 +74,27 @@ scmi_system_fill_custom_report(const struct scmi_protocol_handle *ph,
                               const void *payld, size_t payld_sz,
                               void *report, u32 *src_id)
 {
+       size_t expected_sz;
        const struct scmi_system_power_state_notifier_payld *p = payld;
        struct scmi_system_power_state_notifier_report *r = report;
+       struct scmi_system_info *pinfo = ph->get_priv(ph);
 
+       expected_sz = pinfo->graceful_timeout_supported ?
+                       sizeof(*p) : sizeof(*p) - sizeof(__le32);
        if (evt_id != SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER ||
-           sizeof(*p) != payld_sz)
+           payld_sz != expected_sz)
                return NULL;
 
        r->timestamp = timestamp;
        r->agent_id = le32_to_cpu(p->agent_id);
        r->flags = le32_to_cpu(p->flags);
        r->system_state = le32_to_cpu(p->system_state);
+       if (pinfo->graceful_timeout_supported &&
+           r->system_state == SCMI_SYSTEM_SHUTDOWN &&
+           SCMI_SYSPOWER_IS_REQUEST_GRACEFUL(r->flags))
+               r->timeout = le32_to_cpu(p->timeout);
+       else
+               r->timeout = 0x00;
        *src_id = 0;
 
        return r;
@@ -129,6 +141,9 @@ static int scmi_system_protocol_init(const struct scmi_protocol_handle *ph)
                return -ENOMEM;
 
        pinfo->version = version;
+       if (PROTOCOL_REV_MAJOR(pinfo->version) >= 0x2)
+               pinfo->graceful_timeout_supported = true;
+
        return ph->set_priv(ph, pinfo);
 }
 
index ddf0b9ff9e15cda2177c30cd98b02cc55627e9a4..435d0e2658a42e723b48888fc622131b4ad03d27 100644 (file)
@@ -815,7 +815,7 @@ static int scpi_init_versions(struct scpi_drvinfo *info)
                info->firmware_version = le32_to_cpu(caps.platform_version);
        }
        /* Ignore error if not implemented */
-       if (scpi_info->is_legacy && ret == -EOPNOTSUPP)
+       if (info->is_legacy && ret == -EOPNOTSUPP)
                return 0;
 
        return ret;
@@ -913,13 +913,14 @@ static int scpi_probe(struct platform_device *pdev)
        struct resource res;
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
+       struct scpi_drvinfo *scpi_drvinfo;
 
-       scpi_info = devm_kzalloc(dev, sizeof(*scpi_info), GFP_KERNEL);
-       if (!scpi_info)
+       scpi_drvinfo = devm_kzalloc(dev, sizeof(*scpi_drvinfo), GFP_KERNEL);
+       if (!scpi_drvinfo)
                return -ENOMEM;
 
        if (of_match_device(legacy_scpi_of_match, &pdev->dev))
-               scpi_info->is_legacy = true;
+               scpi_drvinfo->is_legacy = true;
 
        count = of_count_phandle_with_args(np, "mboxes", "#mbox-cells");
        if (count < 0) {
@@ -927,19 +928,19 @@ static int scpi_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       scpi_info->channels = devm_kcalloc(dev, count, sizeof(struct scpi_chan),
-                                          GFP_KERNEL);
-       if (!scpi_info->channels)
+       scpi_drvinfo->channels =
+               devm_kcalloc(dev, count, sizeof(struct scpi_chan), GFP_KERNEL);
+       if (!scpi_drvinfo->channels)
                return -ENOMEM;
 
-       ret = devm_add_action(dev, scpi_free_channels, scpi_info);
+       ret = devm_add_action(dev, scpi_free_channels, scpi_drvinfo);
        if (ret)
                return ret;
 
-       for (; scpi_info->num_chans < count; scpi_info->num_chans++) {
+       for (; scpi_drvinfo->num_chans < count; scpi_drvinfo->num_chans++) {
                resource_size_t size;
-               int idx = scpi_info->num_chans;
-               struct scpi_chan *pchan = scpi_info->channels + idx;
+               int idx = scpi_drvinfo->num_chans;
+               struct scpi_chan *pchan = scpi_drvinfo->channels + idx;
                struct mbox_client *cl = &pchan->cl;
                struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
 
@@ -986,45 +987,53 @@ static int scpi_probe(struct platform_device *pdev)
                return ret;
        }
 
-       scpi_info->commands = scpi_std_commands;
+       scpi_drvinfo->commands = scpi_std_commands;
 
-       platform_set_drvdata(pdev, scpi_info);
+       platform_set_drvdata(pdev, scpi_drvinfo);
 
-       if (scpi_info->is_legacy) {
+       if (scpi_drvinfo->is_legacy) {
                /* Replace with legacy variants */
                scpi_ops.clk_set_val = legacy_scpi_clk_set_val;
-               scpi_info->commands = scpi_legacy_commands;
+               scpi_drvinfo->commands = scpi_legacy_commands;
 
                /* Fill priority bitmap */
                for (idx = 0; idx < ARRAY_SIZE(legacy_hpriority_cmds); idx++)
                        set_bit(legacy_hpriority_cmds[idx],
-                               scpi_info->cmd_priority);
+                               scpi_drvinfo->cmd_priority);
        }
 
-       ret = scpi_init_versions(scpi_info);
+       scpi_info = scpi_drvinfo;
+
+       ret = scpi_init_versions(scpi_drvinfo);
        if (ret) {
                dev_err(dev, "incorrect or no SCP firmware found\n");
+               scpi_info = NULL;
                return ret;
        }
 
-       if (scpi_info->is_legacy && !scpi_info->protocol_version &&
-           !scpi_info->firmware_version)
+       if (scpi_drvinfo->is_legacy && !scpi_drvinfo->protocol_version &&
+           !scpi_drvinfo->firmware_version)
                dev_info(dev, "SCP Protocol legacy pre-1.0 firmware\n");
        else
                dev_info(dev, "SCP Protocol %lu.%lu Firmware %lu.%lu.%lu version\n",
                         FIELD_GET(PROTO_REV_MAJOR_MASK,
-                                  scpi_info->protocol_version),
+                                  scpi_drvinfo->protocol_version),
                         FIELD_GET(PROTO_REV_MINOR_MASK,
-                                  scpi_info->protocol_version),
+                                  scpi_drvinfo->protocol_version),
                         FIELD_GET(FW_REV_MAJOR_MASK,
-                                  scpi_info->firmware_version),
+                                  scpi_drvinfo->firmware_version),
                         FIELD_GET(FW_REV_MINOR_MASK,
-                                  scpi_info->firmware_version),
+                                  scpi_drvinfo->firmware_version),
                         FIELD_GET(FW_REV_PATCH_MASK,
-                                  scpi_info->firmware_version));
-       scpi_info->scpi_ops = &scpi_ops;
+                                  scpi_drvinfo->firmware_version));
+
+       scpi_drvinfo->scpi_ops = &scpi_ops;
 
-       return devm_of_platform_populate(dev);
+       ret = devm_of_platform_populate(dev);
+       if (ret)
+               scpi_info = NULL;
+
+       return ret;
 }
 
 static const struct of_device_id scpi_of_match[] = {
index 1829ba220576b7839939fc1c1e84daa58008a9d3..9f918b9e6f8f68b786a0910067b97a42c8135728 100644 (file)
@@ -120,6 +120,9 @@ static void __scm_legacy_do(const struct arm_smccc_args *smc,
 /**
  * scm_legacy_call() - Sends a command to the SCM and waits for the command to
  * finish processing.
+ * @dev:       device
+ * @desc:      descriptor structure containing arguments and return values
+ * @res:        results from SMC call
  *
  * A note on cache maintenance:
  * Note that any buffers that are expected to be accessed by the secure world
@@ -211,6 +214,7 @@ out:
 /**
  * scm_legacy_call_atomic() - Send an atomic SCM command with up to 5 arguments
  * and 3 return values
+ * @unused: device, legacy argument, not used, can be NULL
  * @desc: SCM call descriptor containing arguments
  * @res:  SCM call return values
  *
index 3163660fa8e290d31dd81c85610c18a8fb1a7173..cdbfe54c8146745d0ca107e910d4c47c8f57720f 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/cpumask.h>
 #include <linux/export.h>
 #include <linux/dma-mapping.h>
+#include <linux/interconnect.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/qcom_scm.h>
@@ -31,8 +32,13 @@ struct qcom_scm {
        struct clk *core_clk;
        struct clk *iface_clk;
        struct clk *bus_clk;
+       struct icc_path *path;
        struct reset_controller_dev reset;
 
+       /* control access to the interconnect path */
+       struct mutex scm_bw_lock;
+       int scm_vote_count;
+
        u64 dload_mode_addr;
 };
 
@@ -99,6 +105,42 @@ static void qcom_scm_clk_disable(void)
        clk_disable_unprepare(__scm->bus_clk);
 }
 
+static int qcom_scm_bw_enable(void)
+{
+       int ret = 0;
+
+       if (!__scm->path)
+               return 0;
+
+       if (IS_ERR(__scm->path))
+               return -EINVAL;
+
+       mutex_lock(&__scm->scm_bw_lock);
+       if (!__scm->scm_vote_count) {
+               ret = icc_set_bw(__scm->path, 0, UINT_MAX);
+               if (ret < 0) {
+                       dev_err(__scm->dev, "failed to set bandwidth request\n");
+                       goto err_bw;
+               }
+       }
+       __scm->scm_vote_count++;
+err_bw:
+       mutex_unlock(&__scm->scm_bw_lock);
+
+       return ret;
+}
+
+static void qcom_scm_bw_disable(void)
+{
+       if (IS_ERR_OR_NULL(__scm->path))
+               return;
+
+       mutex_lock(&__scm->scm_bw_lock);
+       if (__scm->scm_vote_count-- == 1)
+               icc_set_bw(__scm->path, 0, 0);
+       mutex_unlock(&__scm->scm_bw_lock);
+}
+
 enum qcom_scm_convention qcom_scm_convention = SMC_CONVENTION_UNKNOWN;
 static DEFINE_SPINLOCK(scm_query_lock);
 
@@ -444,10 +486,15 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
        if (ret)
                goto out;
 
+       ret = qcom_scm_bw_enable();
+       if (ret)
+               return ret;
+
        desc.args[1] = mdata_phys;
 
        ret = qcom_scm_call(__scm->dev, &desc, &res);
 
+       qcom_scm_bw_disable();
        qcom_scm_clk_disable();
 
 out:
@@ -507,7 +554,12 @@ int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr, phys_addr_t size)
        if (ret)
                return ret;
 
+       ret = qcom_scm_bw_enable();
+       if (ret)
+               return ret;
+
        ret = qcom_scm_call(__scm->dev, &desc, &res);
+       qcom_scm_bw_disable();
        qcom_scm_clk_disable();
 
        return ret ? : res.result[0];
@@ -537,7 +589,12 @@ int qcom_scm_pas_auth_and_reset(u32 peripheral)
        if (ret)
                return ret;
 
+       ret = qcom_scm_bw_enable();
+       if (ret)
+               return ret;
+
        ret = qcom_scm_call(__scm->dev, &desc, &res);
+       qcom_scm_bw_disable();
        qcom_scm_clk_disable();
 
        return ret ? : res.result[0];
@@ -566,8 +623,13 @@ int qcom_scm_pas_shutdown(u32 peripheral)
        if (ret)
                return ret;
 
+       ret = qcom_scm_bw_enable();
+       if (ret)
+               return ret;
+
        ret = qcom_scm_call(__scm->dev, &desc, &res);
 
+       qcom_scm_bw_disable();
        qcom_scm_clk_disable();
 
        return ret ? : res.result[0];
@@ -1277,8 +1339,15 @@ static int qcom_scm_probe(struct platform_device *pdev)
        if (ret < 0)
                return ret;
 
+       mutex_init(&scm->scm_bw_lock);
+
        clks = (unsigned long)of_device_get_match_data(&pdev->dev);
 
+       scm->path = devm_of_icc_get(&pdev->dev, NULL);
+       if (IS_ERR(scm->path))
+               return dev_err_probe(&pdev->dev, PTR_ERR(scm->path),
+                                    "failed to acquire interconnect path\n");
+
        scm->core_clk = devm_clk_get(&pdev->dev, "core");
        if (IS_ERR(scm->core_clk)) {
                if (PTR_ERR(scm->core_clk) == -EPROBE_DEFER)
@@ -1337,7 +1406,7 @@ static int qcom_scm_probe(struct platform_device *pdev)
 
        /*
         * If requested enable "download mode", from this point on warmboot
-        * will cause the the boot stages to enter download mode, unless
+        * will cause the boot stages to enter download mode, unless
         * disabled below by a clean shutdown/reboot.
         */
        if (download_mode)
index fd89899aeeed9ccbbba6ab5e96e202af55f65077..0c440afd522479bc62a0c81d284bdc4986806ece 100644 (file)
@@ -474,7 +474,7 @@ static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp,
                        mode |= attrs & DEBUGFS_S_IWUSR ? 0200 : 0;
                        dentry = debugfs_create_file(name, mode, parent, bpmp,
                                                     &bpmp_debug_fops);
-                       if (!dentry) {
+                       if (IS_ERR(dentry)) {
                                err = -ENOMEM;
                                goto out;
                        }
@@ -725,7 +725,7 @@ static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf,
 
                if (t & DEBUGFS_S_ISDIR) {
                        dentry = debugfs_create_dir(name, parent);
-                       if (!dentry)
+                       if (IS_ERR(dentry))
                                return -ENOMEM;
                        err = bpmp_populate_dir(bpmp, seqbuf, dentry, depth+1);
                        if (err < 0)
@@ -738,7 +738,7 @@ static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf,
                        dentry = debugfs_create_file(name, mode,
                                                     parent, bpmp,
                                                     &debugfs_fops);
-                       if (!dentry)
+                       if (IS_ERR(dentry))
                                return -ENOMEM;
                }
        }
@@ -788,11 +788,11 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
                return 0;
 
        root = debugfs_create_dir("bpmp", NULL);
-       if (!root)
+       if (IS_ERR(root))
                return -ENOMEM;
 
        bpmp->debugfs_mirror = debugfs_create_dir("debug", root);
-       if (!bpmp->debugfs_mirror) {
+       if (IS_ERR(bpmp->debugfs_mirror)) {
                err = -ENOMEM;
                goto out;
        }
index 5654c5e9862b13031f274b2c9e67682d897e96b9..037db21de510c777d69448beeee7332b6d77ea64 100644 (file)
@@ -201,7 +201,7 @@ static ssize_t __tegra_bpmp_channel_read(struct tegra_bpmp_channel *channel,
        int err;
 
        if (data && size > 0)
-               memcpy(data, channel->ib->data, size);
+               memcpy_fromio(data, channel->ib->data, size);
 
        err = tegra_bpmp_ack_response(channel);
        if (err < 0)
@@ -245,7 +245,7 @@ static ssize_t __tegra_bpmp_channel_write(struct tegra_bpmp_channel *channel,
        channel->ob->flags = flags;
 
        if (data && size > 0)
-               memcpy(channel->ob->data, data, size);
+               memcpy_toio(channel->ob->data, data, size);
 
        return tegra_bpmp_post_request(channel);
 }
@@ -420,7 +420,7 @@ void tegra_bpmp_mrq_return(struct tegra_bpmp_channel *channel, int code,
        channel->ob->code = code;
 
        if (data && size > 0)
-               memcpy(channel->ob->data, data, size);
+               memcpy_toio(channel->ob->data, data, size);
 
        err = tegra_bpmp_post_response(channel);
        if (WARN_ON(err < 0))
index 7977a494a651d86c836fe50849dd6a0cb419245f..d1f652802181e5ac9415b41bc608d3c654fc67ff 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Xilinx Zynq MPSoC Firmware layer
  *
- *  Copyright (C) 2014-2021 Xilinx, Inc.
+ *  Copyright (C) 2014-2022 Xilinx, Inc.
  *
  *  Michal Simek <michal.simek@xilinx.com>
  *  Davorin Mista <davorin.mista@aggios.com>
@@ -340,6 +340,20 @@ int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
 static u32 pm_api_version;
 static u32 pm_tz_version;
 
+int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset)
+{
+       int ret;
+
+       ret = zynqmp_pm_invoke_fn(TF_A_PM_REGISTER_SGI, sgi_num, reset, 0, 0,
+                                 NULL);
+       if (!ret)
+               return ret;
+
+       /* try old implementation as fallback strategy if above fails */
+       return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_REGISTER_SGI, sgi_num,
+                                  reset, NULL);
+}
+
 /**
  * zynqmp_pm_get_api_version() - Get version number of PMU PM firmware
  * @version:   Returned version value
index b2c90bdd39d03ef2d993dab0cbd6496864df5d05..52d7b8d991705db4c79dabcf27dd641d44b16d3e 100644 (file)
@@ -550,15 +550,12 @@ static struct irq_chip msc313_gpio_irqchip = {
  * so we need to provide the fwspec. Essentially gpiochip_populate_parent_fwspec_twocell
  * that puts GIC_SPI into the first cell.
  */
-static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
-                                            unsigned int parent_hwirq,
-                                            unsigned int parent_type)
+static int msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
+                                             union gpio_irq_fwspec *gfwspec,
+                                             unsigned int parent_hwirq,
+                                             unsigned int parent_type)
 {
-       struct irq_fwspec *fwspec;
-
-       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = gc->irq.parent_domain->fwnode;
        fwspec->param_count = 3;
@@ -566,7 +563,7 @@ static void *msc313_gpio_populate_parent_fwspec(struct gpio_chip *gc,
        fwspec->param[1] = parent_hwirq;
        fwspec->param[2] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 
 static int msc313e_gpio_child_to_parent_hwirq(struct gpio_chip *chip,
index ff2d2a1f9c732dcb1b63f847c1d1a47af5e01adc..e4fb4cb38a0f4fa87fdabab753d15cc83ec737c9 100644 (file)
@@ -443,15 +443,12 @@ static int tegra_gpio_child_to_parent_hwirq(struct gpio_chip *chip,
        return 0;
 }
 
-static void *tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip,
-                                              unsigned int parent_hwirq,
-                                              unsigned int parent_type)
+static int tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip,
+                                            union gpio_irq_fwspec *gfwspec,
+                                            unsigned int parent_hwirq,
+                                            unsigned int parent_type)
 {
-       struct irq_fwspec *fwspec;
-
-       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = chip->irq.parent_domain->fwnode;
        fwspec->param_count = 3;
@@ -459,7 +456,7 @@ static void *tegra_gpio_populate_parent_fwspec(struct gpio_chip *chip,
        fwspec->param[1] = parent_hwirq;
        fwspec->param[2] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
index de28a68daea0d4d538fe256fe5238df16e835cc2..54d9fa7da9c1ea98e3f6ef2b0362758e2f5de756 100644 (file)
@@ -621,16 +621,13 @@ static int tegra186_gpio_irq_domain_translate(struct irq_domain *domain,
        return 0;
 }
 
-static void *tegra186_gpio_populate_parent_fwspec(struct gpio_chip *chip,
-                                                unsigned int parent_hwirq,
-                                                unsigned int parent_type)
+static int tegra186_gpio_populate_parent_fwspec(struct gpio_chip *chip,
+                                               union gpio_irq_fwspec *gfwspec,
+                                               unsigned int parent_hwirq,
+                                               unsigned int parent_type)
 {
        struct tegra_gpio *gpio = gpiochip_get_data(chip);
-       struct irq_fwspec *fwspec;
-
-       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = chip->irq.parent_domain->fwnode;
        fwspec->param_count = 3;
@@ -638,7 +635,7 @@ static void *tegra186_gpio_populate_parent_fwspec(struct gpio_chip *chip,
        fwspec->param[1] = parent_hwirq;
        fwspec->param[2] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 
 static int tegra186_gpio_child_to_parent_hwirq(struct gpio_chip *chip,
index 9f66deab46eaa99d05413a996b585284c433574d..cc62c6e6410306e7e643e36fae42b5cb1afc3d8e 100644 (file)
@@ -15,8 +15,6 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/spinlock.h>
-#include <asm-generic/msi.h>
-
 
 #define GPIO_RX_DAT    0x0
 #define GPIO_TX_SET    0x8
@@ -408,18 +406,15 @@ static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
        return 0;
 }
 
-static void *thunderx_gpio_populate_parent_alloc_info(struct gpio_chip *chip,
-                                                     unsigned int parent_hwirq,
-                                                     unsigned int parent_type)
+static int thunderx_gpio_populate_parent_alloc_info(struct gpio_chip *chip,
+                                                   union gpio_irq_fwspec *gfwspec,
+                                                   unsigned int parent_hwirq,
+                                                   unsigned int parent_type)
 {
-       msi_alloc_info_t *info;
-
-       info = kmalloc(sizeof(*info), GFP_KERNEL);
-       if (!info)
-               return NULL;
+       msi_alloc_info_t *info = &gfwspec->msiinfo;
 
        info->hwirq = parent_hwirq;
-       return info;
+       return 0;
 }
 
 static int thunderx_gpio_probe(struct pci_dev *pdev,
index e6534ea1eaa7a21968d1793c172a0f54daad87ea..5e108ba9956a6c28cdfb1ee53df0830dd9265168 100644 (file)
@@ -103,15 +103,12 @@ static int visconti_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
        return -EINVAL;
 }
 
-static void *visconti_gpio_populate_parent_fwspec(struct gpio_chip *chip,
-                                                 unsigned int parent_hwirq,
-                                                 unsigned int parent_type)
+static int visconti_gpio_populate_parent_fwspec(struct gpio_chip *chip,
+                                               union gpio_irq_fwspec *gfwspec,
+                                               unsigned int parent_hwirq,
+                                               unsigned int parent_type)
 {
-       struct irq_fwspec *fwspec;
-
-       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = chip->irq.parent_domain->fwnode;
        fwspec->param_count = 3;
@@ -119,7 +116,7 @@ static void *visconti_gpio_populate_parent_fwspec(struct gpio_chip *chip,
        fwspec->param[1] = parent_hwirq;
        fwspec->param[2] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 
 static int visconti_gpio_probe(struct platform_device *pdev)
index 9535f48e18d1c8befd987512341cb148046fc8c5..68d9f95d7799acb3f4d3c856468952df213e8bcd 100644 (file)
@@ -1107,7 +1107,7 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
        irq_hw_number_t hwirq;
        unsigned int type = IRQ_TYPE_NONE;
        struct irq_fwspec *fwspec = data;
-       void *parent_arg;
+       union gpio_irq_fwspec gpio_parent_fwspec = {};
        unsigned int parent_hwirq;
        unsigned int parent_type;
        struct gpio_irq_chip *girq = &gc->irq;
@@ -1147,14 +1147,15 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
        irq_set_probe(irq);
 
        /* This parent only handles asserted level IRQs */
-       parent_arg = girq->populate_parent_alloc_arg(gc, parent_hwirq, parent_type);
-       if (!parent_arg)
-               return -ENOMEM;
+       ret = girq->populate_parent_alloc_arg(gc, &gpio_parent_fwspec,
+                                             parent_hwirq, parent_type);
+       if (ret)
+               return ret;
 
        chip_dbg(gc, "alloc_irqs_parent for %d parent hwirq %d\n",
                  irq, parent_hwirq);
        irq_set_lockdep_class(irq, gc->irq.lock_key, gc->irq.request_key);
-       ret = irq_domain_alloc_irqs_parent(d, irq, 1, parent_arg);
+       ret = irq_domain_alloc_irqs_parent(d, irq, 1, &gpio_parent_fwspec);
        /*
         * If the parent irqdomain is msi, the interrupts have already
         * been allocated, so the EEXIST is good.
@@ -1166,7 +1167,6 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
                         "failed to allocate parent hwirq %d for hwirq %lu\n",
                         parent_hwirq, hwirq);
 
-       kfree(parent_arg);
        return ret;
 }
 
@@ -1181,15 +1181,18 @@ static void gpiochip_hierarchy_setup_domain_ops(struct irq_domain_ops *ops)
        ops->activate = gpiochip_irq_domain_activate;
        ops->deactivate = gpiochip_irq_domain_deactivate;
        ops->alloc = gpiochip_hierarchy_irq_domain_alloc;
-       ops->free = irq_domain_free_irqs_common;
 
        /*
-        * We only allow overriding the translate() function for
+        * We only allow overriding the translate() and free() functions for
         * hierarchical chips, and this should only be done if the user
-        * really need something other than 1:1 translation.
+        * really need something other than 1:1 translation for translate()
+        * callback and free if user wants to free up any resources which
+        * were allocated during callbacks, for example populate_parent_alloc_arg.
         */
        if (!ops->translate)
                ops->translate = gpiochip_hierarchy_irq_domain_translate;
+       if (!ops->free)
+               ops->free = irq_domain_free_irqs_common;
 }
 
 static int gpiochip_hierarchy_add_domain(struct gpio_chip *gc)
@@ -1230,34 +1233,28 @@ static bool gpiochip_hierarchy_is_hierarchical(struct gpio_chip *gc)
        return !!gc->irq.parent_domain;
 }
 
-void *gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
-                                            unsigned int parent_hwirq,
-                                            unsigned int parent_type)
+int gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
+                                           union gpio_irq_fwspec *gfwspec,
+                                           unsigned int parent_hwirq,
+                                           unsigned int parent_type)
 {
-       struct irq_fwspec *fwspec;
-
-       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = gc->irq.parent_domain->fwnode;
        fwspec->param_count = 2;
        fwspec->param[0] = parent_hwirq;
        fwspec->param[1] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 EXPORT_SYMBOL_GPL(gpiochip_populate_parent_fwspec_twocell);
 
-void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
-                                             unsigned int parent_hwirq,
-                                             unsigned int parent_type)
+int gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
+                                            union gpio_irq_fwspec *gfwspec,
+                                            unsigned int parent_hwirq,
+                                            unsigned int parent_type)
 {
-       struct irq_fwspec *fwspec;
-
-       fwspec = kmalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = gc->irq.parent_domain->fwnode;
        fwspec->param_count = 4;
@@ -1266,7 +1263,7 @@ void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
        fwspec->param[2] = 0;
        fwspec->param[3] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 EXPORT_SYMBOL_GPL(gpiochip_populate_parent_fwspec_fourcell);
 
index 0ba0598eba20662d149157e41a607fd6016ce7be..ec6771e87e73893eec96c5524ff06d24d96c42c4 100644 (file)
@@ -6,7 +6,7 @@ config DRM_AMD_DC
        bool "AMD DC - Enable new display engine"
        default y
        select SND_HDA_COMPONENT if SND_HDA_CORE
-       select DRM_AMD_DC_DCN if X86 && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
+       select DRM_AMD_DC_DCN if (X86 || PPC_LONG_DOUBLE_128) && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
        help
          Choose this option if you want to use the new display engine
          support for AMDGPU. This adds required support for Vega and
index 1431f1e9dbee76b475ce4c93f96ae1dc3210fd6c..04e435bce79bdfc731b0f4bf834e3bd06381e2da 100644 (file)
@@ -201,6 +201,8 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine);
 int intel_engine_stop_cs(struct intel_engine_cs *engine);
 void intel_engine_cancel_stop_cs(struct intel_engine_cs *engine);
 
+void intel_engine_wait_for_pending_mi_fw(struct intel_engine_cs *engine);
+
 void intel_engine_set_hwsp_writemask(struct intel_engine_cs *engine, u32 mask);
 
 u64 intel_engine_get_active_head(const struct intel_engine_cs *engine);
index 14c6ddbbfde8b65586da0030669db5fa266cac01..5b6ce10cb1588bf51410b26df8c9d837f21b0b96 100644 (file)
@@ -1282,10 +1282,10 @@ static int __intel_engine_stop_cs(struct intel_engine_cs *engine,
        intel_uncore_write_fw(uncore, mode, _MASKED_BIT_ENABLE(STOP_RING));
 
        /*
-        * Wa_22011802037 : gen12, Prior to doing a reset, ensure CS is
+        * Wa_22011802037 : gen11, gen12, Prior to doing a reset, ensure CS is
         * stopped, set ring stop bit and prefetch disable bit to halt CS
         */
-       if (GRAPHICS_VER(engine->i915) == 12)
+       if (IS_GRAPHICS_VER(engine->i915, 11, 12))
                intel_uncore_write_fw(uncore, RING_MODE_GEN7(engine->mmio_base),
                                      _MASKED_BIT_ENABLE(GEN12_GFX_PREFETCH_DISABLE));
 
@@ -1308,6 +1308,18 @@ int intel_engine_stop_cs(struct intel_engine_cs *engine)
                return -ENODEV;
 
        ENGINE_TRACE(engine, "\n");
+       /*
+        * TODO: Find out why occasionally stopping the CS times out. Seen
+        * especially with gem_eio tests.
+        *
+        * Occasionally trying to stop the cs times out, but does not adversely
+        * affect functionality. The timeout is set as a config parameter that
+        * defaults to 100ms. In most cases the follow up operation is to wait
+        * for pending MI_FORCE_WAKES. The assumption is that this timeout is
+        * sufficient for any pending MI_FORCEWAKEs to complete. Once root
+        * caused, the caller must check and handle the return from this
+        * function.
+        */
        if (__intel_engine_stop_cs(engine, 1000, stop_timeout(engine))) {
                ENGINE_TRACE(engine,
                             "timed out on STOP_RING -> IDLE; HEAD:%04x, TAIL:%04x\n",
@@ -1334,6 +1346,78 @@ void intel_engine_cancel_stop_cs(struct intel_engine_cs *engine)
        ENGINE_WRITE_FW(engine, RING_MI_MODE, _MASKED_BIT_DISABLE(STOP_RING));
 }
 
+static u32 __cs_pending_mi_force_wakes(struct intel_engine_cs *engine)
+{
+       static const i915_reg_t _reg[I915_NUM_ENGINES] = {
+               [RCS0] = MSG_IDLE_CS,
+               [BCS0] = MSG_IDLE_BCS,
+               [VCS0] = MSG_IDLE_VCS0,
+               [VCS1] = MSG_IDLE_VCS1,
+               [VCS2] = MSG_IDLE_VCS2,
+               [VCS3] = MSG_IDLE_VCS3,
+               [VCS4] = MSG_IDLE_VCS4,
+               [VCS5] = MSG_IDLE_VCS5,
+               [VCS6] = MSG_IDLE_VCS6,
+               [VCS7] = MSG_IDLE_VCS7,
+               [VECS0] = MSG_IDLE_VECS0,
+               [VECS1] = MSG_IDLE_VECS1,
+               [VECS2] = MSG_IDLE_VECS2,
+               [VECS3] = MSG_IDLE_VECS3,
+               [CCS0] = MSG_IDLE_CS,
+               [CCS1] = MSG_IDLE_CS,
+               [CCS2] = MSG_IDLE_CS,
+               [CCS3] = MSG_IDLE_CS,
+       };
+       u32 val;
+
+       if (!_reg[engine->id].reg) {
+               drm_err(&engine->i915->drm,
+                       "MSG IDLE undefined for engine id %u\n", engine->id);
+               return 0;
+       }
+
+       val = intel_uncore_read(engine->uncore, _reg[engine->id]);
+
+       /* bits[29:25] & bits[13:9] >> shift */
+       return (val & (val >> 16) & MSG_IDLE_FW_MASK) >> MSG_IDLE_FW_SHIFT;
+}
+
+static void __gpm_wait_for_fw_complete(struct intel_gt *gt, u32 fw_mask)
+{
+       int ret;
+
+       /* Ensure GPM receives fw up/down after CS is stopped */
+       udelay(1);
+
+       /* Wait for forcewake request to complete in GPM */
+       ret =  __intel_wait_for_register_fw(gt->uncore,
+                                           GEN9_PWRGT_DOMAIN_STATUS,
+                                           fw_mask, fw_mask, 5000, 0, NULL);
+
+       /* Ensure CS receives fw ack from GPM */
+       udelay(1);
+
+       if (ret)
+               GT_TRACE(gt, "Failed to complete pending forcewake %d\n", ret);
+}
+
+/*
+ * Wa_22011802037:gen12: In addition to stopping the cs, we need to wait for any
+ * pending MI_FORCE_WAKEUP requests that the CS has initiated to complete. The
+ * pending status is indicated by bits[13:9] (masked by bits[29:25]) in the
+ * MSG_IDLE register. There's one MSG_IDLE register per reset domain. Since we
+ * are concerned only with the gt reset here, we use a logical OR of pending
+ * forcewakeups from all reset domains and then wait for them to complete by
+ * querying PWRGT_DOMAIN_STATUS.
+ */
+void intel_engine_wait_for_pending_mi_fw(struct intel_engine_cs *engine)
+{
+       u32 fw_pending = __cs_pending_mi_force_wakes(engine);
+
+       if (fw_pending)
+               __gpm_wait_for_fw_complete(engine->gt, fw_pending);
+}
+
 static u32
 read_subslice_reg(const struct intel_engine_cs *engine,
                  int slice, int subslice, i915_reg_t reg)
index 2b0266cab66b93a579a65b5f36a1268a4e44d1b7..0627fa10d2dcba5acfd23bcbbbb80e2540200884 100644 (file)
@@ -2968,6 +2968,13 @@ static void execlists_reset_prepare(struct intel_engine_cs *engine)
        ring_set_paused(engine, 1);
        intel_engine_stop_cs(engine);
 
+       /*
+        * Wa_22011802037:gen11/gen12: In addition to stopping the cs, we need
+        * to wait for any pending mi force wakeups
+        */
+       if (IS_GRAPHICS_VER(engine->i915, 11, 12))
+               intel_engine_wait_for_pending_mi_fw(engine);
+
        engine->execlists.reset_ccid = active_ccid(engine);
 }
 
index 2c4ad4a65089936b393dc9852baff81b0e405698..8c6885f43d1a1de1157952fbc4f5dad12e000640 100644 (file)
@@ -310,8 +310,8 @@ static u32 guc_ctl_wa_flags(struct intel_guc *guc)
        if (IS_DG2(gt->i915))
                flags |= GUC_WA_DUAL_QUEUE;
 
-       /* Wa_22011802037: graphics version 12 */
-       if (GRAPHICS_VER(gt->i915) == 12)
+       /* Wa_22011802037: graphics version 11/12 */
+       if (IS_GRAPHICS_VER(gt->i915, 11, 12))
                flags |= GUC_WA_PRE_PARSER;
 
        /* Wa_16011777198:dg2 */
index 9ffb343d0f7973cea811fec8564c0014170a66d5..2d9f5f1c79d3aea0cdccdfc4a211f3a79e306bd2 100644 (file)
@@ -1578,87 +1578,18 @@ static void guc_reset_state(struct intel_context *ce, u32 head, bool scrub)
        lrc_update_regs(ce, engine, head);
 }
 
-static u32 __cs_pending_mi_force_wakes(struct intel_engine_cs *engine)
-{
-       static const i915_reg_t _reg[I915_NUM_ENGINES] = {
-               [RCS0] = MSG_IDLE_CS,
-               [BCS0] = MSG_IDLE_BCS,
-               [VCS0] = MSG_IDLE_VCS0,
-               [VCS1] = MSG_IDLE_VCS1,
-               [VCS2] = MSG_IDLE_VCS2,
-               [VCS3] = MSG_IDLE_VCS3,
-               [VCS4] = MSG_IDLE_VCS4,
-               [VCS5] = MSG_IDLE_VCS5,
-               [VCS6] = MSG_IDLE_VCS6,
-               [VCS7] = MSG_IDLE_VCS7,
-               [VECS0] = MSG_IDLE_VECS0,
-               [VECS1] = MSG_IDLE_VECS1,
-               [VECS2] = MSG_IDLE_VECS2,
-               [VECS3] = MSG_IDLE_VECS3,
-               [CCS0] = MSG_IDLE_CS,
-               [CCS1] = MSG_IDLE_CS,
-               [CCS2] = MSG_IDLE_CS,
-               [CCS3] = MSG_IDLE_CS,
-       };
-       u32 val;
-
-       if (!_reg[engine->id].reg)
-               return 0;
-
-       val = intel_uncore_read(engine->uncore, _reg[engine->id]);
-
-       /* bits[29:25] & bits[13:9] >> shift */
-       return (val & (val >> 16) & MSG_IDLE_FW_MASK) >> MSG_IDLE_FW_SHIFT;
-}
-
-static void __gpm_wait_for_fw_complete(struct intel_gt *gt, u32 fw_mask)
-{
-       int ret;
-
-       /* Ensure GPM receives fw up/down after CS is stopped */
-       udelay(1);
-
-       /* Wait for forcewake request to complete in GPM */
-       ret =  __intel_wait_for_register_fw(gt->uncore,
-                                           GEN9_PWRGT_DOMAIN_STATUS,
-                                           fw_mask, fw_mask, 5000, 0, NULL);
-
-       /* Ensure CS receives fw ack from GPM */
-       udelay(1);
-
-       if (ret)
-               GT_TRACE(gt, "Failed to complete pending forcewake %d\n", ret);
-}
-
-/*
- * Wa_22011802037:gen12: In addition to stopping the cs, we need to wait for any
- * pending MI_FORCE_WAKEUP requests that the CS has initiated to complete. The
- * pending status is indicated by bits[13:9] (masked by bits[ 29:25]) in the
- * MSG_IDLE register. There's one MSG_IDLE register per reset domain. Since we
- * are concerned only with the gt reset here, we use a logical OR of pending
- * forcewakeups from all reset domains and then wait for them to complete by
- * querying PWRGT_DOMAIN_STATUS.
- */
 static void guc_engine_reset_prepare(struct intel_engine_cs *engine)
 {
-       u32 fw_pending;
-
-       if (GRAPHICS_VER(engine->i915) != 12)
+       if (!IS_GRAPHICS_VER(engine->i915, 11, 12))
                return;
 
-       /*
-        * Wa_22011802037
-        * TODO: Occasionally trying to stop the cs times out, but does not
-        * adversely affect functionality. The timeout is set as a config
-        * parameter that defaults to 100ms. Assuming that this timeout is
-        * sufficient for any pending MI_FORCEWAKEs to complete, ignore the
-        * timeout returned here until it is root caused.
-        */
        intel_engine_stop_cs(engine);
 
-       fw_pending = __cs_pending_mi_force_wakes(engine);
-       if (fw_pending)
-               __gpm_wait_for_fw_complete(engine->gt, fw_pending);
+       /*
+        * Wa_22011802037:gen11/gen12: In addition to stopping the cs, we need
+        * to wait for any pending mi force wakeups
+        */
+       intel_engine_wait_for_pending_mi_fw(engine);
 }
 
 static void guc_reset_nop(struct intel_engine_cs *engine)
index 7ba66ad68a8a1e5b1b92b32177e2c5fc8c8b23e5..16356611b5b9500bc2563b704bb0f8120a5dba2b 100644 (file)
@@ -680,7 +680,11 @@ nouveau_dmem_migrate_vma(struct nouveau_drm *drm,
                goto out_free_dma;
 
        for (i = 0; i < npages; i += max) {
-               args.end = start + (max << PAGE_SHIFT);
+               if (args.start + (max << PAGE_SHIFT) > end)
+                       args.end = end;
+               else
+                       args.end = args.start + (max << PAGE_SHIFT);
+
                ret = migrate_vma_setup(&args);
                if (ret)
                        goto out_free_pfns;
index 768242a78e2bf476c220dd024e809af29d6d1b13..5422363690e71d6f9a99903290ac218ed5381d8a 100644 (file)
@@ -627,7 +627,7 @@ static const struct drm_connector_funcs simpledrm_connector_funcs = {
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
-static int
+static enum drm_mode_status
 simpledrm_simple_display_pipe_mode_valid(struct drm_simple_display_pipe *pipe,
                                    const struct drm_display_mode *mode)
 {
index 590d3d550acba5005587179f3dff7fa06f616d65..e70d9614bec2c74b7206259da8dfc43824a05076 100644 (file)
@@ -100,6 +100,7 @@ config SENSORS_AD7418
 config SENSORS_ADM1021
        tristate "Analog Devices ADM1021 and compatibles"
        depends on I2C
+       depends on SENSORS_LM90=n
        help
          If you say yes here you get support for Analog Devices ADM1021
          and ADM1023 sensor chips and clones: Maxim MAX1617 and MAX1617A,
@@ -256,13 +257,13 @@ config SENSORS_AHT10
          will be called aht10.
 
 config SENSORS_AQUACOMPUTER_D5NEXT
-       tristate "Aquacomputer D5 Next, Octo, Farbwerk, and Farbwerk 360"
+       tristate "Aquacomputer D5 Next, Octo, Quadro, Farbwerk, and Farbwerk 360"
        depends on USB_HID
        select CRC16
        help
          If you say yes here you get support for sensors and fans of
-         the Aquacomputer D5 Next watercooling pump, Octo fan
-         controller, Farbwerk and Farbwerk 360 RGB controllers, where
+         the Aquacomputer D5 Next watercooling pump, Octo and Quadro fan
+         controllers, Farbwerk and Farbwerk 360 RGB controllers, where
          available.
 
          This driver can also be built as a module. If so, the module
@@ -381,7 +382,7 @@ config SENSORS_ARM_SCPI
 
 config SENSORS_ASB100
        tristate "Asus ASB100 Bach"
-       depends on X86 && I2C
+       depends on (X86 || COMPILE_TEST) && I2C
        select HWMON_VID
        help
          If you say yes here you get support for the ASB100 Bach sensor
@@ -626,7 +627,7 @@ config SENSORS_MC13783_ADC
 
 config SENSORS_FSCHMD
        tristate "Fujitsu Siemens Computers sensor chips"
-       depends on X86 && I2C
+       depends on (X86 || COMPILE_TEST) && I2C
        help
          If you say yes here you get support for the following Fujitsu
          Siemens Computers (FSC) sensor chips: Poseidon, Scylla, Hermes,
@@ -1102,6 +1103,7 @@ config SENSORS_MAX6639
 config SENSORS_MAX6642
        tristate "Maxim MAX6642 sensor chip"
        depends on I2C
+       depends on SENSORS_LM90=n
        help
          If you say yes here you get support for MAX6642 sensor chip.
          MAX6642 is a SMBus-Compatible Remote/Local Temperature Sensor
@@ -1357,12 +1359,15 @@ config SENSORS_LM90
        tristate "National Semiconductor LM90 and compatibles"
        depends on I2C
        help
-         If you say yes here you get support for National Semiconductor LM90,
-         LM86, LM89 and LM99, Analog Devices ADM1032, ADT7461, and ADT7461A,
-         Maxim MAX6646, MAX6647, MAX6648, MAX6649, MAX6654, MAX6657, MAX6658,
-         MAX6659, MAX6680, MAX6681, MAX6692, MAX6695, MAX6696,
-         ON Semiconductor NCT1008, Winbond/Nuvoton W83L771W/G/AWG/ASG,
-         Philips SA56004, GMT G781, Texas Instruments TMP451 and TMP461
+         If you say yes here you get support for National Semiconductor LM84,
+         LM90, LM86, LM89 and LM99, Analog Devices ADM1020, ADM2021, ADM1021A,
+         ADM1023, ADM1032, ADT7461, ADT7461A, ADT7481, ADT7482, and ADT7483A,
+         Maxim MAX1617, MAX6642, MAX6646, MAX6647, MAX6648, MAX6649, MAX6654,
+         MAX6657, MAX6658, MAX6659, MAX6680, MAX6681, MAX6692, MAX6695,
+         MAX6696,
+         ON Semiconductor NCT1008, NCT210, NCT72, NCT214, NCT218,
+         Winbond/Nuvoton W83L771W/G/AWG/ASG,
+         Philips NE1618, SA56004, GMT G781, Texas Instruments TMP451 and TMP461
          sensor chips.
 
          This driver can also be built as a module. If so, the module
index a0e69f7ece36e3aa2e61ebc04e825af58c0dd4bd..66430553cc45106d0ee5e96465cdb42aac089ce6 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * hwmon driver for Aquacomputer devices (D5 Next, Farbwerk, Farbwerk 360, Octo)
+ * hwmon driver for Aquacomputer devices (D5 Next, Farbwerk, Farbwerk 360, Octo,
+ * Quadro)
  *
  * Aquacomputer devices send HID reports (with ID 0x01) every second to report
  * sensor values.
 
 #define USB_VENDOR_ID_AQUACOMPUTER     0x0c70
 #define USB_PRODUCT_ID_FARBWERK                0xf00a
+#define USB_PRODUCT_ID_QUADRO          0xf00d
 #define USB_PRODUCT_ID_D5NEXT          0xf00e
 #define USB_PRODUCT_ID_FARBWERK360     0xf010
 #define USB_PRODUCT_ID_OCTO            0xf011
 
-enum kinds { d5next, farbwerk, farbwerk360, octo };
+enum kinds { d5next, farbwerk, farbwerk360, octo, quadro };
 
 static const char *const aqc_device_names[] = {
        [d5next] = "d5next",
        [farbwerk] = "farbwerk",
        [farbwerk360] = "farbwerk360",
-       [octo] = "octo"
+       [octo] = "octo",
+       [quadro] = "quadro"
 };
 
 #define DRIVER_NAME                    "aquacomputer_d5next"
@@ -54,60 +57,61 @@ static u8 secondary_ctrl_report[] = {
        0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x34, 0xC6
 };
 
-/* Register offsets for the D5 Next pump */
-#define D5NEXT_POWER_CYCLES            24
-
-#define D5NEXT_COOLANT_TEMP            87
-
-#define D5NEXT_PUMP_SPEED              116
-#define D5NEXT_FAN_SPEED               103
-
-#define D5NEXT_PUMP_POWER              114
-#define D5NEXT_FAN_POWER               101
-
-#define D5NEXT_PUMP_VOLTAGE            110
-#define D5NEXT_FAN_VOLTAGE             97
-#define D5NEXT_5V_VOLTAGE              57
+/* Register offsets for all Aquacomputer devices */
+#define AQC_TEMP_SENSOR_SIZE           0x02
+#define AQC_TEMP_SENSOR_DISCONNECTED   0x7FFF
+#define AQC_FAN_PERCENT_OFFSET         0x00
+#define AQC_FAN_VOLTAGE_OFFSET         0x02
+#define AQC_FAN_CURRENT_OFFSET         0x04
+#define AQC_FAN_POWER_OFFSET           0x06
+#define AQC_FAN_SPEED_OFFSET           0x08
 
-#define D5NEXT_PUMP_CURRENT            112
-#define D5NEXT_FAN_CURRENT             99
+/* Register offsets for the D5 Next pump */
+#define D5NEXT_POWER_CYCLES            0x18
+#define D5NEXT_COOLANT_TEMP            0x57
+#define D5NEXT_NUM_FANS                        2
+#define D5NEXT_NUM_SENSORS             1
+#define D5NEXT_PUMP_OFFSET             0x6c
+#define D5NEXT_FAN_OFFSET              0x5f
+#define D5NEXT_5V_VOLTAGE              0x39
+#define D5NEXT_12V_VOLTAGE             0x37
+#define D5NEXT_CTRL_REPORT_SIZE                0x329
+static u8 d5next_sensor_fan_offsets[] = { D5NEXT_PUMP_OFFSET, D5NEXT_FAN_OFFSET };
+
+/* Pump and fan speed registers in D5 Next control report (from 0-100%) */
+static u16 d5next_ctrl_fan_offsets[] = { 0x97, 0x42 };
 
 /* Register offsets for the Farbwerk RGB controller */
 #define FARBWERK_NUM_SENSORS           4
 #define FARBWERK_SENSOR_START          0x2f
-#define FARBWERK_SENSOR_SIZE           0x02
-#define FARBWERK_SENSOR_DISCONNECTED   0x7FFF
 
 /* Register offsets for the Farbwerk 360 RGB controller */
 #define FARBWERK360_NUM_SENSORS                4
 #define FARBWERK360_SENSOR_START       0x32
-#define FARBWERK360_SENSOR_SIZE                0x02
-#define FARBWERK360_SENSOR_DISCONNECTED        0x7FFF
 
 /* Register offsets for the Octo fan controller */
 #define OCTO_POWER_CYCLES              0x18
 #define OCTO_NUM_FANS                  8
-#define OCTO_FAN_PERCENT_OFFSET                0x00
-#define OCTO_FAN_VOLTAGE_OFFSET                0x02
-#define OCTO_FAN_CURRENT_OFFSET                0x04
-#define OCTO_FAN_POWER_OFFSET          0x06
-#define OCTO_FAN_SPEED_OFFSET          0x08
-
-static u8 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xCB, 0xD8 };
-
 #define OCTO_NUM_SENSORS               4
 #define OCTO_SENSOR_START              0x3D
-#define OCTO_SENSOR_SIZE               0x02
-#define OCTO_SENSOR_DISCONNECTED       0x7FFF
-
-#define OCTO_CTRL_REPORT_SIZE                  0x65F
-#define OCTO_CTRL_REPORT_CHECKSUM_OFFSET       0x65D
-#define OCTO_CTRL_REPORT_CHECKSUM_START                0x01
-#define OCTO_CTRL_REPORT_CHECKSUM_LENGTH       0x65C
+#define OCTO_CTRL_REPORT_SIZE          0x65F
+static u8 octo_sensor_fan_offsets[] = { 0x7D, 0x8A, 0x97, 0xA4, 0xB1, 0xBE, 0xCB, 0xD8 };
 
 /* Fan speed registers in Octo control report (from 0-100%) */
 static u16 octo_ctrl_fan_offsets[] = { 0x5B, 0xB0, 0x105, 0x15A, 0x1AF, 0x204, 0x259, 0x2AE };
 
+/* Register offsets for the Quadro fan controller */
+#define QUADRO_POWER_CYCLES            0x18
+#define QUADRO_NUM_FANS                        4
+#define QUADRO_NUM_SENSORS             4
+#define QUADRO_SENSOR_START            0x34
+#define QUADRO_CTRL_REPORT_SIZE                0x3c1
+#define QUADRO_FLOW_SENSOR_OFFSET      0x6e
+static u8 quadro_sensor_fan_offsets[] = { 0x70, 0x7D, 0x8A, 0x97 };
+
+/* Fan speed registers in Quadro control report (from 0-100%) */
+static u16 quadro_ctrl_fan_offsets[] = { 0x36, 0x8b, 0xe0, 0x135 };
+
 /* Labels for D5 Next */
 static const char *const label_d5next_temp[] = {
        "Coolant temp"
@@ -126,7 +130,8 @@ static const char *const label_d5next_power[] = {
 static const char *const label_d5next_voltages[] = {
        "Pump voltage",
        "Fan voltage",
-       "+5V voltage"
+       "+5V voltage",
+       "+12V voltage"
 };
 
 static const char *const label_d5next_current[] = {
@@ -134,7 +139,7 @@ static const char *const label_d5next_current[] = {
        "Fan current"
 };
 
-/* Labels for Farbwerk, Farbwerk 360 and Octo temperature sensors */
+/* Labels for Farbwerk, Farbwerk 360 and Octo and Quadro temperature sensors */
 static const char *const label_temp_sensors[] = {
        "Sensor 1",
        "Sensor 2",
@@ -142,7 +147,7 @@ static const char *const label_temp_sensors[] = {
        "Sensor 4"
 };
 
-/* Labels for Octo */
+/* Labels for Octo and Quadro (except speed) */
 static const char *const label_fan_speed[] = {
        "Fan 1 speed",
        "Fan 2 speed",
@@ -187,6 +192,15 @@ static const char *const label_fan_current[] = {
        "Fan 8 current"
 };
 
+/* Labels for Quadro fan speeds */
+static const char *const label_quadro_speeds[] = {
+       "Fan 1 speed",
+       "Fan 2 speed",
+       "Fan 3 speed",
+       "Fan 4 speed",
+       "Flow speed [dL/h]"
+};
+
 struct aqc_data {
        struct hid_device *hdev;
        struct device *hwmon_dev;
@@ -201,11 +215,19 @@ struct aqc_data {
        int checksum_length;
        int checksum_offset;
 
+       int num_fans;
+       u8 *fan_sensor_offsets;
+       u16 *fan_ctrl_offsets;
+       int num_temp_sensors;
+       int temp_sensor_start_offset;
+       u16 power_cycle_count_offset;
+       u8 flow_sensor_offset;
+
        /* General info, same across all devices */
        u32 serial_number[2];
        u16 firmware_version;
 
-       /* How many times the device was powered on */
+       /* How many times the device was powered on, if available */
        u32 power_cycles;
 
        /* Sensor values */
@@ -323,56 +345,47 @@ static umode_t aqc_is_visible(const void *data, enum hwmon_sensor_types type, u3
 
        switch (type) {
        case hwmon_temp:
-               switch (priv->kind) {
-               case d5next:
-                       if (channel == 0)
-                               return 0444;
-                       break;
-               case farbwerk:
-               case farbwerk360:
-               case octo:
+               if (channel < priv->num_temp_sensors)
                        return 0444;
-               default:
-                       break;
-               }
                break;
        case hwmon_pwm:
-               switch (priv->kind) {
-               case octo:
+               if (priv->fan_ctrl_offsets && channel < priv->num_fans) {
                        switch (attr) {
                        case hwmon_pwm_input:
                                return 0644;
                        default:
                                break;
                        }
-                       break;
-               default:
-                       break;
                }
                break;
        case hwmon_fan:
-       case hwmon_power:
-       case hwmon_curr:
                switch (priv->kind) {
-               case d5next:
-                       if (channel < 2)
+               case quadro:
+                       /* Special case to support flow sensor */
+                       if (channel < priv->num_fans + 1)
                                return 0444;
                        break;
-               case octo:
-                       return 0444;
                default:
+                       if (channel < priv->num_fans)
+                               return 0444;
                        break;
                }
                break;
+       case hwmon_power:
+       case hwmon_curr:
+               if (channel < priv->num_fans)
+                       return 0444;
+               break;
        case hwmon_in:
                switch (priv->kind) {
                case d5next:
-                       if (channel < 3)
+                       /* Special case to support +5V and +12V voltage sensors */
+                       if (channel < priv->num_fans + 2)
                                return 0444;
                        break;
-               case octo:
-                       return 0444;
                default:
+                       if (channel < priv->num_fans)
+                               return 0444;
                        break;
                }
                break;
@@ -406,16 +419,12 @@ static int aqc_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
                *val = priv->power_input[channel];
                break;
        case hwmon_pwm:
-               switch (priv->kind) {
-               case octo:
-                       ret = aqc_get_ctrl_val(priv, octo_ctrl_fan_offsets[channel]);
+               if (priv->fan_ctrl_offsets) {
+                       ret = aqc_get_ctrl_val(priv, priv->fan_ctrl_offsets[channel]);
                        if (ret < 0)
                                return ret;
 
                        *val = aqc_percent_to_pwm(ret);
-                       break;
-               default:
-                       break;
                }
                break;
        case hwmon_in:
@@ -469,19 +478,15 @@ static int aqc_write(struct device *dev, enum hwmon_sensor_types type, u32 attr,
        case hwmon_pwm:
                switch (attr) {
                case hwmon_pwm_input:
-                       switch (priv->kind) {
-                       case octo:
+                       if (priv->fan_ctrl_offsets) {
                                pwm_value = aqc_pwm_to_percent(val);
                                if (pwm_value < 0)
                                        return pwm_value;
 
-                               ret = aqc_set_ctrl_val(priv, octo_ctrl_fan_offsets[channel],
+                               ret = aqc_set_ctrl_val(priv, priv->fan_ctrl_offsets[channel],
                                                       pwm_value);
                                if (ret < 0)
                                        return ret;
-                               break;
-                       default:
-                               break;
                        }
                        break;
                default:
@@ -576,76 +581,42 @@ static int aqc_raw_event(struct hid_device *hdev, struct hid_report *report, u8
        priv->serial_number[1] = get_unaligned_be16(data + SERIAL_SECOND_PART);
        priv->firmware_version = get_unaligned_be16(data + FIRMWARE_VERSION);
 
-       /* Sensor readings */
-       switch (priv->kind) {
-       case d5next:
-               priv->power_cycles = get_unaligned_be32(data + D5NEXT_POWER_CYCLES);
-
-               priv->temp_input[0] = get_unaligned_be16(data + D5NEXT_COOLANT_TEMP) * 10;
+       /* Temperature sensor readings */
+       for (i = 0; i < priv->num_temp_sensors; i++) {
+               sensor_value = get_unaligned_be16(data +
+                                                 priv->temp_sensor_start_offset +
+                                                 i * AQC_TEMP_SENSOR_SIZE);
+               if (sensor_value == AQC_TEMP_SENSOR_DISCONNECTED)
+                       priv->temp_input[i] = -ENODATA;
+               else
+                       priv->temp_input[i] = sensor_value * 10;
+       }
 
-               priv->speed_input[0] = get_unaligned_be16(data + D5NEXT_PUMP_SPEED);
-               priv->speed_input[1] = get_unaligned_be16(data + D5NEXT_FAN_SPEED);
+       /* Fan speed and related readings */
+       for (i = 0; i < priv->num_fans; i++) {
+               priv->speed_input[i] =
+                   get_unaligned_be16(data + priv->fan_sensor_offsets[i] + AQC_FAN_SPEED_OFFSET);
+               priv->power_input[i] =
+                   get_unaligned_be16(data + priv->fan_sensor_offsets[i] +
+                                      AQC_FAN_POWER_OFFSET) * 10000;
+               priv->voltage_input[i] =
+                   get_unaligned_be16(data + priv->fan_sensor_offsets[i] +
+                                      AQC_FAN_VOLTAGE_OFFSET) * 10;
+               priv->current_input[i] =
+                   get_unaligned_be16(data + priv->fan_sensor_offsets[i] + AQC_FAN_CURRENT_OFFSET);
+       }
 
-               priv->power_input[0] = get_unaligned_be16(data + D5NEXT_PUMP_POWER) * 10000;
-               priv->power_input[1] = get_unaligned_be16(data + D5NEXT_FAN_POWER) * 10000;
+       if (priv->power_cycle_count_offset != 0)
+               priv->power_cycles = get_unaligned_be32(data + priv->power_cycle_count_offset);
 
-               priv->voltage_input[0] = get_unaligned_be16(data + D5NEXT_PUMP_VOLTAGE) * 10;
-               priv->voltage_input[1] = get_unaligned_be16(data + D5NEXT_FAN_VOLTAGE) * 10;
+       /* Special-case sensor readings */
+       switch (priv->kind) {
+       case d5next:
                priv->voltage_input[2] = get_unaligned_be16(data + D5NEXT_5V_VOLTAGE) * 10;
-
-               priv->current_input[0] = get_unaligned_be16(data + D5NEXT_PUMP_CURRENT);
-               priv->current_input[1] = get_unaligned_be16(data + D5NEXT_FAN_CURRENT);
-               break;
-       case farbwerk:
-               /* Temperature sensor readings */
-               for (i = 0; i < FARBWERK_NUM_SENSORS; i++) {
-                       sensor_value = get_unaligned_be16(data + FARBWERK_SENSOR_START +
-                                                         i * FARBWERK_SENSOR_SIZE);
-                       if (sensor_value == FARBWERK_SENSOR_DISCONNECTED)
-                               priv->temp_input[i] = -ENODATA;
-                       else
-                               priv->temp_input[i] = sensor_value * 10;
-               }
-               break;
-       case farbwerk360:
-               /* Temperature sensor readings */
-               for (i = 0; i < FARBWERK360_NUM_SENSORS; i++) {
-                       sensor_value = get_unaligned_be16(data + FARBWERK360_SENSOR_START +
-                                                         i * FARBWERK360_SENSOR_SIZE);
-                       if (sensor_value == FARBWERK360_SENSOR_DISCONNECTED)
-                               priv->temp_input[i] = -ENODATA;
-                       else
-                               priv->temp_input[i] = sensor_value * 10;
-               }
+               priv->voltage_input[3] = get_unaligned_be16(data + D5NEXT_12V_VOLTAGE) * 10;
                break;
-       case octo:
-               priv->power_cycles = get_unaligned_be32(data + OCTO_POWER_CYCLES);
-
-               /* Fan speed and related readings */
-               for (i = 0; i < OCTO_NUM_FANS; i++) {
-                       priv->speed_input[i] =
-                           get_unaligned_be16(data + octo_sensor_fan_offsets[i] +
-                                              OCTO_FAN_SPEED_OFFSET);
-                       priv->power_input[i] =
-                           get_unaligned_be16(data + octo_sensor_fan_offsets[i] +
-                                              OCTO_FAN_POWER_OFFSET) * 10000;
-                       priv->voltage_input[i] =
-                           get_unaligned_be16(data + octo_sensor_fan_offsets[i] +
-                                              OCTO_FAN_VOLTAGE_OFFSET) * 10;
-                       priv->current_input[i] =
-                           get_unaligned_be16(data + octo_sensor_fan_offsets[i] +
-                                              OCTO_FAN_CURRENT_OFFSET);
-               }
-
-               /* Temperature sensor readings */
-               for (i = 0; i < OCTO_NUM_SENSORS; i++) {
-                       sensor_value = get_unaligned_be16(data + OCTO_SENSOR_START +
-                                                         i * OCTO_SENSOR_SIZE);
-                       if (sensor_value == OCTO_SENSOR_DISCONNECTED)
-                               priv->temp_input[i] = -ENODATA;
-                       else
-                               priv->temp_input[i] = sensor_value * 10;
-               }
+       case quadro:
+               priv->speed_input[4] = get_unaligned_be16(data + priv->flow_sensor_offset);
                break;
        default:
                break;
@@ -699,14 +670,8 @@ static void aqc_debugfs_init(struct aqc_data *priv)
        debugfs_create_file("serial_number", 0444, priv->debugfs, priv, &serial_number_fops);
        debugfs_create_file("firmware_version", 0444, priv->debugfs, priv, &firmware_version_fops);
 
-       switch (priv->kind) {
-       case d5next:
-       case octo:
+       if (priv->power_cycle_count_offset != 0)
                debugfs_create_file("power_cycles", 0444, priv->debugfs, priv, &power_cycles_fops);
-               break;
-       default:
-               break;
-       }
 }
 
 #else
@@ -747,6 +712,14 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
        case USB_PRODUCT_ID_D5NEXT:
                priv->kind = d5next;
 
+               priv->num_fans = D5NEXT_NUM_FANS;
+               priv->fan_sensor_offsets = d5next_sensor_fan_offsets;
+               priv->fan_ctrl_offsets = d5next_ctrl_fan_offsets;
+               priv->num_temp_sensors = D5NEXT_NUM_SENSORS;
+               priv->temp_sensor_start_offset = D5NEXT_COOLANT_TEMP;
+               priv->power_cycle_count_offset = D5NEXT_POWER_CYCLES;
+               priv->buffer_size = D5NEXT_CTRL_REPORT_SIZE;
+
                priv->temp_label = label_d5next_temp;
                priv->speed_label = label_d5next_speeds;
                priv->power_label = label_d5next_power;
@@ -756,19 +729,29 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
        case USB_PRODUCT_ID_FARBWERK:
                priv->kind = farbwerk;
 
+               priv->num_fans = 0;
+               priv->num_temp_sensors = FARBWERK_NUM_SENSORS;
+               priv->temp_sensor_start_offset = FARBWERK_SENSOR_START;
                priv->temp_label = label_temp_sensors;
                break;
        case USB_PRODUCT_ID_FARBWERK360:
                priv->kind = farbwerk360;
 
+               priv->num_fans = 0;
+               priv->num_temp_sensors = FARBWERK360_NUM_SENSORS;
+               priv->temp_sensor_start_offset = FARBWERK360_SENSOR_START;
                priv->temp_label = label_temp_sensors;
                break;
        case USB_PRODUCT_ID_OCTO:
                priv->kind = octo;
+
+               priv->num_fans = OCTO_NUM_FANS;
+               priv->fan_sensor_offsets = octo_sensor_fan_offsets;
+               priv->fan_ctrl_offsets = octo_ctrl_fan_offsets;
+               priv->num_temp_sensors = OCTO_NUM_SENSORS;
+               priv->temp_sensor_start_offset = OCTO_SENSOR_START;
+               priv->power_cycle_count_offset = OCTO_POWER_CYCLES;
                priv->buffer_size = OCTO_CTRL_REPORT_SIZE;
-               priv->checksum_start = OCTO_CTRL_REPORT_CHECKSUM_START;
-               priv->checksum_length = OCTO_CTRL_REPORT_CHECKSUM_LENGTH;
-               priv->checksum_offset = OCTO_CTRL_REPORT_CHECKSUM_OFFSET;
 
                priv->temp_label = label_temp_sensors;
                priv->speed_label = label_fan_speed;
@@ -776,10 +759,34 @@ static int aqc_probe(struct hid_device *hdev, const struct hid_device_id *id)
                priv->voltage_label = label_fan_voltage;
                priv->current_label = label_fan_current;
                break;
+       case USB_PRODUCT_ID_QUADRO:
+               priv->kind = quadro;
+
+               priv->num_fans = QUADRO_NUM_FANS;
+               priv->fan_sensor_offsets = quadro_sensor_fan_offsets;
+               priv->fan_ctrl_offsets = quadro_ctrl_fan_offsets;
+               priv->num_temp_sensors = QUADRO_NUM_SENSORS;
+               priv->temp_sensor_start_offset = QUADRO_SENSOR_START;
+               priv->power_cycle_count_offset = QUADRO_POWER_CYCLES;
+               priv->buffer_size = QUADRO_CTRL_REPORT_SIZE;
+               priv->flow_sensor_offset = QUADRO_FLOW_SENSOR_OFFSET;
+
+               priv->temp_label = label_temp_sensors;
+               priv->speed_label = label_quadro_speeds;
+               priv->power_label = label_fan_power;
+               priv->voltage_label = label_fan_voltage;
+               priv->current_label = label_fan_current;
+               break;
        default:
                break;
        }
 
+       if (priv->buffer_size != 0) {
+               priv->checksum_start = 0x01;
+               priv->checksum_length = priv->buffer_size - 3;
+               priv->checksum_offset = priv->buffer_size - 2;
+       }
+
        priv->name = aqc_device_names[priv->kind];
 
        priv->buffer = devm_kzalloc(&hdev->dev, priv->buffer_size, GFP_KERNEL);
@@ -825,6 +832,7 @@ static const struct hid_device_id aqc_table[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_AQUACOMPUTER, USB_PRODUCT_ID_FARBWERK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_AQUACOMPUTER, USB_PRODUCT_ID_FARBWERK360) },
        { HID_USB_DEVICE(USB_VENDOR_ID_AQUACOMPUTER, USB_PRODUCT_ID_OCTO) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_AQUACOMPUTER, USB_PRODUCT_ID_QUADRO) },
        { }
 };
 
index 3cb88d6fbec04595ca95db5912c35e742693209b..d11f674e3dc37e7d601a1dbf87fb73f7eb47cd0e 100644 (file)
  * 11: reserved.
  */
 #define M_TACH_MODE 0x02 /* 10b */
-#define M_TACH_UNIT 0x0210
+#define M_TACH_UNIT 0x0420
 #define INIT_FAN_CTRL 0xFF
 
 /* How long we sleep in us while waiting for an RPM result. */
index 3633ab691662bf362baa2a1d08713144c956daea..61a4684fc020e1f5852bf3afc59c87efbd27bc42 100644 (file)
@@ -54,6 +54,10 @@ static char *mutex_path_override;
 /* ACPI mutex for locking access to the EC for the firmware */
 #define ASUS_HW_ACCESS_MUTEX_ASMX      "\\AMW0.ASMX"
 
+#define ASUS_HW_ACCESS_MUTEX_RMTW_ASMX "\\RMTW.ASMX"
+
+#define ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0 "\\_SB_.PCI0.SBRG.SIO1.MUT0"
+
 #define MAX_IDENTICAL_BOARD_VARIATIONS 3
 
 /* Moniker for the ACPI global lock (':' is not allowed in ASL identifiers) */
@@ -119,6 +123,18 @@ enum ec_sensors {
        ec_sensor_temp_water_in,
        /* "Water_Out" temperature sensor reading [℃] */
        ec_sensor_temp_water_out,
+       /* "Water_Block_In" temperature sensor reading [℃] */
+       ec_sensor_temp_water_block_in,
+       /* "Water_Block_Out" temperature sensor reading [℃] */
+       ec_sensor_temp_water_block_out,
+       /* "T_sensor_2" temperature sensor reading [℃] */
+       ec_sensor_temp_t_sensor_2,
+       /* "Extra_1" temperature sensor reading [℃] */
+       ec_sensor_temp_sensor_extra_1,
+       /* "Extra_2" temperature sensor reading [℃] */
+       ec_sensor_temp_sensor_extra_2,
+       /* "Extra_3" temperature sensor reading [℃] */
+       ec_sensor_temp_sensor_extra_3,
 };
 
 #define SENSOR_TEMP_CHIPSET BIT(ec_sensor_temp_chipset)
@@ -134,11 +150,19 @@ enum ec_sensors {
 #define SENSOR_CURR_CPU BIT(ec_sensor_curr_cpu)
 #define SENSOR_TEMP_WATER_IN BIT(ec_sensor_temp_water_in)
 #define SENSOR_TEMP_WATER_OUT BIT(ec_sensor_temp_water_out)
+#define SENSOR_TEMP_WATER_BLOCK_IN BIT(ec_sensor_temp_water_block_in)
+#define SENSOR_TEMP_WATER_BLOCK_OUT BIT(ec_sensor_temp_water_block_out)
+#define SENSOR_TEMP_T_SENSOR_2 BIT(ec_sensor_temp_t_sensor_2)
+#define SENSOR_TEMP_SENSOR_EXTRA_1 BIT(ec_sensor_temp_sensor_extra_1)
+#define SENSOR_TEMP_SENSOR_EXTRA_2 BIT(ec_sensor_temp_sensor_extra_2)
+#define SENSOR_TEMP_SENSOR_EXTRA_3 BIT(ec_sensor_temp_sensor_extra_3)
 
 enum board_family {
        family_unknown,
        family_amd_400_series,
        family_amd_500_series,
+       family_intel_300_series,
+       family_intel_600_series
 };
 
 /* All the known sensors for ASUS EC controllers */
@@ -195,12 +219,53 @@ static const struct ec_sensor_info sensors_family_amd_500[] = {
                EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x00),
        [ec_sensor_temp_water_out] =
                EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01),
+       [ec_sensor_temp_water_block_in] =
+               EC_SENSOR("Water_Block_In", hwmon_temp, 1, 0x01, 0x02),
+       [ec_sensor_temp_water_block_out] =
+               EC_SENSOR("Water_Block_Out", hwmon_temp, 1, 0x01, 0x03),
+       [ec_sensor_temp_sensor_extra_1] =
+               EC_SENSOR("Extra_1", hwmon_temp, 1, 0x01, 0x09),
+       [ec_sensor_temp_t_sensor_2] =
+               EC_SENSOR("T_sensor_2", hwmon_temp, 1, 0x01, 0x0a),
+       [ec_sensor_temp_sensor_extra_2] =
+               EC_SENSOR("Extra_2", hwmon_temp, 1, 0x01, 0x0b),
+       [ec_sensor_temp_sensor_extra_3] =
+               EC_SENSOR("Extra_3", hwmon_temp, 1, 0x01, 0x0c),
+};
+
+static const struct ec_sensor_info sensors_family_intel_300[] = {
+       [ec_sensor_temp_chipset] =
+               EC_SENSOR("Chipset", hwmon_temp, 1, 0x00, 0x3a),
+       [ec_sensor_temp_cpu] = EC_SENSOR("CPU", hwmon_temp, 1, 0x00, 0x3b),
+       [ec_sensor_temp_mb] =
+               EC_SENSOR("Motherboard", hwmon_temp, 1, 0x00, 0x3c),
+       [ec_sensor_temp_t_sensor] =
+               EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d),
+       [ec_sensor_temp_vrm] = EC_SENSOR("VRM", hwmon_temp, 1, 0x00, 0x3e),
+       [ec_sensor_fan_cpu_opt] =
+               EC_SENSOR("CPU_Opt", hwmon_fan, 2, 0x00, 0xb0),
+       [ec_sensor_fan_vrm_hs] = EC_SENSOR("VRM HS", hwmon_fan, 2, 0x00, 0xb2),
+       [ec_sensor_fan_water_flow] =
+               EC_SENSOR("Water_Flow", hwmon_fan, 2, 0x00, 0xbc),
+       [ec_sensor_temp_water_in] =
+               EC_SENSOR("Water_In", hwmon_temp, 1, 0x01, 0x00),
+       [ec_sensor_temp_water_out] =
+               EC_SENSOR("Water_Out", hwmon_temp, 1, 0x01, 0x01),
+};
+
+static const struct ec_sensor_info sensors_family_intel_600[] = {
+       [ec_sensor_temp_t_sensor] =
+               EC_SENSOR("T_Sensor", hwmon_temp, 1, 0x00, 0x3d),
+       [ec_sensor_temp_vrm] = EC_SENSOR("VRM", hwmon_temp, 1, 0x00, 0x3e),
 };
 
 /* Shortcuts for common combinations */
 #define SENSOR_SET_TEMP_CHIPSET_CPU_MB                                         \
        (SENSOR_TEMP_CHIPSET | SENSOR_TEMP_CPU | SENSOR_TEMP_MB)
 #define SENSOR_SET_TEMP_WATER (SENSOR_TEMP_WATER_IN | SENSOR_TEMP_WATER_OUT)
+#define SENSOR_SET_WATER_BLOCK                                                 \
+       (SENSOR_TEMP_WATER_BLOCK_IN | SENSOR_TEMP_WATER_BLOCK_OUT)
+
 
 struct ec_board_info {
        const char *board_names[MAX_IDENTICAL_BOARD_VARIATIONS];
@@ -272,6 +337,18 @@ static const struct ec_board_info board_info[] = {
                .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
                .family = family_amd_500_series,
        },
+       {
+               .board_names = {
+                       "ROG MAXIMUS XI HERO",
+                       "ROG MAXIMUS XI HERO (WI-FI)",
+               },
+               .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+                       SENSOR_TEMP_T_SENSOR |
+                       SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+                       SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW,
+               .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+               .family = family_intel_300_series,
+       },
        {
                .board_names = {"ROG CROSSHAIR VIII IMPACT"},
                .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
@@ -324,12 +401,31 @@ static const struct ec_board_info board_info[] = {
        },
        {
                .board_names = {"ROG STRIX X570-I GAMING"},
-               .sensors = SENSOR_TEMP_T_SENSOR | SENSOR_FAN_VRM_HS |
-                       SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
-                       SENSOR_IN_CPU_CORE,
+               .sensors = SENSOR_TEMP_CHIPSET | SENSOR_TEMP_VRM |
+                       SENSOR_TEMP_T_SENSOR |
+                       SENSOR_FAN_VRM_HS | SENSOR_FAN_CHIPSET |
+                       SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
                .mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
                .family = family_amd_500_series,
        },
+       {
+               .board_names = {"ROG STRIX Z690-A GAMING WIFI D4"},
+               .sensors = SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM,
+               .mutex_path = ASUS_HW_ACCESS_MUTEX_RMTW_ASMX,
+               .family = family_intel_600_series,
+       },
+       {
+               .board_names = {"ROG ZENITH II EXTREME"},
+               .sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_T_SENSOR |
+                       SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+                       SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET | SENSOR_FAN_VRM_HS |
+                       SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE |
+                       SENSOR_SET_WATER_BLOCK |
+                       SENSOR_TEMP_T_SENSOR_2 | SENSOR_TEMP_SENSOR_EXTRA_1 |
+                       SENSOR_TEMP_SENSOR_EXTRA_2 | SENSOR_TEMP_SENSOR_EXTRA_3,
+               .mutex_path = ASUS_HW_ACCESS_MUTEX_SB_PCI0_SBRG_SIO1_MUT0,
+               .family = family_amd_500_series,
+       },
        {}
 };
 
@@ -799,6 +895,12 @@ static int __init asus_ec_probe(struct platform_device *pdev)
        case family_amd_500_series:
                ec_data->sensors_info = sensors_family_amd_500;
                break;
+       case family_intel_300_series:
+               ec_data->sensors_info = sensors_family_intel_300;
+               break;
+       case family_intel_600_series:
+               ec_data->sensors_info = sensors_family_intel_600;
+               break;
        default:
                dev_err(dev, "Unknown board family: %d",
                        ec_data->board_info->family);
index 9e935e34c9983b8726d28dd17703fcb5b24506eb..6e8a908171f0aa99396454fff3c3a5042dde6b41 100644 (file)
@@ -514,22 +514,20 @@ static int asus_wmi_configure_sensor_setup(struct device *dev,
        int i, idx;
        int err;
 
-       temp_sensor = devm_kcalloc(dev, 1, sizeof(*temp_sensor), GFP_KERNEL);
-       if (!temp_sensor)
-               return -ENOMEM;
-
        for (i = 0; i < sensor_data->wmi.sensor_count; i++) {
-               err = asus_wmi_sensor_info(i, temp_sensor);
+               struct asus_wmi_sensor_info sensor;
+
+               err = asus_wmi_sensor_info(i, &sensor);
                if (err)
                        return err;
 
-               switch (temp_sensor->data_type) {
+               switch (sensor.data_type) {
                case TEMPERATURE_C:
                case VOLTAGE:
                case CURRENT:
                case FAN_RPM:
                case WATER_FLOW:
-                       type = asus_data_types[temp_sensor->data_type];
+                       type = asus_data_types[sensor.data_type];
                        if (!nr_count[type])
                                nr_types++;
                        nr_count[type]++;
index 071aa6f4e109b76567f21b9d02a2c6c934d56c9e..7f8d95dd2717642944dd226017d53b1832d96354 100644 (file)
@@ -130,7 +130,7 @@ struct smm_regs {
        unsigned int edx;
        unsigned int esi;
        unsigned int edi;
-} __packed;
+};
 
 static const char * const temp_labels[] = {
        "CPU",
@@ -175,77 +175,35 @@ static int i8k_smm_func(void *par)
        struct smm_regs *regs = par;
        int eax = regs->eax;
        int ebx = regs->ebx;
+       unsigned char carry;
        long long duration;
-       int rc;
 
        /* SMM requires CPU 0 */
        if (smp_processor_id() != 0)
                return -EBUSY;
 
-#if defined(CONFIG_X86_64)
-       asm volatile("pushq %%rax\n\t"
-               "movl 0(%%rax),%%edx\n\t"
-               "pushq %%rdx\n\t"
-               "movl 4(%%rax),%%ebx\n\t"
-               "movl 8(%%rax),%%ecx\n\t"
-               "movl 12(%%rax),%%edx\n\t"
-               "movl 16(%%rax),%%esi\n\t"
-               "movl 20(%%rax),%%edi\n\t"
-               "popq %%rax\n\t"
-               "out %%al,$0xb2\n\t"
-               "out %%al,$0x84\n\t"
-               "xchgq %%rax,(%%rsp)\n\t"
-               "movl %%ebx,4(%%rax)\n\t"
-               "movl %%ecx,8(%%rax)\n\t"
-               "movl %%edx,12(%%rax)\n\t"
-               "movl %%esi,16(%%rax)\n\t"
-               "movl %%edi,20(%%rax)\n\t"
-               "popq %%rdx\n\t"
-               "movl %%edx,0(%%rax)\n\t"
-               "pushfq\n\t"
-               "popq %%rax\n\t"
-               "andl $1,%%eax\n"
-               : "=a"(rc)
-               :    "a"(regs)
-               :    "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
-#else
-       asm volatile("pushl %%eax\n\t"
-           "movl 0(%%eax),%%edx\n\t"
-           "push %%edx\n\t"
-           "movl 4(%%eax),%%ebx\n\t"
-           "movl 8(%%eax),%%ecx\n\t"
-           "movl 12(%%eax),%%edx\n\t"
-           "movl 16(%%eax),%%esi\n\t"
-           "movl 20(%%eax),%%edi\n\t"
-           "popl %%eax\n\t"
-           "out %%al,$0xb2\n\t"
-           "out %%al,$0x84\n\t"
-           "xchgl %%eax,(%%esp)\n\t"
-           "movl %%ebx,4(%%eax)\n\t"
-           "movl %%ecx,8(%%eax)\n\t"
-           "movl %%edx,12(%%eax)\n\t"
-           "movl %%esi,16(%%eax)\n\t"
-           "movl %%edi,20(%%eax)\n\t"
-           "popl %%edx\n\t"
-           "movl %%edx,0(%%eax)\n\t"
-           "lahf\n\t"
-           "shrl $8,%%eax\n\t"
-           "andl $1,%%eax\n"
-           : "=a"(rc)
-           :    "a"(regs)
-           :    "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
-#endif
-       if (rc != 0 || (regs->eax & 0xffff) == 0xffff || regs->eax == eax)
-               rc = -EINVAL;
+       asm volatile("out %%al,$0xb2\n\t"
+                    "out %%al,$0x84\n\t"
+                    "setc %0\n"
+                    : "=mr" (carry),
+                      "+a" (regs->eax),
+                      "+b" (regs->ebx),
+                      "+c" (regs->ecx),
+                      "+d" (regs->edx),
+                      "+S" (regs->esi),
+                      "+D" (regs->edi));
 
        duration = ktime_us_delta(ktime_get(), calltime);
-       pr_debug("smm(0x%.4x 0x%.4x) = 0x%.4x  (took %7lld usecs)\n", eax, ebx,
-                (rc ? 0xffff : regs->eax & 0xffff), duration);
+       pr_debug("smm(0x%.4x 0x%.4x) = 0x%.4x carry: %d (took %7lld usecs)\n",
+                eax, ebx, regs->eax & 0xffff, carry, duration);
 
        if (duration > DELL_SMM_MAX_DURATION)
                pr_warn_once("SMM call took %lld usecs!\n", duration);
 
-       return rc;
+       if (carry || (regs->eax & 0xffff) == 0xffff || regs->eax == eax)
+               return -EINVAL;
+
+       return 0;
 }
 
 /*
@@ -1131,6 +1089,13 @@ static const struct i8k_config_data i8k_config_data[] __initconst = {
 };
 
 static const struct dmi_system_id i8k_dmi_table[] __initconst = {
+       {
+               .ident = "Dell G5 5590",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G5 5590"),
+               },
+       },
        {
                .ident = "Dell Inspiron",
                .matches = {
@@ -1365,6 +1330,14 @@ static const struct dmi_system_id i8k_whitelist_fan_control[] __initconst = {
                },
                .driver_data = (void *)&i8k_fan_control_data[I8K_FAN_34A3_35A3],
        },
+       {
+               .ident = "Dell XPS 13 7390",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+                       DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 13 7390"),
+               },
+               .driver_data = (void *)&i8k_fan_control_data[I8K_FAN_34A3_35A3],
+       },
        { }
 };
 
index 1eb37106a220bb05530f24d05ca6ee59acc4b3df..5bac2b0fc7bb6ada463a45d8c6516c36046f22a5 100644 (file)
@@ -621,3 +621,4 @@ module_exit(drivetemp_exit);
 MODULE_AUTHOR("Guenter Roeck <linus@roeck-us.net>");
 MODULE_DESCRIPTION("Hard drive temperature monitor");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:drivetemp");
index 6830e029995dc5caea75550a260eaccb24c274c3..19b6c643059a79a2954b1674ede819738ffc5fa0 100644 (file)
@@ -49,6 +49,7 @@
 #define SIO_F81768D_ID         0x1210  /* Chipset ID */
 #define SIO_F81865_ID          0x0704  /* Chipset ID */
 #define SIO_F81866_ID          0x1010  /* Chipset ID */
+#define SIO_F71858AD_ID                0x0903  /* Chipset ID */
 #define SIO_F81966_ID          0x1502  /* Chipset ID */
 
 #define REGION_LENGTH          8
@@ -2638,6 +2639,7 @@ static int __init f71882fg_find(int sioaddr, struct f71882fg_sio_data *sio_data)
                sio_data->type = f71808a;
                break;
        case SIO_F71858_ID:
+       case SIO_F71858AD_ID:
                sio_data->type = f71858fg;
                break;
        case SIO_F71862_ID:
index 1fe37418ff46c9f2a130c85bbc77aaac41956fdc..d64be48f1ef6c51c2490ee633824440b068f00b3 100644 (file)
@@ -269,10 +269,13 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
        /* fan controller base address */
        fan = of_find_compatible_node(dev->parent->of_node, NULL, "gw,gsc-fan");
        if (fan && of_property_read_u32(fan, "reg", &pdata->fan_base)) {
+               of_node_put(fan);
                dev_err(dev, "fan node without base\n");
                return ERR_PTR(-EINVAL);
        }
 
+       of_node_put(fan);
+
        /* allocate structures for channels and count instances of each type */
        device_for_each_child_node(dev, child) {
                if (fwnode_property_read_string(child, "label", &ch->name)) {
index 4e239bd75b1dae2cf8f3108b0cdefbba78d4afad..5a9d47a229e4066c8039e180818317af6e2f9197 100644 (file)
@@ -428,6 +428,10 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                        data->ccd_offset = 0x154;
                        k10temp_get_ccd_support(pdev, data, 8);
                        break;
+               case 0xa0 ... 0xaf:
+                       data->ccd_offset = 0x300;
+                       k10temp_get_ccd_support(pdev, data, 8);
+                       break;
                }
        } else if (boot_cpu_data.x86 == 0x19) {
                data->temp_adjust_mask = ZEN_CUR_TEMP_RANGE_SEL_MASK;
@@ -445,6 +449,11 @@ static int k10temp_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                        data->ccd_offset = 0x300;
                        k10temp_get_ccd_support(pdev, data, 8);
                        break;
+               case 0x60 ... 0x6f:
+               case 0x70 ... 0x7f:
+                       data->ccd_offset = 0x308;
+                       k10temp_get_ccd_support(pdev, data, 8);
+                       break;
                case 0x10 ... 0x1f:
                case 0xa0 ... 0xaf:
                        data->ccd_offset = 0x300;
@@ -489,10 +498,13 @@ static const struct pci_device_id k10temp_id_table[] = {
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M30H_DF_F3) },
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M60H_DF_F3) },
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_M70H_DF_F3) },
+       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3) },
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_DF_F3) },
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M10H_DF_F3) },
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M40H_DF_F3) },
        { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M50H_DF_F3) },
+       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M60H_DF_F3) },
+       { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_19H_M70H_DF_F3) },
        { PCI_VDEVICE(HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
        {}
 };
index a398171162a833be84342e699d0fc07ad4eba391..b803ada5e3c97a09969d13d6733fc4f33e211752 100644 (file)
@@ -11,7 +11,8 @@
  * which contains this code, we don't worry about the wasted space.
  */
 
-#include <linux/kernel.h>
+#include <linux/minmax.h>
+#include <linux/types.h>
 
 /* straight from the datasheet */
 #define LM75_TEMP_MIN (-55000)
index 3820f0e615108122168380be35bb82089cce5a3e..03d07da8c2dcf3f4a2d7b3d0e3ef5abc71a92cb0 100644 (file)
@@ -42,7 +42,8 @@
  * accordingly, and is done during initialization. Extended precision is only
  * available at conversion rates of 1 Hz and slower. Note that extended
  * precision is not enabled by default, as this driver initializes all chips
- * to 2 Hz by design.
+ * to 2 Hz by design. The driver also supports MAX6690, which is practically
+ * identical to MAX6654.
  *
  * This driver also supports the MAX6646, MAX6647, MAX6648, MAX6649 and
  * MAX6692 chips made by Maxim.  These are again similar to the LM86,
  * and extended mode. They are mostly compatible with LM90 except for a data
  * format difference for the temperature value registers.
  *
+ * This driver also supports ADT7481, ADT7482, and ADT7483 from Analog Devices
+ * / ON Semiconductor. The chips are similar to ADT7461 but support two external
+ * temperature sensors.
+ *
+ * This driver also supports NCT72, NCT214, and NCT218 from ON Semiconductor.
+ * The chips are similar to ADT7461/ADT7461A but have full PEC support
+ * (undocumented).
+ *
  * This driver also supports the SA56004 from Philips. This device is
  * pin-compatible with the LM86, the ED/EDP parts are also address-compatible.
  *
  * They are mostly compatible with ADT7461 except for local temperature
  * low byte register and max conversion rate.
  *
+ * This driver also supports MAX1617 and various clones such as G767
+ * and NE1617. Such clones will be detected as MAX1617.
+ *
+ * This driver also supports NE1618 from Philips. It is similar to NE1617
+ * but supports 11 bit external temperature values.
+ *
  * Since the LM90 was the first chipset supported by this driver, most
  * comments will refer to this chipset, but are actually general and
  * concern all supported chipsets, unless mentioned otherwise.
  */
 
-#include <linux/module.h>
+#include <linux/bits.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/i2c.h>
 #include <linux/init.h>
-#include <linux/slab.h>
+#include <linux/interrupt.h>
 #include <linux/jiffies.h>
-#include <linux/i2c.h>
 #include <linux/hwmon.h>
-#include <linux/err.h>
+#include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/of_device.h>
-#include <linux/sysfs.h>
-#include <linux/interrupt.h>
 #include <linux/regulator/consumer.h>
+#include <linux/slab.h>
+#include <linux/workqueue.h>
+
+/* The maximum number of channels currently supported */
+#define MAX_CHANNELS   3
 
 /*
  * Addresses to scan
@@ -112,119 +132,131 @@ static const unsigned short normal_i2c[] = {
        0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x48, 0x49, 0x4a, 0x4b, 0x4c,
        0x4d, 0x4e, 0x4f, I2C_CLIENT_END };
 
-enum chips { lm90, adm1032, lm99, lm86, max6657, max6659, adt7461, max6680,
-       max6646, w83l771, max6696, sa56004, g781, tmp451, tmp461, max6654 };
+enum chips { adm1023, adm1032, adt7461, adt7461a, adt7481,
+       g781, lm84, lm90, lm99,
+       max1617, max6642, max6646, max6648, max6654, max6657, max6659, max6680, max6696,
+       nct210, nct72, ne1618, sa56004, tmp451, tmp461, w83l771,
+};
 
 /*
  * The LM90 registers
  */
 
-#define LM90_REG_R_MAN_ID              0xFE
-#define LM90_REG_R_CHIP_ID             0xFF
-#define LM90_REG_R_CONFIG1             0x03
-#define LM90_REG_W_CONFIG1             0x09
-#define LM90_REG_R_CONFIG2             0xBF
-#define LM90_REG_W_CONFIG2             0xBF
-#define LM90_REG_R_CONVRATE            0x04
-#define LM90_REG_W_CONVRATE            0x0A
-#define LM90_REG_R_STATUS              0x02
-#define LM90_REG_R_LOCAL_TEMP          0x00
-#define LM90_REG_R_LOCAL_HIGH          0x05
-#define LM90_REG_W_LOCAL_HIGH          0x0B
-#define LM90_REG_R_LOCAL_LOW           0x06
-#define LM90_REG_W_LOCAL_LOW           0x0C
-#define LM90_REG_R_LOCAL_CRIT          0x20
-#define LM90_REG_W_LOCAL_CRIT          0x20
-#define LM90_REG_R_REMOTE_TEMPH                0x01
-#define LM90_REG_R_REMOTE_TEMPL                0x10
-#define LM90_REG_R_REMOTE_OFFSH                0x11
-#define LM90_REG_W_REMOTE_OFFSH                0x11
-#define LM90_REG_R_REMOTE_OFFSL                0x12
-#define LM90_REG_W_REMOTE_OFFSL                0x12
-#define LM90_REG_R_REMOTE_HIGHH                0x07
-#define LM90_REG_W_REMOTE_HIGHH                0x0D
-#define LM90_REG_R_REMOTE_HIGHL                0x13
-#define LM90_REG_W_REMOTE_HIGHL                0x13
-#define LM90_REG_R_REMOTE_LOWH         0x08
-#define LM90_REG_W_REMOTE_LOWH         0x0E
-#define LM90_REG_R_REMOTE_LOWL         0x14
-#define LM90_REG_W_REMOTE_LOWL         0x14
-#define LM90_REG_R_REMOTE_CRIT         0x19
-#define LM90_REG_W_REMOTE_CRIT         0x19
-#define LM90_REG_R_TCRIT_HYST          0x21
-#define LM90_REG_W_TCRIT_HYST          0x21
+#define LM90_REG_MAN_ID                        0xFE
+#define LM90_REG_CHIP_ID               0xFF
+#define LM90_REG_CONFIG1               0x03
+#define LM90_REG_CONFIG2               0xBF
+#define LM90_REG_CONVRATE              0x04
+#define LM90_REG_STATUS                        0x02
+#define LM90_REG_LOCAL_TEMP            0x00
+#define LM90_REG_LOCAL_HIGH            0x05
+#define LM90_REG_LOCAL_LOW             0x06
+#define LM90_REG_LOCAL_CRIT            0x20
+#define LM90_REG_REMOTE_TEMPH          0x01
+#define LM90_REG_REMOTE_TEMPL          0x10
+#define LM90_REG_REMOTE_OFFSH          0x11
+#define LM90_REG_REMOTE_OFFSL          0x12
+#define LM90_REG_REMOTE_HIGHH          0x07
+#define LM90_REG_REMOTE_HIGHL          0x13
+#define LM90_REG_REMOTE_LOWH           0x08
+#define LM90_REG_REMOTE_LOWL           0x14
+#define LM90_REG_REMOTE_CRIT           0x19
+#define LM90_REG_TCRIT_HYST            0x21
 
 /* MAX6646/6647/6649/6654/6657/6658/6659/6695/6696 registers */
 
-#define MAX6657_REG_R_LOCAL_TEMPL      0x11
-#define MAX6696_REG_R_STATUS2          0x12
-#define MAX6659_REG_R_REMOTE_EMERG     0x16
-#define MAX6659_REG_W_REMOTE_EMERG     0x16
-#define MAX6659_REG_R_LOCAL_EMERG      0x17
-#define MAX6659_REG_W_LOCAL_EMERG      0x17
+#define MAX6657_REG_LOCAL_TEMPL                0x11
+#define MAX6696_REG_STATUS2            0x12
+#define MAX6659_REG_REMOTE_EMERG       0x16
+#define MAX6659_REG_LOCAL_EMERG                0x17
 
 /*  SA56004 registers */
 
-#define SA56004_REG_R_LOCAL_TEMPL 0x22
+#define SA56004_REG_LOCAL_TEMPL                0x22
 
 #define LM90_MAX_CONVRATE_MS   16000   /* Maximum conversion rate in ms */
 
 /* TMP451/TMP461 registers */
-#define TMP451_REG_R_LOCAL_TEMPL       0x15
+#define TMP451_REG_LOCAL_TEMPL         0x15
 #define TMP451_REG_CONALERT            0x22
 
 #define TMP461_REG_CHEN                        0x16
 #define TMP461_REG_DFC                 0x24
 
-/*
- * Device flags
- */
-#define LM90_FLAG_ADT7461_EXT  (1 << 0) /* ADT7461 extended mode       */
+/* ADT7481 registers */
+#define ADT7481_REG_STATUS2            0x23
+#define ADT7481_REG_CONFIG2            0x24
+
+#define ADT7481_REG_MAN_ID             0x3e
+#define ADT7481_REG_CHIP_ID            0x3d
+
 /* Device features */
-#define LM90_HAVE_OFFSET       (1 << 1) /* temperature offset register */
-#define LM90_HAVE_REM_LIMIT_EXT        (1 << 3) /* extended remote limit       */
-#define LM90_HAVE_EMERGENCY    (1 << 4) /* 3rd upper (emergency) limit */
-#define LM90_HAVE_EMERGENCY_ALARM (1 << 5)/* emergency alarm           */
-#define LM90_HAVE_TEMP3                (1 << 6) /* 3rd temperature sensor      */
-#define LM90_HAVE_BROKEN_ALERT (1 << 7) /* Broken alert                */
-#define LM90_HAVE_EXTENDED_TEMP        (1 << 8) /* extended temperature support*/
-#define LM90_PAUSE_FOR_CONFIG  (1 << 9) /* Pause conversion for config */
-#define LM90_HAVE_CRIT         (1 << 10)/* Chip supports CRIT/OVERT register   */
-#define LM90_HAVE_CRIT_ALRM_SWP        (1 << 11)/* critical alarm bits swapped */
+#define LM90_HAVE_EXTENDED_TEMP        BIT(0)  /* extended temperature support */
+#define LM90_HAVE_OFFSET       BIT(1)  /* temperature offset register  */
+#define LM90_HAVE_UNSIGNED_TEMP        BIT(2)  /* temperatures are unsigned    */
+#define LM90_HAVE_REM_LIMIT_EXT        BIT(3)  /* extended remote limit        */
+#define LM90_HAVE_EMERGENCY    BIT(4)  /* 3rd upper (emergency) limit  */
+#define LM90_HAVE_EMERGENCY_ALARM BIT(5)/* emergency alarm             */
+#define LM90_HAVE_TEMP3                BIT(6)  /* 3rd temperature sensor       */
+#define LM90_HAVE_BROKEN_ALERT BIT(7)  /* Broken alert                 */
+#define LM90_PAUSE_FOR_CONFIG  BIT(8)  /* Pause conversion for config  */
+#define LM90_HAVE_CRIT         BIT(9)  /* Chip supports CRIT/OVERT register    */
+#define LM90_HAVE_CRIT_ALRM_SWP        BIT(10) /* critical alarm bits swapped  */
+#define LM90_HAVE_PEC          BIT(11) /* Chip supports PEC            */
+#define LM90_HAVE_PARTIAL_PEC  BIT(12) /* Partial PEC support (adm1032)*/
+#define LM90_HAVE_ALARMS       BIT(13) /* Create 'alarms' attribute    */
+#define LM90_HAVE_EXT_UNSIGNED BIT(14) /* extended unsigned temperature*/
+#define LM90_HAVE_LOW          BIT(15) /* low limits                   */
+#define LM90_HAVE_CONVRATE     BIT(16) /* conversion rate              */
+#define LM90_HAVE_REMOTE_EXT   BIT(17) /* extended remote temperature  */
+#define LM90_HAVE_FAULTQUEUE   BIT(18) /* configurable samples count   */
 
 /* LM90 status */
-#define LM90_STATUS_LTHRM      (1 << 0) /* local THERM limit tripped */
-#define LM90_STATUS_RTHRM      (1 << 1) /* remote THERM limit tripped */
-#define LM90_STATUS_ROPEN      (1 << 2) /* remote is an open circuit */
-#define LM90_STATUS_RLOW       (1 << 3) /* remote low temp limit tripped */
-#define LM90_STATUS_RHIGH      (1 << 4) /* remote high temp limit tripped */
-#define LM90_STATUS_LLOW       (1 << 5) /* local low temp limit tripped */
-#define LM90_STATUS_LHIGH      (1 << 6) /* local high temp limit tripped */
-#define LM90_STATUS_BUSY       (1 << 7) /* conversion is ongoing */
-
-#define MAX6696_STATUS2_R2THRM (1 << 1) /* remote2 THERM limit tripped */
-#define MAX6696_STATUS2_R2OPEN (1 << 2) /* remote2 is an open circuit */
-#define MAX6696_STATUS2_R2LOW  (1 << 3) /* remote2 low temp limit tripped */
-#define MAX6696_STATUS2_R2HIGH (1 << 4) /* remote2 high temp limit tripped */
-#define MAX6696_STATUS2_ROT2   (1 << 5) /* remote emergency limit tripped */
-#define MAX6696_STATUS2_R2OT2  (1 << 6) /* remote2 emergency limit tripped */
-#define MAX6696_STATUS2_LOT2   (1 << 7) /* local emergency limit tripped */
+#define LM90_STATUS_LTHRM      BIT(0)  /* local THERM limit tripped */
+#define LM90_STATUS_RTHRM      BIT(1)  /* remote THERM limit tripped */
+#define LM90_STATUS_ROPEN      BIT(2)  /* remote is an open circuit */
+#define LM90_STATUS_RLOW       BIT(3)  /* remote low temp limit tripped */
+#define LM90_STATUS_RHIGH      BIT(4)  /* remote high temp limit tripped */
+#define LM90_STATUS_LLOW       BIT(5)  /* local low temp limit tripped */
+#define LM90_STATUS_LHIGH      BIT(6)  /* local high temp limit tripped */
+#define LM90_STATUS_BUSY       BIT(7)  /* conversion is ongoing */
+
+/* MAX6695/6696 and ADT7481 2nd status register */
+#define MAX6696_STATUS2_R2THRM BIT(1)  /* remote2 THERM limit tripped */
+#define MAX6696_STATUS2_R2OPEN BIT(2)  /* remote2 is an open circuit */
+#define MAX6696_STATUS2_R2LOW  BIT(3)  /* remote2 low temp limit tripped */
+#define MAX6696_STATUS2_R2HIGH BIT(4)  /* remote2 high temp limit tripped */
+#define MAX6696_STATUS2_ROT2   BIT(5)  /* remote emergency limit tripped */
+#define MAX6696_STATUS2_R2OT2  BIT(6)  /* remote2 emergency limit tripped */
+#define MAX6696_STATUS2_LOT2   BIT(7)  /* local emergency limit tripped */
 
 /*
  * Driver data (common to all clients)
  */
 
 static const struct i2c_device_id lm90_id[] = {
+       { "adm1020", max1617 },
+       { "adm1021", max1617 },
+       { "adm1023", adm1023 },
        { "adm1032", adm1032 },
+       { "adt7421", adt7461a },
        { "adt7461", adt7461 },
-       { "adt7461a", adt7461 },
+       { "adt7461a", adt7461a },
+       { "adt7481", adt7481 },
+       { "adt7482", adt7481 },
+       { "adt7483a", adt7481 },
        { "g781", g781 },
+       { "gl523sm", max1617 },
+       { "lm84", lm84 },
+       { "lm86", lm90 },
+       { "lm89", lm90 },
        { "lm90", lm90 },
-       { "lm86", lm86 },
-       { "lm89", lm86 },
        { "lm99", lm99 },
+       { "max1617", max1617 },
+       { "max6642", max6642 },
        { "max6646", max6646 },
        { "max6647", max6646 },
+       { "max6648", max6648 },
        { "max6649", max6646 },
        { "max6654", max6654 },
        { "max6657", max6657 },
@@ -232,11 +264,20 @@ static const struct i2c_device_id lm90_id[] = {
        { "max6659", max6659 },
        { "max6680", max6680 },
        { "max6681", max6680 },
+       { "max6690", max6654 },
+       { "max6692", max6648 },
        { "max6695", max6696 },
        { "max6696", max6696 },
-       { "nct1008", adt7461 },
+       { "mc1066", max1617 },
+       { "nct1008", adt7461a },
+       { "nct210", nct210 },
+       { "nct214", nct72 },
+       { "nct218", nct72 },
+       { "nct72", nct72 },
+       { "ne1618", ne1618 },
        { "w83l771", w83l771 },
        { "sa56004", sa56004 },
+       { "thmc10", max1617 },
        { "tmp451", tmp451 },
        { "tmp461", tmp461 },
        { }
@@ -254,7 +295,11 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
        },
        {
                .compatible = "adi,adt7461a",
-               .data = (void *)adt7461
+               .data = (void *)adt7461a
+       },
+       {
+               .compatible = "adi,adt7481",
+               .data = (void *)adt7481
        },
        {
                .compatible = "gmt,g781",
@@ -266,11 +311,11 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
        },
        {
                .compatible = "national,lm86",
-               .data = (void *)lm86
+               .data = (void *)lm90
        },
        {
                .compatible = "national,lm89",
-               .data = (void *)lm86
+               .data = (void *)lm90
        },
        {
                .compatible = "national,lm99",
@@ -322,7 +367,19 @@ static const struct of_device_id __maybe_unused lm90_of_match[] = {
        },
        {
                .compatible = "onnn,nct1008",
-               .data = (void *)adt7461
+               .data = (void *)adt7461a
+       },
+       {
+               .compatible = "onnn,nct214",
+               .data = (void *)nct72
+       },
+       {
+               .compatible = "onnn,nct218",
+               .data = (void *)nct72
+       },
+       {
+               .compatible = "onnn,nct72",
+               .data = (void *)nct72
        },
        {
                .compatible = "winbond,w83l771",
@@ -352,115 +409,252 @@ struct lm90_params {
        u16 alert_alarms;       /* Which alarm bits trigger ALERT# */
                                /* Upper 8 bits for max6695/96 */
        u8 max_convrate;        /* Maximum conversion rate register value */
+       u8 resolution;          /* 16-bit resolution (default 11 bit) */
+       u8 reg_status2;         /* 2nd status register (optional) */
        u8 reg_local_ext;       /* Extended local temp register (optional) */
+       u8 faultqueue_mask;     /* fault queue bit mask */
+       u8 faultqueue_depth;    /* fault queue depth if mask is used */
 };
 
 static const struct lm90_params lm90_params[] = {
+       [adm1023] = {
+               .flags = LM90_HAVE_ALARMS | LM90_HAVE_OFFSET | LM90_HAVE_BROKEN_ALERT
+                 | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT,
+               .alert_alarms = 0x7c,
+               .resolution = 8,
+               .max_convrate = 7,
+       },
        [adm1032] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT,
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT
+                 | LM90_HAVE_PARTIAL_PEC | LM90_HAVE_ALARMS
+                 | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
+                 | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7c,
                .max_convrate = 10,
        },
        [adt7461] = {
+               /*
+                * Standard temperature range is supposed to be unsigned,
+                * but that does not match reality. Negative temperatures
+                * are always reported.
+                */
+               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
+                 | LM90_HAVE_CRIT | LM90_HAVE_PARTIAL_PEC
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
+               .alert_alarms = 0x7c,
+               .max_convrate = 10,
+               .resolution = 10,
+       },
+       [adt7461a] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
                  | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
-                 | LM90_HAVE_CRIT,
+                 | LM90_HAVE_CRIT | LM90_HAVE_PEC | LM90_HAVE_ALARMS
+                 | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
+                 | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7c,
                .max_convrate = 10,
        },
+       [adt7481] = {
+               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
+                 | LM90_HAVE_UNSIGNED_TEMP | LM90_HAVE_PEC
+                 | LM90_HAVE_TEMP3 | LM90_HAVE_CRIT | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
+                 | LM90_HAVE_FAULTQUEUE,
+               .alert_alarms = 0x1c7c,
+               .max_convrate = 11,
+               .resolution = 10,
+               .reg_status2 = ADT7481_REG_STATUS2,
+       },
        [g781] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT,
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7c,
                .max_convrate = 7,
        },
-       [lm86] = {
-               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_CRIT,
-               .alert_alarms = 0x7b,
-               .max_convrate = 9,
+       [lm84] = {
+               .flags = LM90_HAVE_ALARMS,
+               .resolution = 8,
        },
        [lm90] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_CRIT,
+                 | LM90_HAVE_CRIT | LM90_HAVE_ALARMS | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
+                 | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7b,
                .max_convrate = 9,
+               .faultqueue_mask = BIT(0),
+               .faultqueue_depth = 3,
        },
        [lm99] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_CRIT,
+                 | LM90_HAVE_CRIT | LM90_HAVE_ALARMS | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
+                 | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7b,
                .max_convrate = 9,
+               .faultqueue_mask = BIT(0),
+               .faultqueue_depth = 3,
+       },
+       [max1617] = {
+               .flags = LM90_HAVE_CONVRATE | LM90_HAVE_BROKEN_ALERT |
+                 LM90_HAVE_LOW | LM90_HAVE_ALARMS,
+               .alert_alarms = 0x78,
+               .resolution = 8,
+               .max_convrate = 7,
+       },
+       [max6642] = {
+               .flags = LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXT_UNSIGNED
+                 | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
+               .alert_alarms = 0x50,
+               .resolution = 10,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
+               .faultqueue_mask = BIT(4),
+               .faultqueue_depth = 2,
        },
        [max6646] = {
-               .flags = LM90_HAVE_CRIT | LM90_HAVE_BROKEN_ALERT,
+               .flags = LM90_HAVE_CRIT | LM90_HAVE_BROKEN_ALERT
+                 | LM90_HAVE_EXT_UNSIGNED | LM90_HAVE_ALARMS | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT,
                .alert_alarms = 0x7c,
                .max_convrate = 6,
-               .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
+       },
+       [max6648] = {
+               .flags = LM90_HAVE_UNSIGNED_TEMP | LM90_HAVE_CRIT
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT,
+               .alert_alarms = 0x7c,
+               .max_convrate = 6,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
        },
        [max6654] = {
-               .flags = LM90_HAVE_BROKEN_ALERT,
+               .flags = LM90_HAVE_BROKEN_ALERT | LM90_HAVE_ALARMS | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT,
                .alert_alarms = 0x7c,
                .max_convrate = 7,
-               .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
        },
        [max6657] = {
-               .flags = LM90_PAUSE_FOR_CONFIG | LM90_HAVE_CRIT,
+               .flags = LM90_PAUSE_FOR_CONFIG | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT,
                .alert_alarms = 0x7c,
                .max_convrate = 8,
-               .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
        },
        [max6659] = {
-               .flags = LM90_HAVE_EMERGENCY | LM90_HAVE_CRIT,
+               .flags = LM90_HAVE_EMERGENCY | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT,
                .alert_alarms = 0x7c,
                .max_convrate = 8,
-               .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
        },
        [max6680] = {
+               /*
+                * Apparent temperatures of 128 degrees C or higher are reported
+                * and treated as negative temperatures (meaning min_alarm will
+                * be set).
+                */
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_CRIT
-                 | LM90_HAVE_CRIT_ALRM_SWP | LM90_HAVE_BROKEN_ALERT,
+                 | LM90_HAVE_CRIT_ALRM_SWP | LM90_HAVE_BROKEN_ALERT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT,
                .alert_alarms = 0x7c,
                .max_convrate = 7,
        },
        [max6696] = {
                .flags = LM90_HAVE_EMERGENCY
-                 | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3 | LM90_HAVE_CRIT,
+                 | LM90_HAVE_EMERGENCY_ALARM | LM90_HAVE_TEMP3 | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x1c7c,
                .max_convrate = 6,
-               .reg_local_ext = MAX6657_REG_R_LOCAL_TEMPL,
+               .reg_status2 = MAX6696_REG_STATUS2,
+               .reg_local_ext = MAX6657_REG_LOCAL_TEMPL,
+               .faultqueue_mask = BIT(5),
+               .faultqueue_depth = 4,
+       },
+       [nct72] = {
+               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP
+                 | LM90_HAVE_CRIT | LM90_HAVE_PEC | LM90_HAVE_UNSIGNED_TEMP
+                 | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT
+                 | LM90_HAVE_FAULTQUEUE,
+               .alert_alarms = 0x7c,
+               .max_convrate = 10,
+               .resolution = 10,
+       },
+       [nct210] = {
+               .flags = LM90_HAVE_ALARMS | LM90_HAVE_BROKEN_ALERT
+                 | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT,
+               .alert_alarms = 0x7c,
+               .resolution = 11,
+               .max_convrate = 7,
+       },
+       [ne1618] = {
+               .flags = LM90_PAUSE_FOR_CONFIG | LM90_HAVE_BROKEN_ALERT
+                 | LM90_HAVE_LOW | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT,
+               .alert_alarms = 0x7c,
+               .resolution = 11,
+               .max_convrate = 7,
        },
        [w83l771] = {
-               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT,
+               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT,
                .alert_alarms = 0x7c,
                .max_convrate = 8,
        },
        [sa56004] = {
-               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT,
+               /*
+                * Apparent temperatures of 128 degrees C or higher are reported
+                * and treated as negative temperatures (meaning min_alarm will
+                * be set).
+                */
+               .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7b,
                .max_convrate = 9,
-               .reg_local_ext = SA56004_REG_R_LOCAL_TEMPL,
+               .reg_local_ext = SA56004_REG_LOCAL_TEMPL,
+               .faultqueue_mask = BIT(0),
+               .faultqueue_depth = 3,
        },
        [tmp451] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP | LM90_HAVE_CRIT,
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP | LM90_HAVE_CRIT
+                 | LM90_HAVE_UNSIGNED_TEMP | LM90_HAVE_ALARMS | LM90_HAVE_LOW
+                 | LM90_HAVE_CONVRATE | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7c,
                .max_convrate = 9,
-               .reg_local_ext = TMP451_REG_R_LOCAL_TEMPL,
+               .resolution = 12,
+               .reg_local_ext = TMP451_REG_LOCAL_TEMPL,
        },
        [tmp461] = {
                .flags = LM90_HAVE_OFFSET | LM90_HAVE_REM_LIMIT_EXT
-                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP | LM90_HAVE_CRIT,
+                 | LM90_HAVE_BROKEN_ALERT | LM90_HAVE_EXTENDED_TEMP | LM90_HAVE_CRIT
+                 | LM90_HAVE_ALARMS | LM90_HAVE_LOW | LM90_HAVE_CONVRATE
+                 | LM90_HAVE_REMOTE_EXT | LM90_HAVE_FAULTQUEUE,
                .alert_alarms = 0x7c,
                .max_convrate = 9,
-               .reg_local_ext = TMP451_REG_R_LOCAL_TEMPL,
+               .resolution = 12,
+               .reg_local_ext = TMP451_REG_LOCAL_TEMPL,
        },
 };
 
 /*
- * TEMP8 register index
+ * temperature register index
  */
-enum lm90_temp8_reg_index {
+enum lm90_temp_reg_index {
        LOCAL_LOW = 0,
        LOCAL_HIGH,
        LOCAL_CRIT,
@@ -469,14 +663,8 @@ enum lm90_temp8_reg_index {
        REMOTE_EMERG,   /* max6659 and max6695/96 */
        REMOTE2_CRIT,   /* max6695/96 only */
        REMOTE2_EMERG,  /* max6695/96 only */
-       TEMP8_REG_NUM
-};
 
-/*
- * TEMP11 register index
- */
-enum lm90_temp11_reg_index {
-       REMOTE_TEMP = 0,
+       REMOTE_TEMP,
        REMOTE_LOW,
        REMOTE_HIGH,
        REMOTE_OFFSET,  /* except max6646, max6657/58/59, and max6695/96 */
@@ -484,7 +672,9 @@ enum lm90_temp11_reg_index {
        REMOTE2_TEMP,   /* max6695/96 only */
        REMOTE2_LOW,    /* max6695/96 only */
        REMOTE2_HIGH,   /* max6695/96 only */
-       TEMP11_REG_NUM
+       REMOTE2_OFFSET,
+
+       TEMP_REG_NUM
 };
 
 /*
@@ -494,13 +684,20 @@ enum lm90_temp11_reg_index {
 struct lm90_data {
        struct i2c_client *client;
        struct device *hwmon_dev;
-       u32 channel_config[4];
+       u32 chip_config[2];
+       u32 channel_config[MAX_CHANNELS + 1];
+       const char *channel_label[MAX_CHANNELS];
+       struct hwmon_channel_info chip_info;
        struct hwmon_channel_info temp_info;
        const struct hwmon_channel_info *info[3];
        struct hwmon_chip_info chip;
        struct mutex update_lock;
+       struct delayed_work alert_work;
+       struct work_struct report_work;
        bool valid;             /* true if register values are valid */
+       bool alarms_valid;      /* true if status register values are valid */
        unsigned long last_updated; /* in jiffies */
+       unsigned long alarms_updated; /* in jiffies */
        int kind;
        u32 flags;
 
@@ -509,16 +706,23 @@ struct lm90_data {
        u8 config;              /* Current configuration register value */
        u8 config_orig;         /* Original configuration register value */
        u8 convrate_orig;       /* Original conversion rate register value */
+       u8 resolution;          /* temperature resolution in bit */
        u16 alert_alarms;       /* Which alarm bits trigger ALERT# */
                                /* Upper 8 bits for max6695/96 */
        u8 max_convrate;        /* Maximum conversion rate */
+       u8 reg_status2;         /* 2nd status register (optional) */
        u8 reg_local_ext;       /* local extension register offset */
+       u8 reg_remote_ext;      /* remote temperature low byte */
+       u8 faultqueue_mask;     /* fault queue mask */
+       u8 faultqueue_depth;    /* fault queue mask */
 
        /* registers values */
-       s8 temp8[TEMP8_REG_NUM];
-       s16 temp11[TEMP11_REG_NUM];
+       u16 temp[TEMP_REG_NUM];
        u8 temp_hyst;
-       u16 alarms; /* bitvector (upper 8 bits for max6695/96) */
+       u8 conalert;
+       u16 reported_alarms;    /* alarms reported as sysfs/udev events */
+       u16 current_alarms;     /* current alarms, reported by chip */
+       u16 alarms;             /* alarms not yet reported to user */
 };
 
 /*
@@ -526,10 +730,10 @@ struct lm90_data {
  */
 
 /*
- * The ADM1032 supports PEC but not on write byte transactions, so we need
+ * If the chip supports PEC but not on write byte transactions, we need
  * to explicitly ask for a transaction without PEC.
  */
-static inline s32 adm1032_write_byte(struct i2c_client *client, u8 value)
+static inline s32 lm90_write_no_pec(struct i2c_client *client, u8 value)
 {
        return i2c_smbus_xfer(client->adapter, client->addr,
                              client->flags & ~I2C_CLIENT_PEC,
@@ -538,47 +742,96 @@ static inline s32 adm1032_write_byte(struct i2c_client *client, u8 value)
 
 /*
  * It is assumed that client->update_lock is held (unless we are in
- * detection or initialization steps). This matters when PEC is enabled,
- * because we don't want the address pointer to change between the write
- * byte and the read byte transactions.
+ * detection or initialization steps). This matters when PEC is enabled
+ * for chips with partial PEC support, because we don't want the address
+ * pointer to change between the write byte and the read byte transactions.
  */
 static int lm90_read_reg(struct i2c_client *client, u8 reg)
 {
+       struct lm90_data *data = i2c_get_clientdata(client);
+       bool partial_pec = (client->flags & I2C_CLIENT_PEC) &&
+                       (data->flags & LM90_HAVE_PARTIAL_PEC);
        int err;
 
-       if (client->flags & I2C_CLIENT_PEC) {
-               err = adm1032_write_byte(client, reg);
-               if (err >= 0)
-                       err = i2c_smbus_read_byte(client);
-       } else
-               err = i2c_smbus_read_byte_data(client, reg);
+       if (partial_pec) {
+               err = lm90_write_no_pec(client, reg);
+               if (err)
+                       return err;
+               return i2c_smbus_read_byte(client);
+       }
+       return i2c_smbus_read_byte_data(client, reg);
+}
 
-       return err;
+/*
+ * Return register write address
+ *
+ * The write address for registers 0x03 .. 0x08 is the read address plus 6.
+ * For other registers the write address matches the read address.
+ */
+static u8 lm90_write_reg_addr(u8 reg)
+{
+       if (reg >= LM90_REG_CONFIG1 && reg <= LM90_REG_REMOTE_LOWH)
+               return reg + 6;
+       return reg;
+}
+
+/*
+ * Write into LM90 register.
+ * Convert register address to write address if needed, then execute the
+ * operation.
+ */
+static int lm90_write_reg(struct i2c_client *client, u8 reg, u8 val)
+{
+       return i2c_smbus_write_byte_data(client, lm90_write_reg_addr(reg), val);
+}
+
+/*
+ * Write into 16-bit LM90 register.
+ * Convert register addresses to write address if needed, then execute the
+ * operation.
+ */
+static int lm90_write16(struct i2c_client *client, u8 regh, u8 regl, u16 val)
+{
+       int ret;
+
+       ret = lm90_write_reg(client, regh, val >> 8);
+       if (ret < 0 || !regl)
+               return ret;
+       return lm90_write_reg(client, regl, val & 0xff);
 }
 
-static int lm90_read16(struct i2c_client *client, u8 regh, u8 regl)
+static int lm90_read16(struct i2c_client *client, u8 regh, u8 regl,
+                      bool is_volatile)
 {
        int oldh, newh, l;
 
-       /*
-        * There is a trick here. We have to read two registers to have the
-        * sensor temperature, but we have to beware a conversion could occur
-        * between the readings. The datasheet says we should either use
-        * the one-shot conversion register, which we don't want to do
-        * (disables hardware monitoring) or monitor the busy bit, which is
-        * impossible (we can't read the values and monitor that bit at the
-        * exact same time). So the solution used here is to read the high
-        * byte once, then the low byte, then the high byte again. If the new
-        * high byte matches the old one, then we have a valid reading. Else
-        * we have to read the low byte again, and now we believe we have a
-        * correct reading.
-        */
        oldh = lm90_read_reg(client, regh);
        if (oldh < 0)
                return oldh;
+
+       if (!regl)
+               return oldh << 8;
+
        l = lm90_read_reg(client, regl);
        if (l < 0)
                return l;
+
+       if (!is_volatile)
+               return (oldh << 8) | l;
+
+       /*
+        * For volatile registers we have to use a trick.
+        * We have to read two registers to have the sensor temperature,
+        * but we have to beware a conversion could occur between the
+        * readings. The datasheet says we should either use
+        * the one-shot conversion register, which we don't want to do
+        * (disables hardware monitoring) or monitor the busy bit, which is
+        * impossible (we can't read the values and monitor that bit at the
+        * exact same time). So the solution used here is to read the high
+        * the high byte again. If the new high byte matches the old one,
+        * then we have a valid reading. Otherwise we have to read the low
+        * byte again, and now we believe we have a correct reading.
+        */
        newh = lm90_read_reg(client, regh);
        if (newh < 0)
                return newh;
@@ -595,9 +848,7 @@ static int lm90_update_confreg(struct lm90_data *data, u8 config)
        if (data->config != config) {
                int err;
 
-               err = i2c_smbus_write_byte_data(data->client,
-                                               LM90_REG_W_CONFIG1,
-                                               config);
+               err = lm90_write_reg(data->client, LM90_REG_CONFIG1, config);
                if (err)
                        return err;
                data->config = config;
@@ -613,18 +864,14 @@ static int lm90_update_confreg(struct lm90_data *data, u8 config)
  * various registers have different meanings as a result of selecting a
  * non-default remote channel.
  */
-static int lm90_select_remote_channel(struct lm90_data *data, int channel)
+static int lm90_select_remote_channel(struct lm90_data *data, bool second)
 {
-       int err = 0;
+       u8 config = data->config & ~0x08;
 
-       if (data->kind == max6696) {
-               u8 config = data->config & ~0x08;
+       if (second)
+               config |= 0x08;
 
-               if (channel)
-                       config |= 0x08;
-               err = lm90_update_confreg(data, config);
-       }
-       return err;
+       return lm90_update_confreg(data, config);
 }
 
 static int lm90_write_convrate(struct lm90_data *data, int val)
@@ -640,7 +887,7 @@ static int lm90_write_convrate(struct lm90_data *data, int val)
        }
 
        /* Set conv rate */
-       err = i2c_smbus_write_byte_data(data->client, LM90_REG_W_CONVRATE, val);
+       err = lm90_write_reg(data->client, LM90_REG_CONVRATE, val);
 
        /* Revert change to config */
        lm90_update_confreg(data, config);
@@ -673,6 +920,26 @@ static int lm90_set_convrate(struct i2c_client *client, struct lm90_data *data,
        return err;
 }
 
+static int lm90_set_faultqueue(struct i2c_client *client,
+                              struct lm90_data *data, int val)
+{
+       int err;
+
+       if (data->faultqueue_mask) {
+               err = lm90_update_confreg(data, val <= data->faultqueue_depth / 2 ?
+                                         data->config & ~data->faultqueue_mask :
+                                         data->config | data->faultqueue_mask);
+       } else {
+               static const u8 values[4] = {0, 2, 6, 0x0e};
+
+               data->conalert = (data->conalert & 0xf1) | values[val - 1];
+               err = lm90_write_reg(data->client, TMP451_REG_CONALERT,
+                                    data->conalert);
+       }
+
+       return err;
+}
+
 static int lm90_update_limits(struct device *dev)
 {
        struct lm90_data *data = dev_get_drvdata(dev);
@@ -680,97 +947,260 @@ static int lm90_update_limits(struct device *dev)
        int val;
 
        if (data->flags & LM90_HAVE_CRIT) {
-               val = lm90_read_reg(client, LM90_REG_R_LOCAL_CRIT);
+               val = lm90_read_reg(client, LM90_REG_LOCAL_CRIT);
                if (val < 0)
                        return val;
-               data->temp8[LOCAL_CRIT] = val;
+               data->temp[LOCAL_CRIT] = val << 8;
 
-               val = lm90_read_reg(client, LM90_REG_R_REMOTE_CRIT);
+               val = lm90_read_reg(client, LM90_REG_REMOTE_CRIT);
                if (val < 0)
                        return val;
-               data->temp8[REMOTE_CRIT] = val;
+               data->temp[REMOTE_CRIT] = val << 8;
 
-               val = lm90_read_reg(client, LM90_REG_R_TCRIT_HYST);
+               val = lm90_read_reg(client, LM90_REG_TCRIT_HYST);
                if (val < 0)
                        return val;
                data->temp_hyst = val;
        }
-
-       val = lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
-       if (val < 0)
-               return val;
-       data->temp11[REMOTE_LOW] = val << 8;
-
-       if (data->flags & LM90_HAVE_REM_LIMIT_EXT) {
-               val = lm90_read_reg(client, LM90_REG_R_REMOTE_LOWL);
+       if ((data->flags & LM90_HAVE_FAULTQUEUE) && !data->faultqueue_mask) {
+               val = lm90_read_reg(client, TMP451_REG_CONALERT);
                if (val < 0)
                        return val;
-               data->temp11[REMOTE_LOW] |= val;
+               data->conalert = val;
        }
 
-       val = lm90_read_reg(client, LM90_REG_R_REMOTE_HIGHH);
+       val = lm90_read16(client, LM90_REG_REMOTE_LOWH,
+                         (data->flags & LM90_HAVE_REM_LIMIT_EXT) ? LM90_REG_REMOTE_LOWL : 0,
+                         false);
        if (val < 0)
                return val;
-       data->temp11[REMOTE_HIGH] = val << 8;
+       data->temp[REMOTE_LOW] = val;
 
-       if (data->flags & LM90_HAVE_REM_LIMIT_EXT) {
-               val = lm90_read_reg(client, LM90_REG_R_REMOTE_HIGHL);
-               if (val < 0)
-                       return val;
-               data->temp11[REMOTE_HIGH] |= val;
-       }
+       val = lm90_read16(client, LM90_REG_REMOTE_HIGHH,
+                         (data->flags & LM90_HAVE_REM_LIMIT_EXT) ? LM90_REG_REMOTE_HIGHL : 0,
+                         false);
+       if (val < 0)
+               return val;
+       data->temp[REMOTE_HIGH] = val;
 
        if (data->flags & LM90_HAVE_OFFSET) {
-               val = lm90_read16(client, LM90_REG_R_REMOTE_OFFSH,
-                                 LM90_REG_R_REMOTE_OFFSL);
+               val = lm90_read16(client, LM90_REG_REMOTE_OFFSH,
+                                 LM90_REG_REMOTE_OFFSL, false);
                if (val < 0)
                        return val;
-               data->temp11[REMOTE_OFFSET] = val;
+               data->temp[REMOTE_OFFSET] = val;
        }
 
        if (data->flags & LM90_HAVE_EMERGENCY) {
-               val = lm90_read_reg(client, MAX6659_REG_R_LOCAL_EMERG);
+               val = lm90_read_reg(client, MAX6659_REG_LOCAL_EMERG);
                if (val < 0)
                        return val;
-               data->temp8[LOCAL_EMERG] = val;
+               data->temp[LOCAL_EMERG] = val << 8;
 
-               val = lm90_read_reg(client, MAX6659_REG_R_REMOTE_EMERG);
+               val = lm90_read_reg(client, MAX6659_REG_REMOTE_EMERG);
                if (val < 0)
                        return val;
-               data->temp8[REMOTE_EMERG] = val;
+               data->temp[REMOTE_EMERG] = val << 8;
        }
 
-       if (data->kind == max6696) {
-               val = lm90_select_remote_channel(data, 1);
+       if (data->flags & LM90_HAVE_TEMP3) {
+               val = lm90_select_remote_channel(data, true);
                if (val < 0)
                        return val;
 
-               val = lm90_read_reg(client, LM90_REG_R_REMOTE_CRIT);
+               val = lm90_read_reg(client, LM90_REG_REMOTE_CRIT);
                if (val < 0)
                        return val;
-               data->temp8[REMOTE2_CRIT] = val;
+               data->temp[REMOTE2_CRIT] = val << 8;
+
+               if (data->flags & LM90_HAVE_EMERGENCY) {
+                       val = lm90_read_reg(client, MAX6659_REG_REMOTE_EMERG);
+                       if (val < 0)
+                               return val;
+                       data->temp[REMOTE2_EMERG] = val << 8;
+               }
 
-               val = lm90_read_reg(client, MAX6659_REG_R_REMOTE_EMERG);
+               val = lm90_read_reg(client, LM90_REG_REMOTE_LOWH);
                if (val < 0)
                        return val;
-               data->temp8[REMOTE2_EMERG] = val;
+               data->temp[REMOTE2_LOW] = val << 8;
 
-               val = lm90_read_reg(client, LM90_REG_R_REMOTE_LOWH);
+               val = lm90_read_reg(client, LM90_REG_REMOTE_HIGHH);
                if (val < 0)
                        return val;
-               data->temp11[REMOTE2_LOW] = val << 8;
+               data->temp[REMOTE2_HIGH] = val << 8;
+
+               if (data->flags & LM90_HAVE_OFFSET) {
+                       val = lm90_read16(client, LM90_REG_REMOTE_OFFSH,
+                                         LM90_REG_REMOTE_OFFSL, false);
+                       if (val < 0)
+                               return val;
+                       data->temp[REMOTE2_OFFSET] = val;
+               }
+
+               lm90_select_remote_channel(data, false);
+       }
+
+       return 0;
+}
+
+static void lm90_report_alarms(struct work_struct *work)
+{
+       struct lm90_data *data = container_of(work, struct lm90_data, report_work);
+       u16 cleared_alarms, new_alarms, current_alarms;
+       struct device *hwmon_dev = data->hwmon_dev;
+       struct device *dev = &data->client->dev;
+       int st, st2;
+
+       current_alarms = data->current_alarms;
+       cleared_alarms = data->reported_alarms & ~current_alarms;
+       new_alarms = current_alarms & ~data->reported_alarms;
+
+       if (!cleared_alarms && !new_alarms)
+               return;
+
+       st = new_alarms & 0xff;
+       st2 = new_alarms >> 8;
+
+       if ((st & (LM90_STATUS_LLOW | LM90_STATUS_LHIGH | LM90_STATUS_LTHRM)) ||
+           (st2 & MAX6696_STATUS2_LOT2))
+               dev_dbg(dev, "temp%d out of range, please check!\n", 1);
+       if ((st & (LM90_STATUS_RLOW | LM90_STATUS_RHIGH | LM90_STATUS_RTHRM)) ||
+           (st2 & MAX6696_STATUS2_ROT2))
+               dev_dbg(dev, "temp%d out of range, please check!\n", 2);
+       if (st & LM90_STATUS_ROPEN)
+               dev_dbg(dev, "temp%d diode open, please check!\n", 2);
+       if (st2 & (MAX6696_STATUS2_R2LOW | MAX6696_STATUS2_R2HIGH |
+                  MAX6696_STATUS2_R2THRM | MAX6696_STATUS2_R2OT2))
+               dev_dbg(dev, "temp%d out of range, please check!\n", 3);
+       if (st2 & MAX6696_STATUS2_R2OPEN)
+               dev_dbg(dev, "temp%d diode open, please check!\n", 3);
+
+       st |= cleared_alarms & 0xff;
+       st2 |= cleared_alarms >> 8;
+
+       if (st & LM90_STATUS_LLOW)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_min_alarm, 0);
+       if (st & LM90_STATUS_RLOW)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_min_alarm, 1);
+       if (st2 & MAX6696_STATUS2_R2LOW)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_min_alarm, 2);
+
+       if (st & LM90_STATUS_LHIGH)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_max_alarm, 0);
+       if (st & LM90_STATUS_RHIGH)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_max_alarm, 1);
+       if (st2 & MAX6696_STATUS2_R2HIGH)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_max_alarm, 2);
+
+       if (st & LM90_STATUS_LTHRM)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_crit_alarm, 0);
+       if (st & LM90_STATUS_RTHRM)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_crit_alarm, 1);
+       if (st2 & MAX6696_STATUS2_R2THRM)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_crit_alarm, 2);
+
+       if (st2 & MAX6696_STATUS2_LOT2)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_emergency_alarm, 0);
+       if (st2 & MAX6696_STATUS2_ROT2)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_emergency_alarm, 1);
+       if (st2 & MAX6696_STATUS2_R2OT2)
+               hwmon_notify_event(hwmon_dev, hwmon_temp, hwmon_temp_emergency_alarm, 2);
+
+       data->reported_alarms = current_alarms;
+}
+
+static int lm90_update_alarms_locked(struct lm90_data *data, bool force)
+{
+       if (force || !data->alarms_valid ||
+           time_after(jiffies, data->alarms_updated + msecs_to_jiffies(data->update_interval))) {
+               struct i2c_client *client = data->client;
+               bool check_enable;
+               u16 alarms;
+               int val;
+
+               data->alarms_valid = false;
 
-               val = lm90_read_reg(client, LM90_REG_R_REMOTE_HIGHH);
+               val = lm90_read_reg(client, LM90_REG_STATUS);
                if (val < 0)
                        return val;
-               data->temp11[REMOTE2_HIGH] = val << 8;
+               alarms = val & ~LM90_STATUS_BUSY;
 
-               lm90_select_remote_channel(data, 0);
-       }
+               if (data->reg_status2) {
+                       val = lm90_read_reg(client, data->reg_status2);
+                       if (val < 0)
+                               return val;
+                       alarms |= val << 8;
+               }
+               /*
+                * If the update is forced (called from interrupt or alert
+                * handler) and alarm data is valid, the alarms may have been
+                * updated after the last update interval, and the status
+                * register may still be cleared. Only add additional alarms
+                * in this case. Alarms will be cleared later if appropriate.
+                */
+               if (force && data->alarms_valid)
+                       data->current_alarms |= alarms;
+               else
+                       data->current_alarms = alarms;
+               data->alarms |= alarms;
+
+               check_enable = (client->irq || !(data->config_orig & 0x80)) &&
+                       (data->config & 0x80);
 
+               if (force || check_enable)
+                       schedule_work(&data->report_work);
+
+               /*
+                * Re-enable ALERT# output if it was originally enabled, relevant
+                * alarms are all clear, and alerts are currently disabled.
+                * Otherwise (re)schedule worker if needed.
+                */
+               if (check_enable) {
+                       if (!(data->current_alarms & data->alert_alarms)) {
+                               dev_dbg(&client->dev, "Re-enabling ALERT#\n");
+                               lm90_update_confreg(data, data->config & ~0x80);
+                               /*
+                                * We may have been called from the update handler.
+                                * If so, the worker, if scheduled, is no longer
+                                * needed. Cancel it. Don't synchronize because
+                                * it may already be running.
+                                */
+                               cancel_delayed_work(&data->alert_work);
+                       } else {
+                               schedule_delayed_work(&data->alert_work,
+                                       max_t(int, HZ, msecs_to_jiffies(data->update_interval)));
+                       }
+               }
+               data->alarms_updated = jiffies;
+               data->alarms_valid = true;
+       }
        return 0;
 }
 
+static int lm90_update_alarms(struct lm90_data *data, bool force)
+{
+       int err;
+
+       mutex_lock(&data->update_lock);
+       err = lm90_update_alarms_locked(data, force);
+       mutex_unlock(&data->update_lock);
+
+       return err;
+}
+
+static void lm90_alert_work(struct work_struct *__work)
+{
+       struct delayed_work *delayed_work = container_of(__work, struct delayed_work, work);
+       struct lm90_data *data = container_of(delayed_work, struct lm90_data, alert_work);
+
+       /* Nothing to do if alerts are enabled */
+       if (!(data->config & 0x80))
+               return;
+
+       lm90_update_alarms(data, true);
+}
+
 static int lm90_update_device(struct device *dev)
 {
        struct lm90_data *data = dev_get_drvdata(dev);
@@ -791,71 +1221,46 @@ static int lm90_update_device(struct device *dev)
 
                data->valid = false;
 
-               val = lm90_read_reg(client, LM90_REG_R_LOCAL_LOW);
+               val = lm90_read_reg(client, LM90_REG_LOCAL_LOW);
                if (val < 0)
                        return val;
-               data->temp8[LOCAL_LOW] = val;
+               data->temp[LOCAL_LOW] = val << 8;
 
-               val = lm90_read_reg(client, LM90_REG_R_LOCAL_HIGH);
+               val = lm90_read_reg(client, LM90_REG_LOCAL_HIGH);
                if (val < 0)
                        return val;
-               data->temp8[LOCAL_HIGH] = val;
+               data->temp[LOCAL_HIGH] = val << 8;
 
-               if (data->reg_local_ext) {
-                       val = lm90_read16(client, LM90_REG_R_LOCAL_TEMP,
-                                         data->reg_local_ext);
-                       if (val < 0)
-                               return val;
-                       data->temp11[LOCAL_TEMP] = val;
-               } else {
-                       val = lm90_read_reg(client, LM90_REG_R_LOCAL_TEMP);
-                       if (val < 0)
-                               return val;
-                       data->temp11[LOCAL_TEMP] = val << 8;
-               }
-               val = lm90_read16(client, LM90_REG_R_REMOTE_TEMPH,
-                                 LM90_REG_R_REMOTE_TEMPL);
+               val = lm90_read16(client, LM90_REG_LOCAL_TEMP,
+                                 data->reg_local_ext, true);
                if (val < 0)
                        return val;
-               data->temp11[REMOTE_TEMP] = val;
-
-               val = lm90_read_reg(client, LM90_REG_R_STATUS);
+               data->temp[LOCAL_TEMP] = val;
+               val = lm90_read16(client, LM90_REG_REMOTE_TEMPH,
+                                 data->reg_remote_ext, true);
                if (val < 0)
                        return val;
-               data->alarms = val & ~LM90_STATUS_BUSY;
+               data->temp[REMOTE_TEMP] = val;
 
-               if (data->kind == max6696) {
-                       val = lm90_select_remote_channel(data, 1);
+               if (data->flags & LM90_HAVE_TEMP3) {
+                       val = lm90_select_remote_channel(data, true);
                        if (val < 0)
                                return val;
 
-                       val = lm90_read16(client, LM90_REG_R_REMOTE_TEMPH,
-                                         LM90_REG_R_REMOTE_TEMPL);
+                       val = lm90_read16(client, LM90_REG_REMOTE_TEMPH,
+                                         data->reg_remote_ext, true);
                        if (val < 0) {
-                               lm90_select_remote_channel(data, 0);
+                               lm90_select_remote_channel(data, false);
                                return val;
                        }
-                       data->temp11[REMOTE2_TEMP] = val;
+                       data->temp[REMOTE2_TEMP] = val;
 
-                       lm90_select_remote_channel(data, 0);
-
-                       val = lm90_read_reg(client, MAX6696_REG_R_STATUS2);
-                       if (val < 0)
-                               return val;
-                       data->alarms |= val << 8;
+                       lm90_select_remote_channel(data, false);
                }
 
-               /*
-                * Re-enable ALERT# output if it was originally enabled and
-                * relevant alarms are all clear
-                */
-               if ((client->irq || !(data->config_orig & 0x80)) &&
-                   !(data->alarms & data->alert_alarms)) {
-                       if (data->config & 0x80) {
-                               dev_dbg(&client->dev, "Re-enabling ALERT#\n");
-                               lm90_update_confreg(data, data->config & ~0x80);
-                       }
-               }
+               val = lm90_update_alarms_locked(data, false);
+               if (val < 0)
+                       return val;
 
                data->last_updated = jiffies;
                data->valid = true;
@@ -864,355 +1269,247 @@ static int lm90_update_device(struct device *dev)
        return 0;
 }
 
-/*
- * Conversions
- * For local temperatures and limits, critical limits and the hysteresis
- * value, the LM90 uses signed 8-bit values with LSB = 1 degree Celsius.
- * For remote temperatures and limits, it uses signed 11-bit values with
- * LSB = 0.125 degree Celsius, left-justified in 16-bit registers.  Some
- * Maxim chips use unsigned values.
- */
-
-static inline int temp_from_s8(s8 val)
+/* pec used for devices with PEC support */
+static ssize_t pec_show(struct device *dev, struct device_attribute *dummy,
+                       char *buf)
 {
-       return val * 1000;
-}
+       struct i2c_client *client = to_i2c_client(dev);
 
-static inline int temp_from_u8(u8 val)
-{
-       return val * 1000;
+       return sprintf(buf, "%d\n", !!(client->flags & I2C_CLIENT_PEC));
 }
 
-static inline int temp_from_s16(s16 val)
+static ssize_t pec_store(struct device *dev, struct device_attribute *dummy,
+                        const char *buf, size_t count)
 {
-       return val / 32 * 125;
-}
+       struct i2c_client *client = to_i2c_client(dev);
+       long val;
+       int err;
 
-static inline int temp_from_u16(u16 val)
-{
-       return val / 32 * 125;
-}
+       err = kstrtol(buf, 10, &val);
+       if (err < 0)
+               return err;
 
-static s8 temp_to_s8(long val)
-{
-       if (val <= -128000)
-               return -128;
-       if (val >= 127000)
-               return 127;
-       if (val < 0)
-               return (val - 500) / 1000;
-       return (val + 500) / 1000;
-}
+       switch (val) {
+       case 0:
+               client->flags &= ~I2C_CLIENT_PEC;
+               break;
+       case 1:
+               client->flags |= I2C_CLIENT_PEC;
+               break;
+       default:
+               return -EINVAL;
+       }
 
-static u8 temp_to_u8(long val)
-{
-       if (val <= 0)
-               return 0;
-       if (val >= 255000)
-               return 255;
-       return (val + 500) / 1000;
-}
-
-static s16 temp_to_s16(long val)
-{
-       if (val <= -128000)
-               return 0x8000;
-       if (val >= 127875)
-               return 0x7FE0;
-       if (val < 0)
-               return (val - 62) / 125 * 32;
-       return (val + 62) / 125 * 32;
-}
-
-static u8 hyst_to_reg(long val)
-{
-       if (val <= 0)
-               return 0;
-       if (val >= 30500)
-               return 31;
-       return (val + 500) / 1000;
-}
-
-/*
- * ADT7461 in compatibility mode is almost identical to LM90 except that
- * attempts to write values that are outside the range 0 < temp < 127 are
- * treated as the boundary value.
- *
- * ADT7461 in "extended mode" operation uses unsigned integers offset by
- * 64 (e.g., 0 -> -64 degC).  The range is restricted to -64..191 degC.
- */
-static inline int temp_from_u8_adt7461(struct lm90_data *data, u8 val)
-{
-       if (data->flags & LM90_FLAG_ADT7461_EXT)
-               return (val - 64) * 1000;
-       return temp_from_s8(val);
+       return count;
 }
 
-static inline int temp_from_u16_adt7461(struct lm90_data *data, u16 val)
-{
-       if (data->flags & LM90_FLAG_ADT7461_EXT)
-               return (val - 0x4000) / 64 * 250;
-       return temp_from_s16(val);
-}
+static DEVICE_ATTR_RW(pec);
 
-static u8 temp_to_u8_adt7461(struct lm90_data *data, long val)
+static int lm90_temp_get_resolution(struct lm90_data *data, int index)
 {
-       if (data->flags & LM90_FLAG_ADT7461_EXT) {
-               if (val <= -64000)
-                       return 0;
-               if (val >= 191000)
-                       return 0xFF;
-               return (val + 500 + 64000) / 1000;
+       switch (index) {
+       case REMOTE_TEMP:
+               if (data->reg_remote_ext)
+                       return data->resolution;
+               return 8;
+       case REMOTE_OFFSET:
+       case REMOTE2_OFFSET:
+       case REMOTE2_TEMP:
+               return data->resolution;
+       case LOCAL_TEMP:
+               if (data->reg_local_ext)
+                       return data->resolution;
+               return 8;
+       case REMOTE_LOW:
+       case REMOTE_HIGH:
+       case REMOTE2_LOW:
+       case REMOTE2_HIGH:
+               if (data->flags & LM90_HAVE_REM_LIMIT_EXT)
+                       return data->resolution;
+               return 8;
+       default:
+               return 8;
        }
-       if (val <= 0)
-               return 0;
-       if (val >= 127000)
-               return 127;
-       return (val + 500) / 1000;
 }
 
-static u16 temp_to_u16_adt7461(struct lm90_data *data, long val)
+static int lm90_temp_from_reg(u32 flags, u16 regval, u8 resolution)
 {
-       if (data->flags & LM90_FLAG_ADT7461_EXT) {
-               if (val <= -64000)
-                       return 0;
-               if (val >= 191750)
-                       return 0xFFC0;
-               return (val + 64000 + 125) / 250 * 64;
-       }
-       if (val <= 0)
-               return 0;
-       if (val >= 127750)
-               return 0x7FC0;
-       return (val + 125) / 250 * 64;
-}
+       int val;
 
-/* pec used for ADM1032 only */
-static ssize_t pec_show(struct device *dev, struct device_attribute *dummy,
-                       char *buf)
-{
-       struct i2c_client *client = to_i2c_client(dev);
+       if (flags & LM90_HAVE_EXTENDED_TEMP)
+               val = regval - 0x4000;
+       else if (flags & (LM90_HAVE_UNSIGNED_TEMP | LM90_HAVE_EXT_UNSIGNED))
+               val = regval;
+       else
+               val = (s16)regval;
 
-       return sprintf(buf, "%d\n", !!(client->flags & I2C_CLIENT_PEC));
+       return ((val >> (16 - resolution)) * 1000) >> (resolution - 8);
 }
 
-static ssize_t pec_store(struct device *dev, struct device_attribute *dummy,
-                        const char *buf, size_t count)
+static int lm90_get_temp(struct lm90_data *data, int index, int channel)
 {
-       struct i2c_client *client = to_i2c_client(dev);
-       long val;
-       int err;
+       int temp = lm90_temp_from_reg(data->flags, data->temp[index],
+                                     lm90_temp_get_resolution(data, index));
 
-       err = kstrtol(buf, 10, &val);
-       if (err < 0)
-               return err;
-
-       switch (val) {
-       case 0:
-               client->flags &= ~I2C_CLIENT_PEC;
-               break;
-       case 1:
-               client->flags |= I2C_CLIENT_PEC;
-               break;
-       default:
-               return -EINVAL;
-       }
+       /* +16 degrees offset for remote temperature on LM99 */
+       if (data->kind == lm99 && channel)
+               temp += 16000;
 
-       return count;
+       return temp;
 }
 
-static DEVICE_ATTR_RW(pec);
-
-static int lm90_get_temp11(struct lm90_data *data, int index)
+static u16 lm90_temp_to_reg(u32 flags, long val, u8 resolution)
 {
-       s16 temp11 = data->temp11[index];
-       int temp;
-
-       if (data->flags & LM90_HAVE_EXTENDED_TEMP)
-               temp = temp_from_u16_adt7461(data, temp11);
-       else if (data->kind == max6646)
-               temp = temp_from_u16(temp11);
-       else
-               temp = temp_from_s16(temp11);
-
-       /* +16 degrees offset for temp2 for the LM99 */
-       if (data->kind == lm99 && index <= 2)
-               temp += 16000;
+       int fraction = resolution > 8 ?
+                       1000 - DIV_ROUND_CLOSEST(1000, BIT(resolution - 8)) : 0;
+
+       if (flags & LM90_HAVE_EXTENDED_TEMP) {
+               val = clamp_val(val, -64000, 191000 + fraction);
+               val += 64000;
+       } else if (flags & LM90_HAVE_EXT_UNSIGNED) {
+               val = clamp_val(val, 0, 255000 + fraction);
+       } else if (flags & LM90_HAVE_UNSIGNED_TEMP) {
+               val = clamp_val(val, 0, 127000 + fraction);
+       } else {
+               val = clamp_val(val, -128000, 127000 + fraction);
+       }
 
-       return temp;
+       return DIV_ROUND_CLOSEST(val << (resolution - 8), 1000) << (16 - resolution);
 }
 
-static int lm90_set_temp11(struct lm90_data *data, int index, long val)
+static int lm90_set_temp(struct lm90_data *data, int index, int channel, long val)
 {
-       static struct reg {
-               u8 high;
-               u8 low;
-       } reg[] = {
-       [REMOTE_LOW] = { LM90_REG_W_REMOTE_LOWH, LM90_REG_W_REMOTE_LOWL },
-       [REMOTE_HIGH] = { LM90_REG_W_REMOTE_HIGHH, LM90_REG_W_REMOTE_HIGHL },
-       [REMOTE_OFFSET] = { LM90_REG_W_REMOTE_OFFSH, LM90_REG_W_REMOTE_OFFSL },
-       [REMOTE2_LOW] = { LM90_REG_W_REMOTE_LOWH, LM90_REG_W_REMOTE_LOWL },
-       [REMOTE2_HIGH] = { LM90_REG_W_REMOTE_HIGHH, LM90_REG_W_REMOTE_HIGHL }
+       static const u8 regs[] = {
+               [LOCAL_LOW] = LM90_REG_LOCAL_LOW,
+               [LOCAL_HIGH] = LM90_REG_LOCAL_HIGH,
+               [LOCAL_CRIT] = LM90_REG_LOCAL_CRIT,
+               [REMOTE_CRIT] = LM90_REG_REMOTE_CRIT,
+               [LOCAL_EMERG] = MAX6659_REG_LOCAL_EMERG,
+               [REMOTE_EMERG] = MAX6659_REG_REMOTE_EMERG,
+               [REMOTE2_CRIT] = LM90_REG_REMOTE_CRIT,
+               [REMOTE2_EMERG] = MAX6659_REG_REMOTE_EMERG,
+               [REMOTE_LOW] = LM90_REG_REMOTE_LOWH,
+               [REMOTE_HIGH] = LM90_REG_REMOTE_HIGHH,
+               [REMOTE2_LOW] = LM90_REG_REMOTE_LOWH,
+               [REMOTE2_HIGH] = LM90_REG_REMOTE_HIGHH,
        };
        struct i2c_client *client = data->client;
-       struct reg *regp = &reg[index];
+       u8 regh = regs[index];
+       u8 regl = 0;
        int err;
 
-       /* +16 degrees offset for temp2 for the LM99 */
-       if (data->kind == lm99 && index <= 2) {
+       if (channel && (data->flags & LM90_HAVE_REM_LIMIT_EXT)) {
+               if (index == REMOTE_LOW || index == REMOTE2_LOW)
+                       regl = LM90_REG_REMOTE_LOWL;
+               else if (index == REMOTE_HIGH || index == REMOTE2_HIGH)
+                       regl = LM90_REG_REMOTE_HIGHL;
+       }
+
+       /* +16 degrees offset for remote temperature on LM99 */
+       if (data->kind == lm99 && channel) {
                /* prevent integer underflow */
                val = max(val, -128000l);
                val -= 16000;
        }
 
-       if (data->flags & LM90_HAVE_EXTENDED_TEMP)
-               data->temp11[index] = temp_to_u16_adt7461(data, val);
-       else if (data->kind == max6646)
-               data->temp11[index] = temp_to_u8(val) << 8;
-       else if (data->flags & LM90_HAVE_REM_LIMIT_EXT)
-               data->temp11[index] = temp_to_s16(val);
-       else
-               data->temp11[index] = temp_to_s8(val) << 8;
+       data->temp[index] = lm90_temp_to_reg(data->flags, val,
+                                            lm90_temp_get_resolution(data, index));
 
-       lm90_select_remote_channel(data, index >= 3);
-       err = i2c_smbus_write_byte_data(client, regp->high,
-                                 data->temp11[index] >> 8);
-       if (err < 0)
-               return err;
-       if (data->flags & LM90_HAVE_REM_LIMIT_EXT)
-               err = i2c_smbus_write_byte_data(client, regp->low,
-                                               data->temp11[index] & 0xff);
+       if (channel > 1)
+               lm90_select_remote_channel(data, true);
+
+       err = lm90_write16(client, regh, regl, data->temp[index]);
+
+       if (channel > 1)
+               lm90_select_remote_channel(data, false);
 
-       lm90_select_remote_channel(data, 0);
        return err;
 }
 
-static int lm90_get_temp8(struct lm90_data *data, int index)
+static int lm90_get_temphyst(struct lm90_data *data, int index, int channel)
 {
-       s8 temp8 = data->temp8[index];
-       int temp;
+       int temp = lm90_get_temp(data, index, channel);
 
-       if (data->flags & LM90_HAVE_EXTENDED_TEMP)
-               temp = temp_from_u8_adt7461(data, temp8);
-       else if (data->kind == max6646)
-               temp = temp_from_u8(temp8);
-       else
-               temp = temp_from_s8(temp8);
-
-       /* +16 degrees offset for temp2 for the LM99 */
-       if (data->kind == lm99 && index == 3)
-               temp += 16000;
-
-       return temp;
+       return temp - data->temp_hyst * 1000;
 }
 
-static int lm90_set_temp8(struct lm90_data *data, int index, long val)
+static int lm90_set_temphyst(struct lm90_data *data, long val)
 {
-       static const u8 reg[TEMP8_REG_NUM] = {
-               LM90_REG_W_LOCAL_LOW,
-               LM90_REG_W_LOCAL_HIGH,
-               LM90_REG_W_LOCAL_CRIT,
-               LM90_REG_W_REMOTE_CRIT,
-               MAX6659_REG_W_LOCAL_EMERG,
-               MAX6659_REG_W_REMOTE_EMERG,
-               LM90_REG_W_REMOTE_CRIT,
-               MAX6659_REG_W_REMOTE_EMERG,
-       };
-       struct i2c_client *client = data->client;
-       int err;
+       int temp = lm90_get_temp(data, LOCAL_CRIT, 0);
 
-       /* +16 degrees offset for temp2 for the LM99 */
-       if (data->kind == lm99 && index == 3) {
-               /* prevent integer underflow */
-               val = max(val, -128000l);
-               val -= 16000;
-       }
+       /* prevent integer overflow/underflow */
+       val = clamp_val(val, -128000l, 255000l);
+       data->temp_hyst = clamp_val(DIV_ROUND_CLOSEST(temp - val, 1000), 0, 31);
 
-       if (data->flags & LM90_HAVE_EXTENDED_TEMP)
-               data->temp8[index] = temp_to_u8_adt7461(data, val);
-       else if (data->kind == max6646)
-               data->temp8[index] = temp_to_u8(val);
-       else
-               data->temp8[index] = temp_to_s8(val);
+       return lm90_write_reg(data->client, LM90_REG_TCRIT_HYST, data->temp_hyst);
+}
 
-       lm90_select_remote_channel(data, index >= 6);
-       err = i2c_smbus_write_byte_data(client, reg[index], data->temp8[index]);
-       lm90_select_remote_channel(data, 0);
+static int lm90_get_temp_offset(struct lm90_data *data, int index)
+{
+       int res = lm90_temp_get_resolution(data, index);
 
-       return err;
+       return lm90_temp_from_reg(0, data->temp[index], res);
 }
 
-static int lm90_get_temphyst(struct lm90_data *data, int index)
+static int lm90_set_temp_offset(struct lm90_data *data, int index, int channel, long val)
 {
-       int temp;
+       int err;
 
-       if (data->flags & LM90_HAVE_EXTENDED_TEMP)
-               temp = temp_from_u8_adt7461(data, data->temp8[index]);
-       else if (data->kind == max6646)
-               temp = temp_from_u8(data->temp8[index]);
-       else
-               temp = temp_from_s8(data->temp8[index]);
+       val = lm90_temp_to_reg(0, val, lm90_temp_get_resolution(data, index));
 
-       /* +16 degrees offset for temp2 for the LM99 */
-       if (data->kind == lm99 && index == 3)
-               temp += 16000;
+       /* For ADT7481 we can use the same registers for remote channel 1 and 2 */
+       if (channel > 1)
+               lm90_select_remote_channel(data, true);
 
-       return temp - temp_from_s8(data->temp_hyst);
-}
+       err = lm90_write16(data->client, LM90_REG_REMOTE_OFFSH, LM90_REG_REMOTE_OFFSL, val);
 
-static int lm90_set_temphyst(struct lm90_data *data, long val)
-{
-       struct i2c_client *client = data->client;
-       int temp;
-       int err;
+       if (channel > 1)
+               lm90_select_remote_channel(data, false);
 
-       if (data->flags & LM90_HAVE_EXTENDED_TEMP)
-               temp = temp_from_u8_adt7461(data, data->temp8[LOCAL_CRIT]);
-       else if (data->kind == max6646)
-               temp = temp_from_u8(data->temp8[LOCAL_CRIT]);
-       else
-               temp = temp_from_s8(data->temp8[LOCAL_CRIT]);
+       if (err)
+               return err;
 
-       /* prevent integer overflow/underflow */
-       val = clamp_val(val, -128000l, 255000l);
+       data->temp[index] = val;
 
-       data->temp_hyst = hyst_to_reg(temp - val);
-       err = i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST,
-                                       data->temp_hyst);
-       return err;
+       return 0;
 }
 
-static const u8 lm90_temp_index[3] = {
+static const u8 lm90_temp_index[MAX_CHANNELS] = {
        LOCAL_TEMP, REMOTE_TEMP, REMOTE2_TEMP
 };
 
-static const u8 lm90_temp_min_index[3] = {
+static const u8 lm90_temp_min_index[MAX_CHANNELS] = {
        LOCAL_LOW, REMOTE_LOW, REMOTE2_LOW
 };
 
-static const u8 lm90_temp_max_index[3] = {
+static const u8 lm90_temp_max_index[MAX_CHANNELS] = {
        LOCAL_HIGH, REMOTE_HIGH, REMOTE2_HIGH
 };
 
-static const u8 lm90_temp_crit_index[3] = {
+static const u8 lm90_temp_crit_index[MAX_CHANNELS] = {
        LOCAL_CRIT, REMOTE_CRIT, REMOTE2_CRIT
 };
 
-static const u8 lm90_temp_emerg_index[3] = {
+static const u8 lm90_temp_emerg_index[MAX_CHANNELS] = {
        LOCAL_EMERG, REMOTE_EMERG, REMOTE2_EMERG
 };
 
-static const u8 lm90_min_alarm_bits[3] = { 5, 3, 11 };
-static const u8 lm90_max_alarm_bits[3] = { 6, 4, 12 };
-static const u8 lm90_crit_alarm_bits[3] = { 0, 1, 9 };
-static const u8 lm90_crit_alarm_bits_swapped[3] = { 1, 0, 9 };
-static const u8 lm90_emergency_alarm_bits[3] = { 15, 13, 14 };
-static const u8 lm90_fault_bits[3] = { 0, 2, 10 };
+static const s8 lm90_temp_offset_index[MAX_CHANNELS] = {
+       -1, REMOTE_OFFSET, REMOTE2_OFFSET
+};
+
+static const u16 lm90_min_alarm_bits[MAX_CHANNELS] = { BIT(5), BIT(3), BIT(11) };
+static const u16 lm90_max_alarm_bits[MAX_CHANNELS] = { BIT(6), BIT(4), BIT(12) };
+static const u16 lm90_crit_alarm_bits[MAX_CHANNELS] = { BIT(0), BIT(1), BIT(9) };
+static const u16 lm90_crit_alarm_bits_swapped[MAX_CHANNELS] = { BIT(1), BIT(0), BIT(9) };
+static const u16 lm90_emergency_alarm_bits[MAX_CHANNELS] = { BIT(15), BIT(13), BIT(14) };
+static const u16 lm90_fault_bits[MAX_CHANNELS] = { BIT(0), BIT(2), BIT(10) };
 
 static int lm90_temp_read(struct device *dev, u32 attr, int channel, long *val)
 {
        struct lm90_data *data = dev_get_drvdata(dev);
        int err;
+       u16 bit;
 
        mutex_lock(&data->update_lock);
        err = lm90_update_device(dev);
@@ -1222,56 +1519,57 @@ static int lm90_temp_read(struct device *dev, u32 attr, int channel, long *val)
 
        switch (attr) {
        case hwmon_temp_input:
-               *val = lm90_get_temp11(data, lm90_temp_index[channel]);
+               *val = lm90_get_temp(data, lm90_temp_index[channel], channel);
                break;
        case hwmon_temp_min_alarm:
-               *val = (data->alarms >> lm90_min_alarm_bits[channel]) & 1;
-               break;
        case hwmon_temp_max_alarm:
-               *val = (data->alarms >> lm90_max_alarm_bits[channel]) & 1;
-               break;
        case hwmon_temp_crit_alarm:
-               if (data->flags & LM90_HAVE_CRIT_ALRM_SWP)
-                       *val = (data->alarms >> lm90_crit_alarm_bits_swapped[channel]) & 1;
-               else
-                       *val = (data->alarms >> lm90_crit_alarm_bits[channel]) & 1;
-               break;
        case hwmon_temp_emergency_alarm:
-               *val = (data->alarms >> lm90_emergency_alarm_bits[channel]) & 1;
-               break;
        case hwmon_temp_fault:
-               *val = (data->alarms >> lm90_fault_bits[channel]) & 1;
+               switch (attr) {
+               case hwmon_temp_min_alarm:
+                       bit = lm90_min_alarm_bits[channel];
+                       break;
+               case hwmon_temp_max_alarm:
+                       bit = lm90_max_alarm_bits[channel];
+                       break;
+               case hwmon_temp_crit_alarm:
+                       if (data->flags & LM90_HAVE_CRIT_ALRM_SWP)
+                               bit = lm90_crit_alarm_bits_swapped[channel];
+                       else
+                               bit = lm90_crit_alarm_bits[channel];
+                       break;
+               case hwmon_temp_emergency_alarm:
+                       bit = lm90_emergency_alarm_bits[channel];
+                       break;
+               case hwmon_temp_fault:
+                       bit = lm90_fault_bits[channel];
+                       break;
+               }
+               *val = !!(data->alarms & bit);
+               data->alarms &= ~bit;
+               data->alarms |= data->current_alarms;
                break;
        case hwmon_temp_min:
-               if (channel == 0)
-                       *val = lm90_get_temp8(data,
-                                             lm90_temp_min_index[channel]);
-               else
-                       *val = lm90_get_temp11(data,
-                                              lm90_temp_min_index[channel]);
+               *val = lm90_get_temp(data, lm90_temp_min_index[channel], channel);
                break;
        case hwmon_temp_max:
-               if (channel == 0)
-                       *val = lm90_get_temp8(data,
-                                             lm90_temp_max_index[channel]);
-               else
-                       *val = lm90_get_temp11(data,
-                                              lm90_temp_max_index[channel]);
+               *val = lm90_get_temp(data, lm90_temp_max_index[channel], channel);
                break;
        case hwmon_temp_crit:
-               *val = lm90_get_temp8(data, lm90_temp_crit_index[channel]);
+               *val = lm90_get_temp(data, lm90_temp_crit_index[channel], channel);
                break;
        case hwmon_temp_crit_hyst:
-               *val = lm90_get_temphyst(data, lm90_temp_crit_index[channel]);
+               *val = lm90_get_temphyst(data, lm90_temp_crit_index[channel], channel);
                break;
        case hwmon_temp_emergency:
-               *val = lm90_get_temp8(data, lm90_temp_emerg_index[channel]);
+               *val = lm90_get_temp(data, lm90_temp_emerg_index[channel], channel);
                break;
        case hwmon_temp_emergency_hyst:
-               *val = lm90_get_temphyst(data, lm90_temp_emerg_index[channel]);
+               *val = lm90_get_temphyst(data, lm90_temp_emerg_index[channel], channel);
                break;
        case hwmon_temp_offset:
-               *val = lm90_get_temp11(data, REMOTE_OFFSET);
+               *val = lm90_get_temp_offset(data, lm90_temp_offset_index[channel]);
                break;
        default:
                return -EOPNOTSUPP;
@@ -1292,36 +1590,27 @@ static int lm90_temp_write(struct device *dev, u32 attr, int channel, long val)
 
        switch (attr) {
        case hwmon_temp_min:
-               if (channel == 0)
-                       err = lm90_set_temp8(data,
-                                             lm90_temp_min_index[channel],
-                                             val);
-               else
-                       err = lm90_set_temp11(data,
-                                             lm90_temp_min_index[channel],
-                                             val);
+               err = lm90_set_temp(data, lm90_temp_min_index[channel],
+                                   channel, val);
                break;
        case hwmon_temp_max:
-               if (channel == 0)
-                       err = lm90_set_temp8(data,
-                                            lm90_temp_max_index[channel],
-                                            val);
-               else
-                       err = lm90_set_temp11(data,
-                                             lm90_temp_max_index[channel],
-                                             val);
+               err = lm90_set_temp(data, lm90_temp_max_index[channel],
+                                   channel, val);
                break;
        case hwmon_temp_crit:
-               err = lm90_set_temp8(data, lm90_temp_crit_index[channel], val);
+               err = lm90_set_temp(data, lm90_temp_crit_index[channel],
+                                   channel, val);
                break;
        case hwmon_temp_crit_hyst:
                err = lm90_set_temphyst(data, val);
                break;
        case hwmon_temp_emergency:
-               err = lm90_set_temp8(data, lm90_temp_emerg_index[channel], val);
+               err = lm90_set_temp(data, lm90_temp_emerg_index[channel],
+                                   channel, val);
                break;
        case hwmon_temp_offset:
-               err = lm90_set_temp11(data, REMOTE_OFFSET, val);
+               err = lm90_set_temp_offset(data, lm90_temp_offset_index[channel],
+                                          channel, val);
                break;
        default:
                err = -EOPNOTSUPP;
@@ -1343,6 +1632,7 @@ static umode_t lm90_temp_is_visible(const void *data, u32 attr, int channel)
        case hwmon_temp_emergency_alarm:
        case hwmon_temp_emergency_hyst:
        case hwmon_temp_fault:
+       case hwmon_temp_label:
                return 0444;
        case hwmon_temp_min:
        case hwmon_temp_max:
@@ -1377,6 +1667,28 @@ static int lm90_chip_read(struct device *dev, u32 attr, int channel, long *val)
        case hwmon_chip_alarms:
                *val = data->alarms;
                break;
+       case hwmon_chip_temp_samples:
+               if (data->faultqueue_mask) {
+                       *val = (data->config & data->faultqueue_mask) ?
+                               data->faultqueue_depth : 1;
+               } else {
+                       switch (data->conalert & 0x0e) {
+                       case 0x0:
+                       default:
+                               *val = 1;
+                               break;
+                       case 0x2:
+                               *val = 2;
+                               break;
+                       case 0x6:
+                               *val = 3;
+                               break;
+                       case 0xe:
+                               *val = 4;
+                               break;
+                       }
+               }
+               break;
        default:
                return -EOPNOTSUPP;
        }
@@ -1401,6 +1713,9 @@ static int lm90_chip_write(struct device *dev, u32 attr, int channel, long val)
                err = lm90_set_convrate(client, data,
                                        clamp_val(val, 0, 100000));
                break;
+       case hwmon_chip_temp_samples:
+               err = lm90_set_faultqueue(client, data, clamp_val(val, 1, 4));
+               break;
        default:
                err = -EOPNOTSUPP;
                break;
@@ -1415,6 +1730,7 @@ static umode_t lm90_chip_is_visible(const void *data, u32 attr, int channel)
 {
        switch (attr) {
        case hwmon_chip_update_interval:
+       case hwmon_chip_temp_samples:
                return 0644;
        case hwmon_chip_alarms:
                return 0444;
@@ -1436,6 +1752,16 @@ static int lm90_read(struct device *dev, enum hwmon_sensor_types type,
        }
 }
 
+static int lm90_read_string(struct device *dev, enum hwmon_sensor_types type,
+                           u32 attr, int channel, const char **str)
+{
+       struct lm90_data *data = dev_get_drvdata(dev);
+
+       *str = data->channel_label[channel];
+
+       return 0;
+}
+
 static int lm90_write(struct device *dev, enum hwmon_sensor_types type,
                      u32 attr, int channel, long val)
 {
@@ -1462,124 +1788,358 @@ static umode_t lm90_is_visible(const void *data, enum hwmon_sensor_types type,
        }
 }
 
-/* Return 0 if detection is successful, -ENODEV otherwise */
-static int lm90_detect(struct i2c_client *client,
-                      struct i2c_board_info *info)
+static const char *lm90_detect_lm84(struct i2c_client *client)
 {
-       struct i2c_adapter *adapter = client->adapter;
+       static const u8 regs[] = {
+               LM90_REG_STATUS, LM90_REG_LOCAL_TEMP, LM90_REG_LOCAL_HIGH,
+               LM90_REG_REMOTE_TEMPH, LM90_REG_REMOTE_HIGHH
+       };
+       int status = i2c_smbus_read_byte_data(client, LM90_REG_STATUS);
+       int reg1, reg2, reg3, reg4;
+       bool nonzero = false;
+       u8 ff = 0xff;
+       int i;
+
+       if (status < 0 || (status & 0xab))
+               return NULL;
+
+       /*
+        * For LM84, undefined registers return the most recent value.
+        * Repeat several times, each time checking against a different
+        * (presumably) existing register.
+        */
+       for (i = 0; i < ARRAY_SIZE(regs); i++) {
+               reg1 = i2c_smbus_read_byte_data(client, regs[i]);
+               reg2 = i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_TEMPL);
+               reg3 = i2c_smbus_read_byte_data(client, LM90_REG_LOCAL_LOW);
+               reg4 = i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_LOWH);
+
+               if (reg1 < 0)
+                       return NULL;
+
+               /* If any register has a different value, this is not an LM84 */
+               if (reg2 != reg1 || reg3 != reg1 || reg4 != reg1)
+                       return NULL;
+
+               nonzero |= reg1 || reg2 || reg3 || reg4;
+               ff &= reg1;
+       }
+       /*
+        * If all registers always returned 0 or 0xff, all bets are off,
+        * and we can not make any predictions about the chip type.
+        */
+       return nonzero && ff != 0xff ? "lm84" : NULL;
+}
+
+static const char *lm90_detect_max1617(struct i2c_client *client, int config1)
+{
+       int status = i2c_smbus_read_byte_data(client, LM90_REG_STATUS);
+       int llo, rlo, lhi, rhi;
+
+       if (status < 0 || (status & 0x03))
+               return NULL;
+
+       if (config1 & 0x3f)
+               return NULL;
+
+       /*
+        * Fail if unsupported registers return anything but 0xff.
+        * The calling code already checked man_id and chip_id.
+        * A byte read operation repeats the most recent read operation
+        * and should also return 0xff.
+        */
+       if (i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_TEMPL) != 0xff ||
+           i2c_smbus_read_byte_data(client, MAX6657_REG_LOCAL_TEMPL) != 0xff ||
+           i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_LOWL) != 0xff ||
+           i2c_smbus_read_byte(client) != 0xff)
+               return NULL;
+
+       llo = i2c_smbus_read_byte_data(client, LM90_REG_LOCAL_LOW);
+       rlo = i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_LOWH);
+
+       lhi = i2c_smbus_read_byte_data(client, LM90_REG_LOCAL_HIGH);
+       rhi = i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_HIGHH);
+
+       if (llo < 0 || rlo < 0)
+               return NULL;
+
+       /*
+        * A byte read operation repeats the most recent read and should
+        * return the same value.
+        */
+       if (i2c_smbus_read_byte(client) != rhi)
+               return NULL;
+
+       /*
+        * The following two checks are marginal since the checked values
+        * are strictly speaking valid.
+        */
+
+       /* fail for negative high limits; this also catches read errors */
+       if ((s8)lhi < 0 || (s8)rhi < 0)
+               return NULL;
+
+       /* fail if low limits are larger than or equal to high limits */
+       if ((s8)llo >= lhi || (s8)rlo >= rhi)
+               return NULL;
+
+       if (i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
+               /*
+                * Word read operations return 0xff in second byte
+                */
+               if (i2c_smbus_read_word_data(client, LM90_REG_REMOTE_TEMPL) !=
+                                               0xffff)
+                       return NULL;
+               if (i2c_smbus_read_word_data(client, LM90_REG_CONFIG1) !=
+                                               (config1 | 0xff00))
+                       return NULL;
+               if (i2c_smbus_read_word_data(client, LM90_REG_LOCAL_HIGH) !=
+                                               (lhi | 0xff00))
+                       return NULL;
+       }
+
+       return "max1617";
+}
+
+static const char *lm90_detect_national(struct i2c_client *client, int chip_id,
+                                       int config1, int convrate)
+{
+       int config2 = i2c_smbus_read_byte_data(client, LM90_REG_CONFIG2);
        int address = client->addr;
        const char *name = NULL;
-       int man_id, chip_id, config1, config2, convrate;
 
-       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
-               return -ENODEV;
+       if (config2 < 0)
+               return NULL;
 
-       /* detection and identification */
-       man_id = i2c_smbus_read_byte_data(client, LM90_REG_R_MAN_ID);
-       chip_id = i2c_smbus_read_byte_data(client, LM90_REG_R_CHIP_ID);
-       config1 = i2c_smbus_read_byte_data(client, LM90_REG_R_CONFIG1);
-       convrate = i2c_smbus_read_byte_data(client, LM90_REG_R_CONVRATE);
-       if (man_id < 0 || chip_id < 0 || config1 < 0 || convrate < 0)
-               return -ENODEV;
+       if ((config1 & 0x2a) || (config2 & 0xf8) || convrate > 0x09)
+               return NULL;
 
-       if (man_id == 0x01 || man_id == 0x5C || man_id == 0xA1) {
-               config2 = i2c_smbus_read_byte_data(client, LM90_REG_R_CONFIG2);
-               if (config2 < 0)
-                       return -ENODEV;
+       if (address != 0x4c && address != 0x4d)
+               return NULL;
+
+       switch (chip_id & 0xf0) {
+       case 0x10:      /* LM86 */
+               if (address == 0x4c)
+                       name = "lm86";
+               break;
+       case 0x20:      /* LM90 */
+               if (address == 0x4c)
+                       name = "lm90";
+               break;
+       case 0x30:      /* LM89/LM99 */
+               name = "lm99";  /* detect LM89 as LM99 */
+               break;
+       default:
+               break;
        }
 
-       if ((address == 0x4C || address == 0x4D)
-        && man_id == 0x01) { /* National Semiconductor */
-               if ((config1 & 0x2A) == 0x00
-                && (config2 & 0xF8) == 0x00
-                && convrate <= 0x09) {
-                       if (address == 0x4C
-                        && (chip_id & 0xF0) == 0x20) { /* LM90 */
-                               name = "lm90";
-                       } else
-                       if ((chip_id & 0xF0) == 0x30) { /* LM89/LM99 */
-                               name = "lm99";
-                               dev_info(&adapter->dev,
-                                        "Assuming LM99 chip at 0x%02x\n",
-                                        address);
-                               dev_info(&adapter->dev,
-                                        "If it is an LM89, instantiate it "
-                                        "with the new_device sysfs "
-                                        "interface\n");
-                       } else
-                       if (address == 0x4C
-                        && (chip_id & 0xF0) == 0x10) { /* LM86 */
-                               name = "lm86";
-                       }
-               }
-       } else
-       if ((address == 0x4C || address == 0x4D)
-        && man_id == 0x41) { /* Analog Devices */
-               if ((chip_id & 0xF0) == 0x40 /* ADM1032 */
-                && (config1 & 0x3F) == 0x00
-                && convrate <= 0x0A) {
+       return name;
+}
+
+static const char *lm90_detect_on(struct i2c_client *client, int chip_id, int config1,
+                                 int convrate)
+{
+       int address = client->addr;
+       const char *name = NULL;
+
+       switch (chip_id) {
+       case 0xca:              /* NCT218 */
+               if ((address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
+                   convrate <= 0x0a)
+                       name = "nct218";
+               break;
+       default:
+               break;
+       }
+       return name;
+}
+
+static const char *lm90_detect_analog(struct i2c_client *client, bool common_address,
+                                     int chip_id, int config1, int convrate)
+{
+       int status = i2c_smbus_read_byte_data(client, LM90_REG_STATUS);
+       int config2 = i2c_smbus_read_byte_data(client, ADT7481_REG_CONFIG2);
+       int man_id2 = i2c_smbus_read_byte_data(client, ADT7481_REG_MAN_ID);
+       int chip_id2 = i2c_smbus_read_byte_data(client, ADT7481_REG_CHIP_ID);
+       int address = client->addr;
+       const char *name = NULL;
+
+       if (status < 0 || config2 < 0 || man_id2 < 0 || chip_id2 < 0)
+               return NULL;
+
+       /*
+        * The following chips should be detected by this function. Known
+        * register values are listed. Registers 0x3d .. 0x3e are undocumented
+        * for most of the chips, yet appear to return a well defined value.
+        * Register 0xff is undocumented for some of the chips. Register 0x3f
+        * is undocumented for all chips, but also returns a well defined value.
+        * Values are as reported from real chips unless mentioned otherwise.
+        * The code below checks values for registers 0x3d, 0x3e, and 0xff,
+        * but not for register 0x3f.
+        *
+        * Chip                 Register
+        *              3d      3e      3f      fe      ff      Notes
+        * ----------------------------------------------------------
+        * adm1020      00      00      00      41      39
+        * adm1021      00      00      00      41      03
+        * adm1021a     00      00      00      41      3c
+        * adm1023      00      00      00      41      3c      same as adm1021a
+        * adm1032      00      00      00      41      42
+        *
+        * adt7421      21      41      04      41      04
+        * adt7461      00      00      00      41      51
+        * adt7461a     61      41      05      41      57
+        * adt7481      81      41      02      41      62
+        * adt7482      -       -       -       41      65      datasheet
+        *              82      41      05      41      75      real chip
+        * adt7483      83      41      04      41      94
+        *
+        * nct72        61      41      07      41      55
+        * nct210       00      00      00      41      3f
+        * nct214       61      41      08      41      5a
+        * nct1008      -       -       -       41      57      datasheet rev. 3
+        *              61      41      06      41      54      real chip
+        *
+        * nvt210       -       -       -       41      -       datasheet
+        * nvt211       -       -       -       41      -       datasheet
+        */
+       switch (chip_id) {
+       case 0x00 ... 0x03:     /* ADM1021 */
+       case 0x05 ... 0x0f:
+               if (man_id2 == 0x00 && chip_id2 == 0x00 && common_address &&
+                   !(status & 0x03) && !(config1 & 0x3f) && !(convrate & 0xf8))
+                       name = "adm1021";
+               break;
+       case 0x04:              /* ADT7421 (undocumented) */
+               if (man_id2 == 0x41 && chip_id2 == 0x21 &&
+                   (address == 0x4c || address == 0x4d) &&
+                   (config1 & 0x0b) == 0x08 && convrate <= 0x0a)
+                       name = "adt7421";
+               break;
+       case 0x30 ... 0x38:     /* ADM1021A, ADM1023 */
+       case 0x3a ... 0x3e:
+               /*
+                * ADM1021A and compatible chips will be mis-detected as
+                * ADM1023. Chips labeled 'ADM1021A' and 'ADM1023' were both
+                * found to have a Chip ID of 0x3c.
+                * ADM1021A does not officially support low byte registers
+                * (0x12 .. 0x14), but a chip labeled ADM1021A does support it.
+                * Official support for the temperature offset high byte
+                * register (0x11) was added to revision F of the ADM1021A
+                * datasheet.
+                * It is currently unknown if there is a means to distinguish
+                * ADM1021A from ADM1023, and/or if revisions of ADM1021A exist
+                * which differ in functionality from ADM1023.
+                */
+               if (man_id2 == 0x00 && chip_id2 == 0x00 && common_address &&
+                   !(status & 0x03) && !(config1 & 0x3f) && !(convrate & 0xf8))
+                       name = "adm1023";
+               break;
+       case 0x39:              /* ADM1020 (undocumented) */
+               if (man_id2 == 0x00 && chip_id2 == 0x00 &&
+                   (address == 0x4c || address == 0x4d || address == 0x4e) &&
+                   !(status & 0x03) && !(config1 & 0x3f) && !(convrate & 0xf8))
+                       name = "adm1020";
+               break;
+       case 0x3f:              /* NCT210 */
+               if (man_id2 == 0x00 && chip_id2 == 0x00 && common_address &&
+                   !(status & 0x03) && !(config1 & 0x3f) && !(convrate & 0xf8))
+                       name = "nct210";
+               break;
+       case 0x40 ... 0x4f:     /* ADM1032 */
+               if (man_id2 == 0x00 && chip_id2 == 0x00 &&
+                   (address == 0x4c || address == 0x4d) && !(config1 & 0x3f) &&
+                   convrate <= 0x0a)
                        name = "adm1032";
-                       /*
-                        * The ADM1032 supports PEC, but only if combined
-                        * transactions are not used.
-                        */
-                       if (i2c_check_functionality(adapter,
-                                                   I2C_FUNC_SMBUS_BYTE))
-                               info->flags |= I2C_CLIENT_PEC;
-               } else
-               if (chip_id == 0x51 /* ADT7461 */
-                && (config1 & 0x1B) == 0x00
-                && convrate <= 0x0A) {
+               break;
+       case 0x51:      /* ADT7461 */
+               if (man_id2 == 0x00 && chip_id2 == 0x00 &&
+                   (address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
+                   convrate <= 0x0a)
                        name = "adt7461";
-               } else
-               if (chip_id == 0x57 /* ADT7461A, NCT1008 */
-                && (config1 & 0x1B) == 0x00
-                && convrate <= 0x0A) {
+               break;
+       case 0x54:      /* NCT1008 */
+               if (man_id2 == 0x41 && chip_id2 == 0x61 &&
+                   (address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
+                   convrate <= 0x0a)
+                       name = "nct1008";
+               break;
+       case 0x55:      /* NCT72 */
+               if (man_id2 == 0x41 && chip_id2 == 0x61 &&
+                   (address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
+                   convrate <= 0x0a)
+                       name = "nct72";
+               break;
+       case 0x57:      /* ADT7461A, NCT1008 (datasheet rev. 3) */
+               if (man_id2 == 0x41 && chip_id2 == 0x61 &&
+                   (address == 0x4c || address == 0x4d) && !(config1 & 0x1b) &&
+                   convrate <= 0x0a)
                        name = "adt7461a";
+               break;
+       case 0x5a:      /* NCT214 */
+               if (man_id2 == 0x41 && chip_id2 == 0x61 &&
+                   common_address && !(config1 & 0x1b) && convrate <= 0x0a)
+                       name = "nct214";
+               break;
+       case 0x62:      /* ADT7481, undocumented */
+               if (man_id2 == 0x41 && chip_id2 == 0x81 &&
+                   (address == 0x4b || address == 0x4c) && !(config1 & 0x10) &&
+                   !(config2 & 0x7f) && (convrate & 0x0f) <= 0x0b) {
+                       name = "adt7481";
                }
-       } else
-       if (man_id == 0x4D) { /* Maxim */
-               int emerg, emerg2, status2;
+               break;
+       case 0x65:      /* ADT7482, datasheet */
+       case 0x75:      /* ADT7482, real chip */
+               if (man_id2 == 0x41 && chip_id2 == 0x82 &&
+                   address == 0x4c && !(config1 & 0x10) && !(config2 & 0x7f) &&
+                   convrate <= 0x0a)
+                       name = "adt7482";
+               break;
+       case 0x94:      /* ADT7483 */
+               if (man_id2 == 0x41 && chip_id2 == 0x83 &&
+                   common_address &&
+                   ((address >= 0x18 && address <= 0x1a) ||
+                    (address >= 0x29 && address <= 0x2b) ||
+                    (address >= 0x4c && address <= 0x4e)) &&
+                   !(config1 & 0x10) && !(config2 & 0x7f) && convrate <= 0x0a)
+                       name = "adt7483a";
+               break;
+       default:
+               break;
+       }
+
+       return name;
+}
+
+static const char *lm90_detect_maxim(struct i2c_client *client, bool common_address,
+                                    int chip_id, int config1, int convrate)
+{
+       int man_id, emerg, emerg2, status2;
+       int address = client->addr;
+       const char *name = NULL;
+
+       switch (chip_id) {
+       case 0x01:
+               if (!common_address)
+                       break;
 
                /*
-                * We read MAX6659_REG_R_REMOTE_EMERG twice, and re-read
-                * LM90_REG_R_MAN_ID in between. If MAX6659_REG_R_REMOTE_EMERG
+                * We read MAX6659_REG_REMOTE_EMERG twice, and re-read
+                * LM90_REG_MAN_ID in between. If MAX6659_REG_REMOTE_EMERG
                 * exists, both readings will reflect the same value. Otherwise,
                 * the readings will be different.
                 */
                emerg = i2c_smbus_read_byte_data(client,
-                                                MAX6659_REG_R_REMOTE_EMERG);
+                                                MAX6659_REG_REMOTE_EMERG);
                man_id = i2c_smbus_read_byte_data(client,
-                                                 LM90_REG_R_MAN_ID);
+                                                 LM90_REG_MAN_ID);
                emerg2 = i2c_smbus_read_byte_data(client,
-                                                 MAX6659_REG_R_REMOTE_EMERG);
+                                                 MAX6659_REG_REMOTE_EMERG);
                status2 = i2c_smbus_read_byte_data(client,
-                                                  MAX6696_REG_R_STATUS2);
+                                                  MAX6696_REG_STATUS2);
                if (emerg < 0 || man_id < 0 || emerg2 < 0 || status2 < 0)
-                       return -ENODEV;
+                       return NULL;
 
-               /*
-                * The MAX6657, MAX6658 and MAX6659 do NOT have a chip_id
-                * register. Reading from that address will return the last
-                * read value, which in our case is those of the man_id
-                * register. Likewise, the config1 register seems to lack a
-                * low nibble, so the value will be those of the previous
-                * read, so in our case those of the man_id register.
-                * MAX6659 has a third set of upper temperature limit registers.
-                * Those registers also return values on MAX6657 and MAX6658,
-                * thus the only way to detect MAX6659 is by its address.
-                * For this reason it will be mis-detected as MAX6657 if its
-                * address is 0x4C.
-                */
-               if (chip_id == man_id
-                && (address == 0x4C || address == 0x4D || address == 0x4E)
-                && (config1 & 0x1F) == (man_id & 0x0F)
-                && convrate <= 0x09) {
-                       if (address == 0x4C)
-                               name = "max6657";
-                       else
-                               name = "max6659";
-               } else
                /*
                 * Even though MAX6695 and MAX6696 do not have a chip ID
                 * register, reading it returns 0x01. Bit 4 of the config1
@@ -1591,90 +2151,288 @@ static int lm90_detect(struct i2c_client *client,
                 * limit registers. We can detect those chips by checking if
                 * one of those registers exists.
                 */
-               if (chip_id == 0x01
-                && (config1 & 0x10) == 0x00
-                && (status2 & 0x01) == 0x00
-                && emerg == emerg2
-                && convrate <= 0x07) {
+               if (!(config1 & 0x10) && !(status2 & 0x01) && emerg == emerg2 &&
+                   convrate <= 0x07)
                        name = "max6696";
-               } else
                /*
                 * The chip_id register of the MAX6680 and MAX6681 holds the
                 * revision of the chip. The lowest bit of the config1 register
                 * is unused and should return zero when read, so should the
-                * second to last bit of config1 (software reset).
+                * second to last bit of config1 (software reset). Register
+                * address 0x12 (LM90_REG_REMOTE_OFFSL) exists for this chip and
+                * should differ from emerg2, and emerg2 should match man_id
+                * since it does not exist.
                 */
-               if (chip_id == 0x01
-                && (config1 & 0x03) == 0x00
-                && convrate <= 0x07) {
+               else if (!(config1 & 0x03) && convrate <= 0x07 &&
+                        emerg2 == man_id && emerg2 != status2)
                        name = "max6680";
-               } else
                /*
-                * The chip_id register of the MAX6646/6647/6649 holds the
-                * revision of the chip. The lowest 6 bits of the config1
-                * register are unused and should return zero when read.
+                * MAX1617A does not have any extended registers (register
+                * address 0x10 or higher) except for manufacturer and
+                * device ID registers. Unlike other chips of this series,
+                * unsupported registers were observed to return a fixed value
+                * of 0x01.
+                * Note: Multiple chips with different markings labeled as
+                * "MAX1617" (no "A") were observed to report manufacturer ID
+                * 0x4d and device ID 0x01. It is unknown if other variants of
+                * MAX1617/MAX617A with different behavior exist. The detection
+                * code below works for those chips.
                 */
-               if (chip_id == 0x59
-                && (config1 & 0x3f) == 0x00
-                && convrate <= 0x07) {
-                       name = "max6646";
-               } else
+               else if (!(config1 & 0x03f) && convrate <= 0x07 &&
+                        emerg == 0x01 && emerg2 == 0x01 && status2 == 0x01)
+                       name = "max1617";
+               break;
+       case 0x08:
                /*
                 * The chip_id of the MAX6654 holds the revision of the chip.
                 * The lowest 3 bits of the config1 register are unused and
                 * should return zero when read.
                 */
-               if (chip_id == 0x08
-                && (config1 & 0x07) == 0x00
-                && convrate <= 0x07) {
+               if (common_address && !(config1 & 0x07) && convrate <= 0x07)
                        name = "max6654";
+               break;
+       case 0x09:
+               /*
+                * The chip_id of the MAX6690 holds the revision of the chip.
+                * The lowest 3 bits of the config1 register are unused and
+                * should return zero when read.
+                * Note that MAX6654 and MAX6690 are practically the same chips.
+                * The only diference is the rated accuracy. Rev. 1 of the
+                * MAX6690 datasheet lists a chip ID of 0x08, and a chip labeled
+                * MAX6654 was observed to have a chip ID of 0x09.
+                */
+               if (common_address && !(config1 & 0x07) && convrate <= 0x07)
+                       name = "max6690";
+               break;
+       case 0x4d:
+               /*
+                * MAX6642, MAX6657, MAX6658 and MAX6659 do NOT have a chip_id
+                * register. Reading from that address will return the last
+                * read value, which in our case is those of the man_id
+                * register, or 0x4d.
+                * MAX6642 does not have a conversion rate register, nor low
+                * limit registers. Reading from those registers returns the
+                * last read value.
+                *
+                * For MAX6657, MAX6658 and MAX6659, the config1 register lacks
+                * a low nibble, so the value will be those of the previous
+                * read, so in our case again those of the man_id register.
+                * MAX6659 has a third set of upper temperature limit registers.
+                * Those registers also return values on MAX6657 and MAX6658,
+                * thus the only way to detect MAX6659 is by its address.
+                * For this reason it will be mis-detected as MAX6657 if its
+                * address is 0x4c.
+                */
+               if (address >= 0x48 && address <= 0x4f && config1 == convrate &&
+                   !(config1 & 0x0f)) {
+                       int regval;
+
+                       /*
+                        * We know that this is not a MAX6657/58/59 because its
+                        * configuration register has the wrong value and it does
+                        * not appear to have a conversion rate register.
+                        */
+
+                       /* re-read manufacturer ID to have a good baseline */
+                       if (i2c_smbus_read_byte_data(client, LM90_REG_MAN_ID) != 0x4d)
+                               break;
+
+                       /* check various non-existing registers */
+                       if (i2c_smbus_read_byte_data(client, LM90_REG_CONVRATE) != 0x4d ||
+                           i2c_smbus_read_byte_data(client, LM90_REG_LOCAL_LOW) != 0x4d ||
+                           i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_LOWH) != 0x4d)
+                               break;
+
+                       /* check for unused status register bits */
+                       regval = i2c_smbus_read_byte_data(client, LM90_REG_STATUS);
+                       if (regval < 0 || (regval & 0x2b))
+                               break;
+
+                       /* re-check unsupported registers */
+                       if (i2c_smbus_read_byte_data(client, LM90_REG_CONVRATE) != regval ||
+                           i2c_smbus_read_byte_data(client, LM90_REG_LOCAL_LOW) != regval ||
+                           i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_LOWH) != regval)
+                               break;
+
+                       name = "max6642";
+               } else if ((address == 0x4c || address == 0x4d || address == 0x4e) &&
+                          (config1 & 0x1f) == 0x0d && convrate <= 0x09) {
+                       if (address == 0x4c)
+                               name = "max6657";
+                       else
+                               name = "max6659";
                }
-       } else
-       if (address == 0x4C
-        && man_id == 0x5C) { /* Winbond/Nuvoton */
-               if ((config1 & 0x2A) == 0x00
-                && (config2 & 0xF8) == 0x00) {
-                       if (chip_id == 0x01 /* W83L771W/G */
-                        && convrate <= 0x09) {
-                               name = "w83l771";
-                       } else
-                       if ((chip_id & 0xFE) == 0x10 /* W83L771AWG/ASG */
-                        && convrate <= 0x08) {
-                               name = "w83l771";
+               break;
+       case 0x59:
+               /*
+                * The chip_id register of the MAX6646/6647/6649 holds the
+                * revision of the chip. The lowest 6 bits of the config1
+                * register are unused and should return zero when read.
+                * The I2C address of MAX6648/6692 is fixed at 0x4c.
+                * MAX6646 is at address 0x4d, MAX6647 is at address 0x4e,
+                * and MAX6649 is at address 0x4c. A slight difference between
+                * the two sets of chips is that the remote temperature register
+                * reports different values if the DXP pin is open or shorted.
+                * We can use that information to help distinguish between the
+                * chips. MAX6648 will be mis-detected as MAX6649 if the remote
+                * diode is connected, but there isn't really anything we can
+                * do about that.
+                */
+               if (!(config1 & 0x3f) && convrate <= 0x07) {
+                       int temp;
+
+                       switch (address) {
+                       case 0x4c:
+                               /*
+                                * MAX6649 reports an external temperature
+                                * value of 0xff if DXP is open or shorted.
+                                * MAX6648 reports 0x80 in that case.
+                                */
+                               temp = i2c_smbus_read_byte_data(client,
+                                                               LM90_REG_REMOTE_TEMPH);
+                               if (temp == 0x80)
+                                       name = "max6648";
+                               else
+                                       name = "max6649";
+                               break;
+                       case 0x4d:
+                               name = "max6646";
+                               break;
+                       case 0x4e:
+                               name = "max6647";
+                               break;
+                       default:
+                               break;
                        }
                }
-       } else
-       if (address >= 0x48 && address <= 0x4F
-        && man_id == 0xA1) { /*  NXP Semiconductor/Philips */
-               if (chip_id == 0x00
-                && (config1 & 0x2A) == 0x00
-                && (config2 & 0xFE) == 0x00
-                && convrate <= 0x09) {
-                       name = "sa56004";
+               break;
+       default:
+               break;
+       }
+
+       return name;
+}
+
+static const char *lm90_detect_nuvoton(struct i2c_client *client, int chip_id,
+                                      int config1, int convrate)
+{
+       int config2 = i2c_smbus_read_byte_data(client, LM90_REG_CONFIG2);
+       int address = client->addr;
+       const char *name = NULL;
+
+       if (config2 < 0)
+               return ERR_PTR(-ENODEV);
+
+       if (address == 0x4c && !(config1 & 0x2a) && !(config2 & 0xf8)) {
+               if (chip_id == 0x01 && convrate <= 0x09) {
+                       /* W83L771W/G */
+                       name = "w83l771";
+               } else if ((chip_id & 0xfe) == 0x10 && convrate <= 0x08) {
+                       /* W83L771AWG/ASG */
+                       name = "w83l771";
                }
-       } else
-       if ((address == 0x4C || address == 0x4D)
-        && man_id == 0x47) { /* GMT */
-               if (chip_id == 0x01 /* G781 */
-                && (config1 & 0x3F) == 0x00
-                && convrate <= 0x08)
-                       name = "g781";
-       } else
-       if (man_id == 0x55 && chip_id == 0x00 &&
-           (config1 & 0x1B) == 0x00 && convrate <= 0x09) {
+       }
+       return name;
+}
+
+static const char *lm90_detect_nxp(struct i2c_client *client, bool common_address,
+                                  int chip_id, int config1, int convrate)
+{
+       int address = client->addr;
+       const char *name = NULL;
+       int config2;
+
+       switch (chip_id) {
+       case 0x00:
+               config2 = i2c_smbus_read_byte_data(client, LM90_REG_CONFIG2);
+               if (config2 < 0)
+                       return NULL;
+               if (address >= 0x48 && address <= 0x4f &&
+                   !(config1 & 0x2a) && !(config2 & 0xfe) && convrate <= 0x09)
+                       name = "sa56004";
+               break;
+       case 0x80:
+               if (common_address && !(config1 & 0x3f) && convrate <= 0x07)
+                       name = "ne1618";
+               break;
+       default:
+               break;
+       }
+       return name;
+}
+
+static const char *lm90_detect_gmt(struct i2c_client *client, int chip_id,
+                                  int config1, int convrate)
+{
+       int address = client->addr;
+
+       /*
+        * According to the datasheet, G781 is supposed to be at I2C Address
+        * 0x4c and have a chip ID of 0x01. G781-1 is supposed to be at I2C
+        * address 0x4d and have a chip ID of 0x03. However, when support
+        * for G781 was added, chips at 0x4c and 0x4d were found to have a
+        * chip ID of 0x01. A G781-1 at I2C address 0x4d was now found with
+        * chip ID 0x03.
+        * To avoid detection failures, accept chip ID 0x01 and 0x03 at both
+        * addresses.
+        * G784 reports manufacturer ID 0x47 and chip ID 0x01. A public
+        * datasheet is not available. Extensive testing suggests that
+        * the chip appears to be fully compatible with G781.
+        * Available register dumps show that G751 also reports manufacturer
+        * ID 0x47 and chip ID 0x01 even though that chip does not officially
+        * support those registers. This makes chip detection somewhat
+        * vulnerable. To improve detection quality, read the offset low byte
+        * and alert fault queue registers and verify that only expected bits
+        * are set.
+        */
+       if ((chip_id == 0x01 || chip_id == 0x03) &&
+           (address == 0x4c || address == 0x4d) &&
+           !(config1 & 0x3f) && convrate <= 0x08) {
+               int reg;
+
+               reg = i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_OFFSL);
+               if (reg < 0 || reg & 0x1f)
+                       return NULL;
+               reg = i2c_smbus_read_byte_data(client, TMP451_REG_CONALERT);
+               if (reg < 0 || reg & 0xf1)
+                       return NULL;
+
+               return "g781";
+       }
+
+       return NULL;
+}
+
+static const char *lm90_detect_ti49(struct i2c_client *client, bool common_address,
+                                   int chip_id, int config1, int convrate)
+{
+       if (common_address && chip_id == 0x00 && !(config1 & 0x3f) && !(convrate & 0xf8)) {
+               /* THMC10: Unsupported registers return 0xff */
+               if (i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_TEMPL) == 0xff &&
+                   i2c_smbus_read_byte_data(client, LM90_REG_REMOTE_CRIT) == 0xff)
+                       return "thmc10";
+       }
+       return NULL;
+}
+
+static const char *lm90_detect_ti(struct i2c_client *client, int chip_id,
+                                 int config1, int convrate)
+{
+       int address = client->addr;
+       const char *name = NULL;
+
+       if (chip_id == 0x00 && !(config1 & 0x1b) && convrate <= 0x09) {
                int local_ext, conalert, chen, dfc;
 
                local_ext = i2c_smbus_read_byte_data(client,
-                                                    TMP451_REG_R_LOCAL_TEMPL);
+                                                    TMP451_REG_LOCAL_TEMPL);
                conalert = i2c_smbus_read_byte_data(client,
                                                    TMP451_REG_CONALERT);
                chen = i2c_smbus_read_byte_data(client, TMP461_REG_CHEN);
                dfc = i2c_smbus_read_byte_data(client, TMP461_REG_DFC);
 
-               if ((local_ext & 0x0F) == 0x00 &&
-                   (conalert & 0xf1) == 0x01 &&
-                   (chen & 0xfc) == 0x00 &&
-                   (dfc & 0xfc) == 0x00) {
+               if (!(local_ext & 0x0f) && (conalert & 0xf1) == 0x01 &&
+                   (chen & 0xfc) == 0x00 && (dfc & 0xfc) == 0x00) {
                        if (address == 0x4c && !(chen & 0x03))
                                name = "tmp451";
                        else if (address >= 0x48 && address <= 0x4f)
@@ -1682,10 +2440,110 @@ static int lm90_detect(struct i2c_client *client,
                }
        }
 
-       if (!name) { /* identification failed */
+       return name;
+}
+
+/* Return 0 if detection is successful, -ENODEV otherwise */
+static int lm90_detect(struct i2c_client *client, struct i2c_board_info *info)
+{
+       struct i2c_adapter *adapter = client->adapter;
+       int man_id, chip_id, config1, convrate, lhigh;
+       const char *name = NULL;
+       int address = client->addr;
+       bool common_address =
+                       (address >= 0x18 && address <= 0x1a) ||
+                       (address >= 0x29 && address <= 0x2b) ||
+                       (address >= 0x4c && address <= 0x4e);
+
+       if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
+               return -ENODEV;
+
+       /*
+        * Get well defined register value for chips with neither man_id nor
+        * chip_id registers.
+        */
+       lhigh = i2c_smbus_read_byte_data(client, LM90_REG_LOCAL_HIGH);
+
+       /* detection and identification */
+       man_id = i2c_smbus_read_byte_data(client, LM90_REG_MAN_ID);
+       chip_id = i2c_smbus_read_byte_data(client, LM90_REG_CHIP_ID);
+       config1 = i2c_smbus_read_byte_data(client, LM90_REG_CONFIG1);
+       convrate = i2c_smbus_read_byte_data(client, LM90_REG_CONVRATE);
+       if (man_id < 0 || chip_id < 0 || config1 < 0 || convrate < 0 || lhigh < 0)
+               return -ENODEV;
+
+       /* Bail out immediately if all register report the same value */
+       if (lhigh == man_id && lhigh == chip_id && lhigh == config1 && lhigh == convrate)
+               return -ENODEV;
+
+       /*
+        * If reading man_id and chip_id both return the same value as lhigh,
+        * the chip may not support those registers and return the most recent read
+        * value. Check again with a different register and handle accordingly.
+        */
+       if (man_id == lhigh && chip_id == lhigh) {
+               convrate = i2c_smbus_read_byte_data(client, LM90_REG_CONVRATE);
+               man_id = i2c_smbus_read_byte_data(client, LM90_REG_MAN_ID);
+               chip_id = i2c_smbus_read_byte_data(client, LM90_REG_CHIP_ID);
+               if (convrate < 0 || man_id < 0 || chip_id < 0)
+                       return -ENODEV;
+               if (man_id == convrate && chip_id == convrate)
+                       man_id = -1;
+       }
+       switch (man_id) {
+       case -1:        /* Chip does not support man_id / chip_id */
+               if (common_address && !convrate && !(config1 & 0x7f))
+                       name = lm90_detect_lm84(client);
+               break;
+       case 0x01:      /* National Semiconductor */
+               name = lm90_detect_national(client, chip_id, config1, convrate);
+               break;
+       case 0x1a:      /* ON */
+               name = lm90_detect_on(client, chip_id, config1, convrate);
+               break;
+       case 0x23:      /* Genesys Logic */
+               if (common_address && !(config1 & 0x3f) && !(convrate & 0xf8))
+                       name = "gl523sm";
+               break;
+       case 0x41:      /* Analog Devices */
+               name = lm90_detect_analog(client, common_address, chip_id, config1,
+                                         convrate);
+               break;
+       case 0x47:      /* GMT */
+               name = lm90_detect_gmt(client, chip_id, config1, convrate);
+               break;
+       case 0x49:      /* TI */
+               name = lm90_detect_ti49(client, common_address, chip_id, config1, convrate);
+               break;
+       case 0x4d:      /* Maxim Integrated */
+               name = lm90_detect_maxim(client, common_address, chip_id,
+                                        config1, convrate);
+               break;
+       case 0x54:      /* ON MC1066, Microchip TC1068, TCM1617 (originally TelCom) */
+               if (common_address && !(config1 & 0x3f) && !(convrate & 0xf8))
+                       name = "mc1066";
+               break;
+       case 0x55:      /* TI */
+               name = lm90_detect_ti(client, chip_id, config1, convrate);
+               break;
+       case 0x5c:      /* Winbond/Nuvoton */
+               name = lm90_detect_nuvoton(client, chip_id, config1, convrate);
+               break;
+       case 0xa1:      /*  NXP Semiconductor/Philips */
+               name = lm90_detect_nxp(client, common_address, chip_id, config1, convrate);
+               break;
+       case 0xff:      /* MAX1617, G767, NE1617 */
+               if (common_address && chip_id == 0xff && convrate < 8)
+                       name = lm90_detect_max1617(client, config1);
+               break;
+       default:
+               break;
+       }
+
+       if (!name) {    /* identification failed */
                dev_dbg(&adapter->dev,
-                       "Unsupported chip at 0x%02x (man_id=0x%02X, "
-                       "chip_id=0x%02X)\n", address, man_id, chip_id);
+                       "Unsupported chip at 0x%02x (man_id=0x%02X, chip_id=0x%02X)\n",
+                       client->addr, man_id, chip_id);
                return -ENODEV;
        }
 
@@ -1699,10 +2557,13 @@ static void lm90_restore_conf(void *_data)
        struct lm90_data *data = _data;
        struct i2c_client *client = data->client;
 
+       cancel_delayed_work_sync(&data->alert_work);
+       cancel_work_sync(&data->report_work);
+
        /* Restore initial configuration */
-       lm90_write_convrate(data, data->convrate_orig);
-       i2c_smbus_write_byte_data(client, LM90_REG_W_CONFIG1,
-                                 data->config_orig);
+       if (data->flags & LM90_HAVE_CONVRATE)
+               lm90_write_convrate(data, data->convrate_orig);
+       lm90_write_reg(client, LM90_REG_CONFIG1, data->config_orig);
 }
 
 static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
@@ -1710,35 +2571,39 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
        struct device_node *np = client->dev.of_node;
        int config, convrate;
 
-       convrate = lm90_read_reg(client, LM90_REG_R_CONVRATE);
-       if (convrate < 0)
-               return convrate;
-       data->convrate_orig = convrate;
+       if (data->flags & LM90_HAVE_CONVRATE) {
+               convrate = lm90_read_reg(client, LM90_REG_CONVRATE);
+               if (convrate < 0)
+                       return convrate;
+               data->convrate_orig = convrate;
+               lm90_set_convrate(client, data, 500); /* 500ms; 2Hz conversion rate */
+       } else {
+               data->update_interval = 500;
+       }
 
        /*
         * Start the conversions.
         */
-       config = lm90_read_reg(client, LM90_REG_R_CONFIG1);
+       config = lm90_read_reg(client, LM90_REG_CONFIG1);
        if (config < 0)
                return config;
        data->config_orig = config;
        data->config = config;
 
-       lm90_set_convrate(client, data, 500); /* 500ms; 2Hz conversion rate */
-
        /* Check Temperature Range Select */
        if (data->flags & LM90_HAVE_EXTENDED_TEMP) {
                if (of_property_read_bool(np, "ti,extended-range-enable"))
                        config |= 0x04;
-
-               if (config & 0x04)
-                       data->flags |= LM90_FLAG_ADT7461_EXT;
+               if (!(config & 0x04))
+                       data->flags &= ~LM90_HAVE_EXTENDED_TEMP;
        }
 
        /*
         * Put MAX6680/MAX8881 into extended resolution (bit 0x10,
         * 0.125 degree resolution) and range (0x08, extend range
         * to -64 degree) mode for the remote temperature sensor.
+        * Note that expeciments with an actual chip do not show a difference
+        * if bit 3 is set or not.
         */
        if (data->kind == max6680)
                config |= 0x18;
@@ -1753,9 +2618,9 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
                config |= 0x20;
 
        /*
-        * Select external channel 0 for max6695/96
+        * Select external channel 0 for devices with three sensors
         */
-       if (data->kind == max6696)
+       if (data->flags & LM90_HAVE_TEMP3)
                config &= ~0x08;
 
        /*
@@ -1771,73 +2636,23 @@ static int lm90_init_client(struct i2c_client *client, struct lm90_data *data)
        return devm_add_action_or_reset(&client->dev, lm90_restore_conf, data);
 }
 
-static bool lm90_is_tripped(struct i2c_client *client, u16 *status)
+static bool lm90_is_tripped(struct i2c_client *client)
 {
        struct lm90_data *data = i2c_get_clientdata(client);
-       int st, st2 = 0;
+       int ret;
 
-       st = lm90_read_reg(client, LM90_REG_R_STATUS);
-       if (st < 0)
+       ret = lm90_update_alarms(data, true);
+       if (ret < 0)
                return false;
 
-       if (data->kind == max6696) {
-               st2 = lm90_read_reg(client, MAX6696_REG_R_STATUS2);
-               if (st2 < 0)
-                       return false;
-       }
-
-       *status = st | (st2 << 8);
-
-       if ((st & 0x7f) == 0 && (st2 & 0xfe) == 0)
-               return false;
-
-       if ((st & (LM90_STATUS_LLOW | LM90_STATUS_LHIGH | LM90_STATUS_LTHRM)) ||
-           (st2 & MAX6696_STATUS2_LOT2))
-               dev_dbg(&client->dev,
-                       "temp%d out of range, please check!\n", 1);
-       if ((st & (LM90_STATUS_RLOW | LM90_STATUS_RHIGH | LM90_STATUS_RTHRM)) ||
-           (st2 & MAX6696_STATUS2_ROT2))
-               dev_dbg(&client->dev,
-                       "temp%d out of range, please check!\n", 2);
-       if (st & LM90_STATUS_ROPEN)
-               dev_dbg(&client->dev,
-                       "temp%d diode open, please check!\n", 2);
-       if (st2 & (MAX6696_STATUS2_R2LOW | MAX6696_STATUS2_R2HIGH |
-                  MAX6696_STATUS2_R2THRM | MAX6696_STATUS2_R2OT2))
-               dev_dbg(&client->dev,
-                       "temp%d out of range, please check!\n", 3);
-       if (st2 & MAX6696_STATUS2_R2OPEN)
-               dev_dbg(&client->dev,
-                       "temp%d diode open, please check!\n", 3);
-
-       if (st & LM90_STATUS_LLOW)
-               hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_min_alarm, 0);
-       if (st & LM90_STATUS_RLOW)
-               hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_min_alarm, 1);
-       if (st2 & MAX6696_STATUS2_R2LOW)
-               hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_min_alarm, 2);
-       if (st & LM90_STATUS_LHIGH)
-               hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_max_alarm, 0);
-       if (st & LM90_STATUS_RHIGH)
-               hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_max_alarm, 1);
-       if (st2 & MAX6696_STATUS2_R2HIGH)
-               hwmon_notify_event(data->hwmon_dev, hwmon_temp,
-                                  hwmon_temp_max_alarm, 2);
-
-       return true;
+       return !!data->current_alarms;
 }
 
 static irqreturn_t lm90_irq_thread(int irq, void *dev_id)
 {
        struct i2c_client *client = dev_id;
-       u16 status;
 
-       if (lm90_is_tripped(client, &status))
+       if (lm90_is_tripped(client))
                return IRQ_HANDLED;
        else
                return IRQ_NONE;
@@ -1853,10 +2668,79 @@ static void lm90_regulator_disable(void *regulator)
        regulator_disable(regulator);
 }
 
+static int lm90_probe_channel_from_dt(struct i2c_client *client,
+                                     struct device_node *child,
+                                     struct lm90_data *data)
+{
+       u32 id;
+       s32 val;
+       int err;
+       struct device *dev = &client->dev;
+
+       err = of_property_read_u32(child, "reg", &id);
+       if (err) {
+               dev_err(dev, "missing reg property of %pOFn\n", child);
+               return err;
+       }
+
+       if (id >= MAX_CHANNELS) {
+               dev_err(dev, "invalid reg property value %d in %pOFn\n", id, child);
+               return -EINVAL;
+       }
+
+       err = of_property_read_string(child, "label", &data->channel_label[id]);
+       if (err == -ENODATA || err == -EILSEQ) {
+               dev_err(dev, "invalid label property in %pOFn\n", child);
+               return err;
+       }
+
+       if (data->channel_label[id])
+               data->channel_config[id] |= HWMON_T_LABEL;
+
+       err = of_property_read_s32(child, "temperature-offset-millicelsius", &val);
+       if (!err) {
+               if (id == 0) {
+                       dev_err(dev, "temperature-offset-millicelsius can't be set for internal channel\n");
+                       return -EINVAL;
+               }
+
+               err = lm90_set_temp_offset(data, lm90_temp_offset_index[id], id, val);
+               if (err) {
+                       dev_err(dev, "can't set temperature offset %d for channel %d (%d)\n",
+                               val, id, err);
+                       return err;
+               }
+       }
+
+       return 0;
+}
+
+static int lm90_parse_dt_channel_info(struct i2c_client *client,
+                                     struct lm90_data *data)
+{
+       int err;
+       struct device_node *child;
+       struct device *dev = &client->dev;
+       const struct device_node *np = dev->of_node;
+
+       for_each_child_of_node(np, child) {
+               if (strcmp(child->name, "channel"))
+                       continue;
+
+               err = lm90_probe_channel_from_dt(client, child, data);
+               if (err) {
+                       of_node_put(child);
+                       return err;
+               }
+       }
+
+       return 0;
+}
 
 static const struct hwmon_ops lm90_ops = {
        .is_visible = lm90_is_visible,
        .read = lm90_read,
+       .read_string = lm90_read_string,
        .write = lm90_write,
 };
 
@@ -1891,41 +2775,63 @@ static int lm90_probe(struct i2c_client *client)
        data->client = client;
        i2c_set_clientdata(client, data);
        mutex_init(&data->update_lock);
+       INIT_DELAYED_WORK(&data->alert_work, lm90_alert_work);
+       INIT_WORK(&data->report_work, lm90_report_alarms);
 
        /* Set the device type */
        if (client->dev.of_node)
                data->kind = (enum chips)of_device_get_match_data(&client->dev);
        else
                data->kind = i2c_match_id(lm90_id, client)->driver_data;
-       if (data->kind == adm1032) {
-               if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
-                       client->flags &= ~I2C_CLIENT_PEC;
-       }
 
        /*
         * Different devices have different alarm bits triggering the
         * ALERT# output
         */
        data->alert_alarms = lm90_params[data->kind].alert_alarms;
+       data->resolution = lm90_params[data->kind].resolution ? : 11;
 
        /* Set chip capabilities */
        data->flags = lm90_params[data->kind].flags;
 
+       if ((data->flags & (LM90_HAVE_PEC | LM90_HAVE_PARTIAL_PEC)) &&
+           !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_PEC))
+               data->flags &= ~(LM90_HAVE_PEC | LM90_HAVE_PARTIAL_PEC);
+
+       if ((data->flags & LM90_HAVE_PARTIAL_PEC) &&
+           !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
+               data->flags &= ~LM90_HAVE_PARTIAL_PEC;
+
        data->chip.ops = &lm90_ops;
        data->chip.info = data->info;
 
-       data->info[0] = HWMON_CHANNEL_INFO(chip,
-               HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL | HWMON_C_ALARMS);
+       data->info[0] = &data->chip_info;
+       info = &data->chip_info;
+       info->type = hwmon_chip;
+       info->config = data->chip_config;
+
+       data->chip_config[0] = HWMON_C_REGISTER_TZ;
+       if (data->flags & LM90_HAVE_ALARMS)
+               data->chip_config[0] |= HWMON_C_ALARMS;
+       if (data->flags & LM90_HAVE_CONVRATE)
+               data->chip_config[0] |= HWMON_C_UPDATE_INTERVAL;
+       if (data->flags & LM90_HAVE_FAULTQUEUE)
+               data->chip_config[0] |= HWMON_C_TEMP_SAMPLES;
        data->info[1] = &data->temp_info;
 
        info = &data->temp_info;
        info->type = hwmon_temp;
        info->config = data->channel_config;
 
-       data->channel_config[0] = HWMON_T_INPUT | HWMON_T_MIN | HWMON_T_MAX |
-               HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM;
-       data->channel_config[1] = HWMON_T_INPUT | HWMON_T_MIN | HWMON_T_MAX |
-               HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM | HWMON_T_FAULT;
+       data->channel_config[0] = HWMON_T_INPUT | HWMON_T_MAX |
+               HWMON_T_MAX_ALARM;
+       data->channel_config[1] = HWMON_T_INPUT | HWMON_T_MAX |
+               HWMON_T_MAX_ALARM | HWMON_T_FAULT;
+
+       if (data->flags & LM90_HAVE_LOW) {
+               data->channel_config[0] |= HWMON_T_MIN | HWMON_T_MIN_ALARM;
+               data->channel_config[1] |= HWMON_T_MIN | HWMON_T_MIN_ALARM;
+       }
 
        if (data->flags & LM90_HAVE_CRIT) {
                data->channel_config[0] |= HWMON_T_CRIT | HWMON_T_CRIT_ALARM | HWMON_T_CRIT_HYST;
@@ -1951,17 +2857,35 @@ static int lm90_probe(struct i2c_client *client)
                data->channel_config[2] = HWMON_T_INPUT |
                        HWMON_T_MIN | HWMON_T_MAX |
                        HWMON_T_CRIT | HWMON_T_CRIT_HYST |
-                       HWMON_T_EMERGENCY | HWMON_T_EMERGENCY_HYST |
                        HWMON_T_MIN_ALARM | HWMON_T_MAX_ALARM |
-                       HWMON_T_CRIT_ALARM | HWMON_T_EMERGENCY_ALARM |
-                       HWMON_T_FAULT;
+                       HWMON_T_CRIT_ALARM | HWMON_T_FAULT;
+               if (data->flags & LM90_HAVE_EMERGENCY) {
+                       data->channel_config[2] |= HWMON_T_EMERGENCY |
+                               HWMON_T_EMERGENCY_HYST;
+               }
+               if (data->flags & LM90_HAVE_EMERGENCY_ALARM)
+                       data->channel_config[2] |= HWMON_T_EMERGENCY_ALARM;
+               if (data->flags & LM90_HAVE_OFFSET)
+                       data->channel_config[2] |= HWMON_T_OFFSET;
        }
 
+       data->faultqueue_mask = lm90_params[data->kind].faultqueue_mask;
+       data->faultqueue_depth = lm90_params[data->kind].faultqueue_depth;
        data->reg_local_ext = lm90_params[data->kind].reg_local_ext;
+       if (data->flags & LM90_HAVE_REMOTE_EXT)
+               data->reg_remote_ext = LM90_REG_REMOTE_TEMPL;
+       data->reg_status2 = lm90_params[data->kind].reg_status2;
 
        /* Set maximum conversion rate */
        data->max_convrate = lm90_params[data->kind].max_convrate;
 
+       /* Parse device-tree channel information */
+       if (client->dev.of_node) {
+               err = lm90_parse_dt_channel_info(client, data);
+               if (err)
+                       return err;
+       }
+
        /* Initialize the LM90 chip */
        err = lm90_init_client(client, data);
        if (err < 0) {
@@ -1973,7 +2897,7 @@ static int lm90_probe(struct i2c_client *client)
         * The 'pec' attribute is attached to the i2c device and thus created
         * separately.
         */
-       if (client->flags & I2C_CLIENT_PEC) {
+       if (data->flags & (LM90_HAVE_PEC | LM90_HAVE_PARTIAL_PEC)) {
                err = device_create_file(dev, &dev_attr_pec);
                if (err)
                        return err;
@@ -2007,12 +2931,10 @@ static int lm90_probe(struct i2c_client *client)
 static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type,
                       unsigned int flag)
 {
-       u16 alarms;
-
        if (type != I2C_PROTOCOL_SMBUS_ALERT)
                return;
 
-       if (lm90_is_tripped(client, &alarms)) {
+       if (lm90_is_tripped(client)) {
                /*
                 * Disable ALERT# output, because these chips don't implement
                 * SMBus alert correctly; they should only hold the alert line
@@ -2021,9 +2943,13 @@ static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type,
                struct lm90_data *data = i2c_get_clientdata(client);
 
                if ((data->flags & LM90_HAVE_BROKEN_ALERT) &&
-                   (alarms & data->alert_alarms)) {
-                       dev_dbg(&client->dev, "Disabling ALERT#\n");
-                       lm90_update_confreg(data, data->config | 0x80);
+                   (data->current_alarms & data->alert_alarms)) {
+                       if (!(data->config & 0x80)) {
+                               dev_dbg(&client->dev, "Disabling ALERT#\n");
+                               lm90_update_confreg(data, data->config | 0x80);
+                       }
+                       schedule_delayed_work(&data->alert_work,
+                               max_t(int, HZ, msecs_to_jiffies(data->update_interval)));
                }
        } else {
                dev_dbg(&client->dev, "Everything OK\n");
index ce2780768074ca5cc6e8530c21c9031dac947df4..e093b19982968122a7e285da795fddae67decc2c 100644 (file)
@@ -7,7 +7,7 @@
  * Reworked by Sven Schuchmann <schuchmann@schleissheimer.de>
  * DT support added by Clemens Gruber <clemens.gruber@pqgruber.com>
  *
- * This driver export the value of analog input voltage to sysfs, the
+ * This driver exports the value of analog input voltage to sysfs, the
  * voltage unit is mV. Through the sysfs interface, lm-sensors tool
  * can also display the input voltage.
  */
@@ -45,19 +45,29 @@ enum chips {
  * Client data (each client gets its own)
  */
 struct mcp3021_data {
-       struct device *hwmon_dev;
+       struct i2c_client *client;
        u32 vdd;        /* supply and reference voltage in millivolt */
        u16 sar_shift;
        u16 sar_mask;
        u8 output_res;
 };
 
-static int mcp3021_read16(struct i2c_client *client)
+static inline u16 volts_from_reg(struct mcp3021_data *data, u16 val)
 {
-       struct mcp3021_data *data = i2c_get_clientdata(client);
-       int ret;
-       u16 reg;
+       return DIV_ROUND_CLOSEST(data->vdd * val, 1 << data->output_res);
+}
+
+static int mcp3021_read(struct device *dev, enum hwmon_sensor_types type,
+                       u32 attr, int channel, long *val)
+{
+       struct mcp3021_data *data = dev_get_drvdata(dev);
+       struct i2c_client *client = data->client;
        __be16 buf;
+       u16 reg;
+       int ret;
+
+       if (type != hwmon_in)
+               return -EOPNOTSUPP;
 
        ret = i2c_master_recv(client, (char *)&buf, 2);
        if (ret < 0)
@@ -74,39 +84,46 @@ static int mcp3021_read16(struct i2c_client *client)
         */
        reg = (reg >> data->sar_shift) & data->sar_mask;
 
-       return reg;
-}
+       *val = volts_from_reg(data, reg);
 
-static inline u16 volts_from_reg(struct mcp3021_data *data, u16 val)
-{
-       return DIV_ROUND_CLOSEST(data->vdd * val, 1 << data->output_res);
+       return 0;
 }
 
-static ssize_t in0_input_show(struct device *dev,
-                             struct device_attribute *attr, char *buf)
+static umode_t mcp3021_is_visible(const void *_data,
+                                 enum hwmon_sensor_types type,
+                                 u32 attr, int channel)
 {
-       struct i2c_client *client = to_i2c_client(dev);
-       struct mcp3021_data *data = i2c_get_clientdata(client);
-       int reg, in_input;
+       if (type != hwmon_in)
+               return 0;
 
-       reg = mcp3021_read16(client);
-       if (reg < 0)
-               return reg;
+       if (attr != hwmon_in_input)
+               return 0;
 
-       in_input = volts_from_reg(data, reg);
-
-       return sprintf(buf, "%d\n", in_input);
+       return 0444;
 }
 
-static DEVICE_ATTR_RO(in0_input);
+static const struct hwmon_channel_info *mcp3021_info[] = {
+       HWMON_CHANNEL_INFO(in, HWMON_I_INPUT),
+       NULL
+};
+
+static const struct hwmon_ops mcp3021_hwmon_ops = {
+       .is_visible = mcp3021_is_visible,
+       .read = mcp3021_read,
+};
+
+static const struct hwmon_chip_info mcp3021_chip_info = {
+       .ops = &mcp3021_hwmon_ops,
+       .info = mcp3021_info,
+};
 
 static const struct i2c_device_id mcp3021_id[];
 
 static int mcp3021_probe(struct i2c_client *client)
 {
-       int err;
        struct mcp3021_data *data = NULL;
        struct device_node *np = client->dev.of_node;
+       struct device *hwmon_dev;
 
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
                return -ENODEV;
@@ -147,34 +164,17 @@ static int mcp3021_probe(struct i2c_client *client)
                break;
        }
 
+       data->client = client;
+
        if (data->vdd > MCP3021_VDD_REF_MAX || data->vdd < MCP3021_VDD_REF_MIN)
                return -EINVAL;
 
-       err = sysfs_create_file(&client->dev.kobj, &dev_attr_in0_input.attr);
-       if (err)
-               return err;
-
-       data->hwmon_dev = hwmon_device_register(&client->dev);
-       if (IS_ERR(data->hwmon_dev)) {
-               err = PTR_ERR(data->hwmon_dev);
-               goto exit_remove;
-       }
-
-       return 0;
-
-exit_remove:
-       sysfs_remove_file(&client->dev.kobj, &dev_attr_in0_input.attr);
-       return err;
-}
-
-static int mcp3021_remove(struct i2c_client *client)
-{
-       struct mcp3021_data *data = i2c_get_clientdata(client);
-
-       hwmon_device_unregister(data->hwmon_dev);
-       sysfs_remove_file(&client->dev.kobj, &dev_attr_in0_input.attr);
-
-       return 0;
+       hwmon_dev = devm_hwmon_device_register_with_info(&client->dev,
+                                                        client->name,
+                                                        data,
+                                                        &mcp3021_chip_info,
+                                                        NULL);
+       return PTR_ERR_OR_ZERO(hwmon_dev);
 }
 
 static const struct i2c_device_id mcp3021_id[] = {
@@ -199,7 +199,6 @@ static struct i2c_driver mcp3021_driver = {
                .of_match_table = of_match_ptr(of_mcp3021_match),
        },
        .probe_new = mcp3021_probe,
-       .remove = mcp3021_remove,
        .id_table = mcp3021_id,
 };
 
index 6d46c940189841eb697c352832bfddbc914fa150..ab30437221ce3b0a08cf29d5d366d1933dc9dc71 100644 (file)
@@ -1083,6 +1083,7 @@ static const char * const asus_wmi_boards[] = {
        "TUF GAMING B550M-PLUS",
        "TUF GAMING B550M-PLUS (WI-FI)",
        "TUF GAMING B550-PLUS",
+       "TUF GAMING B550-PLUS WIFI II",
        "TUF GAMING B550-PRO",
        "TUF GAMING X570-PLUS",
        "TUF GAMING X570-PLUS (WI-FI)",
@@ -1200,10 +1201,8 @@ static int __init sensors_nct6775_platform_init(void)
 exit_device_put:
        platform_device_put(pdev[i]);
 exit_device_unregister:
-       while (--i >= 0) {
-               if (pdev[i])
-                       platform_device_unregister(pdev[i]);
-       }
+       while (i--)
+               platform_device_unregister(pdev[i]);
 exit_unregister:
        platform_driver_unregister(&nct6775_driver);
        return err;
@@ -1213,10 +1212,8 @@ static void __exit sensors_nct6775_platform_exit(void)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(pdev); i++) {
-               if (pdev[i])
-                       platform_device_unregister(pdev[i]);
-       }
+       for (i = 0; i < ARRAY_SIZE(pdev); i++)
+               platform_device_unregister(pdev[i]);
        platform_driver_unregister(&nct6775_driver);
 }
 
index 157b73a3da29fb51ca571c6329b93179caa6b2df..45407b12db4b481342f3e86e5082ae0aefe8c0ed 100644 (file)
@@ -729,18 +729,14 @@ static ssize_t occ_show_extended(struct device *dev,
                        rc = sysfs_emit(buf, "%u",
                                        get_unaligned_be32(&extn->sensor_id));
                } else {
-                       rc = sysfs_emit(buf, "%02x%02x%02x%02x\n",
-                                       extn->name[0], extn->name[1],
-                                       extn->name[2], extn->name[3]);
+                       rc = sysfs_emit(buf, "%4phN\n", extn->name);
                }
                break;
        case 1:
                rc = sysfs_emit(buf, "%02x\n", extn->flags);
                break;
        case 2:
-               rc = sysfs_emit(buf, "%02x%02x%02x%02x%02x%02x\n",
-                               extn->data[0], extn->data[1], extn->data[2],
-                               extn->data[3], extn->data[4], extn->data[5]);
+               rc = sysfs_emit(buf, "%6phN\n", extn->data);
                break;
        default:
                return -EINVAL;
index a91937e28e12bf634a8466ad9e181e684a747ade..c1e0a1d96cd47a3479dedfebe7aba171caf3acd8 100644 (file)
@@ -55,8 +55,7 @@ static bool p9_sbe_occ_save_ffdc(struct p9_sbe_occ *ctx, const void *resp,
        mutex_lock(&ctx->sbe_error_lock);
        if (!ctx->sbe_error) {
                if (resp_len > ctx->ffdc_size) {
-                       if (ctx->ffdc)
-                               kvfree(ctx->ffdc);
+                       kvfree(ctx->ffdc);
                        ctx->ffdc = kvmalloc(resp_len, GFP_KERNEL);
                        if (!ctx->ffdc) {
                                ctx->ffdc_len = 0;
@@ -170,8 +169,7 @@ static int p9_sbe_occ_remove(struct platform_device *pdev)
        ctx->sbe = NULL;
        occ_shutdown(occ);
 
-       if (ctx->ffdc)
-               kvfree(ctx->ffdc);
+       kvfree(ctx->ffdc);
 
        return 0;
 }
index dfae76db65aef21eec3f6ba7d1838984ddb20a2e..951e4a9ff2d6b67cddfcb18f3f0785def3df4911 100644 (file)
@@ -181,6 +181,15 @@ config SENSORS_LM25066_REGULATOR
          If you say yes here you get regulator support for National
          Semiconductor LM25066, LM5064, and LM5066.
 
+config SENSORS_LT7182S
+       tristate "Analog Devices LT7182S"
+       help
+         If you say yes here you get hardware monitoring support for Analog
+         Devices LT7182S.
+
+         This driver can also be built as a module. If so, the module will
+         be called lt7182s.
+
 config SENSORS_LTC2978
        tristate "Linear Technologies LTC2978 and compatibles"
        help
index 4678fba5012c7f1b0f711f92b48981c5693e78d2..e2fe86f989650b15394f6dcb40368f9af15a5f4d 100644 (file)
@@ -20,6 +20,7 @@ obj-$(CONFIG_SENSORS_IR38064) += ir38064.o
 obj-$(CONFIG_SENSORS_IRPS5401) += irps5401.o
 obj-$(CONFIG_SENSORS_ISL68137) += isl68137.o
 obj-$(CONFIG_SENSORS_LM25066)  += lm25066.o
+obj-$(CONFIG_SENSORS_LT7182S)  += lt7182s.o
 obj-$(CONFIG_SENSORS_LTC2978)  += ltc2978.o
 obj-$(CONFIG_SENSORS_LTC3815)  += ltc3815.o
 obj-$(CONFIG_SENSORS_MAX15301) += max15301.o
diff --git a/drivers/hwmon/pmbus/lt7182s.c b/drivers/hwmon/pmbus/lt7182s.c
new file mode 100644 (file)
index 0000000..4cfe476
--- /dev/null
@@ -0,0 +1,195 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Hardware monitoring driver for Analog Devices LT7182S
+ *
+ * Copyright (c) 2022 Guenter Roeck
+ *
+ */
+
+#include <linux/bits.h>
+#include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include "pmbus.h"
+
+#define LT7182S_NUM_PAGES      2
+
+#define MFR_READ_EXTVCC                0xcd
+#define MFR_READ_ITH           0xce
+#define MFR_CONFIG_ALL_LT7182S 0xd1
+#define MFR_IOUT_PEAK          0xd7
+#define MFR_ADC_CONTROL_LT7182S 0xd8
+
+#define MFR_DEBUG_TELEMETRY    BIT(0)
+
+#define MFR_VOUT_PEAK          0xdd
+#define MFR_VIN_PEAK           0xde
+#define MFR_TEMPERATURE_1_PEAK 0xdf
+#define MFR_CLEAR_PEAKS                0xe3
+
+#define MFR_CONFIG_IEEE                BIT(8)
+
+static int lt7182s_read_word_data(struct i2c_client *client, int page, int phase, int reg)
+{
+       int ret;
+
+       switch (reg) {
+       case PMBUS_VIRT_READ_VMON:
+               if (page == 0 || page == 1)
+                       ret = pmbus_read_word_data(client, page, phase, MFR_READ_ITH);
+               else
+                       ret = pmbus_read_word_data(client, 0, phase, MFR_READ_EXTVCC);
+               break;
+       case PMBUS_VIRT_READ_IOUT_MAX:
+               ret = pmbus_read_word_data(client, page, phase, MFR_IOUT_PEAK);
+               break;
+       case PMBUS_VIRT_READ_VOUT_MAX:
+               ret = pmbus_read_word_data(client, page, phase, MFR_VOUT_PEAK);
+               break;
+       case PMBUS_VIRT_READ_VIN_MAX:
+               ret = pmbus_read_word_data(client, page, phase, MFR_VIN_PEAK);
+               break;
+       case PMBUS_VIRT_READ_TEMP_MAX:
+               ret = pmbus_read_word_data(client, page, phase, MFR_TEMPERATURE_1_PEAK);
+               break;
+       case PMBUS_VIRT_RESET_VIN_HISTORY:
+               ret = (page == 0) ? 0 : -ENODATA;
+               break;
+       default:
+               ret = -ENODATA;
+               break;
+       }
+       return ret;
+}
+
+static int lt7182s_write_word_data(struct i2c_client *client, int page, int reg, u16 word)
+{
+       int ret;
+
+       switch (reg) {
+       case PMBUS_VIRT_RESET_VIN_HISTORY:
+               ret = pmbus_write_byte(client, 0, MFR_CLEAR_PEAKS);
+               break;
+       default:
+               ret = -ENODATA;
+               break;
+       }
+       return ret;
+}
+
+static struct pmbus_driver_info lt7182s_info = {
+       .pages = LT7182S_NUM_PAGES,
+       .format[PSC_VOLTAGE_IN] = linear,
+       .format[PSC_VOLTAGE_OUT] = linear,
+       .format[PSC_CURRENT_IN] = linear,
+       .format[PSC_CURRENT_OUT] = linear,
+       .format[PSC_TEMPERATURE] = linear,
+       .format[PSC_POWER] = linear,
+       .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT |
+         PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT |
+         PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT |
+         PMBUS_HAVE_STATUS_INPUT | PMBUS_HAVE_STATUS_TEMP,
+       .func[1] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT |
+         PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_POUT |
+         PMBUS_HAVE_STATUS_VOUT | PMBUS_HAVE_STATUS_IOUT |
+         PMBUS_HAVE_STATUS_INPUT,
+       .read_word_data = lt7182s_read_word_data,
+       .write_word_data = lt7182s_write_word_data,
+};
+
+static int lt7182s_probe(struct i2c_client *client)
+{
+       struct device *dev = &client->dev;
+       struct pmbus_driver_info *info;
+       u8 buf[I2C_SMBUS_BLOCK_MAX + 1];
+       int ret;
+
+       if (!i2c_check_functionality(client->adapter,
+                                    I2C_FUNC_SMBUS_READ_BYTE_DATA |
+                                    I2C_FUNC_SMBUS_READ_WORD_DATA |
+                                    I2C_FUNC_SMBUS_READ_BLOCK_DATA))
+               return -ENODEV;
+
+       ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID, buf);
+       if (ret < 0) {
+               dev_err(dev, "Failed to read PMBUS_MFR_ID\n");
+               return ret;
+       }
+       if (ret != 3 || strncmp(buf, "ADI", 3)) {
+               buf[ret] = '\0';
+               dev_err(dev, "Manufacturer '%s' not supported\n", buf);
+               return -ENODEV;
+       }
+
+       ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
+       if (ret < 0) {
+               dev_err(dev, "Failed to read PMBUS_MFR_MODEL\n");
+               return ret;
+       }
+       if (ret != 7 || strncmp(buf, "LT7182S", 7)) {
+               buf[ret] = '\0';
+               dev_err(dev, "Model '%s' not supported\n", buf);
+               return -ENODEV;
+       }
+
+       info = devm_kmemdup(dev, &lt7182s_info,
+                           sizeof(struct pmbus_driver_info), GFP_KERNEL);
+       if (!info)
+               return -ENOMEM;
+
+       /* Set data format to IEEE754 if configured */
+       ret = i2c_smbus_read_word_data(client, MFR_CONFIG_ALL_LT7182S);
+       if (ret < 0)
+               return ret;
+       if (ret & MFR_CONFIG_IEEE) {
+               info->format[PSC_VOLTAGE_IN] = ieee754;
+               info->format[PSC_VOLTAGE_OUT] = ieee754;
+               info->format[PSC_CURRENT_IN] = ieee754;
+               info->format[PSC_CURRENT_OUT] = ieee754;
+               info->format[PSC_TEMPERATURE] = ieee754;
+               info->format[PSC_POWER] = ieee754;
+       }
+
+       /* Enable VMON output if configured */
+       ret = i2c_smbus_read_byte_data(client, MFR_ADC_CONTROL_LT7182S);
+       if (ret < 0)
+               return ret;
+       if (ret & MFR_DEBUG_TELEMETRY) {
+               info->pages = 3;
+               info->func[0] |= PMBUS_HAVE_VMON;
+               info->func[1] |= PMBUS_HAVE_VMON;
+               info->func[2] = PMBUS_HAVE_VMON;
+       }
+
+       return pmbus_do_probe(client, info);
+}
+
+static const struct i2c_device_id lt7182s_id[] = {
+       { "lt7182s", 0 },
+       {}
+};
+MODULE_DEVICE_TABLE(i2c, lt7182s_id);
+
+static const struct of_device_id __maybe_unused lt7182s_of_match[] = {
+       { .compatible = "adi,lt7182s" },
+       {}
+};
+
+static struct i2c_driver lt7182s_driver = {
+       .driver = {
+               .name = "lt7182s",
+               .of_match_table = of_match_ptr(lt7182s_of_match),
+       },
+       .probe_new = lt7182s_probe,
+       .id_table = lt7182s_id,
+};
+
+module_i2c_driver(lt7182s_driver);
+
+MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>");
+MODULE_DESCRIPTION("PMBus driver for Analog Devices LT7182S");
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS(PMBUS);
index 531aa674a9283367d6259cb2d0f3e3290d44a042..6d2592731ba3dc1c0b571e8cfbecc417f2f1f25b 100644 (file)
@@ -562,7 +562,24 @@ static const struct i2c_device_id ltc2978_id[] = {
 MODULE_DEVICE_TABLE(i2c, ltc2978_id);
 
 #if IS_ENABLED(CONFIG_SENSORS_LTC2978_REGULATOR)
+#define LTC2978_ADC_RES        0xFFFF
+#define LTC2978_N_ADC  122
+#define LTC2978_MAX_UV (LTC2978_ADC_RES * LTC2978_N_ADC)
+#define LTC2978_UV_STEP        1000
+#define LTC2978_N_VOLTAGES     ((LTC2978_MAX_UV / LTC2978_UV_STEP) + 1)
+
 static const struct regulator_desc ltc2978_reg_desc[] = {
+       PMBUS_REGULATOR_STEP("vout", 0, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 1, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 2, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 3, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 4, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 5, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 6, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+       PMBUS_REGULATOR_STEP("vout", 7, LTC2978_N_VOLTAGES, LTC2978_UV_STEP),
+};
+
+static const struct regulator_desc ltc2978_reg_desc_default[] = {
        PMBUS_REGULATOR("vout", 0),
        PMBUS_REGULATOR("vout", 1),
        PMBUS_REGULATOR("vout", 2),
@@ -839,10 +856,29 @@ static int ltc2978_probe(struct i2c_client *client)
 
 #if IS_ENABLED(CONFIG_SENSORS_LTC2978_REGULATOR)
        info->num_regulators = info->pages;
-       info->reg_desc = ltc2978_reg_desc;
-       if (info->num_regulators > ARRAY_SIZE(ltc2978_reg_desc)) {
-               dev_err(&client->dev, "num_regulators too large!");
-               info->num_regulators = ARRAY_SIZE(ltc2978_reg_desc);
+       switch (data->id) {
+       case ltc2972:
+       case ltc2974:
+       case ltc2975:
+       case ltc2977:
+       case ltc2978:
+       case ltc2979:
+       case ltc2980:
+       case ltm2987:
+               info->reg_desc = ltc2978_reg_desc;
+               if (info->num_regulators > ARRAY_SIZE(ltc2978_reg_desc)) {
+                       dev_warn(&client->dev, "num_regulators too large!");
+                       info->num_regulators = ARRAY_SIZE(ltc2978_reg_desc);
+               }
+               break;
+       default:
+               info->reg_desc = ltc2978_reg_desc_default;
+               if (info->num_regulators > ARRAY_SIZE(ltc2978_reg_desc_default)) {
+                       dev_warn(&client->dev, "num_regulators too large!");
+                       info->num_regulators =
+                           ARRAY_SIZE(ltc2978_reg_desc_default);
+               }
+               break;
        }
 #endif
 
index c031a9700ace9bdbb53ac8648700dc53da498582..7daaf0caf4d30a0dbd9b5669a86f01b0ff1850a2 100644 (file)
@@ -406,7 +406,7 @@ enum pmbus_sensor_classes {
 #define PMBUS_PHASE_VIRTUAL    BIT(30) /* Phases on this page are virtual */
 #define PMBUS_PAGE_VIRTUAL     BIT(31) /* Page is virtual */
 
-enum pmbus_data_format { linear = 0, direct, vid };
+enum pmbus_data_format { linear = 0, ieee754, direct, vid };
 enum vrm_version { vr11 = 0, vr12, vr13, imvp9, amd625mv };
 
 struct pmbus_driver_info {
@@ -463,8 +463,8 @@ struct pmbus_driver_info {
 
 extern const struct regulator_ops pmbus_regulator_ops;
 
-/* Macro for filling in array of struct regulator_desc */
-#define PMBUS_REGULATOR(_name, _id)                            \
+/* Macros for filling in array of struct regulator_desc */
+#define PMBUS_REGULATOR_STEP(_name, _id, _voltages, _step)  \
        [_id] = {                                               \
                .name = (_name # _id),                          \
                .supply_name = "vin",                           \
@@ -474,8 +474,12 @@ extern const struct regulator_ops pmbus_regulator_ops;
                .ops = &pmbus_regulator_ops,                    \
                .type = REGULATOR_VOLTAGE,                      \
                .owner = THIS_MODULE,                           \
+               .n_voltages = _voltages,                        \
+               .uV_step = _step,                               \
        }
 
+#define PMBUS_REGULATOR(_name, _id)    PMBUS_REGULATOR_STEP(_name, _id, 0, 0)
+
 /* Function declarations */
 
 void pmbus_clear_cache(struct i2c_client *client);
index 02912022853d802e24173d43fd3e96ba83174557..f10bac8860fce5e9823647c876f7cfce2a48fd2d 100644 (file)
@@ -104,6 +104,9 @@ struct pmbus_data {
 
        s16 currpage;   /* current page, -1 for unknown/unset */
        s16 currphase;  /* current phase, 0xff for all, -1 for unknown/unset */
+
+       int vout_low[PMBUS_PAGES];      /* voltage low margin */
+       int vout_high[PMBUS_PAGES];     /* voltage high margin */
 };
 
 struct pmbus_debugfs_entry {
@@ -441,6 +444,18 @@ int pmbus_update_byte_data(struct i2c_client *client, int page, u8 reg,
 }
 EXPORT_SYMBOL_NS_GPL(pmbus_update_byte_data, PMBUS);
 
+static int pmbus_read_block_data(struct i2c_client *client, int page, u8 reg,
+                                char *data_buf)
+{
+       int rv;
+
+       rv = pmbus_set_page(client, page, 0xff);
+       if (rv < 0)
+               return rv;
+
+       return i2c_smbus_read_block_data(client, reg, data_buf);
+}
+
 static struct pmbus_sensor *pmbus_find_sensor(struct pmbus_data *data, int page,
                                              int reg)
 {
@@ -578,6 +593,22 @@ bool pmbus_check_word_register(struct i2c_client *client, int page, int reg)
 }
 EXPORT_SYMBOL_NS_GPL(pmbus_check_word_register, PMBUS);
 
+static bool __maybe_unused pmbus_check_block_register(struct i2c_client *client,
+                                                     int page, int reg)
+{
+       int rv;
+       struct pmbus_data *data = i2c_get_clientdata(client);
+       char data_buf[I2C_SMBUS_BLOCK_MAX + 2];
+
+       rv = pmbus_read_block_data(client, page, reg, data_buf);
+       if (rv >= 0 && !(data->flags & PMBUS_SKIP_STATUS_CHECK))
+               rv = pmbus_check_status_cml(client);
+       if (rv < 0 && (data->flags & PMBUS_READ_STATUS_AFTER_FAILED_CHECK))
+               data->read_status(client, -1);
+       pmbus_clear_fault_page(client, -1);
+       return rv >= 0;
+}
+
 const struct pmbus_driver_info *pmbus_get_driver_info(struct i2c_client *client)
 {
        struct pmbus_data *data = i2c_get_clientdata(client);
@@ -611,6 +642,66 @@ static void pmbus_update_sensor_data(struct i2c_client *client, struct pmbus_sen
                                                     sensor->phase, sensor->reg);
 }
 
+/*
+ * Convert ieee754 sensor values to milli- or micro-units
+ * depending on sensor type.
+ *
+ * ieee754 data format:
+ *     bit 15:         sign
+ *     bit 10..14:     exponent
+ *     bit 0..9:       mantissa
+ * exponent=0:
+ *     v=(−1)^signbit * 2^(−14) * 0.significantbits
+ * exponent=1..30:
+ *     v=(−1)^signbit * 2^(exponent - 15) * 1.significantbits
+ * exponent=31:
+ *     v=NaN
+ *
+ * Add the number mantissa bits into the calculations for simplicity.
+ * To do that, add '10' to the exponent. By doing that, we can just add
+ * 0x400 to normal values and get the expected result.
+ */
+static long pmbus_reg2data_ieee754(struct pmbus_data *data,
+                                  struct pmbus_sensor *sensor)
+{
+       int exponent;
+       bool sign;
+       long val;
+
+       /* only support half precision for now */
+       sign = sensor->data & 0x8000;
+       exponent = (sensor->data >> 10) & 0x1f;
+       val = sensor->data & 0x3ff;
+
+       if (exponent == 0) {                    /* subnormal */
+               exponent = -(14 + 10);
+       } else if (exponent ==  0x1f) {         /* NaN, convert to min/max */
+               exponent = 0;
+               val = 65504;
+       } else {
+               exponent -= (15 + 10);          /* normal */
+               val |= 0x400;
+       }
+
+       /* scale result to milli-units for all sensors except fans */
+       if (sensor->class != PSC_FAN)
+               val = val * 1000L;
+
+       /* scale result to micro-units for power sensors */
+       if (sensor->class == PSC_POWER)
+               val = val * 1000L;
+
+       if (exponent >= 0)
+               val <<= exponent;
+       else
+               val >>= -exponent;
+
+       if (sign)
+               val = -val;
+
+       return val;
+}
+
 /*
  * Convert linear sensor values to milli- or micro-units
  * depending on sensor type.
@@ -741,6 +832,9 @@ static s64 pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor)
        case vid:
                val = pmbus_reg2data_vid(data, sensor);
                break;
+       case ieee754:
+               val = pmbus_reg2data_ieee754(data, sensor);
+               break;
        case linear:
        default:
                val = pmbus_reg2data_linear(data, sensor);
@@ -749,8 +843,72 @@ static s64 pmbus_reg2data(struct pmbus_data *data, struct pmbus_sensor *sensor)
        return val;
 }
 
-#define MAX_MANTISSA   (1023 * 1000)
-#define MIN_MANTISSA   (511 * 1000)
+#define MAX_IEEE_MANTISSA      (0x7ff * 1000)
+#define MIN_IEEE_MANTISSA      (0x400 * 1000)
+
+static u16 pmbus_data2reg_ieee754(struct pmbus_data *data,
+                                 struct pmbus_sensor *sensor, long val)
+{
+       u16 exponent = (15 + 10);
+       long mantissa;
+       u16 sign = 0;
+
+       /* simple case */
+       if (val == 0)
+               return 0;
+
+       if (val < 0) {
+               sign = 0x8000;
+               val = -val;
+       }
+
+       /* Power is in uW. Convert to mW before converting. */
+       if (sensor->class == PSC_POWER)
+               val = DIV_ROUND_CLOSEST(val, 1000L);
+
+       /*
+        * For simplicity, convert fan data to milli-units
+        * before calculating the exponent.
+        */
+       if (sensor->class == PSC_FAN)
+               val = val * 1000;
+
+       /* Reduce large mantissa until it fits into 10 bit */
+       while (val > MAX_IEEE_MANTISSA && exponent < 30) {
+               exponent++;
+               val >>= 1;
+       }
+       /*
+        * Increase small mantissa to generate valid 'normal'
+        * number
+        */
+       while (val < MIN_IEEE_MANTISSA && exponent > 1) {
+               exponent--;
+               val <<= 1;
+       }
+
+       /* Convert mantissa from milli-units to units */
+       mantissa = DIV_ROUND_CLOSEST(val, 1000);
+
+       /*
+        * Ensure that the resulting number is within range.
+        * Valid range is 0x400..0x7ff, where bit 10 reflects
+        * the implied high bit in normalized ieee754 numbers.
+        * Set the range to 0x400..0x7ff to reflect this.
+        * The upper bit is then removed by the mask against
+        * 0x3ff in the final assignment.
+        */
+       if (mantissa > 0x7ff)
+               mantissa = 0x7ff;
+       else if (mantissa < 0x400)
+               mantissa = 0x400;
+
+       /* Convert to sign, 5 bit exponent, 10 bit mantissa */
+       return sign | (mantissa & 0x3ff) | ((exponent << 10) & 0x7c00);
+}
+
+#define MAX_LIN_MANTISSA       (1023 * 1000)
+#define MIN_LIN_MANTISSA       (511 * 1000)
 
 static u16 pmbus_data2reg_linear(struct pmbus_data *data,
                                 struct pmbus_sensor *sensor, s64 val)
@@ -796,12 +954,12 @@ static u16 pmbus_data2reg_linear(struct pmbus_data *data,
                val = val * 1000LL;
 
        /* Reduce large mantissa until it fits into 10 bit */
-       while (val >= MAX_MANTISSA && exponent < 15) {
+       while (val >= MAX_LIN_MANTISSA && exponent < 15) {
                exponent++;
                val >>= 1;
        }
        /* Increase small mantissa to improve precision */
-       while (val < MIN_MANTISSA && exponent > -15) {
+       while (val < MIN_LIN_MANTISSA && exponent > -15) {
                exponent--;
                val <<= 1;
        }
@@ -875,6 +1033,9 @@ static u16 pmbus_data2reg(struct pmbus_data *data,
        case vid:
                regval = pmbus_data2reg_vid(data, sensor, val);
                break;
+       case ieee754:
+               regval = pmbus_data2reg_ieee754(data, sensor, val);
+               break;
        case linear:
        default:
                regval = pmbus_data2reg_linear(data, sensor, val);
@@ -2369,6 +2530,10 @@ static int pmbus_identify_common(struct i2c_client *client,
                        if (data->info->format[PSC_VOLTAGE_OUT] != direct)
                                return -ENODEV;
                        break;
+               case 3: /* ieee 754 half precision */
+                       if (data->info->format[PSC_VOLTAGE_OUT] != ieee754)
+                               return -ENODEV;
+                       break;
                default:
                        return -ENODEV;
                }
@@ -2388,6 +2553,42 @@ static int pmbus_read_status_word(struct i2c_client *client, int page)
        return _pmbus_read_word_data(client, page, 0xff, PMBUS_STATUS_WORD);
 }
 
+/* PEC attribute support */
+
+static ssize_t pec_show(struct device *dev, struct device_attribute *dummy,
+                       char *buf)
+{
+       struct i2c_client *client = to_i2c_client(dev);
+
+       return sysfs_emit(buf, "%d\n", !!(client->flags & I2C_CLIENT_PEC));
+}
+
+static ssize_t pec_store(struct device *dev, struct device_attribute *dummy,
+                        const char *buf, size_t count)
+{
+       struct i2c_client *client = to_i2c_client(dev);
+       bool enable;
+       int err;
+
+       err = kstrtobool(buf, &enable);
+       if (err < 0)
+               return err;
+
+       if (enable)
+               client->flags |= I2C_CLIENT_PEC;
+       else
+               client->flags &= ~I2C_CLIENT_PEC;
+
+       return count;
+}
+
+static DEVICE_ATTR_RW(pec);
+
+static void pmbus_remove_pec(void *dev)
+{
+       device_remove_file(dev, &dev_attr_pec);
+}
+
 static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
                             struct pmbus_driver_info *info)
 {
@@ -2474,6 +2675,20 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
                        return ret;
        }
 
+       if (client->flags & I2C_CLIENT_PEC) {
+               /*
+                * If I2C_CLIENT_PEC is set here, both the I2C adapter and the
+                * chip support PEC. Add 'pec' attribute to client device to let
+                * the user control it.
+                */
+               ret = device_create_file(dev, &dev_attr_pec);
+               if (ret)
+                       return ret;
+               ret = devm_add_action_or_reset(dev, pmbus_remove_pec, dev);
+               if (ret)
+                       return ret;
+       }
+
        return 0;
 }
 
@@ -2636,6 +2851,58 @@ static int pmbus_regulator_get_error_flags(struct regulator_dev *rdev, unsigned
        return 0;
 }
 
+static int pmbus_regulator_get_low_margin(struct i2c_client *client, int page)
+{
+       struct pmbus_data *data = i2c_get_clientdata(client);
+       struct pmbus_sensor s = {
+               .page = page,
+               .class = PSC_VOLTAGE_OUT,
+               .convert = true,
+               .data = -1,
+       };
+
+       if (!data->vout_low[page]) {
+               if (pmbus_check_word_register(client, page, PMBUS_MFR_VOUT_MIN))
+                       s.data = _pmbus_read_word_data(client, page, 0xff,
+                                                      PMBUS_MFR_VOUT_MIN);
+               if (s.data < 0) {
+                       s.data = _pmbus_read_word_data(client, page, 0xff,
+                                                      PMBUS_VOUT_MARGIN_LOW);
+                       if (s.data < 0)
+                               return s.data;
+               }
+               data->vout_low[page] = pmbus_reg2data(data, &s);
+       }
+
+       return data->vout_low[page];
+}
+
+static int pmbus_regulator_get_high_margin(struct i2c_client *client, int page)
+{
+       struct pmbus_data *data = i2c_get_clientdata(client);
+       struct pmbus_sensor s = {
+               .page = page,
+               .class = PSC_VOLTAGE_OUT,
+               .convert = true,
+               .data = -1,
+       };
+
+       if (!data->vout_high[page]) {
+               if (pmbus_check_word_register(client, page, PMBUS_MFR_VOUT_MAX))
+                       s.data = _pmbus_read_word_data(client, page, 0xff,
+                                                      PMBUS_MFR_VOUT_MAX);
+               if (s.data < 0) {
+                       s.data = _pmbus_read_word_data(client, page, 0xff,
+                                                      PMBUS_VOUT_MARGIN_HIGH);
+                       if (s.data < 0)
+                               return s.data;
+               }
+               data->vout_high[page] = pmbus_reg2data(data, &s);
+       }
+
+       return data->vout_high[page];
+}
+
 static int pmbus_regulator_get_voltage(struct regulator_dev *rdev)
 {
        struct device *dev = rdev_get_dev(rdev);
@@ -2671,24 +2938,13 @@ static int pmbus_regulator_set_voltage(struct regulator_dev *rdev, int min_uv,
 
        *selector = 0;
 
-       if (pmbus_check_word_register(client, s.page, PMBUS_MFR_VOUT_MIN))
-               s.data = _pmbus_read_word_data(client, s.page, 0xff, PMBUS_MFR_VOUT_MIN);
-       if (s.data < 0) {
-               s.data = _pmbus_read_word_data(client, s.page, 0xff, PMBUS_VOUT_MARGIN_LOW);
-               if (s.data < 0)
-                       return s.data;
-       }
-       low = pmbus_reg2data(data, &s);
+       low = pmbus_regulator_get_low_margin(client, s.page);
+       if (low < 0)
+               return low;
 
-       s.data = -1;
-       if (pmbus_check_word_register(client, s.page, PMBUS_MFR_VOUT_MAX))
-               s.data = _pmbus_read_word_data(client, s.page, 0xff, PMBUS_MFR_VOUT_MAX);
-       if (s.data < 0) {
-               s.data = _pmbus_read_word_data(client, s.page, 0xff, PMBUS_VOUT_MARGIN_HIGH);
-               if (s.data < 0)
-                       return s.data;
-       }
-       high = pmbus_reg2data(data, &s);
+       high = pmbus_regulator_get_high_margin(client, s.page);
+       if (high < 0)
+               return high;
 
        /* Make sure we are within margins */
        if (low > val)
@@ -2701,6 +2957,35 @@ static int pmbus_regulator_set_voltage(struct regulator_dev *rdev, int min_uv,
        return _pmbus_write_word_data(client, s.page, PMBUS_VOUT_COMMAND, (u16)val);
 }
 
+static int pmbus_regulator_list_voltage(struct regulator_dev *rdev,
+                                        unsigned int selector)
+{
+       struct device *dev = rdev_get_dev(rdev);
+       struct i2c_client *client = to_i2c_client(dev->parent);
+       int val, low, high;
+
+       if (selector >= rdev->desc->n_voltages ||
+           selector < rdev->desc->linear_min_sel)
+               return -EINVAL;
+
+       selector -= rdev->desc->linear_min_sel;
+       val = DIV_ROUND_CLOSEST(rdev->desc->min_uV +
+                               (rdev->desc->uV_step * selector), 1000); /* convert to mV */
+
+       low = pmbus_regulator_get_low_margin(client, rdev_get_id(rdev));
+       if (low < 0)
+               return low;
+
+       high = pmbus_regulator_get_high_margin(client, rdev_get_id(rdev));
+       if (high < 0)
+               return high;
+
+       if (val >= low && val <= high)
+               return val * 1000; /* unit is uV */
+
+       return 0;
+}
+
 const struct regulator_ops pmbus_regulator_ops = {
        .enable = pmbus_regulator_enable,
        .disable = pmbus_regulator_disable,
@@ -2708,6 +2993,7 @@ const struct regulator_ops pmbus_regulator_ops = {
        .get_error_flags = pmbus_regulator_get_error_flags,
        .get_voltage = pmbus_regulator_get_voltage,
        .set_voltage = pmbus_regulator_set_voltage,
+       .list_voltage = pmbus_regulator_list_voltage,
 };
 EXPORT_SYMBOL_NS_GPL(pmbus_regulator_ops, PMBUS);
 
@@ -2782,41 +3068,33 @@ static int pmbus_debugfs_get_status(void *data, u64 *val)
 DEFINE_DEBUGFS_ATTRIBUTE(pmbus_debugfs_ops_status, pmbus_debugfs_get_status,
                         NULL, "0x%04llx\n");
 
-static int pmbus_debugfs_get_pec(void *data, u64 *val)
-{
-       struct i2c_client *client = data;
-
-       *val = !!(client->flags & I2C_CLIENT_PEC);
-
-       return 0;
-}
-
-static int pmbus_debugfs_set_pec(void *data, u64 val)
+static ssize_t pmbus_debugfs_mfr_read(struct file *file, char __user *buf,
+                                      size_t count, loff_t *ppos)
 {
        int rc;
-       struct i2c_client *client = data;
-
-       if (!val) {
-               client->flags &= ~I2C_CLIENT_PEC;
-               return 0;
-       }
-
-       if (val != 1)
-               return -EINVAL;
+       struct pmbus_debugfs_entry *entry = file->private_data;
+       char data[I2C_SMBUS_BLOCK_MAX + 2] = { 0 };
 
-       rc = i2c_smbus_read_byte_data(client, PMBUS_CAPABILITY);
+       rc = pmbus_read_block_data(entry->client, entry->page, entry->reg,
+                                  data);
        if (rc < 0)
                return rc;
 
-       if (!(rc & PB_CAPABILITY_ERROR_CHECK))
-               return -EOPNOTSUPP;
+       /* Add newline at the end of a read data */
+       data[rc] = '\n';
 
-       client->flags |= I2C_CLIENT_PEC;
+       /* Include newline into the length */
+       rc += 1;
 
-       return 0;
+       return simple_read_from_buffer(buf, count, ppos, data, rc);
 }
-DEFINE_DEBUGFS_ATTRIBUTE(pmbus_debugfs_ops_pec, pmbus_debugfs_get_pec,
-                        pmbus_debugfs_set_pec, "%llu\n");
+
+static const struct file_operations pmbus_debugfs_ops_mfr = {
+       .llseek = noop_llseek,
+       .read = pmbus_debugfs_mfr_read,
+       .write = NULL,
+       .open = simple_open,
+};
 
 static void pmbus_remove_debugfs(void *data)
 {
@@ -2846,16 +3124,80 @@ static int pmbus_init_debugfs(struct i2c_client *client,
                return -ENODEV;
        }
 
-       /* Allocate the max possible entries we need. */
+       /*
+        * Allocate the max possible entries we need.
+        * 6 entries device-specific
+        * 10 entries page-specific
+        */
        entries = devm_kcalloc(data->dev,
-                              data->info->pages * 10, sizeof(*entries),
+                              6 + data->info->pages * 10, sizeof(*entries),
                               GFP_KERNEL);
        if (!entries)
                return -ENOMEM;
 
-       debugfs_create_file("pec", 0664, data->debugfs, client,
-                           &pmbus_debugfs_ops_pec);
-
+       /*
+        * Add device-specific entries.
+        * Please note that the PMBUS standard allows all registers to be
+        * page-specific.
+        * To reduce the number of debugfs entries for devices with many pages
+        * assume that values of the following registers are the same for all
+        * pages and report values only for page 0.
+        */
+       if (pmbus_check_block_register(client, 0, PMBUS_MFR_ID)) {
+               entries[idx].client = client;
+               entries[idx].page = 0;
+               entries[idx].reg = PMBUS_MFR_ID;
+               debugfs_create_file("mfr_id", 0444, data->debugfs,
+                                   &entries[idx++],
+                                   &pmbus_debugfs_ops_mfr);
+       }
+
+       if (pmbus_check_block_register(client, 0, PMBUS_MFR_MODEL)) {
+               entries[idx].client = client;
+               entries[idx].page = 0;
+               entries[idx].reg = PMBUS_MFR_MODEL;
+               debugfs_create_file("mfr_model", 0444, data->debugfs,
+                                   &entries[idx++],
+                                   &pmbus_debugfs_ops_mfr);
+       }
+
+       if (pmbus_check_block_register(client, 0, PMBUS_MFR_REVISION)) {
+               entries[idx].client = client;
+               entries[idx].page = 0;
+               entries[idx].reg = PMBUS_MFR_REVISION;
+               debugfs_create_file("mfr_revision", 0444, data->debugfs,
+                                   &entries[idx++],
+                                   &pmbus_debugfs_ops_mfr);
+       }
+
+       if (pmbus_check_block_register(client, 0, PMBUS_MFR_LOCATION)) {
+               entries[idx].client = client;
+               entries[idx].page = 0;
+               entries[idx].reg = PMBUS_MFR_LOCATION;
+               debugfs_create_file("mfr_location", 0444, data->debugfs,
+                                   &entries[idx++],
+                                   &pmbus_debugfs_ops_mfr);
+       }
+
+       if (pmbus_check_block_register(client, 0, PMBUS_MFR_DATE)) {
+               entries[idx].client = client;
+               entries[idx].page = 0;
+               entries[idx].reg = PMBUS_MFR_DATE;
+               debugfs_create_file("mfr_date", 0444, data->debugfs,
+                                   &entries[idx++],
+                                   &pmbus_debugfs_ops_mfr);
+       }
+
+       if (pmbus_check_block_register(client, 0, PMBUS_MFR_SERIAL)) {
+               entries[idx].client = client;
+               entries[idx].page = 0;
+               entries[idx].reg = PMBUS_MFR_SERIAL;
+               debugfs_create_file("mfr_serial", 0444, data->debugfs,
+                                   &entries[idx++],
+                                   &pmbus_debugfs_ops_mfr);
+       }
+
+       /* Add page specific entries */
        for (i = 0; i < data->info->pages; ++i) {
                /* Check accessibility of status register if it's not page 0 */
                if (!i || pmbus_check_status_register(client, i)) {
index 3ece53adabd626764ed604ba14e947402abfb162..de3a0886c2f726da1cb3d31712250fbca069f6fb 100644 (file)
@@ -523,6 +523,28 @@ static int __init sch56xx_device_add(int address, const char *name)
        return PTR_ERR_OR_ZERO(sch56xx_pdev);
 }
 
+static const struct dmi_system_id sch56xx_dmi_override_table[] __initconst = {
+       {
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS W380"),
+               },
+       },
+       {
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO P710"),
+               },
+       },
+       {
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO E9900"),
+               },
+       },
+       { }
+};
+
 /* For autoloading only */
 static const struct dmi_system_id sch56xx_dmi_table[] __initconst = {
        {
@@ -543,16 +565,18 @@ static int __init sch56xx_init(void)
                if (!dmi_check_system(sch56xx_dmi_table))
                        return -ENODEV;
 
-               /*
-                * Some machines like the Esprimo P720 and Esprimo C700 have
-                * onboard devices named " Antiope"/" Theseus" instead of
-                * "Antiope"/"Theseus", so we need to check for both.
-                */
-               if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
-                   !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
-                   !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
-                   !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
-                       return -ENODEV;
+               if (!dmi_check_system(sch56xx_dmi_override_table)) {
+                       /*
+                        * Some machines like the Esprimo P720 and Esprimo C700 have
+                        * onboard devices named " Antiope"/" Theseus" instead of
+                        * "Antiope"/"Theseus", so we need to check for both.
+                        */
+                       if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
+                           !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
+                           !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
+                           !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
+                               return -ENODEV;
+               }
        }
 
        /*
index 7f4a639597306391239cbd7fab3920180c054a75..ae4d14257a11da2044650867b1ad8245dd62e865 100644 (file)
@@ -1020,25 +1020,20 @@ err_release_reg:
 static int sht15_remove(struct platform_device *pdev)
 {
        struct sht15_data *data = platform_get_drvdata(pdev);
+       int ret;
 
-       /*
-        * Make sure any reads from the device are done and
-        * prevent new ones beginning
-        */
-       mutex_lock(&data->read_lock);
-       if (sht15_soft_reset(data)) {
-               mutex_unlock(&data->read_lock);
-               return -EFAULT;
-       }
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&pdev->dev.kobj, &sht15_attr_group);
+
+       ret = sht15_soft_reset(data);
+       if (ret)
+               dev_err(&pdev->dev, "Failed to reset device (%pe)\n", ERR_PTR(ret));
+
        if (!IS_ERR(data->reg)) {
                regulator_unregister_notifier(data->reg, &data->nb);
                regulator_disable(data->reg);
        }
 
-       mutex_unlock(&data->read_lock);
-
        return 0;
 }
 
index 8bd6435c13e82fb1fa0c4fc2f5c117291bbd9cf9..42762e87b0147bf6e908ec0602857ce5126fb864 100644 (file)
@@ -140,7 +140,8 @@ static int tps23861_read_temp(struct tps23861_data *data, long *val)
 static int tps23861_read_voltage(struct tps23861_data *data, int channel,
                                 long *val)
 {
-       unsigned int regval;
+       __le16 regval;
+       long raw_val;
        int err;
 
        if (channel < TPS23861_NUM_PORTS) {
@@ -155,7 +156,8 @@ static int tps23861_read_voltage(struct tps23861_data *data, int channel,
        if (err < 0)
                return err;
 
-       *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * VOLTAGE_LSB) / 1000;
+       raw_val = le16_to_cpu(regval);
+       *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * VOLTAGE_LSB) / 1000;
 
        return 0;
 }
@@ -163,8 +165,9 @@ static int tps23861_read_voltage(struct tps23861_data *data, int channel,
 static int tps23861_read_current(struct tps23861_data *data, int channel,
                                 long *val)
 {
-       unsigned int current_lsb;
-       unsigned int regval;
+       long raw_val, current_lsb;
+       __le16 regval;
+
        int err;
 
        if (data->shunt_resistor == SHUNT_RESISTOR_DEFAULT)
@@ -178,7 +181,8 @@ static int tps23861_read_current(struct tps23861_data *data, int channel,
        if (err < 0)
                return err;
 
-       *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, regval) * current_lsb) / 1000000;
+       raw_val = le16_to_cpu(regval);
+       *val = (FIELD_GET(VOLTAGE_CURRENT_MASK, raw_val) * current_lsb) / 1000000;
 
        return 0;
 }
index a1bae59208e346572063dc8a16fe8b9c89ecf583..708a67c7faaa8efba4eb657a80838c8102f68fae 100644 (file)
@@ -486,7 +486,7 @@ config I2C_BCM_KONA
 
 config I2C_BRCMSTB
        tristate "BRCM Settop/DSL I2C controller"
-       depends on ARCH_BCM2835 || ARCH_BCM4908 || ARCH_BCM_63XX || \
+       depends on ARCH_BCM2835 || ARCH_BCM4908 || ARCH_BCMBCA || \
                   ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
        default y
        help
index f5c6802aa6c3ea6f5c6aef233f61b53126ce9e90..445b19d20b9a3de46d897ec1e1da0df654f2311e 100644 (file)
@@ -56,6 +56,7 @@
 #include <asm/nospec-branch.h>
 #include <asm/mwait.h>
 #include <asm/msr.h>
+#include <asm/fpu/api.h>
 
 #define INTEL_IDLE_VERSION "0.5.1"
 
@@ -113,6 +114,11 @@ static unsigned int mwait_substates __initdata;
  */
 #define CPUIDLE_FLAG_IBRS              BIT(16)
 
+/*
+ * Initialize large xstate for the C6-state entrance.
+ */
+#define CPUIDLE_FLAG_INIT_XSTATE       BIT(17)
+
 /*
  * MWAIT takes an 8-bit "hint" in EAX "suggesting"
  * the C-state (top nibble) and sub-state (bottom nibble)
@@ -162,7 +168,13 @@ static __cpuidle int intel_idle_irq(struct cpuidle_device *dev,
 
        raw_local_irq_enable();
        ret = __intel_idle(dev, drv, index);
-       raw_local_irq_disable();
+
+       /*
+        * The lockdep hardirqs state may be changed to 'on' with timer
+        * tick interrupt followed by __do_softirq(). Use local_irq_disable()
+        * to keep the hardirqs state correct.
+        */
+       local_irq_disable();
 
        return ret;
 }
@@ -185,6 +197,13 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
        return ret;
 }
 
+static __cpuidle int intel_idle_xstate(struct cpuidle_device *dev,
+                                      struct cpuidle_driver *drv, int index)
+{
+       fpu_idle_fpregs();
+       return __intel_idle(dev, drv, index);
+}
+
 /**
  * intel_idle_s2idle - Ask the processor to enter the given idle state.
  * @dev: cpuidle device of the target CPU.
@@ -200,8 +219,12 @@ static __cpuidle int intel_idle_ibrs(struct cpuidle_device *dev,
 static __cpuidle int intel_idle_s2idle(struct cpuidle_device *dev,
                                       struct cpuidle_driver *drv, int index)
 {
-       unsigned long eax = flg2MWAIT(drv->states[index].flags);
        unsigned long ecx = 1; /* break on interrupt flag */
+       struct cpuidle_state *state = &drv->states[index];
+       unsigned long eax = flg2MWAIT(state->flags);
+
+       if (state->flags & CPUIDLE_FLAG_INIT_XSTATE)
+               fpu_idle_fpregs();
 
        mwait_idle_with_hints(eax, ecx);
 
@@ -936,7 +959,8 @@ static struct cpuidle_state spr_cstates[] __initdata = {
        {
                .name = "C6",
                .desc = "MWAIT 0x20",
-               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
+               .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED |
+                                          CPUIDLE_FLAG_INIT_XSTATE,
                .exit_latency = 290,
                .target_residency = 800,
                .enter = &intel_idle,
@@ -1851,6 +1875,9 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
                        drv->states[drv->state_count].enter = intel_idle_ibrs;
                }
 
+               if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_INIT_XSTATE)
+                       drv->states[drv->state_count].enter = intel_idle_xstate;
+
                if ((disabled_states_mask & BIT(drv->state_count)) ||
                    ((icpu->use_acpi || force_use_acpi) &&
                     intel_idle_off_by_default(mwait_hint) &&
index e285a220c913a46a8609b0bd03cdb25118dd525a..51bd66a45a11ef95bbda3b7a91f4547b1532545a 100644 (file)
@@ -194,7 +194,7 @@ hyperv_root_ir_compose_msi_msg(struct irq_data *irq_data, struct msi_msg *msg)
        u32 vector;
        struct irq_cfg *cfg;
        int ioapic_id;
-       struct cpumask *affinity;
+       const struct cpumask *affinity;
        int cpu;
        struct hv_interrupt_entry entry;
        struct hyperv_root_ir_data *data = irq_data->chip_data;
index bbb11cb8b0f73a22cf167fe2e473639141349b39..66b9fa408bf2422fd083acddbaf705e6ddce6b9a 100644 (file)
@@ -8,7 +8,7 @@ config IRQCHIP
 config ARM_GIC
        bool
        select IRQ_DOMAIN_HIERARCHY
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config ARM_GIC_PM
        bool
@@ -34,7 +34,7 @@ config ARM_GIC_V3
        bool
        select IRQ_DOMAIN_HIERARCHY
        select PARTITION_PERCPU
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config ARM_GIC_V3_ITS
        bool
@@ -76,7 +76,7 @@ config ARMADA_370_XP_IRQ
        bool
        select GENERIC_IRQ_CHIP
        select PCI_MSI if PCI
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config ALPINE_MSI
        bool
@@ -112,7 +112,7 @@ config BCM6345_L1_IRQ
        bool
        select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config BCM7038_L1_IRQ
        tristate "Broadcom STB 7038-style L1/L2 interrupt controller driver"
@@ -120,7 +120,7 @@ config BCM7038_L1_IRQ
        default ARCH_BRCMSTB || BMIPS_GENERIC
        select GENERIC_IRQ_CHIP
        select IRQ_DOMAIN
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config BCM7120_L2_IRQ
        tristate "Broadcom STB 7120-style L2 interrupt controller driver"
@@ -177,9 +177,9 @@ config MADERA_IRQ
 config IRQ_MIPS_CPU
        bool
        select GENERIC_IRQ_CHIP
-       select GENERIC_IRQ_IPI if SYS_SUPPORTS_MULTITHREADING
+       select GENERIC_IRQ_IPI if SMP && SYS_SUPPORTS_MULTITHREADING
        select IRQ_DOMAIN
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config CLPS711X_IRQCHIP
        bool
@@ -242,6 +242,14 @@ config RENESAS_RZA1_IRQC
          Enable support for the Renesas RZ/A1 Interrupt Controller, to use up
          to 8 external interrupts with configurable sense select.
 
+config RENESAS_RZG2L_IRQC
+       bool "Renesas RZ/G2L (and alike SoC) IRQC support" if COMPILE_TEST
+       select GENERIC_IRQ_CHIP
+       select IRQ_DOMAIN_HIERARCHY
+       help
+         Enable support for the Renesas RZ/G2L (and alike SoC) Interrupt Controller
+         for external devices.
+
 config SL28CPLD_INTC
        bool "Kontron sl28cpld IRQ controller"
        depends on MFD_SL28CPLD=y || COMPILE_TEST
@@ -294,7 +302,7 @@ config VERSATILE_FPGA_IRQ_NR
 config XTENSA_MX
        bool
        select IRQ_DOMAIN
-       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
 
 config XILINX_INTC
        bool "Xilinx Interrupt Controller IP"
@@ -322,7 +330,8 @@ config KEYSTONE_IRQ
 
 config MIPS_GIC
        bool
-       select GENERIC_IRQ_IPI
+       select GENERIC_IRQ_IPI if SMP
+       select IRQ_DOMAIN_HIERARCHY
        select MIPS_CM
 
 config INGENIC_IRQ
@@ -530,6 +539,7 @@ config SIFIVE_PLIC
        bool "SiFive Platform-Level Interrupt Controller"
        depends on RISCV
        select IRQ_DOMAIN_HIERARCHY
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK if SMP
        help
           This enables support for the PLIC chip found in SiFive (and
           potentially other) RISC-V systems.  The PLIC controls devices
@@ -546,6 +556,16 @@ config EXYNOS_IRQ_COMBINER
          Say yes here to add support for the IRQ combiner devices embedded
          in Samsung Exynos chips.
 
+config IRQ_LOONGARCH_CPU
+       bool
+       select GENERIC_IRQ_CHIP
+       select IRQ_DOMAIN
+       select GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       help
+         Support for the LoongArch CPU Interrupt Controller. For details of
+         irq chip hierarchy on LoongArch platforms please read the document
+         Documentation/loongarch/irq-chip-model.rst.
+
 config LOONGSON_LIOINTC
        bool "Loongson Local I/O Interrupt Controller"
        depends on MACH_LOONGSON64
@@ -555,6 +575,16 @@ config LOONGSON_LIOINTC
        help
          Support for the Loongson Local I/O Interrupt Controller.
 
+config LOONGSON_EIOINTC
+       bool "Loongson Extend I/O Interrupt Controller"
+       depends on LOONGARCH
+       depends on MACH_LOONGSON64
+       default MACH_LOONGSON64
+       select IRQ_DOMAIN_HIERARCHY
+       select GENERIC_IRQ_CHIP
+       help
+         Support for the Loongson3 Extend I/O Interrupt Vector Controller.
+
 config LOONGSON_HTPIC
        bool "Loongson3 HyperTransport PIC Controller"
        depends on MACH_LOONGSON64 && MIPS
@@ -574,7 +604,7 @@ config LOONGSON_HTVEC
 
 config LOONGSON_PCH_PIC
        bool "Loongson PCH PIC Controller"
-       depends on MACH_LOONGSON64 || COMPILE_TEST
+       depends on MACH_LOONGSON64
        default MACH_LOONGSON64
        select IRQ_DOMAIN_HIERARCHY
        select IRQ_FASTEOI_HIERARCHY_HANDLERS
@@ -583,7 +613,7 @@ config LOONGSON_PCH_PIC
 
 config LOONGSON_PCH_MSI
        bool "Loongson PCH MSI Controller"
-       depends on MACH_LOONGSON64 || COMPILE_TEST
+       depends on MACH_LOONGSON64
        depends on PCI
        default MACH_LOONGSON64
        select IRQ_DOMAIN_HIERARCHY
@@ -591,6 +621,14 @@ config LOONGSON_PCH_MSI
        help
          Support for the Loongson PCH MSI Controller.
 
+config LOONGSON_PCH_LPC
+       bool "Loongson PCH LPC Controller"
+       depends on MACH_LOONGSON64
+       default (MACH_LOONGSON64 && LOONGARCH)
+       select IRQ_DOMAIN_HIERARCHY
+       help
+         Support for the Loongson PCH LPC Controller.
+
 config MST_IRQ
        bool "MStar Interrupt Controller"
        depends on ARCH_MEDIATEK || ARCH_MSTARV7 || COMPILE_TEST
@@ -627,4 +665,13 @@ config MCHP_EIC
        help
          Support for Microchip External Interrupt Controller.
 
+config SUNPLUS_SP7021_INTC
+       bool "Sunplus SP7021 interrupt controller" if COMPILE_TEST
+       default SOC_SP7021
+       help
+         Support for the Sunplus SP7021 Interrupt Controller IP core.
+         SP7021 SoC has 2 Chips: C-Chip & P-Chip. This is used as a
+         chained controller, routing all interrupt source in P-Chip to
+         the primary controller on C-Chip.
+
 endmenu
index 5b67450a95388fdc6196b8c56582157fc22a8461..b6acbca2248bc24291a5f2719a024a818f45aec2 100644 (file)
@@ -51,6 +51,7 @@ obj-$(CONFIG_RDA_INTC)                        += irq-rda-intc.o
 obj-$(CONFIG_RENESAS_INTC_IRQPIN)      += irq-renesas-intc-irqpin.o
 obj-$(CONFIG_RENESAS_IRQC)             += irq-renesas-irqc.o
 obj-$(CONFIG_RENESAS_RZA1_IRQC)                += irq-renesas-rza1.o
+obj-$(CONFIG_RENESAS_RZG2L_IRQC)       += irq-renesas-rzg2l.o
 obj-$(CONFIG_VERSATILE_FPGA_IRQ)       += irq-versatile-fpga.o
 obj-$(CONFIG_ARCH_NSPIRE)              += irq-zevio.o
 obj-$(CONFIG_ARCH_VT8500)              += irq-vt8500.o
@@ -103,11 +104,14 @@ obj-$(CONFIG_LS1X_IRQ)                    += irq-ls1x.o
 obj-$(CONFIG_TI_SCI_INTR_IRQCHIP)      += irq-ti-sci-intr.o
 obj-$(CONFIG_TI_SCI_INTA_IRQCHIP)      += irq-ti-sci-inta.o
 obj-$(CONFIG_TI_PRUSS_INTC)            += irq-pruss-intc.o
+obj-$(CONFIG_IRQ_LOONGARCH_CPU)                += irq-loongarch-cpu.o
 obj-$(CONFIG_LOONGSON_LIOINTC)         += irq-loongson-liointc.o
+obj-$(CONFIG_LOONGSON_EIOINTC)         += irq-loongson-eiointc.o
 obj-$(CONFIG_LOONGSON_HTPIC)           += irq-loongson-htpic.o
 obj-$(CONFIG_LOONGSON_HTVEC)           += irq-loongson-htvec.o
 obj-$(CONFIG_LOONGSON_PCH_PIC)         += irq-loongson-pch-pic.o
 obj-$(CONFIG_LOONGSON_PCH_MSI)         += irq-loongson-pch-msi.o
+obj-$(CONFIG_LOONGSON_PCH_LPC)         += irq-loongson-pch-lpc.o
 obj-$(CONFIG_MST_IRQ)                  += irq-mst-intc.o
 obj-$(CONFIG_SL28CPLD_INTC)            += irq-sl28cpld.o
 obj-$(CONFIG_MACH_REALTEK_RTL)         += irq-realtek-rtl.o
@@ -115,3 +119,4 @@ obj-$(CONFIG_WPCM450_AIC)           += irq-wpcm450-aic.o
 obj-$(CONFIG_IRQ_IDT3243X)             += irq-idt3243x.o
 obj-$(CONFIG_APPLE_AIC)                        += irq-apple-aic.o
 obj-$(CONFIG_MCHP_EIC)                 += irq-mchp-eic.o
+obj-$(CONFIG_SUNPLUS_SP7021_INTC)      += irq-sp7021-intc.o
index 142a7431745f940cc2ce327d8afc5ab70f7e6908..6899e37810a8866b77c3e7ae2a62c3baf63862b4 100644 (file)
@@ -216,11 +216,11 @@ static int bcm6345_l1_set_affinity(struct irq_data *d,
                enabled = intc->cpus[old_cpu]->enable_cache[word] & mask;
                if (enabled)
                        __bcm6345_l1_mask(d);
-               cpumask_copy(irq_data_get_affinity_mask(d), dest);
+               irq_data_update_affinity(d, dest);
                if (enabled)
                        __bcm6345_l1_unmask(d);
        } else {
-               cpumask_copy(irq_data_get_affinity_mask(d), dest);
+               irq_data_update_affinity(d, dest);
        }
        raw_spin_unlock_irqrestore(&intc->lock, flags);
 
index 2d25bca63d2a1f3e963f74fa1d863ccd692a2377..262658fd5f9e59f9d3ee6395c1af39be4399d9d8 100644 (file)
@@ -1783,7 +1783,7 @@ static void gic_enable_nmi_support(void)
         * the security state of the GIC (controlled by the GICD_CTRL.DS bit)
         * and if Group 0 interrupts can be delivered to Linux in the non-secure
         * world as FIQs (controlled by the SCR_EL3.FIQ bit). These affect the
-        * the ICC_PMR_EL1 register and the priority that software assigns to
+        * ICC_PMR_EL1 register and the priority that software assigns to
         * interrupts:
         *
         * GICD_CTRL.DS | SCR_EL3.FIQ | ICC_PMR_EL1 | Group 1 priority
@@ -2381,11 +2381,17 @@ static void __init gic_acpi_setup_kvm_info(void)
        vgic_set_kvm_info(&gic_v3_kvm_info);
 }
 
+static struct fwnode_handle *gsi_domain_handle;
+
+static struct fwnode_handle *gic_v3_get_gsi_domain_id(u32 gsi)
+{
+       return gsi_domain_handle;
+}
+
 static int __init
 gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
 {
        struct acpi_madt_generic_distributor *dist;
-       struct fwnode_handle *domain_handle;
        size_t size;
        int i, err;
 
@@ -2417,18 +2423,18 @@ gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
        if (err)
                goto out_redist_unmap;
 
-       domain_handle = irq_domain_alloc_fwnode(&dist->base_address);
-       if (!domain_handle) {
+       gsi_domain_handle = irq_domain_alloc_fwnode(&dist->base_address);
+       if (!gsi_domain_handle) {
                err = -ENOMEM;
                goto out_redist_unmap;
        }
 
        err = gic_init_bases(acpi_data.dist_base, acpi_data.redist_regs,
-                            acpi_data.nr_redist_regions, 0, domain_handle);
+                            acpi_data.nr_redist_regions, 0, gsi_domain_handle);
        if (err)
                goto out_fwhandle_free;
 
-       acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
+       acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, gic_v3_get_gsi_domain_id);
 
        if (static_branch_likely(&supports_deactivate_key))
                gic_acpi_setup_kvm_info();
@@ -2436,7 +2442,7 @@ gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end)
        return 0;
 
 out_fwhandle_free:
-       irq_domain_free_fwnode(domain_handle);
+       irq_domain_free_fwnode(gsi_domain_handle);
 out_redist_unmap:
        for (i = 0; i < acpi_data.nr_redist_regions; i++)
                if (acpi_data.redist_regs[i].redist_base)
index 820404cb56bc7396a5c5aa51ef8c76c3ccb782a9..4c7bae0ec8f96e000aa1e46490bb3165f388f11b 100644 (file)
@@ -1682,11 +1682,17 @@ static void __init gic_acpi_setup_kvm_info(void)
        vgic_set_kvm_info(&gic_v2_kvm_info);
 }
 
+static struct fwnode_handle *gsi_domain_handle;
+
+static struct fwnode_handle *gic_v2_get_gsi_domain_id(u32 gsi)
+{
+       return gsi_domain_handle;
+}
+
 static int __init gic_v2_acpi_init(union acpi_subtable_headers *header,
                                   const unsigned long end)
 {
        struct acpi_madt_generic_distributor *dist;
-       struct fwnode_handle *domain_handle;
        struct gic_chip_data *gic = &gic_data[0];
        int count, ret;
 
@@ -1724,22 +1730,22 @@ static int __init gic_v2_acpi_init(union acpi_subtable_headers *header,
        /*
         * Initialize GIC instance zero (no multi-GIC support).
         */
-       domain_handle = irq_domain_alloc_fwnode(&dist->base_address);
-       if (!domain_handle) {
+       gsi_domain_handle = irq_domain_alloc_fwnode(&dist->base_address);
+       if (!gsi_domain_handle) {
                pr_err("Unable to allocate domain handle\n");
                gic_teardown(gic);
                return -ENOMEM;
        }
 
-       ret = __gic_init_bases(gic, domain_handle);
+       ret = __gic_init_bases(gic, gsi_domain_handle);
        if (ret) {
                pr_err("Failed to initialise GIC\n");
-               irq_domain_free_fwnode(domain_handle);
+               irq_domain_free_fwnode(gsi_domain_handle);
                gic_teardown(gic);
                return ret;
        }
 
-       acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, domain_handle);
+       acpi_set_irq_model(ACPI_IRQ_MODEL_GIC, gic_v2_get_gsi_domain_id);
 
        if (IS_ENABLED(CONFIG_ARM_GIC_V2M))
                gicv2m_init(NULL, gic_data[0].domain);
diff --git a/drivers/irqchip/irq-loongarch-cpu.c b/drivers/irqchip/irq-loongarch-cpu.c
new file mode 100644 (file)
index 0000000..327f3ab
--- /dev/null
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/irqdomain.h>
+
+#include <asm/loongarch.h>
+#include <asm/setup.h>
+
+static struct irq_domain *irq_domain;
+struct fwnode_handle *cpuintc_handle;
+
+static u32 lpic_gsi_to_irq(u32 gsi)
+{
+       /* Only pch irqdomain transferring is required for LoongArch. */
+       if (gsi >= GSI_MIN_PCH_IRQ && gsi <= GSI_MAX_PCH_IRQ)
+               return acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_HIGH);
+
+       return 0;
+}
+
+static struct fwnode_handle *lpic_get_gsi_domain_id(u32 gsi)
+{
+       int id;
+       struct fwnode_handle *domain_handle = NULL;
+
+       switch (gsi) {
+       case GSI_MIN_CPU_IRQ ... GSI_MAX_CPU_IRQ:
+               if (liointc_handle)
+                       domain_handle = liointc_handle;
+               break;
+
+       case GSI_MIN_LPC_IRQ ... GSI_MAX_LPC_IRQ:
+               if (pch_lpc_handle)
+                       domain_handle = pch_lpc_handle;
+               break;
+
+       case GSI_MIN_PCH_IRQ ... GSI_MAX_PCH_IRQ:
+               id = find_pch_pic(gsi);
+               if (id >= 0 && pch_pic_handle[id])
+                       domain_handle = pch_pic_handle[id];
+               break;
+       }
+
+       return domain_handle;
+}
+
+static void mask_loongarch_irq(struct irq_data *d)
+{
+       clear_csr_ecfg(ECFGF(d->hwirq));
+}
+
+static void unmask_loongarch_irq(struct irq_data *d)
+{
+       set_csr_ecfg(ECFGF(d->hwirq));
+}
+
+static struct irq_chip cpu_irq_controller = {
+       .name           = "CPUINTC",
+       .irq_mask       = mask_loongarch_irq,
+       .irq_unmask     = unmask_loongarch_irq,
+};
+
+static void handle_cpu_irq(struct pt_regs *regs)
+{
+       int hwirq;
+       unsigned int estat = read_csr_estat() & CSR_ESTAT_IS;
+
+       while ((hwirq = ffs(estat))) {
+               estat &= ~BIT(hwirq - 1);
+               generic_handle_domain_irq(irq_domain, hwirq - 1);
+       }
+}
+
+static int loongarch_cpu_intc_map(struct irq_domain *d, unsigned int irq,
+                            irq_hw_number_t hwirq)
+{
+       irq_set_noprobe(irq);
+       irq_set_chip_and_handler(irq, &cpu_irq_controller, handle_percpu_irq);
+
+       return 0;
+}
+
+static const struct irq_domain_ops loongarch_cpu_intc_irq_domain_ops = {
+       .map = loongarch_cpu_intc_map,
+       .xlate = irq_domain_xlate_onecell,
+};
+
+static int __init
+liointc_parse_madt(union acpi_subtable_headers *header,
+                      const unsigned long end)
+{
+       struct acpi_madt_lio_pic *liointc_entry = (struct acpi_madt_lio_pic *)header;
+
+       return liointc_acpi_init(irq_domain, liointc_entry);
+}
+
+static int __init
+eiointc_parse_madt(union acpi_subtable_headers *header,
+                      const unsigned long end)
+{
+       struct acpi_madt_eio_pic *eiointc_entry = (struct acpi_madt_eio_pic *)header;
+
+       return eiointc_acpi_init(irq_domain, eiointc_entry);
+}
+
+static int __init acpi_cascade_irqdomain_init(void)
+{
+       acpi_table_parse_madt(ACPI_MADT_TYPE_LIO_PIC,
+                             liointc_parse_madt, 0);
+       acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC,
+                             eiointc_parse_madt, 0);
+       return 0;
+}
+
+static int __init cpuintc_acpi_init(union acpi_subtable_headers *header,
+                                  const unsigned long end)
+{
+       if (irq_domain)
+               return 0;
+
+       /* Mask interrupts. */
+       clear_csr_ecfg(ECFG0_IM);
+       clear_csr_estat(ESTATF_IP);
+
+       cpuintc_handle = irq_domain_alloc_fwnode(NULL);
+       irq_domain = irq_domain_create_linear(cpuintc_handle, EXCCODE_INT_NUM,
+                                       &loongarch_cpu_intc_irq_domain_ops, NULL);
+
+       if (!irq_domain)
+               panic("Failed to add irqdomain for LoongArch CPU");
+
+       set_handle_irq(&handle_cpu_irq);
+       acpi_set_irq_model(ACPI_IRQ_MODEL_LPIC, lpic_get_gsi_domain_id);
+       acpi_set_gsi_to_irq_fallback(lpic_gsi_to_irq);
+       acpi_cascade_irqdomain_init();
+
+       return 0;
+}
+
+IRQCHIP_ACPI_DECLARE(cpuintc_v1, ACPI_MADT_TYPE_CORE_PIC,
+               NULL, ACPI_MADT_CORE_PIC_VERSION_V1, cpuintc_acpi_init);
diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c
new file mode 100644 (file)
index 0000000..80d8ca6
--- /dev/null
@@ -0,0 +1,395 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson Extend I/O Interrupt Controller support
+ *
+ * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
+ */
+
+#define pr_fmt(fmt) "eiointc: " fmt
+
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/irqdomain.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+
+#define EIOINTC_REG_NODEMAP    0x14a0
+#define EIOINTC_REG_IPMAP      0x14c0
+#define EIOINTC_REG_ENABLE     0x1600
+#define EIOINTC_REG_BOUNCE     0x1680
+#define EIOINTC_REG_ISR                0x1800
+#define EIOINTC_REG_ROUTE      0x1c00
+
+#define VEC_REG_COUNT          4
+#define VEC_COUNT_PER_REG      64
+#define VEC_COUNT              (VEC_REG_COUNT * VEC_COUNT_PER_REG)
+#define VEC_REG_IDX(irq_id)    ((irq_id) / VEC_COUNT_PER_REG)
+#define VEC_REG_BIT(irq_id)     ((irq_id) % VEC_COUNT_PER_REG)
+#define EIOINTC_ALL_ENABLE     0xffffffff
+
+#define MAX_EIO_NODES          (NR_CPUS / CORES_PER_EIO_NODE)
+
+static int nr_pics;
+
+struct eiointc_priv {
+       u32                     node;
+       nodemask_t              node_map;
+       cpumask_t               cpuspan_map;
+       struct fwnode_handle    *domain_handle;
+       struct irq_domain       *eiointc_domain;
+};
+
+static struct eiointc_priv *eiointc_priv[MAX_IO_PICS];
+
+static void eiointc_enable(void)
+{
+       uint64_t misc;
+
+       misc = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
+       misc |= IOCSR_MISC_FUNC_EXT_IOI_EN;
+       iocsr_write64(misc, LOONGARCH_IOCSR_MISC_FUNC);
+}
+
+static int cpu_to_eio_node(int cpu)
+{
+       return cpu_logical_map(cpu) / CORES_PER_EIO_NODE;
+}
+
+static void eiointc_set_irq_route(int pos, unsigned int cpu, unsigned int mnode, nodemask_t *node_map)
+{
+       int i, node, cpu_node, route_node;
+       unsigned char coremap;
+       uint32_t pos_off, data, data_byte, data_mask;
+
+       pos_off = pos & ~3;
+       data_byte = pos & 3;
+       data_mask = ~BIT_MASK(data_byte) & 0xf;
+
+       /* Calculate node and coremap of target irq */
+       cpu_node = cpu_logical_map(cpu) / CORES_PER_EIO_NODE;
+       coremap = BIT(cpu_logical_map(cpu) % CORES_PER_EIO_NODE);
+
+       for_each_online_cpu(i) {
+               node = cpu_to_eio_node(i);
+               if (!node_isset(node, *node_map))
+                       continue;
+
+               /* EIO node 0 is in charge of inter-node interrupt dispatch */
+               route_node = (node == mnode) ? cpu_node : node;
+               data = ((coremap | (route_node << 4)) << (data_byte * 8));
+               csr_any_send(EIOINTC_REG_ROUTE + pos_off, data, data_mask, node * CORES_PER_EIO_NODE);
+       }
+}
+
+static DEFINE_RAW_SPINLOCK(affinity_lock);
+
+static int eiointc_set_irq_affinity(struct irq_data *d, const struct cpumask *affinity, bool force)
+{
+       unsigned int cpu;
+       unsigned long flags;
+       uint32_t vector, regaddr;
+       struct cpumask intersect_affinity;
+       struct eiointc_priv *priv = d->domain->host_data;
+
+       raw_spin_lock_irqsave(&affinity_lock, flags);
+
+       cpumask_and(&intersect_affinity, affinity, cpu_online_mask);
+       cpumask_and(&intersect_affinity, &intersect_affinity, &priv->cpuspan_map);
+
+       if (cpumask_empty(&intersect_affinity)) {
+               raw_spin_unlock_irqrestore(&affinity_lock, flags);
+               return -EINVAL;
+       }
+       cpu = cpumask_first(&intersect_affinity);
+
+       vector = d->hwirq;
+       regaddr = EIOINTC_REG_ENABLE + ((vector >> 5) << 2);
+
+       /* Mask target vector */
+       csr_any_send(regaddr, EIOINTC_ALL_ENABLE & (~BIT(vector & 0x1F)), 0x0, 0);
+       /* Set route for target vector */
+       eiointc_set_irq_route(vector, cpu, priv->node, &priv->node_map);
+       /* Unmask target vector */
+       csr_any_send(regaddr, EIOINTC_ALL_ENABLE, 0x0, 0);
+
+       irq_data_update_effective_affinity(d, cpumask_of(cpu));
+
+       raw_spin_unlock_irqrestore(&affinity_lock, flags);
+
+       return IRQ_SET_MASK_OK;
+}
+
+static int eiointc_index(int node)
+{
+       int i;
+
+       for (i = 0; i < nr_pics; i++) {
+               if (node_isset(node, eiointc_priv[i]->node_map))
+                       return i;
+       }
+
+       return -1;
+}
+
+static int eiointc_router_init(unsigned int cpu)
+{
+       int i, bit;
+       uint32_t data;
+       uint32_t node = cpu_to_eio_node(cpu);
+       uint32_t index = eiointc_index(node);
+
+       if (index < 0) {
+               pr_err("Error: invalid nodemap!\n");
+               return -1;
+       }
+
+       if ((cpu_logical_map(cpu) % CORES_PER_EIO_NODE) == 0) {
+               eiointc_enable();
+
+               for (i = 0; i < VEC_COUNT / 32; i++) {
+                       data = (((1 << (i * 2 + 1)) << 16) | (1 << (i * 2)));
+                       iocsr_write32(data, EIOINTC_REG_NODEMAP + i * 4);
+               }
+
+               for (i = 0; i < VEC_COUNT / 32 / 4; i++) {
+                       bit = BIT(1 + index); /* Route to IP[1 + index] */
+                       data = bit | (bit << 8) | (bit << 16) | (bit << 24);
+                       iocsr_write32(data, EIOINTC_REG_IPMAP + i * 4);
+               }
+
+               for (i = 0; i < VEC_COUNT / 4; i++) {
+                       /* Route to Node-0 Core-0 */
+                       if (index == 0)
+                               bit = BIT(cpu_logical_map(0));
+                       else
+                               bit = (eiointc_priv[index]->node << 4) | 1;
+
+                       data = bit | (bit << 8) | (bit << 16) | (bit << 24);
+                       iocsr_write32(data, EIOINTC_REG_ROUTE + i * 4);
+               }
+
+               for (i = 0; i < VEC_COUNT / 32; i++) {
+                       data = 0xffffffff;
+                       iocsr_write32(data, EIOINTC_REG_ENABLE + i * 4);
+                       iocsr_write32(data, EIOINTC_REG_BOUNCE + i * 4);
+               }
+       }
+
+       return 0;
+}
+
+static void eiointc_irq_dispatch(struct irq_desc *desc)
+{
+       int i;
+       u64 pending;
+       bool handled = false;
+       struct irq_chip *chip = irq_desc_get_chip(desc);
+       struct eiointc_priv *priv = irq_desc_get_handler_data(desc);
+
+       chained_irq_enter(chip, desc);
+
+       for (i = 0; i < VEC_REG_COUNT; i++) {
+               pending = iocsr_read64(EIOINTC_REG_ISR + (i << 3));
+               iocsr_write64(pending, EIOINTC_REG_ISR + (i << 3));
+               while (pending) {
+                       int bit = __ffs(pending);
+                       int irq = bit + VEC_COUNT_PER_REG * i;
+
+                       generic_handle_domain_irq(priv->eiointc_domain, irq);
+                       pending &= ~BIT(bit);
+                       handled = true;
+               }
+       }
+
+       if (!handled)
+               spurious_interrupt();
+
+       chained_irq_exit(chip, desc);
+}
+
+static void eiointc_ack_irq(struct irq_data *d)
+{
+}
+
+static void eiointc_mask_irq(struct irq_data *d)
+{
+}
+
+static void eiointc_unmask_irq(struct irq_data *d)
+{
+}
+
+static struct irq_chip eiointc_irq_chip = {
+       .name                   = "EIOINTC",
+       .irq_ack                = eiointc_ack_irq,
+       .irq_mask               = eiointc_mask_irq,
+       .irq_unmask             = eiointc_unmask_irq,
+       .irq_set_affinity       = eiointc_set_irq_affinity,
+};
+
+static int eiointc_domain_alloc(struct irq_domain *domain, unsigned int virq,
+                               unsigned int nr_irqs, void *arg)
+{
+       int ret;
+       unsigned int i, type;
+       unsigned long hwirq = 0;
+       struct eiointc *priv = domain->host_data;
+
+       ret = irq_domain_translate_onecell(domain, arg, &hwirq, &type);
+       if (ret)
+               return ret;
+
+       for (i = 0; i < nr_irqs; i++) {
+               irq_domain_set_info(domain, virq + i, hwirq + i, &eiointc_irq_chip,
+                                       priv, handle_edge_irq, NULL, NULL);
+       }
+
+       return 0;
+}
+
+static void eiointc_domain_free(struct irq_domain *domain, unsigned int virq,
+                               unsigned int nr_irqs)
+{
+       int i;
+
+       for (i = 0; i < nr_irqs; i++) {
+               struct irq_data *d = irq_domain_get_irq_data(domain, virq + i);
+
+               irq_set_handler(virq + i, NULL);
+               irq_domain_reset_irq_data(d);
+       }
+}
+
+static const struct irq_domain_ops eiointc_domain_ops = {
+       .translate      = irq_domain_translate_onecell,
+       .alloc          = eiointc_domain_alloc,
+       .free           = eiointc_domain_free,
+};
+
+static void acpi_set_vec_parent(int node, struct irq_domain *parent, struct acpi_vector_group *vec_group)
+{
+       int i;
+
+       if (cpu_has_flatmode)
+               node = cpu_to_node(node * CORES_PER_EIO_NODE);
+
+       for (i = 0; i < MAX_IO_PICS; i++) {
+               if (node == vec_group[i].node) {
+                       vec_group[i].parent = parent;
+                       return;
+               }
+       }
+}
+
+struct irq_domain *acpi_get_vec_parent(int node, struct acpi_vector_group *vec_group)
+{
+       int i;
+
+       for (i = 0; i < MAX_IO_PICS; i++) {
+               if (node == vec_group[i].node)
+                       return vec_group[i].parent;
+       }
+       return NULL;
+}
+
+static int __init
+pch_pic_parse_madt(union acpi_subtable_headers *header,
+                      const unsigned long end)
+{
+       struct acpi_madt_bio_pic *pchpic_entry = (struct acpi_madt_bio_pic *)header;
+       unsigned int node = (pchpic_entry->address >> 44) & 0xf;
+       struct irq_domain *parent = acpi_get_vec_parent(node, pch_group);
+
+       if (parent)
+               return pch_pic_acpi_init(parent, pchpic_entry);
+
+       return -EINVAL;
+}
+
+static int __init
+pch_msi_parse_madt(union acpi_subtable_headers *header,
+                      const unsigned long end)
+{
+       struct acpi_madt_msi_pic *pchmsi_entry = (struct acpi_madt_msi_pic *)header;
+       struct irq_domain *parent = acpi_get_vec_parent(eiointc_priv[nr_pics - 1]->node, msi_group);
+
+       if (parent)
+               return pch_msi_acpi_init(parent, pchmsi_entry);
+
+       return -EINVAL;
+}
+
+static int __init acpi_cascade_irqdomain_init(void)
+{
+       acpi_table_parse_madt(ACPI_MADT_TYPE_BIO_PIC,
+                             pch_pic_parse_madt, 0);
+       acpi_table_parse_madt(ACPI_MADT_TYPE_MSI_PIC,
+                             pch_msi_parse_madt, 1);
+       return 0;
+}
+
+int __init eiointc_acpi_init(struct irq_domain *parent,
+                                    struct acpi_madt_eio_pic *acpi_eiointc)
+{
+       int i, parent_irq;
+       unsigned long node_map;
+       struct eiointc_priv *priv;
+
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       priv->domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_eiointc);
+       if (!priv->domain_handle) {
+               pr_err("Unable to allocate domain handle\n");
+               goto out_free_priv;
+       }
+
+       priv->node = acpi_eiointc->node;
+       node_map = acpi_eiointc->node_map ? : -1ULL;
+
+       for_each_possible_cpu(i) {
+               if (node_map & (1ULL << cpu_to_eio_node(i))) {
+                       node_set(cpu_to_eio_node(i), priv->node_map);
+                       cpumask_or(&priv->cpuspan_map, &priv->cpuspan_map, cpumask_of(i));
+               }
+       }
+
+       /* Setup IRQ domain */
+       priv->eiointc_domain = irq_domain_create_linear(priv->domain_handle, VEC_COUNT,
+                                       &eiointc_domain_ops, priv);
+       if (!priv->eiointc_domain) {
+               pr_err("loongson-eiointc: cannot add IRQ domain\n");
+               goto out_free_handle;
+       }
+
+       eiointc_priv[nr_pics++] = priv;
+
+       eiointc_router_init(0);
+
+       parent_irq = irq_create_mapping(parent, acpi_eiointc->cascade);
+       irq_set_chained_handler_and_data(parent_irq, eiointc_irq_dispatch, priv);
+
+       cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_LOONGARCH_STARTING,
+                                 "irqchip/loongarch/intc:starting",
+                                 eiointc_router_init, NULL);
+
+       acpi_set_vec_parent(acpi_eiointc->node, priv->eiointc_domain, pch_group);
+       acpi_set_vec_parent(acpi_eiointc->node, priv->eiointc_domain, msi_group);
+       acpi_cascade_irqdomain_init();
+
+       return 0;
+
+out_free_handle:
+       irq_domain_free_fwnode(priv->domain_handle);
+       priv->domain_handle = NULL;
+out_free_priv:
+       kfree(priv);
+
+       return -ENOMEM;
+}
index 8d05d8bcf56fe020fb405060459a3cba94f57c7e..c4f3c886ad6150dea1aca63311eba9662be87b5a 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 
 #define LIOINTC_CHIP_IRQ       32
-#define LIOINTC_NUM_PARENT 4
+#define LIOINTC_NUM_PARENT     4
 #define LIOINTC_NUM_CORES      4
 
 #define LIOINTC_INTC_CHIP_START        0x20
@@ -58,6 +58,8 @@ struct liointc_priv {
        bool                            has_lpc_irq_errata;
 };
 
+struct fwnode_handle *liointc_handle;
+
 static void liointc_chained_handle_irq(struct irq_desc *desc)
 {
        struct liointc_handler_data *handler = irq_desc_get_handler_data(desc);
@@ -153,97 +155,79 @@ static void liointc_resume(struct irq_chip_generic *gc)
        irq_gc_unlock_irqrestore(gc, flags);
 }
 
-static const char * const parent_names[] = {"int0", "int1", "int2", "int3"};
-static const char * const core_reg_names[] = {"isr0", "isr1", "isr2", "isr3"};
+static int parent_irq[LIOINTC_NUM_PARENT];
+static u32 parent_int_map[LIOINTC_NUM_PARENT];
+static const char *const parent_names[] = {"int0", "int1", "int2", "int3"};
+static const char *const core_reg_names[] = {"isr0", "isr1", "isr2", "isr3"};
 
-static void __iomem *liointc_get_reg_byname(struct device_node *node,
-                                               const char *name)
+static int liointc_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
+                            const u32 *intspec, unsigned int intsize,
+                            unsigned long *out_hwirq, unsigned int *out_type)
 {
-       int index = of_property_match_string(node, "reg-names", name);
-
-       if (index < 0)
-               return NULL;
-
-       return of_iomap(node, index);
+       if (WARN_ON(intsize < 1))
+               return -EINVAL;
+       *out_hwirq = intspec[0] - GSI_MIN_CPU_IRQ;
+       *out_type = IRQ_TYPE_NONE;
+       return 0;
 }
 
-static int __init liointc_of_init(struct device_node *node,
-                                 struct device_node *parent)
+static const struct irq_domain_ops acpi_irq_gc_ops = {
+       .map    = irq_map_generic_chip,
+       .unmap  = irq_unmap_generic_chip,
+       .xlate  = liointc_domain_xlate,
+};
+
+static int liointc_init(phys_addr_t addr, unsigned long size, int revision,
+               struct fwnode_handle *domain_handle, struct device_node *node)
 {
+       int i, err;
+       void __iomem *base;
+       struct irq_chip_type *ct;
        struct irq_chip_generic *gc;
        struct irq_domain *domain;
-       struct irq_chip_type *ct;
        struct liointc_priv *priv;
-       void __iomem *base;
-       u32 of_parent_int_map[LIOINTC_NUM_PARENT];
-       int parent_irq[LIOINTC_NUM_PARENT];
-       bool have_parent = FALSE;
-       int sz, i, err = 0;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
-       if (of_device_is_compatible(node, "loongson,liointc-2.0")) {
-               base = liointc_get_reg_byname(node, "main");
-               if (!base) {
-                       err = -ENODEV;
-                       goto out_free_priv;
-               }
+       base = ioremap(addr, size);
+       if (!base)
+               goto out_free_priv;
 
-               for (i = 0; i < LIOINTC_NUM_CORES; i++)
-                       priv->core_isr[i] = liointc_get_reg_byname(node, core_reg_names[i]);
-               if (!priv->core_isr[0]) {
-                       err = -ENODEV;
-                       goto out_iounmap_base;
-               }
-       } else {
-               base = of_iomap(node, 0);
-               if (!base) {
-                       err = -ENODEV;
-                       goto out_free_priv;
-               }
+       for (i = 0; i < LIOINTC_NUM_CORES; i++)
+               priv->core_isr[i] = base + LIOINTC_REG_INTC_STATUS;
 
-               for (i = 0; i < LIOINTC_NUM_CORES; i++)
-                       priv->core_isr[i] = base + LIOINTC_REG_INTC_STATUS;
-       }
+       for (i = 0; i < LIOINTC_NUM_PARENT; i++)
+               priv->handler[i].parent_int_map = parent_int_map[i];
 
-       for (i = 0; i < LIOINTC_NUM_PARENT; i++) {
-               parent_irq[i] = of_irq_get_byname(node, parent_names[i]);
-               if (parent_irq[i] > 0)
-                       have_parent = TRUE;
-       }
-       if (!have_parent) {
-               err = -ENODEV;
-               goto out_iounmap_isr;
-       }
+       if (revision > 1) {
+               for (i = 0; i < LIOINTC_NUM_CORES; i++) {
+                       int index = of_property_match_string(node,
+                                       "reg-names", core_reg_names[i]);
 
-       sz = of_property_read_variable_u32_array(node,
-                                               "loongson,parent_int_map",
-                                               &of_parent_int_map[0],
-                                               LIOINTC_NUM_PARENT,
-                                               LIOINTC_NUM_PARENT);
-       if (sz < 4) {
-               pr_err("loongson-liointc: No parent_int_map\n");
-               err = -ENODEV;
-               goto out_iounmap_isr;
-       }
+                       if (index < 0)
+                               return -EINVAL;
 
-       for (i = 0; i < LIOINTC_NUM_PARENT; i++)
-               priv->handler[i].parent_int_map = of_parent_int_map[i];
+                       priv->core_isr[i] = of_iomap(node, index);
+               }
+       }
 
        /* Setup IRQ domain */
-       domain = irq_domain_add_linear(node, 32,
+       if (!acpi_disabled)
+               domain = irq_domain_create_linear(domain_handle, LIOINTC_CHIP_IRQ,
+                                       &acpi_irq_gc_ops, priv);
+       else
+               domain = irq_domain_create_linear(domain_handle, LIOINTC_CHIP_IRQ,
                                        &irq_generic_chip_ops, priv);
        if (!domain) {
                pr_err("loongson-liointc: cannot add IRQ domain\n");
-               err = -EINVAL;
-               goto out_iounmap_isr;
+               goto out_iounmap;
        }
 
-       err = irq_alloc_domain_generic_chips(domain, 32, 1,
-                                       node->full_name, handle_level_irq,
-                                       IRQ_NOPROBE, 0, 0);
+       err = irq_alloc_domain_generic_chips(domain, LIOINTC_CHIP_IRQ, 1,
+                                       (node ? node->full_name : "LIOINTC"),
+                                       handle_level_irq, 0, IRQ_NOPROBE, 0);
        if (err) {
                pr_err("loongson-liointc: unable to register IRQ domain\n");
                goto out_free_domain;
@@ -299,24 +283,93 @@ static int __init liointc_of_init(struct device_node *node,
                                liointc_chained_handle_irq, &priv->handler[i]);
        }
 
+       liointc_handle = domain_handle;
        return 0;
 
 out_free_domain:
        irq_domain_remove(domain);
-out_iounmap_isr:
-       for (i = 0; i < LIOINTC_NUM_CORES; i++) {
-               if (!priv->core_isr[i])
-                       continue;
-               iounmap(priv->core_isr[i]);
-       }
-out_iounmap_base:
+out_iounmap:
        iounmap(base);
 out_free_priv:
        kfree(priv);
 
-       return err;
+       return -EINVAL;
+}
+
+#ifdef CONFIG_OF
+
+static int __init liointc_of_init(struct device_node *node,
+                                 struct device_node *parent)
+{
+       bool have_parent = FALSE;
+       int sz, i, index, revision, err = 0;
+       struct resource res;
+
+       if (!of_device_is_compatible(node, "loongson,liointc-2.0")) {
+               index = 0;
+               revision = 1;
+       } else {
+               index = of_property_match_string(node, "reg-names", "main");
+               revision = 2;
+       }
+
+       if (of_address_to_resource(node, index, &res))
+               return -EINVAL;
+
+       for (i = 0; i < LIOINTC_NUM_PARENT; i++) {
+               parent_irq[i] = of_irq_get_byname(node, parent_names[i]);
+               if (parent_irq[i] > 0)
+                       have_parent = TRUE;
+       }
+       if (!have_parent)
+               return -ENODEV;
+
+       sz = of_property_read_variable_u32_array(node,
+                                               "loongson,parent_int_map",
+                                               &parent_int_map[0],
+                                               LIOINTC_NUM_PARENT,
+                                               LIOINTC_NUM_PARENT);
+       if (sz < 4) {
+               pr_err("loongson-liointc: No parent_int_map\n");
+               return -ENODEV;
+       }
+
+       err = liointc_init(res.start, resource_size(&res),
+                       revision, of_node_to_fwnode(node), node);
+       if (err < 0)
+               return err;
+
+       return 0;
 }
 
 IRQCHIP_DECLARE(loongson_liointc_1_0, "loongson,liointc-1.0", liointc_of_init);
 IRQCHIP_DECLARE(loongson_liointc_1_0a, "loongson,liointc-1.0a", liointc_of_init);
 IRQCHIP_DECLARE(loongson_liointc_2_0, "loongson,liointc-2.0", liointc_of_init);
+
+#endif
+
+#ifdef CONFIG_ACPI
+int __init liointc_acpi_init(struct irq_domain *parent, struct acpi_madt_lio_pic *acpi_liointc)
+{
+       int ret;
+       struct fwnode_handle *domain_handle;
+
+       parent_int_map[0] = acpi_liointc->cascade_map[0];
+       parent_int_map[1] = acpi_liointc->cascade_map[1];
+
+       parent_irq[0] = irq_create_mapping(parent, acpi_liointc->cascade[0]);
+       parent_irq[1] = irq_create_mapping(parent, acpi_liointc->cascade[1]);
+
+       domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_liointc);
+       if (!domain_handle) {
+               pr_err("Unable to allocate domain handle\n");
+               return -ENOMEM;
+       }
+       ret = liointc_init(acpi_liointc->address, acpi_liointc->size,
+                          1, domain_handle, NULL);
+       if (ret)
+               irq_domain_free_fwnode(domain_handle);
+
+       return ret;
+}
+#endif
diff --git a/drivers/irqchip/irq-loongson-pch-lpc.c b/drivers/irqchip/irq-loongson-pch-lpc.c
new file mode 100644 (file)
index 0000000..bf23249
--- /dev/null
@@ -0,0 +1,205 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Loongson LPC Interrupt Controller support
+ *
+ * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
+ */
+
+#define pr_fmt(fmt) "lpc: " fmt
+
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/irqdomain.h>
+#include <linux/kernel.h>
+
+/* Registers */
+#define LPC_INT_CTL            0x00
+#define LPC_INT_ENA            0x04
+#define LPC_INT_STS            0x08
+#define LPC_INT_CLR            0x0c
+#define LPC_INT_POL            0x10
+#define LPC_COUNT              16
+
+/* LPC_INT_CTL */
+#define LPC_INT_CTL_EN         BIT(31)
+
+struct pch_lpc {
+       void __iomem            *base;
+       struct irq_domain       *lpc_domain;
+       raw_spinlock_t          lpc_lock;
+       u32                     saved_reg_ctl;
+       u32                     saved_reg_ena;
+       u32                     saved_reg_pol;
+};
+
+struct fwnode_handle *pch_lpc_handle;
+
+static void lpc_irq_ack(struct irq_data *d)
+{
+       unsigned long flags;
+       struct pch_lpc *priv = d->domain->host_data;
+
+       raw_spin_lock_irqsave(&priv->lpc_lock, flags);
+       writel(0x1 << d->hwirq, priv->base + LPC_INT_CLR);
+       raw_spin_unlock_irqrestore(&priv->lpc_lock, flags);
+}
+
+static void lpc_irq_mask(struct irq_data *d)
+{
+       unsigned long flags;
+       struct pch_lpc *priv = d->domain->host_data;
+
+       raw_spin_lock_irqsave(&priv->lpc_lock, flags);
+       writel(readl(priv->base + LPC_INT_ENA) & (~(0x1 << (d->hwirq))),
+                       priv->base + LPC_INT_ENA);
+       raw_spin_unlock_irqrestore(&priv->lpc_lock, flags);
+}
+
+static void lpc_irq_unmask(struct irq_data *d)
+{
+       unsigned long flags;
+       struct pch_lpc *priv = d->domain->host_data;
+
+       raw_spin_lock_irqsave(&priv->lpc_lock, flags);
+       writel(readl(priv->base + LPC_INT_ENA) | (0x1 << (d->hwirq)),
+                       priv->base + LPC_INT_ENA);
+       raw_spin_unlock_irqrestore(&priv->lpc_lock, flags);
+}
+
+static int lpc_irq_set_type(struct irq_data *d, unsigned int type)
+{
+       u32 val;
+       u32 mask = 0x1 << (d->hwirq);
+       struct pch_lpc *priv = d->domain->host_data;
+
+       if (!(type & IRQ_TYPE_LEVEL_MASK))
+               return 0;
+
+       val = readl(priv->base + LPC_INT_POL);
+
+       if (type == IRQ_TYPE_LEVEL_HIGH)
+               val |= mask;
+       else
+               val &= ~mask;
+
+       writel(val, priv->base + LPC_INT_POL);
+
+       return 0;
+}
+
+static const struct irq_chip pch_lpc_irq_chip = {
+       .name                   = "PCH LPC",
+       .irq_mask               = lpc_irq_mask,
+       .irq_unmask             = lpc_irq_unmask,
+       .irq_ack                = lpc_irq_ack,
+       .irq_set_type           = lpc_irq_set_type,
+       .flags                  = IRQCHIP_SKIP_SET_WAKE,
+};
+
+static void lpc_irq_dispatch(struct irq_desc *desc)
+{
+       u32 pending, bit;
+       struct irq_chip *chip = irq_desc_get_chip(desc);
+       struct pch_lpc *priv = irq_desc_get_handler_data(desc);
+
+       chained_irq_enter(chip, desc);
+
+       pending = readl(priv->base + LPC_INT_ENA);
+       pending &= readl(priv->base + LPC_INT_STS);
+       if (!pending)
+               spurious_interrupt();
+
+       while (pending) {
+               bit = __ffs(pending);
+
+               generic_handle_domain_irq(priv->lpc_domain, bit);
+               pending &= ~BIT(bit);
+       }
+       chained_irq_exit(chip, desc);
+}
+
+static int pch_lpc_map(struct irq_domain *d, unsigned int irq,
+                       irq_hw_number_t hw)
+{
+       irq_set_chip_and_handler(irq, &pch_lpc_irq_chip, handle_level_irq);
+       return 0;
+}
+
+static const struct irq_domain_ops pch_lpc_domain_ops = {
+       .map            = pch_lpc_map,
+       .translate      = irq_domain_translate_twocell,
+};
+
+static void pch_lpc_reset(struct pch_lpc *priv)
+{
+       /* Enable the LPC interrupt, bit31: en  bit30: edge */
+       writel(LPC_INT_CTL_EN, priv->base + LPC_INT_CTL);
+       writel(0, priv->base + LPC_INT_ENA);
+       /* Clear all 18-bit interrpt bit */
+       writel(GENMASK(17, 0), priv->base + LPC_INT_CLR);
+}
+
+static int pch_lpc_disabled(struct pch_lpc *priv)
+{
+       return (readl(priv->base + LPC_INT_ENA) == 0xffffffff) &&
+                       (readl(priv->base + LPC_INT_STS) == 0xffffffff);
+}
+
+int __init pch_lpc_acpi_init(struct irq_domain *parent,
+                                       struct acpi_madt_lpc_pic *acpi_pchlpc)
+{
+       int parent_irq;
+       struct pch_lpc *priv;
+       struct irq_fwspec fwspec;
+       struct fwnode_handle *irq_handle;
+
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       raw_spin_lock_init(&priv->lpc_lock);
+
+       priv->base = ioremap(acpi_pchlpc->address, acpi_pchlpc->size);
+       if (!priv->base)
+               goto free_priv;
+
+       if (pch_lpc_disabled(priv)) {
+               pr_err("Failed to get LPC status\n");
+               goto iounmap_base;
+       }
+
+       irq_handle = irq_domain_alloc_named_fwnode("lpcintc");
+       if (!irq_handle) {
+               pr_err("Unable to allocate domain handle\n");
+               goto iounmap_base;
+       }
+
+       priv->lpc_domain = irq_domain_create_linear(irq_handle, LPC_COUNT,
+                                       &pch_lpc_domain_ops, priv);
+       if (!priv->lpc_domain) {
+               pr_err("Failed to create IRQ domain\n");
+               goto free_irq_handle;
+       }
+       pch_lpc_reset(priv);
+
+       fwspec.fwnode = parent->fwnode;
+       fwspec.param[0] = acpi_pchlpc->cascade + GSI_MIN_PCH_IRQ;
+       fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH;
+       fwspec.param_count = 2;
+       parent_irq = irq_create_fwspec_mapping(&fwspec);
+       irq_set_chained_handler_and_data(parent_irq, lpc_irq_dispatch, priv);
+
+       pch_lpc_handle = irq_handle;
+       return 0;
+
+free_irq_handle:
+       irq_domain_free_fwnode(irq_handle);
+iounmap_base:
+       iounmap(priv->base);
+free_priv:
+       kfree(priv);
+
+       return -ENOMEM;
+}
index e3801c4a77ed2cea3384b9c46606309bf4277837..d0e8551bebfab7bdb5b1962c6859b9eaaa20b88f 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 
+static int nr_pics;
+
 struct pch_msi_data {
        struct mutex    msi_map_lock;
        phys_addr_t     doorbell;
@@ -23,6 +25,8 @@ struct pch_msi_data {
        unsigned long   *msi_map;
 };
 
+static struct fwnode_handle *pch_msi_handle[MAX_IO_PICS];
+
 static void pch_msi_mask_msi_irq(struct irq_data *d)
 {
        pci_msi_mask_irq(d);
@@ -154,12 +158,12 @@ static const struct irq_domain_ops pch_msi_middle_domain_ops = {
 };
 
 static int pch_msi_init_domains(struct pch_msi_data *priv,
-                               struct device_node *node,
-                               struct irq_domain *parent)
+                               struct irq_domain *parent,
+                               struct fwnode_handle *domain_handle)
 {
        struct irq_domain *middle_domain, *msi_domain;
 
-       middle_domain = irq_domain_create_linear(of_node_to_fwnode(node),
+       middle_domain = irq_domain_create_linear(domain_handle,
                                                priv->num_irqs,
                                                &pch_msi_middle_domain_ops,
                                                priv);
@@ -171,7 +175,7 @@ static int pch_msi_init_domains(struct pch_msi_data *priv,
        middle_domain->parent = parent;
        irq_domain_update_bus_token(middle_domain, DOMAIN_BUS_NEXUS);
 
-       msi_domain = pci_msi_create_irq_domain(of_node_to_fwnode(node),
+       msi_domain = pci_msi_create_irq_domain(domain_handle,
                                               &pch_msi_domain_info,
                                               middle_domain);
        if (!msi_domain) {
@@ -183,19 +187,11 @@ static int pch_msi_init_domains(struct pch_msi_data *priv,
        return 0;
 }
 
-static int pch_msi_init(struct device_node *node,
-                           struct device_node *parent)
+static int pch_msi_init(phys_addr_t msg_address, int irq_base, int irq_count,
+                       struct irq_domain *parent_domain, struct fwnode_handle *domain_handle)
 {
-       struct pch_msi_data *priv;
-       struct irq_domain *parent_domain;
-       struct resource res;
        int ret;
-
-       parent_domain = irq_find_host(parent);
-       if (!parent_domain) {
-               pr_err("Failed to find the parent domain\n");
-               return -ENXIO;
-       }
+       struct pch_msi_data *priv;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
@@ -203,48 +199,95 @@ static int pch_msi_init(struct device_node *node,
 
        mutex_init(&priv->msi_map_lock);
 
-       ret = of_address_to_resource(node, 0, &res);
-       if (ret) {
-               pr_err("Failed to allocate resource\n");
-               goto err_priv;
-       }
-
-       priv->doorbell = res.start;
-
-       if (of_property_read_u32(node, "loongson,msi-base-vec",
-                               &priv->irq_first)) {
-               pr_err("Unable to parse MSI vec base\n");
-               ret = -EINVAL;
-               goto err_priv;
-       }
-
-       if (of_property_read_u32(node, "loongson,msi-num-vecs",
-                               &priv->num_irqs)) {
-               pr_err("Unable to parse MSI vec number\n");
-               ret = -EINVAL;
-               goto err_priv;
-       }
+       priv->doorbell = msg_address;
+       priv->irq_first = irq_base;
+       priv->num_irqs = irq_count;
 
        priv->msi_map = bitmap_zalloc(priv->num_irqs, GFP_KERNEL);
-       if (!priv->msi_map) {
-               ret = -ENOMEM;
+       if (!priv->msi_map)
                goto err_priv;
-       }
 
        pr_debug("Registering %d MSIs, starting at %d\n",
                 priv->num_irqs, priv->irq_first);
 
-       ret = pch_msi_init_domains(priv, node, parent_domain);
+       ret = pch_msi_init_domains(priv, parent_domain, domain_handle);
        if (ret)
                goto err_map;
 
+       pch_msi_handle[nr_pics++] = domain_handle;
        return 0;
 
 err_map:
        bitmap_free(priv->msi_map);
 err_priv:
        kfree(priv);
-       return ret;
+
+       return -EINVAL;
+}
+
+#ifdef CONFIG_OF
+static int pch_msi_of_init(struct device_node *node, struct device_node *parent)
+{
+       int err;
+       int irq_base, irq_count;
+       struct resource res;
+       struct irq_domain *parent_domain;
+
+       parent_domain = irq_find_host(parent);
+       if (!parent_domain) {
+               pr_err("Failed to find the parent domain\n");
+               return -ENXIO;
+       }
+
+       if (of_address_to_resource(node, 0, &res)) {
+               pr_err("Failed to allocate resource\n");
+               return -EINVAL;
+       }
+
+       if (of_property_read_u32(node, "loongson,msi-base-vec", &irq_base)) {
+               pr_err("Unable to parse MSI vec base\n");
+               return -EINVAL;
+       }
+
+       if (of_property_read_u32(node, "loongson,msi-num-vecs", &irq_count)) {
+               pr_err("Unable to parse MSI vec number\n");
+               return -EINVAL;
+       }
+
+       err = pch_msi_init(res.start, irq_base, irq_count, parent_domain, of_node_to_fwnode(node));
+       if (err < 0)
+               return err;
+
+       return 0;
 }
 
-IRQCHIP_DECLARE(pch_msi, "loongson,pch-msi-1.0", pch_msi_init);
+IRQCHIP_DECLARE(pch_msi, "loongson,pch-msi-1.0", pch_msi_of_init);
+#endif
+
+#ifdef CONFIG_ACPI
+struct fwnode_handle *get_pch_msi_handle(int pci_segment)
+{
+       int i;
+
+       for (i = 0; i < MAX_IO_PICS; i++) {
+               if (msi_group[i].pci_segment == pci_segment)
+                       return pch_msi_handle[i];
+       }
+       return NULL;
+}
+
+int __init pch_msi_acpi_init(struct irq_domain *parent,
+                                       struct acpi_madt_msi_pic *acpi_pchmsi)
+{
+       int ret;
+       struct fwnode_handle *domain_handle;
+
+       domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_pchmsi);
+       ret = pch_msi_init(acpi_pchmsi->msg_address, acpi_pchmsi->start,
+                               acpi_pchmsi->count, parent, domain_handle);
+       if (ret < 0)
+               irq_domain_free_fwnode(domain_handle);
+
+       return ret;
+}
+#endif
index a4eb8a2181c7f1c0b5c23bc8756c0588c34e4c6a..b6f1392964b14668df4baf9f3cecb98c78f6cfd0 100644 (file)
 #define PIC_REG_IDX(irq_id)    ((irq_id) / PIC_COUNT_PER_REG)
 #define PIC_REG_BIT(irq_id)    ((irq_id) % PIC_COUNT_PER_REG)
 
+static int nr_pics;
+
 struct pch_pic {
        void __iomem            *base;
        struct irq_domain       *pic_domain;
        u32                     ht_vec_base;
        raw_spinlock_t          pic_lock;
+       u32                     vec_count;
+       u32                     gsi_base;
 };
 
+static struct pch_pic *pch_pic_priv[MAX_IO_PICS];
+
+struct fwnode_handle *pch_pic_handle[MAX_IO_PICS];
+
+int find_pch_pic(u32 gsi)
+{
+       int i;
+
+       /* Find the PCH_PIC that manages this GSI. */
+       for (i = 0; i < MAX_IO_PICS; i++) {
+               struct pch_pic *priv = pch_pic_priv[i];
+
+               if (!priv)
+                       return -1;
+
+               if (gsi >= priv->gsi_base && gsi < (priv->gsi_base + priv->vec_count))
+                       return i;
+       }
+
+       pr_err("ERROR: Unable to locate PCH_PIC for GSI %d\n", gsi);
+       return -1;
+}
+
 static void pch_pic_bitset(struct pch_pic *priv, int offset, int bit)
 {
        u32 reg;
@@ -139,6 +166,28 @@ static struct irq_chip pch_pic_irq_chip = {
        .irq_set_type           = pch_pic_set_type,
 };
 
+static int pch_pic_domain_translate(struct irq_domain *d,
+                                       struct irq_fwspec *fwspec,
+                                       unsigned long *hwirq,
+                                       unsigned int *type)
+{
+       struct pch_pic *priv = d->host_data;
+       struct device_node *of_node = to_of_node(fwspec->fwnode);
+
+       if (fwspec->param_count < 1)
+               return -EINVAL;
+
+       if (of_node) {
+               *hwirq = fwspec->param[0] + priv->ht_vec_base;
+               *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK;
+       } else {
+               *hwirq = fwspec->param[0] - priv->gsi_base;
+               *type = IRQ_TYPE_NONE;
+       }
+
+       return 0;
+}
+
 static int pch_pic_alloc(struct irq_domain *domain, unsigned int virq,
                              unsigned int nr_irqs, void *arg)
 {
@@ -149,13 +198,13 @@ static int pch_pic_alloc(struct irq_domain *domain, unsigned int virq,
        struct irq_fwspec parent_fwspec;
        struct pch_pic *priv = domain->host_data;
 
-       err = irq_domain_translate_twocell(domain, fwspec, &hwirq, &type);
+       err = pch_pic_domain_translate(domain, fwspec, &hwirq, &type);
        if (err)
                return err;
 
        parent_fwspec.fwnode = domain->parent->fwnode;
        parent_fwspec.param_count = 1;
-       parent_fwspec.param[0] = hwirq + priv->ht_vec_base;
+       parent_fwspec.param[0] = hwirq;
 
        err = irq_domain_alloc_irqs_parent(domain, virq, 1, &parent_fwspec);
        if (err)
@@ -170,7 +219,7 @@ static int pch_pic_alloc(struct irq_domain *domain, unsigned int virq,
 }
 
 static const struct irq_domain_ops pch_pic_domain_ops = {
-       .translate      = irq_domain_translate_twocell,
+       .translate      = pch_pic_domain_translate,
        .alloc          = pch_pic_alloc,
        .free           = irq_domain_free_irqs_parent,
 };
@@ -180,7 +229,7 @@ static void pch_pic_reset(struct pch_pic *priv)
        int i;
 
        for (i = 0; i < PIC_COUNT; i++) {
-               /* Write vectored ID */
+               /* Write vector ID */
                writeb(priv->ht_vec_base + i, priv->base + PCH_INT_HTVEC(i));
                /* Hardcode route to HT0 Lo */
                writeb(1, priv->base + PCH_INT_ROUTE(i));
@@ -198,50 +247,37 @@ static void pch_pic_reset(struct pch_pic *priv)
        }
 }
 
-static int pch_pic_of_init(struct device_node *node,
-                               struct device_node *parent)
+static int pch_pic_init(phys_addr_t addr, unsigned long size, int vec_base,
+                       struct irq_domain *parent_domain, struct fwnode_handle *domain_handle,
+                       u32 gsi_base)
 {
        struct pch_pic *priv;
-       struct irq_domain *parent_domain;
-       int err;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
        raw_spin_lock_init(&priv->pic_lock);
-       priv->base = of_iomap(node, 0);
-       if (!priv->base) {
-               err = -ENOMEM;
+       priv->base = ioremap(addr, size);
+       if (!priv->base)
                goto free_priv;
-       }
 
-       parent_domain = irq_find_host(parent);
-       if (!parent_domain) {
-               pr_err("Failed to find the parent domain\n");
-               err = -ENXIO;
-               goto iounmap_base;
-       }
-
-       if (of_property_read_u32(node, "loongson,pic-base-vec",
-                               &priv->ht_vec_base)) {
-               pr_err("Failed to determine pic-base-vec\n");
-               err = -EINVAL;
-               goto iounmap_base;
-       }
+       priv->ht_vec_base = vec_base;
+       priv->vec_count = ((readq(priv->base) >> 48) & 0xff) + 1;
+       priv->gsi_base = gsi_base;
 
        priv->pic_domain = irq_domain_create_hierarchy(parent_domain, 0,
-                                                      PIC_COUNT,
-                                                      of_node_to_fwnode(node),
-                                                      &pch_pic_domain_ops,
-                                                      priv);
+                                               priv->vec_count, domain_handle,
+                                               &pch_pic_domain_ops, priv);
+
        if (!priv->pic_domain) {
                pr_err("Failed to create IRQ domain\n");
-               err = -ENOMEM;
                goto iounmap_base;
        }
 
        pch_pic_reset(priv);
+       pch_pic_handle[nr_pics] = domain_handle;
+       pch_pic_priv[nr_pics++] = priv;
 
        return 0;
 
@@ -250,7 +286,86 @@ iounmap_base:
 free_priv:
        kfree(priv);
 
-       return err;
+       return -EINVAL;
+}
+
+#ifdef CONFIG_OF
+
+static int pch_pic_of_init(struct device_node *node,
+                               struct device_node *parent)
+{
+       int err, vec_base;
+       struct resource res;
+       struct irq_domain *parent_domain;
+
+       if (of_address_to_resource(node, 0, &res))
+               return -EINVAL;
+
+       parent_domain = irq_find_host(parent);
+       if (!parent_domain) {
+               pr_err("Failed to find the parent domain\n");
+               return -ENXIO;
+       }
+
+       if (of_property_read_u32(node, "loongson,pic-base-vec", &vec_base)) {
+               pr_err("Failed to determine pic-base-vec\n");
+               return -EINVAL;
+       }
+
+       err = pch_pic_init(res.start, resource_size(&res), vec_base,
+                               parent_domain, of_node_to_fwnode(node), 0);
+       if (err < 0)
+               return err;
+
+       return 0;
 }
 
 IRQCHIP_DECLARE(pch_pic, "loongson,pch-pic-1.0", pch_pic_of_init);
+
+#endif
+
+#ifdef CONFIG_ACPI
+static int __init
+pch_lpc_parse_madt(union acpi_subtable_headers *header,
+                      const unsigned long end)
+{
+       struct acpi_madt_lpc_pic *pchlpc_entry = (struct acpi_madt_lpc_pic *)header;
+
+       return pch_lpc_acpi_init(pch_pic_priv[0]->pic_domain, pchlpc_entry);
+}
+
+static int __init acpi_cascade_irqdomain_init(void)
+{
+       acpi_table_parse_madt(ACPI_MADT_TYPE_LPC_PIC,
+                             pch_lpc_parse_madt, 0);
+       return 0;
+}
+
+int __init pch_pic_acpi_init(struct irq_domain *parent,
+                                       struct acpi_madt_bio_pic *acpi_pchpic)
+{
+       int ret, vec_base;
+       struct fwnode_handle *domain_handle;
+
+       vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ;
+
+       domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_pchpic);
+       if (!domain_handle) {
+               pr_err("Unable to allocate domain handle\n");
+               return -ENOMEM;
+       }
+
+       ret = pch_pic_init(acpi_pchpic->address, acpi_pchpic->size,
+                               vec_base, parent, domain_handle, acpi_pchpic->gsi_base);
+
+       if (ret < 0) {
+               irq_domain_free_fwnode(domain_handle);
+               return ret;
+       }
+
+       if (acpi_pchpic->id == 0)
+               acpi_cascade_irqdomain_init();
+
+       return ret;
+}
+#endif
index ff89b36267dd4955e2a1a25184edb0daaf944e73..1ba0f1555c8055173de241ec50f71f4bbaad721e 100644 (file)
@@ -52,13 +52,15 @@ static DEFINE_PER_CPU_READ_MOSTLY(unsigned long[GIC_MAX_LONGS], pcpu_masks);
 
 static DEFINE_SPINLOCK(gic_lock);
 static struct irq_domain *gic_irq_domain;
-static struct irq_domain *gic_ipi_domain;
 static int gic_shared_intrs;
 static unsigned int gic_cpu_pin;
 static unsigned int timer_cpu_pin;
 static struct irq_chip gic_level_irq_controller, gic_edge_irq_controller;
+
+#ifdef CONFIG_GENERIC_IRQ_IPI
 static DECLARE_BITMAP(ipi_resrv, GIC_MAX_INTRS);
 static DECLARE_BITMAP(ipi_available, GIC_MAX_INTRS);
+#endif /* CONFIG_GENERIC_IRQ_IPI */
 
 static struct gic_all_vpes_chip_data {
        u32     map;
@@ -472,9 +474,11 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int virq,
        u32 map;
 
        if (hwirq >= GIC_SHARED_HWIRQ_BASE) {
+#ifdef CONFIG_GENERIC_IRQ_IPI
                /* verify that shared irqs don't conflict with an IPI irq */
                if (test_bit(GIC_HWIRQ_TO_SHARED(hwirq), ipi_resrv))
                        return -EBUSY;
+#endif /* CONFIG_GENERIC_IRQ_IPI */
 
                err = irq_domain_set_hwirq_and_chip(d, virq, hwirq,
                                                    &gic_level_irq_controller,
@@ -567,6 +571,8 @@ static const struct irq_domain_ops gic_irq_domain_ops = {
        .map = gic_irq_domain_map,
 };
 
+#ifdef CONFIG_GENERIC_IRQ_IPI
+
 static int gic_ipi_domain_xlate(struct irq_domain *d, struct device_node *ctrlr,
                                const u32 *intspec, unsigned int intsize,
                                irq_hw_number_t *out_hwirq,
@@ -670,6 +676,48 @@ static const struct irq_domain_ops gic_ipi_domain_ops = {
        .match = gic_ipi_domain_match,
 };
 
+static int gic_register_ipi_domain(struct device_node *node)
+{
+       struct irq_domain *gic_ipi_domain;
+       unsigned int v[2], num_ipis;
+
+       gic_ipi_domain = irq_domain_add_hierarchy(gic_irq_domain,
+                                                 IRQ_DOMAIN_FLAG_IPI_PER_CPU,
+                                                 GIC_NUM_LOCAL_INTRS + gic_shared_intrs,
+                                                 node, &gic_ipi_domain_ops, NULL);
+       if (!gic_ipi_domain) {
+               pr_err("Failed to add IPI domain");
+               return -ENXIO;
+       }
+
+       irq_domain_update_bus_token(gic_ipi_domain, DOMAIN_BUS_IPI);
+
+       if (node &&
+           !of_property_read_u32_array(node, "mti,reserved-ipi-vectors", v, 2)) {
+               bitmap_set(ipi_resrv, v[0], v[1]);
+       } else {
+               /*
+                * Reserve 2 interrupts per possible CPU/VP for use as IPIs,
+                * meeting the requirements of arch/mips SMP.
+                */
+               num_ipis = 2 * num_possible_cpus();
+               bitmap_set(ipi_resrv, gic_shared_intrs - num_ipis, num_ipis);
+       }
+
+       bitmap_copy(ipi_available, ipi_resrv, GIC_MAX_INTRS);
+
+       return 0;
+}
+
+#else /* !CONFIG_GENERIC_IRQ_IPI */
+
+static inline int gic_register_ipi_domain(struct device_node *node)
+{
+       return 0;
+}
+
+#endif /* !CONFIG_GENERIC_IRQ_IPI */
+
 static int gic_cpu_startup(unsigned int cpu)
 {
        /* Enable or disable EIC */
@@ -688,11 +736,12 @@ static int gic_cpu_startup(unsigned int cpu)
 static int __init gic_of_init(struct device_node *node,
                              struct device_node *parent)
 {
-       unsigned int cpu_vec, i, gicconfig, v[2], num_ipis;
+       unsigned int cpu_vec, i, gicconfig;
        unsigned long reserved;
        phys_addr_t gic_base;
        struct resource res;
        size_t gic_len;
+       int ret;
 
        /* Find the first available CPU vector. */
        i = 0;
@@ -734,6 +783,10 @@ static int __init gic_of_init(struct device_node *node,
        }
 
        mips_gic_base = ioremap(gic_base, gic_len);
+       if (!mips_gic_base) {
+               pr_err("Failed to ioremap gic_base\n");
+               return -ENOMEM;
+       }
 
        gicconfig = read_gic_config();
        gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);
@@ -780,30 +833,9 @@ static int __init gic_of_init(struct device_node *node,
                return -ENXIO;
        }
 
-       gic_ipi_domain = irq_domain_add_hierarchy(gic_irq_domain,
-                                                 IRQ_DOMAIN_FLAG_IPI_PER_CPU,
-                                                 GIC_NUM_LOCAL_INTRS + gic_shared_intrs,
-                                                 node, &gic_ipi_domain_ops, NULL);
-       if (!gic_ipi_domain) {
-               pr_err("Failed to add IPI domain");
-               return -ENXIO;
-       }
-
-       irq_domain_update_bus_token(gic_ipi_domain, DOMAIN_BUS_IPI);
-
-       if (node &&
-           !of_property_read_u32_array(node, "mti,reserved-ipi-vectors", v, 2)) {
-               bitmap_set(ipi_resrv, v[0], v[1]);
-       } else {
-               /*
-                * Reserve 2 interrupts per possible CPU/VP for use as IPIs,
-                * meeting the requirements of arch/mips SMP.
-                */
-               num_ipis = 2 * num_possible_cpus();
-               bitmap_set(ipi_resrv, gic_shared_intrs - num_ipis, num_ipis);
-       }
-
-       bitmap_copy(ipi_available, ipi_resrv, GIC_MAX_INTRS);
+       ret = gic_register_ipi_domain(node);
+       if (ret)
+               return ret;
 
        board_bind_eic_interrupt = &gic_bind_eic_interrupt;
 
diff --git a/drivers/irqchip/irq-renesas-rzg2l.c b/drivers/irqchip/irq-renesas-rzg2l.c
new file mode 100644 (file)
index 0000000..25fd8ee
--- /dev/null
@@ -0,0 +1,393 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Renesas RZ/G2L IRQC Driver
+ *
+ * Copyright (C) 2022 Renesas Electronics Corporation.
+ *
+ * Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/irqchip.h>
+#include <linux/irqdomain.h>
+#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/pm_runtime.h>
+#include <linux/reset.h>
+#include <linux/spinlock.h>
+
+#define IRQC_IRQ_START                 1
+#define IRQC_IRQ_COUNT                 8
+#define IRQC_TINT_START                        (IRQC_IRQ_START + IRQC_IRQ_COUNT)
+#define IRQC_TINT_COUNT                        32
+#define IRQC_NUM_IRQ                   (IRQC_TINT_START + IRQC_TINT_COUNT)
+
+#define ISCR                           0x10
+#define IITSR                          0x14
+#define TSCR                           0x20
+#define TITSR0                         0x24
+#define TITSR1                         0x28
+#define TITSR0_MAX_INT                 16
+#define TITSEL_WIDTH                   0x2
+#define TSSR(n)                                (0x30 + ((n) * 4))
+#define TIEN                           BIT(7)
+#define TSSEL_SHIFT(n)                 (8 * (n))
+#define TSSEL_MASK                     GENMASK(7, 0)
+#define IRQ_MASK                       0x3
+
+#define TSSR_OFFSET(n)                 ((n) % 4)
+#define TSSR_INDEX(n)                  ((n) / 4)
+
+#define TITSR_TITSEL_EDGE_RISING       0
+#define TITSR_TITSEL_EDGE_FALLING      1
+#define TITSR_TITSEL_LEVEL_HIGH                2
+#define TITSR_TITSEL_LEVEL_LOW         3
+
+#define IITSR_IITSEL(n, sense)         ((sense) << ((n) * 2))
+#define IITSR_IITSEL_LEVEL_LOW         0
+#define IITSR_IITSEL_EDGE_FALLING      1
+#define IITSR_IITSEL_EDGE_RISING       2
+#define IITSR_IITSEL_EDGE_BOTH         3
+#define IITSR_IITSEL_MASK(n)           IITSR_IITSEL((n), 3)
+
+#define TINT_EXTRACT_HWIRQ(x)           FIELD_GET(GENMASK(15, 0), (x))
+#define TINT_EXTRACT_GPIOINT(x)         FIELD_GET(GENMASK(31, 16), (x))
+
+struct rzg2l_irqc_priv {
+       void __iomem *base;
+       struct irq_fwspec fwspec[IRQC_NUM_IRQ];
+       raw_spinlock_t lock;
+};
+
+static struct rzg2l_irqc_priv *irq_data_to_priv(struct irq_data *data)
+{
+       return data->domain->host_data;
+}
+
+static void rzg2l_irq_eoi(struct irq_data *d)
+{
+       unsigned int hw_irq = irqd_to_hwirq(d) - IRQC_IRQ_START;
+       struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+       u32 bit = BIT(hw_irq);
+       u32 reg;
+
+       reg = readl_relaxed(priv->base + ISCR);
+       if (reg & bit)
+               writel_relaxed(reg & ~bit, priv->base + ISCR);
+}
+
+static void rzg2l_tint_eoi(struct irq_data *d)
+{
+       unsigned int hw_irq = irqd_to_hwirq(d) - IRQC_TINT_START;
+       struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+       u32 bit = BIT(hw_irq);
+       u32 reg;
+
+       reg = readl_relaxed(priv->base + TSCR);
+       if (reg & bit)
+               writel_relaxed(reg & ~bit, priv->base + TSCR);
+}
+
+static void rzg2l_irqc_eoi(struct irq_data *d)
+{
+       struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+       unsigned int hw_irq = irqd_to_hwirq(d);
+
+       raw_spin_lock(&priv->lock);
+       if (hw_irq >= IRQC_IRQ_START && hw_irq <= IRQC_IRQ_COUNT)
+               rzg2l_irq_eoi(d);
+       else if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ)
+               rzg2l_tint_eoi(d);
+       raw_spin_unlock(&priv->lock);
+       irq_chip_eoi_parent(d);
+}
+
+static void rzg2l_irqc_irq_disable(struct irq_data *d)
+{
+       unsigned int hw_irq = irqd_to_hwirq(d);
+
+       if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) {
+               struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+               u32 offset = hw_irq - IRQC_TINT_START;
+               u32 tssr_offset = TSSR_OFFSET(offset);
+               u8 tssr_index = TSSR_INDEX(offset);
+               u32 reg;
+
+               raw_spin_lock(&priv->lock);
+               reg = readl_relaxed(priv->base + TSSR(tssr_index));
+               reg &= ~(TSSEL_MASK << tssr_offset);
+               writel_relaxed(reg, priv->base + TSSR(tssr_index));
+               raw_spin_unlock(&priv->lock);
+       }
+       irq_chip_disable_parent(d);
+}
+
+static void rzg2l_irqc_irq_enable(struct irq_data *d)
+{
+       unsigned int hw_irq = irqd_to_hwirq(d);
+
+       if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) {
+               struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+               unsigned long tint = (uintptr_t)d->chip_data;
+               u32 offset = hw_irq - IRQC_TINT_START;
+               u32 tssr_offset = TSSR_OFFSET(offset);
+               u8 tssr_index = TSSR_INDEX(offset);
+               u32 reg;
+
+               raw_spin_lock(&priv->lock);
+               reg = readl_relaxed(priv->base + TSSR(tssr_index));
+               reg |= (TIEN | tint) << TSSEL_SHIFT(tssr_offset);
+               writel_relaxed(reg, priv->base + TSSR(tssr_index));
+               raw_spin_unlock(&priv->lock);
+       }
+       irq_chip_enable_parent(d);
+}
+
+static int rzg2l_irq_set_type(struct irq_data *d, unsigned int type)
+{
+       unsigned int hw_irq = irqd_to_hwirq(d) - IRQC_IRQ_START;
+       struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+       u16 sense, tmp;
+
+       switch (type & IRQ_TYPE_SENSE_MASK) {
+       case IRQ_TYPE_LEVEL_LOW:
+               sense = IITSR_IITSEL_LEVEL_LOW;
+               break;
+
+       case IRQ_TYPE_EDGE_FALLING:
+               sense = IITSR_IITSEL_EDGE_FALLING;
+               break;
+
+       case IRQ_TYPE_EDGE_RISING:
+               sense = IITSR_IITSEL_EDGE_RISING;
+               break;
+
+       case IRQ_TYPE_EDGE_BOTH:
+               sense = IITSR_IITSEL_EDGE_BOTH;
+               break;
+
+       default:
+               return -EINVAL;
+       }
+
+       raw_spin_lock(&priv->lock);
+       tmp = readl_relaxed(priv->base + IITSR);
+       tmp &= ~IITSR_IITSEL_MASK(hw_irq);
+       tmp |= IITSR_IITSEL(hw_irq, sense);
+       writel_relaxed(tmp, priv->base + IITSR);
+       raw_spin_unlock(&priv->lock);
+
+       return 0;
+}
+
+static int rzg2l_tint_set_edge(struct irq_data *d, unsigned int type)
+{
+       struct rzg2l_irqc_priv *priv = irq_data_to_priv(d);
+       unsigned int hwirq = irqd_to_hwirq(d);
+       u32 titseln = hwirq - IRQC_TINT_START;
+       u32 offset;
+       u8 sense;
+       u32 reg;
+
+       switch (type & IRQ_TYPE_SENSE_MASK) {
+       case IRQ_TYPE_EDGE_RISING:
+               sense = TITSR_TITSEL_EDGE_RISING;
+               break;
+
+       case IRQ_TYPE_EDGE_FALLING:
+               sense = TITSR_TITSEL_EDGE_FALLING;
+               break;
+
+       default:
+               return -EINVAL;
+       }
+
+       offset = TITSR0;
+       if (titseln >= TITSR0_MAX_INT) {
+               titseln -= TITSR0_MAX_INT;
+               offset = TITSR1;
+       }
+
+       raw_spin_lock(&priv->lock);
+       reg = readl_relaxed(priv->base + offset);
+       reg &= ~(IRQ_MASK << (titseln * TITSEL_WIDTH));
+       reg |= sense << (titseln * TITSEL_WIDTH);
+       writel_relaxed(reg, priv->base + offset);
+       raw_spin_unlock(&priv->lock);
+
+       return 0;
+}
+
+static int rzg2l_irqc_set_type(struct irq_data *d, unsigned int type)
+{
+       unsigned int hw_irq = irqd_to_hwirq(d);
+       int ret = -EINVAL;
+
+       if (hw_irq >= IRQC_IRQ_START && hw_irq <= IRQC_IRQ_COUNT)
+               ret = rzg2l_irq_set_type(d, type);
+       else if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ)
+               ret = rzg2l_tint_set_edge(d, type);
+       if (ret)
+               return ret;
+
+       return irq_chip_set_type_parent(d, IRQ_TYPE_LEVEL_HIGH);
+}
+
+static const struct irq_chip irqc_chip = {
+       .name                   = "rzg2l-irqc",
+       .irq_eoi                = rzg2l_irqc_eoi,
+       .irq_mask               = irq_chip_mask_parent,
+       .irq_unmask             = irq_chip_unmask_parent,
+       .irq_disable            = rzg2l_irqc_irq_disable,
+       .irq_enable             = rzg2l_irqc_irq_enable,
+       .irq_get_irqchip_state  = irq_chip_get_parent_state,
+       .irq_set_irqchip_state  = irq_chip_set_parent_state,
+       .irq_retrigger          = irq_chip_retrigger_hierarchy,
+       .irq_set_type           = rzg2l_irqc_set_type,
+       .flags                  = IRQCHIP_MASK_ON_SUSPEND |
+                                 IRQCHIP_SET_TYPE_MASKED |
+                                 IRQCHIP_SKIP_SET_WAKE,
+};
+
+static int rzg2l_irqc_alloc(struct irq_domain *domain, unsigned int virq,
+                           unsigned int nr_irqs, void *arg)
+{
+       struct rzg2l_irqc_priv *priv = domain->host_data;
+       unsigned long tint = 0;
+       irq_hw_number_t hwirq;
+       unsigned int type;
+       int ret;
+
+       ret = irq_domain_translate_twocell(domain, arg, &hwirq, &type);
+       if (ret)
+               return ret;
+
+       /*
+        * For TINT interrupts ie where pinctrl driver is child of irqc domain
+        * the hwirq and TINT are encoded in fwspec->param[0].
+        * hwirq for TINT range from 9-40, hwirq is embedded 0-15 bits and TINT
+        * from 16-31 bits. TINT from the pinctrl driver needs to be programmed
+        * in IRQC registers to enable a given gpio pin as interrupt.
+        */
+       if (hwirq > IRQC_IRQ_COUNT) {
+               tint = TINT_EXTRACT_GPIOINT(hwirq);
+               hwirq = TINT_EXTRACT_HWIRQ(hwirq);
+
+               if (hwirq < IRQC_TINT_START)
+                       return -EINVAL;
+       }
+
+       if (hwirq > (IRQC_NUM_IRQ - 1))
+               return -EINVAL;
+
+       ret = irq_domain_set_hwirq_and_chip(domain, virq, hwirq, &irqc_chip,
+                                           (void *)(uintptr_t)tint);
+       if (ret)
+               return ret;
+
+       return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &priv->fwspec[hwirq]);
+}
+
+static const struct irq_domain_ops rzg2l_irqc_domain_ops = {
+       .alloc = rzg2l_irqc_alloc,
+       .free = irq_domain_free_irqs_common,
+       .translate = irq_domain_translate_twocell,
+};
+
+static int rzg2l_irqc_parse_interrupts(struct rzg2l_irqc_priv *priv,
+                                      struct device_node *np)
+{
+       struct of_phandle_args map;
+       unsigned int i;
+       int ret;
+
+       for (i = 0; i < IRQC_NUM_IRQ; i++) {
+               ret = of_irq_parse_one(np, i, &map);
+               if (ret)
+                       return ret;
+               of_phandle_args_to_fwspec(np, map.args, map.args_count,
+                                         &priv->fwspec[i]);
+       }
+
+       return 0;
+}
+
+static int rzg2l_irqc_init(struct device_node *node, struct device_node *parent)
+{
+       struct irq_domain *irq_domain, *parent_domain;
+       struct platform_device *pdev;
+       struct reset_control *resetn;
+       struct rzg2l_irqc_priv *priv;
+       int ret;
+
+       pdev = of_find_device_by_node(node);
+       if (!pdev)
+               return -ENODEV;
+
+       parent_domain = irq_find_host(parent);
+       if (!parent_domain) {
+               dev_err(&pdev->dev, "cannot find parent domain\n");
+               return -ENODEV;
+       }
+
+       priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       priv->base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL);
+       if (IS_ERR(priv->base))
+               return PTR_ERR(priv->base);
+
+       ret = rzg2l_irqc_parse_interrupts(priv, node);
+       if (ret) {
+               dev_err(&pdev->dev, "cannot parse interrupts: %d\n", ret);
+               return ret;
+       }
+
+       resetn = devm_reset_control_get_exclusive(&pdev->dev, NULL);
+       if (IS_ERR(resetn))
+               return PTR_ERR(resetn);
+
+       ret = reset_control_deassert(resetn);
+       if (ret) {
+               dev_err(&pdev->dev, "failed to deassert resetn pin, %d\n", ret);
+               return ret;
+       }
+
+       pm_runtime_enable(&pdev->dev);
+       ret = pm_runtime_resume_and_get(&pdev->dev);
+       if (ret < 0) {
+               dev_err(&pdev->dev, "pm_runtime_resume_and_get failed: %d\n", ret);
+               goto pm_disable;
+       }
+
+       raw_spin_lock_init(&priv->lock);
+
+       irq_domain = irq_domain_add_hierarchy(parent_domain, 0, IRQC_NUM_IRQ,
+                                             node, &rzg2l_irqc_domain_ops,
+                                             priv);
+       if (!irq_domain) {
+               dev_err(&pdev->dev, "failed to add irq domain\n");
+               ret = -ENOMEM;
+               goto pm_put;
+       }
+
+       return 0;
+
+pm_put:
+       pm_runtime_put(&pdev->dev);
+pm_disable:
+       pm_runtime_disable(&pdev->dev);
+       reset_control_assert(resetn);
+       return ret;
+}
+
+IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc)
+IRQCHIP_MATCH("renesas,rzg2l-irqc", rzg2l_irqc_init)
+IRQCHIP_PLATFORM_DRIVER_END(rzg2l_irqc)
+MODULE_AUTHOR("Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>");
+MODULE_DESCRIPTION("Renesas RZ/G2L IRQC Driver");
+MODULE_LICENSE("GPL");
index bb87e4c3b88e1c95688e830a5ef9d2a3f73b54be..ba4938188570cc136c29cdd16c8b7728e02c885f 100644 (file)
 #define        PLIC_DISABLE_THRESHOLD          0x7
 #define        PLIC_ENABLE_THRESHOLD           0
 
+#define PLIC_QUIRK_EDGE_INTERRUPT      0
+
 struct plic_priv {
        struct cpumask lmask;
        struct irq_domain *irqdomain;
        void __iomem *regs;
+       unsigned long plic_quirks;
 };
 
 struct plic_handler {
@@ -81,6 +84,8 @@ static int plic_parent_irq __ro_after_init;
 static bool plic_cpuhp_setup_done __ro_after_init;
 static DEFINE_PER_CPU(struct plic_handler, plic_handlers);
 
+static int plic_irq_set_type(struct irq_data *d, unsigned int type);
+
 static void __plic_toggle(void __iomem *enable_base, int hwirq, int enable)
 {
        u32 __iomem *reg = enable_base + (hwirq / 32) * sizeof(u32);
@@ -103,37 +108,43 @@ static inline void plic_irq_toggle(const struct cpumask *mask,
                                   struct irq_data *d, int enable)
 {
        int cpu;
-       struct plic_priv *priv = irq_data_get_irq_chip_data(d);
 
-       writel(enable, priv->regs + PRIORITY_BASE + d->hwirq * PRIORITY_PER_ID);
        for_each_cpu(cpu, mask) {
                struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu);
 
-               if (handler->present &&
-                   cpumask_test_cpu(cpu, &handler->priv->lmask))
-                       plic_toggle(handler, d->hwirq, enable);
+               plic_toggle(handler, d->hwirq, enable);
        }
 }
 
+static void plic_irq_enable(struct irq_data *d)
+{
+       plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 1);
+}
+
+static void plic_irq_disable(struct irq_data *d)
+{
+       plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 0);
+}
+
 static void plic_irq_unmask(struct irq_data *d)
 {
-       struct cpumask amask;
-       unsigned int cpu;
        struct plic_priv *priv = irq_data_get_irq_chip_data(d);
 
-       cpumask_and(&amask, &priv->lmask, cpu_online_mask);
-       cpu = cpumask_any_and(irq_data_get_affinity_mask(d),
-                                          &amask);
-       if (WARN_ON_ONCE(cpu >= nr_cpu_ids))
-               return;
-       plic_irq_toggle(cpumask_of(cpu), d, 1);
+       writel(1, priv->regs + PRIORITY_BASE + d->hwirq * PRIORITY_PER_ID);
 }
 
 static void plic_irq_mask(struct irq_data *d)
 {
        struct plic_priv *priv = irq_data_get_irq_chip_data(d);
 
-       plic_irq_toggle(&priv->lmask, d, 0);
+       writel(0, priv->regs + PRIORITY_BASE + d->hwirq * PRIORITY_PER_ID);
+}
+
+static void plic_irq_eoi(struct irq_data *d)
+{
+       struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
+
+       writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
 }
 
 #ifdef CONFIG_SMP
@@ -154,38 +165,68 @@ static int plic_set_affinity(struct irq_data *d,
        if (cpu >= nr_cpu_ids)
                return -EINVAL;
 
-       plic_irq_toggle(&priv->lmask, d, 0);
-       plic_irq_toggle(cpumask_of(cpu), d, !irqd_irq_masked(d));
+       plic_irq_disable(d);
 
        irq_data_update_effective_affinity(d, cpumask_of(cpu));
 
+       if (!irqd_irq_disabled(d))
+               plic_irq_enable(d);
+
        return IRQ_SET_MASK_OK_DONE;
 }
 #endif
 
-static void plic_irq_eoi(struct irq_data *d)
-{
-       struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
-
-       if (irqd_irq_masked(d)) {
-               plic_irq_unmask(d);
-               writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
-               plic_irq_mask(d);
-       } else {
-               writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
-       }
-}
+static struct irq_chip plic_edge_chip = {
+       .name           = "SiFive PLIC",
+       .irq_enable     = plic_irq_enable,
+       .irq_disable    = plic_irq_disable,
+       .irq_ack        = plic_irq_eoi,
+       .irq_mask       = plic_irq_mask,
+       .irq_unmask     = plic_irq_unmask,
+#ifdef CONFIG_SMP
+       .irq_set_affinity = plic_set_affinity,
+#endif
+       .irq_set_type   = plic_irq_set_type,
+       .flags          = IRQCHIP_AFFINITY_PRE_STARTUP,
+};
 
 static struct irq_chip plic_chip = {
        .name           = "SiFive PLIC",
+       .irq_enable     = plic_irq_enable,
+       .irq_disable    = plic_irq_disable,
        .irq_mask       = plic_irq_mask,
        .irq_unmask     = plic_irq_unmask,
        .irq_eoi        = plic_irq_eoi,
 #ifdef CONFIG_SMP
        .irq_set_affinity = plic_set_affinity,
 #endif
+       .irq_set_type   = plic_irq_set_type,
+       .flags          = IRQCHIP_AFFINITY_PRE_STARTUP,
 };
 
+static int plic_irq_set_type(struct irq_data *d, unsigned int type)
+{
+       struct plic_priv *priv = irq_data_get_irq_chip_data(d);
+
+       if (!test_bit(PLIC_QUIRK_EDGE_INTERRUPT, &priv->plic_quirks))
+               return IRQ_SET_MASK_OK_NOCOPY;
+
+       switch (type) {
+       case IRQ_TYPE_EDGE_RISING:
+               irq_set_chip_handler_name_locked(d, &plic_edge_chip,
+                                                handle_edge_irq, NULL);
+               break;
+       case IRQ_TYPE_LEVEL_HIGH:
+               irq_set_chip_handler_name_locked(d, &plic_chip,
+                                                handle_fasteoi_irq, NULL);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return IRQ_SET_MASK_OK;
+}
+
 static int plic_irqdomain_map(struct irq_domain *d, unsigned int irq,
                              irq_hw_number_t hwirq)
 {
@@ -198,6 +239,19 @@ static int plic_irqdomain_map(struct irq_domain *d, unsigned int irq,
        return 0;
 }
 
+static int plic_irq_domain_translate(struct irq_domain *d,
+                                    struct irq_fwspec *fwspec,
+                                    unsigned long *hwirq,
+                                    unsigned int *type)
+{
+       struct plic_priv *priv = d->host_data;
+
+       if (test_bit(PLIC_QUIRK_EDGE_INTERRUPT, &priv->plic_quirks))
+               return irq_domain_translate_twocell(d, fwspec, hwirq, type);
+
+       return irq_domain_translate_onecell(d, fwspec, hwirq, type);
+}
+
 static int plic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
                                 unsigned int nr_irqs, void *arg)
 {
@@ -206,7 +260,7 @@ static int plic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
        unsigned int type;
        struct irq_fwspec *fwspec = arg;
 
-       ret = irq_domain_translate_onecell(domain, fwspec, &hwirq, &type);
+       ret = plic_irq_domain_translate(domain, fwspec, &hwirq, &type);
        if (ret)
                return ret;
 
@@ -220,7 +274,7 @@ static int plic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
 }
 
 static const struct irq_domain_ops plic_irqdomain_ops = {
-       .translate      = irq_domain_translate_onecell,
+       .translate      = plic_irq_domain_translate,
        .alloc          = plic_irq_domain_alloc,
        .free           = irq_domain_free_irqs_top,
 };
@@ -281,8 +335,9 @@ static int plic_starting_cpu(unsigned int cpu)
        return 0;
 }
 
-static int __init plic_init(struct device_node *node,
-               struct device_node *parent)
+static int __init __plic_init(struct device_node *node,
+                             struct device_node *parent,
+                             unsigned long plic_quirks)
 {
        int error = 0, nr_contexts, nr_handlers = 0, i;
        u32 nr_irqs;
@@ -293,6 +348,8 @@ static int __init plic_init(struct device_node *node,
        if (!priv)
                return -ENOMEM;
 
+       priv->plic_quirks = plic_quirks;
+
        priv->regs = of_iomap(node, 0);
        if (WARN_ON(!priv->regs)) {
                error = -EIO;
@@ -382,8 +439,11 @@ static int __init plic_init(struct device_node *node,
                        i * CONTEXT_ENABLE_SIZE;
                handler->priv = priv;
 done:
-               for (hwirq = 1; hwirq <= nr_irqs; hwirq++)
+               for (hwirq = 1; hwirq <= nr_irqs; hwirq++) {
                        plic_toggle(handler, hwirq, 0);
+                       writel(1, priv->regs + PRIORITY_BASE +
+                                 hwirq * PRIORITY_PER_ID);
+               }
                nr_handlers++;
        }
 
@@ -410,6 +470,20 @@ out_free_priv:
        return error;
 }
 
+static int __init plic_init(struct device_node *node,
+                           struct device_node *parent)
+{
+       return __plic_init(node, parent, 0);
+}
+
 IRQCHIP_DECLARE(sifive_plic, "sifive,plic-1.0.0", plic_init);
 IRQCHIP_DECLARE(riscv_plic0, "riscv,plic0", plic_init); /* for legacy systems */
-IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", plic_init); /* for firmware driver */
+
+static int __init plic_edge_init(struct device_node *node,
+                                struct device_node *parent)
+{
+       return __plic_init(node, parent, BIT(PLIC_QUIRK_EDGE_INTERRUPT));
+}
+
+IRQCHIP_DECLARE(andestech_nceplic100, "andestech,nceplic100", plic_edge_init);
+IRQCHIP_DECLARE(thead_c900_plic, "thead,c900-plic", plic_edge_init);
diff --git a/drivers/irqchip/irq-sp7021-intc.c b/drivers/irqchip/irq-sp7021-intc.c
new file mode 100644 (file)
index 0000000..bed78d1
--- /dev/null
@@ -0,0 +1,278 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Copyright (C) Sunplus Technology Co., Ltd.
+ *       All rights reserved.
+ */
+#include <linux/irq.h>
+#include <linux/irqdomain.h>
+#include <linux/io.h>
+#include <linux/irqchip.h>
+#include <linux/irqchip/chained_irq.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+
+#define SP_INTC_HWIRQ_MIN      0
+#define SP_INTC_HWIRQ_MAX      223
+
+#define SP_INTC_NR_IRQS                (SP_INTC_HWIRQ_MAX - SP_INTC_HWIRQ_MIN + 1)
+#define SP_INTC_NR_GROUPS      DIV_ROUND_UP(SP_INTC_NR_IRQS, 32)
+#define SP_INTC_REG_SIZE       (SP_INTC_NR_GROUPS * 4)
+
+/* REG_GROUP_0 regs */
+#define REG_INTR_TYPE          (sp_intc.g0)
+#define REG_INTR_POLARITY      (REG_INTR_TYPE     + SP_INTC_REG_SIZE)
+#define REG_INTR_PRIORITY      (REG_INTR_POLARITY + SP_INTC_REG_SIZE)
+#define REG_INTR_MASK          (REG_INTR_PRIORITY + SP_INTC_REG_SIZE)
+
+/* REG_GROUP_1 regs */
+#define REG_INTR_CLEAR         (sp_intc.g1)
+#define REG_MASKED_EXT1                (REG_INTR_CLEAR    + SP_INTC_REG_SIZE)
+#define REG_MASKED_EXT0                (REG_MASKED_EXT1   + SP_INTC_REG_SIZE)
+#define REG_INTR_GROUP         (REG_INTR_CLEAR    + 31 * 4)
+
+#define GROUP_MASK             (BIT(SP_INTC_NR_GROUPS) - 1)
+#define GROUP_SHIFT_EXT1       (0)
+#define GROUP_SHIFT_EXT0       (8)
+
+/*
+ * When GPIO_INT0~7 set to edge trigger, doesn't work properly.
+ * WORKAROUND: change it to level trigger, and toggle the polarity
+ * at ACK/Handler to make the HW work.
+ */
+#define GPIO_INT0_HWIRQ                120
+#define GPIO_INT7_HWIRQ                127
+#define IS_GPIO_INT(irq)                                       \
+({                                                             \
+       u32 i = irq;                                            \
+       (i >= GPIO_INT0_HWIRQ) && (i <= GPIO_INT7_HWIRQ);       \
+})
+
+/* index of states */
+enum {
+       _IS_EDGE = 0,
+       _IS_LOW,
+       _IS_ACTIVE
+};
+
+#define STATE_BIT(irq, idx)            (((irq) - GPIO_INT0_HWIRQ) * 3 + (idx))
+#define ASSIGN_STATE(irq, idx, v)      assign_bit(STATE_BIT(irq, idx), sp_intc.states, v)
+#define TEST_STATE(irq, idx)           test_bit(STATE_BIT(irq, idx), sp_intc.states)
+
+static struct sp_intctl {
+       /*
+        * REG_GROUP_0: include type/polarity/priority/mask regs.
+        * REG_GROUP_1: include clear/masked_ext0/masked_ext1/group regs.
+        */
+       void __iomem *g0; // REG_GROUP_0 base
+       void __iomem *g1; // REG_GROUP_1 base
+
+       struct irq_domain *domain;
+       raw_spinlock_t lock;
+
+       /*
+        * store GPIO_INT states
+        * each interrupt has 3 states: is_edge, is_low, is_active
+        */
+       DECLARE_BITMAP(states, (GPIO_INT7_HWIRQ - GPIO_INT0_HWIRQ + 1) * 3);
+} sp_intc;
+
+static struct irq_chip sp_intc_chip;
+
+static void sp_intc_assign_bit(u32 hwirq, void __iomem *base, bool value)
+{
+       u32 offset, mask;
+       unsigned long flags;
+       void __iomem *reg;
+
+       offset = (hwirq / 32) * 4;
+       reg = base + offset;
+
+       raw_spin_lock_irqsave(&sp_intc.lock, flags);
+       mask = readl_relaxed(reg);
+       if (value)
+               mask |= BIT(hwirq % 32);
+       else
+               mask &= ~BIT(hwirq % 32);
+       writel_relaxed(mask, reg);
+       raw_spin_unlock_irqrestore(&sp_intc.lock, flags);
+}
+
+static void sp_intc_ack_irq(struct irq_data *d)
+{
+       u32 hwirq = d->hwirq;
+
+       if (unlikely(IS_GPIO_INT(hwirq) && TEST_STATE(hwirq, _IS_EDGE))) { // WORKAROUND
+               sp_intc_assign_bit(hwirq, REG_INTR_POLARITY, !TEST_STATE(hwirq, _IS_LOW));
+               ASSIGN_STATE(hwirq, _IS_ACTIVE, true);
+       }
+
+       sp_intc_assign_bit(hwirq, REG_INTR_CLEAR, 1);
+}
+
+static void sp_intc_mask_irq(struct irq_data *d)
+{
+       sp_intc_assign_bit(d->hwirq, REG_INTR_MASK, 0);
+}
+
+static void sp_intc_unmask_irq(struct irq_data *d)
+{
+       sp_intc_assign_bit(d->hwirq, REG_INTR_MASK, 1);
+}
+
+static int sp_intc_set_type(struct irq_data *d, unsigned int type)
+{
+       u32 hwirq = d->hwirq;
+       bool is_edge = !(type & IRQ_TYPE_LEVEL_MASK);
+       bool is_low = (type == IRQ_TYPE_LEVEL_LOW || type == IRQ_TYPE_EDGE_FALLING);
+
+       irq_set_handler_locked(d, is_edge ? handle_edge_irq : handle_level_irq);
+
+       if (unlikely(IS_GPIO_INT(hwirq) && is_edge)) { // WORKAROUND
+               /* store states */
+               ASSIGN_STATE(hwirq, _IS_EDGE, is_edge);
+               ASSIGN_STATE(hwirq, _IS_LOW, is_low);
+               ASSIGN_STATE(hwirq, _IS_ACTIVE, false);
+               /* change to level */
+               is_edge = false;
+       }
+
+       sp_intc_assign_bit(hwirq, REG_INTR_TYPE, is_edge);
+       sp_intc_assign_bit(hwirq, REG_INTR_POLARITY, is_low);
+
+       return 0;
+}
+
+static int sp_intc_get_ext_irq(int ext_num)
+{
+       void __iomem *base = ext_num ? REG_MASKED_EXT1 : REG_MASKED_EXT0;
+       u32 shift = ext_num ? GROUP_SHIFT_EXT1 : GROUP_SHIFT_EXT0;
+       u32 groups;
+       u32 pending_group;
+       u32 group;
+       u32 pending_irq;
+
+       groups = readl_relaxed(REG_INTR_GROUP);
+       pending_group = (groups >> shift) & GROUP_MASK;
+       if (!pending_group)
+               return -1;
+
+       group = fls(pending_group) - 1;
+       pending_irq = readl_relaxed(base + group * 4);
+       if (!pending_irq)
+               return -1;
+
+       return (group * 32) + fls(pending_irq) - 1;
+}
+
+static void sp_intc_handle_ext_cascaded(struct irq_desc *desc)
+{
+       struct irq_chip *chip = irq_desc_get_chip(desc);
+       int ext_num = (uintptr_t)irq_desc_get_handler_data(desc);
+       int hwirq;
+
+       chained_irq_enter(chip, desc);
+
+       while ((hwirq = sp_intc_get_ext_irq(ext_num)) >= 0) {
+               if (unlikely(IS_GPIO_INT(hwirq) && TEST_STATE(hwirq, _IS_ACTIVE))) { // WORKAROUND
+                       ASSIGN_STATE(hwirq, _IS_ACTIVE, false);
+                       sp_intc_assign_bit(hwirq, REG_INTR_POLARITY, TEST_STATE(hwirq, _IS_LOW));
+               } else {
+                       generic_handle_domain_irq(sp_intc.domain, hwirq);
+               }
+       }
+
+       chained_irq_exit(chip, desc);
+}
+
+static struct irq_chip sp_intc_chip = {
+       .name = "sp_intc",
+       .irq_ack = sp_intc_ack_irq,
+       .irq_mask = sp_intc_mask_irq,
+       .irq_unmask = sp_intc_unmask_irq,
+       .irq_set_type = sp_intc_set_type,
+};
+
+static int sp_intc_irq_domain_map(struct irq_domain *domain,
+                                 unsigned int irq, irq_hw_number_t hwirq)
+{
+       irq_set_chip_and_handler(irq, &sp_intc_chip, handle_level_irq);
+       irq_set_chip_data(irq, &sp_intc_chip);
+       irq_set_noprobe(irq);
+
+       return 0;
+}
+
+static const struct irq_domain_ops sp_intc_dm_ops = {
+       .xlate = irq_domain_xlate_twocell,
+       .map = sp_intc_irq_domain_map,
+};
+
+static int sp_intc_irq_map(struct device_node *node, int i)
+{
+       unsigned int irq;
+
+       irq = irq_of_parse_and_map(node, i);
+       if (!irq)
+               return -ENOENT;
+
+       irq_set_chained_handler_and_data(irq, sp_intc_handle_ext_cascaded, (void *)(uintptr_t)i);
+
+       return 0;
+}
+
+static int __init sp_intc_init_dt(struct device_node *node, struct device_node *parent)
+{
+       int i, ret;
+
+       sp_intc.g0 = of_iomap(node, 0);
+       if (!sp_intc.g0)
+               return -ENXIO;
+
+       sp_intc.g1 = of_iomap(node, 1);
+       if (!sp_intc.g1) {
+               ret = -ENXIO;
+               goto out_unmap0;
+       }
+
+       ret = sp_intc_irq_map(node, 0); // EXT_INT0
+       if (ret)
+               goto out_unmap1;
+
+       ret = sp_intc_irq_map(node, 1); // EXT_INT1
+       if (ret)
+               goto out_unmap1;
+
+       /* initial regs */
+       for (i = 0; i < SP_INTC_NR_GROUPS; i++) {
+               /* all mask */
+               writel_relaxed(0, REG_INTR_MASK + i * 4);
+               /* all edge */
+               writel_relaxed(~0, REG_INTR_TYPE + i * 4);
+               /* all high-active */
+               writel_relaxed(0, REG_INTR_POLARITY + i * 4);
+               /* all EXT_INT0 */
+               writel_relaxed(~0, REG_INTR_PRIORITY + i * 4);
+               /* all clear */
+               writel_relaxed(~0, REG_INTR_CLEAR + i * 4);
+       }
+
+       sp_intc.domain = irq_domain_add_linear(node, SP_INTC_NR_IRQS,
+                                              &sp_intc_dm_ops, &sp_intc);
+       if (!sp_intc.domain) {
+               ret = -ENOMEM;
+               goto out_unmap1;
+       }
+
+       raw_spin_lock_init(&sp_intc.lock);
+
+       return 0;
+
+out_unmap1:
+       iounmap(sp_intc.g1);
+out_unmap0:
+       iounmap(sp_intc.g0);
+
+       return ret;
+}
+
+IRQCHIP_DECLARE(sp_intc, "sunplus,sp7021-intc", sp_intc_init_dt);
index 9d18f47040eb71baf7824df07cd972e2b46a3ef3..a73763d475f04e277f4794fe7ccc048d8e6313bc 100644 (file)
@@ -34,21 +34,15 @@ struct stm32_exti_bank {
        u32 swier_ofst;
        u32 rpr_ofst;
        u32 fpr_ofst;
+       u32 trg_ofst;
 };
 
 #define UNDEF_REG ~0
 
-struct stm32_desc_irq {
-       u32 exti;
-       u32 irq_parent;
-       struct irq_chip *chip;
-};
-
 struct stm32_exti_drv_data {
        const struct stm32_exti_bank **exti_banks;
-       const struct stm32_desc_irq *desc_irqs;
+       const u8 *desc_irqs;
        u32 bank_nr;
-       u32 irq_nr;
 };
 
 struct stm32_exti_chip_data {
@@ -78,6 +72,7 @@ static const struct stm32_exti_bank stm32f4xx_exti_b1 = {
        .swier_ofst     = 0x10,
        .rpr_ofst       = 0x14,
        .fpr_ofst       = UNDEF_REG,
+       .trg_ofst       = UNDEF_REG,
 };
 
 static const struct stm32_exti_bank *stm32f4xx_exti_banks[] = {
@@ -97,6 +92,7 @@ static const struct stm32_exti_bank stm32h7xx_exti_b1 = {
        .swier_ofst     = 0x08,
        .rpr_ofst       = 0x88,
        .fpr_ofst       = UNDEF_REG,
+       .trg_ofst       = UNDEF_REG,
 };
 
 static const struct stm32_exti_bank stm32h7xx_exti_b2 = {
@@ -107,6 +103,7 @@ static const struct stm32_exti_bank stm32h7xx_exti_b2 = {
        .swier_ofst     = 0x28,
        .rpr_ofst       = 0x98,
        .fpr_ofst       = UNDEF_REG,
+       .trg_ofst       = UNDEF_REG,
 };
 
 static const struct stm32_exti_bank stm32h7xx_exti_b3 = {
@@ -117,6 +114,7 @@ static const struct stm32_exti_bank stm32h7xx_exti_b3 = {
        .swier_ofst     = 0x48,
        .rpr_ofst       = 0xA8,
        .fpr_ofst       = UNDEF_REG,
+       .trg_ofst       = UNDEF_REG,
 };
 
 static const struct stm32_exti_bank *stm32h7xx_exti_banks[] = {
@@ -132,32 +130,35 @@ static const struct stm32_exti_drv_data stm32h7xx_drv_data = {
 
 static const struct stm32_exti_bank stm32mp1_exti_b1 = {
        .imr_ofst       = 0x80,
-       .emr_ofst       = 0x84,
+       .emr_ofst       = UNDEF_REG,
        .rtsr_ofst      = 0x00,
        .ftsr_ofst      = 0x04,
        .swier_ofst     = 0x08,
        .rpr_ofst       = 0x0C,
        .fpr_ofst       = 0x10,
+       .trg_ofst       = 0x3EC,
 };
 
 static const struct stm32_exti_bank stm32mp1_exti_b2 = {
        .imr_ofst       = 0x90,
-       .emr_ofst       = 0x94,
+       .emr_ofst       = UNDEF_REG,
        .rtsr_ofst      = 0x20,
        .ftsr_ofst      = 0x24,
        .swier_ofst     = 0x28,
        .rpr_ofst       = 0x2C,
        .fpr_ofst       = 0x30,
+       .trg_ofst       = 0x3E8,
 };
 
 static const struct stm32_exti_bank stm32mp1_exti_b3 = {
        .imr_ofst       = 0xA0,
-       .emr_ofst       = 0xA4,
+       .emr_ofst       = UNDEF_REG,
        .rtsr_ofst      = 0x40,
        .ftsr_ofst      = 0x44,
        .swier_ofst     = 0x48,
        .rpr_ofst       = 0x4C,
        .fpr_ofst       = 0x50,
+       .trg_ofst       = 0x3E4,
 };
 
 static const struct stm32_exti_bank *stm32mp1_exti_banks[] = {
@@ -169,126 +170,114 @@ static const struct stm32_exti_bank *stm32mp1_exti_banks[] = {
 static struct irq_chip stm32_exti_h_chip;
 static struct irq_chip stm32_exti_h_chip_direct;
 
-static const struct stm32_desc_irq stm32mp1_desc_irq[] = {
-       { .exti = 0, .irq_parent = 6, .chip = &stm32_exti_h_chip },
-       { .exti = 1, .irq_parent = 7, .chip = &stm32_exti_h_chip },
-       { .exti = 2, .irq_parent = 8, .chip = &stm32_exti_h_chip },
-       { .exti = 3, .irq_parent = 9, .chip = &stm32_exti_h_chip },
-       { .exti = 4, .irq_parent = 10, .chip = &stm32_exti_h_chip },
-       { .exti = 5, .irq_parent = 23, .chip = &stm32_exti_h_chip },
-       { .exti = 6, .irq_parent = 64, .chip = &stm32_exti_h_chip },
-       { .exti = 7, .irq_parent = 65, .chip = &stm32_exti_h_chip },
-       { .exti = 8, .irq_parent = 66, .chip = &stm32_exti_h_chip },
-       { .exti = 9, .irq_parent = 67, .chip = &stm32_exti_h_chip },
-       { .exti = 10, .irq_parent = 40, .chip = &stm32_exti_h_chip },
-       { .exti = 11, .irq_parent = 42, .chip = &stm32_exti_h_chip },
-       { .exti = 12, .irq_parent = 76, .chip = &stm32_exti_h_chip },
-       { .exti = 13, .irq_parent = 77, .chip = &stm32_exti_h_chip },
-       { .exti = 14, .irq_parent = 121, .chip = &stm32_exti_h_chip },
-       { .exti = 15, .irq_parent = 127, .chip = &stm32_exti_h_chip },
-       { .exti = 16, .irq_parent = 1, .chip = &stm32_exti_h_chip },
-       { .exti = 19, .irq_parent = 3, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 21, .irq_parent = 31, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 22, .irq_parent = 33, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 23, .irq_parent = 72, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 24, .irq_parent = 95, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 25, .irq_parent = 107, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 26, .irq_parent = 37, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 27, .irq_parent = 38, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 28, .irq_parent = 39, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 29, .irq_parent = 71, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 30, .irq_parent = 52, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 31, .irq_parent = 53, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 32, .irq_parent = 82, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 33, .irq_parent = 83, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 47, .irq_parent = 93, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 48, .irq_parent = 138, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 50, .irq_parent = 139, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 52, .irq_parent = 140, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 53, .irq_parent = 141, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 54, .irq_parent = 135, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 61, .irq_parent = 100, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 65, .irq_parent = 144, .chip = &stm32_exti_h_chip },
-       { .exti = 68, .irq_parent = 143, .chip = &stm32_exti_h_chip },
-       { .exti = 70, .irq_parent = 62, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 73, .irq_parent = 129, .chip = &stm32_exti_h_chip },
+#define EXTI_INVALID_IRQ       U8_MAX
+#define STM32MP1_DESC_IRQ_SIZE (ARRAY_SIZE(stm32mp1_exti_banks) * IRQS_PER_BANK)
+
+static const u8 stm32mp1_desc_irq[] = {
+       /* default value */
+       [0 ... (STM32MP1_DESC_IRQ_SIZE - 1)] = EXTI_INVALID_IRQ,
+
+       [0] = 6,
+       [1] = 7,
+       [2] = 8,
+       [3] = 9,
+       [4] = 10,
+       [5] = 23,
+       [6] = 64,
+       [7] = 65,
+       [8] = 66,
+       [9] = 67,
+       [10] = 40,
+       [11] = 42,
+       [12] = 76,
+       [13] = 77,
+       [14] = 121,
+       [15] = 127,
+       [16] = 1,
+       [19] = 3,
+       [21] = 31,
+       [22] = 33,
+       [23] = 72,
+       [24] = 95,
+       [25] = 107,
+       [26] = 37,
+       [27] = 38,
+       [28] = 39,
+       [29] = 71,
+       [30] = 52,
+       [31] = 53,
+       [32] = 82,
+       [33] = 83,
+       [47] = 93,
+       [48] = 138,
+       [50] = 139,
+       [52] = 140,
+       [53] = 141,
+       [54] = 135,
+       [61] = 100,
+       [65] = 144,
+       [68] = 143,
+       [70] = 62,
+       [73] = 129,
 };
 
-static const struct stm32_desc_irq stm32mp13_desc_irq[] = {
-       { .exti = 0, .irq_parent = 6, .chip = &stm32_exti_h_chip },
-       { .exti = 1, .irq_parent = 7, .chip = &stm32_exti_h_chip },
-       { .exti = 2, .irq_parent = 8, .chip = &stm32_exti_h_chip },
-       { .exti = 3, .irq_parent = 9, .chip = &stm32_exti_h_chip },
-       { .exti = 4, .irq_parent = 10, .chip = &stm32_exti_h_chip },
-       { .exti = 5, .irq_parent = 24, .chip = &stm32_exti_h_chip },
-       { .exti = 6, .irq_parent = 65, .chip = &stm32_exti_h_chip },
-       { .exti = 7, .irq_parent = 66, .chip = &stm32_exti_h_chip },
-       { .exti = 8, .irq_parent = 67, .chip = &stm32_exti_h_chip },
-       { .exti = 9, .irq_parent = 68, .chip = &stm32_exti_h_chip },
-       { .exti = 10, .irq_parent = 41, .chip = &stm32_exti_h_chip },
-       { .exti = 11, .irq_parent = 43, .chip = &stm32_exti_h_chip },
-       { .exti = 12, .irq_parent = 77, .chip = &stm32_exti_h_chip },
-       { .exti = 13, .irq_parent = 78, .chip = &stm32_exti_h_chip },
-       { .exti = 14, .irq_parent = 106, .chip = &stm32_exti_h_chip },
-       { .exti = 15, .irq_parent = 109, .chip = &stm32_exti_h_chip },
-       { .exti = 16, .irq_parent = 1, .chip = &stm32_exti_h_chip },
-       { .exti = 19, .irq_parent = 3, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 21, .irq_parent = 32, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 22, .irq_parent = 34, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 23, .irq_parent = 73, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 24, .irq_parent = 93, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 25, .irq_parent = 114, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 26, .irq_parent = 38, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 27, .irq_parent = 39, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 28, .irq_parent = 40, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 29, .irq_parent = 72, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 30, .irq_parent = 53, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 31, .irq_parent = 54, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 32, .irq_parent = 83, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 33, .irq_parent = 84, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 44, .irq_parent = 96, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 47, .irq_parent = 92, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 48, .irq_parent = 116, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 50, .irq_parent = 117, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 52, .irq_parent = 118, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 53, .irq_parent = 119, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 68, .irq_parent = 63, .chip = &stm32_exti_h_chip_direct },
-       { .exti = 70, .irq_parent = 98, .chip = &stm32_exti_h_chip_direct },
+static const u8 stm32mp13_desc_irq[] = {
+       /* default value */
+       [0 ... (STM32MP1_DESC_IRQ_SIZE - 1)] = EXTI_INVALID_IRQ,
+
+       [0] = 6,
+       [1] = 7,
+       [2] = 8,
+       [3] = 9,
+       [4] = 10,
+       [5] = 24,
+       [6] = 65,
+       [7] = 66,
+       [8] = 67,
+       [9] = 68,
+       [10] = 41,
+       [11] = 43,
+       [12] = 77,
+       [13] = 78,
+       [14] = 106,
+       [15] = 109,
+       [16] = 1,
+       [19] = 3,
+       [21] = 32,
+       [22] = 34,
+       [23] = 73,
+       [24] = 93,
+       [25] = 114,
+       [26] = 38,
+       [27] = 39,
+       [28] = 40,
+       [29] = 72,
+       [30] = 53,
+       [31] = 54,
+       [32] = 83,
+       [33] = 84,
+       [44] = 96,
+       [47] = 92,
+       [48] = 116,
+       [50] = 117,
+       [52] = 118,
+       [53] = 119,
+       [68] = 63,
+       [70] = 98,
 };
 
 static const struct stm32_exti_drv_data stm32mp1_drv_data = {
        .exti_banks = stm32mp1_exti_banks,
        .bank_nr = ARRAY_SIZE(stm32mp1_exti_banks),
        .desc_irqs = stm32mp1_desc_irq,
-       .irq_nr = ARRAY_SIZE(stm32mp1_desc_irq),
 };
 
 static const struct stm32_exti_drv_data stm32mp13_drv_data = {
        .exti_banks = stm32mp1_exti_banks,
        .bank_nr = ARRAY_SIZE(stm32mp1_exti_banks),
        .desc_irqs = stm32mp13_desc_irq,
-       .irq_nr = ARRAY_SIZE(stm32mp13_desc_irq),
 };
 
-static const struct
-stm32_desc_irq *stm32_exti_get_desc(const struct stm32_exti_drv_data *drv_data,
-                                   irq_hw_number_t hwirq)
-{
-       const struct stm32_desc_irq *desc = NULL;
-       int i;
-
-       if (!drv_data->desc_irqs)
-               return NULL;
-
-       for (i = 0; i < drv_data->irq_nr; i++) {
-               desc = &drv_data->desc_irqs[i];
-               if (desc->exti == hwirq)
-                       break;
-       }
-
-       return desc;
-}
-
 static unsigned long stm32_exti_pending(struct irq_chip_generic *gc)
 {
        struct stm32_exti_chip_data *chip_data = gc->private;
@@ -614,7 +603,7 @@ static int stm32_exti_h_set_affinity(struct irq_data *d,
        if (d->parent_data->chip)
                return irq_chip_set_affinity_parent(d, dest, force);
 
-       return -EINVAL;
+       return IRQ_SET_MASK_OK_DONE;
 }
 
 static int __maybe_unused stm32_exti_h_suspend(void)
@@ -691,8 +680,8 @@ static struct irq_chip stm32_exti_h_chip_direct = {
        .name                   = "stm32-exti-h-direct",
        .irq_eoi                = irq_chip_eoi_parent,
        .irq_ack                = irq_chip_ack_parent,
-       .irq_mask               = irq_chip_mask_parent,
-       .irq_unmask             = irq_chip_unmask_parent,
+       .irq_mask               = stm32_exti_h_mask,
+       .irq_unmask             = stm32_exti_h_unmask,
        .irq_retrigger          = irq_chip_retrigger_hierarchy,
        .irq_set_type           = irq_chip_set_type_parent,
        .irq_set_wake           = stm32_exti_h_set_wake,
@@ -706,28 +695,36 @@ static int stm32_exti_h_domain_alloc(struct irq_domain *dm,
 {
        struct stm32_exti_host_data *host_data = dm->host_data;
        struct stm32_exti_chip_data *chip_data;
-       const struct stm32_desc_irq *desc;
+       u8 desc_irq;
        struct irq_fwspec *fwspec = data;
        struct irq_fwspec p_fwspec;
        irq_hw_number_t hwirq;
        int bank;
+       u32 event_trg;
+       struct irq_chip *chip;
 
        hwirq = fwspec->param[0];
+       if (hwirq >= host_data->drv_data->bank_nr * IRQS_PER_BANK)
+               return -EINVAL;
+
        bank  = hwirq / IRQS_PER_BANK;
        chip_data = &host_data->chips_data[bank];
 
+       event_trg = readl_relaxed(host_data->base + chip_data->reg_bank->trg_ofst);
+       chip = (event_trg & BIT(hwirq % IRQS_PER_BANK)) ?
+              &stm32_exti_h_chip : &stm32_exti_h_chip_direct;
+
+       irq_domain_set_hwirq_and_chip(dm, virq, hwirq, chip, chip_data);
 
-       desc = stm32_exti_get_desc(host_data->drv_data, hwirq);
-       if (!desc)
+       if (!host_data->drv_data || !host_data->drv_data->desc_irqs)
                return -EINVAL;
 
-       irq_domain_set_hwirq_and_chip(dm, virq, hwirq, desc->chip,
-                                     chip_data);
-       if (desc->irq_parent) {
+       desc_irq = host_data->drv_data->desc_irqs[hwirq];
+       if (desc_irq != EXTI_INVALID_IRQ) {
                p_fwspec.fwnode = dm->parent->fwnode;
                p_fwspec.param_count = 3;
                p_fwspec.param[0] = GIC_SPI;
-               p_fwspec.param[1] = desc->irq_parent;
+               p_fwspec.param[1] = desc_irq;
                p_fwspec.param[2] = IRQ_TYPE_LEVEL_HIGH;
 
                return irq_domain_alloc_irqs_parent(dm, virq, 1, &p_fwspec);
@@ -792,7 +789,8 @@ stm32_exti_chip_data *stm32_exti_chip_init(struct stm32_exti_host_data *h_data,
         * clear registers to avoid residue
         */
        writel_relaxed(0, base + stm32_bank->imr_ofst);
-       writel_relaxed(0, base + stm32_bank->emr_ofst);
+       if (stm32_bank->emr_ofst != UNDEF_REG)
+               writel_relaxed(0, base + stm32_bank->emr_ofst);
 
        pr_info("%pOF: bank%d\n", node, bank_idx);
 
index 4c5154e0bf00ca6ffe4bf9b5a6593de384ff5b06..d7cb7ead2ac7fc04f52af23b14f3fcb76cdd42e9 100644 (file)
 /* SMI COMMON */
 #define SMI_L1LEN                      0x100
 
+#define SMI_L1_ARB                     0x200
 #define SMI_BUS_SEL                    0x220
 #define SMI_BUS_LARB_SHIFT(larbid)     ((larbid) << 1)
 /* All are MMU0 defaultly. Only specialize mmu1 here. */
 #define F_MMU1_LARB(larbid)            (0x1 << SMI_BUS_LARB_SHIFT(larbid))
 
+#define SMI_READ_FIFO_TH               0x230
 #define SMI_M4U_TH                     0x234
 #define SMI_FIFO_TH1                   0x238
 #define SMI_FIFO_TH2                   0x23c
@@ -360,6 +362,7 @@ static const struct of_device_id mtk_smi_larb_of_ids[] = {
        {.compatible = "mediatek,mt2701-smi-larb", .data = &mtk_smi_larb_mt2701},
        {.compatible = "mediatek,mt2712-smi-larb", .data = &mtk_smi_larb_mt2712},
        {.compatible = "mediatek,mt6779-smi-larb", .data = &mtk_smi_larb_mt6779},
+       {.compatible = "mediatek,mt6795-smi-larb", .data = &mtk_smi_larb_mt8173},
        {.compatible = "mediatek,mt8167-smi-larb", .data = &mtk_smi_larb_mt8167},
        {.compatible = "mediatek,mt8173-smi-larb", .data = &mtk_smi_larb_mt8173},
        {.compatible = "mediatek,mt8183-smi-larb", .data = &mtk_smi_larb_mt8183},
@@ -544,6 +547,13 @@ static struct platform_driver mtk_smi_larb_driver = {
        }
 };
 
+static const struct mtk_smi_reg_pair mtk_smi_common_mt6795_init[SMI_COMMON_INIT_REGS_NR] = {
+       {SMI_L1_ARB, 0x1b},
+       {SMI_M4U_TH, 0xce810c85},
+       {SMI_FIFO_TH1, 0x43214c8},
+       {SMI_READ_FIFO_TH, 0x191f},
+};
+
 static const struct mtk_smi_reg_pair mtk_smi_common_mt8195_init[SMI_COMMON_INIT_REGS_NR] = {
        {SMI_L1LEN, 0xb},
        {SMI_M4U_TH, 0xe100e10},
@@ -568,6 +578,12 @@ static const struct mtk_smi_common_plat mtk_smi_common_mt6779 = {
                    F_MMU1_LARB(5) | F_MMU1_LARB(6) | F_MMU1_LARB(7),
 };
 
+static const struct mtk_smi_common_plat mtk_smi_common_mt6795 = {
+       .type     = MTK_SMI_GEN2,
+       .bus_sel  = F_MMU1_LARB(0),
+       .init     = mtk_smi_common_mt6795_init,
+};
+
 static const struct mtk_smi_common_plat mtk_smi_common_mt8183 = {
        .type     = MTK_SMI_GEN2,
        .has_gals = true,
@@ -612,6 +628,7 @@ static const struct of_device_id mtk_smi_common_of_ids[] = {
        {.compatible = "mediatek,mt2701-smi-common", .data = &mtk_smi_common_gen1},
        {.compatible = "mediatek,mt2712-smi-common", .data = &mtk_smi_common_gen2},
        {.compatible = "mediatek,mt6779-smi-common", .data = &mtk_smi_common_mt6779},
+       {.compatible = "mediatek,mt6795-smi-common", .data = &mtk_smi_common_mt6795},
        {.compatible = "mediatek,mt8167-smi-common", .data = &mtk_smi_common_gen2},
        {.compatible = "mediatek,mt8173-smi-common", .data = &mtk_smi_common_gen2},
        {.compatible = "mediatek,mt8183-smi-common", .data = &mtk_smi_common_mt8183},
index e23ebd421f17b03ebd33fb207209fbf7fcf80a66..a9e8fd99730fa990fdcace2fff19fe8f76ed4681 100644 (file)
 
 static const struct tegra_mc_client tegra234_mc_clients[] = {
        {
+               .id = TEGRA234_MEMORY_CLIENT_MGBEARD,
+               .name = "mgbeard",
+               .sid = TEGRA234_SID_MGBE,
+               .regs = {
+                       .sid = {
+                               .override = 0x2c0,
+                               .security = 0x2c4,
+                       },
+               },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBEBRD,
+               .name = "mgbebrd",
+               .sid = TEGRA234_SID_MGBE_VF1,
+               .regs = {
+                       .sid = {
+                               .override = 0x2c8,
+                               .security = 0x2cc,
+                       },
+               },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBECRD,
+               .name = "mgbecrd",
+               .sid = TEGRA234_SID_MGBE_VF2,
+               .regs = {
+                       .sid = {
+                               .override = 0x2d0,
+                               .security = 0x2d4,
+                       },
+               },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBEDRD,
+               .name = "mgbedrd",
+               .sid = TEGRA234_SID_MGBE_VF3,
+               .regs = {
+                       .sid = {
+                               .override = 0x2d8,
+                               .security = 0x2dc,
+                       },
+               },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBEAWR,
+               .name = "mgbeawr",
+               .sid = TEGRA234_SID_MGBE,
+               .regs = {
+                       .sid = {
+                               .override = 0x2e0,
+                               .security = 0x2e4,
+                       },
+               },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBEBWR,
+               .name = "mgbebwr",
+               .sid = TEGRA234_SID_MGBE_VF1,
+               .regs = {
+                       .sid = {
+                               .override = 0x2f8,
+                               .security = 0x2fc,
+                       },
+               },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBECWR,
+               .name = "mgbecwr",
+               .sid = TEGRA234_SID_MGBE_VF2,
+               .regs = {
+                       .sid = {
+                               .override = 0x308,
+                               .security = 0x30c,
+                       },
+               },
+       }, {
                .id = TEGRA234_MEMORY_CLIENT_SDMMCRAB,
                .name = "sdmmcrab",
                .sid = TEGRA234_SID_SDMMC4,
@@ -20,6 +90,16 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
                                .security = 0x31c,
                        },
                },
+       }, {
+               .id = TEGRA234_MEMORY_CLIENT_MGBEDWR,
+               .name = "mgbedwr",
+               .sid = TEGRA234_SID_MGBE_VF3,
+               .regs = {
+                       .sid = {
+                               .override = 0x328,
+                               .security = 0x32c,
+                       },
+               },
        }, {
                .id = TEGRA234_MEMORY_CLIENT_SDMMCWAB,
                .name = "sdmmcwab",
index 42fe67f1538e76887e0ddfc631724e72a119ef72..49cd1f03884afc05e575fb5ff9e9a44029a17289 100644 (file)
@@ -25,9 +25,52 @@ static const struct mfd_cell bcm2835_power_devs[] = {
        { .name = "bcm2835-power" },
 };
 
+static int bcm2835_pm_get_pdata(struct platform_device *pdev,
+                               struct bcm2835_pm *pm)
+{
+       if (of_find_property(pm->dev->of_node, "reg-names", NULL)) {
+               struct resource *res;
+
+               pm->base = devm_platform_ioremap_resource_byname(pdev, "pm");
+               if (IS_ERR(pm->base))
+                       return PTR_ERR(pm->base);
+
+               res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "asb");
+               if (res) {
+                       pm->asb = devm_ioremap_resource(&pdev->dev, res);
+                       if (IS_ERR(pm->asb))
+                               pm->asb = NULL;
+               }
+
+               res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+                                                   "rpivid_asb");
+               if (res) {
+                       pm->rpivid_asb = devm_ioremap_resource(&pdev->dev, res);
+                       if (IS_ERR(pm->rpivid_asb))
+                               pm->rpivid_asb = NULL;
+               }
+
+               return 0;
+       }
+
+       /* If no 'reg-names' property is found we can assume we're using old DTB. */
+       pm->base = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(pm->base))
+               return PTR_ERR(pm->base);
+
+       pm->asb = devm_platform_ioremap_resource(pdev, 1);
+       if (IS_ERR(pm->asb))
+               pm->asb = NULL;
+
+       pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2);
+       if (IS_ERR(pm->rpivid_asb))
+               pm->rpivid_asb = NULL;
+
+       return 0;
+}
+
 static int bcm2835_pm_probe(struct platform_device *pdev)
 {
-       struct resource *res;
        struct device *dev = &pdev->dev;
        struct bcm2835_pm *pm;
        int ret;
@@ -39,10 +82,9 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
 
        pm->dev = dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       pm->base = devm_ioremap_resource(dev, res);
-       if (IS_ERR(pm->base))
-               return PTR_ERR(pm->base);
+       ret = bcm2835_pm_get_pdata(pdev, pm);
+       if (ret)
+               return ret;
 
        ret = devm_mfd_add_devices(dev, -1,
                                   bcm2835_pm_devs, ARRAY_SIZE(bcm2835_pm_devs),
@@ -50,30 +92,22 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       /* We'll use the presence of the AXI ASB regs in the
+       /*
+        * We'll use the presence of the AXI ASB regs in the
         * bcm2835-pm binding as the key for whether we can reference
         * the full PM register range and support power domains.
         */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       if (res) {
-               pm->asb = devm_ioremap_resource(dev, res);
-               if (IS_ERR(pm->asb))
-                       return PTR_ERR(pm->asb);
-
-               ret = devm_mfd_add_devices(dev, -1,
-                                          bcm2835_power_devs,
-                                          ARRAY_SIZE(bcm2835_power_devs),
-                                          NULL, 0, NULL);
-               if (ret)
-                       return ret;
-       }
-
+       if (pm->asb)
+               return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
+                                           ARRAY_SIZE(bcm2835_power_devs),
+                                           NULL, 0, NULL);
        return 0;
 }
 
 static const struct of_device_id bcm2835_pm_of_match[] = {
        { .compatible = "brcm,bcm2835-pm-wdt", },
        { .compatible = "brcm,bcm2835-pm", },
+       { .compatible = "brcm,bcm2711-pm", },
        {},
 };
 MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
index 684a011a63968843f87a91e43abef57fe954a3d1..8b058200d5adaf5fd718c4641e4583867913fee0 100644 (file)
@@ -60,12 +60,29 @@ int mfd_cell_disable(struct platform_device *pdev)
 EXPORT_SYMBOL(mfd_cell_disable);
 
 #if IS_ENABLED(CONFIG_ACPI)
+struct match_ids_walk_data {
+       struct acpi_device_id *ids;
+       struct acpi_device *adev;
+};
+
+static int match_device_ids(struct acpi_device *adev, void *data)
+{
+       struct match_ids_walk_data *wd = data;
+
+       if (!acpi_match_device_ids(adev, wd->ids)) {
+               wd->adev = adev;
+               return 1;
+       }
+
+       return 0;
+}
+
 static void mfd_acpi_add_device(const struct mfd_cell *cell,
                                struct platform_device *pdev)
 {
        const struct mfd_cell_acpi_match *match = cell->acpi_match;
-       struct acpi_device *parent, *child;
        struct acpi_device *adev = NULL;
+       struct acpi_device *parent;
 
        parent = ACPI_COMPANION(pdev->dev.parent);
        if (!parent)
@@ -83,14 +100,14 @@ static void mfd_acpi_add_device(const struct mfd_cell *cell,
        if (match) {
                if (match->pnpid) {
                        struct acpi_device_id ids[2] = {};
+                       struct match_ids_walk_data wd = {
+                               .adev = NULL,
+                               .ids = ids,
+                       };
 
                        strlcpy(ids[0].id, match->pnpid, sizeof(ids[0].id));
-                       list_for_each_entry(child, &parent->children, node) {
-                               if (!acpi_match_device_ids(child, ids)) {
-                                       adev = child;
-                                       break;
-                               }
-                       }
+                       acpi_dev_for_each_child(parent, match_device_ids, &wd);
+                       adev = wd.adev;
                } else {
                        adev = acpi_find_child_device(parent, match->adr, false);
                }
index c0350e9c03f3bdbcf66e18b47f8346bda1f4f4ae..4cca4c90769bc3ea625f23e0a7a3f842aba851fd 100644 (file)
@@ -775,8 +775,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        const struct sdhci_acpi_slot *slot;
-       struct acpi_device *device, *child;
        const struct dmi_system_id *id;
+       struct acpi_device *device;
        struct sdhci_acpi_host *c;
        struct sdhci_host *host;
        struct resource *iomem;
@@ -796,10 +796,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
        slot = sdhci_acpi_get_slot(device);
 
        /* Power on the SDHCI controller and its children */
-       acpi_device_fix_up_power(device);
-       list_for_each_entry(child, &device->children, node)
-               if (child->status.present && child->status.enabled)
-                       acpi_device_fix_up_power(child);
+       acpi_device_fix_up_power_extended(device);
 
        if (sdhci_acpi_byt_defer(dev))
                return -EPROBE_DEFER;
index ed53276f6ad90ba9cdfdd13495904696b324f894..622b7de96c7f679428a7f9d0107d8f81a52c8431 100644 (file)
@@ -1240,16 +1240,11 @@ static const struct sdhci_pci_fixes sdhci_intel_byt_sd = {
 #ifdef CONFIG_ACPI
 static void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot)
 {
-       struct acpi_device *device, *child;
+       struct acpi_device *device;
 
        device = ACPI_COMPANION(&slot->chip->pdev->dev);
-       if (!device)
-               return;
-
-       acpi_device_fix_up_power(device);
-       list_for_each_entry(child, &device->children, node)
-               if (child->status.present && child->status.enabled)
-                       acpi_device_fix_up_power(child);
+       if (device)
+               acpi_device_fix_up_power_extended(device);
 }
 #else
 static inline void intel_mrfld_mmc_fix_up_power_slot(struct sdhci_pci_slot *slot) {}
index 0f6a549b9f6797586081500468666acb9cb8bf15..29a6c2ede43a6991af695e63659d5f477d3d2d4b 100644 (file)
@@ -142,6 +142,7 @@ static void *fun_run_xdp(struct funeth_rxq *q, skb_frag_t *frags, void *buf_va,
                         int ref_ok, struct funeth_txq *xdp_q)
 {
        struct bpf_prog *xdp_prog;
+       struct xdp_frame *xdpf;
        struct xdp_buff xdp;
        u32 act;
 
@@ -163,7 +164,9 @@ static void *fun_run_xdp(struct funeth_rxq *q, skb_frag_t *frags, void *buf_va,
        case XDP_TX:
                if (unlikely(!ref_ok))
                        goto pass;
-               if (!fun_xdp_tx(xdp_q, xdp.data, xdp.data_end - xdp.data))
+
+               xdpf = xdp_convert_buff_to_frame(&xdp);
+               if (!xdpf || !fun_xdp_tx(xdp_q, xdpf))
                        goto xdp_error;
                FUN_QSTAT_INC(q, xdp_tx);
                q->xdp_flush |= FUN_XDP_FLUSH_TX;
index ff6e292372535eb145e7f9bf3c73750d961b5fa6..2f6698b98b0344e939250fc6a0d2477499b5afc0 100644 (file)
@@ -466,7 +466,7 @@ static unsigned int fun_xdpq_clean(struct funeth_txq *q, unsigned int budget)
 
                do {
                        fun_xdp_unmap(q, reclaim_idx);
-                       page_frag_free(q->info[reclaim_idx].vaddr);
+                       xdp_return_frame(q->info[reclaim_idx].xdpf);
 
                        trace_funeth_tx_free(q, reclaim_idx, 1, head);
 
@@ -479,11 +479,11 @@ static unsigned int fun_xdpq_clean(struct funeth_txq *q, unsigned int budget)
        return npkts;
 }
 
-bool fun_xdp_tx(struct funeth_txq *q, void *data, unsigned int len)
+bool fun_xdp_tx(struct funeth_txq *q, struct xdp_frame *xdpf)
 {
        struct fun_eth_tx_req *req;
        struct fun_dataop_gl *gle;
-       unsigned int idx;
+       unsigned int idx, len;
        dma_addr_t dma;
 
        if (fun_txq_avail(q) < FUN_XDP_CLEAN_THRES)
@@ -494,7 +494,8 @@ bool fun_xdp_tx(struct funeth_txq *q, void *data, unsigned int len)
                return false;
        }
 
-       dma = dma_map_single(q->dma_dev, data, len, DMA_TO_DEVICE);
+       len = xdpf->len;
+       dma = dma_map_single(q->dma_dev, xdpf->data, len, DMA_TO_DEVICE);
        if (unlikely(dma_mapping_error(q->dma_dev, dma))) {
                FUN_QSTAT_INC(q, tx_map_err);
                return false;
@@ -514,7 +515,7 @@ bool fun_xdp_tx(struct funeth_txq *q, void *data, unsigned int len)
        gle = (struct fun_dataop_gl *)req->dataop.imm;
        fun_dataop_gl_init(gle, 0, 0, len, dma);
 
-       q->info[idx].vaddr = data;
+       q->info[idx].xdpf = xdpf;
 
        u64_stats_update_begin(&q->syncp);
        q->stats.tx_bytes += len;
@@ -545,12 +546,9 @@ int fun_xdp_xmit_frames(struct net_device *dev, int n,
        if (unlikely(q_idx >= fp->num_xdpqs))
                return -ENXIO;
 
-       for (q = xdpqs[q_idx], i = 0; i < n; i++) {
-               const struct xdp_frame *xdpf = frames[i];
-
-               if (!fun_xdp_tx(q, xdpf->data, xdpf->len))
+       for (q = xdpqs[q_idx], i = 0; i < n; i++)
+               if (!fun_xdp_tx(q, frames[i]))
                        break;
-       }
 
        if (unlikely(flags & XDP_XMIT_FLUSH))
                fun_txq_wr_db(q);
@@ -577,7 +575,7 @@ static void fun_xdpq_purge(struct funeth_txq *q)
                unsigned int idx = q->cons_cnt & q->mask;
 
                fun_xdp_unmap(q, idx);
-               page_frag_free(q->info[idx].vaddr);
+               xdp_return_frame(q->info[idx].xdpf);
                q->cons_cnt++;
        }
 }
index 04c9f91b7489bf6f9d13fb1ff527e2f689b4d104..8708e2895946ddc68c92529ec6089e14c9b7d88c 100644 (file)
@@ -95,8 +95,8 @@ struct funeth_txq_stats {  /* per Tx queue SW counters */
 
 struct funeth_tx_info {      /* per Tx descriptor state */
        union {
-               struct sk_buff *skb; /* associated packet */
-               void *vaddr;         /* start address for XDP */
+               struct sk_buff *skb;    /* associated packet (sk_buff path) */
+               struct xdp_frame *xdpf; /* associated XDP frame (XDP path) */
        };
 };
 
@@ -245,7 +245,7 @@ static inline int fun_irq_node(const struct fun_irq *p)
 int fun_rxq_napi_poll(struct napi_struct *napi, int budget);
 int fun_txq_napi_poll(struct napi_struct *napi, int budget);
 netdev_tx_t fun_start_xmit(struct sk_buff *skb, struct net_device *netdev);
-bool fun_xdp_tx(struct funeth_txq *q, void *data, unsigned int len);
+bool fun_xdp_tx(struct funeth_txq *q, struct xdp_frame *xdpf);
 int fun_xdp_xmit_frames(struct net_device *dev, int n,
                        struct xdp_frame **frames, u32 flags);
 
index 7f1a0d90dc51eabbfef366527bdea7cfb70245f5..685556e968f2065d721627556955a98c184150cc 100644 (file)
@@ -1925,11 +1925,15 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
                 * non-zero req_queue_pairs says that user requested a new
                 * queue count via ethtool's set_channels, so use this
                 * value for queues distribution across traffic classes
+                * We need at least one queue pair for the interface
+                * to be usable as we see in else statement.
                 */
                if (vsi->req_queue_pairs > 0)
                        vsi->num_queue_pairs = vsi->req_queue_pairs;
                else if (pf->flags & I40E_FLAG_MSIX_ENABLED)
                        vsi->num_queue_pairs = pf->num_lan_msix;
+               else
+                       vsi->num_queue_pairs = 1;
        }
 
        /* Number of queues per enabled TC */
index 70335f6e85243bcc88d3f421b8149d9a56cd752a..4efa5e5846e01385811a978d9e0c2d0ed45af081 100644 (file)
@@ -658,7 +658,8 @@ static int ice_lbtest_receive_frames(struct ice_rx_ring *rx_ring)
                rx_desc = ICE_RX_DESC(rx_ring, i);
 
                if (!(rx_desc->wb.status_error0 &
-                   cpu_to_le16(ICE_TX_DESC_CMD_EOP | ICE_TX_DESC_CMD_RS)))
+                   (cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_DD_S)) |
+                    cpu_to_le16(BIT(ICE_RX_FLEX_DESC_STATUS0_EOF_S)))))
                        continue;
 
                rx_buf = &rx_ring->rx_buf[i];
index ff2eac2f8c64423eafff3dff46e9e8ce7e37366e..9f02b60459f10d93f0a8ca442b3d4ce2616bb171 100644 (file)
@@ -4656,6 +4656,8 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
                ice_set_safe_mode_caps(hw);
        }
 
+       hw->ucast_shared = true;
+
        err = ice_init_pf(pf);
        if (err) {
                dev_err(dev, "ice_init_pf failed: %d\n", err);
@@ -6011,10 +6013,12 @@ int ice_vsi_cfg(struct ice_vsi *vsi)
        if (vsi->netdev) {
                ice_set_rx_mode(vsi->netdev);
 
-               err = ice_vsi_vlan_setup(vsi);
+               if (vsi->type != ICE_VSI_LB) {
+                       err = ice_vsi_vlan_setup(vsi);
 
-               if (err)
-                       return err;
+                       if (err)
+                               return err;
+               }
        }
        ice_vsi_cfg_dcb_rings(vsi);
 
index bb1721f1321db85a0ced65ed5d9e0770c4138dfe..f4907a3c2d193c6fd9b83fc0b19828aca651bc8e 100644 (file)
@@ -1309,39 +1309,6 @@ out_put_vf:
        return ret;
 }
 
-/**
- * ice_unicast_mac_exists - check if the unicast MAC exists on the PF's switch
- * @pf: PF used to reference the switch's rules
- * @umac: unicast MAC to compare against existing switch rules
- *
- * Return true on the first/any match, else return false
- */
-static bool ice_unicast_mac_exists(struct ice_pf *pf, u8 *umac)
-{
-       struct ice_sw_recipe *mac_recipe_list =
-               &pf->hw.switch_info->recp_list[ICE_SW_LKUP_MAC];
-       struct ice_fltr_mgmt_list_entry *list_itr;
-       struct list_head *rule_head;
-       struct mutex *rule_lock; /* protect MAC filter list access */
-
-       rule_head = &mac_recipe_list->filt_rules;
-       rule_lock = &mac_recipe_list->filt_rule_lock;
-
-       mutex_lock(rule_lock);
-       list_for_each_entry(list_itr, rule_head, list_entry) {
-               u8 *existing_mac = &list_itr->fltr_info.l_data.mac.mac_addr[0];
-
-               if (ether_addr_equal(existing_mac, umac)) {
-                       mutex_unlock(rule_lock);
-                       return true;
-               }
-       }
-
-       mutex_unlock(rule_lock);
-
-       return false;
-}
-
 /**
  * ice_set_vf_mac
  * @netdev: network interface device structure
@@ -1376,13 +1343,6 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
        if (ret)
                goto out_put_vf;
 
-       if (ice_unicast_mac_exists(pf, mac)) {
-               netdev_err(netdev, "Unicast MAC %pM already exists on this PF. Preventing setting VF %u unicast MAC address to %pM\n",
-                          mac, vf_id, mac);
-               ret = -EINVAL;
-               goto out_put_vf;
-       }
-
        mutex_lock(&vf->cfg_lock);
 
        /* VF is notified of its new MAC via the PF's response to the
index 3f8b7274ed2f10b38da451449a01066d81a164ee..836dce8407124f2f200f36fab42412f80009469e 100644 (file)
@@ -1751,11 +1751,13 @@ int ice_tx_csum(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
 
        protocol = vlan_get_protocol(skb);
 
-       if (eth_p_mpls(protocol))
+       if (eth_p_mpls(protocol)) {
                ip.hdr = skb_inner_network_header(skb);
-       else
+               l4.hdr = skb_checksum_start(skb);
+       } else {
                ip.hdr = skb_network_header(skb);
-       l4.hdr = skb_checksum_start(skb);
+               l4.hdr = skb_transport_header(skb);
+       }
 
        /* compute outer L2 header size */
        l2_len = ip.hdr - skb->data;
index 4547bc1f7cee7e8d70dac936e1296f0a5e603c89..24188ec594d5aaa568ff9e9a6655cbfd9b0b0e35 100644 (file)
@@ -2948,7 +2948,8 @@ ice_vc_validate_add_vlan_filter_list(struct ice_vsi *vsi,
                                     struct virtchnl_vlan_filtering_caps *vfc,
                                     struct virtchnl_vlan_filter_list_v2 *vfl)
 {
-       u16 num_requested_filters = vsi->num_vlan + vfl->num_elements;
+       u16 num_requested_filters = ice_vsi_num_non_zero_vlans(vsi) +
+               vfl->num_elements;
 
        if (num_requested_filters > vfc->max_filters)
                return false;
index 28b19945d716cf56c863404dc61342777e057d33..e64318c110fdd4d3b14e6bbac236f53f4d7a47d8 100644 (file)
@@ -28,6 +28,9 @@
 #define MAX_RATE_EXPONENT              0x0FULL
 #define MAX_RATE_MANTISSA              0xFFULL
 
+#define CN10K_MAX_BURST_MANTISSA       0x7FFFULL
+#define CN10K_MAX_BURST_SIZE           8453888ULL
+
 /* Bitfields in NIX_TLX_PIR register */
 #define TLX_RATE_MANTISSA              GENMASK_ULL(8, 1)
 #define TLX_RATE_EXPONENT              GENMASK_ULL(12, 9)
@@ -35,6 +38,9 @@
 #define TLX_BURST_MANTISSA             GENMASK_ULL(36, 29)
 #define TLX_BURST_EXPONENT             GENMASK_ULL(40, 37)
 
+#define CN10K_TLX_BURST_MANTISSA       GENMASK_ULL(43, 29)
+#define CN10K_TLX_BURST_EXPONENT       GENMASK_ULL(47, 44)
+
 struct otx2_tc_flow_stats {
        u64 bytes;
        u64 pkts;
@@ -77,33 +83,42 @@ int otx2_tc_alloc_ent_bitmap(struct otx2_nic *nic)
 }
 EXPORT_SYMBOL(otx2_tc_alloc_ent_bitmap);
 
-static void otx2_get_egress_burst_cfg(u32 burst, u32 *burst_exp,
-                                     u32 *burst_mantissa)
+static void otx2_get_egress_burst_cfg(struct otx2_nic *nic, u32 burst,
+                                     u32 *burst_exp, u32 *burst_mantissa)
 {
+       int max_burst, max_mantissa;
        unsigned int tmp;
 
+       if (is_dev_otx2(nic->pdev)) {
+               max_burst = MAX_BURST_SIZE;
+               max_mantissa = MAX_BURST_MANTISSA;
+       } else {
+               max_burst = CN10K_MAX_BURST_SIZE;
+               max_mantissa = CN10K_MAX_BURST_MANTISSA;
+       }
+
        /* Burst is calculated as
         * ((256 + BURST_MANTISSA) << (1 + BURST_EXPONENT)) / 256
         * Max supported burst size is 130,816 bytes.
         */
-       burst = min_t(u32, burst, MAX_BURST_SIZE);
+       burst = min_t(u32, burst, max_burst);
        if (burst) {
                *burst_exp = ilog2(burst) ? ilog2(burst) - 1 : 0;
                tmp = burst - rounddown_pow_of_two(burst);
-               if (burst < MAX_BURST_MANTISSA)
+               if (burst < max_mantissa)
                        *burst_mantissa = tmp * 2;
                else
                        *burst_mantissa = tmp / (1ULL << (*burst_exp - 7));
        } else {
                *burst_exp = MAX_BURST_EXPONENT;
-               *burst_mantissa = MAX_BURST_MANTISSA;
+               *burst_mantissa = max_mantissa;
        }
 }
 
-static void otx2_get_egress_rate_cfg(u32 maxrate, u32 *exp,
+static void otx2_get_egress_rate_cfg(u64 maxrate, u32 *exp,
                                     u32 *mantissa, u32 *div_exp)
 {
-       unsigned int tmp;
+       u64 tmp;
 
        /* Rate calculation by hardware
         *
@@ -132,21 +147,44 @@ static void otx2_get_egress_rate_cfg(u32 maxrate, u32 *exp,
        }
 }
 
-static int otx2_set_matchall_egress_rate(struct otx2_nic *nic, u32 burst, u32 maxrate)
+static u64 otx2_get_txschq_rate_regval(struct otx2_nic *nic,
+                                      u64 maxrate, u32 burst)
 {
-       struct otx2_hw *hw = &nic->hw;
-       struct nix_txschq_config *req;
        u32 burst_exp, burst_mantissa;
        u32 exp, mantissa, div_exp;
+       u64 regval = 0;
+
+       /* Get exponent and mantissa values from the desired rate */
+       otx2_get_egress_burst_cfg(nic, burst, &burst_exp, &burst_mantissa);
+       otx2_get_egress_rate_cfg(maxrate, &exp, &mantissa, &div_exp);
+
+       if (is_dev_otx2(nic->pdev)) {
+               regval = FIELD_PREP(TLX_BURST_EXPONENT, (u64)burst_exp) |
+                               FIELD_PREP(TLX_BURST_MANTISSA, (u64)burst_mantissa) |
+                               FIELD_PREP(TLX_RATE_DIVIDER_EXPONENT, div_exp) |
+                               FIELD_PREP(TLX_RATE_EXPONENT, exp) |
+                               FIELD_PREP(TLX_RATE_MANTISSA, mantissa) | BIT_ULL(0);
+       } else {
+               regval = FIELD_PREP(CN10K_TLX_BURST_EXPONENT, (u64)burst_exp) |
+                               FIELD_PREP(CN10K_TLX_BURST_MANTISSA, (u64)burst_mantissa) |
+                               FIELD_PREP(TLX_RATE_DIVIDER_EXPONENT, div_exp) |
+                               FIELD_PREP(TLX_RATE_EXPONENT, exp) |
+                               FIELD_PREP(TLX_RATE_MANTISSA, mantissa) | BIT_ULL(0);
+       }
+
+       return regval;
+}
+
+static int otx2_set_matchall_egress_rate(struct otx2_nic *nic,
+                                        u32 burst, u64 maxrate)
+{
+       struct otx2_hw *hw = &nic->hw;
+       struct nix_txschq_config *req;
        int txschq, err;
 
        /* All SQs share the same TL4, so pick the first scheduler */
        txschq = hw->txschq_list[NIX_TXSCH_LVL_TL4][0];
 
-       /* Get exponent and mantissa values from the desired rate */
-       otx2_get_egress_burst_cfg(burst, &burst_exp, &burst_mantissa);
-       otx2_get_egress_rate_cfg(maxrate, &exp, &mantissa, &div_exp);
-
        mutex_lock(&nic->mbox.lock);
        req = otx2_mbox_alloc_msg_nix_txschq_cfg(&nic->mbox);
        if (!req) {
@@ -157,11 +195,7 @@ static int otx2_set_matchall_egress_rate(struct otx2_nic *nic, u32 burst, u32 ma
        req->lvl = NIX_TXSCH_LVL_TL4;
        req->num_regs = 1;
        req->reg[0] = NIX_AF_TL4X_PIR(txschq);
-       req->regval[0] = FIELD_PREP(TLX_BURST_EXPONENT, burst_exp) |
-                        FIELD_PREP(TLX_BURST_MANTISSA, burst_mantissa) |
-                        FIELD_PREP(TLX_RATE_DIVIDER_EXPONENT, div_exp) |
-                        FIELD_PREP(TLX_RATE_EXPONENT, exp) |
-                        FIELD_PREP(TLX_RATE_MANTISSA, mantissa) | BIT_ULL(0);
+       req->regval[0] = otx2_get_txschq_rate_regval(nic, maxrate, burst);
 
        err = otx2_sync_mbox_msg(&nic->mbox);
        mutex_unlock(&nic->mbox.lock);
@@ -230,7 +264,7 @@ static int otx2_tc_egress_matchall_install(struct otx2_nic *nic,
        struct netlink_ext_ack *extack = cls->common.extack;
        struct flow_action *actions = &cls->rule->action;
        struct flow_action_entry *entry;
-       u32 rate;
+       u64 rate;
        int err;
 
        err = otx2_tc_validate_flow(nic, actions, extack);
@@ -256,7 +290,7 @@ static int otx2_tc_egress_matchall_install(struct otx2_nic *nic,
                }
                /* Convert bytes per second to Mbps */
                rate = entry->police.rate_bytes_ps * 8;
-               rate = max_t(u32, rate / 1000000, 1);
+               rate = max_t(u64, rate / 1000000, 1);
                err = otx2_set_matchall_egress_rate(nic, entry->police.burst, rate);
                if (err)
                        return err;
@@ -614,21 +648,27 @@ static int otx2_tc_prepare_flow(struct otx2_nic *nic, struct otx2_tc_flow *node,
 
                flow_spec->dport = match.key->dst;
                flow_mask->dport = match.mask->dst;
-               if (ip_proto == IPPROTO_UDP)
-                       req->features |= BIT_ULL(NPC_DPORT_UDP);
-               else if (ip_proto == IPPROTO_TCP)
-                       req->features |= BIT_ULL(NPC_DPORT_TCP);
-               else if (ip_proto == IPPROTO_SCTP)
-                       req->features |= BIT_ULL(NPC_DPORT_SCTP);
+
+               if (flow_mask->dport) {
+                       if (ip_proto == IPPROTO_UDP)
+                               req->features |= BIT_ULL(NPC_DPORT_UDP);
+                       else if (ip_proto == IPPROTO_TCP)
+                               req->features |= BIT_ULL(NPC_DPORT_TCP);
+                       else if (ip_proto == IPPROTO_SCTP)
+                               req->features |= BIT_ULL(NPC_DPORT_SCTP);
+               }
 
                flow_spec->sport = match.key->src;
                flow_mask->sport = match.mask->src;
-               if (ip_proto == IPPROTO_UDP)
-                       req->features |= BIT_ULL(NPC_SPORT_UDP);
-               else if (ip_proto == IPPROTO_TCP)
-                       req->features |= BIT_ULL(NPC_SPORT_TCP);
-               else if (ip_proto == IPPROTO_SCTP)
-                       req->features |= BIT_ULL(NPC_SPORT_SCTP);
+
+               if (flow_mask->sport) {
+                       if (ip_proto == IPPROTO_UDP)
+                               req->features |= BIT_ULL(NPC_SPORT_UDP);
+                       else if (ip_proto == IPPROTO_TCP)
+                               req->features |= BIT_ULL(NPC_SPORT_TCP);
+                       else if (ip_proto == IPPROTO_SCTP)
+                               req->features |= BIT_ULL(NPC_SPORT_SCTP);
+               }
        }
 
        return otx2_tc_parse_actions(nic, &rule->action, req, f, node);
index e31f8fbbc696d71bd1fb745e975b2402e3a96d6f..df2ab5cbd49bd1ffabb8a464462700bdf8b1d3fe 100644 (file)
@@ -4233,7 +4233,7 @@ static void nfp_bpf_opt_ldst_gather(struct nfp_prog *nfp_prog)
                        }
 
                        /* If the chain is ended by an load/store pair then this
-                        * could serve as the new head of the the next chain.
+                        * could serve as the new head of the next chain.
                         */
                        if (curr_pair_is_memcpy(meta1, meta2)) {
                                head_ld_meta = meta1;
index 4625f85acab2ea9b2016a89a0ca146dab13a52bb..10ad0b93d283b01a98d3dca215023d334d257ee3 100644 (file)
@@ -1100,7 +1100,29 @@ static void efx_ptp_xmit_skb_queue(struct efx_nic *efx, struct sk_buff *skb)
 
        tx_queue = efx_channel_get_tx_queue(ptp_data->channel, type);
        if (tx_queue && tx_queue->timestamping) {
+               /* This code invokes normal driver TX code which is always
+                * protected from softirqs when called from generic TX code,
+                * which in turn disables preemption. Look at __dev_queue_xmit
+                * which uses rcu_read_lock_bh disabling preemption for RCU
+                * plus disabling softirqs. We do not need RCU reader
+                * protection here.
+                *
+                * Although it is theoretically safe for current PTP TX/RX code
+                * running without disabling softirqs, there are three good
+                * reasond for doing so:
+                *
+                *      1) The code invoked is mainly implemented for non-PTP
+                *         packets and it is always executed with softirqs
+                *         disabled.
+                *      2) This being a single PTP packet, better to not
+                *         interrupt its processing by softirqs which can lead
+                *         to high latencies.
+                *      3) netdev_xmit_more checks preemption is disabled and
+                *         triggers a BUG_ON if not.
+                */
+               local_bh_disable();
                efx_enqueue_skb(tx_queue, skb);
+               local_bh_enable();
        } else {
                WARN_ONCE(1, "PTP channel has no timestamped tx queue\n");
                dev_kfree_skb_any(skb);
index ca8ab290013ce3fd79b9251fedc8f9a59b8d8381..d42e1afb65213419ada4168f1c227a1d7c815c23 100644 (file)
@@ -688,18 +688,19 @@ static int mediatek_dwmac_probe(struct platform_device *pdev)
 
        ret = mediatek_dwmac_clks_config(priv_plat, true);
        if (ret)
-               return ret;
+               goto err_remove_config_dt;
 
        ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
-       if (ret) {
-               stmmac_remove_config_dt(pdev, plat_dat);
+       if (ret)
                goto err_drv_probe;
-       }
 
        return 0;
 
 err_drv_probe:
        mediatek_dwmac_clks_config(priv_plat, false);
+err_remove_config_dt:
+       stmmac_remove_config_dt(pdev, plat_dat);
+
        return ret;
 }
 
index 3233d145fd87c31cf6ba8e13a220b150ac8578e7..495e85abe50bdb8a0e5b7f7dd3fc022449b73469 100644 (file)
@@ -214,7 +214,7 @@ struct ipa_init_modem_driver_req {
 
 /* The response to a IPA_QMI_INIT_DRIVER request begins with a standard
  * QMI response, but contains other information as well.  Currently we
- * simply wait for the the INIT_DRIVER transaction to complete and
+ * simply wait for the INIT_DRIVER transaction to complete and
  * ignore any other data that might be returned.
  */
 struct ipa_init_modem_driver_rsp {
index 817577e713d709fb2961b3bdf195879234d08183..f354fad05714ad2c380c8f4fe8140752774ea845 100644 (file)
@@ -243,6 +243,7 @@ static struct macsec_cb *macsec_skb_cb(struct sk_buff *skb)
 #define DEFAULT_SEND_SCI true
 #define DEFAULT_ENCRYPT false
 #define DEFAULT_ENCODING_SA 0
+#define MACSEC_XPN_MAX_REPLAY_WINDOW (((1 << 30) - 1))
 
 static bool send_sci(const struct macsec_secy *secy)
 {
@@ -1697,7 +1698,7 @@ static bool validate_add_rxsa(struct nlattr **attrs)
                return false;
 
        if (attrs[MACSEC_SA_ATTR_PN] &&
-           *(u64 *)nla_data(attrs[MACSEC_SA_ATTR_PN]) == 0)
+           nla_get_u64(attrs[MACSEC_SA_ATTR_PN]) == 0)
                return false;
 
        if (attrs[MACSEC_SA_ATTR_ACTIVE]) {
@@ -1753,7 +1754,8 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
        }
 
        pn_len = secy->xpn ? MACSEC_XPN_PN_LEN : MACSEC_DEFAULT_PN_LEN;
-       if (nla_len(tb_sa[MACSEC_SA_ATTR_PN]) != pn_len) {
+       if (tb_sa[MACSEC_SA_ATTR_PN] &&
+           nla_len(tb_sa[MACSEC_SA_ATTR_PN]) != pn_len) {
                pr_notice("macsec: nl: add_rxsa: bad pn length: %d != %d\n",
                          nla_len(tb_sa[MACSEC_SA_ATTR_PN]), pn_len);
                rtnl_unlock();
@@ -1769,7 +1771,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
                if (nla_len(tb_sa[MACSEC_SA_ATTR_SALT]) != MACSEC_SALT_LEN) {
                        pr_notice("macsec: nl: add_rxsa: bad salt length: %d != %d\n",
                                  nla_len(tb_sa[MACSEC_SA_ATTR_SALT]),
-                                 MACSEC_SA_ATTR_SALT);
+                                 MACSEC_SALT_LEN);
                        rtnl_unlock();
                        return -EINVAL;
                }
@@ -1842,7 +1844,7 @@ static int macsec_add_rxsa(struct sk_buff *skb, struct genl_info *info)
        return 0;
 
 cleanup:
-       kfree(rx_sa);
+       macsec_rxsa_put(rx_sa);
        rtnl_unlock();
        return err;
 }
@@ -1939,7 +1941,7 @@ static bool validate_add_txsa(struct nlattr **attrs)
        if (nla_get_u8(attrs[MACSEC_SA_ATTR_AN]) >= MACSEC_NUM_AN)
                return false;
 
-       if (nla_get_u32(attrs[MACSEC_SA_ATTR_PN]) == 0)
+       if (nla_get_u64(attrs[MACSEC_SA_ATTR_PN]) == 0)
                return false;
 
        if (attrs[MACSEC_SA_ATTR_ACTIVE]) {
@@ -2011,7 +2013,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info)
                if (nla_len(tb_sa[MACSEC_SA_ATTR_SALT]) != MACSEC_SALT_LEN) {
                        pr_notice("macsec: nl: add_txsa: bad salt length: %d != %d\n",
                                  nla_len(tb_sa[MACSEC_SA_ATTR_SALT]),
-                                 MACSEC_SA_ATTR_SALT);
+                                 MACSEC_SALT_LEN);
                        rtnl_unlock();
                        return -EINVAL;
                }
@@ -2085,7 +2087,7 @@ static int macsec_add_txsa(struct sk_buff *skb, struct genl_info *info)
 
 cleanup:
        secy->operational = was_operational;
-       kfree(tx_sa);
+       macsec_txsa_put(tx_sa);
        rtnl_unlock();
        return err;
 }
@@ -2293,7 +2295,7 @@ static bool validate_upd_sa(struct nlattr **attrs)
        if (nla_get_u8(attrs[MACSEC_SA_ATTR_AN]) >= MACSEC_NUM_AN)
                return false;
 
-       if (attrs[MACSEC_SA_ATTR_PN] && nla_get_u32(attrs[MACSEC_SA_ATTR_PN]) == 0)
+       if (attrs[MACSEC_SA_ATTR_PN] && nla_get_u64(attrs[MACSEC_SA_ATTR_PN]) == 0)
                return false;
 
        if (attrs[MACSEC_SA_ATTR_ACTIVE]) {
@@ -3745,9 +3747,6 @@ static int macsec_changelink_common(struct net_device *dev,
                secy->operational = tx_sa && tx_sa->active;
        }
 
-       if (data[IFLA_MACSEC_WINDOW])
-               secy->replay_window = nla_get_u32(data[IFLA_MACSEC_WINDOW]);
-
        if (data[IFLA_MACSEC_ENCRYPT])
                tx_sc->encrypt = !!nla_get_u8(data[IFLA_MACSEC_ENCRYPT]);
 
@@ -3793,6 +3792,16 @@ static int macsec_changelink_common(struct net_device *dev,
                }
        }
 
+       if (data[IFLA_MACSEC_WINDOW]) {
+               secy->replay_window = nla_get_u32(data[IFLA_MACSEC_WINDOW]);
+
+               /* IEEE 802.1AEbw-2013 10.7.8 - maximum replay window
+                * for XPN cipher suites */
+               if (secy->xpn &&
+                   secy->replay_window > MACSEC_XPN_MAX_REPLAY_WINDOW)
+                       return -EINVAL;
+       }
+
        return 0;
 }
 
@@ -3822,7 +3831,7 @@ static int macsec_changelink(struct net_device *dev, struct nlattr *tb[],
 
        ret = macsec_changelink_common(dev, data);
        if (ret)
-               return ret;
+               goto cleanup;
 
        /* If h/w offloading is available, propagate to the device */
        if (macsec_is_offloaded(macsec)) {
index 4cfd05c15aeedfc73ea22d41403f4bd0b3993c10..d25fbb9caebab426cca29ef779b7c580b4db0e9b 100644 (file)
@@ -896,7 +896,7 @@ static int xpcs_get_state_c37_sgmii(struct dw_xpcs *xpcs,
         */
        ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_INTR_STS);
        if (ret < 0)
-               return false;
+               return ret;
 
        if (ret & DW_VR_MII_C37_ANSGM_SP_LNKSTS) {
                int speed_value;
index ff22b6b1c6861b8979f663cef5442307ae026304..36803d932dff47248ef92b9f10597c50010eb6f2 100644 (file)
@@ -450,6 +450,7 @@ static int bcm5421_init(struct mii_phy* phy)
                int can_low_power = 1;
                if (np == NULL || of_get_property(np, "no-autolowpower", NULL))
                        can_low_power = 0;
+               of_node_put(np);
                if (can_low_power) {
                        /* Enable automatic low-power */
                        sungem_phy_write(phy, 0x1c, 0x9002);
index 356cf8dd4164b94f3183aeab1f19b0a2335dbd74..ec8e1b3108c3a8ba59a004c842ef91ea10eb8d44 100644 (file)
@@ -242,9 +242,15 @@ struct virtnet_info {
        /* Packet virtio header size */
        u8 hdr_len;
 
-       /* Work struct for refilling if we run low on memory. */
+       /* Work struct for delayed refilling if we run low on memory. */
        struct delayed_work refill;
 
+       /* Is delayed refill enabled? */
+       bool refill_enabled;
+
+       /* The lock to synchronize the access to refill_enabled */
+       spinlock_t refill_lock;
+
        /* Work struct for config space updates */
        struct work_struct config_work;
 
@@ -348,6 +354,20 @@ static struct page *get_a_page(struct receive_queue *rq, gfp_t gfp_mask)
        return p;
 }
 
+static void enable_delayed_refill(struct virtnet_info *vi)
+{
+       spin_lock_bh(&vi->refill_lock);
+       vi->refill_enabled = true;
+       spin_unlock_bh(&vi->refill_lock);
+}
+
+static void disable_delayed_refill(struct virtnet_info *vi)
+{
+       spin_lock_bh(&vi->refill_lock);
+       vi->refill_enabled = false;
+       spin_unlock_bh(&vi->refill_lock);
+}
+
 static void virtqueue_napi_schedule(struct napi_struct *napi,
                                    struct virtqueue *vq)
 {
@@ -1527,8 +1547,12 @@ static int virtnet_receive(struct receive_queue *rq, int budget,
        }
 
        if (rq->vq->num_free > min((unsigned int)budget, virtqueue_get_vring_size(rq->vq)) / 2) {
-               if (!try_fill_recv(vi, rq, GFP_ATOMIC))
-                       schedule_delayed_work(&vi->refill, 0);
+               if (!try_fill_recv(vi, rq, GFP_ATOMIC)) {
+                       spin_lock(&vi->refill_lock);
+                       if (vi->refill_enabled)
+                               schedule_delayed_work(&vi->refill, 0);
+                       spin_unlock(&vi->refill_lock);
+               }
        }
 
        u64_stats_update_begin(&rq->stats.syncp);
@@ -1651,6 +1675,8 @@ static int virtnet_open(struct net_device *dev)
        struct virtnet_info *vi = netdev_priv(dev);
        int i, err;
 
+       enable_delayed_refill(vi);
+
        for (i = 0; i < vi->max_queue_pairs; i++) {
                if (i < vi->curr_queue_pairs)
                        /* Make sure we have some buffers: if oom use wq. */
@@ -2033,6 +2059,8 @@ static int virtnet_close(struct net_device *dev)
        struct virtnet_info *vi = netdev_priv(dev);
        int i;
 
+       /* Make sure NAPI doesn't schedule refill work */
+       disable_delayed_refill(vi);
        /* Make sure refill_work doesn't re-enable napi! */
        cancel_delayed_work_sync(&vi->refill);
 
@@ -2792,6 +2820,8 @@ static int virtnet_restore_up(struct virtio_device *vdev)
 
        virtio_device_ready(vdev);
 
+       enable_delayed_refill(vi);
+
        if (netif_running(vi->dev)) {
                err = virtnet_open(vi->dev);
                if (err)
@@ -3535,6 +3565,7 @@ static int virtnet_probe(struct virtio_device *vdev)
        vdev->priv = vi;
 
        INIT_WORK(&vi->config_work, virtnet_config_changed_work);
+       spin_lock_init(&vi->refill_lock);
 
        /* If we can receive ANY GSO packets, we must allocate large ones. */
        if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) ||
index 58c72d55769a1fc52b2033d567ea96a51454b638..73d9fcba3b1c080a0a7e5f81c7f6059f1918b882 100644 (file)
@@ -3515,6 +3515,8 @@ static const struct pci_device_id nvme_id_table[] = {
                .driver_data = NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(0x1e49, 0x0041),   /* ZHITAI TiPro7000 NVMe SSD */
                .driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
+       { PCI_DEVICE(0xc0a9, 0x540a),   /* Crucial P2 */
+               .driver_data = NVME_QUIRK_BOGUS_NID, },
        { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061),
                .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, },
        { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
index 8d374cc552be5f2805855d0953b27f81cba7156e..f2e58ddfaed250ebd38589311dee9335e838a0b0 100644 (file)
@@ -9,6 +9,7 @@
  *  Copyright (C) 2016  IBM Corporation
  */
 
+#include <linux/ima.h>
 #include <linux/kernel.h>
 #include <linux/kexec.h>
 #include <linux/memblock.h>
@@ -115,6 +116,7 @@ static int do_get_kexec_buffer(const void *prop, int len, unsigned long *addr,
        return 0;
 }
 
+#ifdef CONFIG_HAVE_IMA_KEXEC
 /**
  * ima_get_kexec_buffer - get IMA buffer from the previous kernel
  * @addr:      On successful return, set to point to the buffer contents.
@@ -122,16 +124,13 @@ static int do_get_kexec_buffer(const void *prop, int len, unsigned long *addr,
  *
  * Return: 0 on success, negative errno on error.
  */
-int ima_get_kexec_buffer(void **addr, size_t *size)
+int __init ima_get_kexec_buffer(void **addr, size_t *size)
 {
        int ret, len;
        unsigned long tmp_addr;
        size_t tmp_size;
        const void *prop;
 
-       if (!IS_ENABLED(CONFIG_HAVE_IMA_KEXEC))
-               return -ENOTSUPP;
-
        prop = of_get_property(of_chosen, "linux,ima-kexec-buffer", &len);
        if (!prop)
                return -ENOENT;
@@ -149,16 +148,13 @@ int ima_get_kexec_buffer(void **addr, size_t *size)
 /**
  * ima_free_kexec_buffer - free memory used by the IMA buffer
  */
-int ima_free_kexec_buffer(void)
+int __init ima_free_kexec_buffer(void)
 {
        int ret;
        unsigned long addr;
        size_t size;
        struct property *prop;
 
-       if (!IS_ENABLED(CONFIG_HAVE_IMA_KEXEC))
-               return -ENOTSUPP;
-
        prop = of_find_property(of_chosen, "linux,ima-kexec-buffer", NULL);
        if (!prop)
                return -ENOENT;
@@ -173,6 +169,7 @@ int ima_free_kexec_buffer(void)
 
        return memblock_phys_free(addr, size);
 }
+#endif
 
 /**
  * remove_ima_buffer - remove the IMA buffer property and reservation from @fdt
index 8a3b0c3a1e92bdcfc50c664a7caea0f7818cd8d6..3a8c986156348465b5890317906ecb8dad4bcd5b 100644 (file)
@@ -677,7 +677,7 @@ static int iosapic_set_affinity_irq(struct irq_data *d,
        if (dest_cpu < 0)
                return -1;
 
-       cpumask_copy(irq_data_get_affinity_mask(d), cpumask_of(dest_cpu));
+       irq_data_update_affinity(d, cpumask_of(dest_cpu));
        vi->txn_addr = txn_affinity_addr(d->irq, dest_cpu);
 
        spin_lock_irqsave(&iosapic_lock, flags);
index db814f7b93baa1a9d84388858abb4a04f523561b..e7c6f6629e7c5edfb41f20d9187c6ab400143087 100644 (file)
@@ -642,7 +642,7 @@ static void hv_arch_irq_unmask(struct irq_data *data)
        struct hv_retarget_device_interrupt *params;
        struct tran_int_desc *int_desc;
        struct hv_pcibus_device *hbus;
-       struct cpumask *dest;
+       const struct cpumask *dest;
        cpumask_var_t tmp;
        struct pci_bus *pbus;
        struct pci_dev *pdev;
@@ -1613,7 +1613,7 @@ out:
 }
 
 static u32 hv_compose_msi_req_v1(
-       struct pci_create_interrupt *int_pkt, struct cpumask *affinity,
+       struct pci_create_interrupt *int_pkt, const struct cpumask *affinity,
        u32 slot, u8 vector, u8 vector_count)
 {
        int_pkt->message_type.type = PCI_CREATE_INTERRUPT_MESSAGE;
@@ -1635,13 +1635,13 @@ static u32 hv_compose_msi_req_v1(
  * Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten
  * by subsequent retarget in hv_irq_unmask().
  */
-static int hv_compose_msi_req_get_cpu(struct cpumask *affinity)
+static int hv_compose_msi_req_get_cpu(const struct cpumask *affinity)
 {
        return cpumask_first_and(affinity, cpu_online_mask);
 }
 
 static u32 hv_compose_msi_req_v2(
-       struct pci_create_interrupt2 *int_pkt, struct cpumask *affinity,
+       struct pci_create_interrupt2 *int_pkt, const struct cpumask *affinity,
        u32 slot, u8 vector, u8 vector_count)
 {
        int cpu;
@@ -1660,7 +1660,7 @@ static u32 hv_compose_msi_req_v2(
 }
 
 static u32 hv_compose_msi_req_v3(
-       struct pci_create_interrupt3 *int_pkt, struct cpumask *affinity,
+       struct pci_create_interrupt3 *int_pkt, const struct cpumask *affinity,
        u32 slot, u32 vector, u8 vector_count)
 {
        int cpu;
@@ -1697,7 +1697,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
        struct hv_pci_dev *hpdev;
        struct pci_bus *pbus;
        struct pci_dev *pdev;
-       struct cpumask *dest;
+       const struct cpumask *dest;
        struct compose_comp_ctxt comp;
        struct tran_int_desc *int_desc;
        struct msi_desc *msi_desc;
index 96e09fa4090954f98bb4493610c138ad81c70c60..03b1309875aeaf3921006c04a872c6d2280d3ab2 100644 (file)
@@ -1139,7 +1139,7 @@ static void cci_pmu_start(struct perf_event *event, int pmu_flags)
 
        /*
         * To handle interrupt latency, we always reprogram the period
-        * regardlesss of PERF_EF_RELOAD.
+        * regardless of PERF_EF_RELOAD.
         */
        if (pmu_flags & PERF_EF_RELOAD)
                WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE));
@@ -1261,7 +1261,7 @@ static int validate_group(struct perf_event *event)
                 */
                .used_mask = mask,
        };
-       memset(mask, 0, BITS_TO_LONGS(cci_pmu->num_cntrs) * sizeof(unsigned long));
+       bitmap_zero(mask, cci_pmu->num_cntrs);
 
        if (!validate_event(event->pmu, &fake_pmu, leader))
                return -EINVAL;
@@ -1629,10 +1629,9 @@ static struct cci_pmu *cci_pmu_alloc(struct device *dev)
                                             GFP_KERNEL);
        if (!cci_pmu->hw_events.events)
                return ERR_PTR(-ENOMEM);
-       cci_pmu->hw_events.used_mask = devm_kcalloc(dev,
-                                               BITS_TO_LONGS(CCI_PMU_MAX_HW_CNTRS(model)),
-                                               sizeof(*cci_pmu->hw_events.used_mask),
-                                               GFP_KERNEL);
+       cci_pmu->hw_events.used_mask = devm_bitmap_zalloc(dev,
+                                                         CCI_PMU_MAX_HW_CNTRS(model),
+                                                         GFP_KERNEL);
        if (!cci_pmu->hw_events.used_mask)
                return ERR_PTR(-ENOMEM);
 
index 40b352e8aa7f7eff89f6cfd437801364c500fa6b..728d13d8e98ac9114733ea7ce5745cd118bb626f 100644 (file)
@@ -1250,7 +1250,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
        ccn->dt.cmp_mask[CCN_IDX_MASK_OPCODE].h = ~(0x1f << 9);
 
        /* Get a convenient /sys/event_source/devices/ name */
-       ccn->dt.id = ida_simple_get(&arm_ccn_pmu_ida, 0, 0, GFP_KERNEL);
+       ccn->dt.id = ida_alloc(&arm_ccn_pmu_ida, GFP_KERNEL);
        if (ccn->dt.id == 0) {
                name = "ccn";
        } else {
@@ -1312,7 +1312,7 @@ error_pmu_register:
                                            &ccn->dt.node);
 error_set_affinity:
 error_choose_name:
-       ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id);
+       ida_free(&arm_ccn_pmu_ida, ccn->dt.id);
        for (i = 0; i < ccn->num_xps; i++)
                writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL);
        writel(0, ccn->dt.base + CCN_DT_PMCR);
@@ -1329,7 +1329,7 @@ static void arm_ccn_pmu_cleanup(struct arm_ccn *ccn)
                writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL);
        writel(0, ccn->dt.base + CCN_DT_PMCR);
        perf_pmu_unregister(&ccn->dt.pmu);
-       ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id);
+       ida_free(&arm_ccn_pmu_ida, ccn->dt.id);
 }
 
 static int arm_ccn_for_each_valid_region(struct arm_ccn *ccn,
index db670b26589717a4d06c27e7fc604eefd5b7ffe8..b65a7d9640e1549ea476418a52f0884748ea2550 100644 (file)
 #include <asm/mmu.h>
 #include <asm/sysreg.h>
 
+/*
+ * Cache if the event is allowed to trace Context information.
+ * This allows us to perform the check, i.e, perfmon_capable(),
+ * in the context of the event owner, once, during the event_init().
+ */
+#define SPE_PMU_HW_FLAGS_CX                    BIT(0)
+
+static void set_spe_event_has_cx(struct perf_event *event)
+{
+       if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && perfmon_capable())
+               event->hw.flags |= SPE_PMU_HW_FLAGS_CX;
+}
+
+static bool get_spe_event_has_cx(struct perf_event *event)
+{
+       return !!(event->hw.flags & SPE_PMU_HW_FLAGS_CX);
+}
+
 #define ARM_SPE_BUF_PAD_BYTE                   0
 
 struct arm_spe_pmu_buf {
@@ -272,7 +290,7 @@ static u64 arm_spe_event_to_pmscr(struct perf_event *event)
        if (!attr->exclude_kernel)
                reg |= BIT(SYS_PMSCR_EL1_E1SPE_SHIFT);
 
-       if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR) && perfmon_capable())
+       if (get_spe_event_has_cx(event))
                reg |= BIT(SYS_PMSCR_EL1_CX_SHIFT);
 
        return reg;
@@ -709,10 +727,10 @@ static int arm_spe_pmu_event_init(struct perf_event *event)
            !(spe_pmu->features & SPE_PMU_FEAT_FILT_LAT))
                return -EOPNOTSUPP;
 
+       set_spe_event_has_cx(event);
        reg = arm_spe_event_to_pmscr(event);
        if (!perfmon_capable() &&
            (reg & (BIT(SYS_PMSCR_EL1_PA_SHIFT) |
-                   BIT(SYS_PMSCR_EL1_CX_SHIFT) |
                    BIT(SYS_PMSCR_EL1_PCT_SHIFT))))
                return -EACCES;
 
index b1b2a55de77fc8c658f8e378ce21df435f1fa4be..8e058e08fe81072dde8093116456fafffd757186 100644 (file)
@@ -611,7 +611,7 @@ static int ddr_perf_init(struct ddr_pmu *pmu, void __iomem *base,
                .dev = dev,
        };
 
-       pmu->id = ida_simple_get(&ddr_ida, 0, 0, GFP_KERNEL);
+       pmu->id = ida_alloc(&ddr_ida, GFP_KERNEL);
        return pmu->id;
 }
 
@@ -765,7 +765,7 @@ ddr_perf_err:
 cpuhp_instance_err:
        cpuhp_remove_multi_state(pmu->cpuhp_state);
 cpuhp_state_err:
-       ida_simple_remove(&ddr_ida, pmu->id);
+       ida_free(&ddr_ida, pmu->id);
        dev_warn(&pdev->dev, "i.MX8 DDR Perf PMU failed (%d), disabled\n", ret);
        return ret;
 }
@@ -779,7 +779,7 @@ static int ddr_perf_remove(struct platform_device *pdev)
 
        perf_pmu_unregister(&pmu->pmu);
 
-       ida_simple_remove(&ddr_ida, pmu->id);
+       ida_free(&ddr_ida, pmu->id);
        return 0;
 }
 
index 5546218b5598db757df2ed02b0fadefce279b5b5..171bfc1b6bc27dc195c92e2ccc31665effce74c6 100644 (file)
@@ -14,3 +14,13 @@ config HISI_PCIE_PMU
          RCiEP devices.
          Adds the PCIe PMU into perf events system for monitoring latency,
          bandwidth etc.
+
+config HNS3_PMU
+       tristate "HNS3 PERF PMU"
+       depends on ARM64 || COMPILE_TEST
+       depends on PCI
+       help
+         Provide support for HNS3 performance monitoring unit (PMU) RCiEP
+         devices.
+         Adds the HNS3 PMU into perf events system for monitoring latency,
+         bandwidth etc.
index 6be83517acaa311c66f48ffb64c1c4b7ea7587ef..4d2c9abe3372fd579dd54ded10139ef04d188849 100644 (file)
@@ -4,3 +4,4 @@ obj-$(CONFIG_HISI_PMU) += hisi_uncore_pmu.o hisi_uncore_l3c_pmu.o \
                          hisi_uncore_pa_pmu.o hisi_uncore_cpa_pmu.o
 
 obj-$(CONFIG_HISI_PCIE_PMU) += hisi_pcie_pmu.o
+obj-$(CONFIG_HNS3_PMU) += hns3_pmu.o
index 62299ab5a9be983cef3adea603bfd7d0134c0417..50d0c0a2f1fe9ffa9ae2e0f2cc58d45b35ef1c25 100644 (file)
@@ -516,21 +516,7 @@ static int hisi_ddrc_pmu_probe(struct platform_device *pdev)
                                      "hisi_sccl%u_ddrc%u", ddrc_pmu->sccl_id,
                                      ddrc_pmu->index_id);
 
-       ddrc_pmu->pmu = (struct pmu) {
-               .name           = name,
-               .module         = THIS_MODULE,
-               .task_ctx_nr    = perf_invalid_context,
-               .event_init     = hisi_uncore_pmu_event_init,
-               .pmu_enable     = hisi_uncore_pmu_enable,
-               .pmu_disable    = hisi_uncore_pmu_disable,
-               .add            = hisi_uncore_pmu_add,
-               .del            = hisi_uncore_pmu_del,
-               .start          = hisi_uncore_pmu_start,
-               .stop           = hisi_uncore_pmu_stop,
-               .read           = hisi_uncore_pmu_read,
-               .attr_groups    = ddrc_pmu->pmu_events.attr_groups,
-               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
-       };
+       hisi_pmu_init(&ddrc_pmu->pmu, name, ddrc_pmu->pmu_events.attr_groups, THIS_MODULE);
 
        ret = perf_pmu_register(&ddrc_pmu->pmu, name, -1);
        if (ret) {
index 393513150106a38402b1ef09c2e70f9bb960eb20..13017b3412a5e7dcb1510126b60561be498f473c 100644 (file)
@@ -519,21 +519,7 @@ static int hisi_hha_pmu_probe(struct platform_device *pdev)
 
        name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_hha%u",
                              hha_pmu->sccl_id, hha_pmu->index_id);
-       hha_pmu->pmu = (struct pmu) {
-               .name           = name,
-               .module         = THIS_MODULE,
-               .task_ctx_nr    = perf_invalid_context,
-               .event_init     = hisi_uncore_pmu_event_init,
-               .pmu_enable     = hisi_uncore_pmu_enable,
-               .pmu_disable    = hisi_uncore_pmu_disable,
-               .add            = hisi_uncore_pmu_add,
-               .del            = hisi_uncore_pmu_del,
-               .start          = hisi_uncore_pmu_start,
-               .stop           = hisi_uncore_pmu_stop,
-               .read           = hisi_uncore_pmu_read,
-               .attr_groups    = hha_pmu->pmu_events.attr_groups,
-               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
-       };
+       hisi_pmu_init(&hha_pmu->pmu, name, hha_pmu->pmu_events.attr_groups, THIS_MODULE);
 
        ret = perf_pmu_register(&hha_pmu->pmu, name, -1);
        if (ret) {
index 560ab964c8b5967052788b8e9e9729691df57fe5..2995f3630d4968d431c0dbff92592f91a85c2b7f 100644 (file)
@@ -557,21 +557,7 @@ static int hisi_l3c_pmu_probe(struct platform_device *pdev)
         */
        name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hisi_sccl%u_l3c%u",
                              l3c_pmu->sccl_id, l3c_pmu->ccl_id);
-       l3c_pmu->pmu = (struct pmu) {
-               .name           = name,
-               .module         = THIS_MODULE,
-               .task_ctx_nr    = perf_invalid_context,
-               .event_init     = hisi_uncore_pmu_event_init,
-               .pmu_enable     = hisi_uncore_pmu_enable,
-               .pmu_disable    = hisi_uncore_pmu_disable,
-               .add            = hisi_uncore_pmu_add,
-               .del            = hisi_uncore_pmu_del,
-               .start          = hisi_uncore_pmu_start,
-               .stop           = hisi_uncore_pmu_stop,
-               .read           = hisi_uncore_pmu_read,
-               .attr_groups    = l3c_pmu->pmu_events.attr_groups,
-               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
-       };
+       hisi_pmu_init(&l3c_pmu->pmu, name, l3c_pmu->pmu_events.attr_groups, THIS_MODULE);
 
        ret = perf_pmu_register(&l3c_pmu->pmu, name, -1);
        if (ret) {
index a0ee84d97c41f99931db808a4bfcb658c538960f..47d3cc9b6eecde7842fba106604795194661e548 100644 (file)
@@ -412,21 +412,7 @@ static int hisi_pa_pmu_probe(struct platform_device *pdev)
                return ret;
        }
 
-       pa_pmu->pmu = (struct pmu) {
-               .module         = THIS_MODULE,
-               .task_ctx_nr    = perf_invalid_context,
-               .event_init     = hisi_uncore_pmu_event_init,
-               .pmu_enable     = hisi_uncore_pmu_enable,
-               .pmu_disable    = hisi_uncore_pmu_disable,
-               .add            = hisi_uncore_pmu_add,
-               .del            = hisi_uncore_pmu_del,
-               .start          = hisi_uncore_pmu_start,
-               .stop           = hisi_uncore_pmu_stop,
-               .read           = hisi_uncore_pmu_read,
-               .attr_groups    = pa_pmu->pmu_events.attr_groups,
-               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
-       };
-
+       hisi_pmu_init(&pa_pmu->pmu, name, pa_pmu->pmu_events.attr_groups, THIS_MODULE);
        ret = perf_pmu_register(&pa_pmu->pmu, name, -1);
        if (ret) {
                dev_err(pa_pmu->dev, "PMU register failed, ret = %d\n", ret);
index 980b9ee6eb149556d1fdee21171e47759346d2dc..fbc8a93d5eac3bf1ac71d42c7588fa3dbd53111a 100644 (file)
@@ -531,4 +531,22 @@ int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
 }
 EXPORT_SYMBOL_GPL(hisi_uncore_pmu_offline_cpu);
 
+void hisi_pmu_init(struct pmu *pmu, const char *name,
+               const struct attribute_group **attr_groups, struct module *module)
+{
+       pmu->name               = name;
+       pmu->module             = module;
+       pmu->task_ctx_nr        = perf_invalid_context;
+       pmu->event_init         = hisi_uncore_pmu_event_init;
+       pmu->pmu_enable         = hisi_uncore_pmu_enable;
+       pmu->pmu_disable        = hisi_uncore_pmu_disable;
+       pmu->add                = hisi_uncore_pmu_add;
+       pmu->del                = hisi_uncore_pmu_del;
+       pmu->start              = hisi_uncore_pmu_start;
+       pmu->stop               = hisi_uncore_pmu_stop;
+       pmu->read               = hisi_uncore_pmu_read;
+       pmu->attr_groups        = attr_groups;
+}
+EXPORT_SYMBOL_GPL(hisi_pmu_init);
+
 MODULE_LICENSE("GPL v2");
index 96eeddad55ffce10a6e5781efa22d79816a78691..b59de33cd0596462e94e420c671daebcd764b1c3 100644 (file)
@@ -121,4 +121,6 @@ ssize_t hisi_uncore_pmu_identifier_attr_show(struct device *dev,
 int hisi_uncore_pmu_init_irq(struct hisi_pmu *hisi_pmu,
                             struct platform_device *pdev);
 
+void hisi_pmu_init(struct pmu *pmu, const char *name,
+               const struct attribute_group **attr_groups, struct module *module);
 #endif /* __HISI_UNCORE_PMU_H__ */
index 6aedc303ff56a8a214e9245bf9af6bc2de1f6a61..b9c79f17230c2f9a7e4130c7e5483852d6e7fef0 100644 (file)
@@ -445,20 +445,7 @@ static int hisi_sllc_pmu_probe(struct platform_device *pdev)
                return ret;
        }
 
-       sllc_pmu->pmu = (struct pmu) {
-               .module         = THIS_MODULE,
-               .task_ctx_nr    = perf_invalid_context,
-               .event_init     = hisi_uncore_pmu_event_init,
-               .pmu_enable     = hisi_uncore_pmu_enable,
-               .pmu_disable    = hisi_uncore_pmu_disable,
-               .add            = hisi_uncore_pmu_add,
-               .del            = hisi_uncore_pmu_del,
-               .start          = hisi_uncore_pmu_start,
-               .stop           = hisi_uncore_pmu_stop,
-               .read           = hisi_uncore_pmu_read,
-               .attr_groups    = sllc_pmu->pmu_events.attr_groups,
-               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
-       };
+       hisi_pmu_init(&sllc_pmu->pmu, name, sllc_pmu->pmu_events.attr_groups, THIS_MODULE);
 
        ret = perf_pmu_register(&sllc_pmu->pmu, name, -1);
        if (ret) {
diff --git a/drivers/perf/hisilicon/hns3_pmu.c b/drivers/perf/hisilicon/hns3_pmu.c
new file mode 100644 (file)
index 0000000..e0457d8
--- /dev/null
@@ -0,0 +1,1671 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * This driver adds support for HNS3 PMU iEP device. Related perf events are
+ * bandwidth, latency, packet rate, interrupt rate etc.
+ *
+ * Copyright (C) 2022 HiSilicon Limited
+ */
+#include <linux/bitfield.h>
+#include <linux/bitmap.h>
+#include <linux/bug.h>
+#include <linux/cpuhotplug.h>
+#include <linux/cpumask.h>
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/interrupt.h>
+#include <linux/iopoll.h>
+#include <linux/io-64-nonatomic-hi-lo.h>
+#include <linux/irq.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/pci-epf.h>
+#include <linux/perf_event.h>
+#include <linux/smp.h>
+
+/* registers offset address */
+#define HNS3_PMU_REG_GLOBAL_CTRL               0x0000
+#define HNS3_PMU_REG_CLOCK_FREQ                        0x0020
+#define HNS3_PMU_REG_BDF                       0x0fe0
+#define HNS3_PMU_REG_VERSION                   0x0fe4
+#define HNS3_PMU_REG_DEVICE_ID                 0x0fe8
+
+#define HNS3_PMU_REG_EVENT_OFFSET              0x1000
+#define HNS3_PMU_REG_EVENT_SIZE                        0x1000
+#define HNS3_PMU_REG_EVENT_CTRL_LOW            0x00
+#define HNS3_PMU_REG_EVENT_CTRL_HIGH           0x04
+#define HNS3_PMU_REG_EVENT_INTR_STATUS         0x08
+#define HNS3_PMU_REG_EVENT_INTR_MASK           0x0c
+#define HNS3_PMU_REG_EVENT_COUNTER             0x10
+#define HNS3_PMU_REG_EVENT_EXT_COUNTER         0x18
+#define HNS3_PMU_REG_EVENT_QID_CTRL            0x28
+#define HNS3_PMU_REG_EVENT_QID_PARA            0x2c
+
+#define HNS3_PMU_FILTER_SUPPORT_GLOBAL         BIT(0)
+#define HNS3_PMU_FILTER_SUPPORT_PORT           BIT(1)
+#define HNS3_PMU_FILTER_SUPPORT_PORT_TC                BIT(2)
+#define HNS3_PMU_FILTER_SUPPORT_FUNC           BIT(3)
+#define HNS3_PMU_FILTER_SUPPORT_FUNC_QUEUE     BIT(4)
+#define HNS3_PMU_FILTER_SUPPORT_FUNC_INTR      BIT(5)
+
+#define HNS3_PMU_FILTER_ALL_TC                 0xf
+#define HNS3_PMU_FILTER_ALL_QUEUE              0xffff
+
+#define HNS3_PMU_CTRL_SUBEVENT_S               4
+#define HNS3_PMU_CTRL_FILTER_MODE_S            24
+
+#define HNS3_PMU_GLOBAL_START                  BIT(0)
+
+#define HNS3_PMU_EVENT_STATUS_RESET            BIT(11)
+#define HNS3_PMU_EVENT_EN                      BIT(12)
+#define HNS3_PMU_EVENT_OVERFLOW_RESTART                BIT(15)
+
+#define HNS3_PMU_QID_PARA_FUNC_S               0
+#define HNS3_PMU_QID_PARA_QUEUE_S              16
+
+#define HNS3_PMU_QID_CTRL_REQ_ENABLE           BIT(0)
+#define HNS3_PMU_QID_CTRL_DONE                 BIT(1)
+#define HNS3_PMU_QID_CTRL_MISS                 BIT(2)
+
+#define HNS3_PMU_INTR_MASK_OVERFLOW            BIT(1)
+
+#define HNS3_PMU_MAX_HW_EVENTS                 8
+
+/*
+ * Each hardware event contains two registers (counter and ext_counter) for
+ * bandwidth, packet rate, latency and interrupt rate. These two registers will
+ * be triggered to run at the same when a hardware event is enabled. The meaning
+ * of counter and ext_counter of different event type are different, their
+ * meaning show as follow:
+ *
+ * +----------------+------------------+---------------+
+ * |   event type   |     counter      |  ext_counter  |
+ * +----------------+------------------+---------------+
+ * | bandwidth      | byte number      | cycle number  |
+ * +----------------+------------------+---------------+
+ * | packet rate    | packet number    | cycle number  |
+ * +----------------+------------------+---------------+
+ * | latency        | cycle number     | packet number |
+ * +----------------+------------------+---------------+
+ * | interrupt rate | interrupt number | cycle number  |
+ * +----------------+------------------+---------------+
+ *
+ * The cycle number indicates increment of counter of hardware timer, the
+ * frequency of hardware timer can be read from hw_clk_freq file.
+ *
+ * Performance of each hardware event is calculated by: counter / ext_counter.
+ *
+ * Since processing of data is preferred to be done in userspace, we expose
+ * ext_counter as a separate event for userspace and use bit 16 to indicate it.
+ * For example, event 0x00001 and 0x10001 are actually one event for hardware
+ * because bit 0-15 are same. If the bit 16 of one event is 0 means to read
+ * counter register, otherwise means to read ext_counter register.
+ */
+/* bandwidth events */
+#define HNS3_PMU_EVT_BW_SSU_EGU_BYTE_NUM               0x00001
+#define HNS3_PMU_EVT_BW_SSU_EGU_TIME                   0x10001
+#define HNS3_PMU_EVT_BW_SSU_RPU_BYTE_NUM               0x00002
+#define HNS3_PMU_EVT_BW_SSU_RPU_TIME                   0x10002
+#define HNS3_PMU_EVT_BW_SSU_ROCE_BYTE_NUM              0x00003
+#define HNS3_PMU_EVT_BW_SSU_ROCE_TIME                  0x10003
+#define HNS3_PMU_EVT_BW_ROCE_SSU_BYTE_NUM              0x00004
+#define HNS3_PMU_EVT_BW_ROCE_SSU_TIME                  0x10004
+#define HNS3_PMU_EVT_BW_TPU_SSU_BYTE_NUM               0x00005
+#define HNS3_PMU_EVT_BW_TPU_SSU_TIME                   0x10005
+#define HNS3_PMU_EVT_BW_RPU_RCBRX_BYTE_NUM             0x00006
+#define HNS3_PMU_EVT_BW_RPU_RCBRX_TIME                 0x10006
+#define HNS3_PMU_EVT_BW_RCBTX_TXSCH_BYTE_NUM           0x00008
+#define HNS3_PMU_EVT_BW_RCBTX_TXSCH_TIME               0x10008
+#define HNS3_PMU_EVT_BW_WR_FBD_BYTE_NUM                        0x00009
+#define HNS3_PMU_EVT_BW_WR_FBD_TIME                    0x10009
+#define HNS3_PMU_EVT_BW_WR_EBD_BYTE_NUM                        0x0000a
+#define HNS3_PMU_EVT_BW_WR_EBD_TIME                    0x1000a
+#define HNS3_PMU_EVT_BW_RD_FBD_BYTE_NUM                        0x0000b
+#define HNS3_PMU_EVT_BW_RD_FBD_TIME                    0x1000b
+#define HNS3_PMU_EVT_BW_RD_EBD_BYTE_NUM                        0x0000c
+#define HNS3_PMU_EVT_BW_RD_EBD_TIME                    0x1000c
+#define HNS3_PMU_EVT_BW_RD_PAY_M0_BYTE_NUM             0x0000d
+#define HNS3_PMU_EVT_BW_RD_PAY_M0_TIME                 0x1000d
+#define HNS3_PMU_EVT_BW_RD_PAY_M1_BYTE_NUM             0x0000e
+#define HNS3_PMU_EVT_BW_RD_PAY_M1_TIME                 0x1000e
+#define HNS3_PMU_EVT_BW_WR_PAY_M0_BYTE_NUM             0x0000f
+#define HNS3_PMU_EVT_BW_WR_PAY_M0_TIME                 0x1000f
+#define HNS3_PMU_EVT_BW_WR_PAY_M1_BYTE_NUM             0x00010
+#define HNS3_PMU_EVT_BW_WR_PAY_M1_TIME                 0x10010
+
+/* packet rate events */
+#define HNS3_PMU_EVT_PPS_IGU_SSU_PACKET_NUM            0x00100
+#define HNS3_PMU_EVT_PPS_IGU_SSU_TIME                  0x10100
+#define HNS3_PMU_EVT_PPS_SSU_EGU_PACKET_NUM            0x00101
+#define HNS3_PMU_EVT_PPS_SSU_EGU_TIME                  0x10101
+#define HNS3_PMU_EVT_PPS_SSU_RPU_PACKET_NUM            0x00102
+#define HNS3_PMU_EVT_PPS_SSU_RPU_TIME                  0x10102
+#define HNS3_PMU_EVT_PPS_SSU_ROCE_PACKET_NUM           0x00103
+#define HNS3_PMU_EVT_PPS_SSU_ROCE_TIME                 0x10103
+#define HNS3_PMU_EVT_PPS_ROCE_SSU_PACKET_NUM           0x00104
+#define HNS3_PMU_EVT_PPS_ROCE_SSU_TIME                 0x10104
+#define HNS3_PMU_EVT_PPS_TPU_SSU_PACKET_NUM            0x00105
+#define HNS3_PMU_EVT_PPS_TPU_SSU_TIME                  0x10105
+#define HNS3_PMU_EVT_PPS_RPU_RCBRX_PACKET_NUM          0x00106
+#define HNS3_PMU_EVT_PPS_RPU_RCBRX_TIME                        0x10106
+#define HNS3_PMU_EVT_PPS_RCBTX_TPU_PACKET_NUM          0x00107
+#define HNS3_PMU_EVT_PPS_RCBTX_TPU_TIME                        0x10107
+#define HNS3_PMU_EVT_PPS_RCBTX_TXSCH_PACKET_NUM                0x00108
+#define HNS3_PMU_EVT_PPS_RCBTX_TXSCH_TIME              0x10108
+#define HNS3_PMU_EVT_PPS_WR_FBD_PACKET_NUM             0x00109
+#define HNS3_PMU_EVT_PPS_WR_FBD_TIME                   0x10109
+#define HNS3_PMU_EVT_PPS_WR_EBD_PACKET_NUM             0x0010a
+#define HNS3_PMU_EVT_PPS_WR_EBD_TIME                   0x1010a
+#define HNS3_PMU_EVT_PPS_RD_FBD_PACKET_NUM             0x0010b
+#define HNS3_PMU_EVT_PPS_RD_FBD_TIME                   0x1010b
+#define HNS3_PMU_EVT_PPS_RD_EBD_PACKET_NUM             0x0010c
+#define HNS3_PMU_EVT_PPS_RD_EBD_TIME                   0x1010c
+#define HNS3_PMU_EVT_PPS_RD_PAY_M0_PACKET_NUM          0x0010d
+#define HNS3_PMU_EVT_PPS_RD_PAY_M0_TIME                        0x1010d
+#define HNS3_PMU_EVT_PPS_RD_PAY_M1_PACKET_NUM          0x0010e
+#define HNS3_PMU_EVT_PPS_RD_PAY_M1_TIME                        0x1010e
+#define HNS3_PMU_EVT_PPS_WR_PAY_M0_PACKET_NUM          0x0010f
+#define HNS3_PMU_EVT_PPS_WR_PAY_M0_TIME                        0x1010f
+#define HNS3_PMU_EVT_PPS_WR_PAY_M1_PACKET_NUM          0x00110
+#define HNS3_PMU_EVT_PPS_WR_PAY_M1_TIME                        0x10110
+#define HNS3_PMU_EVT_PPS_NICROH_TX_PRE_PACKET_NUM      0x00111
+#define HNS3_PMU_EVT_PPS_NICROH_TX_PRE_TIME            0x10111
+#define HNS3_PMU_EVT_PPS_NICROH_RX_PRE_PACKET_NUM      0x00112
+#define HNS3_PMU_EVT_PPS_NICROH_RX_PRE_TIME            0x10112
+
+/* latency events */
+#define HNS3_PMU_EVT_DLY_TX_PUSH_TIME                  0x00202
+#define HNS3_PMU_EVT_DLY_TX_PUSH_PACKET_NUM            0x10202
+#define HNS3_PMU_EVT_DLY_TX_TIME                       0x00204
+#define HNS3_PMU_EVT_DLY_TX_PACKET_NUM                 0x10204
+#define HNS3_PMU_EVT_DLY_SSU_TX_NIC_TIME               0x00206
+#define HNS3_PMU_EVT_DLY_SSU_TX_NIC_PACKET_NUM         0x10206
+#define HNS3_PMU_EVT_DLY_SSU_TX_ROCE_TIME              0x00207
+#define HNS3_PMU_EVT_DLY_SSU_TX_ROCE_PACKET_NUM                0x10207
+#define HNS3_PMU_EVT_DLY_SSU_RX_NIC_TIME               0x00208
+#define HNS3_PMU_EVT_DLY_SSU_RX_NIC_PACKET_NUM         0x10208
+#define HNS3_PMU_EVT_DLY_SSU_RX_ROCE_TIME              0x00209
+#define HNS3_PMU_EVT_DLY_SSU_RX_ROCE_PACKET_NUM                0x10209
+#define HNS3_PMU_EVT_DLY_RPU_TIME                      0x0020e
+#define HNS3_PMU_EVT_DLY_RPU_PACKET_NUM                        0x1020e
+#define HNS3_PMU_EVT_DLY_TPU_TIME                      0x0020f
+#define HNS3_PMU_EVT_DLY_TPU_PACKET_NUM                        0x1020f
+#define HNS3_PMU_EVT_DLY_RPE_TIME                      0x00210
+#define HNS3_PMU_EVT_DLY_RPE_PACKET_NUM                        0x10210
+#define HNS3_PMU_EVT_DLY_TPE_TIME                      0x00211
+#define HNS3_PMU_EVT_DLY_TPE_PACKET_NUM                        0x10211
+#define HNS3_PMU_EVT_DLY_TPE_PUSH_TIME                 0x00212
+#define HNS3_PMU_EVT_DLY_TPE_PUSH_PACKET_NUM           0x10212
+#define HNS3_PMU_EVT_DLY_WR_FBD_TIME                   0x00213
+#define HNS3_PMU_EVT_DLY_WR_FBD_PACKET_NUM             0x10213
+#define HNS3_PMU_EVT_DLY_WR_EBD_TIME                   0x00214
+#define HNS3_PMU_EVT_DLY_WR_EBD_PACKET_NUM             0x10214
+#define HNS3_PMU_EVT_DLY_RD_FBD_TIME                   0x00215
+#define HNS3_PMU_EVT_DLY_RD_FBD_PACKET_NUM             0x10215
+#define HNS3_PMU_EVT_DLY_RD_EBD_TIME                   0x00216
+#define HNS3_PMU_EVT_DLY_RD_EBD_PACKET_NUM             0x10216
+#define HNS3_PMU_EVT_DLY_RD_PAY_M0_TIME                        0x00217
+#define HNS3_PMU_EVT_DLY_RD_PAY_M0_PACKET_NUM          0x10217
+#define HNS3_PMU_EVT_DLY_RD_PAY_M1_TIME                        0x00218
+#define HNS3_PMU_EVT_DLY_RD_PAY_M1_PACKET_NUM          0x10218
+#define HNS3_PMU_EVT_DLY_WR_PAY_M0_TIME                        0x00219
+#define HNS3_PMU_EVT_DLY_WR_PAY_M0_PACKET_NUM          0x10219
+#define HNS3_PMU_EVT_DLY_WR_PAY_M1_TIME                        0x0021a
+#define HNS3_PMU_EVT_DLY_WR_PAY_M1_PACKET_NUM          0x1021a
+#define HNS3_PMU_EVT_DLY_MSIX_WRITE_TIME               0x0021c
+#define HNS3_PMU_EVT_DLY_MSIX_WRITE_PACKET_NUM         0x1021c
+
+/* interrupt rate events */
+#define HNS3_PMU_EVT_PPS_MSIX_NIC_INTR_NUM             0x00300
+#define HNS3_PMU_EVT_PPS_MSIX_NIC_TIME                 0x10300
+
+/* filter mode supported by each bandwidth event */
+#define HNS3_PMU_FILTER_BW_SSU_EGU             0x07
+#define HNS3_PMU_FILTER_BW_SSU_RPU             0x1f
+#define HNS3_PMU_FILTER_BW_SSU_ROCE            0x0f
+#define HNS3_PMU_FILTER_BW_ROCE_SSU            0x0f
+#define HNS3_PMU_FILTER_BW_TPU_SSU             0x1f
+#define HNS3_PMU_FILTER_BW_RPU_RCBRX           0x11
+#define HNS3_PMU_FILTER_BW_RCBTX_TXSCH         0x11
+#define HNS3_PMU_FILTER_BW_WR_FBD              0x1b
+#define HNS3_PMU_FILTER_BW_WR_EBD              0x11
+#define HNS3_PMU_FILTER_BW_RD_FBD              0x01
+#define HNS3_PMU_FILTER_BW_RD_EBD              0x1b
+#define HNS3_PMU_FILTER_BW_RD_PAY_M0           0x01
+#define HNS3_PMU_FILTER_BW_RD_PAY_M1           0x01
+#define HNS3_PMU_FILTER_BW_WR_PAY_M0           0x01
+#define HNS3_PMU_FILTER_BW_WR_PAY_M1           0x01
+
+/* filter mode supported by each packet rate event */
+#define HNS3_PMU_FILTER_PPS_IGU_SSU            0x07
+#define HNS3_PMU_FILTER_PPS_SSU_EGU            0x07
+#define HNS3_PMU_FILTER_PPS_SSU_RPU            0x1f
+#define HNS3_PMU_FILTER_PPS_SSU_ROCE           0x0f
+#define HNS3_PMU_FILTER_PPS_ROCE_SSU           0x0f
+#define HNS3_PMU_FILTER_PPS_TPU_SSU            0x1f
+#define HNS3_PMU_FILTER_PPS_RPU_RCBRX          0x11
+#define HNS3_PMU_FILTER_PPS_RCBTX_TPU          0x1f
+#define HNS3_PMU_FILTER_PPS_RCBTX_TXSCH                0x11
+#define HNS3_PMU_FILTER_PPS_WR_FBD             0x1b
+#define HNS3_PMU_FILTER_PPS_WR_EBD             0x11
+#define HNS3_PMU_FILTER_PPS_RD_FBD             0x01
+#define HNS3_PMU_FILTER_PPS_RD_EBD             0x1b
+#define HNS3_PMU_FILTER_PPS_RD_PAY_M0          0x01
+#define HNS3_PMU_FILTER_PPS_RD_PAY_M1          0x01
+#define HNS3_PMU_FILTER_PPS_WR_PAY_M0          0x01
+#define HNS3_PMU_FILTER_PPS_WR_PAY_M1          0x01
+#define HNS3_PMU_FILTER_PPS_NICROH_TX_PRE      0x01
+#define HNS3_PMU_FILTER_PPS_NICROH_RX_PRE      0x01
+
+/* filter mode supported by each latency event */
+#define HNS3_PMU_FILTER_DLY_TX_PUSH            0x01
+#define HNS3_PMU_FILTER_DLY_TX                 0x01
+#define HNS3_PMU_FILTER_DLY_SSU_TX_NIC         0x07
+#define HNS3_PMU_FILTER_DLY_SSU_TX_ROCE                0x07
+#define HNS3_PMU_FILTER_DLY_SSU_RX_NIC         0x07
+#define HNS3_PMU_FILTER_DLY_SSU_RX_ROCE                0x07
+#define HNS3_PMU_FILTER_DLY_RPU                        0x11
+#define HNS3_PMU_FILTER_DLY_TPU                        0x1f
+#define HNS3_PMU_FILTER_DLY_RPE                        0x01
+#define HNS3_PMU_FILTER_DLY_TPE                        0x0b
+#define HNS3_PMU_FILTER_DLY_TPE_PUSH           0x1b
+#define HNS3_PMU_FILTER_DLY_WR_FBD             0x1b
+#define HNS3_PMU_FILTER_DLY_WR_EBD             0x11
+#define HNS3_PMU_FILTER_DLY_RD_FBD             0x01
+#define HNS3_PMU_FILTER_DLY_RD_EBD             0x1b
+#define HNS3_PMU_FILTER_DLY_RD_PAY_M0          0x01
+#define HNS3_PMU_FILTER_DLY_RD_PAY_M1          0x01
+#define HNS3_PMU_FILTER_DLY_WR_PAY_M0          0x01
+#define HNS3_PMU_FILTER_DLY_WR_PAY_M1          0x01
+#define HNS3_PMU_FILTER_DLY_MSIX_WRITE         0x01
+
+/* filter mode supported by each interrupt rate event */
+#define HNS3_PMU_FILTER_INTR_MSIX_NIC          0x01
+
+enum hns3_pmu_hw_filter_mode {
+       HNS3_PMU_HW_FILTER_GLOBAL,
+       HNS3_PMU_HW_FILTER_PORT,
+       HNS3_PMU_HW_FILTER_PORT_TC,
+       HNS3_PMU_HW_FILTER_FUNC,
+       HNS3_PMU_HW_FILTER_FUNC_QUEUE,
+       HNS3_PMU_HW_FILTER_FUNC_INTR,
+};
+
+struct hns3_pmu_event_attr {
+       u32 event;
+       u16 filter_support;
+};
+
+struct hns3_pmu {
+       struct perf_event *hw_events[HNS3_PMU_MAX_HW_EVENTS];
+       struct hlist_node node;
+       struct pci_dev *pdev;
+       struct pmu pmu;
+       void __iomem *base;
+       int irq;
+       int on_cpu;
+       u32 identifier;
+       u32 hw_clk_freq; /* hardware clock frequency of PMU */
+       /* maximum and minimum bdf allowed by PMU */
+       u16 bdf_min;
+       u16 bdf_max;
+};
+
+#define to_hns3_pmu(p)  (container_of((p), struct hns3_pmu, pmu))
+
+#define GET_PCI_DEVFN(bdf)  ((bdf) & 0xff)
+
+#define FILTER_CONDITION_PORT(port) ((1 << (port)) & 0xff)
+#define FILTER_CONDITION_PORT_TC(port, tc) (((port) << 3) | ((tc) & 0x07))
+#define FILTER_CONDITION_FUNC_INTR(func, intr) (((intr) << 8) | (func))
+
+#define HNS3_PMU_FILTER_ATTR(_name, _config, _start, _end)               \
+       static inline u64 hns3_pmu_get_##_name(struct perf_event *event) \
+       {                                                                \
+               return FIELD_GET(GENMASK_ULL(_end, _start),              \
+                                event->attr._config);                   \
+       }
+
+HNS3_PMU_FILTER_ATTR(subevent, config, 0, 7);
+HNS3_PMU_FILTER_ATTR(event_type, config, 8, 15);
+HNS3_PMU_FILTER_ATTR(ext_counter_used, config, 16, 16);
+HNS3_PMU_FILTER_ATTR(port, config1, 0, 3);
+HNS3_PMU_FILTER_ATTR(tc, config1, 4, 7);
+HNS3_PMU_FILTER_ATTR(bdf, config1, 8, 23);
+HNS3_PMU_FILTER_ATTR(queue, config1, 24, 39);
+HNS3_PMU_FILTER_ATTR(intr, config1, 40, 51);
+HNS3_PMU_FILTER_ATTR(global, config1, 52, 52);
+
+#define HNS3_BW_EVT_BYTE_NUM(_name)    (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_BW_##_name##_BYTE_NUM,                             \
+       HNS3_PMU_FILTER_BW_##_name})
+#define HNS3_BW_EVT_TIME(_name)                (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_BW_##_name##_TIME,                                 \
+       HNS3_PMU_FILTER_BW_##_name})
+#define HNS3_PPS_EVT_PACKET_NUM(_name) (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_PPS_##_name##_PACKET_NUM,                          \
+       HNS3_PMU_FILTER_PPS_##_name})
+#define HNS3_PPS_EVT_TIME(_name)       (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_PPS_##_name##_TIME,                                \
+       HNS3_PMU_FILTER_PPS_##_name})
+#define HNS3_DLY_EVT_TIME(_name)       (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_DLY_##_name##_TIME,                                \
+       HNS3_PMU_FILTER_DLY_##_name})
+#define HNS3_DLY_EVT_PACKET_NUM(_name) (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_DLY_##_name##_PACKET_NUM,                          \
+       HNS3_PMU_FILTER_DLY_##_name})
+#define HNS3_INTR_EVT_INTR_NUM(_name)  (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_PPS_##_name##_INTR_NUM,                            \
+       HNS3_PMU_FILTER_INTR_##_name})
+#define HNS3_INTR_EVT_TIME(_name)      (&(struct hns3_pmu_event_attr) {\
+       HNS3_PMU_EVT_PPS_##_name##_TIME,                                \
+       HNS3_PMU_FILTER_INTR_##_name})
+
+static ssize_t hns3_pmu_format_show(struct device *dev,
+                                   struct device_attribute *attr, char *buf)
+{
+       struct dev_ext_attribute *eattr;
+
+       eattr = container_of(attr, struct dev_ext_attribute, attr);
+
+       return sysfs_emit(buf, "%s\n", (char *)eattr->var);
+}
+
+static ssize_t hns3_pmu_event_show(struct device *dev,
+                                  struct device_attribute *attr, char *buf)
+{
+       struct hns3_pmu_event_attr *event;
+       struct dev_ext_attribute *eattr;
+
+       eattr = container_of(attr, struct dev_ext_attribute, attr);
+       event = eattr->var;
+
+       return sysfs_emit(buf, "config=0x%x\n", event->event);
+}
+
+static ssize_t hns3_pmu_filter_mode_show(struct device *dev,
+                                        struct device_attribute *attr,
+                                        char *buf)
+{
+       struct hns3_pmu_event_attr *event;
+       struct dev_ext_attribute *eattr;
+       int len;
+
+       eattr = container_of(attr, struct dev_ext_attribute, attr);
+       event = eattr->var;
+
+       len = sysfs_emit_at(buf, 0, "filter mode supported: ");
+       if (event->filter_support & HNS3_PMU_FILTER_SUPPORT_GLOBAL)
+               len += sysfs_emit_at(buf, len, "global ");
+       if (event->filter_support & HNS3_PMU_FILTER_SUPPORT_PORT)
+               len += sysfs_emit_at(buf, len, "port ");
+       if (event->filter_support & HNS3_PMU_FILTER_SUPPORT_PORT_TC)
+               len += sysfs_emit_at(buf, len, "port-tc ");
+       if (event->filter_support & HNS3_PMU_FILTER_SUPPORT_FUNC)
+               len += sysfs_emit_at(buf, len, "func ");
+       if (event->filter_support & HNS3_PMU_FILTER_SUPPORT_FUNC_QUEUE)
+               len += sysfs_emit_at(buf, len, "func-queue ");
+       if (event->filter_support & HNS3_PMU_FILTER_SUPPORT_FUNC_INTR)
+               len += sysfs_emit_at(buf, len, "func-intr ");
+
+       len += sysfs_emit_at(buf, len, "\n");
+
+       return len;
+}
+
+#define HNS3_PMU_ATTR(_name, _func, _config)                           \
+       (&((struct dev_ext_attribute[]) {                               \
+               { __ATTR(_name, 0444, _func, NULL), (void *)_config }   \
+       })[0].attr.attr)
+
+#define HNS3_PMU_FORMAT_ATTR(_name, _format) \
+       HNS3_PMU_ATTR(_name, hns3_pmu_format_show, (void *)_format)
+#define HNS3_PMU_EVENT_ATTR(_name, _event) \
+       HNS3_PMU_ATTR(_name, hns3_pmu_event_show, (void *)_event)
+#define HNS3_PMU_FLT_MODE_ATTR(_name, _event) \
+       HNS3_PMU_ATTR(_name, hns3_pmu_filter_mode_show, (void *)_event)
+
+#define HNS3_PMU_BW_EVT_PAIR(_name, _macro) \
+       HNS3_PMU_EVENT_ATTR(_name##_byte_num, HNS3_BW_EVT_BYTE_NUM(_macro)), \
+       HNS3_PMU_EVENT_ATTR(_name##_time, HNS3_BW_EVT_TIME(_macro))
+#define HNS3_PMU_PPS_EVT_PAIR(_name, _macro) \
+       HNS3_PMU_EVENT_ATTR(_name##_packet_num, HNS3_PPS_EVT_PACKET_NUM(_macro)), \
+       HNS3_PMU_EVENT_ATTR(_name##_time, HNS3_PPS_EVT_TIME(_macro))
+#define HNS3_PMU_DLY_EVT_PAIR(_name, _macro) \
+       HNS3_PMU_EVENT_ATTR(_name##_time, HNS3_DLY_EVT_TIME(_macro)), \
+       HNS3_PMU_EVENT_ATTR(_name##_packet_num, HNS3_DLY_EVT_PACKET_NUM(_macro))
+#define HNS3_PMU_INTR_EVT_PAIR(_name, _macro) \
+       HNS3_PMU_EVENT_ATTR(_name##_intr_num, HNS3_INTR_EVT_INTR_NUM(_macro)), \
+       HNS3_PMU_EVENT_ATTR(_name##_time, HNS3_INTR_EVT_TIME(_macro))
+
+#define HNS3_PMU_BW_FLT_MODE_PAIR(_name, _macro) \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_byte_num, HNS3_BW_EVT_BYTE_NUM(_macro)), \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_time, HNS3_BW_EVT_TIME(_macro))
+#define HNS3_PMU_PPS_FLT_MODE_PAIR(_name, _macro) \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_packet_num, HNS3_PPS_EVT_PACKET_NUM(_macro)), \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_time, HNS3_PPS_EVT_TIME(_macro))
+#define HNS3_PMU_DLY_FLT_MODE_PAIR(_name, _macro) \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_time, HNS3_DLY_EVT_TIME(_macro)), \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_packet_num, HNS3_DLY_EVT_PACKET_NUM(_macro))
+#define HNS3_PMU_INTR_FLT_MODE_PAIR(_name, _macro) \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_intr_num, HNS3_INTR_EVT_INTR_NUM(_macro)), \
+       HNS3_PMU_FLT_MODE_ATTR(_name##_time, HNS3_INTR_EVT_TIME(_macro))
+
+static u8 hns3_pmu_hw_filter_modes[] = {
+       HNS3_PMU_HW_FILTER_GLOBAL,
+       HNS3_PMU_HW_FILTER_PORT,
+       HNS3_PMU_HW_FILTER_PORT_TC,
+       HNS3_PMU_HW_FILTER_FUNC,
+       HNS3_PMU_HW_FILTER_FUNC_QUEUE,
+       HNS3_PMU_HW_FILTER_FUNC_INTR,
+};
+
+#define HNS3_PMU_SET_HW_FILTER(_hwc, _mode) \
+       ((_hwc)->addr_filters = (void *)&hns3_pmu_hw_filter_modes[(_mode)])
+
+static ssize_t identifier_show(struct device *dev,
+                              struct device_attribute *attr, char *buf)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(dev_get_drvdata(dev));
+
+       return sysfs_emit(buf, "0x%x\n", hns3_pmu->identifier);
+}
+static DEVICE_ATTR_RO(identifier);
+
+static ssize_t cpumask_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(dev_get_drvdata(dev));
+
+       return sysfs_emit(buf, "%d\n", hns3_pmu->on_cpu);
+}
+static DEVICE_ATTR_RO(cpumask);
+
+static ssize_t bdf_min_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(dev_get_drvdata(dev));
+       u16 bdf = hns3_pmu->bdf_min;
+
+       return sysfs_emit(buf, "%02x:%02x.%x\n", PCI_BUS_NUM(bdf),
+                         PCI_SLOT(bdf), PCI_FUNC(bdf));
+}
+static DEVICE_ATTR_RO(bdf_min);
+
+static ssize_t bdf_max_show(struct device *dev, struct device_attribute *attr,
+                           char *buf)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(dev_get_drvdata(dev));
+       u16 bdf = hns3_pmu->bdf_max;
+
+       return sysfs_emit(buf, "%02x:%02x.%x\n", PCI_BUS_NUM(bdf),
+                         PCI_SLOT(bdf), PCI_FUNC(bdf));
+}
+static DEVICE_ATTR_RO(bdf_max);
+
+static ssize_t hw_clk_freq_show(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(dev_get_drvdata(dev));
+
+       return sysfs_emit(buf, "%u\n", hns3_pmu->hw_clk_freq);
+}
+static DEVICE_ATTR_RO(hw_clk_freq);
+
+static struct attribute *hns3_pmu_events_attr[] = {
+       /* bandwidth events */
+       HNS3_PMU_BW_EVT_PAIR(bw_ssu_egu, SSU_EGU),
+       HNS3_PMU_BW_EVT_PAIR(bw_ssu_rpu, SSU_RPU),
+       HNS3_PMU_BW_EVT_PAIR(bw_ssu_roce, SSU_ROCE),
+       HNS3_PMU_BW_EVT_PAIR(bw_roce_ssu, ROCE_SSU),
+       HNS3_PMU_BW_EVT_PAIR(bw_tpu_ssu, TPU_SSU),
+       HNS3_PMU_BW_EVT_PAIR(bw_rpu_rcbrx, RPU_RCBRX),
+       HNS3_PMU_BW_EVT_PAIR(bw_rcbtx_txsch, RCBTX_TXSCH),
+       HNS3_PMU_BW_EVT_PAIR(bw_wr_fbd, WR_FBD),
+       HNS3_PMU_BW_EVT_PAIR(bw_wr_ebd, WR_EBD),
+       HNS3_PMU_BW_EVT_PAIR(bw_rd_fbd, RD_FBD),
+       HNS3_PMU_BW_EVT_PAIR(bw_rd_ebd, RD_EBD),
+       HNS3_PMU_BW_EVT_PAIR(bw_rd_pay_m0, RD_PAY_M0),
+       HNS3_PMU_BW_EVT_PAIR(bw_rd_pay_m1, RD_PAY_M1),
+       HNS3_PMU_BW_EVT_PAIR(bw_wr_pay_m0, WR_PAY_M0),
+       HNS3_PMU_BW_EVT_PAIR(bw_wr_pay_m1, WR_PAY_M1),
+
+       /* packet rate events */
+       HNS3_PMU_PPS_EVT_PAIR(pps_igu_ssu, IGU_SSU),
+       HNS3_PMU_PPS_EVT_PAIR(pps_ssu_egu, SSU_EGU),
+       HNS3_PMU_PPS_EVT_PAIR(pps_ssu_rpu, SSU_RPU),
+       HNS3_PMU_PPS_EVT_PAIR(pps_ssu_roce, SSU_ROCE),
+       HNS3_PMU_PPS_EVT_PAIR(pps_roce_ssu, ROCE_SSU),
+       HNS3_PMU_PPS_EVT_PAIR(pps_tpu_ssu, TPU_SSU),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rpu_rcbrx, RPU_RCBRX),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rcbtx_tpu, RCBTX_TPU),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rcbtx_txsch, RCBTX_TXSCH),
+       HNS3_PMU_PPS_EVT_PAIR(pps_wr_fbd, WR_FBD),
+       HNS3_PMU_PPS_EVT_PAIR(pps_wr_ebd, WR_EBD),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rd_fbd, RD_FBD),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rd_ebd, RD_EBD),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rd_pay_m0, RD_PAY_M0),
+       HNS3_PMU_PPS_EVT_PAIR(pps_rd_pay_m1, RD_PAY_M1),
+       HNS3_PMU_PPS_EVT_PAIR(pps_wr_pay_m0, WR_PAY_M0),
+       HNS3_PMU_PPS_EVT_PAIR(pps_wr_pay_m1, WR_PAY_M1),
+       HNS3_PMU_PPS_EVT_PAIR(pps_intr_nicroh_tx_pre, NICROH_TX_PRE),
+       HNS3_PMU_PPS_EVT_PAIR(pps_intr_nicroh_rx_pre, NICROH_RX_PRE),
+
+       /* latency events */
+       HNS3_PMU_DLY_EVT_PAIR(dly_tx_push_to_mac, TX_PUSH),
+       HNS3_PMU_DLY_EVT_PAIR(dly_tx_normal_to_mac, TX),
+       HNS3_PMU_DLY_EVT_PAIR(dly_ssu_tx_th_nic, SSU_TX_NIC),
+       HNS3_PMU_DLY_EVT_PAIR(dly_ssu_tx_th_roce, SSU_TX_ROCE),
+       HNS3_PMU_DLY_EVT_PAIR(dly_ssu_rx_th_nic, SSU_RX_NIC),
+       HNS3_PMU_DLY_EVT_PAIR(dly_ssu_rx_th_roce, SSU_RX_ROCE),
+       HNS3_PMU_DLY_EVT_PAIR(dly_rpu, RPU),
+       HNS3_PMU_DLY_EVT_PAIR(dly_tpu, TPU),
+       HNS3_PMU_DLY_EVT_PAIR(dly_rpe, RPE),
+       HNS3_PMU_DLY_EVT_PAIR(dly_tpe_normal, TPE),
+       HNS3_PMU_DLY_EVT_PAIR(dly_tpe_push, TPE_PUSH),
+       HNS3_PMU_DLY_EVT_PAIR(dly_wr_fbd, WR_FBD),
+       HNS3_PMU_DLY_EVT_PAIR(dly_wr_ebd, WR_EBD),
+       HNS3_PMU_DLY_EVT_PAIR(dly_rd_fbd, RD_FBD),
+       HNS3_PMU_DLY_EVT_PAIR(dly_rd_ebd, RD_EBD),
+       HNS3_PMU_DLY_EVT_PAIR(dly_rd_pay_m0, RD_PAY_M0),
+       HNS3_PMU_DLY_EVT_PAIR(dly_rd_pay_m1, RD_PAY_M1),
+       HNS3_PMU_DLY_EVT_PAIR(dly_wr_pay_m0, WR_PAY_M0),
+       HNS3_PMU_DLY_EVT_PAIR(dly_wr_pay_m1, WR_PAY_M1),
+       HNS3_PMU_DLY_EVT_PAIR(dly_msix_write, MSIX_WRITE),
+
+       /* interrupt rate events */
+       HNS3_PMU_INTR_EVT_PAIR(pps_intr_msix_nic, MSIX_NIC),
+
+       NULL
+};
+
+static struct attribute *hns3_pmu_filter_mode_attr[] = {
+       /* bandwidth events */
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_ssu_egu, SSU_EGU),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_ssu_rpu, SSU_RPU),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_ssu_roce, SSU_ROCE),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_roce_ssu, ROCE_SSU),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_tpu_ssu, TPU_SSU),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_rpu_rcbrx, RPU_RCBRX),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_rcbtx_txsch, RCBTX_TXSCH),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_wr_fbd, WR_FBD),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_wr_ebd, WR_EBD),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_rd_fbd, RD_FBD),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_rd_ebd, RD_EBD),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_rd_pay_m0, RD_PAY_M0),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_rd_pay_m1, RD_PAY_M1),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_wr_pay_m0, WR_PAY_M0),
+       HNS3_PMU_BW_FLT_MODE_PAIR(bw_wr_pay_m1, WR_PAY_M1),
+
+       /* packet rate events */
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_igu_ssu, IGU_SSU),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_ssu_egu, SSU_EGU),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_ssu_rpu, SSU_RPU),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_ssu_roce, SSU_ROCE),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_roce_ssu, ROCE_SSU),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_tpu_ssu, TPU_SSU),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rpu_rcbrx, RPU_RCBRX),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rcbtx_tpu, RCBTX_TPU),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rcbtx_txsch, RCBTX_TXSCH),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_wr_fbd, WR_FBD),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_wr_ebd, WR_EBD),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rd_fbd, RD_FBD),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rd_ebd, RD_EBD),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rd_pay_m0, RD_PAY_M0),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_rd_pay_m1, RD_PAY_M1),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_wr_pay_m0, WR_PAY_M0),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_wr_pay_m1, WR_PAY_M1),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_intr_nicroh_tx_pre, NICROH_TX_PRE),
+       HNS3_PMU_PPS_FLT_MODE_PAIR(pps_intr_nicroh_rx_pre, NICROH_RX_PRE),
+
+       /* latency events */
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_tx_push_to_mac, TX_PUSH),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_tx_normal_to_mac, TX),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_ssu_tx_th_nic, SSU_TX_NIC),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_ssu_tx_th_roce, SSU_TX_ROCE),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_ssu_rx_th_nic, SSU_RX_NIC),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_ssu_rx_th_roce, SSU_RX_ROCE),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_rpu, RPU),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_tpu, TPU),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_rpe, RPE),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_tpe_normal, TPE),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_tpe_push, TPE_PUSH),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_wr_fbd, WR_FBD),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_wr_ebd, WR_EBD),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_rd_fbd, RD_FBD),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_rd_ebd, RD_EBD),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_rd_pay_m0, RD_PAY_M0),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_rd_pay_m1, RD_PAY_M1),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_wr_pay_m0, WR_PAY_M0),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_wr_pay_m1, WR_PAY_M1),
+       HNS3_PMU_DLY_FLT_MODE_PAIR(dly_msix_write, MSIX_WRITE),
+
+       /* interrupt rate events */
+       HNS3_PMU_INTR_FLT_MODE_PAIR(pps_intr_msix_nic, MSIX_NIC),
+
+       NULL
+};
+
+static struct attribute_group hns3_pmu_events_group = {
+       .name = "events",
+       .attrs = hns3_pmu_events_attr,
+};
+
+static struct attribute_group hns3_pmu_filter_mode_group = {
+       .name = "filtermode",
+       .attrs = hns3_pmu_filter_mode_attr,
+};
+
+static struct attribute *hns3_pmu_format_attr[] = {
+       HNS3_PMU_FORMAT_ATTR(subevent, "config:0-7"),
+       HNS3_PMU_FORMAT_ATTR(event_type, "config:8-15"),
+       HNS3_PMU_FORMAT_ATTR(ext_counter_used, "config:16"),
+       HNS3_PMU_FORMAT_ATTR(port, "config1:0-3"),
+       HNS3_PMU_FORMAT_ATTR(tc, "config1:4-7"),
+       HNS3_PMU_FORMAT_ATTR(bdf, "config1:8-23"),
+       HNS3_PMU_FORMAT_ATTR(queue, "config1:24-39"),
+       HNS3_PMU_FORMAT_ATTR(intr, "config1:40-51"),
+       HNS3_PMU_FORMAT_ATTR(global, "config1:52"),
+       NULL
+};
+
+static struct attribute_group hns3_pmu_format_group = {
+       .name = "format",
+       .attrs = hns3_pmu_format_attr,
+};
+
+static struct attribute *hns3_pmu_cpumask_attrs[] = {
+       &dev_attr_cpumask.attr,
+       NULL
+};
+
+static struct attribute_group hns3_pmu_cpumask_attr_group = {
+       .attrs = hns3_pmu_cpumask_attrs,
+};
+
+static struct attribute *hns3_pmu_identifier_attrs[] = {
+       &dev_attr_identifier.attr,
+       NULL
+};
+
+static struct attribute_group hns3_pmu_identifier_attr_group = {
+       .attrs = hns3_pmu_identifier_attrs,
+};
+
+static struct attribute *hns3_pmu_bdf_range_attrs[] = {
+       &dev_attr_bdf_min.attr,
+       &dev_attr_bdf_max.attr,
+       NULL
+};
+
+static struct attribute_group hns3_pmu_bdf_range_attr_group = {
+       .attrs = hns3_pmu_bdf_range_attrs,
+};
+
+static struct attribute *hns3_pmu_hw_clk_freq_attrs[] = {
+       &dev_attr_hw_clk_freq.attr,
+       NULL
+};
+
+static struct attribute_group hns3_pmu_hw_clk_freq_attr_group = {
+       .attrs = hns3_pmu_hw_clk_freq_attrs,
+};
+
+static const struct attribute_group *hns3_pmu_attr_groups[] = {
+       &hns3_pmu_events_group,
+       &hns3_pmu_filter_mode_group,
+       &hns3_pmu_format_group,
+       &hns3_pmu_cpumask_attr_group,
+       &hns3_pmu_identifier_attr_group,
+       &hns3_pmu_bdf_range_attr_group,
+       &hns3_pmu_hw_clk_freq_attr_group,
+       NULL
+};
+
+static u32 hns3_pmu_get_event(struct perf_event *event)
+{
+       return hns3_pmu_get_ext_counter_used(event) << 16 |
+              hns3_pmu_get_event_type(event) << 8 |
+              hns3_pmu_get_subevent(event);
+}
+
+static u32 hns3_pmu_get_real_event(struct perf_event *event)
+{
+       return hns3_pmu_get_event_type(event) << 8 |
+              hns3_pmu_get_subevent(event);
+}
+
+static u32 hns3_pmu_get_offset(u32 offset, u32 idx)
+{
+       return offset + HNS3_PMU_REG_EVENT_OFFSET +
+              HNS3_PMU_REG_EVENT_SIZE * idx;
+}
+
+static u32 hns3_pmu_readl(struct hns3_pmu *hns3_pmu, u32 reg_offset, u32 idx)
+{
+       u32 offset = hns3_pmu_get_offset(reg_offset, idx);
+
+       return readl(hns3_pmu->base + offset);
+}
+
+static void hns3_pmu_writel(struct hns3_pmu *hns3_pmu, u32 reg_offset, u32 idx,
+                           u32 val)
+{
+       u32 offset = hns3_pmu_get_offset(reg_offset, idx);
+
+       writel(val, hns3_pmu->base + offset);
+}
+
+static u64 hns3_pmu_readq(struct hns3_pmu *hns3_pmu, u32 reg_offset, u32 idx)
+{
+       u32 offset = hns3_pmu_get_offset(reg_offset, idx);
+
+       return readq(hns3_pmu->base + offset);
+}
+
+static void hns3_pmu_writeq(struct hns3_pmu *hns3_pmu, u32 reg_offset, u32 idx,
+                           u64 val)
+{
+       u32 offset = hns3_pmu_get_offset(reg_offset, idx);
+
+       writeq(val, hns3_pmu->base + offset);
+}
+
+static bool hns3_pmu_cmp_event(struct perf_event *target,
+                              struct perf_event *event)
+{
+       return hns3_pmu_get_real_event(target) == hns3_pmu_get_real_event(event);
+}
+
+static int hns3_pmu_find_related_event_idx(struct hns3_pmu *hns3_pmu,
+                                          struct perf_event *event)
+{
+       struct perf_event *sibling;
+       int hw_event_used = 0;
+       int idx;
+
+       for (idx = 0; idx < HNS3_PMU_MAX_HW_EVENTS; idx++) {
+               sibling = hns3_pmu->hw_events[idx];
+               if (!sibling)
+                       continue;
+
+               hw_event_used++;
+
+               if (!hns3_pmu_cmp_event(sibling, event))
+                       continue;
+
+               /* Related events is used in group */
+               if (sibling->group_leader == event->group_leader)
+                       return idx;
+       }
+
+       /* No related event and all hardware events are used up */
+       if (hw_event_used >= HNS3_PMU_MAX_HW_EVENTS)
+               return -EBUSY;
+
+       /* No related event and there is extra hardware events can be use */
+       return -ENOENT;
+}
+
+static int hns3_pmu_get_event_idx(struct hns3_pmu *hns3_pmu)
+{
+       int idx;
+
+       for (idx = 0; idx < HNS3_PMU_MAX_HW_EVENTS; idx++) {
+               if (!hns3_pmu->hw_events[idx])
+                       return idx;
+       }
+
+       return -EBUSY;
+}
+
+static bool hns3_pmu_valid_bdf(struct hns3_pmu *hns3_pmu, u16 bdf)
+{
+       struct pci_dev *pdev;
+
+       if (bdf < hns3_pmu->bdf_min || bdf > hns3_pmu->bdf_max) {
+               pci_err(hns3_pmu->pdev, "Invalid EP device: %#x!\n", bdf);
+               return false;
+       }
+
+       pdev = pci_get_domain_bus_and_slot(pci_domain_nr(hns3_pmu->pdev->bus),
+                                          PCI_BUS_NUM(bdf),
+                                          GET_PCI_DEVFN(bdf));
+       if (!pdev) {
+               pci_err(hns3_pmu->pdev, "Nonexistent EP device: %#x!\n", bdf);
+               return false;
+       }
+
+       pci_dev_put(pdev);
+       return true;
+}
+
+static void hns3_pmu_set_qid_para(struct hns3_pmu *hns3_pmu, u32 idx, u16 bdf,
+                                 u16 queue)
+{
+       u32 val;
+
+       val = GET_PCI_DEVFN(bdf);
+       val |= (u32)queue << HNS3_PMU_QID_PARA_QUEUE_S;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_QID_PARA, idx, val);
+}
+
+static bool hns3_pmu_qid_req_start(struct hns3_pmu *hns3_pmu, u32 idx)
+{
+       bool queue_id_valid = false;
+       u32 reg_qid_ctrl, val;
+       int err;
+
+       /* enable queue id request */
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_QID_CTRL, idx,
+                       HNS3_PMU_QID_CTRL_REQ_ENABLE);
+
+       reg_qid_ctrl = hns3_pmu_get_offset(HNS3_PMU_REG_EVENT_QID_CTRL, idx);
+       err = readl_poll_timeout(hns3_pmu->base + reg_qid_ctrl, val,
+                                val & HNS3_PMU_QID_CTRL_DONE, 1, 1000);
+       if (err == -ETIMEDOUT) {
+               pci_err(hns3_pmu->pdev, "QID request timeout!\n");
+               goto out;
+       }
+
+       queue_id_valid = !(val & HNS3_PMU_QID_CTRL_MISS);
+
+out:
+       /* disable qid request and clear status */
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_QID_CTRL, idx, 0);
+
+       return queue_id_valid;
+}
+
+static bool hns3_pmu_valid_queue(struct hns3_pmu *hns3_pmu, u32 idx, u16 bdf,
+                                u16 queue)
+{
+       hns3_pmu_set_qid_para(hns3_pmu, idx, bdf, queue);
+
+       return hns3_pmu_qid_req_start(hns3_pmu, idx);
+}
+
+static struct hns3_pmu_event_attr *hns3_pmu_get_pmu_event(u32 event)
+{
+       struct hns3_pmu_event_attr *pmu_event;
+       struct dev_ext_attribute *eattr;
+       struct device_attribute *dattr;
+       struct attribute *attr;
+       u32 i;
+
+       for (i = 0; i < ARRAY_SIZE(hns3_pmu_events_attr) - 1; i++) {
+               attr = hns3_pmu_events_attr[i];
+               dattr = container_of(attr, struct device_attribute, attr);
+               eattr = container_of(dattr, struct dev_ext_attribute, attr);
+               pmu_event = eattr->var;
+
+               if (event == pmu_event->event)
+                       return pmu_event;
+       }
+
+       return NULL;
+}
+
+static int hns3_pmu_set_func_mode(struct perf_event *event,
+                                 struct hns3_pmu *hns3_pmu)
+{
+       struct hw_perf_event *hwc = &event->hw;
+       u16 bdf = hns3_pmu_get_bdf(event);
+
+       if (!hns3_pmu_valid_bdf(hns3_pmu, bdf))
+               return -ENOENT;
+
+       HNS3_PMU_SET_HW_FILTER(hwc, HNS3_PMU_HW_FILTER_FUNC);
+
+       return 0;
+}
+
+static int hns3_pmu_set_func_queue_mode(struct perf_event *event,
+                                       struct hns3_pmu *hns3_pmu)
+{
+       u16 queue_id = hns3_pmu_get_queue(event);
+       struct hw_perf_event *hwc = &event->hw;
+       u16 bdf = hns3_pmu_get_bdf(event);
+
+       if (!hns3_pmu_valid_bdf(hns3_pmu, bdf))
+               return -ENOENT;
+
+       if (!hns3_pmu_valid_queue(hns3_pmu, hwc->idx, bdf, queue_id)) {
+               pci_err(hns3_pmu->pdev, "Invalid queue: %u\n", queue_id);
+               return -ENOENT;
+       }
+
+       HNS3_PMU_SET_HW_FILTER(hwc, HNS3_PMU_HW_FILTER_FUNC_QUEUE);
+
+       return 0;
+}
+
+static bool
+hns3_pmu_is_enabled_global_mode(struct perf_event *event,
+                               struct hns3_pmu_event_attr *pmu_event)
+{
+       u8 global = hns3_pmu_get_global(event);
+
+       if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_GLOBAL))
+               return false;
+
+       return global;
+}
+
+static bool hns3_pmu_is_enabled_func_mode(struct perf_event *event,
+                                         struct hns3_pmu_event_attr *pmu_event)
+{
+       u16 queue_id = hns3_pmu_get_queue(event);
+       u16 bdf = hns3_pmu_get_bdf(event);
+
+       if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_FUNC))
+               return false;
+       else if (queue_id != HNS3_PMU_FILTER_ALL_QUEUE)
+               return false;
+
+       return bdf;
+}
+
+static bool
+hns3_pmu_is_enabled_func_queue_mode(struct perf_event *event,
+                                   struct hns3_pmu_event_attr *pmu_event)
+{
+       u16 queue_id = hns3_pmu_get_queue(event);
+       u16 bdf = hns3_pmu_get_bdf(event);
+
+       if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_FUNC_QUEUE))
+               return false;
+       else if (queue_id == HNS3_PMU_FILTER_ALL_QUEUE)
+               return false;
+
+       return bdf;
+}
+
+static bool hns3_pmu_is_enabled_port_mode(struct perf_event *event,
+                                         struct hns3_pmu_event_attr *pmu_event)
+{
+       u8 tc_id = hns3_pmu_get_tc(event);
+
+       if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_PORT))
+               return false;
+
+       return tc_id == HNS3_PMU_FILTER_ALL_TC;
+}
+
+static bool
+hns3_pmu_is_enabled_port_tc_mode(struct perf_event *event,
+                                struct hns3_pmu_event_attr *pmu_event)
+{
+       u8 tc_id = hns3_pmu_get_tc(event);
+
+       if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_PORT_TC))
+               return false;
+
+       return tc_id != HNS3_PMU_FILTER_ALL_TC;
+}
+
+static bool
+hns3_pmu_is_enabled_func_intr_mode(struct perf_event *event,
+                                  struct hns3_pmu *hns3_pmu,
+                                  struct hns3_pmu_event_attr *pmu_event)
+{
+       u16 bdf = hns3_pmu_get_bdf(event);
+
+       if (!(pmu_event->filter_support & HNS3_PMU_FILTER_SUPPORT_FUNC_INTR))
+               return false;
+
+       return hns3_pmu_valid_bdf(hns3_pmu, bdf);
+}
+
+static int hns3_pmu_select_filter_mode(struct perf_event *event,
+                                      struct hns3_pmu *hns3_pmu)
+{
+       u32 event_id = hns3_pmu_get_event(event);
+       struct hw_perf_event *hwc = &event->hw;
+       struct hns3_pmu_event_attr *pmu_event;
+
+       pmu_event = hns3_pmu_get_pmu_event(event_id);
+       if (!pmu_event) {
+               pci_err(hns3_pmu->pdev, "Invalid pmu event\n");
+               return -ENOENT;
+       }
+
+       if (hns3_pmu_is_enabled_global_mode(event, pmu_event)) {
+               HNS3_PMU_SET_HW_FILTER(hwc, HNS3_PMU_HW_FILTER_GLOBAL);
+               return 0;
+       }
+
+       if (hns3_pmu_is_enabled_func_mode(event, pmu_event))
+               return hns3_pmu_set_func_mode(event, hns3_pmu);
+
+       if (hns3_pmu_is_enabled_func_queue_mode(event, pmu_event))
+               return hns3_pmu_set_func_queue_mode(event, hns3_pmu);
+
+       if (hns3_pmu_is_enabled_port_mode(event, pmu_event)) {
+               HNS3_PMU_SET_HW_FILTER(hwc, HNS3_PMU_HW_FILTER_PORT);
+               return 0;
+       }
+
+       if (hns3_pmu_is_enabled_port_tc_mode(event, pmu_event)) {
+               HNS3_PMU_SET_HW_FILTER(hwc, HNS3_PMU_HW_FILTER_PORT_TC);
+               return 0;
+       }
+
+       if (hns3_pmu_is_enabled_func_intr_mode(event, hns3_pmu, pmu_event)) {
+               HNS3_PMU_SET_HW_FILTER(hwc, HNS3_PMU_HW_FILTER_FUNC_INTR);
+               return 0;
+       }
+
+       return -ENOENT;
+}
+
+static bool hns3_pmu_validate_event_group(struct perf_event *event)
+{
+       struct perf_event *sibling, *leader = event->group_leader;
+       struct perf_event *event_group[HNS3_PMU_MAX_HW_EVENTS];
+       int counters = 1;
+       int num;
+
+       event_group[0] = leader;
+       if (!is_software_event(leader)) {
+               if (leader->pmu != event->pmu)
+                       return false;
+
+               if (leader != event && !hns3_pmu_cmp_event(leader, event))
+                       event_group[counters++] = event;
+       }
+
+       for_each_sibling_event(sibling, event->group_leader) {
+               if (is_software_event(sibling))
+                       continue;
+
+               if (sibling->pmu != event->pmu)
+                       return false;
+
+               for (num = 0; num < counters; num++) {
+                       if (hns3_pmu_cmp_event(event_group[num], sibling))
+                               break;
+               }
+
+               if (num == counters)
+                       event_group[counters++] = sibling;
+       }
+
+       return counters <= HNS3_PMU_MAX_HW_EVENTS;
+}
+
+static u32 hns3_pmu_get_filter_condition(struct perf_event *event)
+{
+       struct hw_perf_event *hwc = &event->hw;
+       u16 intr_id = hns3_pmu_get_intr(event);
+       u8 port_id = hns3_pmu_get_port(event);
+       u16 bdf = hns3_pmu_get_bdf(event);
+       u8 tc_id = hns3_pmu_get_tc(event);
+       u8 filter_mode;
+
+       filter_mode = *(u8 *)hwc->addr_filters;
+       switch (filter_mode) {
+       case HNS3_PMU_HW_FILTER_PORT:
+               return FILTER_CONDITION_PORT(port_id);
+       case HNS3_PMU_HW_FILTER_PORT_TC:
+               return FILTER_CONDITION_PORT_TC(port_id, tc_id);
+       case HNS3_PMU_HW_FILTER_FUNC:
+       case HNS3_PMU_HW_FILTER_FUNC_QUEUE:
+               return GET_PCI_DEVFN(bdf);
+       case HNS3_PMU_HW_FILTER_FUNC_INTR:
+               return FILTER_CONDITION_FUNC_INTR(GET_PCI_DEVFN(bdf), intr_id);
+       default:
+               break;
+       }
+
+       return 0;
+}
+
+static void hns3_pmu_config_filter(struct perf_event *event)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       u8 event_type = hns3_pmu_get_event_type(event);
+       u8 subevent_id = hns3_pmu_get_subevent(event);
+       u16 queue_id = hns3_pmu_get_queue(event);
+       struct hw_perf_event *hwc = &event->hw;
+       u8 filter_mode = *(u8 *)hwc->addr_filters;
+       u16 bdf = hns3_pmu_get_bdf(event);
+       u32 idx = hwc->idx;
+       u32 val;
+
+       val = event_type;
+       val |= subevent_id << HNS3_PMU_CTRL_SUBEVENT_S;
+       val |= filter_mode << HNS3_PMU_CTRL_FILTER_MODE_S;
+       val |= HNS3_PMU_EVENT_OVERFLOW_RESTART;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx, val);
+
+       val = hns3_pmu_get_filter_condition(event);
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_HIGH, idx, val);
+
+       if (filter_mode == HNS3_PMU_HW_FILTER_FUNC_QUEUE)
+               hns3_pmu_set_qid_para(hns3_pmu, idx, bdf, queue_id);
+}
+
+static void hns3_pmu_enable_counter(struct hns3_pmu *hns3_pmu,
+                                   struct hw_perf_event *hwc)
+{
+       u32 idx = hwc->idx;
+       u32 val;
+
+       val = hns3_pmu_readl(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx);
+       val |= HNS3_PMU_EVENT_EN;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx, val);
+}
+
+static void hns3_pmu_disable_counter(struct hns3_pmu *hns3_pmu,
+                                    struct hw_perf_event *hwc)
+{
+       u32 idx = hwc->idx;
+       u32 val;
+
+       val = hns3_pmu_readl(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx);
+       val &= ~HNS3_PMU_EVENT_EN;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx, val);
+}
+
+static void hns3_pmu_enable_intr(struct hns3_pmu *hns3_pmu,
+                                struct hw_perf_event *hwc)
+{
+       u32 idx = hwc->idx;
+       u32 val;
+
+       val = hns3_pmu_readl(hns3_pmu, HNS3_PMU_REG_EVENT_INTR_MASK, idx);
+       val &= ~HNS3_PMU_INTR_MASK_OVERFLOW;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_INTR_MASK, idx, val);
+}
+
+static void hns3_pmu_disable_intr(struct hns3_pmu *hns3_pmu,
+                                 struct hw_perf_event *hwc)
+{
+       u32 idx = hwc->idx;
+       u32 val;
+
+       val = hns3_pmu_readl(hns3_pmu, HNS3_PMU_REG_EVENT_INTR_MASK, idx);
+       val |= HNS3_PMU_INTR_MASK_OVERFLOW;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_INTR_MASK, idx, val);
+}
+
+static void hns3_pmu_clear_intr_status(struct hns3_pmu *hns3_pmu, u32 idx)
+{
+       u32 val;
+
+       val = hns3_pmu_readl(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx);
+       val |= HNS3_PMU_EVENT_STATUS_RESET;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx, val);
+
+       val = hns3_pmu_readl(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx);
+       val &= ~HNS3_PMU_EVENT_STATUS_RESET;
+       hns3_pmu_writel(hns3_pmu, HNS3_PMU_REG_EVENT_CTRL_LOW, idx, val);
+}
+
+static u64 hns3_pmu_read_counter(struct perf_event *event)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+
+       return hns3_pmu_readq(hns3_pmu, event->hw.event_base, event->hw.idx);
+}
+
+static void hns3_pmu_write_counter(struct perf_event *event, u64 value)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       u32 idx = event->hw.idx;
+
+       hns3_pmu_writeq(hns3_pmu, HNS3_PMU_REG_EVENT_COUNTER, idx, value);
+       hns3_pmu_writeq(hns3_pmu, HNS3_PMU_REG_EVENT_EXT_COUNTER, idx, value);
+}
+
+static void hns3_pmu_init_counter(struct perf_event *event)
+{
+       struct hw_perf_event *hwc = &event->hw;
+
+       local64_set(&hwc->prev_count, 0);
+       hns3_pmu_write_counter(event, 0);
+}
+
+static int hns3_pmu_event_init(struct perf_event *event)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       struct hw_perf_event *hwc = &event->hw;
+       int idx;
+       int ret;
+
+       if (event->attr.type != event->pmu->type)
+               return -ENOENT;
+
+       /* Sampling is not supported */
+       if (is_sampling_event(event) || event->attach_state & PERF_ATTACH_TASK)
+               return -EOPNOTSUPP;
+
+       event->cpu = hns3_pmu->on_cpu;
+
+       idx = hns3_pmu_get_event_idx(hns3_pmu);
+       if (idx < 0) {
+               pci_err(hns3_pmu->pdev, "Up to %u events are supported!\n",
+                       HNS3_PMU_MAX_HW_EVENTS);
+               return -EBUSY;
+       }
+
+       hwc->idx = idx;
+
+       ret = hns3_pmu_select_filter_mode(event, hns3_pmu);
+       if (ret) {
+               pci_err(hns3_pmu->pdev, "Invalid filter, ret = %d.\n", ret);
+               return ret;
+       }
+
+       if (!hns3_pmu_validate_event_group(event)) {
+               pci_err(hns3_pmu->pdev, "Invalid event group.\n");
+               return -EINVAL;
+       }
+
+       if (hns3_pmu_get_ext_counter_used(event))
+               hwc->event_base = HNS3_PMU_REG_EVENT_EXT_COUNTER;
+       else
+               hwc->event_base = HNS3_PMU_REG_EVENT_COUNTER;
+
+       return 0;
+}
+
+static void hns3_pmu_read(struct perf_event *event)
+{
+       struct hw_perf_event *hwc = &event->hw;
+       u64 new_cnt, prev_cnt, delta;
+
+       do {
+               prev_cnt = local64_read(&hwc->prev_count);
+               new_cnt = hns3_pmu_read_counter(event);
+       } while (local64_cmpxchg(&hwc->prev_count, prev_cnt, new_cnt) !=
+                prev_cnt);
+
+       delta = new_cnt - prev_cnt;
+       local64_add(delta, &event->count);
+}
+
+static void hns3_pmu_start(struct perf_event *event, int flags)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       struct hw_perf_event *hwc = &event->hw;
+
+       if (WARN_ON_ONCE(!(hwc->state & PERF_HES_STOPPED)))
+               return;
+
+       WARN_ON_ONCE(!(hwc->state & PERF_HES_UPTODATE));
+       hwc->state = 0;
+
+       hns3_pmu_config_filter(event);
+       hns3_pmu_init_counter(event);
+       hns3_pmu_enable_intr(hns3_pmu, hwc);
+       hns3_pmu_enable_counter(hns3_pmu, hwc);
+
+       perf_event_update_userpage(event);
+}
+
+static void hns3_pmu_stop(struct perf_event *event, int flags)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       struct hw_perf_event *hwc = &event->hw;
+
+       hns3_pmu_disable_counter(hns3_pmu, hwc);
+       hns3_pmu_disable_intr(hns3_pmu, hwc);
+
+       WARN_ON_ONCE(hwc->state & PERF_HES_STOPPED);
+       hwc->state |= PERF_HES_STOPPED;
+
+       if (hwc->state & PERF_HES_UPTODATE)
+               return;
+
+       /* Read hardware counter and update the perf counter statistics */
+       hns3_pmu_read(event);
+       hwc->state |= PERF_HES_UPTODATE;
+}
+
+static int hns3_pmu_add(struct perf_event *event, int flags)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       struct hw_perf_event *hwc = &event->hw;
+       int idx;
+
+       hwc->state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
+
+       /* Check all working events to find a related event. */
+       idx = hns3_pmu_find_related_event_idx(hns3_pmu, event);
+       if (idx < 0 && idx != -ENOENT)
+               return idx;
+
+       /* Current event shares an enabled hardware event with related event */
+       if (idx >= 0 && idx < HNS3_PMU_MAX_HW_EVENTS) {
+               hwc->idx = idx;
+               goto start_count;
+       }
+
+       idx = hns3_pmu_get_event_idx(hns3_pmu);
+       if (idx < 0)
+               return idx;
+
+       hwc->idx = idx;
+       hns3_pmu->hw_events[idx] = event;
+
+start_count:
+       if (flags & PERF_EF_START)
+               hns3_pmu_start(event, PERF_EF_RELOAD);
+
+       return 0;
+}
+
+static void hns3_pmu_del(struct perf_event *event, int flags)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(event->pmu);
+       struct hw_perf_event *hwc = &event->hw;
+
+       hns3_pmu_stop(event, PERF_EF_UPDATE);
+       hns3_pmu->hw_events[hwc->idx] = NULL;
+       perf_event_update_userpage(event);
+}
+
+static void hns3_pmu_enable(struct pmu *pmu)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(pmu);
+       u32 val;
+
+       val = readl(hns3_pmu->base + HNS3_PMU_REG_GLOBAL_CTRL);
+       val |= HNS3_PMU_GLOBAL_START;
+       writel(val, hns3_pmu->base + HNS3_PMU_REG_GLOBAL_CTRL);
+}
+
+static void hns3_pmu_disable(struct pmu *pmu)
+{
+       struct hns3_pmu *hns3_pmu = to_hns3_pmu(pmu);
+       u32 val;
+
+       val = readl(hns3_pmu->base + HNS3_PMU_REG_GLOBAL_CTRL);
+       val &= ~HNS3_PMU_GLOBAL_START;
+       writel(val, hns3_pmu->base + HNS3_PMU_REG_GLOBAL_CTRL);
+}
+
+static int hns3_pmu_alloc_pmu(struct pci_dev *pdev, struct hns3_pmu *hns3_pmu)
+{
+       u16 device_id;
+       char *name;
+       u32 val;
+
+       hns3_pmu->base = pcim_iomap_table(pdev)[BAR_2];
+       if (!hns3_pmu->base) {
+               pci_err(pdev, "ioremap failed\n");
+               return -ENOMEM;
+       }
+
+       hns3_pmu->hw_clk_freq = readl(hns3_pmu->base + HNS3_PMU_REG_CLOCK_FREQ);
+
+       val = readl(hns3_pmu->base + HNS3_PMU_REG_BDF);
+       hns3_pmu->bdf_min = val & 0xffff;
+       hns3_pmu->bdf_max = val >> 16;
+
+       val = readl(hns3_pmu->base + HNS3_PMU_REG_DEVICE_ID);
+       device_id = val & 0xffff;
+       name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "hns3_pmu_sicl_%u", device_id);
+       if (!name)
+               return -ENOMEM;
+
+       hns3_pmu->pdev = pdev;
+       hns3_pmu->on_cpu = -1;
+       hns3_pmu->identifier = readl(hns3_pmu->base + HNS3_PMU_REG_VERSION);
+       hns3_pmu->pmu = (struct pmu) {
+               .name           = name,
+               .module         = THIS_MODULE,
+               .event_init     = hns3_pmu_event_init,
+               .pmu_enable     = hns3_pmu_enable,
+               .pmu_disable    = hns3_pmu_disable,
+               .add            = hns3_pmu_add,
+               .del            = hns3_pmu_del,
+               .start          = hns3_pmu_start,
+               .stop           = hns3_pmu_stop,
+               .read           = hns3_pmu_read,
+               .task_ctx_nr    = perf_invalid_context,
+               .attr_groups    = hns3_pmu_attr_groups,
+               .capabilities   = PERF_PMU_CAP_NO_EXCLUDE,
+       };
+
+       return 0;
+}
+
+static irqreturn_t hns3_pmu_irq(int irq, void *data)
+{
+       struct hns3_pmu *hns3_pmu = data;
+       u32 intr_status, idx;
+
+       for (idx = 0; idx < HNS3_PMU_MAX_HW_EVENTS; idx++) {
+               intr_status = hns3_pmu_readl(hns3_pmu,
+                                            HNS3_PMU_REG_EVENT_INTR_STATUS,
+                                            idx);
+
+               /*
+                * As each counter will restart from 0 when it is overflowed,
+                * extra processing is no need, just clear interrupt status.
+                */
+               if (intr_status)
+                       hns3_pmu_clear_intr_status(hns3_pmu, idx);
+       }
+
+       return IRQ_HANDLED;
+}
+
+static int hns3_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
+{
+       struct hns3_pmu *hns3_pmu;
+
+       hns3_pmu = hlist_entry_safe(node, struct hns3_pmu, node);
+       if (!hns3_pmu)
+               return -ENODEV;
+
+       if (hns3_pmu->on_cpu == -1) {
+               hns3_pmu->on_cpu = cpu;
+               irq_set_affinity(hns3_pmu->irq, cpumask_of(cpu));
+       }
+
+       return 0;
+}
+
+static int hns3_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
+{
+       struct hns3_pmu *hns3_pmu;
+       unsigned int target;
+
+       hns3_pmu = hlist_entry_safe(node, struct hns3_pmu, node);
+       if (!hns3_pmu)
+               return -ENODEV;
+
+       /* Nothing to do if this CPU doesn't own the PMU */
+       if (hns3_pmu->on_cpu != cpu)
+               return 0;
+
+       /* Choose a new CPU from all online cpus */
+       target = cpumask_any_but(cpu_online_mask, cpu);
+       if (target >= nr_cpu_ids)
+               return 0;
+
+       perf_pmu_migrate_context(&hns3_pmu->pmu, cpu, target);
+       hns3_pmu->on_cpu = target;
+       irq_set_affinity(hns3_pmu->irq, cpumask_of(target));
+
+       return 0;
+}
+
+static void hns3_pmu_free_irq(void *data)
+{
+       struct pci_dev *pdev = data;
+
+       pci_free_irq_vectors(pdev);
+}
+
+static int hns3_pmu_irq_register(struct pci_dev *pdev,
+                                struct hns3_pmu *hns3_pmu)
+{
+       int irq, ret;
+
+       ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
+       if (ret < 0) {
+               pci_err(pdev, "failed to enable MSI vectors, ret = %d.\n", ret);
+               return ret;
+       }
+
+       ret = devm_add_action(&pdev->dev, hns3_pmu_free_irq, pdev);
+       if (ret) {
+               pci_err(pdev, "failed to add free irq action, ret = %d.\n", ret);
+               return ret;
+       }
+
+       irq = pci_irq_vector(pdev, 0);
+       ret = devm_request_irq(&pdev->dev, irq, hns3_pmu_irq, 0,
+                              hns3_pmu->pmu.name, hns3_pmu);
+       if (ret) {
+               pci_err(pdev, "failed to register irq, ret = %d.\n", ret);
+               return ret;
+       }
+
+       hns3_pmu->irq = irq;
+
+       return 0;
+}
+
+static int hns3_pmu_init_pmu(struct pci_dev *pdev, struct hns3_pmu *hns3_pmu)
+{
+       int ret;
+
+       ret = hns3_pmu_alloc_pmu(pdev, hns3_pmu);
+       if (ret)
+               return ret;
+
+       ret = hns3_pmu_irq_register(pdev, hns3_pmu);
+       if (ret)
+               return ret;
+
+       ret = cpuhp_state_add_instance(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE,
+                                      &hns3_pmu->node);
+       if (ret) {
+               pci_err(pdev, "failed to register hotplug, ret = %d.\n", ret);
+               return ret;
+       }
+
+       ret = perf_pmu_register(&hns3_pmu->pmu, hns3_pmu->pmu.name, -1);
+       if (ret) {
+               pci_err(pdev, "failed to register perf PMU, ret = %d.\n", ret);
+               cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE,
+                                           &hns3_pmu->node);
+       }
+
+       return ret;
+}
+
+static void hns3_pmu_uninit_pmu(struct pci_dev *pdev)
+{
+       struct hns3_pmu *hns3_pmu = pci_get_drvdata(pdev);
+
+       perf_pmu_unregister(&hns3_pmu->pmu);
+       cpuhp_state_remove_instance(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE,
+                                   &hns3_pmu->node);
+}
+
+static int hns3_pmu_init_dev(struct pci_dev *pdev)
+{
+       int ret;
+
+       ret = pcim_enable_device(pdev);
+       if (ret) {
+               pci_err(pdev, "failed to enable pci device, ret = %d.\n", ret);
+               return ret;
+       }
+
+       ret = pcim_iomap_regions(pdev, BIT(BAR_2), "hns3_pmu");
+       if (ret < 0) {
+               pci_err(pdev, "failed to request pci region, ret = %d.\n", ret);
+               return ret;
+       }
+
+       pci_set_master(pdev);
+
+       return 0;
+}
+
+static int hns3_pmu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+       struct hns3_pmu *hns3_pmu;
+       int ret;
+
+       hns3_pmu = devm_kzalloc(&pdev->dev, sizeof(*hns3_pmu), GFP_KERNEL);
+       if (!hns3_pmu)
+               return -ENOMEM;
+
+       ret = hns3_pmu_init_dev(pdev);
+       if (ret)
+               return ret;
+
+       ret = hns3_pmu_init_pmu(pdev, hns3_pmu);
+       if (ret) {
+               pci_clear_master(pdev);
+               return ret;
+       }
+
+       pci_set_drvdata(pdev, hns3_pmu);
+
+       return ret;
+}
+
+static void hns3_pmu_remove(struct pci_dev *pdev)
+{
+       hns3_pmu_uninit_pmu(pdev);
+       pci_clear_master(pdev);
+       pci_set_drvdata(pdev, NULL);
+}
+
+static const struct pci_device_id hns3_pmu_ids[] = {
+       { PCI_DEVICE(PCI_VENDOR_ID_HUAWEI, 0xa22b) },
+       { 0, }
+};
+MODULE_DEVICE_TABLE(pci, hns3_pmu_ids);
+
+static struct pci_driver hns3_pmu_driver = {
+       .name = "hns3_pmu",
+       .id_table = hns3_pmu_ids,
+       .probe = hns3_pmu_probe,
+       .remove = hns3_pmu_remove,
+};
+
+static int __init hns3_pmu_module_init(void)
+{
+       int ret;
+
+       ret = cpuhp_setup_state_multi(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE,
+                                     "AP_PERF_ARM_HNS3_PMU_ONLINE",
+                                     hns3_pmu_online_cpu,
+                                     hns3_pmu_offline_cpu);
+       if (ret) {
+               pr_err("failed to setup HNS3 PMU hotplug, ret = %d.\n", ret);
+               return ret;
+       }
+
+       ret = pci_register_driver(&hns3_pmu_driver);
+       if (ret) {
+               pr_err("failed to register pci driver, ret = %d.\n", ret);
+               cpuhp_remove_multi_state(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE);
+       }
+
+       return ret;
+}
+module_init(hns3_pmu_module_init);
+
+static void __exit hns3_pmu_module_exit(void)
+{
+       pci_unregister_driver(&hns3_pmu_driver);
+       cpuhp_remove_multi_state(CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE);
+}
+module_exit(hns3_pmu_module_exit);
+
+MODULE_DESCRIPTION("HNS3 PMU driver");
+MODULE_LICENSE("GPL v2");
index 282d3a071a67c661de6986d53a31dfd34a0186f2..69c3050a4348b5792b70880e60d94a846aa46dfc 100644 (file)
@@ -2,10 +2,6 @@
 /* Marvell CN10K LLC-TAD perf driver
  *
  * Copyright (C) 2021 Marvell
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #define pr_fmt(fmt) "tad_pmu: " fmt
@@ -18,9 +14,9 @@
 #include <linux/perf_event.h>
 #include <linux/platform_device.h>
 
-#define TAD_PFC_OFFSET         0x0
+#define TAD_PFC_OFFSET         0x800
 #define TAD_PFC(counter)       (TAD_PFC_OFFSET | (counter << 3))
-#define TAD_PRF_OFFSET         0x100
+#define TAD_PRF_OFFSET         0x900
 #define TAD_PRF(counter)       (TAD_PRF_OFFSET | (counter << 3))
 #define TAD_PRF_CNTSEL_MASK    0xFF
 #define TAD_MAX_COUNTERS       8
@@ -100,9 +96,7 @@ static void tad_pmu_event_counter_start(struct perf_event *event, int flags)
         * which sets TAD()_PRF()[CNTSEL] != 0
         */
        for (i = 0; i < tad_pmu->region_cnt; i++) {
-               reg_val = readq_relaxed(tad_pmu->regions[i].base +
-                                       TAD_PRF(counter_idx));
-               reg_val |= (event_idx & 0xFF);
+               reg_val = event_idx & 0xFF;
                writeq_relaxed(reg_val, tad_pmu->regions[i].base +
                               TAD_PRF(counter_idx));
        }
index b2b8d2074ed0dc24e372df593ebdd71775511cfc..2c961839903d68c79091b25fb73c7f4281d6ed88 100644 (file)
@@ -121,7 +121,7 @@ u64 riscv_pmu_event_update(struct perf_event *event)
        return delta;
 }
 
-static void riscv_pmu_stop(struct perf_event *event, int flags)
+void riscv_pmu_stop(struct perf_event *event, int flags)
 {
        struct hw_perf_event *hwc = &event->hw;
        struct riscv_pmu *rvpmu = to_riscv_pmu(event->pmu);
@@ -175,7 +175,7 @@ int riscv_pmu_event_set_period(struct perf_event *event)
        return overflow;
 }
 
-static void riscv_pmu_start(struct perf_event *event, int flags)
+void riscv_pmu_start(struct perf_event *event, int flags)
 {
        struct hw_perf_event *hwc = &event->hw;
        struct riscv_pmu *rvpmu = to_riscv_pmu(event->pmu);
index dca3537a8dccea33ed61e070138e31a8588b9adc..79a3de515ece6ba2f3c6218906d5c31f44e9ea82 100644 (file)
 #include <linux/irqdomain.h>
 #include <linux/of_irq.h>
 #include <linux/of.h>
+#include <linux/cpu_pm.h>
 
 #include <asm/sbi.h>
 #include <asm/hwcap.h>
 
+PMU_FORMAT_ATTR(event, "config:0-47");
+PMU_FORMAT_ATTR(firmware, "config:63");
+
+static struct attribute *riscv_arch_formats_attr[] = {
+       &format_attr_event.attr,
+       &format_attr_firmware.attr,
+       NULL,
+};
+
+static struct attribute_group riscv_pmu_format_group = {
+       .name = "format",
+       .attrs = riscv_arch_formats_attr,
+};
+
+static const struct attribute_group *riscv_pmu_attr_groups[] = {
+       &riscv_pmu_format_group,
+       NULL,
+};
+
 union sbi_pmu_ctr_info {
        unsigned long value;
        struct {
@@ -666,12 +686,15 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde
                child = of_get_compatible_child(cpu, "riscv,cpu-intc");
                if (!child) {
                        pr_err("Failed to find INTC node\n");
+                       of_node_put(cpu);
                        return -ENODEV;
                }
                domain = irq_find_host(child);
                of_node_put(child);
-               if (domain)
+               if (domain) {
+                       of_node_put(cpu);
                        break;
+               }
        }
        if (!domain) {
                pr_err("Failed to find INTC IRQ root domain\n");
@@ -693,6 +716,73 @@ static int pmu_sbi_setup_irqs(struct riscv_pmu *pmu, struct platform_device *pde
        return 0;
 }
 
+#ifdef CONFIG_CPU_PM
+static int riscv_pm_pmu_notify(struct notifier_block *b, unsigned long cmd,
+                               void *v)
+{
+       struct riscv_pmu *rvpmu = container_of(b, struct riscv_pmu, riscv_pm_nb);
+       struct cpu_hw_events *cpuc = this_cpu_ptr(rvpmu->hw_events);
+       int enabled = bitmap_weight(cpuc->used_hw_ctrs, RISCV_MAX_COUNTERS);
+       struct perf_event *event;
+       int idx;
+
+       if (!enabled)
+               return NOTIFY_OK;
+
+       for (idx = 0; idx < RISCV_MAX_COUNTERS; idx++) {
+               event = cpuc->events[idx];
+               if (!event)
+                       continue;
+
+               switch (cmd) {
+               case CPU_PM_ENTER:
+                       /*
+                        * Stop and update the counter
+                        */
+                       riscv_pmu_stop(event, PERF_EF_UPDATE);
+                       break;
+               case CPU_PM_EXIT:
+               case CPU_PM_ENTER_FAILED:
+                       /*
+                        * Restore and enable the counter.
+                        *
+                        * Requires RCU read locking to be functional,
+                        * wrap the call within RCU_NONIDLE to make the
+                        * RCU subsystem aware this cpu is not idle from
+                        * an RCU perspective for the riscv_pmu_start() call
+                        * duration.
+                        */
+                       RCU_NONIDLE(riscv_pmu_start(event, PERF_EF_RELOAD));
+                       break;
+               default:
+                       break;
+               }
+       }
+
+       return NOTIFY_OK;
+}
+
+static int riscv_pm_pmu_register(struct riscv_pmu *pmu)
+{
+       pmu->riscv_pm_nb.notifier_call = riscv_pm_pmu_notify;
+       return cpu_pm_register_notifier(&pmu->riscv_pm_nb);
+}
+
+static void riscv_pm_pmu_unregister(struct riscv_pmu *pmu)
+{
+       cpu_pm_unregister_notifier(&pmu->riscv_pm_nb);
+}
+#else
+static inline int riscv_pm_pmu_register(struct riscv_pmu *pmu) { return 0; }
+static inline void riscv_pm_pmu_unregister(struct riscv_pmu *pmu) { }
+#endif
+
+static void riscv_pmu_destroy(struct riscv_pmu *pmu)
+{
+       riscv_pm_pmu_unregister(pmu);
+       cpuhp_state_remove_instance(CPUHP_AP_PERF_RISCV_STARTING, &pmu->node);
+}
+
 static int pmu_sbi_device_probe(struct platform_device *pdev)
 {
        struct riscv_pmu *pmu = NULL;
@@ -720,6 +810,7 @@ static int pmu_sbi_device_probe(struct platform_device *pdev)
                pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
                pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE;
        }
+       pmu->pmu.attr_groups = riscv_pmu_attr_groups;
        pmu->num_counters = num_counters;
        pmu->ctr_start = pmu_sbi_ctr_start;
        pmu->ctr_stop = pmu_sbi_ctr_stop;
@@ -733,14 +824,19 @@ static int pmu_sbi_device_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
+       ret = riscv_pm_pmu_register(pmu);
+       if (ret)
+               goto out_unregister;
+
        ret = perf_pmu_register(&pmu->pmu, "cpu", PERF_TYPE_RAW);
-       if (ret) {
-               cpuhp_state_remove_instance(CPUHP_AP_PERF_RISCV_STARTING, &pmu->node);
-               return ret;
-       }
+       if (ret)
+               goto out_unregister;
 
        return 0;
 
+out_unregister:
+       riscv_pmu_destroy(pmu);
+
 out_free:
        kfree(pmu);
        return ret;
index 849c4204f550691f5fb66cf9afceb80b0c522d4c..93a6a8ee47167313251b3823a55aa67090e8bab5 100644 (file)
@@ -83,7 +83,7 @@ config PHY_NS2_USB_DRD
 config PHY_BRCM_SATA
        tristate "Broadcom SATA PHY driver"
        depends on ARCH_BRCMSTB || ARCH_BCM_IPROC || BMIPS_GENERIC || \
-                  ARCH_BCM_63XX || COMPILE_TEST
+                  ARCH_BCMBCA || COMPILE_TEST
        depends on OF
        select GENERIC_PHY
        default ARCH_BCM_IPROC
index dfc8ea9f3843cfcf57d45fa920871b15a7341b9b..771dd1f4fbe04858586368081469470540096cdc 100644 (file)
@@ -1810,6 +1810,7 @@ static void ocelot_irq_mask(struct irq_data *data)
 
        regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio),
                           BIT(gpio % 32), 0);
+       gpiochip_disable_irq(chip, gpio);
 }
 
 static void ocelot_irq_unmask(struct irq_data *data)
@@ -1818,6 +1819,7 @@ static void ocelot_irq_unmask(struct irq_data *data)
        struct ocelot_pinctrl *info = gpiochip_get_data(chip);
        unsigned int gpio = irqd_to_hwirq(data);
 
+       gpiochip_enable_irq(chip, gpio);
        regmap_update_bits(info->map, REG(OCELOT_GPIO_INTR_ENA, info, gpio),
                           BIT(gpio % 32), BIT(gpio % 32));
 }
@@ -1839,8 +1841,10 @@ static struct irq_chip ocelot_eoi_irqchip = {
        .irq_mask       = ocelot_irq_mask,
        .irq_eoi        = ocelot_irq_ack,
        .irq_unmask     = ocelot_irq_unmask,
-       .flags          = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED,
+       .flags          = IRQCHIP_EOI_THREADED | IRQCHIP_EOI_IF_HANDLED |
+                         IRQCHIP_IMMUTABLE,
        .irq_set_type   = ocelot_irq_set_type,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS
 };
 
 static struct irq_chip ocelot_irqchip = {
@@ -1849,6 +1853,8 @@ static struct irq_chip ocelot_irqchip = {
        .irq_ack        = ocelot_irq_ack,
        .irq_unmask     = ocelot_irq_unmask,
        .irq_set_type   = ocelot_irq_set_type,
+       .flags          = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS
 };
 
 static int ocelot_irq_set_type(struct irq_data *data, unsigned int type)
@@ -1912,7 +1918,7 @@ static int ocelot_gpiochip_register(struct platform_device *pdev,
        irq = platform_get_irq_optional(pdev, 0);
        if (irq > 0) {
                girq = &gc->irq;
-               girq->chip = &ocelot_irqchip;
+               gpio_irq_chip_set_chip(girq, &ocelot_irqchip);
                girq->parent_handler = ocelot_irq_handler;
                girq->num_parents = 1;
                girq->parents = devm_kcalloc(&pdev->dev, 1,
index fd5fff9adff083e64b734253f4c65b3902035266..3be2a08ae3a6aab5d4c798b9ef4f8e842793f724 100644 (file)
@@ -966,16 +966,13 @@ static int pmic_gpio_child_to_parent_hwirq(struct gpio_chip *chip,
        return 0;
 }
 
-static void *pmic_gpio_populate_parent_fwspec(struct gpio_chip *chip,
-                                            unsigned int parent_hwirq,
-                                            unsigned int parent_type)
+static int pmic_gpio_populate_parent_fwspec(struct gpio_chip *chip,
+                                           union gpio_irq_fwspec *gfwspec,
+                                           unsigned int parent_hwirq,
+                                           unsigned int parent_type)
 {
        struct pmic_gpio_state *state = gpiochip_get_data(chip);
-       struct irq_fwspec *fwspec;
-
-       fwspec = kzalloc(sizeof(*fwspec), GFP_KERNEL);
-       if (!fwspec)
-               return NULL;
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
 
        fwspec->fwnode = chip->irq.parent_domain->fwnode;
 
@@ -985,7 +982,7 @@ static void *pmic_gpio_populate_parent_fwspec(struct gpio_chip *chip,
        /* param[2] must be left as 0 */
        fwspec->param[3] = parent_type;
 
-       return fwspec;
+       return 0;
 }
 
 static int pmic_gpio_probe(struct platform_device *pdev)
index a48cac55152cefa37b26803d28a9084716bdeb47..c47eed9d948fd0e68910d5691a451f042f974b9b 100644 (file)
@@ -9,8 +9,10 @@
 #include <linux/clk.h>
 #include <linux/gpio/driver.h>
 #include <linux/io.h>
+#include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinconf.h>
 #include <linux/pinctrl/pinctrl.h>
@@ -89,6 +91,7 @@
 #define PIN(n)                 (0x0800 + 0x10 + (n))
 #define IOLH(n)                        (0x1000 + (n) * 8)
 #define IEN(n)                 (0x1800 + (n) * 8)
+#define ISEL(n)                        (0x2c80 + (n) * 8)
 #define PWPR                   (0x3014)
 #define SD_CH(n)               (0x3000 + (n) * 4)
 #define QSPI                   (0x3008)
 #define RZG2L_PIN_ID_TO_PORT_OFFSET(id)        (RZG2L_PIN_ID_TO_PORT(id) + 0x10)
 #define RZG2L_PIN_ID_TO_PIN(id)                ((id) % RZG2L_PINS_PER_PORT)
 
+#define RZG2L_TINT_MAX_INTERRUPT       32
+#define RZG2L_TINT_IRQ_START_INDEX     9
+#define RZG2L_PACK_HWIRQ(t, i)         (((t) << 16) | (i))
+
 struct rzg2l_dedicated_configs {
        const char *name;
        u32 config;
@@ -137,6 +144,9 @@ struct rzg2l_pinctrl {
 
        struct gpio_chip                gpio_chip;
        struct pinctrl_gpio_range       gpio_range;
+       DECLARE_BITMAP(tint_slot, RZG2L_TINT_MAX_INTERRUPT);
+       spinlock_t                      bitmap_lock;
+       unsigned int                    hwirq[RZG2L_TINT_MAX_INTERRUPT];
 
        spinlock_t                      lock;
 };
@@ -883,8 +893,14 @@ static int rzg2l_gpio_get(struct gpio_chip *chip, unsigned int offset)
 
 static void rzg2l_gpio_free(struct gpio_chip *chip, unsigned int offset)
 {
+       unsigned int virq;
+
        pinctrl_gpio_free(chip->base + offset);
 
+       virq = irq_find_mapping(chip->irq.domain, offset);
+       if (virq)
+               irq_dispose_mapping(virq);
+
        /*
         * Set the GPIO as an input to ensure that the next GPIO request won't
         * drive the GPIO pin as an output.
@@ -1104,14 +1120,221 @@ static struct {
        }
 };
 
+static int rzg2l_gpio_get_gpioint(unsigned int virq)
+{
+       unsigned int gpioint;
+       unsigned int i;
+       u32 port, bit;
+
+       port = virq / 8;
+       bit = virq % 8;
+
+       if (port >= ARRAY_SIZE(rzg2l_gpio_configs) ||
+           bit >= RZG2L_GPIO_PORT_GET_PINCNT(rzg2l_gpio_configs[port]))
+               return -EINVAL;
+
+       gpioint = bit;
+       for (i = 0; i < port; i++)
+               gpioint += RZG2L_GPIO_PORT_GET_PINCNT(rzg2l_gpio_configs[i]);
+
+       return gpioint;
+}
+
+static void rzg2l_gpio_irq_disable(struct irq_data *d)
+{
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+       struct rzg2l_pinctrl *pctrl = container_of(gc, struct rzg2l_pinctrl, gpio_chip);
+       unsigned int hwirq = irqd_to_hwirq(d);
+       unsigned long flags;
+       void __iomem *addr;
+       u32 port;
+       u8 bit;
+
+       port = RZG2L_PIN_ID_TO_PORT(hwirq);
+       bit = RZG2L_PIN_ID_TO_PIN(hwirq);
+
+       addr = pctrl->base + ISEL(port);
+       if (bit >= 4) {
+               bit -= 4;
+               addr += 4;
+       }
+
+       spin_lock_irqsave(&pctrl->lock, flags);
+       writel(readl(addr) & ~BIT(bit * 8), addr);
+       spin_unlock_irqrestore(&pctrl->lock, flags);
+
+       gpiochip_disable_irq(gc, hwirq);
+       irq_chip_disable_parent(d);
+}
+
+static void rzg2l_gpio_irq_enable(struct irq_data *d)
+{
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+       struct rzg2l_pinctrl *pctrl = container_of(gc, struct rzg2l_pinctrl, gpio_chip);
+       unsigned int hwirq = irqd_to_hwirq(d);
+       unsigned long flags;
+       void __iomem *addr;
+       u32 port;
+       u8 bit;
+
+       gpiochip_enable_irq(gc, hwirq);
+
+       port = RZG2L_PIN_ID_TO_PORT(hwirq);
+       bit = RZG2L_PIN_ID_TO_PIN(hwirq);
+
+       addr = pctrl->base + ISEL(port);
+       if (bit >= 4) {
+               bit -= 4;
+               addr += 4;
+       }
+
+       spin_lock_irqsave(&pctrl->lock, flags);
+       writel(readl(addr) | BIT(bit * 8), addr);
+       spin_unlock_irqrestore(&pctrl->lock, flags);
+
+       irq_chip_enable_parent(d);
+}
+
+static int rzg2l_gpio_irq_set_type(struct irq_data *d, unsigned int type)
+{
+       return irq_chip_set_type_parent(d, type);
+}
+
+static void rzg2l_gpio_irqc_eoi(struct irq_data *d)
+{
+       irq_chip_eoi_parent(d);
+}
+
+static void rzg2l_gpio_irq_print_chip(struct irq_data *data, struct seq_file *p)
+{
+       struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
+
+       seq_printf(p, dev_name(gc->parent));
+}
+
+static const struct irq_chip rzg2l_gpio_irqchip = {
+       .name = "rzg2l-gpio",
+       .irq_disable = rzg2l_gpio_irq_disable,
+       .irq_enable = rzg2l_gpio_irq_enable,
+       .irq_mask = irq_chip_mask_parent,
+       .irq_unmask = irq_chip_unmask_parent,
+       .irq_set_type = rzg2l_gpio_irq_set_type,
+       .irq_eoi = rzg2l_gpio_irqc_eoi,
+       .irq_print_chip = rzg2l_gpio_irq_print_chip,
+       .flags = IRQCHIP_IMMUTABLE,
+       GPIOCHIP_IRQ_RESOURCE_HELPERS,
+};
+
+static int rzg2l_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
+                                           unsigned int child,
+                                           unsigned int child_type,
+                                           unsigned int *parent,
+                                           unsigned int *parent_type)
+{
+       struct rzg2l_pinctrl *pctrl = gpiochip_get_data(gc);
+       unsigned long flags;
+       int gpioint, irq;
+
+       gpioint = rzg2l_gpio_get_gpioint(child);
+       if (gpioint < 0)
+               return gpioint;
+
+       spin_lock_irqsave(&pctrl->bitmap_lock, flags);
+       irq = bitmap_find_free_region(pctrl->tint_slot, RZG2L_TINT_MAX_INTERRUPT, get_order(1));
+       spin_unlock_irqrestore(&pctrl->bitmap_lock, flags);
+       if (irq < 0)
+               return -ENOSPC;
+       pctrl->hwirq[irq] = child;
+       irq += RZG2L_TINT_IRQ_START_INDEX;
+
+       /* All these interrupts are level high in the CPU */
+       *parent_type = IRQ_TYPE_LEVEL_HIGH;
+       *parent = RZG2L_PACK_HWIRQ(gpioint, irq);
+       return 0;
+}
+
+static int rzg2l_gpio_populate_parent_fwspec(struct gpio_chip *chip,
+                                            union gpio_irq_fwspec *gfwspec,
+                                            unsigned int parent_hwirq,
+                                            unsigned int parent_type)
+{
+       struct irq_fwspec *fwspec = &gfwspec->fwspec;
+
+       fwspec->fwnode = chip->irq.parent_domain->fwnode;
+       fwspec->param_count = 2;
+       fwspec->param[0] = parent_hwirq;
+       fwspec->param[1] = parent_type;
+
+       return 0;
+}
+
+static void rzg2l_gpio_irq_domain_free(struct irq_domain *domain, unsigned int virq,
+                                      unsigned int nr_irqs)
+{
+       struct irq_data *d;
+
+       d = irq_domain_get_irq_data(domain, virq);
+       if (d) {
+               struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+               struct rzg2l_pinctrl *pctrl = container_of(gc, struct rzg2l_pinctrl, gpio_chip);
+               irq_hw_number_t hwirq = irqd_to_hwirq(d);
+               unsigned long flags;
+               unsigned int i;
+
+               for (i = 0; i < RZG2L_TINT_MAX_INTERRUPT; i++) {
+                       if (pctrl->hwirq[i] == hwirq) {
+                               spin_lock_irqsave(&pctrl->bitmap_lock, flags);
+                               bitmap_release_region(pctrl->tint_slot, i, get_order(1));
+                               spin_unlock_irqrestore(&pctrl->bitmap_lock, flags);
+                               pctrl->hwirq[i] = 0;
+                               break;
+                       }
+               }
+       }
+       irq_domain_free_irqs_common(domain, virq, nr_irqs);
+}
+
+static void rzg2l_init_irq_valid_mask(struct gpio_chip *gc,
+                                     unsigned long *valid_mask,
+                                     unsigned int ngpios)
+{
+       struct rzg2l_pinctrl *pctrl = gpiochip_get_data(gc);
+       struct gpio_chip *chip = &pctrl->gpio_chip;
+       unsigned int offset;
+
+       /* Forbid unused lines to be mapped as IRQs */
+       for (offset = 0; offset < chip->ngpio; offset++) {
+               u32 port, bit;
+
+               port = offset / 8;
+               bit = offset % 8;
+
+               if (port >= ARRAY_SIZE(rzg2l_gpio_configs) ||
+                   bit >= RZG2L_GPIO_PORT_GET_PINCNT(rzg2l_gpio_configs[port]))
+                       clear_bit(offset, valid_mask);
+       }
+}
+
 static int rzg2l_gpio_register(struct rzg2l_pinctrl *pctrl)
 {
        struct device_node *np = pctrl->dev->of_node;
        struct gpio_chip *chip = &pctrl->gpio_chip;
        const char *name = dev_name(pctrl->dev);
+       struct irq_domain *parent_domain;
        struct of_phandle_args of_args;
+       struct device_node *parent_np;
+       struct gpio_irq_chip *girq;
        int ret;
 
+       parent_np = of_irq_find_parent(np);
+       if (!parent_np)
+               return -ENXIO;
+
+       parent_domain = irq_find_host(parent_np);
+       of_node_put(parent_np);
+       if (!parent_domain)
+               return -EPROBE_DEFER;
+
        ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &of_args);
        if (ret) {
                dev_err(pctrl->dev, "Unable to parse gpio-ranges\n");
@@ -1138,6 +1361,15 @@ static int rzg2l_gpio_register(struct rzg2l_pinctrl *pctrl)
        chip->base = -1;
        chip->ngpio = of_args.args[2];
 
+       girq = &chip->irq;
+       gpio_irq_chip_set_chip(girq, &rzg2l_gpio_irqchip);
+       girq->fwnode = of_node_to_fwnode(np);
+       girq->parent_domain = parent_domain;
+       girq->child_to_parent_hwirq = rzg2l_gpio_child_to_parent_hwirq;
+       girq->populate_parent_alloc_arg = rzg2l_gpio_populate_parent_fwspec;
+       girq->child_irq_domain_ops.free = rzg2l_gpio_irq_domain_free;
+       girq->init_valid_mask = rzg2l_init_irq_valid_mask;
+
        pctrl->gpio_range.id = 0;
        pctrl->gpio_range.pin_base = 0;
        pctrl->gpio_range.base = 0;
@@ -1253,6 +1485,7 @@ static int rzg2l_pinctrl_probe(struct platform_device *pdev)
        }
 
        spin_lock_init(&pctrl->lock);
+       spin_lock_init(&pctrl->bitmap_lock);
 
        platform_set_drvdata(pdev, pctrl);
 
index a8b383051528517a452b2a13e60f55c908d94f26..502dcd1c33b72d550012824f999754e3245541ed 100644 (file)
@@ -6842,6 +6842,31 @@ static const struct backlight_ops ibm_backlight_data = {
 
 /* --------------------------------------------------------------------- */
 
+static int __init tpacpi_evaluate_bcl(struct acpi_device *adev, void *not_used)
+{
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       union acpi_object *obj;
+       acpi_status status;
+       int rc;
+
+       status = acpi_evaluate_object(adev->handle, "_BCL", NULL, &buffer);
+       if (ACPI_FAILURE(status))
+               return 0;
+
+       obj = buffer.pointer;
+       if (!obj || obj->type != ACPI_TYPE_PACKAGE) {
+               acpi_handle_info(adev->handle,
+                                "Unknown _BCL data, please report this to %s\n",
+                                TPACPI_MAIL);
+               rc = 0;
+       } else {
+               rc = obj->package.count;
+       }
+       kfree(obj);
+
+       return rc;
+}
+
 /*
  * Call _BCL method of video device.  On some ThinkPads this will
  * switch the firmware to the ACPI brightness control mode.
@@ -6849,37 +6874,13 @@ static const struct backlight_ops ibm_backlight_data = {
 
 static int __init tpacpi_query_bcl_levels(acpi_handle handle)
 {
-       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
-       union acpi_object *obj;
-       struct acpi_device *device, *child;
-       int rc;
+       struct acpi_device *device;
 
        device = acpi_fetch_acpi_dev(handle);
        if (!device)
                return 0;
 
-       rc = 0;
-       list_for_each_entry(child, &device->children, node) {
-               acpi_status status = acpi_evaluate_object(child->handle, "_BCL",
-                                                         NULL, &buffer);
-               if (ACPI_FAILURE(status)) {
-                       buffer.length = ACPI_ALLOCATE_BUFFER;
-                       continue;
-               }
-
-               obj = (union acpi_object *)buffer.pointer;
-               if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
-                       pr_err("Unknown _BCL data, please report this to %s\n",
-                               TPACPI_MAIL);
-                       rc = 0;
-               } else {
-                       rc = obj->package.count;
-               }
-               break;
-       }
-
-       kfree(buffer.pointer);
-       return rc;
+       return acpi_dev_for_each_child(device, tpacpi_evaluate_bcl, NULL);
 }
 
 
index f5eced0842b36d158cf18a2c648482513a4496cc..6a88eb7e9f7577d4c72ed13ac0b0ac07d56b08cb 100644 (file)
@@ -71,34 +71,19 @@ static u64 set_pd_power_limit(struct dtpm *dtpm, u64 power_limit)
 
 static u64 scale_pd_power_uw(struct cpumask *pd_mask, u64 power)
 {
-       unsigned long max = 0, sum_util = 0;
+       unsigned long max, sum_util = 0;
        int cpu;
 
-       for_each_cpu_and(cpu, pd_mask, cpu_online_mask) {
-
-               /*
-                * The capacity is the same for all CPUs belonging to
-                * the same perf domain, so a single call to
-                * arch_scale_cpu_capacity() is enough. However, we
-                * need the CPU parameter to be initialized by the
-                * loop, so the call ends up in this block.
-                *
-                * We can initialize 'max' with a cpumask_first() call
-                * before the loop but the bits computation is not
-                * worth given the arch_scale_cpu_capacity() just
-                * returns a value where the resulting assembly code
-                * will be optimized by the compiler.
-                */
-               max = arch_scale_cpu_capacity(cpu);
-               sum_util += sched_cpu_util(cpu, max);
-       }
-
        /*
-        * In the improbable case where all the CPUs of the perf
-        * domain are offline, 'max' will be zero and will lead to an
-        * illegal operation with a zero division.
+        * The capacity is the same for all CPUs belonging to
+        * the same perf domain.
         */
-       return max ? (power * ((sum_util << 10) / max)) >> 10 : 0;
+       max = arch_scale_cpu_capacity(cpumask_first(pd_mask));
+
+       for_each_cpu_and(cpu, pd_mask, cpu_online_mask)
+               sum_util += sched_cpu_util(cpu);
+
+       return (power * ((sum_util << 10) / max)) >> 10;
 }
 
 static u64 get_pd_power_uw(struct dtpm *dtpm)
index 458218f88c5eb9cb80cb39864fbfb3f7384ce4b4..fe4971b65c6481d6c90b5c719528452843bf1601 100644 (file)
@@ -176,6 +176,7 @@ config PTP_1588_CLOCK_OCP
        depends on !S390
        depends on COMMON_CLK
        select NET_DEVLINK
+       select CRC16
        help
          This driver adds support for an OpenCompute time card.
 
index 904de8d61828a6b620ce7b9760913df5d3db0c21..60d13a949bc58c698aa72e77f9b4ae44a886b49e 100644 (file)
@@ -140,6 +140,16 @@ config PWM_BRCMSTB
          To compile this driver as a module, choose M Here: the module
          will be called pwm-brcmstb.c.
 
+config PWM_CLK
+       tristate "Clock based PWM support"
+       depends on HAVE_CLK || COMPILE_TEST
+       help
+         Generic PWM framework driver for outputs that can be
+         muxed to clocks.
+
+         To compile this driver as a module, choose M here: the module
+         will be called pwm-clk.
+
 config PWM_CLPS711X
        tristate "CLPS711X PWM support"
        depends on ARCH_CLPS711X || COMPILE_TEST
index 5c08bdb817b4c58f3ff5bcfaa4c5aced9c7412a4..7bf1a29f02b843c336e6000bc3b3e1161af4eb86 100644 (file)
@@ -10,6 +10,7 @@ obj-$(CONFIG_PWM_BCM_KONA)    += pwm-bcm-kona.o
 obj-$(CONFIG_PWM_BCM2835)      += pwm-bcm2835.o
 obj-$(CONFIG_PWM_BERLIN)       += pwm-berlin.o
 obj-$(CONFIG_PWM_BRCMSTB)      += pwm-brcmstb.o
+obj-$(CONFIG_PWM_CLK)          += pwm-clk.o
 obj-$(CONFIG_PWM_CLPS711X)     += pwm-clps711x.o
 obj-$(CONFIG_PWM_CRC)          += pwm-crc.o
 obj-$(CONFIG_PWM_CROS_EC)      += pwm-cros-ec.o
index c7552df320829a30f2137c8db012d47f77cb3737..0e042410f6b977e03084ce2cf3082dbb2960e624 100644 (file)
@@ -235,18 +235,8 @@ EXPORT_SYMBOL_GPL(pwm_get_chip_data);
 
 static bool pwm_ops_check(const struct pwm_chip *chip)
 {
-
        const struct pwm_ops *ops = chip->ops;
 
-       /* driver supports legacy, non-atomic operation */
-       if (ops->config && ops->enable && ops->disable) {
-               if (IS_ENABLED(CONFIG_PWM_DEBUG))
-                       dev_warn(chip->dev,
-                                "Driver needs updating to atomic API\n");
-
-               return true;
-       }
-
        if (!ops->apply)
                return false;
 
@@ -548,73 +538,6 @@ static void pwm_apply_state_debug(struct pwm_device *pwm,
        }
 }
 
-static int pwm_apply_legacy(struct pwm_chip *chip, struct pwm_device *pwm,
-                           const struct pwm_state *state)
-{
-       int err;
-       struct pwm_state initial_state = pwm->state;
-
-       if (state->polarity != pwm->state.polarity) {
-               if (!chip->ops->set_polarity)
-                       return -EINVAL;
-
-               /*
-                * Changing the polarity of a running PWM is only allowed when
-                * the PWM driver implements ->apply().
-                */
-               if (pwm->state.enabled) {
-                       chip->ops->disable(chip, pwm);
-
-                       /*
-                        * Update pwm->state already here in case
-                        * .set_polarity() or another callback depend on that.
-                        */
-                       pwm->state.enabled = false;
-               }
-
-               err = chip->ops->set_polarity(chip, pwm, state->polarity);
-               if (err)
-                       goto rollback;
-
-               pwm->state.polarity = state->polarity;
-       }
-
-       if (!state->enabled) {
-               if (pwm->state.enabled)
-                       chip->ops->disable(chip, pwm);
-
-               return 0;
-       }
-
-       /*
-        * We cannot skip calling ->config even if state->period ==
-        * pwm->state.period && state->duty_cycle == pwm->state.duty_cycle
-        * because we might have exited early in the last call to
-        * pwm_apply_state because of !state->enabled and so the two values in
-        * pwm->state might not be configured in hardware.
-        */
-       err = chip->ops->config(pwm->chip, pwm,
-                               state->duty_cycle,
-                               state->period);
-       if (err)
-               goto rollback;
-
-       pwm->state.period = state->period;
-       pwm->state.duty_cycle = state->duty_cycle;
-
-       if (!pwm->state.enabled) {
-               err = chip->ops->enable(chip, pwm);
-               if (err)
-                       goto rollback;
-       }
-
-       return 0;
-
-rollback:
-       pwm->state = initial_state;
-       return err;
-}
-
 /**
  * pwm_apply_state() - atomically apply a new state to a PWM device
  * @pwm: PWM device
@@ -647,10 +570,7 @@ int pwm_apply_state(struct pwm_device *pwm, const struct pwm_state *state)
            state->usage_power == pwm->state.usage_power)
                return 0;
 
-       if (chip->ops->apply)
-               err = chip->ops->apply(chip, pwm, state);
-       else
-               err = pwm_apply_legacy(chip, pwm, state);
+       err = chip->ops->apply(chip, pwm, state);
        if (err)
                return err;
 
index 3977a0f9d132ff0c7c818ae8bcbf533862205b72..2837b4ce8053ca4d49037d8531b02f107e0e759d 100644 (file)
@@ -304,7 +304,7 @@ static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
        /*
         * Find best clk divisor:
         * the smallest divisor which can fulfill the period_ns requirements.
-        * If there is a gclk, the first divisor is actuallly the gclk selector
+        * If there is a gclk, the first divisor is actually the gclk selector
         */
        if (tcbpwmc->gclk)
                i = 1;
diff --git a/drivers/pwm/pwm-clk.c b/drivers/pwm/pwm-clk.c
new file mode 100644 (file)
index 0000000..c2a503d
--- /dev/null
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Clock based PWM controller
+ *
+ * Copyright (c) 2021 Nikita Travkin <nikita@trvn.ru>
+ *
+ * This is an "adapter" driver that allows PWM consumers to use
+ * system clocks with duty cycle control as PWM outputs.
+ *
+ * Limitations:
+ * - Due to the fact that exact behavior depends on the underlying
+ *   clock driver, various limitations are possible.
+ * - Underlying clock may not be able to give 0% or 100% duty cycle
+ *   (constant off or on), exact behavior will depend on the clock.
+ * - When the PWM is disabled, the clock will be disabled as well,
+ *   line state will depend on the clock.
+ * - The clk API doesn't expose the necessary calls to implement
+ *   .get_state().
+ */
+
+#include <linux/kernel.h>
+#include <linux/math64.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/clk.h>
+#include <linux/pwm.h>
+
+struct pwm_clk_chip {
+       struct pwm_chip chip;
+       struct clk *clk;
+       bool clk_enabled;
+};
+
+#define to_pwm_clk_chip(_chip) container_of(_chip, struct pwm_clk_chip, chip)
+
+static int pwm_clk_apply(struct pwm_chip *chip, struct pwm_device *pwm,
+                        const struct pwm_state *state)
+{
+       struct pwm_clk_chip *pcchip = to_pwm_clk_chip(chip);
+       int ret;
+       u32 rate;
+       u64 period = state->period;
+       u64 duty_cycle = state->duty_cycle;
+
+       if (!state->enabled) {
+               if (pwm->state.enabled) {
+                       clk_disable(pcchip->clk);
+                       pcchip->clk_enabled = false;
+               }
+               return 0;
+       } else if (!pwm->state.enabled) {
+               ret = clk_enable(pcchip->clk);
+               if (ret)
+                       return ret;
+               pcchip->clk_enabled = true;
+       }
+
+       /*
+        * We have to enable the clk before setting the rate and duty_cycle,
+        * that however results in a window where the clk is on with a
+        * (potentially) different setting. Also setting period and duty_cycle
+        * are two separate calls, so that probably isn't atomic either.
+        */
+
+       rate = DIV64_U64_ROUND_UP(NSEC_PER_SEC, period);
+       ret = clk_set_rate(pcchip->clk, rate);
+       if (ret)
+               return ret;
+
+       if (state->polarity == PWM_POLARITY_INVERSED)
+               duty_cycle = period - duty_cycle;
+
+       return clk_set_duty_cycle(pcchip->clk, duty_cycle, period);
+}
+
+static const struct pwm_ops pwm_clk_ops = {
+       .apply = pwm_clk_apply,
+       .owner = THIS_MODULE,
+};
+
+static int pwm_clk_probe(struct platform_device *pdev)
+{
+       struct pwm_clk_chip *pcchip;
+       int ret;
+
+       pcchip = devm_kzalloc(&pdev->dev, sizeof(*pcchip), GFP_KERNEL);
+       if (!pcchip)
+               return -ENOMEM;
+
+       pcchip->clk = devm_clk_get(&pdev->dev, NULL);
+       if (IS_ERR(pcchip->clk))
+               return dev_err_probe(&pdev->dev, PTR_ERR(pcchip->clk),
+                                    "Failed to get clock\n");
+
+       pcchip->chip.dev = &pdev->dev;
+       pcchip->chip.ops = &pwm_clk_ops;
+       pcchip->chip.npwm = 1;
+
+       ret = clk_prepare(pcchip->clk);
+       if (ret < 0)
+               return dev_err_probe(&pdev->dev, ret, "Failed to prepare clock\n");
+
+       ret = pwmchip_add(&pcchip->chip);
+       if (ret < 0) {
+               clk_unprepare(pcchip->clk);
+               return dev_err_probe(&pdev->dev, ret, "Failed to add pwm chip\n");
+       }
+
+       platform_set_drvdata(pdev, pcchip);
+       return 0;
+}
+
+static int pwm_clk_remove(struct platform_device *pdev)
+{
+       struct pwm_clk_chip *pcchip = platform_get_drvdata(pdev);
+
+       pwmchip_remove(&pcchip->chip);
+
+       if (pcchip->clk_enabled)
+               clk_disable(pcchip->clk);
+
+       clk_unprepare(pcchip->clk);
+
+       return 0;
+}
+
+static const struct of_device_id pwm_clk_dt_ids[] = {
+       { .compatible = "clk-pwm", },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, pwm_clk_dt_ids);
+
+static struct platform_driver pwm_clk_driver = {
+       .driver = {
+               .name = "pwm-clk",
+               .of_match_table = pwm_clk_dt_ids,
+       },
+       .probe = pwm_clk_probe,
+       .remove = pwm_clk_remove,
+};
+module_platform_driver(pwm_clk_driver);
+
+MODULE_ALIAS("platform:pwm-clk");
+MODULE_AUTHOR("Nikita Travkin <nikita@trvn.ru>");
+MODULE_DESCRIPTION("Clock based PWM driver");
+MODULE_LICENSE("GPL");
index 272e0b5d01b89b17eac2aad1aeee920f19884d20..763f2e3a146d53a21df011798531ce7f621fdbc9 100644 (file)
@@ -98,7 +98,7 @@ struct lpc18xx_pwm_chip {
        unsigned long clk_rate;
        unsigned int period_ns;
        unsigned int min_period_ns;
-       unsigned int max_period_ns;
+       u64 max_period_ns;
        unsigned int period_event;
        unsigned long event_map;
        struct mutex res_lock;
@@ -145,40 +145,48 @@ static void lpc18xx_pwm_set_conflict_res(struct lpc18xx_pwm_chip *lpc18xx_pwm,
        mutex_unlock(&lpc18xx_pwm->res_lock);
 }
 
-static void lpc18xx_pwm_config_period(struct pwm_chip *chip, int period_ns)
+static void lpc18xx_pwm_config_period(struct pwm_chip *chip, u64 period_ns)
 {
        struct lpc18xx_pwm_chip *lpc18xx_pwm = to_lpc18xx_pwm_chip(chip);
-       u64 val;
+       u32 val;
 
-       val = (u64)period_ns * lpc18xx_pwm->clk_rate;
-       do_div(val, NSEC_PER_SEC);
+       /*
+        * With clk_rate < NSEC_PER_SEC this cannot overflow.
+        * With period_ns < max_period_ns this also fits into an u32.
+        * As period_ns >= min_period_ns = DIV_ROUND_UP(NSEC_PER_SEC, lpc18xx_pwm->clk_rate);
+        * we have val >= 1.
+        */
+       val = mul_u64_u64_div_u64(period_ns, lpc18xx_pwm->clk_rate, NSEC_PER_SEC);
 
        lpc18xx_pwm_writel(lpc18xx_pwm,
                           LPC18XX_PWM_MATCH(lpc18xx_pwm->period_event),
-                          (u32)val - 1);
+                          val - 1);
 
        lpc18xx_pwm_writel(lpc18xx_pwm,
                           LPC18XX_PWM_MATCHREL(lpc18xx_pwm->period_event),
-                          (u32)val - 1);
+                          val - 1);
 }
 
 static void lpc18xx_pwm_config_duty(struct pwm_chip *chip,
-                                   struct pwm_device *pwm, int duty_ns)
+                                   struct pwm_device *pwm, u64 duty_ns)
 {
        struct lpc18xx_pwm_chip *lpc18xx_pwm = to_lpc18xx_pwm_chip(chip);
        struct lpc18xx_pwm_data *lpc18xx_data = &lpc18xx_pwm->channeldata[pwm->hwpwm];
-       u64 val;
+       u32 val;
 
-       val = (u64)duty_ns * lpc18xx_pwm->clk_rate;
-       do_div(val, NSEC_PER_SEC);
+       /*
+        * With clk_rate < NSEC_PER_SEC this cannot overflow.
+        * With duty_ns <= period_ns < max_period_ns this also fits into an u32.
+        */
+       val = mul_u64_u64_div_u64(duty_ns, lpc18xx_pwm->clk_rate, NSEC_PER_SEC);
 
        lpc18xx_pwm_writel(lpc18xx_pwm,
                           LPC18XX_PWM_MATCH(lpc18xx_data->duty_event),
-                          (u32)val);
+                          val);
 
        lpc18xx_pwm_writel(lpc18xx_pwm,
                           LPC18XX_PWM_MATCHREL(lpc18xx_data->duty_event),
-                          (u32)val);
+                          val);
 }
 
 static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
@@ -359,30 +367,35 @@ static int lpc18xx_pwm_probe(struct platform_device *pdev)
                return PTR_ERR(lpc18xx_pwm->base);
 
        lpc18xx_pwm->pwm_clk = devm_clk_get(&pdev->dev, "pwm");
-       if (IS_ERR(lpc18xx_pwm->pwm_clk)) {
-               dev_err(&pdev->dev, "failed to get pwm clock\n");
-               return PTR_ERR(lpc18xx_pwm->pwm_clk);
-       }
+       if (IS_ERR(lpc18xx_pwm->pwm_clk))
+               return dev_err_probe(&pdev->dev, PTR_ERR(lpc18xx_pwm->pwm_clk),
+                                    "failed to get pwm clock\n");
 
        ret = clk_prepare_enable(lpc18xx_pwm->pwm_clk);
-       if (ret < 0) {
-               dev_err(&pdev->dev, "could not prepare or enable pwm clock\n");
-               return ret;
-       }
+       if (ret < 0)
+               return dev_err_probe(&pdev->dev, ret,
+                                    "could not prepare or enable pwm clock\n");
 
        lpc18xx_pwm->clk_rate = clk_get_rate(lpc18xx_pwm->pwm_clk);
        if (!lpc18xx_pwm->clk_rate) {
-               dev_err(&pdev->dev, "pwm clock has no frequency\n");
-               ret = -EINVAL;
+               ret = dev_err_probe(&pdev->dev,
+                                   -EINVAL, "pwm clock has no frequency\n");
+               goto disable_pwmclk;
+       }
+
+       /*
+        * If clkrate is too fast, the calculations in .apply() might overflow.
+        */
+       if (lpc18xx_pwm->clk_rate > NSEC_PER_SEC) {
+               ret = dev_err_probe(&pdev->dev, -EINVAL, "pwm clock to fast\n");
                goto disable_pwmclk;
        }
 
        mutex_init(&lpc18xx_pwm->res_lock);
        mutex_init(&lpc18xx_pwm->period_lock);
 
-       val = (u64)NSEC_PER_SEC * LPC18XX_PWM_TIMER_MAX;
-       do_div(val, lpc18xx_pwm->clk_rate);
-       lpc18xx_pwm->max_period_ns = val;
+       lpc18xx_pwm->max_period_ns =
+               mul_u64_u64_div_u64(NSEC_PER_SEC, LPC18XX_PWM_TIMER_MAX, lpc18xx_pwm->clk_rate);
 
        lpc18xx_pwm->min_period_ns = DIV_ROUND_UP(NSEC_PER_SEC,
                                                  lpc18xx_pwm->clk_rate);
@@ -423,7 +436,7 @@ static int lpc18xx_pwm_probe(struct platform_device *pdev)
 
        ret = pwmchip_add(&lpc18xx_pwm->chip);
        if (ret < 0) {
-               dev_err(&pdev->dev, "pwmchip_add failed: %d\n", ret);
+               dev_err_probe(&pdev->dev, ret, "pwmchip_add failed\n");
                goto disable_pwmclk;
        }
 
index d28c0874c7f2a8cb60d368918df6298f5cedea04..6901a44dc428de536b97cf4dd287533b520330c0 100644 (file)
@@ -323,6 +323,12 @@ static const struct pwm_mediatek_of_data mt8183_pwm_data = {
        .has_ck_26m_sel = true,
 };
 
+static const struct pwm_mediatek_of_data mt8365_pwm_data = {
+       .num_pwms = 3,
+       .pwm45_fixup = false,
+       .has_ck_26m_sel = true,
+};
+
 static const struct pwm_mediatek_of_data mt8516_pwm_data = {
        .num_pwms = 5,
        .pwm45_fixup = false,
@@ -337,6 +343,7 @@ static const struct of_device_id pwm_mediatek_of_match[] = {
        { .compatible = "mediatek,mt7628-pwm", .data = &mt7628_pwm_data },
        { .compatible = "mediatek,mt7629-pwm", .data = &mt7629_pwm_data },
        { .compatible = "mediatek,mt8183-pwm", .data = &mt8183_pwm_data },
+       { .compatible = "mediatek,mt8365-pwm", .data = &mt8365_pwm_data },
        { .compatible = "mediatek,mt8516-pwm", .data = &mt8516_pwm_data },
        { },
 };
index e6d05a329002694bc50d3e05ee631a34f53487d4..2d4fa5e5fdd462798364338ce5ea55e0cb720b3f 100644 (file)
@@ -23,7 +23,7 @@
 #define PWM_SIFIVE_PWMCFG              0x0
 #define PWM_SIFIVE_PWMCOUNT            0x8
 #define PWM_SIFIVE_PWMS                        0x10
-#define PWM_SIFIVE_PWMCMP0             0x20
+#define PWM_SIFIVE_PWMCMP(i)           (0x20 + 4 * (i))
 
 /* PWMCFG fields */
 #define PWM_SIFIVE_PWMCFG_SCALE                GENMASK(3, 0)
 #define PWM_SIFIVE_PWMCFG_GANG         BIT(24)
 #define PWM_SIFIVE_PWMCFG_IP           BIT(28)
 
-/* PWM_SIFIVE_SIZE_PWMCMP is used to calculate offset for pwmcmpX registers */
-#define PWM_SIFIVE_SIZE_PWMCMP         4
 #define PWM_SIFIVE_CMPWIDTH            16
 #define PWM_SIFIVE_DEFAULT_PERIOD      10000000
 
 struct pwm_sifive_ddata {
        struct pwm_chip chip;
-       struct mutex lock; /* lock to protect user_count */
+       struct mutex lock; /* lock to protect user_count and approx_period */
        struct notifier_block notifier;
        struct clk *clk;
        void __iomem *regs;
@@ -78,6 +76,7 @@ static void pwm_sifive_free(struct pwm_chip *chip, struct pwm_device *pwm)
        mutex_unlock(&ddata->lock);
 }
 
+/* Called holding ddata->lock */
 static void pwm_sifive_update_clock(struct pwm_sifive_ddata *ddata,
                                    unsigned long rate)
 {
@@ -112,8 +111,7 @@ static void pwm_sifive_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
        struct pwm_sifive_ddata *ddata = pwm_sifive_chip_to_ddata(chip);
        u32 duty, val;
 
-       duty = readl(ddata->regs + PWM_SIFIVE_PWMCMP0 +
-                    pwm->hwpwm * PWM_SIFIVE_SIZE_PWMCMP);
+       duty = readl(ddata->regs + PWM_SIFIVE_PWMCMP(pwm->hwpwm));
 
        state->enabled = duty > 0;
 
@@ -127,24 +125,6 @@ static void pwm_sifive_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
        state->polarity = PWM_POLARITY_INVERSED;
 }
 
-static int pwm_sifive_enable(struct pwm_chip *chip, bool enable)
-{
-       struct pwm_sifive_ddata *ddata = pwm_sifive_chip_to_ddata(chip);
-       int ret;
-
-       if (enable) {
-               ret = clk_enable(ddata->clk);
-               if (ret) {
-                       dev_err(ddata->chip.dev, "Enable clk failed\n");
-                       return ret;
-               }
-       } else {
-               clk_disable(ddata->clk);
-       }
-
-       return 0;
-}
-
 static int pwm_sifive_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                            const struct pwm_state *state)
 {
@@ -159,13 +139,6 @@ static int pwm_sifive_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        if (state->polarity != PWM_POLARITY_INVERSED)
                return -EINVAL;
 
-       ret = clk_enable(ddata->clk);
-       if (ret) {
-               dev_err(ddata->chip.dev, "Enable clk failed\n");
-               return ret;
-       }
-
-       mutex_lock(&ddata->lock);
        cur_state = pwm->state;
        enabled = cur_state.enabled;
 
@@ -184,25 +157,36 @@ static int pwm_sifive_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        /* The hardware cannot generate a 100% duty cycle */
        frac = min(frac, (1U << PWM_SIFIVE_CMPWIDTH) - 1);
 
+       mutex_lock(&ddata->lock);
        if (state->period != ddata->approx_period) {
                if (ddata->user_count != 1) {
-                       ret = -EBUSY;
-                       goto exit;
+                       mutex_unlock(&ddata->lock);
+                       return -EBUSY;
                }
                ddata->approx_period = state->period;
                pwm_sifive_update_clock(ddata, clk_get_rate(ddata->clk));
        }
+       mutex_unlock(&ddata->lock);
 
-       writel(frac, ddata->regs + PWM_SIFIVE_PWMCMP0 +
-              pwm->hwpwm * PWM_SIFIVE_SIZE_PWMCMP);
+       /*
+        * If the PWM is enabled the clk is already on. So only enable it
+        * conditionally to have it on exactly once afterwards independent of
+        * the PWM state.
+        */
+       if (!enabled) {
+               ret = clk_enable(ddata->clk);
+               if (ret) {
+                       dev_err(ddata->chip.dev, "Enable clk failed\n");
+                       return ret;
+               }
+       }
 
-       if (state->enabled != enabled)
-               pwm_sifive_enable(chip, state->enabled);
+       writel(frac, ddata->regs + PWM_SIFIVE_PWMCMP(pwm->hwpwm));
 
-exit:
-       clk_disable(ddata->clk);
-       mutex_unlock(&ddata->lock);
-       return ret;
+       if (!state->enabled)
+               clk_disable(ddata->clk);
+
+       return 0;
 }
 
 static const struct pwm_ops pwm_sifive_ops = {
@@ -232,6 +216,8 @@ static int pwm_sifive_probe(struct platform_device *pdev)
        struct pwm_sifive_ddata *ddata;
        struct pwm_chip *chip;
        int ret;
+       u32 val;
+       unsigned int enabled_pwms = 0, enabled_clks = 1;
 
        ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
        if (!ddata)
@@ -258,6 +244,33 @@ static int pwm_sifive_probe(struct platform_device *pdev)
                return ret;
        }
 
+       val = readl(ddata->regs + PWM_SIFIVE_PWMCFG);
+       if (val & PWM_SIFIVE_PWMCFG_EN_ALWAYS) {
+               unsigned int i;
+
+               for (i = 0; i < chip->npwm; ++i) {
+                       val = readl(ddata->regs + PWM_SIFIVE_PWMCMP(i));
+                       if (val > 0)
+                               ++enabled_pwms;
+               }
+       }
+
+       /* The clk should be on once for each running PWM. */
+       if (enabled_pwms) {
+               while (enabled_clks < enabled_pwms) {
+                       /* This is not expected to fail as the clk is already on */
+                       ret = clk_enable(ddata->clk);
+                       if (unlikely(ret)) {
+                               dev_err_probe(dev, ret, "Failed to enable clk\n");
+                               goto disable_clk;
+                       }
+                       ++enabled_clks;
+               }
+       } else {
+               clk_disable(ddata->clk);
+               enabled_clks = 0;
+       }
+
        /* Watch for changes to underlying clock frequency */
        ddata->notifier.notifier_call = pwm_sifive_clock_notifier;
        ret = clk_notifier_register(ddata->clk, &ddata->notifier);
@@ -280,7 +293,11 @@ static int pwm_sifive_probe(struct platform_device *pdev)
 unregister_clk:
        clk_notifier_unregister(ddata->clk, &ddata->notifier);
 disable_clk:
-       clk_disable_unprepare(ddata->clk);
+       while (enabled_clks) {
+               clk_disable(ddata->clk);
+               --enabled_clks;
+       }
+       clk_unprepare(ddata->clk);
 
        return ret;
 }
@@ -288,23 +305,19 @@ disable_clk:
 static int pwm_sifive_remove(struct platform_device *dev)
 {
        struct pwm_sifive_ddata *ddata = platform_get_drvdata(dev);
-       bool is_enabled = false;
        struct pwm_device *pwm;
        int ch;
 
+       pwmchip_remove(&ddata->chip);
+       clk_notifier_unregister(ddata->clk, &ddata->notifier);
+
        for (ch = 0; ch < ddata->chip.npwm; ch++) {
                pwm = &ddata->chip.pwms[ch];
-               if (pwm->state.enabled) {
-                       is_enabled = true;
-                       break;
-               }
+               if (pwm->state.enabled)
+                       clk_disable(ddata->clk);
        }
-       if (is_enabled)
-               clk_disable(ddata->clk);
 
-       clk_disable_unprepare(ddata->clk);
-       pwmchip_remove(&ddata->chip);
-       clk_notifier_unregister(ddata->clk, &ddata->notifier);
+       clk_unprepare(ddata->clk);
 
        return 0;
 }
index ed0b63dd38f1a45b9d43a3f95337e80eb4a4d231..8fb84b4418538023129e3288f280ed7940263912 100644 (file)
@@ -7,6 +7,22 @@
  *
  * This driver is a complete rewrite of the former pwm-twl6030.c authorded by:
  * Hemanth V <hemanthv@ti.com>
+ *
+ * Reference manual for the twl6030 is available at:
+ * https://www.ti.com/lit/ds/symlink/twl6030.pdf
+ *
+ * Limitations:
+ * - The twl6030 hardware only supports two period lengths (128 clock ticks and
+ *   64 clock ticks), the driver only uses 128 ticks
+ * - The hardware doesn't support ON = 0, so the active part of a period doesn't
+ *   start at its beginning.
+ * - The hardware could support inverted polarity (with a similar limitation as
+ *   for normal: the last clock tick is always inactive).
+ * - The hardware emits a constant low output when disabled.
+ * - A request for .duty_cycle = 0 results in an output wave with one active
+ *   clock tick per period. This should better use the disabled state.
+ * - The driver only implements setting the relative duty cycle.
+ * - The driver doesn't implement .get_state().
  */
 
 #include <linux/module.h>
index cbe0f96ca342bb1f064c9e134bb1bf0a6c8fcc32..23e3e4a35cc9440c3809e51169040eff0d9c39e8 100644 (file)
@@ -546,6 +546,16 @@ config REGULATOR_MAX1586
          regulator via I2C bus. The provided regulator is suitable
          for PXA27x chips to control VCC_CORE and VCC_USIM voltages.
 
+config REGULATOR_MAX597X
+       tristate "Maxim 597x power switch and monitor"
+       depends on I2C
+       depends on OF
+       depends on MFD_MAX597X
+       help
+         This driver controls a Maxim 5970/5978 switch via I2C bus.
+         The MAX5970/5978 is a smart switch with no output regulation, but
+         fault protection and voltage and current monitoring capabilities.
+
 config REGULATOR_MAX77620
        tristate "Maxim 77620/MAX20024 voltage regulator"
        depends on MFD_MAX77620 || COMPILE_TEST
@@ -804,6 +814,14 @@ config REGULATOR_MT6360
          2-channel buck with Thermal Shutdown and Overload Protection
          6-channel High PSRR and Low Dropout LDO.
 
+config REGULATOR_MT6370
+       tristate "MT6370 SubPMIC Regulator"
+       depends on MFD_MT6370
+       help
+         Say Y here to enable MT6370 regulator support.
+         This driver supports the control for DisplayBias voltages and one
+         general purpose LDO which is commonly used to drive the vibrator.
+
 config REGULATOR_MT6380
        tristate "MediaTek MT6380 PMIC"
        depends on MTK_PMIC_WRAP
@@ -1047,6 +1065,16 @@ config REGULATOR_RT5033
          RT5033 PMIC. The device supports multiple regulators like
          current source, LDO and Buck.
 
+config REGULATOR_RT5120
+       tristate "Richtek RT5120 PMIC Regulators"
+       depends on MFD_RT5120
+       help
+         This adds support for voltage regulator in Richtek RT5120 PMIC.
+         It integrates 4 channels buck controller, 1 channel LDO, 1 EXTEN
+         to control external power source. Only BUCK1 is adjustable from
+         600mV to 1395mV, per step 6.250mV. The others are all fixed voltage
+         by external hardware circuit.
+
 config REGULATOR_RT5190A
        tristate "Richtek RT5190A PMIC"
        depends on I2C
index 8d3ee8b6d41d8f5a37a716ab38bd9946e11de677..fa49bb6cc5442ffed274a2f586703e92e53dd611 100644 (file)
@@ -67,6 +67,7 @@ obj-$(CONFIG_REGULATOR_LTC3589) += ltc3589.o
 obj-$(CONFIG_REGULATOR_LTC3676) += ltc3676.o
 obj-$(CONFIG_REGULATOR_MAX14577) += max14577-regulator.o
 obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
+obj-$(CONFIG_REGULATOR_MAX597X) += max597x-regulator.o
 obj-$(CONFIG_REGULATOR_MAX77620) += max77620-regulator.o
 obj-$(CONFIG_REGULATOR_MAX77650) += max77650-regulator.o
 obj-$(CONFIG_REGULATOR_MAX8649)        += max8649.o
@@ -97,6 +98,7 @@ obj-$(CONFIG_REGULATOR_MT6323)        += mt6323-regulator.o
 obj-$(CONFIG_REGULATOR_MT6358) += mt6358-regulator.o
 obj-$(CONFIG_REGULATOR_MT6359) += mt6359-regulator.o
 obj-$(CONFIG_REGULATOR_MT6360) += mt6360-regulator.o
+obj-$(CONFIG_REGULATOR_MT6370) += mt6370-regulator.o
 obj-$(CONFIG_REGULATOR_MT6380) += mt6380-regulator.o
 obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
 obj-$(CONFIG_REGULATOR_MTK_DVFSRC) += mtk-dvfsrc-regulator.o
@@ -126,6 +128,7 @@ obj-$(CONFIG_REGULATOR_ROHM)        += rohm-regulator.o
 obj-$(CONFIG_REGULATOR_RT4801) += rt4801-regulator.o
 obj-$(CONFIG_REGULATOR_RT4831) += rt4831-regulator.o
 obj-$(CONFIG_REGULATOR_RT5033) += rt5033-regulator.o
+obj-$(CONFIG_REGULATOR_RT5120) += rt5120-regulator.o
 obj-$(CONFIG_REGULATOR_RT5190A) += rt5190a-regulator.o
 obj-$(CONFIG_REGULATOR_RT5759) += rt5759-regulator.o
 obj-$(CONFIG_REGULATOR_RT6160) += rt6160-regulator.o
index 1e54a833f2cf0e5ea2dcab5f8351e0da690a6b39..7150b1d0159e5da8868badd8faafe17eb1a56d73 100644 (file)
@@ -1565,6 +1565,9 @@ static int set_machine_constraints(struct regulator_dev *rdev)
                        rdev->constraints->always_on = true;
        }
 
+       if (rdev->desc->off_on_delay)
+               rdev->last_off = ktime_get();
+
        /* If the constraints say the regulator should be on at this point
         * and we have control then make sure it is enabled.
         */
@@ -1592,8 +1595,6 @@ static int set_machine_constraints(struct regulator_dev *rdev)
 
                if (rdev->constraints->always_on)
                        rdev->use_count++;
-       } else if (rdev->desc->off_on_delay) {
-               rdev->last_off = ktime_get();
        }
 
        print_constraints(rdev);
@@ -4783,22 +4784,26 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
                consumers[i].consumer = regulator_get(dev,
                                                      consumers[i].supply);
                if (IS_ERR(consumers[i].consumer)) {
-                       ret = PTR_ERR(consumers[i].consumer);
                        consumers[i].consumer = NULL;
+                       ret = dev_err_probe(dev, PTR_ERR(consumers[i].consumer),
+                                           "Failed to get supply '%s'",
+                                           consumers[i].supply);
                        goto err;
                }
+
+               if (consumers[i].init_load_uA > 0) {
+                       ret = regulator_set_load(consumers[i].consumer,
+                                                consumers[i].init_load_uA);
+                       if (ret) {
+                               i++;
+                               goto err;
+                       }
+               }
        }
 
        return 0;
 
 err:
-       if (ret != -EPROBE_DEFER)
-               dev_err(dev, "Failed to get supply '%s': %pe\n",
-                       consumers[i].supply, ERR_PTR(ret));
-       else
-               dev_dbg(dev, "Failed to get supply '%s', deferring\n",
-                       consumers[i].supply);
-
        while (--i >= 0)
                regulator_put(consumers[i].consumer);
 
index 9113233f41cd11a38c7d6e308172f6b0407c28fb..32823a87fd409a310ddd0417ee4af41869271ce7 100644 (file)
@@ -166,6 +166,34 @@ int devm_regulator_bulk_get(struct device *dev, int num_consumers,
 }
 EXPORT_SYMBOL_GPL(devm_regulator_bulk_get);
 
+/**
+ * devm_regulator_bulk_get_const - devm_regulator_bulk_get() w/ const data
+ *
+ * @dev:           device to supply
+ * @num_consumers: number of consumers to register
+ * @in_consumers:  const configuration of consumers
+ * @out_consumers: in_consumers is copied here and this is passed to
+ *                devm_regulator_bulk_get().
+ *
+ * This is a convenience function to allow bulk regulator configuration
+ * to be stored "static const" in files.
+ *
+ * Return: 0 on success, an errno on failure.
+ */
+int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
+                                 const struct regulator_bulk_data *in_consumers,
+                                 struct regulator_bulk_data **out_consumers)
+{
+       *out_consumers = devm_kmemdup(dev, in_consumers,
+                                     num_consumers * sizeof(*in_consumers),
+                                     GFP_KERNEL);
+       if (*out_consumers == NULL)
+               return -ENOMEM;
+
+       return devm_regulator_bulk_get(dev, num_consumers, *out_consumers);
+}
+EXPORT_SYMBOL_GPL(devm_regulator_bulk_get_const);
+
 static void devm_rdev_release(struct device *dev, void *res)
 {
        regulator_unregister(*(struct regulator_dev **)res);
diff --git a/drivers/regulator/max597x-regulator.c b/drivers/regulator/max597x-regulator.c
new file mode 100644 (file)
index 0000000..03c6027
--- /dev/null
@@ -0,0 +1,502 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device driver for regulators in MAX5970 and MAX5978 IC
+ *
+ * Copyright (c) 2022 9elements GmbH
+ *
+ * Author: Patrick Rudolph <patrick.rudolph@9elements.com>
+ */
+
+#include <linux/bitops.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/module.h>
+#include <linux/io.h>
+#include <linux/of.h>
+#include <linux/i2c.h>
+#include <linux/regmap.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/of_regulator.h>
+#include <linux/platform_device.h>
+
+#include <linux/mfd/max597x.h>
+
+struct max597x_regulator {
+       int num_switches, mon_rng, irng, shunt_micro_ohms, lim_uA;
+       struct regmap *regmap;
+};
+
+enum max597x_regulator_id {
+       MAX597X_SW0,
+       MAX597X_SW1,
+};
+
+static int max597x_uvp_ovp_check_mode(struct regulator_dev *rdev, int severity)
+{
+       int ret, reg;
+
+       /* Status1 register contains the soft strap values sampled at POR */
+       ret = regmap_read(rdev->regmap, MAX5970_REG_STATUS1, &reg);
+       if (ret)
+               return ret;
+
+       /* Check soft straps match requested mode */
+       if (severity == REGULATOR_SEVERITY_PROT) {
+               if (STATUS1_PROT(reg) != STATUS1_PROT_SHUTDOWN)
+                       return -EOPNOTSUPP;
+
+               return 0;
+       }
+       if (STATUS1_PROT(reg) == STATUS1_PROT_SHUTDOWN)
+               return -EOPNOTSUPP;
+
+       return 0;
+}
+
+static int max597x_set_vp(struct regulator_dev *rdev, int lim_uV, int severity,
+                         bool enable, bool overvoltage)
+{
+       int off_h, off_l, reg, ret;
+       struct max597x_regulator *data = rdev_get_drvdata(rdev);
+       int channel = rdev_get_id(rdev);
+
+       if (overvoltage) {
+               if (severity == REGULATOR_SEVERITY_WARN) {
+                       off_h = MAX5970_REG_CH_OV_WARN_H(channel);
+                       off_l = MAX5970_REG_CH_OV_WARN_L(channel);
+               } else {
+                       off_h = MAX5970_REG_CH_OV_CRIT_H(channel);
+                       off_l = MAX5970_REG_CH_OV_CRIT_L(channel);
+               }
+       } else {
+               if (severity == REGULATOR_SEVERITY_WARN) {
+                       off_h = MAX5970_REG_CH_UV_WARN_H(channel);
+                       off_l = MAX5970_REG_CH_UV_WARN_L(channel);
+               } else {
+                       off_h = MAX5970_REG_CH_UV_CRIT_H(channel);
+                       off_l = MAX5970_REG_CH_UV_CRIT_L(channel);
+               }
+       }
+
+       if (enable)
+               /* reg = ADC_MASK * (lim_uV / 1000000) / (data->mon_rng / 1000000) */
+               reg = ADC_MASK * lim_uV / data->mon_rng;
+       else
+               reg = 0;
+
+       ret = regmap_write(rdev->regmap, off_h, MAX5970_VAL2REG_H(reg));
+       if (ret)
+               return ret;
+
+       ret = regmap_write(rdev->regmap, off_l, MAX5970_VAL2REG_L(reg));
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
+static int max597x_set_uvp(struct regulator_dev *rdev, int lim_uV, int severity,
+                          bool enable)
+{
+       int ret;
+
+       /*
+        * MAX5970 has enable control as a special value in limit reg. Can't
+        * set limit but keep feature disabled or enable W/O given limit.
+        */
+       if ((lim_uV && !enable) || (!lim_uV && enable))
+               return -EINVAL;
+
+       ret = max597x_uvp_ovp_check_mode(rdev, severity);
+       if (ret)
+               return ret;
+
+       return max597x_set_vp(rdev, lim_uV, severity, enable, false);
+}
+
+static int max597x_set_ovp(struct regulator_dev *rdev, int lim_uV, int severity,
+                          bool enable)
+{
+       int ret;
+
+       /*
+        * MAX5970 has enable control as a special value in limit reg. Can't
+        * set limit but keep feature disabled or enable W/O given limit.
+        */
+       if ((lim_uV && !enable) || (!lim_uV && enable))
+               return -EINVAL;
+
+       ret = max597x_uvp_ovp_check_mode(rdev, severity);
+       if (ret)
+               return ret;
+
+       return max597x_set_vp(rdev, lim_uV, severity, enable, true);
+}
+
+static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
+                          int severity, bool enable)
+{
+       int ret, val, reg;
+       unsigned int vthst, vthfst;
+
+       struct max597x_regulator *data = rdev_get_drvdata(rdev);
+       int rdev_id = rdev_get_id(rdev);
+       /*
+        * MAX5970 doesn't has enable control for ocp.
+        * If limit is specified but enable is not set then hold the value in
+        * variable & later use it when ocp needs to be enabled.
+        */
+       if (lim_uA != 0 && lim_uA != data->lim_uA)
+               data->lim_uA = lim_uA;
+
+       if (severity != REGULATOR_SEVERITY_PROT)
+               return -EINVAL;
+
+       if (enable) {
+
+               /* Calc Vtrip threshold in uV. */
+               vthst =
+                   div_u64(mul_u32_u32(data->shunt_micro_ohms, data->lim_uA),
+                           1000000);
+
+               /*
+                * As recommended in datasheed, add 20% margin to avoid
+                * spurious event & passive component tolerance.
+                */
+               vthst = div_u64(mul_u32_u32(vthst, 120), 100);
+
+               /* Calc fast Vtrip threshold in uV */
+               vthfst = vthst * (MAX5970_FAST2SLOW_RATIO / 100);
+
+               if (vthfst > data->irng) {
+                       dev_err(&rdev->dev, "Current limit out of range\n");
+                       return -EINVAL;
+               }
+               /* Fast trip threshold to be programmed */
+               val = div_u64(mul_u32_u32(0xFF, vthfst), data->irng);
+       } else
+               /*
+                * Since there is no option to disable ocp, set limit to max
+                * value
+                */
+               val = 0xFF;
+
+       reg = MAX5970_REG_DAC_FAST(rdev_id);
+       ret = regmap_write(rdev->regmap, reg, val);
+
+       return ret;
+}
+
+static int max597x_get_status(struct regulator_dev *rdev)
+{
+       int val, ret;
+
+       ret = regmap_read(rdev->regmap, MAX5970_REG_STATUS3, &val);
+       if (ret)
+               return REGULATOR_FAILED_RETRY;
+
+       if (val & MAX5970_STATUS3_ALERT)
+               return REGULATOR_STATUS_ERROR;
+
+       ret = regulator_is_enabled_regmap(rdev);
+       if (ret < 0)
+               return ret;
+
+       if (ret)
+               return REGULATOR_STATUS_ON;
+
+       return REGULATOR_STATUS_OFF;
+}
+
+static const struct regulator_ops max597x_switch_ops = {
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .is_enabled = regulator_is_enabled_regmap,
+       .get_status = max597x_get_status,
+       .set_over_voltage_protection = max597x_set_ovp,
+       .set_under_voltage_protection = max597x_set_uvp,
+       .set_over_current_protection = max597x_set_ocp,
+};
+
+static int max597x_dt_parse(struct device_node *np,
+                           const struct regulator_desc *desc,
+                           struct regulator_config *cfg)
+{
+       struct max597x_regulator *data = cfg->driver_data;
+       int ret = 0;
+
+       ret =
+           of_property_read_u32(np, "shunt-resistor-micro-ohms",
+                                &data->shunt_micro_ohms);
+       if (ret < 0)
+               dev_err(cfg->dev,
+                       "property 'shunt-resistor-micro-ohms' not found, err %d\n",
+                       ret);
+       return ret;
+
+}
+
+#define MAX597X_SWITCH(_ID, _ereg, _chan, _supply) {     \
+       .name            = #_ID,                         \
+       .of_match        = of_match_ptr(#_ID),           \
+       .ops             = &max597x_switch_ops,          \
+       .regulators_node = of_match_ptr("regulators"),   \
+       .type            = REGULATOR_VOLTAGE,            \
+       .id              = MAX597X_##_ID,                \
+       .owner           = THIS_MODULE,                  \
+       .supply_name     = _supply,                      \
+       .enable_reg      = _ereg,                        \
+       .enable_mask     = CHXEN((_chan)),               \
+       .of_parse_cb     = max597x_dt_parse,             \
+}
+
+static const struct regulator_desc regulators[] = {
+       MAX597X_SWITCH(SW0, MAX5970_REG_CHXEN, 0, "vss1"),
+       MAX597X_SWITCH(SW1, MAX5970_REG_CHXEN, 1, "vss2"),
+};
+
+static int max597x_regmap_read_clear(struct regmap *map, unsigned int reg,
+                                    unsigned int *val)
+{
+       int ret;
+
+       ret = regmap_read(map, reg, val);
+       if (ret)
+               return ret;
+
+       if (*val)
+               return regmap_write(map, reg, *val);
+
+       return 0;
+}
+
+static int max597x_irq_handler(int irq, struct regulator_irq_data *rid,
+                              unsigned long *dev_mask)
+{
+       struct regulator_err_state *stat;
+       struct max597x_regulator *d = (struct max597x_regulator *)rid->data;
+       int val, ret, i;
+
+       ret = max597x_regmap_read_clear(d->regmap, MAX5970_REG_FAULT0, &val);
+       if (ret)
+               return REGULATOR_FAILED_RETRY;
+
+       *dev_mask = 0;
+       for (i = 0; i < d->num_switches; i++) {
+               stat = &rid->states[i];
+               stat->notifs = 0;
+               stat->errors = 0;
+       }
+
+       for (i = 0; i < d->num_switches; i++) {
+               stat = &rid->states[i];
+
+               if (val & UV_STATUS_CRIT(i)) {
+                       *dev_mask |= 1 << i;
+                       stat->notifs |= REGULATOR_EVENT_UNDER_VOLTAGE;
+                       stat->errors |= REGULATOR_ERROR_UNDER_VOLTAGE;
+               } else if (val & UV_STATUS_WARN(i)) {
+                       *dev_mask |= 1 << i;
+                       stat->notifs |= REGULATOR_EVENT_UNDER_VOLTAGE_WARN;
+                       stat->errors |= REGULATOR_ERROR_UNDER_VOLTAGE_WARN;
+               }
+       }
+
+       ret = max597x_regmap_read_clear(d->regmap, MAX5970_REG_FAULT1, &val);
+       if (ret)
+               return REGULATOR_FAILED_RETRY;
+
+       for (i = 0; i < d->num_switches; i++) {
+               stat = &rid->states[i];
+
+               if (val & OV_STATUS_CRIT(i)) {
+                       *dev_mask |= 1 << i;
+                       stat->notifs |= REGULATOR_EVENT_REGULATION_OUT;
+                       stat->errors |= REGULATOR_ERROR_REGULATION_OUT;
+               } else if (val & OV_STATUS_WARN(i)) {
+                       *dev_mask |= 1 << i;
+                       stat->notifs |= REGULATOR_EVENT_OVER_VOLTAGE_WARN;
+                       stat->errors |= REGULATOR_ERROR_OVER_VOLTAGE_WARN;
+               }
+       }
+
+       ret = max597x_regmap_read_clear(d->regmap, MAX5970_REG_FAULT2, &val);
+       if (ret)
+               return REGULATOR_FAILED_RETRY;
+
+       for (i = 0; i < d->num_switches; i++) {
+               stat = &rid->states[i];
+
+               if (val & OC_STATUS_WARN(i)) {
+                       *dev_mask |= 1 << i;
+                       stat->notifs |= REGULATOR_EVENT_OVER_CURRENT_WARN;
+                       stat->errors |= REGULATOR_ERROR_OVER_CURRENT_WARN;
+               }
+       }
+
+       ret = regmap_read(d->regmap, MAX5970_REG_STATUS0, &val);
+       if (ret)
+               return REGULATOR_FAILED_RETRY;
+
+       for (i = 0; i < d->num_switches; i++) {
+               stat = &rid->states[i];
+
+               if ((val & MAX5970_CB_IFAULTF(i))
+                   || (val & MAX5970_CB_IFAULTS(i))) {
+                       *dev_mask |= 1 << i;
+                       stat->notifs |=
+                           REGULATOR_EVENT_OVER_CURRENT |
+                           REGULATOR_EVENT_DISABLE;
+                       stat->errors |=
+                           REGULATOR_ERROR_OVER_CURRENT | REGULATOR_ERROR_FAIL;
+
+                       /* Clear the sub-IRQ status */
+                       regulator_disable_regmap(stat->rdev);
+               }
+       }
+       return 0;
+}
+
+static const struct regmap_config max597x_regmap_config = {
+       .reg_bits = 8,
+       .val_bits = 8,
+       .max_register = MAX_REGISTERS,
+};
+
+static int max597x_adc_range(struct regmap *regmap, const int ch,
+                            u32 *irng, u32 *mon_rng)
+{
+       unsigned int reg;
+       int ret;
+
+       /* Decode current ADC range */
+       ret = regmap_read(regmap, MAX5970_REG_STATUS2, &reg);
+       if (ret)
+               return ret;
+       switch (MAX5970_IRNG(reg, ch)) {
+       case 0:
+               *irng = 100000; /* 100 mV */
+               break;
+       case 1:
+               *irng = 50000;  /* 50 mV */
+               break;
+       case 2:
+               *irng = 25000;  /* 25 mV */
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* Decode current voltage monitor range */
+       ret = regmap_read(regmap, MAX5970_REG_MON_RANGE, &reg);
+       if (ret)
+               return ret;
+
+       *mon_rng = MAX5970_MON_MAX_RANGE_UV >> MAX5970_MON(reg, ch);
+
+       return 0;
+}
+
+static int max597x_setup_irq(struct device *dev,
+                            int irq,
+                            struct regulator_dev *rdevs[MAX5970_NUM_SWITCHES],
+                            int num_switches, struct max597x_regulator *data)
+{
+       struct regulator_irq_desc max597x_notif = {
+               .name = "max597x-irq",
+               .map_event = max597x_irq_handler,
+               .data = data,
+       };
+       int errs = REGULATOR_ERROR_UNDER_VOLTAGE |
+           REGULATOR_ERROR_UNDER_VOLTAGE_WARN |
+           REGULATOR_ERROR_OVER_VOLTAGE_WARN |
+           REGULATOR_ERROR_REGULATION_OUT |
+           REGULATOR_ERROR_OVER_CURRENT |
+           REGULATOR_ERROR_OVER_CURRENT_WARN | REGULATOR_ERROR_FAIL;
+       void *irq_helper;
+
+       /* Register notifiers - can fail if IRQ is not given */
+       irq_helper = devm_regulator_irq_helper(dev, &max597x_notif,
+                                              irq, 0, errs, NULL,
+                                              &rdevs[0], num_switches);
+       if (IS_ERR(irq_helper)) {
+               if (PTR_ERR(irq_helper) == -EPROBE_DEFER)
+                       return -EPROBE_DEFER;
+
+               dev_warn(dev, "IRQ disabled %pe\n", irq_helper);
+       }
+
+       return 0;
+}
+
+static int max597x_regulator_probe(struct platform_device *pdev)
+{
+
+
+       struct max597x_data *max597x = dev_get_drvdata(pdev->dev.parent);
+       struct max597x_regulator *data;
+
+       struct regulator_config config = { };
+       struct regulator_dev *rdev;
+       struct regulator_dev *rdevs[MAX5970_NUM_SWITCHES];
+       int num_switches = max597x->num_switches;
+       int ret, i;
+
+       for (i = 0; i < num_switches; i++) {
+               data =
+                   devm_kzalloc(max597x->dev, sizeof(struct max597x_regulator),
+                                GFP_KERNEL);
+               if (!data)
+                       return -ENOMEM;
+
+               data->num_switches = num_switches;
+               data->regmap = max597x->regmap;
+
+               ret = max597x_adc_range(data->regmap, i, &max597x->irng[i], &max597x->mon_rng[i]);
+               if (ret < 0)
+                       return ret;
+
+               data->irng = max597x->irng[i];
+               data->mon_rng = max597x->mon_rng[i];
+
+               config.dev = max597x->dev;
+               config.driver_data = (void *)data;
+               config.regmap = data->regmap;
+               rdev = devm_regulator_register(max597x->dev,
+                                              &regulators[i], &config);
+               if (IS_ERR(rdev)) {
+                       dev_err(max597x->dev, "failed to register regulator %s\n",
+                               regulators[i].name);
+                       return PTR_ERR(rdev);
+               }
+               rdevs[i] = rdev;
+               max597x->shunt_micro_ohms[i] = data->shunt_micro_ohms;
+       }
+
+       if (max597x->irq) {
+               ret =
+                   max597x_setup_irq(max597x->dev, max597x->irq, rdevs, num_switches,
+                                     data);
+               if (ret) {
+                       dev_err(max597x->dev, "IRQ setup failed");
+                       return ret;
+               }
+       }
+
+       return ret;
+}
+
+static struct platform_driver max597x_regulator_driver = {
+       .driver = {
+               .name = "max597x-regulator",
+       },
+       .probe = max597x_regulator_probe,
+};
+
+module_platform_driver(max597x_regulator_driver);
+
+
+MODULE_AUTHOR("Patrick Rudolph <patrick.rudolph@9elements.com>");
+MODULE_DESCRIPTION("MAX5970_hot-swap controller driver");
+MODULE_LICENSE("GPL v2");
index 39cebec0edb6624ec6ee1476ec0886d4f488ff61..82892d71c2c962f9c66eda0724a32c11c50188f0 100644 (file)
@@ -6,14 +6,14 @@
 //
 // Author: Saravanan Sekar <sravanhome@gmail.com>
 
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
 #include <linux/err.h>
+#include <linux/i2c.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/driver.h>
-#include <linux/i2c.h>
 
 #define MP5416_REG_CTL0                        0x00
 #define MP5416_REG_CTL1                        0x01
@@ -174,10 +174,22 @@ static struct regulator_desc mp5416_regulators_desc[MP5416_MAX_REGULATORS] = {
        MP5416LDO("ldo4", 4, BIT(1)),
 };
 
+static struct regulator_desc mp5496_regulators_desc[MP5416_MAX_REGULATORS] = {
+       MP5416BUCK("buck1", 1, mp5416_I_limits1, MP5416_REG_CTL1, BIT(0), 1),
+       MP5416BUCK("buck2", 2, mp5416_I_limits2, MP5416_REG_CTL1, BIT(1), 1),
+       MP5416BUCK("buck3", 3, mp5416_I_limits1, MP5416_REG_CTL1, BIT(2), 1),
+       MP5416BUCK("buck4", 4, mp5416_I_limits2, MP5416_REG_CTL2, BIT(5), 1),
+       MP5416LDO("ldo1", 1, BIT(4)),
+       MP5416LDO("ldo2", 2, BIT(3)),
+       MP5416LDO("ldo3", 3, BIT(2)),
+       MP5416LDO("ldo4", 4, BIT(1)),
+};
+
 static int mp5416_i2c_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        struct regulator_config config = { NULL, };
+       static const struct regulator_desc *desc;
        struct regulator_dev *rdev;
        struct regmap *regmap;
        int i;
@@ -188,12 +200,16 @@ static int mp5416_i2c_probe(struct i2c_client *client)
                return PTR_ERR(regmap);
        }
 
+       desc = of_device_get_match_data(dev);
+       if (!desc)
+               return -ENODEV;
+
        config.dev = dev;
        config.regmap = regmap;
 
        for (i = 0; i < MP5416_MAX_REGULATORS; i++) {
                rdev = devm_regulator_register(dev,
-                                              &mp5416_regulators_desc[i],
+                                              &desc[i],
                                               &config);
                if (IS_ERR(rdev)) {
                        dev_err(dev, "Failed to register regulator!\n");
@@ -205,13 +221,15 @@ static int mp5416_i2c_probe(struct i2c_client *client)
 }
 
 static const struct of_device_id mp5416_of_match[] = {
-       { .compatible = "mps,mp5416" },
+       { .compatible = "mps,mp5416", .data = &mp5416_regulators_desc },
+       { .compatible = "mps,mp5496", .data = &mp5496_regulators_desc },
        {},
 };
 MODULE_DEVICE_TABLE(of, mp5416_of_match);
 
 static const struct i2c_device_id mp5416_id[] = {
        { "mp5416", },
+       { "mp5496", },
        { },
 };
 MODULE_DEVICE_TABLE(i2c, mp5416_id);
diff --git a/drivers/regulator/mt6370-regulator.c b/drivers/regulator/mt6370-regulator.c
new file mode 100644 (file)
index 0000000..e73f5a4
--- /dev/null
@@ -0,0 +1,390 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <linux/bits.h>
+#include <linux/gpio/consumer.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+
+enum {
+       MT6370_IDX_DSVBOOST = 0,
+       MT6370_IDX_DSVPOS,
+       MT6370_IDX_DSVNEG,
+       MT6370_IDX_VIBLDO,
+       MT6370_MAX_IDX
+};
+
+#define MT6370_REG_LDO_CFG     0x180
+#define MT6370_REG_LDO_VOUT    0x181
+#define MT6370_REG_DB_CTRL1    0x1B0
+#define MT6370_REG_DB_CTRL2    0x1B1
+#define MT6370_REG_DB_VBST     0x1B2
+#define MT6370_REG_DB_VPOS     0x1B3
+#define MT6370_REG_DB_VNEG     0x1B4
+#define MT6370_REG_LDO_STAT    0x1DC
+#define MT6370_REG_DB_STAT     0x1DF
+
+#define MT6370_LDOOMS_MASK     BIT(7)
+#define MT6370_LDOEN_MASK      BIT(7)
+#define MT6370_LDOVOUT_MASK    GENMASK(3, 0)
+#define MT6370_DBPERD_MASK     (BIT(7) | BIT(4))
+#define MT6370_DBEXTEN_MASK    BIT(0)
+#define MT6370_DBVPOSEN_MASK   BIT(6)
+#define MT6370_DBVPOSDISG_MASK BIT(5)
+#define MT6370_DBVNEGEN_MASK   BIT(3)
+#define MT6370_DBVNEGDISG_MASK BIT(2)
+#define MT6370_DBALLON_MASK    (MT6370_DBVPOSEN_MASK | MT6370_DBVNEGEN_MASK)
+#define MT6370_DBSLEW_MASK     GENMASK(7, 6)
+#define MT6370_DBVOUT_MASK     GENMASK(5, 0)
+#define MT6370_LDOOC_EVT_MASK  BIT(7)
+#define MT6370_POSSCP_EVT_MASK BIT(7)
+#define MT6370_NEGSCP_EVT_MASK BIT(6)
+#define MT6370_BSTOCP_EVT_MASK BIT(5)
+#define MT6370_POSOCP_EVT_MASK BIT(4)
+#define MT6370_NEGOCP_EVT_MASK BIT(3)
+
+#define MT6370_LDO_MINUV       1600000
+#define MT6370_LDO_STPUV       200000
+#define MT6370_LDO_N_VOLT      13
+#define MT6370_DBVBOOST_MINUV  4000000
+#define MT6370_DBVBOOST_STPUV  50000
+#define MT6370_DBVBOOST_N_VOLT 45
+#define MT6370_DBVOUT_MINUV    4000000
+#define MT6370_DBVOUT_STPUV    50000
+#define MT6370_DBVOUT_N_VOLT   41
+
+struct mt6370_priv {
+       struct device *dev;
+       struct regmap *regmap;
+       struct regulator_dev *rdev[MT6370_MAX_IDX];
+       bool use_external_ctrl;
+};
+
+static const unsigned int mt6370_vpos_ramp_tbl[] = { 8540, 5840, 4830, 3000 };
+static const unsigned int mt6370_vneg_ramp_tbl[] = { 10090, 6310, 5050, 3150 };
+
+static int mt6370_get_error_flags(struct regulator_dev *rdev,
+                                 unsigned int *flags)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       unsigned int stat_reg, stat, rpt_flags = 0;
+       int rid = rdev_get_id(rdev), ret;
+
+       if (rid == MT6370_IDX_VIBLDO)
+               stat_reg = MT6370_REG_LDO_STAT;
+       else
+               stat_reg = MT6370_REG_DB_STAT;
+
+       ret = regmap_read(regmap, stat_reg, &stat);
+       if (ret)
+               return ret;
+
+       switch (rid) {
+       case MT6370_IDX_DSVBOOST:
+               if (stat & MT6370_BSTOCP_EVT_MASK)
+                       rpt_flags |= REGULATOR_ERROR_OVER_CURRENT;
+               break;
+       case MT6370_IDX_DSVPOS:
+               if (stat & MT6370_POSSCP_EVT_MASK)
+                       rpt_flags |= REGULATOR_ERROR_UNDER_VOLTAGE;
+
+               if (stat & MT6370_POSOCP_EVT_MASK)
+                       rpt_flags |= REGULATOR_ERROR_OVER_CURRENT;
+               break;
+       case MT6370_IDX_DSVNEG:
+               if (stat & MT6370_NEGSCP_EVT_MASK)
+                       rpt_flags |= REGULATOR_ERROR_UNDER_VOLTAGE;
+
+               if (stat & MT6370_NEGOCP_EVT_MASK)
+                       rpt_flags |= REGULATOR_ERROR_OVER_CURRENT;
+               break;
+       default:
+               if (stat & MT6370_LDOOC_EVT_MASK)
+                       rpt_flags |= REGULATOR_ERROR_OVER_CURRENT;
+               break;
+       }
+
+       *flags = rpt_flags;
+       return 0;
+}
+
+static const struct regulator_ops mt6370_dbvboost_ops = {
+       .get_voltage_sel = regulator_get_voltage_sel_regmap,
+       .set_voltage_sel = regulator_set_voltage_sel_regmap,
+       .list_voltage = regulator_list_voltage_linear,
+       .get_bypass = regulator_get_bypass_regmap,
+       .set_bypass = regulator_set_bypass_regmap,
+       .get_error_flags = mt6370_get_error_flags,
+};
+
+static const struct regulator_ops mt6370_dbvout_ops = {
+       .get_voltage_sel = regulator_get_voltage_sel_regmap,
+       .set_voltage_sel = regulator_set_voltage_sel_regmap,
+       .list_voltage = regulator_list_voltage_linear,
+       .is_enabled = regulator_is_enabled_regmap,
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .set_active_discharge = regulator_set_active_discharge_regmap,
+       .set_ramp_delay = regulator_set_ramp_delay_regmap,
+       .get_error_flags = mt6370_get_error_flags,
+};
+
+static const struct regulator_ops mt6370_ldo_ops = {
+       .get_voltage_sel = regulator_get_voltage_sel_regmap,
+       .set_voltage_sel = regulator_set_voltage_sel_regmap,
+       .list_voltage = regulator_list_voltage_linear,
+       .is_enabled = regulator_is_enabled_regmap,
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .set_active_discharge = regulator_set_active_discharge_regmap,
+       .get_error_flags = mt6370_get_error_flags,
+};
+
+static int mt6370_of_parse_cb(struct device_node *np,
+                             const struct regulator_desc *desc,
+                             struct regulator_config *config)
+{
+       struct mt6370_priv *priv = config->driver_data;
+       struct gpio_desc *enable_gpio;
+       int ret;
+
+       enable_gpio = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0,
+                                            GPIOD_OUT_HIGH |
+                                            GPIOD_FLAGS_BIT_NONEXCLUSIVE,
+                                            desc->name);
+       if (IS_ERR(enable_gpio)) {
+               config->ena_gpiod = NULL;
+               return 0;
+       }
+
+       /*
+        * RG control by default
+        * Only if all are using external pin, change all by external control
+        */
+       if (priv->use_external_ctrl) {
+               ret = regmap_update_bits(priv->regmap, MT6370_REG_DB_CTRL1,
+                                        MT6370_DBEXTEN_MASK,
+                                        MT6370_DBEXTEN_MASK);
+               if (ret)
+                       return ret;
+       }
+
+       config->ena_gpiod = enable_gpio;
+       priv->use_external_ctrl = true;
+       return 0;
+}
+
+static const struct regulator_desc mt6370_regulator_descs[] = {
+       {
+               .name = "mt6370-dsv-vbst",
+               .of_match = of_match_ptr("dsvbst"),
+               .regulators_node = of_match_ptr("regulators"),
+               .id = MT6370_IDX_DSVBOOST,
+               .type = REGULATOR_VOLTAGE,
+               .owner = THIS_MODULE,
+               .ops = &mt6370_dbvboost_ops,
+               .min_uV = MT6370_DBVBOOST_MINUV,
+               .uV_step = MT6370_DBVBOOST_STPUV,
+               .n_voltages = MT6370_DBVBOOST_N_VOLT,
+               .vsel_reg = MT6370_REG_DB_VBST,
+               .vsel_mask = MT6370_DBVOUT_MASK,
+               .bypass_reg = MT6370_REG_DB_CTRL1,
+               .bypass_mask = MT6370_DBPERD_MASK,
+               .bypass_val_on = MT6370_DBPERD_MASK,
+       },
+       {
+               .name = "mt6370-dsv-vpos",
+               .of_match = of_match_ptr("dsvpos"),
+               .regulators_node = of_match_ptr("regulators"),
+               .id = MT6370_IDX_DSVPOS,
+               .type = REGULATOR_VOLTAGE,
+               .owner = THIS_MODULE,
+               .of_parse_cb = mt6370_of_parse_cb,
+               .ops = &mt6370_dbvout_ops,
+               .min_uV = MT6370_DBVOUT_MINUV,
+               .uV_step = MT6370_DBVOUT_STPUV,
+               .n_voltages = MT6370_DBVOUT_N_VOLT,
+               .vsel_reg = MT6370_REG_DB_VPOS,
+               .vsel_mask = MT6370_DBVOUT_MASK,
+               .enable_reg = MT6370_REG_DB_CTRL2,
+               .enable_mask = MT6370_DBVPOSEN_MASK,
+               .ramp_reg = MT6370_REG_DB_VPOS,
+               .ramp_mask = MT6370_DBSLEW_MASK,
+               .ramp_delay_table = mt6370_vpos_ramp_tbl,
+               .n_ramp_values = ARRAY_SIZE(mt6370_vpos_ramp_tbl),
+               .active_discharge_reg = MT6370_REG_DB_CTRL2,
+               .active_discharge_mask = MT6370_DBVPOSDISG_MASK,
+               .active_discharge_on = MT6370_DBVPOSDISG_MASK,
+       },
+       {
+               .name = "mt6370-dsv-vneg",
+               .of_match = of_match_ptr("dsvneg"),
+               .regulators_node = of_match_ptr("regulators"),
+               .id = MT6370_IDX_DSVNEG,
+               .type = REGULATOR_VOLTAGE,
+               .owner = THIS_MODULE,
+               .of_parse_cb = mt6370_of_parse_cb,
+               .ops = &mt6370_dbvout_ops,
+               .min_uV = MT6370_DBVOUT_MINUV,
+               .uV_step = MT6370_DBVOUT_STPUV,
+               .n_voltages = MT6370_DBVOUT_N_VOLT,
+               .vsel_reg = MT6370_REG_DB_VNEG,
+               .vsel_mask = MT6370_DBVOUT_MASK,
+               .enable_reg = MT6370_REG_DB_CTRL2,
+               .enable_mask = MT6370_DBVNEGEN_MASK,
+               .ramp_reg = MT6370_REG_DB_VNEG,
+               .ramp_mask = MT6370_DBSLEW_MASK,
+               .ramp_delay_table = mt6370_vneg_ramp_tbl,
+               .n_ramp_values = ARRAY_SIZE(mt6370_vneg_ramp_tbl),
+               .active_discharge_reg = MT6370_REG_DB_CTRL2,
+               .active_discharge_mask = MT6370_DBVNEGDISG_MASK,
+               .active_discharge_on = MT6370_DBVNEGDISG_MASK,
+       },
+       {
+               .name = "mt6370-vib-ldo",
+               .of_match = of_match_ptr("vibldo"),
+               .regulators_node = of_match_ptr("regulators"),
+               .id = MT6370_IDX_VIBLDO,
+               .type = REGULATOR_VOLTAGE,
+               .owner = THIS_MODULE,
+               .ops = &mt6370_ldo_ops,
+               .min_uV = MT6370_LDO_MINUV,
+               .uV_step = MT6370_LDO_STPUV,
+               .n_voltages = MT6370_LDO_N_VOLT,
+               .vsel_reg = MT6370_REG_LDO_VOUT,
+               .vsel_mask = MT6370_LDOVOUT_MASK,
+               .enable_reg = MT6370_REG_LDO_VOUT,
+               .enable_mask = MT6370_LDOEN_MASK,
+               .active_discharge_reg = MT6370_REG_LDO_CFG,
+               .active_discharge_mask = MT6370_LDOOMS_MASK,
+               .active_discharge_on = MT6370_LDOOMS_MASK,
+       }
+};
+
+static irqreturn_t mt6370_scp_handler(int irq, void *data)
+{
+       struct regulator_dev *rdev = data;
+
+       regulator_notifier_call_chain(rdev, REGULATOR_EVENT_UNDER_VOLTAGE,
+                                     NULL);
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t mt6370_ocp_handler(int irq, void *data)
+{
+       struct regulator_dev *rdev = data;
+
+       regulator_notifier_call_chain(rdev, REGULATOR_EVENT_OVER_CURRENT, NULL);
+       return IRQ_HANDLED;
+}
+
+static int mt6370_regulator_irq_register(struct mt6370_priv *priv)
+{
+       struct platform_device *pdev = to_platform_device(priv->dev);
+       static const struct {
+               const char *name;
+               int rid;
+               irq_handler_t handler;
+       } mt6370_irqs[] = {
+               { "db_vpos_scp", MT6370_IDX_DSVPOS, mt6370_scp_handler },
+               { "db_vneg_scp", MT6370_IDX_DSVNEG, mt6370_scp_handler },
+               { "db_vbst_ocp", MT6370_IDX_DSVBOOST, mt6370_ocp_handler },
+               { "db_vpos_ocp", MT6370_IDX_DSVPOS,  mt6370_ocp_handler },
+               { "db_vneg_ocp", MT6370_IDX_DSVNEG, mt6370_ocp_handler },
+               { "ldo_oc", MT6370_IDX_VIBLDO, mt6370_ocp_handler }
+       };
+       struct regulator_dev *rdev;
+       int i, irq, ret;
+
+       for (i = 0; i < ARRAY_SIZE(mt6370_irqs); i++) {
+               irq = platform_get_irq_byname(pdev, mt6370_irqs[i].name);
+
+               rdev = priv->rdev[mt6370_irqs[i].rid];
+
+               ret = devm_request_threaded_irq(priv->dev, irq, NULL,
+                                               mt6370_irqs[i].handler, 0,
+                                               mt6370_irqs[i].name, rdev);
+               if (ret) {
+                       dev_err(priv->dev,
+                               "Failed to register (%d) interrupt\n", i);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+static int mt6370_regualtor_register(struct mt6370_priv *priv)
+{
+       struct regulator_dev *rdev;
+       struct regulator_config cfg = {};
+       struct device *parent = priv->dev->parent;
+       int i;
+
+       cfg.dev = parent;
+       cfg.driver_data = priv;
+
+       for (i = 0; i < MT6370_MAX_IDX; i++) {
+               rdev = devm_regulator_register(priv->dev,
+                                              mt6370_regulator_descs + i,
+                                              &cfg);
+               if (IS_ERR(rdev)) {
+                       dev_err(priv->dev,
+                               "Failed to register (%d) regulator\n", i);
+                       return PTR_ERR(rdev);
+               }
+
+               priv->rdev[i] = rdev;
+       }
+
+       return 0;
+}
+
+static int mt6370_regulator_probe(struct platform_device *pdev)
+{
+       struct mt6370_priv *priv;
+       int ret;
+
+       priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       priv->dev = &pdev->dev;
+
+       priv->regmap = dev_get_regmap(pdev->dev.parent, NULL);
+       if (!priv->regmap) {
+               dev_err(&pdev->dev, "Failed to init regmap\n");
+               return -ENODEV;
+       }
+
+       ret = mt6370_regualtor_register(priv);
+       if (ret)
+               return ret;
+
+       return mt6370_regulator_irq_register(priv);
+}
+
+static const struct platform_device_id mt6370_devid_table[] = {
+       { "mt6370-regulator", 0},
+       {}
+};
+MODULE_DEVICE_TABLE(platform, mt6370_devid_table);
+
+static struct platform_driver mt6370_regulator_driver = {
+       .driver = {
+               .name = "mt6370-regulator",
+       },
+       .id_table = mt6370_devid_table,
+       .probe = mt6370_regulator_probe,
+};
+module_platform_driver(mt6370_regulator_driver);
+
+MODULE_AUTHOR("ChiYuan Huang <cy_huang@richtek.com>");
+MODULE_DESCRIPTION("Mediatek MT6370 Regulator Driver");
+MODULE_LICENSE("GPL v2");
index 2e6b61d3b0cfeed82875b4af5c5f9e348979d403..43234296df369ffdb52ad19c8a4d4f38d4bb7855 100644 (file)
@@ -319,7 +319,7 @@ static const struct platform_device_id mt6380_platform_ids[] = {
 };
 MODULE_DEVICE_TABLE(platform, mt6380_platform_ids);
 
-static const struct of_device_id mt6380_of_match[] = {
+static const struct of_device_id  __maybe_unused mt6380_of_match[] = {
        { .compatible = "mediatek,mt6380-regulator", },
        { /* sentinel */ },
 };
index f54d4f176882a7d84071de210cf53de601ff5a2e..e12b681c72e5ebfd8d68d2b4365fe74d0abfa7b0 100644 (file)
@@ -264,8 +264,12 @@ static int of_get_regulation_constraints(struct device *dev,
                }
 
                suspend_np = of_get_child_by_name(np, regulator_states[i]);
-               if (!suspend_np || !suspend_state)
+               if (!suspend_np)
                        continue;
+               if (!suspend_state) {
+                       of_node_put(suspend_np);
+                       continue;
+               }
 
                if (!of_property_read_u32(suspend_np, "regulator-mode",
                                          &pval)) {
index ef6e47d025cad30b996a6c1124e57f2b2fe5ee06..59024c6391417f2bf9b0ff5cb1c7b34d4b84a98f 100644 (file)
@@ -205,6 +205,7 @@ static const struct regulator_ops rpm_mp5496_ops = {
        .is_enabled = rpm_reg_is_enabled,
        .list_voltage = regulator_list_voltage_linear_range,
 
+       .get_voltage = rpm_reg_get_voltage,
        .set_voltage = rpm_reg_set_voltage,
 };
 
@@ -357,10 +358,10 @@ static const struct regulator_desc pm8941_switch = {
 
 static const struct regulator_desc pm8916_pldo = {
        .linear_ranges = (struct linear_range[]) {
-               REGULATOR_LINEAR_RANGE(750000, 0, 208, 12500),
+               REGULATOR_LINEAR_RANGE(1750000, 0, 127, 12500),
        },
        .n_linear_ranges = 1,
-       .n_voltages = 209,
+       .n_voltages = 128,
        .ops = &rpm_smps_ldo_ops,
 };
 
@@ -783,6 +784,29 @@ static const struct rpm_regulator_data rpm_pm8841_regulators[] = {
        {}
 };
 
+static const struct rpm_regulator_data rpm_pm8909_regulators[] = {
+       { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8916_buck_lvo_smps, "vdd_s1" },
+       { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8916_buck_hvo_smps, "vdd_s2" },
+       { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8916_nldo, "vdd_l1" },
+       { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8916_nldo, "vdd_l2_l5" },
+       { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8916_nldo, "vdd_l3_l6_l10" },
+       { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8916_pldo, "vdd_l4_l7" },
+       { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8226_pldo, "vdd_l2_l5" },
+       { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8226_pldo, "vdd_l3_l6_l10" },
+       { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8226_pldo, "vdd_l4_l7" },
+       { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8916_pldo, "vdd_l8_l11_l15_l18" },
+       { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8916_pldo, "vdd_l9_l12_l14_l17" },
+       { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8916_nldo, "vdd_l3_l6_l10" },
+       { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8226_pldo, "vdd_l8_l11_l15_l18" },
+       { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8916_pldo, "vdd_l9_l12_l14_l17" },
+       { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8916_pldo, "vdd_l13" },
+       { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8916_pldo, "vdd_l9_l12_l14_l17" },
+       { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8916_pldo, "vdd_l8_l11_l15_l18" },
+       { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8916_pldo, "vdd_l9_l12_l14_l17" },
+       { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8916_pldo, "vdd_l8_l11_l15_l18" },
+       {}
+};
+
 static const struct rpm_regulator_data rpm_pm8916_regulators[] = {
        { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8916_buck_lvo_smps, "vdd_s1" },
        { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8916_buck_lvo_smps, "vdd_s2" },
@@ -1221,6 +1245,7 @@ static const struct rpm_regulator_data rpm_pm2250_regulators[] = {
 static const struct of_device_id rpm_of_match[] = {
        { .compatible = "qcom,rpm-mp5496-regulators", .data = &rpm_mp5496_regulators },
        { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators },
+       { .compatible = "qcom,rpm-pm8909-regulators", .data = &rpm_pm8909_regulators },
        { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators },
        { .compatible = "qcom,rpm-pm8226-regulators", .data = &rpm_pm8226_regulators },
        { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators },
index 02bfce98115068075bba01e0a887878bc5cd46ec..a2d0292a92fdc625d6838e192d7b18d8ae0bcd9d 100644 (file)
@@ -164,6 +164,8 @@ enum spmi_regulator_subtype {
        SPMI_REGULATOR_SUBTYPE_ULT_HF_CTL3      = 0x0f,
        SPMI_REGULATOR_SUBTYPE_ULT_HF_CTL4      = 0x10,
        SPMI_REGULATOR_SUBTYPE_HFS430           = 0x0a,
+       SPMI_REGULATOR_SUBTYPE_HT_P150          = 0x35,
+       SPMI_REGULATOR_SUBTYPE_HT_P600          = 0x3d,
 };
 
 enum spmi_common_regulator_registers {
@@ -544,6 +546,14 @@ static struct spmi_voltage_range hfs430_ranges[] = {
        SPMI_VOLTAGE_RANGE(0, 320000, 320000, 2040000, 2040000, 8000),
 };
 
+static struct spmi_voltage_range ht_p150_ranges[] = {
+       SPMI_VOLTAGE_RANGE(0, 1616000, 1616000, 3304000, 3304000, 8000),
+};
+
+static struct spmi_voltage_range ht_p600_ranges[] = {
+       SPMI_VOLTAGE_RANGE(0, 1704000, 1704000, 1896000, 1896000, 8000),
+};
+
 static DEFINE_SPMI_SET_POINTS(pldo);
 static DEFINE_SPMI_SET_POINTS(nldo1);
 static DEFINE_SPMI_SET_POINTS(nldo2);
@@ -564,6 +574,8 @@ static DEFINE_SPMI_SET_POINTS(nldo660);
 static DEFINE_SPMI_SET_POINTS(ht_lvpldo);
 static DEFINE_SPMI_SET_POINTS(ht_nldo);
 static DEFINE_SPMI_SET_POINTS(hfs430);
+static DEFINE_SPMI_SET_POINTS(ht_p150);
+static DEFINE_SPMI_SET_POINTS(ht_p600);
 
 static inline int spmi_vreg_read(struct spmi_regulator *vreg, u16 addr, u8 *buf,
                                 int len)
@@ -1458,6 +1470,8 @@ static const struct regulator_ops spmi_hfs430_ops = {
 
 static const struct spmi_regulator_mapping supported_regulators[] = {
        /*           type subtype dig_min dig_max ltype ops setpoints hpm_min */
+       SPMI_VREG(LDO,   HT_P600,  0, INF, HFS430, hfs430, ht_p600, 10000),
+       SPMI_VREG(LDO,   HT_P150,  0, INF, HFS430, hfs430, ht_p150, 10000),
        SPMI_VREG(BUCK,  GP_CTL,   0, INF, SMPS,   smps,   smps,   100000),
        SPMI_VREG(BUCK,  HFS430,   0, INF, HFS430, hfs430, hfs430,  10000),
        SPMI_VREG(LDO,   N300,     0, INF, LDO,    ldo,    nldo1,   10000),
@@ -2125,6 +2139,28 @@ static const struct spmi_regulator_data pm8005_regulators[] = {
        { }
 };
 
+static const struct spmi_regulator_data pmp8074_regulators[] = {
+       { "s1", 0x1400, "vdd_s1"},
+       { "s2", 0x1700, "vdd_s2"},
+       { "s3", 0x1a00, "vdd_s3"},
+       { "s4", 0x1d00, "vdd_s4"},
+       { "s5", 0x2000, "vdd_s5"},
+       { "l1", 0x4000, "vdd_l1_l2"},
+       { "l2", 0x4100, "vdd_l1_l2"},
+       { "l3", 0x4200, "vdd_l3_l8"},
+       { "l4", 0x4300, "vdd_l4"},
+       { "l5", 0x4400, "vdd_l5_l6_l15"},
+       { "l6", 0x4500, "vdd_l5_l6_l15"},
+       { "l7", 0x4600, "vdd_l7"},
+       { "l8", 0x4700, "vdd_l3_l8"},
+       { "l9", 0x4800, "vdd_l9"},
+       /* l10 is currently unsupported HT_P50 */
+       { "l11", 0x4a00, "vdd_l10_l11_l12_l13"},
+       { "l12", 0x4b00, "vdd_l10_l11_l12_l13"},
+       { "l13", 0x4c00, "vdd_l10_l11_l12_l13"},
+       { }
+};
+
 static const struct spmi_regulator_data pms405_regulators[] = {
        { "s3", 0x1a00, "vdd_s3"},
        { }
@@ -2142,6 +2178,7 @@ static const struct of_device_id qcom_spmi_regulator_match[] = {
        { .compatible = "qcom,pmi8994-regulators", .data = &pmi8994_regulators },
        { .compatible = "qcom,pm660-regulators", .data = &pm660_regulators },
        { .compatible = "qcom,pm660l-regulators", .data = &pm660l_regulators },
+       { .compatible = "qcom,pmp8074-regulators", .data = &pmp8074_regulators },
        { .compatible = "qcom,pms405-regulators", .data = &pms405_regulators },
        { }
 };
index fa8706a352ce9e2c19ecf4b97255ccedeba751f5..105f694a67e681f9cd2557283da7af3824beddc0 100644 (file)
@@ -187,15 +187,11 @@ static int attiny_update_status(struct backlight_device *bl)
 {
        struct attiny_lcd *state = bl_get_data(bl);
        struct regmap *regmap = state->regmap;
-       int brightness = bl->props.brightness;
+       int brightness = backlight_get_brightness(bl);
        int ret, i;
 
        mutex_lock(&state->lock);
 
-       if (bl->props.power != FB_BLANK_UNBLANK ||
-           bl->props.fb_blank != FB_BLANK_UNBLANK)
-               brightness = 0;
-
        for (i = 0; i < 10; i++) {
                ret = regmap_write(regmap, REG_PWM, brightness);
                if (!ret)
diff --git a/drivers/regulator/rt5120-regulator.c b/drivers/regulator/rt5120-regulator.c
new file mode 100644 (file)
index 0000000..8173ede
--- /dev/null
@@ -0,0 +1,420 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <linux/bits.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/of_regulator.h>
+
+#define RT5120_REG_PGSTAT      0x03
+#define RT5120_REG_CH1VID      0x06
+#define RT5120_REG_CH1SLPVID   0x07
+#define RT5120_REG_ENABLE      0x08
+#define RT5120_REG_MODECTL     0x09
+#define RT5120_REG_UVOVPROT    0x0A
+#define RT5120_REG_SLPCTL      0x0C
+#define RT5120_REG_INTSTAT     0x1E
+#define RT5120_REG_DISCHG      0x1F
+
+#define RT5120_OUTPG_MASK(rid) BIT(rid + 1)
+#define RT5120_OUTUV_MASK(rid) BIT(rid + 9)
+#define RT5120_OUTOV_MASK(rid) BIT(rid + 16)
+#define RT5120_CH1VID_MASK     GENMASK(6, 0)
+#define RT5120_RIDEN_MASK(rid) BIT(rid + 1)
+#define RT5120_RADEN_MASK(rid) BIT(rid)
+#define RT5120_FPWM_MASK(rid)  BIT(rid + 1)
+#define RT5120_UVHICCUP_MASK   BIT(1)
+#define RT5120_OVHICCUP_MASK   BIT(0)
+#define RT5120_HOTDIE_MASK     BIT(1)
+
+#define RT5120_BUCK1_MINUV     600000
+#define RT5120_BUCK1_MAXUV     1393750
+#define RT5120_BUCK1_STEPUV    6250
+#define RT5120_BUCK1_NUM_VOLT  0x80
+
+#define RT5120_AUTO_MODE       0
+#define RT5120_FPWM_MODE       1
+
+enum {
+       RT5120_REGULATOR_BUCK1 = 0,
+       RT5120_REGULATOR_BUCK2,
+       RT5120_REGULATOR_BUCK3,
+       RT5120_REGULATOR_BUCK4,
+       RT5120_REGULATOR_LDO,
+       RT5120_REGULATOR_EXTEN,
+       RT5120_MAX_REGULATOR
+};
+
+struct rt5120_priv {
+       struct device *dev;
+       struct regmap *regmap;
+       struct regulator_desc rdesc[RT5120_MAX_REGULATOR];
+};
+
+static int rt5120_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       int rid = rdev_get_id(rdev);
+       unsigned int mask = RT5120_FPWM_MASK(rid), val;
+
+       switch (mode) {
+       case REGULATOR_MODE_NORMAL:
+               val = 0;
+               break;
+       case REGULATOR_MODE_FAST:
+               val = RT5120_FPWM_MASK(rid);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return regmap_update_bits(regmap, RT5120_REG_MODECTL, mask, val);
+}
+
+static unsigned int rt5120_buck_get_mode(struct regulator_dev *rdev)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       int ret, rid = rdev_get_id(rdev);
+       unsigned int val;
+
+       ret = regmap_read(regmap, RT5120_REG_MODECTL, &val);
+       if (ret)
+               return REGULATOR_MODE_INVALID;
+
+       if (val & RT5120_FPWM_MASK(rid))
+               return REGULATOR_MODE_FAST;
+
+       return REGULATOR_MODE_NORMAL;
+}
+
+static int rt5120_regulator_get_error_flags(struct regulator_dev *rdev,
+                                           unsigned int *flags)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       unsigned int stat, hd_stat, cur_flags = 0;
+       int rid = rdev_get_id(rdev), ret;
+
+       /*
+        * reg 0x03/0x04/0x05 to indicate PG/UV/OV
+        * use block read to descrease I/O xfer time
+        */
+       ret = regmap_raw_read(regmap, RT5120_REG_PGSTAT, &stat, 3);
+       if (ret)
+               return ret;
+
+       ret = regmap_read(regmap, RT5120_REG_INTSTAT, &hd_stat);
+       if (ret)
+               return ret;
+
+       if (!(stat & RT5120_OUTPG_MASK(rid))) {
+               if (stat & RT5120_OUTUV_MASK(rid))
+                       cur_flags |= REGULATOR_ERROR_UNDER_VOLTAGE;
+
+               if (stat & RT5120_OUTOV_MASK(rid))
+                       cur_flags |= REGULATOR_ERROR_REGULATION_OUT;
+       }
+
+       if (hd_stat & RT5120_HOTDIE_MASK)
+               cur_flags |= REGULATOR_ERROR_OVER_TEMP;
+
+       *flags = cur_flags;
+       return 0;
+}
+
+static int rt5120_buck1_set_suspend_voltage(struct regulator_dev *rdev, int uV)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       int sel;
+
+       if (uV < RT5120_BUCK1_MINUV || uV > RT5120_BUCK1_MAXUV)
+               return -EINVAL;
+
+       sel = (uV - RT5120_BUCK1_MINUV) / RT5120_BUCK1_STEPUV;
+       return regmap_write(regmap, RT5120_REG_CH1SLPVID, sel);
+}
+
+static int rt5120_regulator_set_suspend_enable(struct regulator_dev *rdev)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       int rid = rdev_get_id(rdev);
+       unsigned int mask = RT5120_RIDEN_MASK(rid);
+
+       return regmap_update_bits(regmap, RT5120_REG_SLPCTL, mask, mask);
+}
+
+static int rt5120_regulator_set_suspend_disable(struct regulator_dev *rdev)
+{
+       struct regmap *regmap = rdev_get_regmap(rdev);
+       int rid = rdev_get_id(rdev);
+       unsigned int mask = RT5120_RIDEN_MASK(rid);
+
+       return regmap_update_bits(regmap, RT5120_REG_SLPCTL, mask, 0);
+}
+
+static const struct regulator_ops rt5120_buck1_ops = {
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .is_enabled = regulator_is_enabled_regmap,
+       .list_voltage = regulator_list_voltage_linear,
+       .set_voltage_sel = regulator_set_voltage_sel_regmap,
+       .get_voltage_sel = regulator_get_voltage_sel_regmap,
+       .set_active_discharge = regulator_set_active_discharge_regmap,
+       .set_mode = rt5120_buck_set_mode,
+       .get_mode = rt5120_buck_get_mode,
+       .get_error_flags = rt5120_regulator_get_error_flags,
+       .set_suspend_voltage = rt5120_buck1_set_suspend_voltage,
+       .set_suspend_enable = rt5120_regulator_set_suspend_enable,
+       .set_suspend_disable = rt5120_regulator_set_suspend_disable,
+};
+
+static const struct regulator_ops rt5120_buck234_ops = {
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .is_enabled = regulator_is_enabled_regmap,
+       .set_active_discharge = regulator_set_active_discharge_regmap,
+       .set_mode = rt5120_buck_set_mode,
+       .get_mode = rt5120_buck_get_mode,
+       .get_error_flags = rt5120_regulator_get_error_flags,
+       .set_suspend_enable = rt5120_regulator_set_suspend_enable,
+       .set_suspend_disable = rt5120_regulator_set_suspend_disable,
+};
+
+static const struct regulator_ops rt5120_ldo_ops = {
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .is_enabled = regulator_is_enabled_regmap,
+       .set_active_discharge = regulator_set_active_discharge_regmap,
+       .get_error_flags = rt5120_regulator_get_error_flags,
+       .set_suspend_enable = rt5120_regulator_set_suspend_enable,
+       .set_suspend_disable = rt5120_regulator_set_suspend_disable,
+};
+
+static const struct regulator_ops rt5120_exten_ops = {
+       .enable = regulator_enable_regmap,
+       .disable = regulator_disable_regmap,
+       .is_enabled = regulator_is_enabled_regmap,
+       .set_suspend_enable = rt5120_regulator_set_suspend_enable,
+       .set_suspend_disable = rt5120_regulator_set_suspend_disable,
+};
+
+static unsigned int rt5120_buck_of_map_mode(unsigned int mode)
+{
+       switch (mode) {
+       case RT5120_AUTO_MODE:
+               return REGULATOR_MODE_NORMAL;
+       case RT5120_FPWM_MODE:
+               return REGULATOR_MODE_FAST;
+       default:
+               return REGULATOR_MODE_INVALID;
+       }
+}
+
+static void rt5120_fillin_regulator_desc(struct regulator_desc *desc, int rid)
+{
+       static const char * const name[] = {
+               "buck1", "buck2", "buck3", "buck4", "ldo", "exten" };
+       static const char * const sname[] = {
+               "vin1", "vin2", "vin3", "vin4", "vinldo", NULL };
+
+       /* Common regulator property */
+       desc->name = name[rid];
+       desc->supply_name = sname[rid];
+       desc->owner = THIS_MODULE;
+       desc->type = REGULATOR_VOLTAGE;
+       desc->id = rid;
+       desc->enable_reg = RT5120_REG_ENABLE;
+       desc->enable_mask = RT5120_RIDEN_MASK(rid);
+       desc->active_discharge_reg = RT5120_REG_DISCHG;
+       desc->active_discharge_mask = RT5120_RADEN_MASK(rid);
+       desc->active_discharge_on = RT5120_RADEN_MASK(rid);
+       /* Config n_voltages to 1 for all*/
+       desc->n_voltages = 1;
+
+       /* Only buck support mode change */
+       if (rid >= RT5120_REGULATOR_BUCK1 && rid <= RT5120_REGULATOR_BUCK4)
+               desc->of_map_mode = rt5120_buck_of_map_mode;
+
+       /* RID specific property init */
+       switch (rid) {
+       case RT5120_REGULATOR_BUCK1:
+               /* Only buck1 support voltage change by I2C */
+               desc->n_voltages = RT5120_BUCK1_NUM_VOLT;
+               desc->min_uV = RT5120_BUCK1_MINUV;
+               desc->uV_step = RT5120_BUCK1_STEPUV;
+               desc->vsel_reg = RT5120_REG_CH1VID,
+               desc->vsel_mask = RT5120_CH1VID_MASK,
+               desc->ops = &rt5120_buck1_ops;
+               break;
+       case RT5120_REGULATOR_BUCK2 ... RT5120_REGULATOR_BUCK4:
+               desc->ops = &rt5120_buck234_ops;
+               break;
+       case RT5120_REGULATOR_LDO:
+               desc->ops = &rt5120_ldo_ops;
+               break;
+       default:
+               desc->ops = &rt5120_exten_ops;
+       }
+}
+
+static int rt5120_of_parse_cb(struct rt5120_priv *priv, int rid,
+                             struct of_regulator_match *match)
+{
+       struct regulator_desc *desc = priv->rdesc + rid;
+       struct regulator_init_data *init_data = match->init_data;
+
+       if (!init_data || rid == RT5120_REGULATOR_BUCK1)
+               return 0;
+
+       if (init_data->constraints.min_uV != init_data->constraints.max_uV) {
+               dev_err(priv->dev, "Variable voltage for fixed regulator\n");
+               return -EINVAL;
+       }
+
+       desc->fixed_uV = init_data->constraints.min_uV;
+       return 0;
+}
+
+static struct of_regulator_match rt5120_regu_match[RT5120_MAX_REGULATOR] = {
+       [RT5120_REGULATOR_BUCK1] = { .name = "buck1", },
+       [RT5120_REGULATOR_BUCK2] = { .name = "buck2", },
+       [RT5120_REGULATOR_BUCK3] = { .name = "buck3", },
+       [RT5120_REGULATOR_BUCK4] = { .name = "buck4", },
+       [RT5120_REGULATOR_LDO] = { .name = "ldo", },
+       [RT5120_REGULATOR_EXTEN] = { .name = "exten", }
+};
+
+static int rt5120_parse_regulator_dt_data(struct rt5120_priv *priv)
+{
+       struct device *dev = priv->dev->parent;
+       struct device_node *reg_node;
+       int i, ret;
+
+       for (i = 0; i < RT5120_MAX_REGULATOR; i++) {
+               rt5120_fillin_regulator_desc(priv->rdesc + i, i);
+
+               rt5120_regu_match[i].desc = priv->rdesc + i;
+       }
+
+       reg_node = of_get_child_by_name(dev->of_node, "regulators");
+       if (!reg_node) {
+               dev_err(priv->dev, "Couldn't find 'regulators' node\n");
+               return -ENODEV;
+       }
+
+       ret = of_regulator_match(priv->dev, reg_node, rt5120_regu_match,
+                                ARRAY_SIZE(rt5120_regu_match));
+
+       of_node_put(reg_node);
+
+       if (ret < 0) {
+               dev_err(priv->dev,
+                       "Error parsing regulator init data (%d)\n", ret);
+               return ret;
+       }
+
+       for (i = 0; i < RT5120_MAX_REGULATOR; i++) {
+               ret = rt5120_of_parse_cb(priv, i, rt5120_regu_match + i);
+               if (ret) {
+                       dev_err(priv->dev, "Failed in [%d] of_passe_cb\n", i);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+static int rt5120_device_property_init(struct rt5120_priv *priv)
+{
+       struct device *dev = priv->dev->parent;
+       struct device_node *np = dev->of_node;
+       bool prot_enable;
+       unsigned int prot_enable_val = 0;
+
+       /* Assign UV/OV HW protection behavior */
+       prot_enable = of_property_read_bool(np,
+                                           "richtek,enable-undervolt-hiccup");
+       if (prot_enable)
+               prot_enable_val |= RT5120_UVHICCUP_MASK;
+
+       prot_enable = of_property_read_bool(np,
+                                           "richtek,enable-overvolt-hiccup");
+       if (prot_enable)
+               prot_enable_val |= RT5120_OVHICCUP_MASK;
+
+       return regmap_update_bits(priv->regmap, RT5120_REG_UVOVPROT,
+                                 RT5120_UVHICCUP_MASK | RT5120_OVHICCUP_MASK,
+                                 prot_enable_val);
+}
+
+static int rt5120_regulator_probe(struct platform_device *pdev)
+{
+       struct rt5120_priv *priv;
+       struct regulator_dev *rdev;
+       struct regulator_config config = {};
+       int i, ret;
+
+       priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
+       if (!priv)
+               return -ENOMEM;
+
+       priv->dev = &pdev->dev;
+
+       priv->regmap = dev_get_regmap(pdev->dev.parent, NULL);
+       if (!priv->regmap) {
+               dev_err(&pdev->dev, "Failed to init regmap\n");
+               return -ENODEV;
+       }
+
+       ret = rt5120_device_property_init(priv);
+       if (ret) {
+               dev_err(&pdev->dev, "Failed to do property init\n");
+               return ret;
+       }
+
+       ret = rt5120_parse_regulator_dt_data(priv);
+       if (ret) {
+               dev_err(&pdev->dev, "Failed to parse dt data\n");
+               return ret;
+       }
+
+       config.dev = &pdev->dev;
+       config.regmap = priv->regmap;
+
+       for (i = 0; i < RT5120_MAX_REGULATOR; i++) {
+               config.of_node = rt5120_regu_match[i].of_node;
+               config.init_data = rt5120_regu_match[i].init_data;
+
+               rdev = devm_regulator_register(&pdev->dev, priv->rdesc + i,
+                                              &config);
+               if (IS_ERR(rdev)) {
+                       dev_err(&pdev->dev,
+                               "Failed to register regulator [%d]\n", i);
+                       return PTR_ERR(rdev);
+               }
+       }
+
+       return 0;
+}
+
+static const struct platform_device_id rt5120_regulator_dev_table[] = {
+       { "rt5120-regulator", 0 },
+       {}
+};
+MODULE_DEVICE_TABLE(platform, rt5120_regulator_dev_table);
+
+static struct platform_driver rt5120_regulator_driver = {
+       .driver = {
+               .name = "rt5120-regulator",
+       },
+       .id_table = rt5120_regulator_dev_table,
+       .probe = rt5120_regulator_probe,
+};
+module_platform_driver(rt5120_regulator_driver);
+
+MODULE_AUTHOR("ChiYuan Huang <cy_huang@richtek.com>");
+MODULE_DESCRIPTION("Richtek RT5120 regulator driver");
+MODULE_LICENSE("GPL v2");
index 155d4afd00b16c7a8cabf406f621e425c77322ed..4a3397b32582be2bc5ddc05b4d71f9935d1e131f 100644 (file)
@@ -224,6 +224,9 @@ static int rt5190a_of_parse_cb(struct rt5190a_priv *priv, int rid,
        bool latchup_enable;
        unsigned int mask = RT5190A_RID_BITMASK(rid), val;
 
+       if (!init_data)
+               return 0;
+
        switch (rid) {
        case RT5190A_IDX_BUCK1:
        case RT5190A_IDX_BUCK4:
index 41ae7ac27ff6a847b6cc3c80fbd8d1d3aaaea9ba..b9918f4fd2418a9b3d6901b6d9b1730a2bdc6647 100644 (file)
@@ -343,6 +343,7 @@ static int scmi_regulator_probe(struct scmi_device *sdev)
         * plausible SCMI Voltage Domain number, all belonging to this SCMI
         * platform instance node (handle->dev->of_node).
         */
+       of_node_get(handle->dev->of_node);
        np = of_find_node_by_name(handle->dev->of_node, "regulators");
        for_each_child_of_node(np, child) {
                ret = process_scmi_regulator_of_node(sdev, ph, child, rinfo);
index bd7b2f287250eccfd9f5ead36ed93ef8d52f9efb..afa336be1cc971b5f16929f7a424ad486713fc89 100644 (file)
@@ -309,7 +309,7 @@ out:
  *
  * Return: 0 on success or appropriate error value when fails
  */
-static int ti_abb_set_voltage_sel(struct regulator_dev *rdev, unsigned sel)
+static int ti_abb_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel)
 {
        const struct regulator_desc *desc = rdev->desc;
        struct ti_abb *abb = rdev_get_drvdata(rdev);
@@ -344,7 +344,7 @@ static int ti_abb_set_voltage_sel(struct regulator_dev *rdev, unsigned sel)
 
        info = &abb->info[sel];
        /*
-        * When Linux kernel is starting up, we are'nt sure of the
+        * When Linux kernel is starting up, we aren't sure of the
         * Bias configuration that bootloader has configured.
         * So, we get to know the actual setting the first time
         * we are asked to transition.
index 93c8d07ee3280ae2e9a563dae85441acd8f7b10d..48d94649ea8215ff237e2ac028dfc91090ddf697 100644 (file)
@@ -231,6 +231,15 @@ config RESET_STARFIVE_JH7100
        help
          This enables the reset controller driver for the StarFive JH7100 SoC.
 
+config RESET_SUNPLUS
+       bool "Sunplus SoCs Reset Driver" if COMPILE_TEST
+       default ARCH_SUNPLUS
+       help
+         This enables the reset driver support for Sunplus SoCs.
+         The reset lines that can be asserted and deasserted by toggling bits
+         in a contiguous, exclusive register space. The register is HIWORD_MASKED,
+         which means each register holds 16 reset lines.
+
 config RESET_SUNXI
        bool "Allwinner SoCs Reset Driver" if COMPILE_TEST && !ARCH_SUNXI
        default ARCH_SUNXI
index a80a9c4008a782d5d54eccbbe57e8e417e440ac7..3ff378f4334805d1649dfc71f6167f8e015ba7ff 100644 (file)
@@ -30,6 +30,7 @@ obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
 obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
 obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o
 obj-$(CONFIG_RESET_STARFIVE_JH7100) += reset-starfive-jh7100.o
+obj-$(CONFIG_RESET_SUNPLUS) += reset-sunplus.o
 obj-$(CONFIG_RESET_SUNXI) += reset-sunxi.o
 obj-$(CONFIG_RESET_TI_SCI) += reset-ti-sci.o
 obj-$(CONFIG_RESET_TI_SYSCON) += reset-ti-syscon.o
index 2ea4d3136e15552f9edd6ed0aea47077fdd369bc..24c55efa98e556c4e81fbd227b383c2f85de679c 100644 (file)
 
 /* NPCM7xx GCR registers */
 #define NPCM_MDLR_OFFSET       0x7C
-#define NPCM_MDLR_USBD0                BIT(9)
-#define NPCM_MDLR_USBD1                BIT(8)
-#define NPCM_MDLR_USBD2_4      BIT(21)
-#define NPCM_MDLR_USBD5_9      BIT(22)
+#define NPCM7XX_MDLR_USBD0     BIT(9)
+#define NPCM7XX_MDLR_USBD1     BIT(8)
+#define NPCM7XX_MDLR_USBD2_4   BIT(21)
+#define NPCM7XX_MDLR_USBD5_9   BIT(22)
+
+/* NPCM8xx MDLR bits */
+#define NPCM8XX_MDLR_USBD0_3   BIT(9)
+#define NPCM8XX_MDLR_USBD4_7   BIT(22)
+#define NPCM8XX_MDLR_USBD8     BIT(24)
+#define NPCM8XX_MDLR_USBD9     BIT(21)
 
 #define NPCM_USB1PHYCTL_OFFSET 0x140
 #define NPCM_USB2PHYCTL_OFFSET 0x144
+#define NPCM_USB3PHYCTL_OFFSET 0x148
 #define NPCM_USBXPHYCTL_RS     BIT(28)
 
 /* NPCM7xx Reset registers */
 #define NPCM_IPSRST3_USBPHY1   BIT(24)
 #define NPCM_IPSRST3_USBPHY2   BIT(25)
 
+#define NPCM_IPSRST4           0x74
+#define NPCM_IPSRST4_USBPHY3   BIT(25)
+#define NPCM_IPSRST4_USB_HOST2 BIT(31)
+
 #define NPCM_RC_RESETS_PER_REG 32
 #define NPCM_MASK_RESETS       GENMASK(4, 0)
 
+enum {
+       BMC_NPCM7XX = 0,
+       BMC_NPCM8XX,
+};
+
+static const u32 npxm7xx_ipsrst[] = {NPCM_IPSRST1, NPCM_IPSRST2, NPCM_IPSRST3};
+static const u32 npxm8xx_ipsrst[] = {NPCM_IPSRST1, NPCM_IPSRST2, NPCM_IPSRST3,
+       NPCM_IPSRST4};
+
+struct npcm_reset_info {
+       u32 bmc_id;
+       u32 num_ipsrst;
+       const u32 *ipsrst;
+};
+
+static const struct npcm_reset_info npxm7xx_reset_info[] = {
+       {.bmc_id = BMC_NPCM7XX, .num_ipsrst = 3, .ipsrst = npxm7xx_ipsrst}};
+static const struct npcm_reset_info npxm8xx_reset_info[] = {
+       {.bmc_id = BMC_NPCM8XX, .num_ipsrst = 4, .ipsrst = npxm8xx_ipsrst}};
+
 struct npcm_rc_data {
        struct reset_controller_dev rcdev;
        struct notifier_block restart_nb;
+       const struct npcm_reset_info *info;
+       struct regmap *gcr_regmap;
        u32 sw_reset_number;
        void __iomem *base;
        spinlock_t lock;
@@ -120,14 +153,24 @@ static int npcm_rc_status(struct reset_controller_dev *rcdev,
 static int npcm_reset_xlate(struct reset_controller_dev *rcdev,
                            const struct of_phandle_args *reset_spec)
 {
+       struct npcm_rc_data *rc = to_rc_data(rcdev);
        unsigned int offset, bit;
+       bool offset_found = false;
+       int off_num;
 
        offset = reset_spec->args[0];
-       if (offset != NPCM_IPSRST1 && offset != NPCM_IPSRST2 &&
-           offset != NPCM_IPSRST3) {
+       for (off_num = 0 ; off_num < rc->info->num_ipsrst ; off_num++) {
+               if (offset == rc->info->ipsrst[off_num]) {
+                       offset_found = true;
+                       break;
+               }
+       }
+
+       if (!offset_found) {
                dev_err(rcdev->dev, "Error reset register (0x%x)\n", offset);
                return -EINVAL;
        }
+
        bit = reset_spec->args[1];
        if (bit >= NPCM_RC_RESETS_PER_REG) {
                dev_err(rcdev->dev, "Error reset number (%d)\n", bit);
@@ -138,45 +181,29 @@ static int npcm_reset_xlate(struct reset_controller_dev *rcdev,
 }
 
 static const struct of_device_id npcm_rc_match[] = {
-       { .compatible = "nuvoton,npcm750-reset",
-               .data = (void *)"nuvoton,npcm750-gcr" },
+       { .compatible = "nuvoton,npcm750-reset", .data = &npxm7xx_reset_info},
+       { .compatible = "nuvoton,npcm845-reset", .data = &npxm8xx_reset_info},
        { }
 };
 
-/*
- *  The following procedure should be observed in USB PHY, USB device and
- *  USB host initialization at BMC boot
- */
-static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
+static void npcm_usb_reset_npcm7xx(struct npcm_rc_data *rc)
 {
        u32 mdlr, iprst1, iprst2, iprst3;
-       struct device *dev = &pdev->dev;
-       struct regmap *gcr_regmap;
        u32 ipsrst1_bits = 0;
        u32 ipsrst2_bits = NPCM_IPSRST2_USB_HOST;
        u32 ipsrst3_bits = 0;
-       const char *gcr_dt;
-
-       gcr_dt = (const char *)
-       of_match_device(dev->driver->of_match_table, dev)->data;
-
-       gcr_regmap = syscon_regmap_lookup_by_compatible(gcr_dt);
-       if (IS_ERR(gcr_regmap)) {
-               dev_err(&pdev->dev, "Failed to find %s\n", gcr_dt);
-               return PTR_ERR(gcr_regmap);
-       }
 
        /* checking which USB device is enabled */
-       regmap_read(gcr_regmap, NPCM_MDLR_OFFSET, &mdlr);
-       if (!(mdlr & NPCM_MDLR_USBD0))
+       regmap_read(rc->gcr_regmap, NPCM_MDLR_OFFSET, &mdlr);
+       if (!(mdlr & NPCM7XX_MDLR_USBD0))
                ipsrst3_bits |= NPCM_IPSRST3_USBD0;
-       if (!(mdlr & NPCM_MDLR_USBD1))
+       if (!(mdlr & NPCM7XX_MDLR_USBD1))
                ipsrst1_bits |= NPCM_IPSRST1_USBD1;
-       if (!(mdlr & NPCM_MDLR_USBD2_4))
+       if (!(mdlr & NPCM7XX_MDLR_USBD2_4))
                ipsrst1_bits |= (NPCM_IPSRST1_USBD2 |
                                 NPCM_IPSRST1_USBD3 |
                                 NPCM_IPSRST1_USBD4);
-       if (!(mdlr & NPCM_MDLR_USBD0)) {
+       if (!(mdlr & NPCM7XX_MDLR_USBD0)) {
                ipsrst1_bits |= (NPCM_IPSRST1_USBD5 |
                                 NPCM_IPSRST1_USBD6);
                ipsrst3_bits |= (NPCM_IPSRST3_USBD7 |
@@ -199,9 +226,9 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
        writel(iprst3, rc->base + NPCM_IPSRST3);
 
        /* clear USB PHY RS bit */
-       regmap_update_bits(gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
                           NPCM_USBXPHYCTL_RS, 0);
-       regmap_update_bits(gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
                           NPCM_USBXPHYCTL_RS, 0);
 
        /* deassert reset USB PHY */
@@ -211,19 +238,131 @@ static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
        udelay(50);
 
        /* set USB PHY RS bit */
-       regmap_update_bits(gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
+                          NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
+                          NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
+
+       /* deassert reset USB devices*/
+       iprst1 &= ~ipsrst1_bits;
+       iprst2 &= ~ipsrst2_bits;
+       iprst3 &= ~ipsrst3_bits;
+
+       writel(iprst1, rc->base + NPCM_IPSRST1);
+       writel(iprst2, rc->base + NPCM_IPSRST2);
+       writel(iprst3, rc->base + NPCM_IPSRST3);
+}
+
+static void npcm_usb_reset_npcm8xx(struct npcm_rc_data *rc)
+{
+       u32 mdlr, iprst1, iprst2, iprst3, iprst4;
+       u32 ipsrst1_bits = 0;
+       u32 ipsrst2_bits = NPCM_IPSRST2_USB_HOST;
+       u32 ipsrst3_bits = 0;
+       u32 ipsrst4_bits = NPCM_IPSRST4_USB_HOST2 | NPCM_IPSRST4_USBPHY3;
+
+       /* checking which USB device is enabled */
+       regmap_read(rc->gcr_regmap, NPCM_MDLR_OFFSET, &mdlr);
+       if (!(mdlr & NPCM8XX_MDLR_USBD0_3)) {
+               ipsrst3_bits |= NPCM_IPSRST3_USBD0;
+               ipsrst1_bits |= (NPCM_IPSRST1_USBD1 |
+                                NPCM_IPSRST1_USBD2 |
+                                NPCM_IPSRST1_USBD3);
+       }
+       if (!(mdlr & NPCM8XX_MDLR_USBD4_7)) {
+               ipsrst1_bits |= (NPCM_IPSRST1_USBD4 |
+                                NPCM_IPSRST1_USBD5 |
+                                NPCM_IPSRST1_USBD6);
+               ipsrst3_bits |= NPCM_IPSRST3_USBD7;
+       }
+
+       if (!(mdlr & NPCM8XX_MDLR_USBD8))
+               ipsrst3_bits |= NPCM_IPSRST3_USBD8;
+       if (!(mdlr & NPCM8XX_MDLR_USBD9))
+               ipsrst3_bits |= NPCM_IPSRST3_USBD9;
+
+       /* assert reset USB PHY and USB devices */
+       iprst1 = readl(rc->base + NPCM_IPSRST1);
+       iprst2 = readl(rc->base + NPCM_IPSRST2);
+       iprst3 = readl(rc->base + NPCM_IPSRST3);
+       iprst4 = readl(rc->base + NPCM_IPSRST4);
+
+       iprst1 |= ipsrst1_bits;
+       iprst2 |= ipsrst2_bits;
+       iprst3 |= (ipsrst3_bits | NPCM_IPSRST3_USBPHY1 |
+                  NPCM_IPSRST3_USBPHY2);
+       iprst2 |= ipsrst4_bits;
+
+       writel(iprst1, rc->base + NPCM_IPSRST1);
+       writel(iprst2, rc->base + NPCM_IPSRST2);
+       writel(iprst3, rc->base + NPCM_IPSRST3);
+       writel(iprst4, rc->base + NPCM_IPSRST4);
+
+       /* clear USB PHY RS bit */
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
+                          NPCM_USBXPHYCTL_RS, 0);
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
+                          NPCM_USBXPHYCTL_RS, 0);
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB3PHYCTL_OFFSET,
+                          NPCM_USBXPHYCTL_RS, 0);
+
+       /* deassert reset USB PHY */
+       iprst3 &= ~(NPCM_IPSRST3_USBPHY1 | NPCM_IPSRST3_USBPHY2);
+       writel(iprst3, rc->base + NPCM_IPSRST3);
+       iprst4 &= ~NPCM_IPSRST4_USBPHY3;
+       writel(iprst4, rc->base + NPCM_IPSRST4);
+
+       /* set USB PHY RS bit */
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB1PHYCTL_OFFSET,
+                          NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
                           NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
-       regmap_update_bits(gcr_regmap, NPCM_USB2PHYCTL_OFFSET,
+       regmap_update_bits(rc->gcr_regmap, NPCM_USB3PHYCTL_OFFSET,
                           NPCM_USBXPHYCTL_RS, NPCM_USBXPHYCTL_RS);
 
        /* deassert reset USB devices*/
        iprst1 &= ~ipsrst1_bits;
        iprst2 &= ~ipsrst2_bits;
        iprst3 &= ~ipsrst3_bits;
+       iprst4 &= ~ipsrst4_bits;
 
        writel(iprst1, rc->base + NPCM_IPSRST1);
        writel(iprst2, rc->base + NPCM_IPSRST2);
        writel(iprst3, rc->base + NPCM_IPSRST3);
+       writel(iprst4, rc->base + NPCM_IPSRST4);
+}
+
+/*
+ *  The following procedure should be observed in USB PHY, USB device and
+ *  USB host initialization at BMC boot
+ */
+static int npcm_usb_reset(struct platform_device *pdev, struct npcm_rc_data *rc)
+{
+       struct device *dev = &pdev->dev;
+
+       rc->gcr_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, "nuvoton,sysgcr");
+       if (IS_ERR(rc->gcr_regmap)) {
+               dev_warn(&pdev->dev, "Failed to find nuvoton,sysgcr property, please update the device tree\n");
+               dev_info(&pdev->dev, "Using nuvoton,npcm750-gcr for Poleg backward compatibility\n");
+               rc->gcr_regmap = syscon_regmap_lookup_by_compatible("nuvoton,npcm750-gcr");
+               if (IS_ERR(rc->gcr_regmap)) {
+                       dev_err(&pdev->dev, "Failed to find nuvoton,npcm750-gcr");
+                       return PTR_ERR(rc->gcr_regmap);
+               }
+       }
+
+       rc->info = (const struct npcm_reset_info *)
+                       of_match_device(dev->driver->of_match_table, dev)->data;
+       switch (rc->info->bmc_id) {
+       case BMC_NPCM7XX:
+               npcm_usb_reset_npcm7xx(rc);
+               break;
+       case BMC_NPCM8XX:
+               npcm_usb_reset_npcm8xx(rc);
+               break;
+       default:
+               return -ENODEV;
+       }
 
        return 0;
 }
diff --git a/drivers/reset/reset-sunplus.c b/drivers/reset/reset-sunplus.c
new file mode 100644 (file)
index 0000000..2f23eca
--- /dev/null
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * SP7021 reset driver
+ *
+ * Copyright (C) Sunplus Technology Co., Ltd.
+ *       All rights reserved.
+ */
+
+#include <linux/io.h>
+#include <linux/init.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <linux/reset-controller.h>
+#include <linux/reboot.h>
+
+/* HIWORD_MASK_REG BITS */
+#define BITS_PER_HWM_REG       16
+
+/* resets HW info: reg_index_shift */
+static const u32 sp_resets[] = {
+/* SP7021: mo_reset0 ~ mo_reset9 */
+       0x00,
+       0x02,
+       0x03,
+       0x04,
+       0x05,
+       0x06,
+       0x07,
+       0x08,
+       0x09,
+       0x0a,
+       0x0b,
+       0x0d,
+       0x0e,
+       0x0f,
+       0x10,
+       0x12,
+       0x14,
+       0x15,
+       0x16,
+       0x17,
+       0x18,
+       0x19,
+       0x1a,
+       0x1b,
+       0x1c,
+       0x1d,
+       0x1e,
+       0x1f,
+       0x20,
+       0x21,
+       0x22,
+       0x23,
+       0x24,
+       0x25,
+       0x26,
+       0x2a,
+       0x2b,
+       0x2d,
+       0x2e,
+       0x30,
+       0x31,
+       0x32,
+       0x33,
+       0x3d,
+       0x3e,
+       0x3f,
+       0x42,
+       0x44,
+       0x4b,
+       0x4c,
+       0x4d,
+       0x4e,
+       0x4f,
+       0x50,
+       0x55,
+       0x60,
+       0x61,
+       0x6a,
+       0x6f,
+       0x70,
+       0x73,
+       0x74,
+       0x86,
+       0x8a,
+       0x8b,
+       0x8d,
+       0x8e,
+       0x8f,
+       0x90,
+       0x92,
+       0x93,
+       0x94,
+       0x95,
+       0x96,
+       0x97,
+       0x98,
+       0x99,
+};
+
+struct sp_reset {
+       struct reset_controller_dev rcdev;
+       struct notifier_block notifier;
+       void __iomem *base;
+};
+
+static inline struct sp_reset *to_sp_reset(struct reset_controller_dev *rcdev)
+{
+       return container_of(rcdev, struct sp_reset, rcdev);
+}
+
+static int sp_reset_update(struct reset_controller_dev *rcdev,
+                          unsigned long id, bool assert)
+{
+       struct sp_reset *reset = to_sp_reset(rcdev);
+       int index = sp_resets[id] / BITS_PER_HWM_REG;
+       int shift = sp_resets[id] % BITS_PER_HWM_REG;
+       u32 val;
+
+       val = (1 << (16 + shift)) | (assert << shift);
+       writel(val, reset->base + (index * 4));
+
+       return 0;
+}
+
+static int sp_reset_assert(struct reset_controller_dev *rcdev,
+                          unsigned long id)
+{
+       return sp_reset_update(rcdev, id, true);
+}
+
+static int sp_reset_deassert(struct reset_controller_dev *rcdev,
+                            unsigned long id)
+{
+       return sp_reset_update(rcdev, id, false);
+}
+
+static int sp_reset_status(struct reset_controller_dev *rcdev,
+                          unsigned long id)
+{
+       struct sp_reset *reset = to_sp_reset(rcdev);
+       int index = sp_resets[id] / BITS_PER_HWM_REG;
+       int shift = sp_resets[id] % BITS_PER_HWM_REG;
+       u32 reg;
+
+       reg = readl(reset->base + (index * 4));
+
+       return !!(reg & BIT(shift));
+}
+
+static const struct reset_control_ops sp_reset_ops = {
+       .assert   = sp_reset_assert,
+       .deassert = sp_reset_deassert,
+       .status   = sp_reset_status,
+};
+
+static int sp_restart(struct notifier_block *nb, unsigned long mode,
+                     void *cmd)
+{
+       struct sp_reset *reset = container_of(nb, struct sp_reset, notifier);
+
+       sp_reset_assert(&reset->rcdev, 0);
+       sp_reset_deassert(&reset->rcdev, 0);
+
+       return NOTIFY_DONE;
+}
+
+static int sp_reset_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct sp_reset *reset;
+       struct resource *res;
+       int ret;
+
+       reset = devm_kzalloc(dev, sizeof(*reset), GFP_KERNEL);
+       if (!reset)
+               return -ENOMEM;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       reset->base = devm_ioremap_resource(dev, res);
+       if (IS_ERR(reset->base))
+               return PTR_ERR(reset->base);
+
+       reset->rcdev.ops = &sp_reset_ops;
+       reset->rcdev.owner = THIS_MODULE;
+       reset->rcdev.of_node = dev->of_node;
+       reset->rcdev.nr_resets = resource_size(res) / 4 * BITS_PER_HWM_REG;
+
+       ret = devm_reset_controller_register(dev, &reset->rcdev);
+       if (ret)
+               return ret;
+
+       reset->notifier.notifier_call = sp_restart;
+       reset->notifier.priority = 192;
+
+       return register_restart_handler(&reset->notifier);
+}
+
+static const struct of_device_id sp_reset_dt_ids[] = {
+       {.compatible = "sunplus,sp7021-reset",},
+       { /* sentinel */ },
+};
+
+static struct platform_driver sp_reset_driver = {
+       .probe = sp_reset_probe,
+       .driver = {
+               .name                   = "sunplus-reset",
+               .of_match_table         = sp_reset_dt_ids,
+               .suppress_bind_attrs    = true,
+       },
+};
+builtin_platform_driver(sp_reset_driver);
index 9e54fe76a9b2e8077f9147cc6db301a4de186e05..35d4b398c197e8c594eaccda2613895a5938d51b 100644 (file)
@@ -3565,7 +3565,7 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
                        if (!atomic_read(&queue->set_pci_flags_count)) {
                                /*
                                 * there's no outstanding PCI any more, so we
-                                * have to request a PCI to be sure the the PCI
+                                * have to request a PCI to be sure the PCI
                                 * will wake at some time in the future then we
                                 * can flush packed buffers that might still be
                                 * hanging around, which can happen if no
index b519f4b59d30e37e711d1608def39f9e16a97b77..5e8887fa02c8a7f83e06ec05b7fc3527e357f5c7 100644 (file)
@@ -11386,6 +11386,7 @@ scsih_shutdown(struct pci_dev *pdev)
        _scsih_ir_shutdown(ioc);
        _scsih_nvme_shutdown(ioc);
        mpt3sas_base_mask_interrupts(ioc);
+       mpt3sas_base_stop_watchdog(ioc);
        ioc->shost_recovery = 1;
        mpt3sas_base_make_ioc_ready(ioc, SOFT_RESET);
        ioc->shost_recovery = 0;
index a480c4d589f5f75860e08df285b9fc2c61a0d453..729e309e60346f6424522240d46ab9a7c5f3217f 100644 (file)
@@ -450,7 +450,7 @@ static int sg_io(struct scsi_device *sdev, struct sg_io_hdr *hdr, fmode_t mode)
                goto out_put_request;
 
        ret = 0;
-       if (hdr->iovec_count) {
+       if (hdr->iovec_count && hdr->dxfer_len) {
                struct iov_iter i;
                struct iovec *iov = NULL;
 
index 358df75101860090808775a62661fce0313219d4..828d81e02b37ab22aa359bfacd42d91e81754b17 100644 (file)
@@ -72,7 +72,7 @@ static int intc_set_affinity(struct irq_data *data,
        if (!cpumask_intersects(cpumask, cpu_online_mask))
                return -1;
 
-       cpumask_copy(irq_data_get_affinity_mask(data), cpumask);
+       irq_data_update_affinity(data, cpumask);
 
        return IRQ_SET_MASK_OK_NOCOPY;
 }
index 86ccf5970bc1bea94d4323967e238af5ab5dedb7..e461c071189b48b61ba15ff428d390b3e40ea8b9 100644 (file)
@@ -9,6 +9,7 @@ source "drivers/soc/atmel/Kconfig"
 source "drivers/soc/bcm/Kconfig"
 source "drivers/soc/canaan/Kconfig"
 source "drivers/soc/fsl/Kconfig"
+source "drivers/soc/fujitsu/Kconfig"
 source "drivers/soc/imx/Kconfig"
 source "drivers/soc/ixp4xx/Kconfig"
 source "drivers/soc/litex/Kconfig"
index 919716e0e7001f645355f6a9d36c722545bf5165..69ba6508cf2c17229ef32afcb79137b53f969d09 100644 (file)
@@ -12,6 +12,7 @@ obj-$(CONFIG_SOC_CANAAN)      += canaan/
 obj-$(CONFIG_ARCH_DOVE)                += dove/
 obj-$(CONFIG_MACH_DOVE)                += dove/
 obj-y                          += fsl/
+obj-y                          += fujitsu/
 obj-$(CONFIG_ARCH_GEMINI)      += gemini/
 obj-y                          += imx/
 obj-y                          += ixp4xx/
index 78f0f1aeca578a1a7716b4e79c41b2b36c9015d2..92125dd65f338fe0466628e0fcdf4fcf124b9528 100644 (file)
@@ -126,6 +126,7 @@ static int __init meson_mx_socinfo_init(void)
        np = of_find_matching_node(NULL, meson_mx_socinfo_analog_top_ids);
        if (np) {
                analog_top_regmap = syscon_node_to_regmap(np);
+               of_node_put(np);
                if (IS_ERR(analog_top_regmap))
                        return PTR_ERR(analog_top_regmap);
 
index a10a417a87db894d8342325ba16986c4e90e7527..e9351876352672f163809b139ccc608589112d66 100644 (file)
@@ -152,8 +152,10 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
        }
 
        pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL);
-       if (!pwrc)
+       if (!pwrc) {
+               of_node_put(sm_np);
                return -ENOMEM;
+       }
 
        pwrc->fw = meson_sm_get(sm_np);
        of_node_put(sm_np);
index 1e0041ec813238cbfa7ab52c3fdc9799961169d1..5bcd047768b60c0d812d9553e62a7f9fafb5a4ca 100644 (file)
 
 #define ASB_AXI_BRDG_ID                        0x20
 
-#define ASB_READ(reg) readl(power->asb + (reg))
-#define ASB_WRITE(reg, val) writel(PM_PASSWORD | (val), power->asb + (reg))
+#define BCM2835_BRDG_ID                        0x62726467
 
 struct bcm2835_power_domain {
        struct generic_pm_domain base;
@@ -142,24 +141,41 @@ struct bcm2835_power {
        void __iomem            *base;
        /* AXI Async bridge registers. */
        void __iomem            *asb;
+       /* RPiVid bridge registers. */
+       void __iomem            *rpivid_asb;
 
        struct genpd_onecell_data pd_xlate;
        struct bcm2835_power_domain domains[BCM2835_POWER_DOMAIN_COUNT];
        struct reset_controller_dev reset;
 };
 
-static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
+static int bcm2835_asb_control(struct bcm2835_power *power, u32 reg, bool enable)
 {
+       void __iomem *base = power->asb;
        u64 start;
+       u32 val;
 
-       if (!reg)
+       switch (reg) {
+       case 0:
                return 0;
+       case ASB_V3D_S_CTRL:
+       case ASB_V3D_M_CTRL:
+               if (power->rpivid_asb)
+                       base = power->rpivid_asb;
+               break;
+       }
 
        start = ktime_get_ns();
 
        /* Enable the module's async AXI bridges. */
-       ASB_WRITE(reg, ASB_READ(reg) & ~ASB_REQ_STOP);
-       while (ASB_READ(reg) & ASB_ACK) {
+       if (enable) {
+               val = readl(base + reg) & ~ASB_REQ_STOP;
+       } else {
+               val = readl(base + reg) | ASB_REQ_STOP;
+       }
+       writel(PM_PASSWORD | val, base + reg);
+
+       while (readl(base + reg) & ASB_ACK) {
                cpu_relax();
                if (ktime_get_ns() - start >= 1000)
                        return -ETIMEDOUT;
@@ -168,30 +184,24 @@ static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
        return 0;
 }
 
-static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg)
+static int bcm2835_asb_enable(struct bcm2835_power *power, u32 reg)
 {
-       u64 start;
-
-       if (!reg)
-               return 0;
-
-       start = ktime_get_ns();
-
-       /* Enable the module's async AXI bridges. */
-       ASB_WRITE(reg, ASB_READ(reg) | ASB_REQ_STOP);
-       while (!(ASB_READ(reg) & ASB_ACK)) {
-               cpu_relax();
-               if (ktime_get_ns() - start >= 1000)
-                       return -ETIMEDOUT;
-       }
+       return bcm2835_asb_control(power, reg, true);
+}
 
-       return 0;
+static int bcm2835_asb_disable(struct bcm2835_power *power, u32 reg)
+{
+       return bcm2835_asb_control(power, reg, false);
 }
 
 static int bcm2835_power_power_off(struct bcm2835_power_domain *pd, u32 pm_reg)
 {
        struct bcm2835_power *power = pd->power;
 
+       /* We don't run this on BCM2711 */
+       if (power->rpivid_asb)
+               return 0;
+
        /* Enable functional isolation */
        PM_WRITE(pm_reg, PM_READ(pm_reg) & ~PM_ISFUNC);
 
@@ -213,6 +223,10 @@ static int bcm2835_power_power_on(struct bcm2835_power_domain *pd, u32 pm_reg)
        int inrush;
        bool powok;
 
+       /* We don't run this on BCM2711 */
+       if (power->rpivid_asb)
+               return 0;
+
        /* If it was already powered on by the fw, leave it that way. */
        if (PM_READ(pm_reg) & PM_POWUP)
                return 0;
@@ -626,13 +640,23 @@ static int bcm2835_power_probe(struct platform_device *pdev)
        power->dev = dev;
        power->base = pm->base;
        power->asb = pm->asb;
+       power->rpivid_asb = pm->rpivid_asb;
 
-       id = ASB_READ(ASB_AXI_BRDG_ID);
-       if (id != 0x62726467 /* "BRDG" */) {
+       id = readl(power->asb + ASB_AXI_BRDG_ID);
+       if (id != BCM2835_BRDG_ID /* "BRDG" */) {
                dev_err(dev, "ASB register ID returned 0x%08x\n", id);
                return -ENODEV;
        }
 
+       if (power->rpivid_asb) {
+               id = readl(power->rpivid_asb + ASB_AXI_BRDG_ID);
+               if (id != BCM2835_BRDG_ID /* "BRDG" */) {
+                       dev_err(dev, "RPiVid ASB register ID returned 0x%08x\n",
+                                    id);
+                       return -ENODEV;
+               }
+       }
+
        power->pd_xlate.domains = devm_kcalloc(dev,
                                               ARRAY_SIZE(power_domain_names),
                                               sizeof(*power->pd_xlate.domains),
index 2c975d79fe8e6abf135eb416a82aec57c92bf8e6..1467bbd59690a4fc49b51e4c55e9f39569d69083 100644 (file)
@@ -340,12 +340,12 @@ static int __init brcmstb_biuctrl_init(void)
 
        ret = setup_hifcpubiuctrl_regs(np);
        if (ret)
-               return ret;
+               goto out_put;
 
        ret = mcp_write_pairing_set();
        if (ret) {
                pr_err("MCP: Unable to disable write pairing!\n");
-               return ret;
+               goto out_put;
        }
 
        a72_b53_rac_enable_all(np);
@@ -353,6 +353,9 @@ static int __init brcmstb_biuctrl_init(void)
 #ifdef CONFIG_PM_SLEEP
        register_syscore_ops(&brcmstb_cpu_credit_syscore_ops);
 #endif
-       return 0;
+       ret = 0;
+out_put:
+       of_node_put(np);
+       return ret;
 }
 early_initcall(brcmstb_biuctrl_init);
index 70ad0f3dce283a828117ffcaeccd08d416aebe48..d6b30d521307db7762cd060e5a3378c38c30ac6f 100644 (file)
@@ -721,7 +721,7 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
        ctrl.phy_a_standby_ctrl_offs = ddr_phy_data->phy_a_standby_ctrl_offs;
        ctrl.phy_b_standby_ctrl_offs = ddr_phy_data->phy_b_standby_ctrl_offs;
        /*
-        * Slightly grosss to use the phy ver to get a memc,
+        * Slightly gross to use the phy ver to get a memc,
         * offset but that is the only versioned things so far
         * we can test for.
         */
index 5ed2fc1c53a0e077773b0290746cbbcc0bdd11e2..6bf3e6a980ffc67c21ed7b62b5b638e37f27454e 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/fsl/guts.h>
 
-struct guts {
-       struct ccsr_guts __iomem *regs;
-       bool little_endian;
-};
-
 struct fsl_soc_die_attr {
        char    *die;
        u32     svr;
        u32     mask;
 };
 
-static struct guts *guts;
-static struct soc_device_attribute soc_dev_attr;
-static struct soc_device *soc_dev;
-
+struct fsl_soc_data {
+       const char *sfp_compat;
+       u32 uid_offset;
+};
 
 /* SoC die attribute definition for QorIQ platform */
 static const struct fsl_soc_die_attr fsl_soc_die[] = {
@@ -120,88 +115,36 @@ static const struct fsl_soc_die_attr *fsl_soc_die_match(
        return NULL;
 }
 
-static u32 fsl_guts_get_svr(void)
-{
-       u32 svr = 0;
-
-       if (!guts || !guts->regs)
-               return svr;
-
-       if (guts->little_endian)
-               svr = ioread32(&guts->regs->svr);
-       else
-               svr = ioread32be(&guts->regs->svr);
-
-       return svr;
-}
-
-static int fsl_guts_probe(struct platform_device *pdev)
+static u64 fsl_guts_get_soc_uid(const char *compat, unsigned int offset)
 {
-       struct device_node *root, *np = pdev->dev.of_node;
-       struct device *dev = &pdev->dev;
-       const struct fsl_soc_die_attr *soc_die;
-       const char *machine;
-       u32 svr;
-
-       /* Initialize guts */
-       guts = devm_kzalloc(dev, sizeof(*guts), GFP_KERNEL);
-       if (!guts)
-               return -ENOMEM;
-
-       guts->little_endian = of_property_read_bool(np, "little-endian");
+       struct device_node *np;
+       void __iomem *sfp_base;
+       u64 uid;
 
-       guts->regs = devm_platform_ioremap_resource(pdev, 0);
-       if (IS_ERR(guts->regs))
-               return PTR_ERR(guts->regs);
+       np = of_find_compatible_node(NULL, NULL, compat);
+       if (!np)
+               return 0;
 
-       /* Register soc device */
-       root = of_find_node_by_path("/");
-       if (of_property_read_string(root, "model", &machine))
-               of_property_read_string_index(root, "compatible", 0, &machine);
-       if (machine) {
-               soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL);
-               if (!soc_dev_attr.machine) {
-                       of_node_put(root);
-                       return -ENOMEM;
-               }
+       sfp_base = of_iomap(np, 0);
+       if (!sfp_base) {
+               of_node_put(np);
+               return 0;
        }
-       of_node_put(root);
 
-       svr = fsl_guts_get_svr();
-       soc_die = fsl_soc_die_match(svr, fsl_soc_die);
-       if (soc_die) {
-               soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL,
-                                                    "QorIQ %s", soc_die->die);
-       } else {
-               soc_dev_attr.family = devm_kasprintf(dev, GFP_KERNEL, "QorIQ");
-       }
-       if (!soc_dev_attr.family)
-               return -ENOMEM;
-       soc_dev_attr.soc_id = devm_kasprintf(dev, GFP_KERNEL,
-                                            "svr:0x%08x", svr);
-       if (!soc_dev_attr.soc_id)
-               return -ENOMEM;
-       soc_dev_attr.revision = devm_kasprintf(dev, GFP_KERNEL, "%d.%d",
-                                              (svr >>  4) & 0xf, svr & 0xf);
-       if (!soc_dev_attr.revision)
-               return -ENOMEM;
+       uid = ioread32(sfp_base + offset);
+       uid <<= 32;
+       uid |= ioread32(sfp_base + offset + 4);
 
-       soc_dev = soc_device_register(&soc_dev_attr);
-       if (IS_ERR(soc_dev))
-               return PTR_ERR(soc_dev);
+       iounmap(sfp_base);
+       of_node_put(np);
 
-       pr_info("Machine: %s\n", soc_dev_attr.machine);
-       pr_info("SoC family: %s\n", soc_dev_attr.family);
-       pr_info("SoC ID: %s, Revision: %s\n",
-               soc_dev_attr.soc_id, soc_dev_attr.revision);
-       return 0;
+       return uid;
 }
 
-static int fsl_guts_remove(struct platform_device *dev)
-{
-       soc_device_unregister(soc_dev);
-       return 0;
-}
+static const struct fsl_soc_data ls1028a_data = {
+       .sfp_compat = "fsl,ls1028a-sfp",
+       .uid_offset = 0x21c,
+};
 
 /*
  * Table for matching compatible strings, for device tree
@@ -231,28 +174,106 @@ static const struct of_device_id fsl_guts_of_match[] = {
        { .compatible = "fsl,ls1012a-dcfg", },
        { .compatible = "fsl,ls1046a-dcfg", },
        { .compatible = "fsl,lx2160a-dcfg", },
-       { .compatible = "fsl,ls1028a-dcfg", },
+       { .compatible = "fsl,ls1028a-dcfg", .data = &ls1028a_data},
        {}
 };
-MODULE_DEVICE_TABLE(of, fsl_guts_of_match);
-
-static struct platform_driver fsl_guts_driver = {
-       .driver = {
-               .name = "fsl-guts",
-               .of_match_table = fsl_guts_of_match,
-       },
-       .probe = fsl_guts_probe,
-       .remove = fsl_guts_remove,
-};
 
 static int __init fsl_guts_init(void)
 {
-       return platform_driver_register(&fsl_guts_driver);
-}
-core_initcall(fsl_guts_init);
+       struct soc_device_attribute *soc_dev_attr;
+       static struct soc_device *soc_dev;
+       const struct fsl_soc_die_attr *soc_die;
+       const struct fsl_soc_data *soc_data;
+       const struct of_device_id *match;
+       struct ccsr_guts __iomem *regs;
+       const char *machine = NULL;
+       struct device_node *np;
+       bool little_endian;
+       u64 soc_uid = 0;
+       u32 svr;
+       int ret;
 
-static void __exit fsl_guts_exit(void)
-{
-       platform_driver_unregister(&fsl_guts_driver);
+       np = of_find_matching_node_and_match(NULL, fsl_guts_of_match, &match);
+       if (!np)
+               return 0;
+       soc_data = match->data;
+
+       regs = of_iomap(np, 0);
+       if (!regs) {
+               of_node_put(np);
+               return -ENOMEM;
+       }
+
+       little_endian = of_property_read_bool(np, "little-endian");
+       if (little_endian)
+               svr = ioread32(&regs->svr);
+       else
+               svr = ioread32be(&regs->svr);
+       iounmap(regs);
+       of_node_put(np);
+
+       /* Register soc device */
+       soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
+       if (!soc_dev_attr)
+               return -ENOMEM;
+
+       if (of_property_read_string(of_root, "model", &machine))
+               of_property_read_string_index(of_root, "compatible", 0, &machine);
+       if (machine) {
+               soc_dev_attr->machine = kstrdup(machine, GFP_KERNEL);
+               if (!soc_dev_attr->machine)
+                       goto err_nomem;
+       }
+
+       soc_die = fsl_soc_die_match(svr, fsl_soc_die);
+       if (soc_die) {
+               soc_dev_attr->family = kasprintf(GFP_KERNEL, "QorIQ %s",
+                                                soc_die->die);
+       } else {
+               soc_dev_attr->family = kasprintf(GFP_KERNEL, "QorIQ");
+       }
+       if (!soc_dev_attr->family)
+               goto err_nomem;
+
+       soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "svr:0x%08x", svr);
+       if (!soc_dev_attr->soc_id)
+               goto err_nomem;
+
+       soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d.%d",
+                                          (svr >>  4) & 0xf, svr & 0xf);
+       if (!soc_dev_attr->revision)
+               goto err_nomem;
+
+       if (soc_data)
+               soc_uid = fsl_guts_get_soc_uid(soc_data->sfp_compat,
+                                              soc_data->uid_offset);
+       if (soc_uid)
+               soc_dev_attr->serial_number = kasprintf(GFP_KERNEL, "%016llX",
+                                                       soc_uid);
+
+       soc_dev = soc_device_register(soc_dev_attr);
+       if (IS_ERR(soc_dev)) {
+               ret = PTR_ERR(soc_dev);
+               goto err;
+       }
+
+       pr_info("Machine: %s\n", soc_dev_attr->machine);
+       pr_info("SoC family: %s\n", soc_dev_attr->family);
+       pr_info("SoC ID: %s, Revision: %s\n",
+               soc_dev_attr->soc_id, soc_dev_attr->revision);
+
+       return 0;
+
+err_nomem:
+       ret = -ENOMEM;
+err:
+       kfree(soc_dev_attr->machine);
+       kfree(soc_dev_attr->family);
+       kfree(soc_dev_attr->soc_id);
+       kfree(soc_dev_attr->revision);
+       kfree(soc_dev_attr->serial_number);
+       kfree(soc_dev_attr);
+
+       return ret;
 }
-module_exit(fsl_guts_exit);
+core_initcall(fsl_guts_init);
diff --git a/drivers/soc/fujitsu/Kconfig b/drivers/soc/fujitsu/Kconfig
new file mode 100644 (file)
index 0000000..987731e
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only
+menu "fujitsu SoC drivers"
+
+config A64FX_DIAG
+       bool "A64FX diag driver"
+       depends on ARM64
+       depends on ACPI
+       help
+         Say Y here if you want to enable diag interrupt on Fujitsu A64FX.
+         This driver enables BMC's diagnostic requests and enables
+         A64FX-specific interrupts. This allows administrators to obtain
+         kernel dumps via diagnostic requests using ipmitool, etc.
+
+         If unsure, say N.
+
+endmenu
diff --git a/drivers/soc/fujitsu/Makefile b/drivers/soc/fujitsu/Makefile
new file mode 100644 (file)
index 0000000..945bc1c
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_A64FX_DIAG)       += a64fx-diag.o
diff --git a/drivers/soc/fujitsu/a64fx-diag.c b/drivers/soc/fujitsu/a64fx-diag.c
new file mode 100644 (file)
index 0000000..d87f348
--- /dev/null
@@ -0,0 +1,154 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * A64FX diag driver.
+ * Copyright (c) 2022 Fujitsu Ltd.
+ */
+
+#include <linux/acpi.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#define A64FX_DIAG_IRQ 1
+#define BMC_DIAG_INTERRUPT_ENABLE 0x40
+#define BMC_DIAG_INTERRUPT_STATUS 0x44
+#define BMC_DIAG_INTERRUPT_MASK BIT(31)
+
+struct a64fx_diag_priv {
+       void __iomem *mmsc_reg_base;
+       int irq;
+       bool has_nmi;
+};
+
+static irqreturn_t a64fx_diag_handler_nmi(int irq, void *dev_id)
+{
+       nmi_panic(NULL, "a64fx_diag: interrupt received\n");
+
+       return IRQ_HANDLED;
+}
+
+static irqreturn_t a64fx_diag_handler_irq(int irq, void *dev_id)
+{
+       panic("a64fx_diag: interrupt received\n");
+
+       return IRQ_HANDLED;
+}
+
+static void a64fx_diag_interrupt_clear(struct a64fx_diag_priv *priv)
+{
+       void __iomem *diag_status_reg_addr;
+       u32 mmsc;
+
+       diag_status_reg_addr = priv->mmsc_reg_base + BMC_DIAG_INTERRUPT_STATUS;
+       mmsc = readl(diag_status_reg_addr);
+       if (mmsc & BMC_DIAG_INTERRUPT_MASK)
+               writel(BMC_DIAG_INTERRUPT_MASK, diag_status_reg_addr);
+}
+
+static void a64fx_diag_interrupt_enable(struct a64fx_diag_priv *priv)
+{
+       void __iomem *diag_enable_reg_addr;
+       u32 mmsc;
+
+       diag_enable_reg_addr = priv->mmsc_reg_base + BMC_DIAG_INTERRUPT_ENABLE;
+       mmsc = readl(diag_enable_reg_addr);
+       if (!(mmsc & BMC_DIAG_INTERRUPT_MASK)) {
+               mmsc |= BMC_DIAG_INTERRUPT_MASK;
+               writel(mmsc, diag_enable_reg_addr);
+       }
+}
+
+static void a64fx_diag_interrupt_disable(struct a64fx_diag_priv *priv)
+{
+       void __iomem *diag_enable_reg_addr;
+       u32 mmsc;
+
+       diag_enable_reg_addr = priv->mmsc_reg_base + BMC_DIAG_INTERRUPT_ENABLE;
+       mmsc = readl(diag_enable_reg_addr);
+       if (mmsc & BMC_DIAG_INTERRUPT_MASK) {
+               mmsc &= ~BMC_DIAG_INTERRUPT_MASK;
+               writel(mmsc, diag_enable_reg_addr);
+       }
+}
+
+static int a64fx_diag_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct a64fx_diag_priv *priv;
+       unsigned long irq_flags;
+       int ret;
+
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       if (priv == NULL)
+               return -ENOMEM;
+
+       priv->mmsc_reg_base = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(priv->mmsc_reg_base))
+               return PTR_ERR(priv->mmsc_reg_base);
+
+       priv->irq = platform_get_irq(pdev, A64FX_DIAG_IRQ);
+       if (priv->irq < 0)
+               return priv->irq;
+
+       platform_set_drvdata(pdev, priv);
+
+       irq_flags = IRQF_PERCPU | IRQF_NOBALANCING | IRQF_NO_AUTOEN |
+                  IRQF_NO_THREAD;
+       ret = request_nmi(priv->irq, &a64fx_diag_handler_nmi, irq_flags,
+                       "a64fx_diag_nmi", NULL);
+       if (ret) {
+               ret = request_irq(priv->irq, &a64fx_diag_handler_irq,
+                               irq_flags, "a64fx_diag_irq", NULL);
+               if (ret) {
+                       dev_err(dev, "cannot register IRQ %d\n", ret);
+                       return ret;
+               }
+               enable_irq(priv->irq);
+       } else {
+               enable_nmi(priv->irq);
+               priv->has_nmi = true;
+       }
+
+       a64fx_diag_interrupt_clear(priv);
+       a64fx_diag_interrupt_enable(priv);
+
+       return 0;
+}
+
+static int a64fx_diag_remove(struct platform_device *pdev)
+{
+       struct a64fx_diag_priv *priv = platform_get_drvdata(pdev);
+
+       a64fx_diag_interrupt_disable(priv);
+       a64fx_diag_interrupt_clear(priv);
+
+       if (priv->has_nmi)
+               free_nmi(priv->irq, NULL);
+       else
+               free_irq(priv->irq, NULL);
+
+       return 0;
+}
+
+static const struct acpi_device_id a64fx_diag_acpi_match[] = {
+       { "FUJI2007", 0 },
+       { },
+};
+MODULE_DEVICE_TABLE(acpi, a64fx_diag_acpi_match);
+
+
+static struct platform_driver a64fx_diag_driver = {
+       .driver = {
+               .name = "a64fx_diag_driver",
+               .acpi_match_table = ACPI_PTR(a64fx_diag_acpi_match),
+       },
+       .probe = a64fx_diag_probe,
+       .remove = a64fx_diag_remove,
+};
+
+module_platform_driver(a64fx_diag_driver);
+
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>");
+MODULE_DESCRIPTION("A64FX diag driver");
index 85aa86e1338aff7d191c46c4172978f3bbb51262..6383a4edc3607fe44018665f3baa08c5d7cbcaae 100644 (file)
@@ -328,7 +328,9 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
        if (!IS_ERR(domain->regulator)) {
                ret = regulator_enable(domain->regulator);
                if (ret) {
-                       dev_err(domain->dev, "failed to enable regulator\n");
+                       dev_err(domain->dev,
+                               "failed to enable regulator: %pe\n",
+                               ERR_PTR(ret));
                        goto out_put_pm;
                }
        }
@@ -467,7 +469,9 @@ static int imx_pgc_power_down(struct generic_pm_domain *genpd)
        if (!IS_ERR(domain->regulator)) {
                ret = regulator_disable(domain->regulator);
                if (ret) {
-                       dev_err(domain->dev, "failed to disable regulator\n");
+                       dev_err(domain->dev,
+                               "failed to disable regulator: %pe\n",
+                               ERR_PTR(ret));
                        return ret;
                }
        }
index 7ebc28709e9455aba1fc4a88b9af9f2bb7b6a684..dff7529268e4dcec93b2d12a61e125799fc96e1f 100644 (file)
@@ -216,7 +216,7 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
        bc->bus_power_dev = genpd_dev_pm_attach_by_name(dev, "bus");
        if (IS_ERR(bc->bus_power_dev))
                return dev_err_probe(dev, PTR_ERR(bc->bus_power_dev),
-                                    "failed to attach power domain\n");
+                                    "failed to attach power domain \"bus\"\n");
 
        for (i = 0; i < bc_data->num_domains; i++) {
                const struct imx8m_blk_ctrl_domain_data *data = &bc_data->domains[i];
@@ -238,7 +238,8 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
                        dev_pm_domain_attach_by_name(dev, data->gpc_name);
                if (IS_ERR(domain->power_dev)) {
                        dev_err_probe(dev, PTR_ERR(domain->power_dev),
-                                     "failed to attach power domain\n");
+                                     "failed to attach power domain \"%s\"\n",
+                                     data->gpc_name);
                        ret = PTR_ERR(domain->power_dev);
                        goto cleanup_pds;
                }
@@ -251,7 +252,9 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
 
                ret = pm_genpd_init(&domain->genpd, NULL, true);
                if (ret) {
-                       dev_err_probe(dev, ret, "failed to init power domain\n");
+                       dev_err_probe(dev, ret,
+                                     "failed to init power domain \"%s\"\n",
+                                     data->gpc_name);
                        dev_pm_domain_detach(domain->power_dev, true);
                        goto cleanup_pds;
                }
index fdd8bc08569ebe6d0284c565fdb98cf4b8c6b2aa..3c3eedea35f729b86217e92ad027b2188867c165 100644 (file)
@@ -73,4 +73,14 @@ config MTK_MMSYS
          Say yes here to add support for the MediaTek Multimedia
          Subsystem (MMSYS).
 
+config MTK_SVS
+       tristate "MediaTek Smart Voltage Scaling(SVS)"
+       depends on MTK_EFUSE && NVMEM
+       help
+         The Smart Voltage Scaling(SVS) engine is a piece of hardware
+         which has several controllers(banks) for calculating suitable
+         voltage to different power domains(CPU/GPU/CCI) according to
+         chip process corner, temperatures and other factors. Then DVFS
+         driver could apply SVS bank voltage to PMIC/Buck.
+
 endmenu
index 90270f8114ed70dea7b58d1e86da5632cb13385a..0e9e703c931a4faf46422d9ed2107c596a71b42f 100644 (file)
@@ -7,3 +7,4 @@ obj-$(CONFIG_MTK_SCPSYS) += mtk-scpsys.o
 obj-$(CONFIG_MTK_SCPSYS_PM_DOMAINS) += mtk-pm-domains.o
 obj-$(CONFIG_MTK_MMSYS) += mtk-mmsys.o
 obj-$(CONFIG_MTK_MMSYS) += mtk-mutex.o
+obj-$(CONFIG_MTK_SVS) += mtk-svs.o
diff --git a/drivers/soc/mediatek/mt6795-pm-domains.h b/drivers/soc/mediatek/mt6795-pm-domains.h
new file mode 100644 (file)
index 0000000..ef07c9d
--- /dev/null
@@ -0,0 +1,112 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __SOC_MEDIATEK_MT6795_PM_DOMAINS_H
+#define __SOC_MEDIATEK_MT6795_PM_DOMAINS_H
+
+#include "mtk-pm-domains.h"
+#include <dt-bindings/power/mt6795-power.h>
+
+/*
+ * MT6795 power domain support
+ */
+
+static const struct scpsys_domain_data scpsys_domain_data_mt6795[] = {
+       [MT6795_POWER_DOMAIN_VDEC] = {
+               .name = "vdec",
+               .sta_mask = PWR_STATUS_VDEC,
+               .ctl_offs = SPM_VDE_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(12, 12),
+       },
+       [MT6795_POWER_DOMAIN_VENC] = {
+               .name = "venc",
+               .sta_mask = PWR_STATUS_VENC,
+               .ctl_offs = SPM_VEN_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(15, 12),
+       },
+       [MT6795_POWER_DOMAIN_ISP] = {
+               .name = "isp",
+               .sta_mask = PWR_STATUS_ISP,
+               .ctl_offs = SPM_ISP_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(13, 12),
+       },
+       [MT6795_POWER_DOMAIN_MM] = {
+               .name = "mm",
+               .sta_mask = PWR_STATUS_DISP,
+               .ctl_offs = SPM_DIS_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(12, 12),
+               .bp_infracfg = {
+                       BUS_PROT_UPDATE_TOPAXI(MT8173_TOP_AXI_PROT_EN_MM_M0 |
+                                              MT8173_TOP_AXI_PROT_EN_MM_M1),
+               },
+       },
+       [MT6795_POWER_DOMAIN_MJC] = {
+               .name = "mjc",
+               .sta_mask = BIT(20),
+               .ctl_offs = 0x298,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(15, 12),
+       },
+       [MT6795_POWER_DOMAIN_AUDIO] = {
+               .name = "audio",
+               .sta_mask = PWR_STATUS_AUDIO,
+               .ctl_offs = SPM_AUDIO_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(15, 12),
+       },
+       [MT6795_POWER_DOMAIN_MFG_ASYNC] = {
+               .name = "mfg_async",
+               .sta_mask = PWR_STATUS_MFG_ASYNC,
+               .ctl_offs = SPM_MFG_ASYNC_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = 0,
+       },
+       [MT6795_POWER_DOMAIN_MFG_2D] = {
+               .name = "mfg_2d",
+               .sta_mask = PWR_STATUS_MFG_2D,
+               .ctl_offs = SPM_MFG_2D_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(11, 8),
+               .sram_pdn_ack_bits = GENMASK(13, 12),
+       },
+       [MT6795_POWER_DOMAIN_MFG] = {
+               .name = "mfg",
+               .sta_mask = PWR_STATUS_MFG,
+               .ctl_offs = SPM_MFG_PWR_CON,
+               .pwr_sta_offs = SPM_PWR_STATUS,
+               .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND,
+               .sram_pdn_bits = GENMASK(13, 8),
+               .sram_pdn_ack_bits = GENMASK(21, 16),
+               .bp_infracfg = {
+                       BUS_PROT_UPDATE_TOPAXI(MT8173_TOP_AXI_PROT_EN_MFG_S |
+                                              MT8173_TOP_AXI_PROT_EN_MFG_M0 |
+                                              MT8173_TOP_AXI_PROT_EN_MFG_M1 |
+                                              MT8173_TOP_AXI_PROT_EN_MFG_SNOOP_OUT),
+               },
+       },
+};
+
+static const struct scpsys_soc_data mt6795_scpsys_data = {
+       .domains_data = scpsys_domain_data_mt6795,
+       .num_domains = ARRAY_SIZE(scpsys_domain_data_mt6795),
+};
+
+#endif /* __SOC_MEDIATEK_MT6795_PM_DOMAINS_H */
index 71b8757e552d6e249b212945cdca9840dfcb41a4..99de67fe5de89921dc8b757bd55bb8ade97a0aa1 100644 (file)
@@ -41,6 +41,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8183[] = {
                .pwr_sta2nd_offs = 0x0184,
                .sram_pdn_bits = 0,
                .sram_pdn_ack_bits = 0,
+               .caps = MTK_SCPD_DOMAIN_SUPPLY,
        },
        [MT8183_POWER_DOMAIN_MFG] = {
                .name = "mfg",
index bf2dd0cdc3a85befbe7168ff3df99f9c0a8caa66..108af61854a38101409c68f1a6576b564524eb94 100644 (file)
@@ -51,7 +51,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8186[] = {
                                MT8186_TOP_AXI_PROT_EN_1_CLR,
                                MT8186_TOP_AXI_PROT_EN_1_STA),
                },
-               .caps = MTK_SCPD_KEEP_DEFAULT_OFF,
+               .caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
        },
        [MT8186_POWER_DOMAIN_MFG2] = {
                .name = "mfg2",
index 558c4ee4784aecd5e94877859180e183a6b38762..b97b2051920fe0b2f3673063105e84b395825ac3 100644 (file)
@@ -58,6 +58,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8192[] = {
                .pwr_sta2nd_offs = 0x0170,
                .sram_pdn_bits = GENMASK(8, 8),
                .sram_pdn_ack_bits = GENMASK(12, 12),
+               .caps = MTK_SCPD_DOMAIN_SUPPLY,
        },
        [MT8192_POWER_DOMAIN_MFG1] = {
                .name = "mfg1",
@@ -85,6 +86,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8192[] = {
                                    MT8192_TOP_AXI_PROT_EN_2_CLR,
                                    MT8192_TOP_AXI_PROT_EN_2_STA1),
                },
+               .caps = MTK_SCPD_DOMAIN_SUPPLY,
        },
        [MT8192_POWER_DOMAIN_MFG2] = {
                .name = "mfg2",
index 938f4d51f5ae1db7ec937497768ab7054bd3ec5c..d7387ea1b9c9188ec977b5523ac146fe2b67871a 100644 (file)
@@ -67,7 +67,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8195[] = {
                .ctl_offs = 0x334,
                .pwr_sta_offs = 0x174,
                .pwr_sta2nd_offs = 0x178,
-               .caps = MTK_SCPD_ACTIVE_WAKEUP,
+               .caps = MTK_SCPD_ACTIVE_WAKEUP | MTK_SCPD_ALWAYS_ON,
        },
        [MT8195_POWER_DOMAIN_CSI_RX_TOP] = {
                .name = "csi_rx_top",
@@ -162,7 +162,7 @@ static const struct scpsys_domain_data scpsys_domain_data_mt8195[] = {
                                    MT8195_TOP_AXI_PROT_EN_SUB_INFRA_VDNR_CLR,
                                    MT8195_TOP_AXI_PROT_EN_SUB_INFRA_VDNR_STA1),
                },
-               .caps = MTK_SCPD_KEEP_DEFAULT_OFF,
+               .caps = MTK_SCPD_KEEP_DEFAULT_OFF | MTK_SCPD_DOMAIN_SUPPLY,
        },
        [MT8195_POWER_DOMAIN_MFG2] = {
                .name = "mfg2",
index 24129a6c25f862c17ae51fab5f01b03044b925d5..7abaf048d91e869b25b9cf6a538d2a88bb2de90c 100644 (file)
@@ -10,6 +10,9 @@
 #define MT8365_DISP_REG_CONFIG_DISP_RDMA0_RSZ0_SEL_IN  0xf60
 #define MT8365_DISP_REG_CONFIG_DISP_COLOR0_SEL_IN      0xf64
 #define MT8365_DISP_REG_CONFIG_DISP_DSI0_SEL_IN                0xf68
+#define MT8365_DISP_REG_CONFIG_DISP_RDMA1_SOUT_SEL     0xfd0
+#define MT8365_DISP_REG_CONFIG_DISP_DPI0_SEL_IN                0xfd8
+#define MT8365_DISP_REG_CONFIG_DISP_LVDS_SYS_CFG_00    0xfdc
 
 #define MT8365_RDMA0_SOUT_COLOR0                       0x1
 #define MT8365_DITHER_MOUT_EN_DSI0                     0x1
 #define MT8365_RDMA0_RSZ0_SEL_IN_RDMA0                 0x0
 #define MT8365_DISP_COLOR_SEL_IN_COLOR0                        0x0
 #define MT8365_OVL0_MOUT_PATH0_SEL                     BIT(0)
+#define MT8365_RDMA1_SOUT_DPI0                         0x1
+#define MT8365_DPI0_SEL_IN_RDMA1                       0x0
+#define MT8365_LVDS_SYS_CFG_00_SEL_LVDS_PXL_CLK                0x1
+#define MT8365_DPI0_SEL_IN_RDMA1                       0x0
 
 static const struct mtk_mmsys_routes mt8365_mmsys_routing_table[] = {
        {
@@ -55,6 +62,21 @@ static const struct mtk_mmsys_routes mt8365_mmsys_routing_table[] = {
                MT8365_DISP_REG_CONFIG_DISP_RDMA0_RSZ0_SEL_IN,
                MT8365_RDMA0_RSZ0_SEL_IN_RDMA0, MT8365_RDMA0_RSZ0_SEL_IN_RDMA0
        },
+       {
+               DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
+               MT8365_DISP_REG_CONFIG_DISP_LVDS_SYS_CFG_00,
+               MT8365_LVDS_SYS_CFG_00_SEL_LVDS_PXL_CLK, MT8365_LVDS_SYS_CFG_00_SEL_LVDS_PXL_CLK
+       },
+       {
+               DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
+               MT8365_DISP_REG_CONFIG_DISP_DPI0_SEL_IN,
+               MT8365_DPI0_SEL_IN_RDMA1, MT8365_DPI0_SEL_IN_RDMA1
+       },
+       {
+               DDP_COMPONENT_RDMA1, DDP_COMPONENT_DPI0,
+               MT8365_DISP_REG_CONFIG_DISP_RDMA1_SOUT_SEL,
+               MT8365_RDMA1_SOUT_DPI0, MT8365_RDMA1_SOUT_DPI0
+       },
 };
 
 #endif /* __SOC_MEDIATEK_MT8365_MMSYS_H */
index 7c65ad3d1f8a38f3b75add46415bf777b50c2f41..fc13334db1b115a9f4ce46ea7c2c596955903942 100644 (file)
@@ -31,10 +31,7 @@ struct mtk_devapc_vio_dbgs {
        u32 vio_dbg1;
 };
 
-struct mtk_devapc_data {
-       /* numbers of violation index */
-       u32 vio_idx_num;
-
+struct mtk_devapc_regs_ofs {
        /* reg offset */
        u32 vio_mask_offset;
        u32 vio_sta_offset;
@@ -46,6 +43,12 @@ struct mtk_devapc_data {
        u32 vio_shift_con_offset;
 };
 
+struct mtk_devapc_data {
+       /* numbers of violation index */
+       u32 vio_idx_num;
+       const struct mtk_devapc_regs_ofs *regs_ofs;
+};
+
 struct mtk_devapc_context {
        struct device *dev;
        void __iomem *infra_base;
@@ -58,7 +61,7 @@ static void clear_vio_status(struct mtk_devapc_context *ctx)
        void __iomem *reg;
        int i;
 
-       reg = ctx->infra_base + ctx->data->vio_sta_offset;
+       reg = ctx->infra_base + ctx->data->regs_ofs->vio_sta_offset;
 
        for (i = 0; i < VIO_MOD_TO_REG_IND(ctx->data->vio_idx_num) - 1; i++)
                writel(GENMASK(31, 0), reg + 4 * i);
@@ -73,7 +76,7 @@ static void mask_module_irq(struct mtk_devapc_context *ctx, bool mask)
        u32 val;
        int i;
 
-       reg = ctx->infra_base + ctx->data->vio_mask_offset;
+       reg = ctx->infra_base + ctx->data->regs_ofs->vio_mask_offset;
 
        if (mask)
                val = GENMASK(31, 0);
@@ -116,11 +119,11 @@ static int devapc_sync_vio_dbg(struct mtk_devapc_context *ctx)
        u32 val;
 
        pd_vio_shift_sta_reg = ctx->infra_base +
-                              ctx->data->vio_shift_sta_offset;
+                              ctx->data->regs_ofs->vio_shift_sta_offset;
        pd_vio_shift_sel_reg = ctx->infra_base +
-                              ctx->data->vio_shift_sel_offset;
+                              ctx->data->regs_ofs->vio_shift_sel_offset;
        pd_vio_shift_con_reg = ctx->infra_base +
-                              ctx->data->vio_shift_con_offset;
+                              ctx->data->regs_ofs->vio_shift_con_offset;
 
        /* Find the minimum shift group which has violation */
        val = readl(pd_vio_shift_sta_reg);
@@ -161,8 +164,8 @@ static void devapc_extract_vio_dbg(struct mtk_devapc_context *ctx)
        void __iomem *vio_dbg0_reg;
        void __iomem *vio_dbg1_reg;
 
-       vio_dbg0_reg = ctx->infra_base + ctx->data->vio_dbg0_offset;
-       vio_dbg1_reg = ctx->infra_base + ctx->data->vio_dbg1_offset;
+       vio_dbg0_reg = ctx->infra_base + ctx->data->regs_ofs->vio_dbg0_offset;
+       vio_dbg1_reg = ctx->infra_base + ctx->data->regs_ofs->vio_dbg1_offset;
 
        vio_dbgs.vio_dbg0 = readl(vio_dbg0_reg);
        vio_dbgs.vio_dbg1 = readl(vio_dbg1_reg);
@@ -200,7 +203,7 @@ static irqreturn_t devapc_violation_irq(int irq_number, void *data)
  */
 static void start_devapc(struct mtk_devapc_context *ctx)
 {
-       writel(BIT(31), ctx->infra_base + ctx->data->apc_con_offset);
+       writel(BIT(31), ctx->infra_base + ctx->data->regs_ofs->apc_con_offset);
 
        mask_module_irq(ctx, false);
 }
@@ -212,11 +215,10 @@ static void stop_devapc(struct mtk_devapc_context *ctx)
 {
        mask_module_irq(ctx, true);
 
-       writel(BIT(2), ctx->infra_base + ctx->data->apc_con_offset);
+       writel(BIT(2), ctx->infra_base + ctx->data->regs_ofs->apc_con_offset);
 }
 
-static const struct mtk_devapc_data devapc_mt6779 = {
-       .vio_idx_num = 511,
+static const struct mtk_devapc_regs_ofs devapc_regs_ofs_mt6779 = {
        .vio_mask_offset = 0x0,
        .vio_sta_offset = 0x400,
        .vio_dbg0_offset = 0x900,
@@ -227,10 +229,23 @@ static const struct mtk_devapc_data devapc_mt6779 = {
        .vio_shift_con_offset = 0xF20,
 };
 
+static const struct mtk_devapc_data devapc_mt6779 = {
+       .vio_idx_num = 511,
+       .regs_ofs = &devapc_regs_ofs_mt6779,
+};
+
+static const struct mtk_devapc_data devapc_mt8186 = {
+       .vio_idx_num = 519,
+       .regs_ofs = &devapc_regs_ofs_mt6779,
+};
+
 static const struct of_device_id mtk_devapc_dt_match[] = {
        {
                .compatible = "mediatek,mt6779-devapc",
                .data = &devapc_mt6779,
+       }, {
+               .compatible = "mediatek,mt8186-devapc",
+               .data = &devapc_mt8186,
        }, {
        },
 };
index 981d56967e7a4d7916042bb52d19326efe3868b8..5ea43de4e410662d7e3530987013cc773442a925 100644 (file)
@@ -7,10 +7,12 @@
 #include <linux/iopoll.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/soc/mediatek/mtk-mmsys.h>
 #include <linux/soc/mediatek/mtk-mutex.h>
+#include <linux/soc/mediatek/mtk-cmdq.h>
 
 #define MT2701_MUTEX0_MOD0                     0x2c
 #define MT2701_MUTEX0_SOF0                     0x30
 #define MT8183_MUTEX_MOD_DISP_GAMMA0           16
 #define MT8183_MUTEX_MOD_DISP_DITHER0          17
 
+#define MT8183_MUTEX_MOD_MDP_RDMA0             2
+#define MT8183_MUTEX_MOD_MDP_RSZ0              4
+#define MT8183_MUTEX_MOD_MDP_RSZ1              5
+#define MT8183_MUTEX_MOD_MDP_TDSHP0            6
+#define MT8183_MUTEX_MOD_MDP_WROT0             7
+#define MT8183_MUTEX_MOD_MDP_WDMA              8
+#define MT8183_MUTEX_MOD_MDP_AAL0              23
+#define MT8183_MUTEX_MOD_MDP_CCORR0            24
+
 #define MT8173_MUTEX_MOD_DISP_OVL0             11
 #define MT8173_MUTEX_MOD_DISP_OVL1             12
 #define MT8173_MUTEX_MOD_DISP_RDMA0            13
 #define MT8195_MUTEX_MOD_DISP_DP_INTF0         21
 #define MT8195_MUTEX_MOD_DISP_PWM0             27
 
+#define MT8365_MUTEX_MOD_DISP_OVL0             7
+#define MT8365_MUTEX_MOD_DISP_OVL0_2L          8
+#define MT8365_MUTEX_MOD_DISP_RDMA0            9
+#define MT8365_MUTEX_MOD_DISP_RDMA1            10
+#define MT8365_MUTEX_MOD_DISP_WDMA0            11
+#define MT8365_MUTEX_MOD_DISP_COLOR0           12
+#define MT8365_MUTEX_MOD_DISP_CCORR            13
+#define MT8365_MUTEX_MOD_DISP_AAL              14
+#define MT8365_MUTEX_MOD_DISP_GAMMA            15
+#define MT8365_MUTEX_MOD_DISP_DITHER           16
+#define MT8365_MUTEX_MOD_DISP_DSI0             17
+#define MT8365_MUTEX_MOD_DISP_PWM0             20
+#define MT8365_MUTEX_MOD_DISP_DPI0             22
+
 #define MT2712_MUTEX_MOD_DISP_PWM2             10
 #define MT2712_MUTEX_MOD_DISP_OVL0             11
 #define MT2712_MUTEX_MOD_DISP_OVL1             12
@@ -185,6 +210,7 @@ struct mtk_mutex_data {
        const unsigned int *mutex_sof;
        const unsigned int mutex_mod_reg;
        const unsigned int mutex_sof_reg;
+       const unsigned int *mutex_table_mod;
        const bool no_clk;
 };
 
@@ -194,6 +220,8 @@ struct mtk_mutex_ctx {
        void __iomem                    *regs;
        struct mtk_mutex                mutex[10];
        const struct mtk_mutex_data     *data;
+       phys_addr_t                     addr;
+       struct cmdq_client_reg          cmdq_reg;
 };
 
 static const unsigned int mt2701_mutex_mod[DDP_COMPONENT_ID_MAX] = {
@@ -272,6 +300,17 @@ static const unsigned int mt8183_mutex_mod[DDP_COMPONENT_ID_MAX] = {
        [DDP_COMPONENT_WDMA0] = MT8183_MUTEX_MOD_DISP_WDMA0,
 };
 
+static const unsigned int mt8183_mutex_table_mod[MUTEX_MOD_IDX_MAX] = {
+       [MUTEX_MOD_IDX_MDP_RDMA0] = MT8183_MUTEX_MOD_MDP_RDMA0,
+       [MUTEX_MOD_IDX_MDP_RSZ0] = MT8183_MUTEX_MOD_MDP_RSZ0,
+       [MUTEX_MOD_IDX_MDP_RSZ1] = MT8183_MUTEX_MOD_MDP_RSZ1,
+       [MUTEX_MOD_IDX_MDP_TDSHP0] = MT8183_MUTEX_MOD_MDP_TDSHP0,
+       [MUTEX_MOD_IDX_MDP_WROT0] = MT8183_MUTEX_MOD_MDP_WROT0,
+       [MUTEX_MOD_IDX_MDP_WDMA] = MT8183_MUTEX_MOD_MDP_WDMA,
+       [MUTEX_MOD_IDX_MDP_AAL0] = MT8183_MUTEX_MOD_MDP_AAL0,
+       [MUTEX_MOD_IDX_MDP_CCORR0] = MT8183_MUTEX_MOD_MDP_CCORR0,
+};
+
 static const unsigned int mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] = {
        [DDP_COMPONENT_AAL0] = MT8186_MUTEX_MOD_DISP_AAL0,
        [DDP_COMPONENT_CCORR] = MT8186_MUTEX_MOD_DISP_CCORR0,
@@ -315,6 +354,22 @@ static const unsigned int mt8195_mutex_mod[DDP_COMPONENT_ID_MAX] = {
        [DDP_COMPONENT_DP_INTF0] = MT8195_MUTEX_MOD_DISP_DP_INTF0,
 };
 
+static const unsigned int mt8365_mutex_mod[DDP_COMPONENT_ID_MAX] = {
+       [DDP_COMPONENT_AAL0] = MT8365_MUTEX_MOD_DISP_AAL,
+       [DDP_COMPONENT_CCORR] = MT8365_MUTEX_MOD_DISP_CCORR,
+       [DDP_COMPONENT_COLOR0] = MT8365_MUTEX_MOD_DISP_COLOR0,
+       [DDP_COMPONENT_DITHER0] = MT8365_MUTEX_MOD_DISP_DITHER,
+       [DDP_COMPONENT_DPI0] = MT8365_MUTEX_MOD_DISP_DPI0,
+       [DDP_COMPONENT_DSI0] = MT8365_MUTEX_MOD_DISP_DSI0,
+       [DDP_COMPONENT_GAMMA] = MT8365_MUTEX_MOD_DISP_GAMMA,
+       [DDP_COMPONENT_OVL0] = MT8365_MUTEX_MOD_DISP_OVL0,
+       [DDP_COMPONENT_OVL_2L0] = MT8365_MUTEX_MOD_DISP_OVL0_2L,
+       [DDP_COMPONENT_PWM0] = MT8365_MUTEX_MOD_DISP_PWM0,
+       [DDP_COMPONENT_RDMA0] = MT8365_MUTEX_MOD_DISP_RDMA0,
+       [DDP_COMPONENT_RDMA1] = MT8365_MUTEX_MOD_DISP_RDMA1,
+       [DDP_COMPONENT_WDMA0] = MT8365_MUTEX_MOD_DISP_WDMA0,
+};
+
 static const unsigned int mt2712_mutex_sof[DDP_MUTEX_SOF_MAX] = {
        [MUTEX_SOF_SINGLE_MODE] = MUTEX_SOF_SINGLE_MODE,
        [MUTEX_SOF_DSI0] = MUTEX_SOF_DSI0,
@@ -399,6 +454,7 @@ static const struct mtk_mutex_data mt8183_mutex_driver_data = {
        .mutex_sof = mt8183_mutex_sof,
        .mutex_mod_reg = MT8183_MUTEX0_MOD0,
        .mutex_sof_reg = MT8183_MUTEX0_SOF0,
+       .mutex_table_mod = mt8183_mutex_table_mod,
        .no_clk = true,
 };
 
@@ -423,6 +479,14 @@ static const struct mtk_mutex_data mt8195_mutex_driver_data = {
        .mutex_sof_reg = MT8183_MUTEX0_SOF0,
 };
 
+static const struct mtk_mutex_data mt8365_mutex_driver_data = {
+       .mutex_mod = mt8365_mutex_mod,
+       .mutex_sof = mt8183_mutex_sof,
+       .mutex_mod_reg = MT8183_MUTEX0_MOD0,
+       .mutex_sof_reg = MT8183_MUTEX0_SOF0,
+       .no_clk = true,
+};
+
 struct mtk_mutex *mtk_mutex_get(struct device *dev)
 {
        struct mtk_mutex_ctx *mtx = dev_get_drvdata(dev);
@@ -572,6 +636,30 @@ void mtk_mutex_enable(struct mtk_mutex *mutex)
 }
 EXPORT_SYMBOL_GPL(mtk_mutex_enable);
 
+int mtk_mutex_enable_by_cmdq(struct mtk_mutex *mutex, void *pkt)
+{
+       struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx,
+                                                mutex[mutex->id]);
+#if IS_REACHABLE(CONFIG_MTK_CMDQ)
+       struct cmdq_pkt *cmdq_pkt = (struct cmdq_pkt *)pkt;
+
+       WARN_ON(&mtx->mutex[mutex->id] != mutex);
+
+       if (!mtx->cmdq_reg.size) {
+               dev_err(mtx->dev, "mediatek,gce-client-reg hasn't been set");
+               return -EINVAL;
+       }
+
+       cmdq_pkt_write(cmdq_pkt, mtx->cmdq_reg.subsys,
+                      mtx->addr + DISP_REG_MUTEX_EN(mutex->id), 1);
+       return 0;
+#else
+       dev_err(mtx->dev, "Not support for enable MUTEX by CMDQ");
+       return -ENODEV;
+#endif
+}
+EXPORT_SYMBOL_GPL(mtk_mutex_enable_by_cmdq);
+
 void mtk_mutex_disable(struct mtk_mutex *mutex)
 {
        struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx,
@@ -606,12 +694,67 @@ void mtk_mutex_release(struct mtk_mutex *mutex)
 }
 EXPORT_SYMBOL_GPL(mtk_mutex_release);
 
+int mtk_mutex_write_mod(struct mtk_mutex *mutex,
+                       enum mtk_mutex_mod_index idx, bool clear)
+{
+       struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx,
+                                                mutex[mutex->id]);
+       unsigned int reg;
+       unsigned int offset;
+
+       WARN_ON(&mtx->mutex[mutex->id] != mutex);
+
+       if (idx < MUTEX_MOD_IDX_MDP_RDMA0 ||
+           idx >= MUTEX_MOD_IDX_MAX) {
+               dev_err(mtx->dev, "Not supported MOD table index : %d", idx);
+               return -EINVAL;
+       }
+
+       offset = DISP_REG_MUTEX_MOD(mtx->data->mutex_mod_reg,
+                                   mutex->id);
+       reg = readl_relaxed(mtx->regs + offset);
+
+       if (clear)
+               reg &= ~BIT(mtx->data->mutex_table_mod[idx]);
+       else
+               reg |= BIT(mtx->data->mutex_table_mod[idx]);
+
+       writel_relaxed(reg, mtx->regs + offset);
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(mtk_mutex_write_mod);
+
+int mtk_mutex_write_sof(struct mtk_mutex *mutex,
+                       enum mtk_mutex_sof_index idx)
+{
+       struct mtk_mutex_ctx *mtx = container_of(mutex, struct mtk_mutex_ctx,
+                                                mutex[mutex->id]);
+
+       WARN_ON(&mtx->mutex[mutex->id] != mutex);
+
+       if (idx < MUTEX_SOF_IDX_SINGLE_MODE ||
+           idx >= MUTEX_SOF_IDX_MAX) {
+               dev_err(mtx->dev, "Not supported SOF index : %d", idx);
+               return -EINVAL;
+       }
+
+       writel_relaxed(idx, mtx->regs +
+                      DISP_REG_MUTEX_SOF(mtx->data->mutex_sof_reg, mutex->id));
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(mtk_mutex_write_sof);
+
 static int mtk_mutex_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct mtk_mutex_ctx *mtx;
        struct resource *regs;
        int i;
+#if IS_REACHABLE(CONFIG_MTK_CMDQ)
+       int ret;
+#endif
 
        mtx = devm_kzalloc(dev, sizeof(*mtx), GFP_KERNEL);
        if (!mtx)
@@ -631,12 +774,18 @@ static int mtk_mutex_probe(struct platform_device *pdev)
                }
        }
 
-       regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mtx->regs = devm_ioremap_resource(dev, regs);
+       mtx->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &regs);
        if (IS_ERR(mtx->regs)) {
                dev_err(dev, "Failed to map mutex registers\n");
                return PTR_ERR(mtx->regs);
        }
+       mtx->addr = regs->start;
+
+#if IS_REACHABLE(CONFIG_MTK_CMDQ)
+       ret = cmdq_dev_get_client_reg(dev, &mtx->cmdq_reg, 0);
+       if (ret)
+               dev_dbg(dev, "No mediatek,gce-client-reg!\n");
+#endif
 
        platform_set_drvdata(pdev, mtx);
 
@@ -665,6 +814,8 @@ static const struct of_device_id mutex_driver_dt_match[] = {
          .data = &mt8192_mutex_driver_data},
        { .compatible = "mediatek,mt8195-disp-mutex",
          .data = &mt8195_mutex_driver_data},
+       { .compatible = "mediatek,mt8365-disp-mutex",
+         .data = &mt8365_mutex_driver_data},
        {},
 };
 MODULE_DEVICE_TABLE(of, mutex_driver_dt_match);
index 5ced254b082bbf3577af904fdc96bbb7e939a929..9734f1091c695f07b40804c764bfaa8497db0494 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/soc/mediatek/infracfg.h>
 
+#include "mt6795-pm-domains.h"
 #include "mt8167-pm-domains.h"
 #include "mt8173-pm-domains.h"
 #include "mt8183-pm-domains.h"
@@ -428,6 +429,9 @@ generic_pm_domain *scpsys_add_one_domain(struct scpsys *scpsys, struct device_no
                        dev_err(scpsys->dev, "%pOF: failed to power on domain: %d\n", node, ret);
                        goto err_put_subsys_clocks;
                }
+
+               if (MTK_SCPD_CAPS(pd, MTK_SCPD_ALWAYS_ON))
+                       pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON;
        }
 
        if (scpsys->domains[id]) {
@@ -555,6 +559,10 @@ static void scpsys_domain_cleanup(struct scpsys *scpsys)
 }
 
 static const struct of_device_id scpsys_of_match[] = {
+       {
+               .compatible = "mediatek,mt6795-power-controller",
+               .data = &mt6795_scpsys_data,
+       },
        {
                .compatible = "mediatek,mt8167-power-controller",
                .data = &mt8167_scpsys_data,
index daa24e890dd4174a74abfa7276cea58cf33eb8c6..7d3c0c36316cf94147929a8021be20f3429dc5e4 100644 (file)
@@ -8,6 +8,8 @@
 #define MTK_SCPD_SRAM_ISO              BIT(2)
 #define MTK_SCPD_KEEP_DEFAULT_OFF      BIT(3)
 #define MTK_SCPD_DOMAIN_SUPPLY         BIT(4)
+/* can't set MTK_SCPD_KEEP_DEFAULT_OFF at the same time */
+#define MTK_SCPD_ALWAYS_ON             BIT(5)
 #define MTK_SCPD_CAPS(_scpd, _x)       ((_scpd)->data->caps & (_x))
 
 #define SPM_VDE_PWR_CON                        0x0210
index bf39a64f3ecc4b6548c3ac73f974ad1af08b02df..d8cb0f8336452c9aec1b5662ae673b51cf874370 100644 (file)
@@ -13,6 +13,9 @@
 #include <linux/regmap.h>
 #include <linux/reset.h>
 
+#define PWRAP_POLL_DELAY_US    10
+#define PWRAP_POLL_TIMEOUT_US  10000
+
 #define PWRAP_MT8135_BRIDGE_IORD_ARB_EN                0x4
 #define PWRAP_MT8135_BRIDGE_WACS3_EN           0x10
 #define PWRAP_MT8135_BRIDGE_INIT_DONE3         0x14
@@ -1140,12 +1143,9 @@ enum pwrap_type {
 };
 
 struct pmic_wrapper;
-struct pwrap_slv_type {
-       const u32 *dew_regs;
-       enum pmic_type type;
+
+struct pwrap_slv_regops {
        const struct regmap_config *regmap;
-       /* Flags indicating the capability for the target slave */
-       u32 caps;
        /*
         * pwrap operations are highly associated with the PMIC types,
         * so the pointers added increases flexibility allowing determination
@@ -1155,6 +1155,14 @@ struct pwrap_slv_type {
        int (*pwrap_write)(struct pmic_wrapper *wrp, u32 adr, u32 wdata);
 };
 
+struct pwrap_slv_type {
+       const u32 *dew_regs;
+       enum pmic_type type;
+       const struct pwrap_slv_regops *regops;
+       /* Flags indicating the capability for the target slave */
+       u32 caps;
+};
+
 struct pmic_wrapper {
        struct device *dev;
        void __iomem *base;
@@ -1241,27 +1249,14 @@ static bool pwrap_is_fsm_idle_and_sync_idle(struct pmic_wrapper *wrp)
                (val & PWRAP_STATE_SYNC_IDLE0);
 }
 
-static int pwrap_wait_for_state(struct pmic_wrapper *wrp,
-               bool (*fp)(struct pmic_wrapper *))
-{
-       unsigned long timeout;
-
-       timeout = jiffies + usecs_to_jiffies(10000);
-
-       do {
-               if (time_after(jiffies, timeout))
-                       return fp(wrp) ? 0 : -ETIMEDOUT;
-               if (fp(wrp))
-                       return 0;
-       } while (1);
-}
-
 static int pwrap_read16(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 {
+       bool tmp;
        int ret;
        u32 val;
 
-       ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle);
+       ret = readx_poll_timeout(pwrap_is_fsm_idle, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                pwrap_leave_fsm_vldclr(wrp);
                return ret;
@@ -1273,7 +1268,8 @@ static int pwrap_read16(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
                val = (adr >> 1) << 16;
        pwrap_writel(wrp, val, PWRAP_WACS2_CMD);
 
-       ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_vldclr);
+       ret = readx_poll_timeout(pwrap_is_fsm_vldclr, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret)
                return ret;
 
@@ -1290,11 +1286,14 @@ static int pwrap_read16(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 
 static int pwrap_read32(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 {
+       bool tmp;
        int ret, msb;
 
        *rdata = 0;
        for (msb = 0; msb < 2; msb++) {
-               ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle);
+               ret = readx_poll_timeout(pwrap_is_fsm_idle, wrp, tmp, tmp,
+                                        PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
+
                if (ret) {
                        pwrap_leave_fsm_vldclr(wrp);
                        return ret;
@@ -1303,7 +1302,8 @@ static int pwrap_read32(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
                pwrap_writel(wrp, ((msb << 30) | (adr << 16)),
                             PWRAP_WACS2_CMD);
 
-               ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_vldclr);
+               ret = readx_poll_timeout(pwrap_is_fsm_vldclr, wrp, tmp, tmp,
+                                        PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
                if (ret)
                        return ret;
 
@@ -1318,14 +1318,16 @@ static int pwrap_read32(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 
 static int pwrap_read(struct pmic_wrapper *wrp, u32 adr, u32 *rdata)
 {
-       return wrp->slave->pwrap_read(wrp, adr, rdata);
+       return wrp->slave->regops->pwrap_read(wrp, adr, rdata);
 }
 
 static int pwrap_write16(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 {
+       bool tmp;
        int ret;
 
-       ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle);
+       ret = readx_poll_timeout(pwrap_is_fsm_idle, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                pwrap_leave_fsm_vldclr(wrp);
                return ret;
@@ -1344,10 +1346,12 @@ static int pwrap_write16(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 
 static int pwrap_write32(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 {
+       bool tmp;
        int ret, msb, rdata;
 
        for (msb = 0; msb < 2; msb++) {
-               ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle);
+               ret = readx_poll_timeout(pwrap_is_fsm_idle, wrp, tmp, tmp,
+                                        PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
                if (ret) {
                        pwrap_leave_fsm_vldclr(wrp);
                        return ret;
@@ -1373,7 +1377,7 @@ static int pwrap_write32(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 
 static int pwrap_write(struct pmic_wrapper *wrp, u32 adr, u32 wdata)
 {
-       return wrp->slave->pwrap_write(wrp, adr, wdata);
+       return wrp->slave->regops->pwrap_write(wrp, adr, wdata);
 }
 
 static int pwrap_regmap_read(void *context, u32 adr, u32 *rdata)
@@ -1388,6 +1392,7 @@ static int pwrap_regmap_write(void *context, u32 adr, u32 wdata)
 
 static int pwrap_reset_spislave(struct pmic_wrapper *wrp)
 {
+       bool tmp;
        int ret, i;
 
        pwrap_writel(wrp, 0, PWRAP_HIPRIO_ARB_EN);
@@ -1407,7 +1412,8 @@ static int pwrap_reset_spislave(struct pmic_wrapper *wrp)
                pwrap_writel(wrp, wrp->master->spi_w | PWRAP_MAN_CMD_OP_OUTS,
                                PWRAP_MAN_CMD);
 
-       ret = pwrap_wait_for_state(wrp, pwrap_is_sync_idle);
+       ret = readx_poll_timeout(pwrap_is_sync_idle, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                dev_err(wrp->dev, "%s fail, ret=%d\n", __func__, ret);
                return ret;
@@ -1458,14 +1464,15 @@ static int pwrap_init_sidly(struct pmic_wrapper *wrp)
 static int pwrap_init_dual_io(struct pmic_wrapper *wrp)
 {
        int ret;
+       bool tmp;
        u32 rdata;
 
        /* Enable dual IO mode */
        pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_DIO_EN], 1);
 
        /* Check IDLE & INIT_DONE in advance */
-       ret = pwrap_wait_for_state(wrp,
-                                  pwrap_is_fsm_idle_and_sync_idle);
+       ret = readx_poll_timeout(pwrap_is_fsm_idle_and_sync_idle, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                dev_err(wrp->dev, "%s fail, ret=%d\n", __func__, ret);
                return ret;
@@ -1570,6 +1577,7 @@ static bool pwrap_is_pmic_cipher_ready(struct pmic_wrapper *wrp)
 static int pwrap_init_cipher(struct pmic_wrapper *wrp)
 {
        int ret;
+       bool tmp;
        u32 rdata = 0;
 
        pwrap_writel(wrp, 0x1, PWRAP_CIPHER_SWRST);
@@ -1624,14 +1632,16 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp)
        }
 
        /* wait for cipher data ready@AP */
-       ret = pwrap_wait_for_state(wrp, pwrap_is_cipher_ready);
+       ret = readx_poll_timeout(pwrap_is_cipher_ready, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                dev_err(wrp->dev, "cipher data ready@AP fail, ret=%d\n", ret);
                return ret;
        }
 
        /* wait for cipher data ready@PMIC */
-       ret = pwrap_wait_for_state(wrp, pwrap_is_pmic_cipher_ready);
+       ret = readx_poll_timeout(pwrap_is_pmic_cipher_ready, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                dev_err(wrp->dev,
                        "timeout waiting for cipher data ready@PMIC\n");
@@ -1640,7 +1650,8 @@ static int pwrap_init_cipher(struct pmic_wrapper *wrp)
 
        /* wait for cipher mode idle */
        pwrap_write(wrp, wrp->slave->dew_regs[PWRAP_DEW_CIPHER_MODE], 0x1);
-       ret = pwrap_wait_for_state(wrp, pwrap_is_fsm_idle_and_sync_idle);
+       ret = readx_poll_timeout(pwrap_is_fsm_idle_and_sync_idle, wrp, tmp, tmp,
+                                PWRAP_POLL_DELAY_US, PWRAP_POLL_TIMEOUT_US);
        if (ret) {
                dev_err(wrp->dev, "cipher mode idle fail, ret=%d\n", ret);
                return ret;
@@ -1885,99 +1896,82 @@ static const struct regmap_config pwrap_regmap_config32 = {
        .max_register = 0xffff,
 };
 
+static const struct pwrap_slv_regops pwrap_regops16 = {
+       .pwrap_read = pwrap_read16,
+       .pwrap_write = pwrap_write16,
+       .regmap = &pwrap_regmap_config16,
+};
+
+static const struct pwrap_slv_regops pwrap_regops32 = {
+       .pwrap_read = pwrap_read32,
+       .pwrap_write = pwrap_write32,
+       .regmap = &pwrap_regmap_config32,
+};
+
 static const struct pwrap_slv_type pmic_mt6323 = {
        .dew_regs = mt6323_regs,
        .type = PMIC_MT6323,
-       .regmap = &pwrap_regmap_config16,
+       .regops = &pwrap_regops16,
        .caps = PWRAP_SLV_CAP_SPI | PWRAP_SLV_CAP_DUALIO |
                PWRAP_SLV_CAP_SECURITY,
-       .pwrap_read = pwrap_read16,
-       .pwrap_write = pwrap_write16,
 };
 
 static const struct pwrap_slv_type pmic_mt6351 = {
        .dew_regs = mt6351_regs,
        .type = PMIC_MT6351,
-       .regmap = &pwrap_regmap_config16,
+       .regops = &pwrap_regops16,
        .caps = 0,
-       .pwrap_read = pwrap_read16,
-       .pwrap_write = pwrap_write16,
 };
 
 static const struct pwrap_slv_type pmic_mt6357 = {
        .dew_regs = mt6357_regs,
        .type = PMIC_MT6357,
-       .regmap = &pwrap_regmap_config16,
+       .regops = &pwrap_regops16,
        .caps = 0,
-       .pwrap_read = pwrap_read16,
-       .pwrap_write = pwrap_write16,
 };
 
 static const struct pwrap_slv_type pmic_mt6358 = {
        .dew_regs = mt6358_regs,
        .type = PMIC_MT6358,
-       .regmap = &pwrap_regmap_config16,
+       .regops = &pwrap_regops16,
        .caps = PWRAP_SLV_CAP_SPI | PWRAP_SLV_CAP_DUALIO,
-       .pwrap_read = pwrap_read16,
-       .pwrap_write = pwrap_write16,
 };
 
 static const struct pwrap_slv_type pmic_mt6359 = {
        .dew_regs = mt6359_regs,
        .type = PMIC_MT6359,
-       .regmap = &pwrap_regmap_config16,
+       .regops = &pwrap_regops16,
        .caps = PWRAP_SLV_CAP_DUALIO,
-       .pwrap_read = pwrap_read16,
-       .pwrap_write = pwrap_write16,
 };
 
 static const struct pwrap_slv_type pmic_mt6380 = {
        .dew_regs = NULL,
        .type = PMIC_MT6380,
-       .regmap = &pwrap_regmap_config32,
+       .regops = &pwrap_regops32,
        .caps = 0,
-       .pwrap_read = pwrap_read32,
-       .pwrap_write = pwrap_write32,
 };
 
 static const struct pwrap_slv_type pmic_mt6397 = {
        .dew_regs = mt6397_regs,
        .type = PMIC_MT6397,
-       .regmap = &pwrap_regmap_config16,
+       .regops = &pwrap_regops16,
        .caps = PWRAP_SLV_CAP_SPI | PWRAP_SLV_CAP_DUALIO |
                PWRAP_SLV_CAP_SECURITY,
-       .pwrap_read = pwrap_read16,
-       .pwrap_write = pwrap_write16,
 };
 
 static const struct of_device_id of_slave_match_tbl[] = {
-       {
-               .compatible = "mediatek,mt6323",
-               .data = &pmic_mt6323,
-       }, {
-               .compatible = "mediatek,mt6351",
-               .data = &pmic_mt6351,
-       }, {
-               .compatible = "mediatek,mt6357",
-               .data = &pmic_mt6357,
-       }, {
-               .compatible = "mediatek,mt6358",
-               .data = &pmic_mt6358,
-       }, {
-               .compatible = "mediatek,mt6359",
-               .data = &pmic_mt6359,
-       }, {
-               /* The MT6380 PMIC only implements a regulator, so we bind it
-                * directly instead of using a MFD.
-                */
-               .compatible = "mediatek,mt6380-regulator",
-               .data = &pmic_mt6380,
-       }, {
-               .compatible = "mediatek,mt6397",
-               .data = &pmic_mt6397,
-       }, {
-               /* sentinel */
-       }
+       { .compatible = "mediatek,mt6323", .data = &pmic_mt6323 },
+       { .compatible = "mediatek,mt6351", .data = &pmic_mt6351 },
+       { .compatible = "mediatek,mt6357", .data = &pmic_mt6357 },
+       { .compatible = "mediatek,mt6358", .data = &pmic_mt6358 },
+       { .compatible = "mediatek,mt6359", .data = &pmic_mt6359 },
+
+       /* The MT6380 PMIC only implements a regulator, so we bind it
+        * directly instead of using a MFD.
+        */
+       { .compatible = "mediatek,mt6380-regulator", .data = &pmic_mt6380 },
+       { .compatible = "mediatek,mt6397", .data = &pmic_mt6397 },
+       { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, of_slave_match_tbl);
 
@@ -2136,45 +2130,19 @@ static struct pmic_wrapper_type pwrap_mt8186 = {
 };
 
 static const struct of_device_id of_pwrap_match_tbl[] = {
-       {
-               .compatible = "mediatek,mt2701-pwrap",
-               .data = &pwrap_mt2701,
-       }, {
-               .compatible = "mediatek,mt6765-pwrap",
-               .data = &pwrap_mt6765,
-       }, {
-               .compatible = "mediatek,mt6779-pwrap",
-               .data = &pwrap_mt6779,
-       }, {
-               .compatible = "mediatek,mt6797-pwrap",
-               .data = &pwrap_mt6797,
-       }, {
-               .compatible = "mediatek,mt6873-pwrap",
-               .data = &pwrap_mt6873,
-       }, {
-               .compatible = "mediatek,mt7622-pwrap",
-               .data = &pwrap_mt7622,
-       }, {
-               .compatible = "mediatek,mt8135-pwrap",
-               .data = &pwrap_mt8135,
-       }, {
-               .compatible = "mediatek,mt8173-pwrap",
-               .data = &pwrap_mt8173,
-       }, {
-               .compatible = "mediatek,mt8183-pwrap",
-               .data = &pwrap_mt8183,
-       }, {
-               .compatible = "mediatek,mt8186-pwrap",
-               .data = &pwrap_mt8186,
-       }, {
-               .compatible = "mediatek,mt8195-pwrap",
-               .data = &pwrap_mt8195,
-       }, {
-               .compatible = "mediatek,mt8516-pwrap",
-               .data = &pwrap_mt8516,
-       }, {
-               /* sentinel */
-       }
+       { .compatible = "mediatek,mt2701-pwrap", .data = &pwrap_mt2701 },
+       { .compatible = "mediatek,mt6765-pwrap", .data = &pwrap_mt6765 },
+       { .compatible = "mediatek,mt6779-pwrap", .data = &pwrap_mt6779 },
+       { .compatible = "mediatek,mt6797-pwrap", .data = &pwrap_mt6797 },
+       { .compatible = "mediatek,mt6873-pwrap", .data = &pwrap_mt6873 },
+       { .compatible = "mediatek,mt7622-pwrap", .data = &pwrap_mt7622 },
+       { .compatible = "mediatek,mt8135-pwrap", .data = &pwrap_mt8135 },
+       { .compatible = "mediatek,mt8173-pwrap", .data = &pwrap_mt8173 },
+       { .compatible = "mediatek,mt8183-pwrap", .data = &pwrap_mt8183 },
+       { .compatible = "mediatek,mt8186-pwrap", .data = &pwrap_mt8186 },
+       { .compatible = "mediatek,mt8195-pwrap", .data = &pwrap_mt8195 },
+       { .compatible = "mediatek,mt8516-pwrap", .data = &pwrap_mt8516 },
+       { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, of_pwrap_match_tbl);
 
@@ -2185,7 +2153,6 @@ static int pwrap_probe(struct platform_device *pdev)
        struct pmic_wrapper *wrp;
        struct device_node *np = pdev->dev.of_node;
        const struct of_device_id *of_slave_id = NULL;
-       struct resource *res;
 
        if (np->child)
                of_slave_id = of_match_node(of_slave_match_tbl, np->child);
@@ -2205,8 +2172,7 @@ static int pwrap_probe(struct platform_device *pdev)
        wrp->slave = of_slave_id->data;
        wrp->dev = &pdev->dev;
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwrap");
-       wrp->base = devm_ioremap_resource(wrp->dev, res);
+       wrp->base = devm_platform_ioremap_resource_byname(pdev, "pwrap");
        if (IS_ERR(wrp->base))
                return PTR_ERR(wrp->base);
 
@@ -2220,9 +2186,7 @@ static int pwrap_probe(struct platform_device *pdev)
        }
 
        if (HAS_CAP(wrp->master->caps, PWRAP_CAP_BRIDGE)) {
-               res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
-                               "pwrap-bridge");
-               wrp->bridge_base = devm_ioremap_resource(wrp->dev, res);
+               wrp->bridge_base = devm_platform_ioremap_resource_byname(pdev, "pwrap-bridge");
                if (IS_ERR(wrp->bridge_base))
                        return PTR_ERR(wrp->bridge_base);
 
@@ -2315,13 +2279,18 @@ static int pwrap_probe(struct platform_device *pdev)
                pwrap_writel(wrp, wrp->master->int1_en_all, PWRAP_INT1_EN);
 
        irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
+               ret = irq;
+               goto err_out2;
+       }
+
        ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt,
                               IRQF_TRIGGER_HIGH,
                               "mt-pmic-pwrap", wrp);
        if (ret)
                goto err_out2;
 
-       wrp->regmap = devm_regmap_init(wrp->dev, NULL, wrp, wrp->slave->regmap);
+       wrp->regmap = devm_regmap_init(wrp->dev, NULL, wrp, wrp->slave->regops->regmap);
        if (IS_ERR(wrp->regmap)) {
                ret = PTR_ERR(wrp->regmap);
                goto err_out2;
diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
new file mode 100644 (file)
index 0000000..dee8664
--- /dev/null
@@ -0,0 +1,2403 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2022 MediaTek Inc.
+ */
+
+#include <linux/bits.h>
+#include <linux/clk.h>
+#include <linux/completion.h>
+#include <linux/cpuidle.h>
+#include <linux/debugfs.h>
+#include <linux/device.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
+#include <linux/kthread.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/nvmem-consumer.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/pm_domain.h>
+#include <linux/pm_opp.h>
+#include <linux/pm_runtime.h>
+#include <linux/regulator/consumer.h>
+#include <linux/reset.h>
+#include <linux/seq_file.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/thermal.h>
+
+/* svs bank 1-line software id */
+#define SVSB_CPU_LITTLE                        BIT(0)
+#define SVSB_CPU_BIG                   BIT(1)
+#define SVSB_CCI                       BIT(2)
+#define SVSB_GPU                       BIT(3)
+
+/* svs bank 2-line type */
+#define SVSB_LOW                       BIT(8)
+#define SVSB_HIGH                      BIT(9)
+
+/* svs bank mode support */
+#define SVSB_MODE_ALL_DISABLE          0
+#define SVSB_MODE_INIT01               BIT(1)
+#define SVSB_MODE_INIT02               BIT(2)
+#define SVSB_MODE_MON                  BIT(3)
+
+/* svs bank volt flags */
+#define SVSB_INIT01_PD_REQ             BIT(0)
+#define SVSB_INIT01_VOLT_IGNORE                BIT(1)
+#define SVSB_INIT01_VOLT_INC_ONLY      BIT(2)
+#define SVSB_MON_VOLT_IGNORE           BIT(16)
+#define SVSB_REMOVE_DVTFIXED_VOLT      BIT(24)
+
+/* svs bank register common configuration */
+#define SVSB_DET_MAX                   0xffff
+#define SVSB_DET_WINDOW                        0xa28
+#define SVSB_DTHI                      0x1
+#define SVSB_DTLO                      0xfe
+#define SVSB_EN_INIT01                 0x1
+#define SVSB_EN_INIT02                 0x5
+#define SVSB_EN_MON                    0x2
+#define SVSB_EN_OFF                    0x0
+#define SVSB_INTEN_INIT0x              0x00005f01
+#define SVSB_INTEN_MONVOPEN            0x00ff0000
+#define SVSB_INTSTS_CLEAN              0x00ffffff
+#define SVSB_INTSTS_COMPLETE           0x1
+#define SVSB_INTSTS_MONVOP             0x00ff0000
+#define SVSB_RUNCONFIG_DEFAULT         0x80000000
+
+/* svs bank related setting */
+#define BITS8                          8
+#define MAX_OPP_ENTRIES                        16
+#define REG_BYTES                      4
+#define SVSB_DC_SIGNED_BIT             BIT(15)
+#define SVSB_DET_CLK_EN                        BIT(31)
+#define SVSB_TEMP_LOWER_BOUND          0xb2
+#define SVSB_TEMP_UPPER_BOUND          0x64
+
+static DEFINE_SPINLOCK(svs_lock);
+
+#define debug_fops_ro(name)                                            \
+       static int svs_##name##_debug_open(struct inode *inode,         \
+                                          struct file *filp)           \
+       {                                                               \
+               return single_open(filp, svs_##name##_debug_show,       \
+                                  inode->i_private);                   \
+       }                                                               \
+       static const struct file_operations svs_##name##_debug_fops = { \
+               .owner = THIS_MODULE,                                   \
+               .open = svs_##name##_debug_open,                        \
+               .read = seq_read,                                       \
+               .llseek = seq_lseek,                                    \
+               .release = single_release,                              \
+       }
+
+#define debug_fops_rw(name)                                            \
+       static int svs_##name##_debug_open(struct inode *inode,         \
+                                          struct file *filp)           \
+       {                                                               \
+               return single_open(filp, svs_##name##_debug_show,       \
+                                  inode->i_private);                   \
+       }                                                               \
+       static const struct file_operations svs_##name##_debug_fops = { \
+               .owner = THIS_MODULE,                                   \
+               .open = svs_##name##_debug_open,                        \
+               .read = seq_read,                                       \
+               .write = svs_##name##_debug_write,                      \
+               .llseek = seq_lseek,                                    \
+               .release = single_release,                              \
+       }
+
+#define svs_dentry_data(name)  {__stringify(name), &svs_##name##_debug_fops}
+
+/**
+ * enum svsb_phase - svs bank phase enumeration
+ * @SVSB_PHASE_ERROR: svs bank encounters unexpected condition
+ * @SVSB_PHASE_INIT01: svs bank basic init for data calibration
+ * @SVSB_PHASE_INIT02: svs bank can provide voltages to opp table
+ * @SVSB_PHASE_MON: svs bank can provide voltages with thermal effect
+ * @SVSB_PHASE_MAX: total number of svs bank phase (debug purpose)
+ *
+ * Each svs bank has its own independent phase and we enable each svs bank by
+ * running their phase orderly. However, when svs bank encounters unexpected
+ * condition, it will fire an irq (PHASE_ERROR) to inform svs software.
+ *
+ * svs bank general phase-enabled order:
+ * SVSB_PHASE_INIT01 -> SVSB_PHASE_INIT02 -> SVSB_PHASE_MON
+ */
+enum svsb_phase {
+       SVSB_PHASE_ERROR = 0,
+       SVSB_PHASE_INIT01,
+       SVSB_PHASE_INIT02,
+       SVSB_PHASE_MON,
+       SVSB_PHASE_MAX,
+};
+
+enum svs_reg_index {
+       DESCHAR = 0,
+       TEMPCHAR,
+       DETCHAR,
+       AGECHAR,
+       DCCONFIG,
+       AGECONFIG,
+       FREQPCT30,
+       FREQPCT74,
+       LIMITVALS,
+       VBOOT,
+       DETWINDOW,
+       CONFIG,
+       TSCALCS,
+       RUNCONFIG,
+       SVSEN,
+       INIT2VALS,
+       DCVALUES,
+       AGEVALUES,
+       VOP30,
+       VOP74,
+       TEMP,
+       INTSTS,
+       INTSTSRAW,
+       INTEN,
+       CHKINT,
+       CHKSHIFT,
+       STATUS,
+       VDESIGN30,
+       VDESIGN74,
+       DVT30,
+       DVT74,
+       AGECOUNT,
+       SMSTATE0,
+       SMSTATE1,
+       CTL0,
+       DESDETSEC,
+       TEMPAGESEC,
+       CTRLSPARE0,
+       CTRLSPARE1,
+       CTRLSPARE2,
+       CTRLSPARE3,
+       CORESEL,
+       THERMINTST,
+       INTST,
+       THSTAGE0ST,
+       THSTAGE1ST,
+       THSTAGE2ST,
+       THAHBST0,
+       THAHBST1,
+       SPARE0,
+       SPARE1,
+       SPARE2,
+       SPARE3,
+       THSLPEVEB,
+       SVS_REG_MAX,
+};
+
+static const u32 svs_regs_v2[] = {
+       [DESCHAR]               = 0xc00,
+       [TEMPCHAR]              = 0xc04,
+       [DETCHAR]               = 0xc08,
+       [AGECHAR]               = 0xc0c,
+       [DCCONFIG]              = 0xc10,
+       [AGECONFIG]             = 0xc14,
+       [FREQPCT30]             = 0xc18,
+       [FREQPCT74]             = 0xc1c,
+       [LIMITVALS]             = 0xc20,
+       [VBOOT]                 = 0xc24,
+       [DETWINDOW]             = 0xc28,
+       [CONFIG]                = 0xc2c,
+       [TSCALCS]               = 0xc30,
+       [RUNCONFIG]             = 0xc34,
+       [SVSEN]                 = 0xc38,
+       [INIT2VALS]             = 0xc3c,
+       [DCVALUES]              = 0xc40,
+       [AGEVALUES]             = 0xc44,
+       [VOP30]                 = 0xc48,
+       [VOP74]                 = 0xc4c,
+       [TEMP]                  = 0xc50,
+       [INTSTS]                = 0xc54,
+       [INTSTSRAW]             = 0xc58,
+       [INTEN]                 = 0xc5c,
+       [CHKINT]                = 0xc60,
+       [CHKSHIFT]              = 0xc64,
+       [STATUS]                = 0xc68,
+       [VDESIGN30]             = 0xc6c,
+       [VDESIGN74]             = 0xc70,
+       [DVT30]                 = 0xc74,
+       [DVT74]                 = 0xc78,
+       [AGECOUNT]              = 0xc7c,
+       [SMSTATE0]              = 0xc80,
+       [SMSTATE1]              = 0xc84,
+       [CTL0]                  = 0xc88,
+       [DESDETSEC]             = 0xce0,
+       [TEMPAGESEC]            = 0xce4,
+       [CTRLSPARE0]            = 0xcf0,
+       [CTRLSPARE1]            = 0xcf4,
+       [CTRLSPARE2]            = 0xcf8,
+       [CTRLSPARE3]            = 0xcfc,
+       [CORESEL]               = 0xf00,
+       [THERMINTST]            = 0xf04,
+       [INTST]                 = 0xf08,
+       [THSTAGE0ST]            = 0xf0c,
+       [THSTAGE1ST]            = 0xf10,
+       [THSTAGE2ST]            = 0xf14,
+       [THAHBST0]              = 0xf18,
+       [THAHBST1]              = 0xf1c,
+       [SPARE0]                = 0xf20,
+       [SPARE1]                = 0xf24,
+       [SPARE2]                = 0xf28,
+       [SPARE3]                = 0xf2c,
+       [THSLPEVEB]             = 0xf30,
+};
+
+/**
+ * struct svs_platform - svs platform control
+ * @name: svs platform name
+ * @base: svs platform register base
+ * @dev: svs platform device
+ * @main_clk: main clock for svs bank
+ * @pbank: svs bank pointer needing to be protected by spin_lock section
+ * @banks: svs banks that svs platform supports
+ * @rst: svs platform reset control
+ * @efuse_parsing: svs platform efuse parsing function pointer
+ * @probe: svs platform probe function pointer
+ * @irqflags: svs platform irq settings flags
+ * @efuse_max: total number of svs efuse
+ * @tefuse_max: total number of thermal efuse
+ * @regs: svs platform registers map
+ * @bank_max: total number of svs banks
+ * @efuse: svs efuse data received from NVMEM framework
+ * @tefuse: thermal efuse data received from NVMEM framework
+ */
+struct svs_platform {
+       char *name;
+       void __iomem *base;
+       struct device *dev;
+       struct clk *main_clk;
+       struct svs_bank *pbank;
+       struct svs_bank *banks;
+       struct reset_control *rst;
+       bool (*efuse_parsing)(struct svs_platform *svsp);
+       int (*probe)(struct svs_platform *svsp);
+       unsigned long irqflags;
+       size_t efuse_max;
+       size_t tefuse_max;
+       const u32 *regs;
+       u32 bank_max;
+       u32 *efuse;
+       u32 *tefuse;
+};
+
+struct svs_platform_data {
+       char *name;
+       struct svs_bank *banks;
+       bool (*efuse_parsing)(struct svs_platform *svsp);
+       int (*probe)(struct svs_platform *svsp);
+       unsigned long irqflags;
+       const u32 *regs;
+       u32 bank_max;
+};
+
+/**
+ * struct svs_bank - svs bank representation
+ * @dev: bank device
+ * @opp_dev: device for opp table/buck control
+ * @init_completion: the timeout completion for bank init
+ * @buck: regulator used by opp_dev
+ * @tzd: thermal zone device for getting temperature
+ * @lock: mutex lock to protect voltage update process
+ * @set_freq_pct: function pointer to set bank frequency percent table
+ * @get_volts: function pointer to get bank voltages
+ * @name: bank name
+ * @buck_name: regulator name
+ * @tzone_name: thermal zone name
+ * @phase: bank current phase
+ * @volt_od: bank voltage overdrive
+ * @reg_data: bank register data in different phase for debug purpose
+ * @pm_runtime_enabled_count: bank pm runtime enabled count
+ * @mode_support: bank mode support.
+ * @freq_base: reference frequency for bank init
+ * @turn_freq_base: refenrece frequency for 2-line turn point
+ * @vboot: voltage request for bank init01 only
+ * @opp_dfreq: default opp frequency table
+ * @opp_dvolt: default opp voltage table
+ * @freq_pct: frequency percent table for bank init
+ * @volt: bank voltage table
+ * @volt_step: bank voltage step
+ * @volt_base: bank voltage base
+ * @volt_flags: bank voltage flags
+ * @vmax: bank voltage maximum
+ * @vmin: bank voltage minimum
+ * @age_config: bank age configuration
+ * @age_voffset_in: bank age voltage offset
+ * @dc_config: bank dc configuration
+ * @dc_voffset_in: bank dc voltage offset
+ * @dvt_fixed: bank dvt fixed value
+ * @vco: bank VCO value
+ * @chk_shift: bank chicken shift
+ * @core_sel: bank selection
+ * @opp_count: bank opp count
+ * @int_st: bank interrupt identification
+ * @sw_id: bank software identification
+ * @cpu_id: cpu core id for SVS CPU bank use only
+ * @ctl0: TS-x selection
+ * @temp: bank temperature
+ * @tzone_htemp: thermal zone high temperature threshold
+ * @tzone_htemp_voffset: thermal zone high temperature voltage offset
+ * @tzone_ltemp: thermal zone low temperature threshold
+ * @tzone_ltemp_voffset: thermal zone low temperature voltage offset
+ * @bts: svs efuse data
+ * @mts: svs efuse data
+ * @bdes: svs efuse data
+ * @mdes: svs efuse data
+ * @mtdes: svs efuse data
+ * @dcbdet: svs efuse data
+ * @dcmdet: svs efuse data
+ * @turn_pt: 2-line turn point tells which opp_volt calculated by high/low bank
+ * @type: bank type to represent it is 2-line (high/low) bank or 1-line bank
+ *
+ * Svs bank will generate suitalbe voltages by below general math equation
+ * and provide these voltages to opp voltage table.
+ *
+ * opp_volt[i] = (volt[i] * volt_step) + volt_base;
+ */
+struct svs_bank {
+       struct device *dev;
+       struct device *opp_dev;
+       struct completion init_completion;
+       struct regulator *buck;
+       struct thermal_zone_device *tzd;
+       struct mutex lock;      /* lock to protect voltage update process */
+       void (*set_freq_pct)(struct svs_platform *svsp);
+       void (*get_volts)(struct svs_platform *svsp);
+       char *name;
+       char *buck_name;
+       char *tzone_name;
+       enum svsb_phase phase;
+       s32 volt_od;
+       u32 reg_data[SVSB_PHASE_MAX][SVS_REG_MAX];
+       u32 pm_runtime_enabled_count;
+       u32 mode_support;
+       u32 freq_base;
+       u32 turn_freq_base;
+       u32 vboot;
+       u32 opp_dfreq[MAX_OPP_ENTRIES];
+       u32 opp_dvolt[MAX_OPP_ENTRIES];
+       u32 freq_pct[MAX_OPP_ENTRIES];
+       u32 volt[MAX_OPP_ENTRIES];
+       u32 volt_step;
+       u32 volt_base;
+       u32 volt_flags;
+       u32 vmax;
+       u32 vmin;
+       u32 age_config;
+       u32 age_voffset_in;
+       u32 dc_config;
+       u32 dc_voffset_in;
+       u32 dvt_fixed;
+       u32 vco;
+       u32 chk_shift;
+       u32 core_sel;
+       u32 opp_count;
+       u32 int_st;
+       u32 sw_id;
+       u32 cpu_id;
+       u32 ctl0;
+       u32 temp;
+       u32 tzone_htemp;
+       u32 tzone_htemp_voffset;
+       u32 tzone_ltemp;
+       u32 tzone_ltemp_voffset;
+       u32 bts;
+       u32 mts;
+       u32 bdes;
+       u32 mdes;
+       u32 mtdes;
+       u32 dcbdet;
+       u32 dcmdet;
+       u32 turn_pt;
+       u32 type;
+};
+
+static u32 percent(u32 numerator, u32 denominator)
+{
+       /* If not divide 1000, "numerator * 100" will have data overflow. */
+       numerator /= 1000;
+       denominator /= 1000;
+
+       return DIV_ROUND_UP(numerator * 100, denominator);
+}
+
+static u32 svs_readl_relaxed(struct svs_platform *svsp, enum svs_reg_index rg_i)
+{
+       return readl_relaxed(svsp->base + svsp->regs[rg_i]);
+}
+
+static void svs_writel_relaxed(struct svs_platform *svsp, u32 val,
+                              enum svs_reg_index rg_i)
+{
+       writel_relaxed(val, svsp->base + svsp->regs[rg_i]);
+}
+
+static void svs_switch_bank(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+
+       svs_writel_relaxed(svsp, svsb->core_sel, CORESEL);
+}
+
+static u32 svs_bank_volt_to_opp_volt(u32 svsb_volt, u32 svsb_volt_step,
+                                    u32 svsb_volt_base)
+{
+       return (svsb_volt * svsb_volt_step) + svsb_volt_base;
+}
+
+static u32 svs_opp_volt_to_bank_volt(u32 opp_u_volt, u32 svsb_volt_step,
+                                    u32 svsb_volt_base)
+{
+       return (opp_u_volt - svsb_volt_base) / svsb_volt_step;
+}
+
+static int svs_sync_bank_volts_from_opp(struct svs_bank *svsb)
+{
+       struct dev_pm_opp *opp;
+       u32 i, opp_u_volt;
+
+       for (i = 0; i < svsb->opp_count; i++) {
+               opp = dev_pm_opp_find_freq_exact(svsb->opp_dev,
+                                                svsb->opp_dfreq[i],
+                                                true);
+               if (IS_ERR(opp)) {
+                       dev_err(svsb->dev, "cannot find freq = %u (%ld)\n",
+                               svsb->opp_dfreq[i], PTR_ERR(opp));
+                       return PTR_ERR(opp);
+               }
+
+               opp_u_volt = dev_pm_opp_get_voltage(opp);
+               svsb->volt[i] = svs_opp_volt_to_bank_volt(opp_u_volt,
+                                                         svsb->volt_step,
+                                                         svsb->volt_base);
+               dev_pm_opp_put(opp);
+       }
+
+       return 0;
+}
+
+static int svs_adjust_pm_opp_volts(struct svs_bank *svsb)
+{
+       int ret = -EPERM, tzone_temp = 0;
+       u32 i, svsb_volt, opp_volt, temp_voffset = 0, opp_start, opp_stop;
+
+       mutex_lock(&svsb->lock);
+
+       /*
+        * 2-line bank updates its corresponding opp volts.
+        * 1-line bank updates all opp volts.
+        */
+       if (svsb->type == SVSB_HIGH) {
+               opp_start = 0;
+               opp_stop = svsb->turn_pt;
+       } else if (svsb->type == SVSB_LOW) {
+               opp_start = svsb->turn_pt;
+               opp_stop = svsb->opp_count;
+       } else {
+               opp_start = 0;
+               opp_stop = svsb->opp_count;
+       }
+
+       /* Get thermal effect */
+       if (svsb->phase == SVSB_PHASE_MON) {
+               ret = thermal_zone_get_temp(svsb->tzd, &tzone_temp);
+               if (ret || (svsb->temp > SVSB_TEMP_UPPER_BOUND &&
+                           svsb->temp < SVSB_TEMP_LOWER_BOUND)) {
+                       dev_err(svsb->dev, "%s: %d (0x%x), run default volts\n",
+                               svsb->tzone_name, ret, svsb->temp);
+                       svsb->phase = SVSB_PHASE_ERROR;
+               }
+
+               if (tzone_temp >= svsb->tzone_htemp)
+                       temp_voffset += svsb->tzone_htemp_voffset;
+               else if (tzone_temp <= svsb->tzone_ltemp)
+                       temp_voffset += svsb->tzone_ltemp_voffset;
+
+               /* 2-line bank update all opp volts when running mon mode */
+               if (svsb->type == SVSB_HIGH || svsb->type == SVSB_LOW) {
+                       opp_start = 0;
+                       opp_stop = svsb->opp_count;
+               }
+       }
+
+       /* vmin <= svsb_volt (opp_volt) <= default opp voltage */
+       for (i = opp_start; i < opp_stop; i++) {
+               switch (svsb->phase) {
+               case SVSB_PHASE_ERROR:
+                       opp_volt = svsb->opp_dvolt[i];
+                       break;
+               case SVSB_PHASE_INIT01:
+                       /* do nothing */
+                       goto unlock_mutex;
+               case SVSB_PHASE_INIT02:
+                       svsb_volt = max(svsb->volt[i], svsb->vmin);
+                       opp_volt = svs_bank_volt_to_opp_volt(svsb_volt,
+                                                            svsb->volt_step,
+                                                            svsb->volt_base);
+                       break;
+               case SVSB_PHASE_MON:
+                       svsb_volt = max(svsb->volt[i] + temp_voffset, svsb->vmin);
+                       opp_volt = svs_bank_volt_to_opp_volt(svsb_volt,
+                                                            svsb->volt_step,
+                                                            svsb->volt_base);
+                       break;
+               default:
+                       dev_err(svsb->dev, "unknown phase: %u\n", svsb->phase);
+                       ret = -EINVAL;
+                       goto unlock_mutex;
+               }
+
+               opp_volt = min(opp_volt, svsb->opp_dvolt[i]);
+               ret = dev_pm_opp_adjust_voltage(svsb->opp_dev,
+                                               svsb->opp_dfreq[i],
+                                               opp_volt, opp_volt,
+                                               svsb->opp_dvolt[i]);
+               if (ret) {
+                       dev_err(svsb->dev, "set %uuV fail: %d\n",
+                               opp_volt, ret);
+                       goto unlock_mutex;
+               }
+       }
+
+unlock_mutex:
+       mutex_unlock(&svsb->lock);
+
+       return ret;
+}
+
+static int svs_dump_debug_show(struct seq_file *m, void *p)
+{
+       struct svs_platform *svsp = (struct svs_platform *)m->private;
+       struct svs_bank *svsb;
+       unsigned long svs_reg_addr;
+       u32 idx, i, j, bank_id;
+
+       for (i = 0; i < svsp->efuse_max; i++)
+               if (svsp->efuse && svsp->efuse[i])
+                       seq_printf(m, "M_HW_RES%d = 0x%08x\n",
+                                  i, svsp->efuse[i]);
+
+       for (i = 0; i < svsp->tefuse_max; i++)
+               if (svsp->tefuse)
+                       seq_printf(m, "THERMAL_EFUSE%d = 0x%08x\n",
+                                  i, svsp->tefuse[i]);
+
+       for (bank_id = 0, idx = 0; idx < svsp->bank_max; idx++, bank_id++) {
+               svsb = &svsp->banks[idx];
+
+               for (i = SVSB_PHASE_INIT01; i <= SVSB_PHASE_MON; i++) {
+                       seq_printf(m, "Bank_number = %u\n", bank_id);
+
+                       if (i == SVSB_PHASE_INIT01 || i == SVSB_PHASE_INIT02)
+                               seq_printf(m, "mode = init%d\n", i);
+                       else if (i == SVSB_PHASE_MON)
+                               seq_puts(m, "mode = mon\n");
+                       else
+                               seq_puts(m, "mode = error\n");
+
+                       for (j = DESCHAR; j < SVS_REG_MAX; j++) {
+                               svs_reg_addr = (unsigned long)(svsp->base +
+                                                              svsp->regs[j]);
+                               seq_printf(m, "0x%08lx = 0x%08x\n",
+                                          svs_reg_addr, svsb->reg_data[i][j]);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+debug_fops_ro(dump);
+
+static int svs_enable_debug_show(struct seq_file *m, void *v)
+{
+       struct svs_bank *svsb = (struct svs_bank *)m->private;
+
+       switch (svsb->phase) {
+       case SVSB_PHASE_ERROR:
+               seq_puts(m, "disabled\n");
+               break;
+       case SVSB_PHASE_INIT01:
+               seq_puts(m, "init1\n");
+               break;
+       case SVSB_PHASE_INIT02:
+               seq_puts(m, "init2\n");
+               break;
+       case SVSB_PHASE_MON:
+               seq_puts(m, "mon mode\n");
+               break;
+       default:
+               seq_puts(m, "unknown\n");
+               break;
+       }
+
+       return 0;
+}
+
+static ssize_t svs_enable_debug_write(struct file *filp,
+                                     const char __user *buffer,
+                                     size_t count, loff_t *pos)
+{
+       struct svs_bank *svsb = file_inode(filp)->i_private;
+       struct svs_platform *svsp = dev_get_drvdata(svsb->dev);
+       unsigned long flags;
+       int enabled, ret;
+       char *buf = NULL;
+
+       if (count >= PAGE_SIZE)
+               return -EINVAL;
+
+       buf = (char *)memdup_user_nul(buffer, count);
+       if (IS_ERR(buf))
+               return PTR_ERR(buf);
+
+       ret = kstrtoint(buf, 10, &enabled);
+       if (ret)
+               return ret;
+
+       if (!enabled) {
+               spin_lock_irqsave(&svs_lock, flags);
+               svsp->pbank = svsb;
+               svsb->mode_support = SVSB_MODE_ALL_DISABLE;
+               svs_switch_bank(svsp);
+               svs_writel_relaxed(svsp, SVSB_EN_OFF, SVSEN);
+               svs_writel_relaxed(svsp, SVSB_INTSTS_CLEAN, INTSTS);
+               spin_unlock_irqrestore(&svs_lock, flags);
+
+               svsb->phase = SVSB_PHASE_ERROR;
+               svs_adjust_pm_opp_volts(svsb);
+       }
+
+       kfree(buf);
+
+       return count;
+}
+
+debug_fops_rw(enable);
+
+static int svs_status_debug_show(struct seq_file *m, void *v)
+{
+       struct svs_bank *svsb = (struct svs_bank *)m->private;
+       struct dev_pm_opp *opp;
+       int tzone_temp = 0, ret;
+       u32 i;
+
+       ret = thermal_zone_get_temp(svsb->tzd, &tzone_temp);
+       if (ret)
+               seq_printf(m, "%s: temperature ignore, turn_pt = %u\n",
+                          svsb->name, svsb->turn_pt);
+       else
+               seq_printf(m, "%s: temperature = %d, turn_pt = %u\n",
+                          svsb->name, tzone_temp, svsb->turn_pt);
+
+       for (i = 0; i < svsb->opp_count; i++) {
+               opp = dev_pm_opp_find_freq_exact(svsb->opp_dev,
+                                                svsb->opp_dfreq[i], true);
+               if (IS_ERR(opp)) {
+                       seq_printf(m, "%s: cannot find freq = %u (%ld)\n",
+                                  svsb->name, svsb->opp_dfreq[i],
+                                  PTR_ERR(opp));
+                       return PTR_ERR(opp);
+               }
+
+               seq_printf(m, "opp_freq[%02u]: %u, opp_volt[%02u]: %lu, ",
+                          i, svsb->opp_dfreq[i], i,
+                          dev_pm_opp_get_voltage(opp));
+               seq_printf(m, "svsb_volt[%02u]: 0x%x, freq_pct[%02u]: %u\n",
+                          i, svsb->volt[i], i, svsb->freq_pct[i]);
+               dev_pm_opp_put(opp);
+       }
+
+       return 0;
+}
+
+debug_fops_ro(status);
+
+static int svs_create_debug_cmds(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       struct dentry *svs_dir, *svsb_dir, *file_entry;
+       const char *d = "/sys/kernel/debug/svs";
+       u32 i, idx;
+
+       struct svs_dentry {
+               const char *name;
+               const struct file_operations *fops;
+       };
+
+       struct svs_dentry svs_entries[] = {
+               svs_dentry_data(dump),
+       };
+
+       struct svs_dentry svsb_entries[] = {
+               svs_dentry_data(enable),
+               svs_dentry_data(status),
+       };
+
+       svs_dir = debugfs_create_dir("svs", NULL);
+       if (IS_ERR(svs_dir)) {
+               dev_err(svsp->dev, "cannot create %s: %ld\n",
+                       d, PTR_ERR(svs_dir));
+               return PTR_ERR(svs_dir);
+       }
+
+       for (i = 0; i < ARRAY_SIZE(svs_entries); i++) {
+               file_entry = debugfs_create_file(svs_entries[i].name, 0664,
+                                                svs_dir, svsp,
+                                                svs_entries[i].fops);
+               if (IS_ERR(file_entry)) {
+                       dev_err(svsp->dev, "cannot create %s/%s: %ld\n",
+                               d, svs_entries[i].name, PTR_ERR(file_entry));
+                       return PTR_ERR(file_entry);
+               }
+       }
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (svsb->mode_support == SVSB_MODE_ALL_DISABLE)
+                       continue;
+
+               svsb_dir = debugfs_create_dir(svsb->name, svs_dir);
+               if (IS_ERR(svsb_dir)) {
+                       dev_err(svsp->dev, "cannot create %s/%s: %ld\n",
+                               d, svsb->name, PTR_ERR(svsb_dir));
+                       return PTR_ERR(svsb_dir);
+               }
+
+               for (i = 0; i < ARRAY_SIZE(svsb_entries); i++) {
+                       file_entry = debugfs_create_file(svsb_entries[i].name,
+                                                        0664, svsb_dir, svsb,
+                                                        svsb_entries[i].fops);
+                       if (IS_ERR(file_entry)) {
+                               dev_err(svsp->dev, "no %s/%s/%s?: %ld\n",
+                                       d, svsb->name, svsb_entries[i].name,
+                                       PTR_ERR(file_entry));
+                               return PTR_ERR(file_entry);
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static u32 interpolate(u32 f0, u32 f1, u32 v0, u32 v1, u32 fx)
+{
+       u32 vx;
+
+       if (v0 == v1 || f0 == f1)
+               return v0;
+
+       /* *100 to have decimal fraction factor */
+       vx = (v0 * 100) - ((((v0 - v1) * 100) / (f0 - f1)) * (f0 - fx));
+
+       return DIV_ROUND_UP(vx, 100);
+}
+
+static void svs_get_bank_volts_v3(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+       u32 i, j, *vop, vop74, vop30, turn_pt = svsb->turn_pt;
+       u32 b_sft, shift_byte = 0, opp_start = 0, opp_stop = 0;
+       u32 middle_index = (svsb->opp_count / 2);
+
+       if (svsb->phase == SVSB_PHASE_MON &&
+           svsb->volt_flags & SVSB_MON_VOLT_IGNORE)
+               return;
+
+       vop74 = svs_readl_relaxed(svsp, VOP74);
+       vop30 = svs_readl_relaxed(svsp, VOP30);
+
+       /* Target is to set svsb->volt[] by algorithm */
+       if (turn_pt < middle_index) {
+               if (svsb->type == SVSB_HIGH) {
+                       /* volt[0] ~ volt[turn_pt - 1] */
+                       for (i = 0; i < turn_pt; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               vop = (shift_byte < REG_BYTES) ? &vop30 :
+                                                                &vop74;
+                               svsb->volt[i] = (*vop >> b_sft) & GENMASK(7, 0);
+                               shift_byte++;
+                       }
+               } else if (svsb->type == SVSB_LOW) {
+                       /* volt[turn_pt] + volt[j] ~ volt[opp_count - 1] */
+                       j = svsb->opp_count - 7;
+                       svsb->volt[turn_pt] = vop30 & GENMASK(7, 0);
+                       shift_byte++;
+                       for (i = j; i < svsb->opp_count; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               vop = (shift_byte < REG_BYTES) ? &vop30 :
+                                                                &vop74;
+                               svsb->volt[i] = (*vop >> b_sft) & GENMASK(7, 0);
+                               shift_byte++;
+                       }
+
+                       /* volt[turn_pt + 1] ~ volt[j - 1] by interpolate */
+                       for (i = turn_pt + 1; i < j; i++)
+                               svsb->volt[i] = interpolate(svsb->freq_pct[turn_pt],
+                                                           svsb->freq_pct[j],
+                                                           svsb->volt[turn_pt],
+                                                           svsb->volt[j],
+                                                           svsb->freq_pct[i]);
+               }
+       } else {
+               if (svsb->type == SVSB_HIGH) {
+                       /* volt[0] + volt[j] ~ volt[turn_pt - 1] */
+                       j = turn_pt - 7;
+                       svsb->volt[0] = vop30 & GENMASK(7, 0);
+                       shift_byte++;
+                       for (i = j; i < turn_pt; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               vop = (shift_byte < REG_BYTES) ? &vop30 :
+                                                                &vop74;
+                               svsb->volt[i] = (*vop >> b_sft) & GENMASK(7, 0);
+                               shift_byte++;
+                       }
+
+                       /* volt[1] ~ volt[j - 1] by interpolate */
+                       for (i = 1; i < j; i++)
+                               svsb->volt[i] = interpolate(svsb->freq_pct[0],
+                                                           svsb->freq_pct[j],
+                                                           svsb->volt[0],
+                                                           svsb->volt[j],
+                                                           svsb->freq_pct[i]);
+               } else if (svsb->type == SVSB_LOW) {
+                       /* volt[turn_pt] ~ volt[opp_count - 1] */
+                       for (i = turn_pt; i < svsb->opp_count; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               vop = (shift_byte < REG_BYTES) ? &vop30 :
+                                                                &vop74;
+                               svsb->volt[i] = (*vop >> b_sft) & GENMASK(7, 0);
+                               shift_byte++;
+                       }
+               }
+       }
+
+       if (svsb->type == SVSB_HIGH) {
+               opp_start = 0;
+               opp_stop = svsb->turn_pt;
+       } else if (svsb->type == SVSB_LOW) {
+               opp_start = svsb->turn_pt;
+               opp_stop = svsb->opp_count;
+       }
+
+       for (i = opp_start; i < opp_stop; i++)
+               if (svsb->volt_flags & SVSB_REMOVE_DVTFIXED_VOLT)
+                       svsb->volt[i] -= svsb->dvt_fixed;
+}
+
+static void svs_set_bank_freq_pct_v3(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+       u32 i, j, *freq_pct, freq_pct74 = 0, freq_pct30 = 0;
+       u32 b_sft, shift_byte = 0, turn_pt;
+       u32 middle_index = (svsb->opp_count / 2);
+
+       for (i = 0; i < svsb->opp_count; i++) {
+               if (svsb->opp_dfreq[i] <= svsb->turn_freq_base) {
+                       svsb->turn_pt = i;
+                       break;
+               }
+       }
+
+       turn_pt = svsb->turn_pt;
+
+       /* Target is to fill out freq_pct74 / freq_pct30 by algorithm */
+       if (turn_pt < middle_index) {
+               if (svsb->type == SVSB_HIGH) {
+                       /*
+                        * If we don't handle this situation,
+                        * SVSB_HIGH's FREQPCT74 / FREQPCT30 would keep "0"
+                        * and this leads SVSB_LOW to work abnormally.
+                        */
+                       if (turn_pt == 0)
+                               freq_pct30 = svsb->freq_pct[0];
+
+                       /* freq_pct[0] ~ freq_pct[turn_pt - 1] */
+                       for (i = 0; i < turn_pt; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               freq_pct = (shift_byte < REG_BYTES) ?
+                                          &freq_pct30 : &freq_pct74;
+                               *freq_pct |= (svsb->freq_pct[i] << b_sft);
+                               shift_byte++;
+                       }
+               } else if (svsb->type == SVSB_LOW) {
+                       /*
+                        * freq_pct[turn_pt] +
+                        * freq_pct[opp_count - 7] ~ freq_pct[opp_count -1]
+                        */
+                       freq_pct30 = svsb->freq_pct[turn_pt];
+                       shift_byte++;
+                       j = svsb->opp_count - 7;
+                       for (i = j; i < svsb->opp_count; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               freq_pct = (shift_byte < REG_BYTES) ?
+                                          &freq_pct30 : &freq_pct74;
+                               *freq_pct |= (svsb->freq_pct[i] << b_sft);
+                               shift_byte++;
+                       }
+               }
+       } else {
+               if (svsb->type == SVSB_HIGH) {
+                       /*
+                        * freq_pct[0] +
+                        * freq_pct[turn_pt - 7] ~ freq_pct[turn_pt - 1]
+                        */
+                       freq_pct30 = svsb->freq_pct[0];
+                       shift_byte++;
+                       j = turn_pt - 7;
+                       for (i = j; i < turn_pt; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               freq_pct = (shift_byte < REG_BYTES) ?
+                                          &freq_pct30 : &freq_pct74;
+                               *freq_pct |= (svsb->freq_pct[i] << b_sft);
+                               shift_byte++;
+                       }
+               } else if (svsb->type == SVSB_LOW) {
+                       /* freq_pct[turn_pt] ~ freq_pct[opp_count - 1] */
+                       for (i = turn_pt; i < svsb->opp_count; i++) {
+                               b_sft = BITS8 * (shift_byte % REG_BYTES);
+                               freq_pct = (shift_byte < REG_BYTES) ?
+                                          &freq_pct30 : &freq_pct74;
+                               *freq_pct |= (svsb->freq_pct[i] << b_sft);
+                               shift_byte++;
+                       }
+               }
+       }
+
+       svs_writel_relaxed(svsp, freq_pct74, FREQPCT74);
+       svs_writel_relaxed(svsp, freq_pct30, FREQPCT30);
+}
+
+static void svs_get_bank_volts_v2(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+       u32 temp, i;
+
+       temp = svs_readl_relaxed(svsp, VOP74);
+       svsb->volt[14] = (temp >> 24) & GENMASK(7, 0);
+       svsb->volt[12] = (temp >> 16) & GENMASK(7, 0);
+       svsb->volt[10] = (temp >> 8)  & GENMASK(7, 0);
+       svsb->volt[8] = (temp & GENMASK(7, 0));
+
+       temp = svs_readl_relaxed(svsp, VOP30);
+       svsb->volt[6] = (temp >> 24) & GENMASK(7, 0);
+       svsb->volt[4] = (temp >> 16) & GENMASK(7, 0);
+       svsb->volt[2] = (temp >> 8)  & GENMASK(7, 0);
+       svsb->volt[0] = (temp & GENMASK(7, 0));
+
+       for (i = 0; i <= 12; i += 2)
+               svsb->volt[i + 1] = interpolate(svsb->freq_pct[i],
+                                               svsb->freq_pct[i + 2],
+                                               svsb->volt[i],
+                                               svsb->volt[i + 2],
+                                               svsb->freq_pct[i + 1]);
+
+       svsb->volt[15] = interpolate(svsb->freq_pct[12],
+                                    svsb->freq_pct[14],
+                                    svsb->volt[12],
+                                    svsb->volt[14],
+                                    svsb->freq_pct[15]);
+
+       for (i = 0; i < svsb->opp_count; i++)
+               svsb->volt[i] += svsb->volt_od;
+}
+
+static void svs_set_bank_freq_pct_v2(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+
+       svs_writel_relaxed(svsp,
+                          (svsb->freq_pct[14] << 24) |
+                          (svsb->freq_pct[12] << 16) |
+                          (svsb->freq_pct[10] << 8) |
+                          svsb->freq_pct[8],
+                          FREQPCT74);
+
+       svs_writel_relaxed(svsp,
+                          (svsb->freq_pct[6] << 24) |
+                          (svsb->freq_pct[4] << 16) |
+                          (svsb->freq_pct[2] << 8) |
+                          svsb->freq_pct[0],
+                          FREQPCT30);
+}
+
+static void svs_set_bank_phase(struct svs_platform *svsp,
+                              enum svsb_phase target_phase)
+{
+       struct svs_bank *svsb = svsp->pbank;
+       u32 des_char, temp_char, det_char, limit_vals, init2vals, ts_calcs;
+
+       svs_switch_bank(svsp);
+
+       des_char = (svsb->bdes << 8) | svsb->mdes;
+       svs_writel_relaxed(svsp, des_char, DESCHAR);
+
+       temp_char = (svsb->vco << 16) | (svsb->mtdes << 8) | svsb->dvt_fixed;
+       svs_writel_relaxed(svsp, temp_char, TEMPCHAR);
+
+       det_char = (svsb->dcbdet << 8) | svsb->dcmdet;
+       svs_writel_relaxed(svsp, det_char, DETCHAR);
+
+       svs_writel_relaxed(svsp, svsb->dc_config, DCCONFIG);
+       svs_writel_relaxed(svsp, svsb->age_config, AGECONFIG);
+       svs_writel_relaxed(svsp, SVSB_RUNCONFIG_DEFAULT, RUNCONFIG);
+
+       svsb->set_freq_pct(svsp);
+
+       limit_vals = (svsb->vmax << 24) | (svsb->vmin << 16) |
+                    (SVSB_DTHI << 8) | SVSB_DTLO;
+       svs_writel_relaxed(svsp, limit_vals, LIMITVALS);
+
+       svs_writel_relaxed(svsp, SVSB_DET_WINDOW, DETWINDOW);
+       svs_writel_relaxed(svsp, SVSB_DET_MAX, CONFIG);
+       svs_writel_relaxed(svsp, svsb->chk_shift, CHKSHIFT);
+       svs_writel_relaxed(svsp, svsb->ctl0, CTL0);
+       svs_writel_relaxed(svsp, SVSB_INTSTS_CLEAN, INTSTS);
+
+       switch (target_phase) {
+       case SVSB_PHASE_INIT01:
+               svs_writel_relaxed(svsp, svsb->vboot, VBOOT);
+               svs_writel_relaxed(svsp, SVSB_INTEN_INIT0x, INTEN);
+               svs_writel_relaxed(svsp, SVSB_EN_INIT01, SVSEN);
+               break;
+       case SVSB_PHASE_INIT02:
+               svs_writel_relaxed(svsp, SVSB_INTEN_INIT0x, INTEN);
+               init2vals = (svsb->age_voffset_in << 16) | svsb->dc_voffset_in;
+               svs_writel_relaxed(svsp, init2vals, INIT2VALS);
+               svs_writel_relaxed(svsp, SVSB_EN_INIT02, SVSEN);
+               break;
+       case SVSB_PHASE_MON:
+               ts_calcs = (svsb->bts << 12) | svsb->mts;
+               svs_writel_relaxed(svsp, ts_calcs, TSCALCS);
+               svs_writel_relaxed(svsp, SVSB_INTEN_MONVOPEN, INTEN);
+               svs_writel_relaxed(svsp, SVSB_EN_MON, SVSEN);
+               break;
+       default:
+               dev_err(svsb->dev, "requested unknown target phase: %u\n",
+                       target_phase);
+               break;
+       }
+}
+
+static inline void svs_save_bank_register_data(struct svs_platform *svsp,
+                                              enum svsb_phase phase)
+{
+       struct svs_bank *svsb = svsp->pbank;
+       enum svs_reg_index rg_i;
+
+       for (rg_i = DESCHAR; rg_i < SVS_REG_MAX; rg_i++)
+               svsb->reg_data[phase][rg_i] = svs_readl_relaxed(svsp, rg_i);
+}
+
+static inline void svs_error_isr_handler(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+
+       dev_err(svsb->dev, "%s: CORESEL = 0x%08x\n",
+               __func__, svs_readl_relaxed(svsp, CORESEL));
+       dev_err(svsb->dev, "SVSEN = 0x%08x, INTSTS = 0x%08x\n",
+               svs_readl_relaxed(svsp, SVSEN),
+               svs_readl_relaxed(svsp, INTSTS));
+       dev_err(svsb->dev, "SMSTATE0 = 0x%08x, SMSTATE1 = 0x%08x\n",
+               svs_readl_relaxed(svsp, SMSTATE0),
+               svs_readl_relaxed(svsp, SMSTATE1));
+       dev_err(svsb->dev, "TEMP = 0x%08x\n", svs_readl_relaxed(svsp, TEMP));
+
+       svs_save_bank_register_data(svsp, SVSB_PHASE_ERROR);
+
+       svsb->phase = SVSB_PHASE_ERROR;
+       svs_writel_relaxed(svsp, SVSB_EN_OFF, SVSEN);
+       svs_writel_relaxed(svsp, SVSB_INTSTS_CLEAN, INTSTS);
+}
+
+static inline void svs_init01_isr_handler(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+
+       dev_info(svsb->dev, "%s: VDN74~30:0x%08x~0x%08x, DC:0x%08x\n",
+                __func__, svs_readl_relaxed(svsp, VDESIGN74),
+                svs_readl_relaxed(svsp, VDESIGN30),
+                svs_readl_relaxed(svsp, DCVALUES));
+
+       svs_save_bank_register_data(svsp, SVSB_PHASE_INIT01);
+
+       svsb->phase = SVSB_PHASE_INIT01;
+       svsb->dc_voffset_in = ~(svs_readl_relaxed(svsp, DCVALUES) &
+                               GENMASK(15, 0)) + 1;
+       if (svsb->volt_flags & SVSB_INIT01_VOLT_IGNORE ||
+           (svsb->dc_voffset_in & SVSB_DC_SIGNED_BIT &&
+            svsb->volt_flags & SVSB_INIT01_VOLT_INC_ONLY))
+               svsb->dc_voffset_in = 0;
+
+       svsb->age_voffset_in = svs_readl_relaxed(svsp, AGEVALUES) &
+                              GENMASK(15, 0);
+
+       svs_writel_relaxed(svsp, SVSB_EN_OFF, SVSEN);
+       svs_writel_relaxed(svsp, SVSB_INTSTS_COMPLETE, INTSTS);
+       svsb->core_sel &= ~SVSB_DET_CLK_EN;
+}
+
+static inline void svs_init02_isr_handler(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+
+       dev_info(svsb->dev, "%s: VOP74~30:0x%08x~0x%08x, DC:0x%08x\n",
+                __func__, svs_readl_relaxed(svsp, VOP74),
+                svs_readl_relaxed(svsp, VOP30),
+                svs_readl_relaxed(svsp, DCVALUES));
+
+       svs_save_bank_register_data(svsp, SVSB_PHASE_INIT02);
+
+       svsb->phase = SVSB_PHASE_INIT02;
+       svsb->get_volts(svsp);
+
+       svs_writel_relaxed(svsp, SVSB_EN_OFF, SVSEN);
+       svs_writel_relaxed(svsp, SVSB_INTSTS_COMPLETE, INTSTS);
+}
+
+static inline void svs_mon_mode_isr_handler(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb = svsp->pbank;
+
+       svs_save_bank_register_data(svsp, SVSB_PHASE_MON);
+
+       svsb->phase = SVSB_PHASE_MON;
+       svsb->get_volts(svsp);
+
+       svsb->temp = svs_readl_relaxed(svsp, TEMP) & GENMASK(7, 0);
+       svs_writel_relaxed(svsp, SVSB_INTSTS_MONVOP, INTSTS);
+}
+
+static irqreturn_t svs_isr(int irq, void *data)
+{
+       struct svs_platform *svsp = data;
+       struct svs_bank *svsb = NULL;
+       unsigned long flags;
+       u32 idx, int_sts, svs_en;
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+               WARN(!svsb, "%s: svsb(%s) is null", __func__, svsb->name);
+
+               spin_lock_irqsave(&svs_lock, flags);
+               svsp->pbank = svsb;
+
+               /* Find out which svs bank fires interrupt */
+               if (svsb->int_st & svs_readl_relaxed(svsp, INTST)) {
+                       spin_unlock_irqrestore(&svs_lock, flags);
+                       continue;
+               }
+
+               svs_switch_bank(svsp);
+               int_sts = svs_readl_relaxed(svsp, INTSTS);
+               svs_en = svs_readl_relaxed(svsp, SVSEN);
+
+               if (int_sts == SVSB_INTSTS_COMPLETE &&
+                   svs_en == SVSB_EN_INIT01)
+                       svs_init01_isr_handler(svsp);
+               else if (int_sts == SVSB_INTSTS_COMPLETE &&
+                        svs_en == SVSB_EN_INIT02)
+                       svs_init02_isr_handler(svsp);
+               else if (int_sts & SVSB_INTSTS_MONVOP)
+                       svs_mon_mode_isr_handler(svsp);
+               else
+                       svs_error_isr_handler(svsp);
+
+               spin_unlock_irqrestore(&svs_lock, flags);
+               break;
+       }
+
+       svs_adjust_pm_opp_volts(svsb);
+
+       if (svsb->phase == SVSB_PHASE_INIT01 ||
+           svsb->phase == SVSB_PHASE_INIT02)
+               complete(&svsb->init_completion);
+
+       return IRQ_HANDLED;
+}
+
+static int svs_init01(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       unsigned long flags, time_left;
+       bool search_done;
+       int ret = 0, r;
+       u32 opp_freq, opp_vboot, buck_volt, idx, i;
+
+       /* Keep CPUs' core power on for svs_init01 initialization */
+       cpuidle_pause_and_lock();
+
+        /* Svs bank init01 preparation - power enable */
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_INIT01))
+                       continue;
+
+               ret = regulator_enable(svsb->buck);
+               if (ret) {
+                       dev_err(svsb->dev, "%s enable fail: %d\n",
+                               svsb->buck_name, ret);
+                       goto svs_init01_resume_cpuidle;
+               }
+
+               /* Some buck doesn't support mode change. Show fail msg only */
+               ret = regulator_set_mode(svsb->buck, REGULATOR_MODE_FAST);
+               if (ret)
+                       dev_notice(svsb->dev, "set fast mode fail: %d\n", ret);
+
+               if (svsb->volt_flags & SVSB_INIT01_PD_REQ) {
+                       if (!pm_runtime_enabled(svsb->opp_dev)) {
+                               pm_runtime_enable(svsb->opp_dev);
+                               svsb->pm_runtime_enabled_count++;
+                       }
+
+                       ret = pm_runtime_get_sync(svsb->opp_dev);
+                       if (ret < 0) {
+                               dev_err(svsb->dev, "mtcmos on fail: %d\n", ret);
+                               goto svs_init01_resume_cpuidle;
+                       }
+               }
+       }
+
+       /*
+        * Svs bank init01 preparation - vboot voltage adjustment
+        * Sometimes two svs banks use the same buck. Therefore,
+        * we have to set each svs bank to target voltage(vboot) first.
+        */
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_INIT01))
+                       continue;
+
+               /*
+                * Find the fastest freq that can be run at vboot and
+                * fix to that freq until svs_init01 is done.
+                */
+               search_done = false;
+               opp_vboot = svs_bank_volt_to_opp_volt(svsb->vboot,
+                                                     svsb->volt_step,
+                                                     svsb->volt_base);
+
+               for (i = 0; i < svsb->opp_count; i++) {
+                       opp_freq = svsb->opp_dfreq[i];
+                       if (!search_done && svsb->opp_dvolt[i] <= opp_vboot) {
+                               ret = dev_pm_opp_adjust_voltage(svsb->opp_dev,
+                                                               opp_freq,
+                                                               opp_vboot,
+                                                               opp_vboot,
+                                                               opp_vboot);
+                               if (ret) {
+                                       dev_err(svsb->dev,
+                                               "set opp %uuV vboot fail: %d\n",
+                                               opp_vboot, ret);
+                                       goto svs_init01_finish;
+                               }
+
+                               search_done = true;
+                       } else {
+                               ret = dev_pm_opp_disable(svsb->opp_dev,
+                                                        svsb->opp_dfreq[i]);
+                               if (ret) {
+                                       dev_err(svsb->dev,
+                                               "opp %uHz disable fail: %d\n",
+                                               svsb->opp_dfreq[i], ret);
+                                       goto svs_init01_finish;
+                               }
+                       }
+               }
+       }
+
+       /* Svs bank init01 begins */
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_INIT01))
+                       continue;
+
+               opp_vboot = svs_bank_volt_to_opp_volt(svsb->vboot,
+                                                     svsb->volt_step,
+                                                     svsb->volt_base);
+
+               buck_volt = regulator_get_voltage(svsb->buck);
+               if (buck_volt != opp_vboot) {
+                       dev_err(svsb->dev,
+                               "buck voltage: %uuV, expected vboot: %uuV\n",
+                               buck_volt, opp_vboot);
+                       ret = -EPERM;
+                       goto svs_init01_finish;
+               }
+
+               spin_lock_irqsave(&svs_lock, flags);
+               svsp->pbank = svsb;
+               svs_set_bank_phase(svsp, SVSB_PHASE_INIT01);
+               spin_unlock_irqrestore(&svs_lock, flags);
+
+               time_left = wait_for_completion_timeout(&svsb->init_completion,
+                                                       msecs_to_jiffies(5000));
+               if (!time_left) {
+                       dev_err(svsb->dev, "init01 completion timeout\n");
+                       ret = -EBUSY;
+                       goto svs_init01_finish;
+               }
+       }
+
+svs_init01_finish:
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_INIT01))
+                       continue;
+
+               for (i = 0; i < svsb->opp_count; i++) {
+                       r = dev_pm_opp_enable(svsb->opp_dev,
+                                             svsb->opp_dfreq[i]);
+                       if (r)
+                               dev_err(svsb->dev, "opp %uHz enable fail: %d\n",
+                                       svsb->opp_dfreq[i], r);
+               }
+
+               if (svsb->volt_flags & SVSB_INIT01_PD_REQ) {
+                       r = pm_runtime_put_sync(svsb->opp_dev);
+                       if (r)
+                               dev_err(svsb->dev, "mtcmos off fail: %d\n", r);
+
+                       if (svsb->pm_runtime_enabled_count > 0) {
+                               pm_runtime_disable(svsb->opp_dev);
+                               svsb->pm_runtime_enabled_count--;
+                       }
+               }
+
+               r = regulator_set_mode(svsb->buck, REGULATOR_MODE_NORMAL);
+               if (r)
+                       dev_notice(svsb->dev, "set normal mode fail: %d\n", r);
+
+               r = regulator_disable(svsb->buck);
+               if (r)
+                       dev_err(svsb->dev, "%s disable fail: %d\n",
+                               svsb->buck_name, r);
+       }
+
+svs_init01_resume_cpuidle:
+       cpuidle_resume_and_unlock();
+
+       return ret;
+}
+
+static int svs_init02(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       unsigned long flags, time_left;
+       u32 idx;
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_INIT02))
+                       continue;
+
+               reinit_completion(&svsb->init_completion);
+               spin_lock_irqsave(&svs_lock, flags);
+               svsp->pbank = svsb;
+               svs_set_bank_phase(svsp, SVSB_PHASE_INIT02);
+               spin_unlock_irqrestore(&svs_lock, flags);
+
+               time_left = wait_for_completion_timeout(&svsb->init_completion,
+                                                       msecs_to_jiffies(5000));
+               if (!time_left) {
+                       dev_err(svsb->dev, "init02 completion timeout\n");
+                       return -EBUSY;
+               }
+       }
+
+       /*
+        * 2-line high/low bank update its corresponding opp voltages only.
+        * Therefore, we sync voltages from opp for high/low bank voltages
+        * consistency.
+        */
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_INIT02))
+                       continue;
+
+               if (svsb->type == SVSB_HIGH || svsb->type == SVSB_LOW) {
+                       if (svs_sync_bank_volts_from_opp(svsb)) {
+                               dev_err(svsb->dev, "sync volt fail\n");
+                               return -EPERM;
+                       }
+               }
+       }
+
+       return 0;
+}
+
+static void svs_mon_mode(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       unsigned long flags;
+       u32 idx;
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (!(svsb->mode_support & SVSB_MODE_MON))
+                       continue;
+
+               spin_lock_irqsave(&svs_lock, flags);
+               svsp->pbank = svsb;
+               svs_set_bank_phase(svsp, SVSB_PHASE_MON);
+               spin_unlock_irqrestore(&svs_lock, flags);
+       }
+}
+
+static int svs_start(struct svs_platform *svsp)
+{
+       int ret;
+
+       ret = svs_init01(svsp);
+       if (ret)
+               return ret;
+
+       ret = svs_init02(svsp);
+       if (ret)
+               return ret;
+
+       svs_mon_mode(svsp);
+
+       return 0;
+}
+
+static int svs_suspend(struct device *dev)
+{
+       struct svs_platform *svsp = dev_get_drvdata(dev);
+       struct svs_bank *svsb;
+       unsigned long flags;
+       int ret;
+       u32 idx;
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               /* This might wait for svs_isr() process */
+               spin_lock_irqsave(&svs_lock, flags);
+               svsp->pbank = svsb;
+               svs_switch_bank(svsp);
+               svs_writel_relaxed(svsp, SVSB_EN_OFF, SVSEN);
+               svs_writel_relaxed(svsp, SVSB_INTSTS_CLEAN, INTSTS);
+               spin_unlock_irqrestore(&svs_lock, flags);
+
+               svsb->phase = SVSB_PHASE_ERROR;
+               svs_adjust_pm_opp_volts(svsb);
+       }
+
+       ret = reset_control_assert(svsp->rst);
+       if (ret) {
+               dev_err(svsp->dev, "cannot assert reset %d\n", ret);
+               return ret;
+       }
+
+       clk_disable_unprepare(svsp->main_clk);
+
+       return 0;
+}
+
+static int svs_resume(struct device *dev)
+{
+       struct svs_platform *svsp = dev_get_drvdata(dev);
+       int ret;
+
+       ret = clk_prepare_enable(svsp->main_clk);
+       if (ret) {
+               dev_err(svsp->dev, "cannot enable main_clk, disable svs\n");
+               return ret;
+       }
+
+       ret = reset_control_deassert(svsp->rst);
+       if (ret) {
+               dev_err(svsp->dev, "cannot deassert reset %d\n", ret);
+               goto out_of_resume;
+       }
+
+       ret = svs_init02(svsp);
+       if (ret)
+               goto out_of_resume;
+
+       svs_mon_mode(svsp);
+
+       return 0;
+
+out_of_resume:
+       clk_disable_unprepare(svsp->main_clk);
+       return ret;
+}
+
+static int svs_bank_resource_setup(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       struct dev_pm_opp *opp;
+       unsigned long freq;
+       int count, ret;
+       u32 idx, i;
+
+       dev_set_drvdata(svsp->dev, svsp);
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               switch (svsb->sw_id) {
+               case SVSB_CPU_LITTLE:
+                       svsb->name = "SVSB_CPU_LITTLE";
+                       break;
+               case SVSB_CPU_BIG:
+                       svsb->name = "SVSB_CPU_BIG";
+                       break;
+               case SVSB_CCI:
+                       svsb->name = "SVSB_CCI";
+                       break;
+               case SVSB_GPU:
+                       if (svsb->type == SVSB_HIGH)
+                               svsb->name = "SVSB_GPU_HIGH";
+                       else if (svsb->type == SVSB_LOW)
+                               svsb->name = "SVSB_GPU_LOW";
+                       else
+                               svsb->name = "SVSB_GPU";
+                       break;
+               default:
+                       dev_err(svsb->dev, "unknown sw_id: %u\n", svsb->sw_id);
+                       return -EINVAL;
+               }
+
+               svsb->dev = devm_kzalloc(svsp->dev, sizeof(*svsb->dev),
+                                        GFP_KERNEL);
+               if (!svsb->dev)
+                       return -ENOMEM;
+
+               ret = dev_set_name(svsb->dev, "%s", svsb->name);
+               if (ret)
+                       return ret;
+
+               dev_set_drvdata(svsb->dev, svsp);
+
+               ret = dev_pm_opp_of_add_table(svsb->opp_dev);
+               if (ret) {
+                       dev_err(svsb->dev, "add opp table fail: %d\n", ret);
+                       return ret;
+               }
+
+               mutex_init(&svsb->lock);
+               init_completion(&svsb->init_completion);
+
+               if (svsb->mode_support & SVSB_MODE_INIT01) {
+                       svsb->buck = devm_regulator_get_optional(svsb->opp_dev,
+                                                                svsb->buck_name);
+                       if (IS_ERR(svsb->buck)) {
+                               dev_err(svsb->dev, "cannot get \"%s-supply\"\n",
+                                       svsb->buck_name);
+                               return PTR_ERR(svsb->buck);
+                       }
+               }
+
+               if (svsb->mode_support & SVSB_MODE_MON) {
+                       svsb->tzd = thermal_zone_get_zone_by_name(svsb->tzone_name);
+                       if (IS_ERR(svsb->tzd)) {
+                               dev_err(svsb->dev, "cannot get \"%s\" thermal zone\n",
+                                       svsb->tzone_name);
+                               return PTR_ERR(svsb->tzd);
+                       }
+               }
+
+               count = dev_pm_opp_get_opp_count(svsb->opp_dev);
+               if (svsb->opp_count != count) {
+                       dev_err(svsb->dev,
+                               "opp_count not \"%u\" but get \"%d\"?\n",
+                               svsb->opp_count, count);
+                       return count;
+               }
+
+               for (i = 0, freq = U32_MAX; i < svsb->opp_count; i++, freq--) {
+                       opp = dev_pm_opp_find_freq_floor(svsb->opp_dev, &freq);
+                       if (IS_ERR(opp)) {
+                               dev_err(svsb->dev, "cannot find freq = %ld\n",
+                                       PTR_ERR(opp));
+                               return PTR_ERR(opp);
+                       }
+
+                       svsb->opp_dfreq[i] = freq;
+                       svsb->opp_dvolt[i] = dev_pm_opp_get_voltage(opp);
+                       svsb->freq_pct[i] = percent(svsb->opp_dfreq[i],
+                                                   svsb->freq_base);
+                       dev_pm_opp_put(opp);
+               }
+       }
+
+       return 0;
+}
+
+static bool svs_mt8192_efuse_parsing(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       struct nvmem_cell *cell;
+       u32 idx, i, vmin, golden_temp;
+
+       for (i = 0; i < svsp->efuse_max; i++)
+               if (svsp->efuse[i])
+                       dev_info(svsp->dev, "M_HW_RES%d: 0x%08x\n",
+                                i, svsp->efuse[i]);
+
+       if (!svsp->efuse[9]) {
+               dev_notice(svsp->dev, "svs_efuse[9] = 0x0?\n");
+               return false;
+       }
+
+       /* Svs efuse parsing */
+       vmin = (svsp->efuse[19] >> 4) & GENMASK(1, 0);
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (vmin == 0x1)
+                       svsb->vmin = 0x1e;
+
+               if (svsb->type == SVSB_LOW) {
+                       svsb->mtdes = svsp->efuse[10] & GENMASK(7, 0);
+                       svsb->bdes = (svsp->efuse[10] >> 16) & GENMASK(7, 0);
+                       svsb->mdes = (svsp->efuse[10] >> 24) & GENMASK(7, 0);
+                       svsb->dcbdet = (svsp->efuse[17]) & GENMASK(7, 0);
+                       svsb->dcmdet = (svsp->efuse[17] >> 8) & GENMASK(7, 0);
+               } else if (svsb->type == SVSB_HIGH) {
+                       svsb->mtdes = svsp->efuse[9] & GENMASK(7, 0);
+                       svsb->bdes = (svsp->efuse[9] >> 16) & GENMASK(7, 0);
+                       svsb->mdes = (svsp->efuse[9] >> 24) & GENMASK(7, 0);
+                       svsb->dcbdet = (svsp->efuse[17] >> 16) & GENMASK(7, 0);
+                       svsb->dcmdet = (svsp->efuse[17] >> 24) & GENMASK(7, 0);
+               }
+
+               svsb->vmax += svsb->dvt_fixed;
+       }
+
+       /* Thermal efuse parsing */
+       cell = nvmem_cell_get(svsp->dev, "t-calibration-data");
+       if (IS_ERR_OR_NULL(cell)) {
+               dev_err(svsp->dev, "no \"t-calibration-data\"? %ld\n",
+                       PTR_ERR(cell));
+               return false;
+       }
+
+       svsp->tefuse = nvmem_cell_read(cell, &svsp->tefuse_max);
+       if (IS_ERR(svsp->tefuse)) {
+               dev_err(svsp->dev, "cannot read thermal efuse: %ld\n",
+                       PTR_ERR(svsp->tefuse));
+               nvmem_cell_put(cell);
+               return false;
+       }
+
+       svsp->tefuse_max /= sizeof(u32);
+       nvmem_cell_put(cell);
+
+       for (i = 0; i < svsp->tefuse_max; i++)
+               if (svsp->tefuse[i] != 0)
+                       break;
+
+       if (i == svsp->tefuse_max)
+               golden_temp = 50; /* All thermal efuse data are 0 */
+       else
+               golden_temp = (svsp->tefuse[0] >> 24) & GENMASK(7, 0);
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+               svsb->mts = 500;
+               svsb->bts = (((500 * golden_temp + 250460) / 1000) - 25) * 4;
+       }
+
+       return true;
+}
+
+static bool svs_mt8183_efuse_parsing(struct svs_platform *svsp)
+{
+       struct svs_bank *svsb;
+       struct nvmem_cell *cell;
+       int format[6], x_roomt[6], o_vtsmcu[5], o_vtsabb, tb_roomt = 0;
+       int adc_ge_t, adc_oe_t, ge, oe, gain, degc_cali, adc_cali_en_t;
+       int o_slope, o_slope_sign, ts_id;
+       u32 idx, i, ft_pgm, mts, temp0, temp1, temp2;
+
+       for (i = 0; i < svsp->efuse_max; i++)
+               if (svsp->efuse[i])
+                       dev_info(svsp->dev, "M_HW_RES%d: 0x%08x\n",
+                                i, svsp->efuse[i]);
+
+       if (!svsp->efuse[2]) {
+               dev_notice(svsp->dev, "svs_efuse[2] = 0x0?\n");
+               return false;
+       }
+
+       /* Svs efuse parsing */
+       ft_pgm = (svsp->efuse[0] >> 4) & GENMASK(3, 0);
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (ft_pgm <= 1)
+                       svsb->volt_flags |= SVSB_INIT01_VOLT_IGNORE;
+
+               switch (svsb->sw_id) {
+               case SVSB_CPU_LITTLE:
+                       svsb->bdes = svsp->efuse[16] & GENMASK(7, 0);
+                       svsb->mdes = (svsp->efuse[16] >> 8) & GENMASK(7, 0);
+                       svsb->dcbdet = (svsp->efuse[16] >> 16) & GENMASK(7, 0);
+                       svsb->dcmdet = (svsp->efuse[16] >> 24) & GENMASK(7, 0);
+                       svsb->mtdes  = (svsp->efuse[17] >> 16) & GENMASK(7, 0);
+
+                       if (ft_pgm <= 3)
+                               svsb->volt_od += 10;
+                       else
+                               svsb->volt_od += 2;
+                       break;
+               case SVSB_CPU_BIG:
+                       svsb->bdes = svsp->efuse[18] & GENMASK(7, 0);
+                       svsb->mdes = (svsp->efuse[18] >> 8) & GENMASK(7, 0);
+                       svsb->dcbdet = (svsp->efuse[18] >> 16) & GENMASK(7, 0);
+                       svsb->dcmdet = (svsp->efuse[18] >> 24) & GENMASK(7, 0);
+                       svsb->mtdes  = svsp->efuse[17] & GENMASK(7, 0);
+
+                       if (ft_pgm <= 3)
+                               svsb->volt_od += 15;
+                       else
+                               svsb->volt_od += 12;
+                       break;
+               case SVSB_CCI:
+                       svsb->bdes = svsp->efuse[4] & GENMASK(7, 0);
+                       svsb->mdes = (svsp->efuse[4] >> 8) & GENMASK(7, 0);
+                       svsb->dcbdet = (svsp->efuse[4] >> 16) & GENMASK(7, 0);
+                       svsb->dcmdet = (svsp->efuse[4] >> 24) & GENMASK(7, 0);
+                       svsb->mtdes  = (svsp->efuse[5] >> 16) & GENMASK(7, 0);
+
+                       if (ft_pgm <= 3)
+                               svsb->volt_od += 10;
+                       else
+                               svsb->volt_od += 2;
+                       break;
+               case SVSB_GPU:
+                       svsb->bdes = svsp->efuse[6] & GENMASK(7, 0);
+                       svsb->mdes = (svsp->efuse[6] >> 8) & GENMASK(7, 0);
+                       svsb->dcbdet = (svsp->efuse[6] >> 16) & GENMASK(7, 0);
+                       svsb->dcmdet = (svsp->efuse[6] >> 24) & GENMASK(7, 0);
+                       svsb->mtdes  = svsp->efuse[5] & GENMASK(7, 0);
+
+                       if (ft_pgm >= 2) {
+                               svsb->freq_base = 800000000; /* 800MHz */
+                               svsb->dvt_fixed = 2;
+                       }
+                       break;
+               default:
+                       dev_err(svsb->dev, "unknown sw_id: %u\n", svsb->sw_id);
+                       return false;
+               }
+       }
+
+       /* Get thermal efuse by nvmem */
+       cell = nvmem_cell_get(svsp->dev, "t-calibration-data");
+       if (IS_ERR(cell)) {
+               dev_err(svsp->dev, "no \"t-calibration-data\"? %ld\n",
+                       PTR_ERR(cell));
+               goto remove_mt8183_svsb_mon_mode;
+       }
+
+       svsp->tefuse = nvmem_cell_read(cell, &svsp->tefuse_max);
+       if (IS_ERR(svsp->tefuse)) {
+               dev_err(svsp->dev, "cannot read thermal efuse: %ld\n",
+                       PTR_ERR(svsp->tefuse));
+               nvmem_cell_put(cell);
+               goto remove_mt8183_svsb_mon_mode;
+       }
+
+       svsp->tefuse_max /= sizeof(u32);
+       nvmem_cell_put(cell);
+
+       /* Thermal efuse parsing */
+       adc_ge_t = (svsp->tefuse[1] >> 22) & GENMASK(9, 0);
+       adc_oe_t = (svsp->tefuse[1] >> 12) & GENMASK(9, 0);
+
+       o_vtsmcu[0] = (svsp->tefuse[0] >> 17) & GENMASK(8, 0);
+       o_vtsmcu[1] = (svsp->tefuse[0] >> 8) & GENMASK(8, 0);
+       o_vtsmcu[2] = svsp->tefuse[1] & GENMASK(8, 0);
+       o_vtsmcu[3] = (svsp->tefuse[2] >> 23) & GENMASK(8, 0);
+       o_vtsmcu[4] = (svsp->tefuse[2] >> 5) & GENMASK(8, 0);
+       o_vtsabb = (svsp->tefuse[2] >> 14) & GENMASK(8, 0);
+
+       degc_cali = (svsp->tefuse[0] >> 1) & GENMASK(5, 0);
+       adc_cali_en_t = svsp->tefuse[0] & BIT(0);
+       o_slope_sign = (svsp->tefuse[0] >> 7) & BIT(0);
+
+       ts_id = (svsp->tefuse[1] >> 9) & BIT(0);
+       o_slope = (svsp->tefuse[0] >> 26) & GENMASK(5, 0);
+
+       if (adc_cali_en_t == 1) {
+               if (!ts_id)
+                       o_slope = 0;
+
+               if (adc_ge_t < 265 || adc_ge_t > 758 ||
+                   adc_oe_t < 265 || adc_oe_t > 758 ||
+                   o_vtsmcu[0] < -8 || o_vtsmcu[0] > 484 ||
+                   o_vtsmcu[1] < -8 || o_vtsmcu[1] > 484 ||
+                   o_vtsmcu[2] < -8 || o_vtsmcu[2] > 484 ||
+                   o_vtsmcu[3] < -8 || o_vtsmcu[3] > 484 ||
+                   o_vtsmcu[4] < -8 || o_vtsmcu[4] > 484 ||
+                   o_vtsabb < -8 || o_vtsabb > 484 ||
+                   degc_cali < 1 || degc_cali > 63) {
+                       dev_err(svsp->dev, "bad thermal efuse, no mon mode\n");
+                       goto remove_mt8183_svsb_mon_mode;
+               }
+       } else {
+               dev_err(svsp->dev, "no thermal efuse, no mon mode\n");
+               goto remove_mt8183_svsb_mon_mode;
+       }
+
+       ge = ((adc_ge_t - 512) * 10000) / 4096;
+       oe = (adc_oe_t - 512);
+       gain = (10000 + ge);
+
+       format[0] = (o_vtsmcu[0] + 3350 - oe);
+       format[1] = (o_vtsmcu[1] + 3350 - oe);
+       format[2] = (o_vtsmcu[2] + 3350 - oe);
+       format[3] = (o_vtsmcu[3] + 3350 - oe);
+       format[4] = (o_vtsmcu[4] + 3350 - oe);
+       format[5] = (o_vtsabb + 3350 - oe);
+
+       for (i = 0; i < 6; i++)
+               x_roomt[i] = (((format[i] * 10000) / 4096) * 10000) / gain;
+
+       temp0 = (10000 * 100000 / gain) * 15 / 18;
+
+       if (!o_slope_sign)
+               mts = (temp0 * 10) / (1534 + o_slope * 10);
+       else
+               mts = (temp0 * 10) / (1534 - o_slope * 10);
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+               svsb->mts = mts;
+
+               switch (svsb->sw_id) {
+               case SVSB_CPU_LITTLE:
+                       tb_roomt = x_roomt[3];
+                       break;
+               case SVSB_CPU_BIG:
+                       tb_roomt = x_roomt[4];
+                       break;
+               case SVSB_CCI:
+                       tb_roomt = x_roomt[3];
+                       break;
+               case SVSB_GPU:
+                       tb_roomt = x_roomt[1];
+                       break;
+               default:
+                       dev_err(svsb->dev, "unknown sw_id: %u\n", svsb->sw_id);
+                       goto remove_mt8183_svsb_mon_mode;
+               }
+
+               temp0 = (degc_cali * 10 / 2);
+               temp1 = ((10000 * 100000 / 4096 / gain) *
+                        oe + tb_roomt * 10) * 15 / 18;
+
+               if (!o_slope_sign)
+                       temp2 = temp1 * 100 / (1534 + o_slope * 10);
+               else
+                       temp2 = temp1 * 100 / (1534 - o_slope * 10);
+
+               svsb->bts = (temp0 + temp2 - 250) * 4 / 10;
+       }
+
+       return true;
+
+remove_mt8183_svsb_mon_mode:
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+               svsb->mode_support &= ~SVSB_MODE_MON;
+       }
+
+       return true;
+}
+
+static bool svs_is_efuse_data_correct(struct svs_platform *svsp)
+{
+       struct nvmem_cell *cell;
+
+       /* Get svs efuse by nvmem */
+       cell = nvmem_cell_get(svsp->dev, "svs-calibration-data");
+       if (IS_ERR(cell)) {
+               dev_err(svsp->dev, "no \"svs-calibration-data\"? %ld\n",
+                       PTR_ERR(cell));
+               return false;
+       }
+
+       svsp->efuse = nvmem_cell_read(cell, &svsp->efuse_max);
+       if (IS_ERR(svsp->efuse)) {
+               dev_err(svsp->dev, "cannot read svs efuse: %ld\n",
+                       PTR_ERR(svsp->efuse));
+               nvmem_cell_put(cell);
+               return false;
+       }
+
+       svsp->efuse_max /= sizeof(u32);
+       nvmem_cell_put(cell);
+
+       return svsp->efuse_parsing(svsp);
+}
+
+static struct device *svs_get_subsys_device(struct svs_platform *svsp,
+                                           const char *node_name)
+{
+       struct platform_device *pdev;
+       struct device_node *np;
+
+       np = of_find_node_by_name(NULL, node_name);
+       if (!np) {
+               dev_err(svsp->dev, "cannot find %s node\n", node_name);
+               return ERR_PTR(-ENODEV);
+       }
+
+       pdev = of_find_device_by_node(np);
+       if (!pdev) {
+               of_node_put(np);
+               dev_err(svsp->dev, "cannot find pdev by %s\n", node_name);
+               return ERR_PTR(-ENXIO);
+       }
+
+       of_node_put(np);
+
+       return &pdev->dev;
+}
+
+static struct device *svs_add_device_link(struct svs_platform *svsp,
+                                         const char *node_name)
+{
+       struct device *dev;
+       struct device_link *sup_link;
+
+       if (!node_name) {
+               dev_err(svsp->dev, "node name cannot be null\n");
+               return ERR_PTR(-EINVAL);
+       }
+
+       dev = svs_get_subsys_device(svsp, node_name);
+       if (IS_ERR(dev))
+               return dev;
+
+       sup_link = device_link_add(svsp->dev, dev,
+                                  DL_FLAG_AUTOREMOVE_CONSUMER);
+       if (!sup_link) {
+               dev_err(svsp->dev, "sup_link is NULL\n");
+               return ERR_PTR(-EINVAL);
+       }
+
+       if (sup_link->supplier->links.status != DL_DEV_DRIVER_BOUND)
+               return ERR_PTR(-EPROBE_DEFER);
+
+       return dev;
+}
+
+static int svs_mt8192_platform_probe(struct svs_platform *svsp)
+{
+       struct device *dev;
+       struct svs_bank *svsb;
+       u32 idx;
+
+       svsp->rst = devm_reset_control_get_optional(svsp->dev, "svs_rst");
+       if (IS_ERR(svsp->rst))
+               return dev_err_probe(svsp->dev, PTR_ERR(svsp->rst),
+                                    "cannot get svs reset control\n");
+
+       dev = svs_add_device_link(svsp, "lvts");
+       if (IS_ERR(dev))
+               return dev_err_probe(svsp->dev, PTR_ERR(dev),
+                                    "failed to get lvts device\n");
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               if (svsb->type == SVSB_HIGH)
+                       svsb->opp_dev = svs_add_device_link(svsp, "mali");
+               else if (svsb->type == SVSB_LOW)
+                       svsb->opp_dev = svs_get_subsys_device(svsp, "mali");
+
+               if (IS_ERR(svsb->opp_dev))
+                       return dev_err_probe(svsp->dev, PTR_ERR(svsb->opp_dev),
+                                            "failed to get OPP device for bank %d\n",
+                                            idx);
+       }
+
+       return 0;
+}
+
+static int svs_mt8183_platform_probe(struct svs_platform *svsp)
+{
+       struct device *dev;
+       struct svs_bank *svsb;
+       u32 idx;
+
+       dev = svs_add_device_link(svsp, "thermal");
+       if (IS_ERR(dev))
+               return dev_err_probe(svsp->dev, PTR_ERR(dev),
+                                    "failed to get thermal device\n");
+
+       for (idx = 0; idx < svsp->bank_max; idx++) {
+               svsb = &svsp->banks[idx];
+
+               switch (svsb->sw_id) {
+               case SVSB_CPU_LITTLE:
+               case SVSB_CPU_BIG:
+                       svsb->opp_dev = get_cpu_device(svsb->cpu_id);
+                       break;
+               case SVSB_CCI:
+                       svsb->opp_dev = svs_add_device_link(svsp, "cci");
+                       break;
+               case SVSB_GPU:
+                       svsb->opp_dev = svs_add_device_link(svsp, "gpu");
+                       break;
+               default:
+                       dev_err(svsb->dev, "unknown sw_id: %u\n", svsb->sw_id);
+                       return -EINVAL;
+               }
+
+               if (IS_ERR(svsb->opp_dev))
+                       return dev_err_probe(svsp->dev, PTR_ERR(svsb->opp_dev),
+                                            "failed to get OPP device for bank %d\n",
+                                            idx);
+       }
+
+       return 0;
+}
+
+static struct svs_bank svs_mt8192_banks[] = {
+       {
+               .sw_id                  = SVSB_GPU,
+               .type                   = SVSB_LOW,
+               .set_freq_pct           = svs_set_bank_freq_pct_v3,
+               .get_volts              = svs_get_bank_volts_v3,
+               .volt_flags             = SVSB_REMOVE_DVTFIXED_VOLT,
+               .mode_support           = SVSB_MODE_INIT02,
+               .opp_count              = MAX_OPP_ENTRIES,
+               .freq_base              = 688000000,
+               .turn_freq_base         = 688000000,
+               .volt_step              = 6250,
+               .volt_base              = 400000,
+               .vmax                   = 0x60,
+               .vmin                   = 0x1a,
+               .age_config             = 0x555555,
+               .dc_config              = 0x1,
+               .dvt_fixed              = 0x1,
+               .vco                    = 0x18,
+               .chk_shift              = 0x87,
+               .core_sel               = 0x0fff0100,
+               .int_st                 = BIT(0),
+               .ctl0                   = 0x00540003,
+       },
+       {
+               .sw_id                  = SVSB_GPU,
+               .type                   = SVSB_HIGH,
+               .set_freq_pct           = svs_set_bank_freq_pct_v3,
+               .get_volts              = svs_get_bank_volts_v3,
+               .tzone_name             = "gpu1",
+               .volt_flags             = SVSB_REMOVE_DVTFIXED_VOLT |
+                                         SVSB_MON_VOLT_IGNORE,
+               .mode_support           = SVSB_MODE_INIT02 | SVSB_MODE_MON,
+               .opp_count              = MAX_OPP_ENTRIES,
+               .freq_base              = 902000000,
+               .turn_freq_base         = 688000000,
+               .volt_step              = 6250,
+               .volt_base              = 400000,
+               .vmax                   = 0x60,
+               .vmin                   = 0x1a,
+               .age_config             = 0x555555,
+               .dc_config              = 0x1,
+               .dvt_fixed              = 0x6,
+               .vco                    = 0x18,
+               .chk_shift              = 0x87,
+               .core_sel               = 0x0fff0101,
+               .int_st                 = BIT(1),
+               .ctl0                   = 0x00540003,
+               .tzone_htemp            = 85000,
+               .tzone_htemp_voffset    = 0,
+               .tzone_ltemp            = 25000,
+               .tzone_ltemp_voffset    = 7,
+       },
+};
+
+static struct svs_bank svs_mt8183_banks[] = {
+       {
+               .sw_id                  = SVSB_CPU_LITTLE,
+               .set_freq_pct           = svs_set_bank_freq_pct_v2,
+               .get_volts              = svs_get_bank_volts_v2,
+               .cpu_id                 = 0,
+               .buck_name              = "proc",
+               .volt_flags             = SVSB_INIT01_VOLT_INC_ONLY,
+               .mode_support           = SVSB_MODE_INIT01 | SVSB_MODE_INIT02,
+               .opp_count              = MAX_OPP_ENTRIES,
+               .freq_base              = 1989000000,
+               .vboot                  = 0x30,
+               .volt_step              = 6250,
+               .volt_base              = 500000,
+               .vmax                   = 0x64,
+               .vmin                   = 0x18,
+               .age_config             = 0x555555,
+               .dc_config              = 0x555555,
+               .dvt_fixed              = 0x7,
+               .vco                    = 0x10,
+               .chk_shift              = 0x77,
+               .core_sel               = 0x8fff0000,
+               .int_st                 = BIT(0),
+               .ctl0                   = 0x00010001,
+       },
+       {
+               .sw_id                  = SVSB_CPU_BIG,
+               .set_freq_pct           = svs_set_bank_freq_pct_v2,
+               .get_volts              = svs_get_bank_volts_v2,
+               .cpu_id                 = 4,
+               .buck_name              = "proc",
+               .volt_flags             = SVSB_INIT01_VOLT_INC_ONLY,
+               .mode_support           = SVSB_MODE_INIT01 | SVSB_MODE_INIT02,
+               .opp_count              = MAX_OPP_ENTRIES,
+               .freq_base              = 1989000000,
+               .vboot                  = 0x30,
+               .volt_step              = 6250,
+               .volt_base              = 500000,
+               .vmax                   = 0x58,
+               .vmin                   = 0x10,
+               .age_config             = 0x555555,
+               .dc_config              = 0x555555,
+               .dvt_fixed              = 0x7,
+               .vco                    = 0x10,
+               .chk_shift              = 0x77,
+               .core_sel               = 0x8fff0001,
+               .int_st                 = BIT(1),
+               .ctl0                   = 0x00000001,
+       },
+       {
+               .sw_id                  = SVSB_CCI,
+               .set_freq_pct           = svs_set_bank_freq_pct_v2,
+               .get_volts              = svs_get_bank_volts_v2,
+               .buck_name              = "proc",
+               .volt_flags             = SVSB_INIT01_VOLT_INC_ONLY,
+               .mode_support           = SVSB_MODE_INIT01 | SVSB_MODE_INIT02,
+               .opp_count              = MAX_OPP_ENTRIES,
+               .freq_base              = 1196000000,
+               .vboot                  = 0x30,
+               .volt_step              = 6250,
+               .volt_base              = 500000,
+               .vmax                   = 0x64,
+               .vmin                   = 0x18,
+               .age_config             = 0x555555,
+               .dc_config              = 0x555555,
+               .dvt_fixed              = 0x7,
+               .vco                    = 0x10,
+               .chk_shift              = 0x77,
+               .core_sel               = 0x8fff0002,
+               .int_st                 = BIT(2),
+               .ctl0                   = 0x00100003,
+       },
+       {
+               .sw_id                  = SVSB_GPU,
+               .set_freq_pct           = svs_set_bank_freq_pct_v2,
+               .get_volts              = svs_get_bank_volts_v2,
+               .buck_name              = "mali",
+               .tzone_name             = "tzts2",
+               .volt_flags             = SVSB_INIT01_PD_REQ |
+                                         SVSB_INIT01_VOLT_INC_ONLY,
+               .mode_support           = SVSB_MODE_INIT01 | SVSB_MODE_INIT02 |
+                                         SVSB_MODE_MON,
+               .opp_count              = MAX_OPP_ENTRIES,
+               .freq_base              = 900000000,
+               .vboot                  = 0x30,
+               .volt_step              = 6250,
+               .volt_base              = 500000,
+               .vmax                   = 0x40,
+               .vmin                   = 0x14,
+               .age_config             = 0x555555,
+               .dc_config              = 0x555555,
+               .dvt_fixed              = 0x3,
+               .vco                    = 0x10,
+               .chk_shift              = 0x77,
+               .core_sel               = 0x8fff0003,
+               .int_st                 = BIT(3),
+               .ctl0                   = 0x00050001,
+               .tzone_htemp            = 85000,
+               .tzone_htemp_voffset    = 0,
+               .tzone_ltemp            = 25000,
+               .tzone_ltemp_voffset    = 3,
+       },
+};
+
+static const struct svs_platform_data svs_mt8192_platform_data = {
+       .name = "mt8192-svs",
+       .banks = svs_mt8192_banks,
+       .efuse_parsing = svs_mt8192_efuse_parsing,
+       .probe = svs_mt8192_platform_probe,
+       .irqflags = IRQF_TRIGGER_HIGH,
+       .regs = svs_regs_v2,
+       .bank_max = ARRAY_SIZE(svs_mt8192_banks),
+};
+
+static const struct svs_platform_data svs_mt8183_platform_data = {
+       .name = "mt8183-svs",
+       .banks = svs_mt8183_banks,
+       .efuse_parsing = svs_mt8183_efuse_parsing,
+       .probe = svs_mt8183_platform_probe,
+       .irqflags = IRQF_TRIGGER_LOW,
+       .regs = svs_regs_v2,
+       .bank_max = ARRAY_SIZE(svs_mt8183_banks),
+};
+
+static const struct of_device_id svs_of_match[] = {
+       {
+               .compatible = "mediatek,mt8192-svs",
+               .data = &svs_mt8192_platform_data,
+       }, {
+               .compatible = "mediatek,mt8183-svs",
+               .data = &svs_mt8183_platform_data,
+       }, {
+               /* Sentinel */
+       },
+};
+
+static struct svs_platform *svs_platform_probe(struct platform_device *pdev)
+{
+       struct svs_platform *svsp;
+       const struct svs_platform_data *svsp_data;
+       int ret;
+
+       svsp_data = of_device_get_match_data(&pdev->dev);
+       if (!svsp_data) {
+               dev_err(&pdev->dev, "no svs platform data?\n");
+               return ERR_PTR(-EPERM);
+       }
+
+       svsp = devm_kzalloc(&pdev->dev, sizeof(*svsp), GFP_KERNEL);
+       if (!svsp)
+               return ERR_PTR(-ENOMEM);
+
+       svsp->dev = &pdev->dev;
+       svsp->name = svsp_data->name;
+       svsp->banks = svsp_data->banks;
+       svsp->efuse_parsing = svsp_data->efuse_parsing;
+       svsp->probe = svsp_data->probe;
+       svsp->irqflags = svsp_data->irqflags;
+       svsp->regs = svsp_data->regs;
+       svsp->bank_max = svsp_data->bank_max;
+
+       ret = svsp->probe(svsp);
+       if (ret)
+               return ERR_PTR(ret);
+
+       return svsp;
+}
+
+static int svs_probe(struct platform_device *pdev)
+{
+       struct svs_platform *svsp;
+       unsigned int svsp_irq;
+       int ret;
+
+       svsp = svs_platform_probe(pdev);
+       if (IS_ERR(svsp))
+               return PTR_ERR(svsp);
+
+       if (!svs_is_efuse_data_correct(svsp)) {
+               dev_notice(svsp->dev, "efuse data isn't correct\n");
+               ret = -EPERM;
+               goto svs_probe_free_resource;
+       }
+
+       ret = svs_bank_resource_setup(svsp);
+       if (ret) {
+               dev_err(svsp->dev, "svs bank resource setup fail: %d\n", ret);
+               goto svs_probe_free_resource;
+       }
+
+       svsp_irq = irq_of_parse_and_map(svsp->dev->of_node, 0);
+       ret = devm_request_threaded_irq(svsp->dev, svsp_irq, NULL, svs_isr,
+                                       svsp->irqflags | IRQF_ONESHOT,
+                                       svsp->name, svsp);
+       if (ret) {
+               dev_err(svsp->dev, "register irq(%d) failed: %d\n",
+                       svsp_irq, ret);
+               goto svs_probe_free_resource;
+       }
+
+       svsp->main_clk = devm_clk_get(svsp->dev, "main");
+       if (IS_ERR(svsp->main_clk)) {
+               dev_err(svsp->dev, "failed to get clock: %ld\n",
+                       PTR_ERR(svsp->main_clk));
+               ret = PTR_ERR(svsp->main_clk);
+               goto svs_probe_free_resource;
+       }
+
+       ret = clk_prepare_enable(svsp->main_clk);
+       if (ret) {
+               dev_err(svsp->dev, "cannot enable main clk: %d\n", ret);
+               goto svs_probe_free_resource;
+       }
+
+       svsp->base = of_iomap(svsp->dev->of_node, 0);
+       if (IS_ERR_OR_NULL(svsp->base)) {
+               dev_err(svsp->dev, "cannot find svs register base\n");
+               ret = -EINVAL;
+               goto svs_probe_clk_disable;
+       }
+
+       ret = svs_start(svsp);
+       if (ret) {
+               dev_err(svsp->dev, "svs start fail: %d\n", ret);
+               goto svs_probe_iounmap;
+       }
+
+       ret = svs_create_debug_cmds(svsp);
+       if (ret) {
+               dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret);
+               goto svs_probe_iounmap;
+       }
+
+       return 0;
+
+svs_probe_iounmap:
+       iounmap(svsp->base);
+
+svs_probe_clk_disable:
+       clk_disable_unprepare(svsp->main_clk);
+
+svs_probe_free_resource:
+       if (!IS_ERR_OR_NULL(svsp->efuse))
+               kfree(svsp->efuse);
+       if (!IS_ERR_OR_NULL(svsp->tefuse))
+               kfree(svsp->tefuse);
+
+       return ret;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(svs_pm_ops, svs_suspend, svs_resume);
+
+static struct platform_driver svs_driver = {
+       .probe  = svs_probe,
+       .driver = {
+               .name           = "mtk-svs",
+               .pm             = &svs_pm_ops,
+               .of_match_table = of_match_ptr(svs_of_match),
+       },
+};
+
+module_platform_driver(svs_driver);
+
+MODULE_AUTHOR("Roger Lu <roger.lu@mediatek.com>");
+MODULE_DESCRIPTION("MediaTek SVS driver");
+MODULE_LICENSE("GPL");
index e718b87354444f3d7d8c2b7119c57f16290046aa..e0d7a54595627797545f53cb7b1927f8bad4cd27 100644 (file)
@@ -129,7 +129,10 @@ config QCOM_RPMHPD
 
 config QCOM_RPMPD
        tristate "Qualcomm RPM Power domain driver"
+       depends on PM
        depends on QCOM_SMD_RPM
+       select PM_GENERIC_DOMAINS
+       select PM_GENERIC_DOMAINS_OF
        help
          QCOM RPM Power domain driver to support power-domains with
          performance states. The driver communicates a performance state
@@ -228,4 +231,19 @@ config QCOM_APR
          application processor and QDSP6. APR is
          used by audio driver to configure QDSP6
          ASM, ADM and AFE modules.
+
+config QCOM_ICC_BWMON
+       tristate "QCOM Interconnect Bandwidth Monitor driver"
+       depends on ARCH_QCOM || COMPILE_TEST
+       select PM_OPP
+       help
+         Sets up driver monitoring bandwidth on various interconnects and
+         based on that voting for interconnect bandwidth, adjusting their
+         speed to current demand.
+         Current implementation brings support for BWMON v4, used for example
+         on SDM845 to measure bandwidth between CPU (gladiator_noc) and Last
+         Level Cache (memnoc).  Usage of this BWMON allows to remove some of
+         the fixed bandwidth votes from cpufreq (CPU nodes) thus achieve high
+         memory throughput even with lower CPU frequencies.
+
 endmenu
index 70d5de69fd7b9fa384c300df10c37ffa2a1206dd..d66604aff2b0647e0d0e27ebad05ba98e5199549 100644 (file)
@@ -28,3 +28,4 @@ obj-$(CONFIG_QCOM_LLCC) += llcc-qcom.o
 obj-$(CONFIG_QCOM_RPMHPD) += rpmhpd.o
 obj-$(CONFIG_QCOM_RPMPD) += rpmpd.o
 obj-$(CONFIG_QCOM_KRYO_L2_ACCESSORS) +=        kryo-l2-accessors.o
+obj-$(CONFIG_QCOM_ICC_BWMON)   += icc-bwmon.o
index 3caabd8733227d18a8c3529165e76ca89af52c63..b4046f393575eaefeab9bebc37a4e5e6b6f65276 100644 (file)
@@ -377,17 +377,14 @@ static int apr_device_probe(struct device *dev)
 static void apr_device_remove(struct device *dev)
 {
        struct apr_device *adev = to_apr_device(dev);
-       struct apr_driver *adrv;
+       struct apr_driver *adrv = to_apr_driver(dev->driver);
        struct packet_router *apr = dev_get_drvdata(adev->dev.parent);
 
-       if (dev->driver) {
-               adrv = to_apr_driver(dev->driver);
-               if (adrv->remove)
-                       adrv->remove(adev);
-               spin_lock(&apr->svcs_lock);
-               idr_remove(&apr->svcs_idr, adev->svc.id);
-               spin_unlock(&apr->svcs_lock);
-       }
+       if (adrv->remove)
+               adrv->remove(adev);
+       spin_lock(&apr->svcs_lock);
+       idr_remove(&apr->svcs_idr, adev->svc.id);
+       spin_unlock(&apr->svcs_lock);
 }
 
 static int apr_uevent(struct device *dev, struct kobj_uevent_env *env)
index dd872017f34509a7692ef9e00b33bcc7bf9c5077..629a7188b576fed4c39a8c76fe276f561fb2bd5f 100644 (file)
@@ -141,13 +141,17 @@ static int cmd_db_get_header(const char *id, const struct entry_header **eh,
        const struct rsc_hdr *rsc_hdr;
        const struct entry_header *ent;
        int ret, i, j;
-       u8 query[8];
+       u8 query[sizeof(ent->id)] __nonstring;
 
        ret = cmd_db_ready();
        if (ret)
                return ret;
 
-       /* Pad out query string to same length as in DB */
+       /*
+        * Pad out query string to same length as in DB. NOTE: the output
+        * query string is not necessarily '\0' terminated if it bumps up
+        * against the max size. That's OK and expected.
+        */
        strncpy(query, id, sizeof(query));
 
        for (i = 0; i < MAX_SLV_ID; i++) {
diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
new file mode 100644 (file)
index 0000000..7f8aca5
--- /dev/null
@@ -0,0 +1,419 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
+ * Copyright (C) 2021-2022 Linaro Ltd
+ * Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, based on
+ *         previous work of Thara Gopinath and msm-4.9 downstream sources.
+ */
+#include <linux/interconnect.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/pm_opp.h>
+#include <linux/sizes.h>
+
+/*
+ * The BWMON samples data throughput within 'sample_ms' time. With three
+ * configurable thresholds (Low, Medium and High) gives four windows (called
+ * zones) of current bandwidth:
+ *
+ * Zone 0: byte count < THRES_LO
+ * Zone 1: THRES_LO < byte count < THRES_MED
+ * Zone 2: THRES_MED < byte count < THRES_HIGH
+ * Zone 3: THRES_HIGH < byte count
+ *
+ * Zones 0 and 2 are not used by this driver.
+ */
+
+/* Internal sampling clock frequency */
+#define HW_TIMER_HZ                            19200000
+
+#define BWMON_GLOBAL_IRQ_STATUS                        0x0
+#define BWMON_GLOBAL_IRQ_CLEAR                 0x8
+#define BWMON_GLOBAL_IRQ_ENABLE                        0xc
+#define BWMON_GLOBAL_IRQ_ENABLE_ENABLE         BIT(0)
+
+#define BWMON_IRQ_STATUS                       0x100
+#define BWMON_IRQ_STATUS_ZONE_SHIFT            4
+#define BWMON_IRQ_CLEAR                                0x108
+#define BWMON_IRQ_ENABLE                       0x10c
+#define BWMON_IRQ_ENABLE_ZONE1_SHIFT           5
+#define BWMON_IRQ_ENABLE_ZONE2_SHIFT           6
+#define BWMON_IRQ_ENABLE_ZONE3_SHIFT           7
+#define BWMON_IRQ_ENABLE_MASK                  (BIT(BWMON_IRQ_ENABLE_ZONE1_SHIFT) | \
+                                                BIT(BWMON_IRQ_ENABLE_ZONE3_SHIFT))
+
+#define BWMON_ENABLE                           0x2a0
+#define BWMON_ENABLE_ENABLE                    BIT(0)
+
+#define BWMON_CLEAR                            0x2a4
+#define BWMON_CLEAR_CLEAR                      BIT(0)
+
+#define BWMON_SAMPLE_WINDOW                    0x2a8
+#define BWMON_THRESHOLD_HIGH                   0x2ac
+#define BWMON_THRESHOLD_MED                    0x2b0
+#define BWMON_THRESHOLD_LOW                    0x2b4
+
+#define BWMON_ZONE_ACTIONS                     0x2b8
+/*
+ * Actions to perform on some zone 'z' when current zone hits the threshold:
+ * Increment counter of zone 'z'
+ */
+#define BWMON_ZONE_ACTIONS_INCREMENT(z)                (0x2 << ((z) * 2))
+/* Clear counter of zone 'z' */
+#define BWMON_ZONE_ACTIONS_CLEAR(z)            (0x1 << ((z) * 2))
+
+/* Zone 0 threshold hit: Clear zone count */
+#define BWMON_ZONE_ACTIONS_ZONE0               (BWMON_ZONE_ACTIONS_CLEAR(0))
+
+/* Zone 1 threshold hit: Increment zone count & clear lower zones */
+#define BWMON_ZONE_ACTIONS_ZONE1               (BWMON_ZONE_ACTIONS_INCREMENT(1) | \
+                                                BWMON_ZONE_ACTIONS_CLEAR(0))
+
+/* Zone 2 threshold hit: Increment zone count & clear lower zones */
+#define BWMON_ZONE_ACTIONS_ZONE2               (BWMON_ZONE_ACTIONS_INCREMENT(2) | \
+                                                BWMON_ZONE_ACTIONS_CLEAR(1) | \
+                                                BWMON_ZONE_ACTIONS_CLEAR(0))
+
+/* Zone 3 threshold hit: Increment zone count & clear lower zones */
+#define BWMON_ZONE_ACTIONS_ZONE3               (BWMON_ZONE_ACTIONS_INCREMENT(3) | \
+                                                BWMON_ZONE_ACTIONS_CLEAR(2) | \
+                                                BWMON_ZONE_ACTIONS_CLEAR(1) | \
+                                                BWMON_ZONE_ACTIONS_CLEAR(0))
+/* Value for BWMON_ZONE_ACTIONS */
+#define BWMON_ZONE_ACTIONS_DEFAULT             (BWMON_ZONE_ACTIONS_ZONE0 | \
+                                                BWMON_ZONE_ACTIONS_ZONE1 << 8 | \
+                                                BWMON_ZONE_ACTIONS_ZONE2 << 16 | \
+                                                BWMON_ZONE_ACTIONS_ZONE3 << 24)
+
+/*
+ * There is no clear documentation/explanation of BWMON_THRESHOLD_COUNT
+ * register. Based on observations, this is number of times one threshold has to
+ * be reached, to trigger interrupt in given zone.
+ *
+ * 0xff are maximum values meant to ignore the zones 0 and 2.
+ */
+#define BWMON_THRESHOLD_COUNT                  0x2bc
+#define BWMON_THRESHOLD_COUNT_ZONE1_SHIFT      8
+#define BWMON_THRESHOLD_COUNT_ZONE2_SHIFT      16
+#define BWMON_THRESHOLD_COUNT_ZONE3_SHIFT      24
+#define BWMON_THRESHOLD_COUNT_ZONE0_DEFAULT    0xff
+#define BWMON_THRESHOLD_COUNT_ZONE2_DEFAULT    0xff
+
+/* BWMONv4 count registers use count unit of 64 kB */
+#define BWMON_COUNT_UNIT_KB                    64
+#define BWMON_ZONE_COUNT                       0x2d8
+#define BWMON_ZONE_MAX(zone)                   (0x2e0 + 4 * (zone))
+
+struct icc_bwmon_data {
+       unsigned int sample_ms;
+       unsigned int default_highbw_kbps;
+       unsigned int default_medbw_kbps;
+       unsigned int default_lowbw_kbps;
+       u8 zone1_thres_count;
+       u8 zone3_thres_count;
+};
+
+struct icc_bwmon {
+       struct device *dev;
+       void __iomem *base;
+       int irq;
+
+       unsigned int default_lowbw_kbps;
+       unsigned int sample_ms;
+       unsigned int max_bw_kbps;
+       unsigned int min_bw_kbps;
+       unsigned int target_kbps;
+       unsigned int current_kbps;
+};
+
+static void bwmon_clear_counters(struct icc_bwmon *bwmon)
+{
+       /*
+        * Clear counters. The order and barriers are
+        * important. Quoting downstream Qualcomm msm-4.9 tree:
+        *
+        * The counter clear and IRQ clear bits are not in the same 4KB
+        * region. So, we need to make sure the counter clear is completed
+        * before we try to clear the IRQ or do any other counter operations.
+        */
+       writel(BWMON_CLEAR_CLEAR, bwmon->base + BWMON_CLEAR);
+}
+
+static void bwmon_clear_irq(struct icc_bwmon *bwmon)
+{
+       /*
+        * Clear zone and global interrupts. The order and barriers are
+        * important. Quoting downstream Qualcomm msm-4.9 tree:
+        *
+        * Synchronize the local interrupt clear in mon_irq_clear()
+        * with the global interrupt clear here. Otherwise, the CPU
+        * may reorder the two writes and clear the global interrupt
+        * before the local interrupt, causing the global interrupt
+        * to be retriggered by the local interrupt still being high.
+        *
+        * Similarly, because the global registers are in a different
+        * region than the local registers, we need to ensure any register
+        * writes to enable the monitor after this call are ordered with the
+        * clearing here so that local writes don't happen before the
+        * interrupt is cleared.
+        */
+       writel(BWMON_IRQ_ENABLE_MASK, bwmon->base + BWMON_IRQ_CLEAR);
+       writel(BIT(0), bwmon->base + BWMON_GLOBAL_IRQ_CLEAR);
+}
+
+static void bwmon_disable(struct icc_bwmon *bwmon)
+{
+       /* Disable interrupts. Strict ordering, see bwmon_clear_irq(). */
+       writel(0x0, bwmon->base + BWMON_GLOBAL_IRQ_ENABLE);
+       writel(0x0, bwmon->base + BWMON_IRQ_ENABLE);
+
+       /*
+        * Disable bwmon. Must happen before bwmon_clear_irq() to avoid spurious
+        * IRQ.
+        */
+       writel(0x0, bwmon->base + BWMON_ENABLE);
+}
+
+static void bwmon_enable(struct icc_bwmon *bwmon, unsigned int irq_enable)
+{
+       /* Enable interrupts */
+       writel(BWMON_GLOBAL_IRQ_ENABLE_ENABLE,
+              bwmon->base + BWMON_GLOBAL_IRQ_ENABLE);
+       writel(irq_enable, bwmon->base + BWMON_IRQ_ENABLE);
+
+       /* Enable bwmon */
+       writel(BWMON_ENABLE_ENABLE, bwmon->base + BWMON_ENABLE);
+}
+
+static unsigned int bwmon_kbps_to_count(unsigned int kbps)
+{
+       return kbps / BWMON_COUNT_UNIT_KB;
+}
+
+static void bwmon_set_threshold(struct icc_bwmon *bwmon, unsigned int reg,
+                               unsigned int kbps)
+{
+       unsigned int thres;
+
+       thres = mult_frac(bwmon_kbps_to_count(kbps), bwmon->sample_ms,
+                         MSEC_PER_SEC);
+       writel_relaxed(thres, bwmon->base + reg);
+}
+
+static void bwmon_start(struct icc_bwmon *bwmon,
+                       const struct icc_bwmon_data *data)
+{
+       unsigned int thres_count;
+       int window;
+
+       bwmon_clear_counters(bwmon);
+
+       window = mult_frac(bwmon->sample_ms, HW_TIMER_HZ, MSEC_PER_SEC);
+       /* Maximum sampling window: 0xfffff */
+       writel_relaxed(window, bwmon->base + BWMON_SAMPLE_WINDOW);
+
+       bwmon_set_threshold(bwmon, BWMON_THRESHOLD_HIGH,
+                           data->default_highbw_kbps);
+       bwmon_set_threshold(bwmon, BWMON_THRESHOLD_MED,
+                           data->default_medbw_kbps);
+       bwmon_set_threshold(bwmon, BWMON_THRESHOLD_LOW,
+                           data->default_lowbw_kbps);
+
+       thres_count = data->zone3_thres_count << BWMON_THRESHOLD_COUNT_ZONE3_SHIFT |
+                     BWMON_THRESHOLD_COUNT_ZONE2_DEFAULT << BWMON_THRESHOLD_COUNT_ZONE2_SHIFT |
+                     data->zone1_thres_count << BWMON_THRESHOLD_COUNT_ZONE1_SHIFT |
+                     BWMON_THRESHOLD_COUNT_ZONE0_DEFAULT;
+       writel_relaxed(thres_count, bwmon->base + BWMON_THRESHOLD_COUNT);
+       writel_relaxed(BWMON_ZONE_ACTIONS_DEFAULT,
+                      bwmon->base + BWMON_ZONE_ACTIONS);
+       /* Write barriers in bwmon_clear_irq() */
+
+       bwmon_clear_irq(bwmon);
+       bwmon_enable(bwmon, BWMON_IRQ_ENABLE_MASK);
+}
+
+static irqreturn_t bwmon_intr(int irq, void *dev_id)
+{
+       struct icc_bwmon *bwmon = dev_id;
+       unsigned int status, max;
+       int zone;
+
+       status = readl(bwmon->base + BWMON_IRQ_STATUS);
+       status &= BWMON_IRQ_ENABLE_MASK;
+       if (!status) {
+               /*
+                * Only zone 1 and zone 3 interrupts are enabled but zone 2
+                * threshold could be hit and trigger interrupt even if not
+                * enabled.
+                * Such spurious interrupt might come with valuable max count or
+                * not, so solution would be to always check all
+                * BWMON_ZONE_MAX() registers to find the highest value.
+                * Such case is currently ignored.
+                */
+               return IRQ_NONE;
+       }
+
+       bwmon_disable(bwmon);
+
+       zone = get_bitmask_order(status >> BWMON_IRQ_STATUS_ZONE_SHIFT) - 1;
+       /*
+        * Zone max bytes count register returns count units within sampling
+        * window.  Downstream kernel for BWMONv4 (called BWMON type 2 in
+        * downstream) always increments the max bytes count by one.
+        */
+       max = readl(bwmon->base + BWMON_ZONE_MAX(zone)) + 1;
+       max *= BWMON_COUNT_UNIT_KB;
+       bwmon->target_kbps = mult_frac(max, MSEC_PER_SEC, bwmon->sample_ms);
+
+       return IRQ_WAKE_THREAD;
+}
+
+static irqreturn_t bwmon_intr_thread(int irq, void *dev_id)
+{
+       struct icc_bwmon *bwmon = dev_id;
+       unsigned int irq_enable = 0;
+       struct dev_pm_opp *opp, *target_opp;
+       unsigned int bw_kbps, up_kbps, down_kbps;
+
+       bw_kbps = bwmon->target_kbps;
+
+       target_opp = dev_pm_opp_find_bw_ceil(bwmon->dev, &bw_kbps, 0);
+       if (IS_ERR(target_opp) && PTR_ERR(target_opp) == -ERANGE)
+               target_opp = dev_pm_opp_find_bw_floor(bwmon->dev, &bw_kbps, 0);
+
+       bwmon->target_kbps = bw_kbps;
+
+       bw_kbps--;
+       opp = dev_pm_opp_find_bw_floor(bwmon->dev, &bw_kbps, 0);
+       if (IS_ERR(opp) && PTR_ERR(opp) == -ERANGE)
+               down_kbps = bwmon->target_kbps;
+       else
+               down_kbps = bw_kbps;
+
+       up_kbps = bwmon->target_kbps + 1;
+
+       if (bwmon->target_kbps >= bwmon->max_bw_kbps)
+               irq_enable = BIT(BWMON_IRQ_ENABLE_ZONE1_SHIFT);
+       else if (bwmon->target_kbps <= bwmon->min_bw_kbps)
+               irq_enable = BIT(BWMON_IRQ_ENABLE_ZONE3_SHIFT);
+       else
+               irq_enable = BWMON_IRQ_ENABLE_MASK;
+
+       bwmon_set_threshold(bwmon, BWMON_THRESHOLD_HIGH, up_kbps);
+       bwmon_set_threshold(bwmon, BWMON_THRESHOLD_MED, down_kbps);
+       /* Write barriers in bwmon_clear_counters() */
+       bwmon_clear_counters(bwmon);
+       bwmon_clear_irq(bwmon);
+       bwmon_enable(bwmon, irq_enable);
+
+       if (bwmon->target_kbps == bwmon->current_kbps)
+               goto out;
+
+       dev_pm_opp_set_opp(bwmon->dev, target_opp);
+       bwmon->current_kbps = bwmon->target_kbps;
+
+out:
+       dev_pm_opp_put(target_opp);
+       if (!IS_ERR(opp))
+               dev_pm_opp_put(opp);
+
+       return IRQ_HANDLED;
+}
+
+static int bwmon_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct dev_pm_opp *opp;
+       struct icc_bwmon *bwmon;
+       const struct icc_bwmon_data *data;
+       int ret;
+
+       bwmon = devm_kzalloc(dev, sizeof(*bwmon), GFP_KERNEL);
+       if (!bwmon)
+               return -ENOMEM;
+
+       data = of_device_get_match_data(dev);
+
+       bwmon->base = devm_platform_ioremap_resource(pdev, 0);
+       if (IS_ERR(bwmon->base)) {
+               dev_err(dev, "failed to map bwmon registers\n");
+               return PTR_ERR(bwmon->base);
+       }
+
+       bwmon->irq = platform_get_irq(pdev, 0);
+       if (bwmon->irq < 0)
+               return bwmon->irq;
+
+       ret = devm_pm_opp_of_add_table(dev);
+       if (ret)
+               return dev_err_probe(dev, ret, "failed to add OPP table\n");
+
+       bwmon->max_bw_kbps = UINT_MAX;
+       opp = dev_pm_opp_find_bw_floor(dev, &bwmon->max_bw_kbps, 0);
+       if (IS_ERR(opp))
+               return dev_err_probe(dev, ret, "failed to find max peak bandwidth\n");
+
+       bwmon->min_bw_kbps = 0;
+       opp = dev_pm_opp_find_bw_ceil(dev, &bwmon->min_bw_kbps, 0);
+       if (IS_ERR(opp))
+               return dev_err_probe(dev, ret, "failed to find min peak bandwidth\n");
+
+       bwmon->sample_ms = data->sample_ms;
+       bwmon->default_lowbw_kbps = data->default_lowbw_kbps;
+       bwmon->dev = dev;
+
+       bwmon_disable(bwmon);
+       ret = devm_request_threaded_irq(dev, bwmon->irq, bwmon_intr,
+                                       bwmon_intr_thread,
+                                       IRQF_ONESHOT, dev_name(dev), bwmon);
+       if (ret)
+               return dev_err_probe(dev, ret, "failed to request IRQ\n");
+
+       platform_set_drvdata(pdev, bwmon);
+       bwmon_start(bwmon, data);
+
+       return 0;
+}
+
+static int bwmon_remove(struct platform_device *pdev)
+{
+       struct icc_bwmon *bwmon = platform_get_drvdata(pdev);
+
+       bwmon_disable(bwmon);
+
+       return 0;
+}
+
+/* BWMON v4 */
+static const struct icc_bwmon_data msm8998_bwmon_data = {
+       .sample_ms = 4,
+       .default_highbw_kbps = 4800 * 1024, /* 4.8 GBps */
+       .default_medbw_kbps = 512 * 1024, /* 512 MBps */
+       .default_lowbw_kbps = 0,
+       .zone1_thres_count = 16,
+       .zone3_thres_count = 1,
+};
+
+static const struct of_device_id bwmon_of_match[] = {
+       { .compatible = "qcom,msm8998-bwmon", .data = &msm8998_bwmon_data },
+       {}
+};
+MODULE_DEVICE_TABLE(of, bwmon_of_match);
+
+static struct platform_driver bwmon_driver = {
+       .probe = bwmon_probe,
+       .remove = bwmon_remove,
+       .driver = {
+               .name = "qcom-bwmon",
+               .of_match_table = bwmon_of_match,
+       },
+};
+module_platform_driver(bwmon_driver);
+
+MODULE_AUTHOR("Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>");
+MODULE_DESCRIPTION("QCOM BWMON driver");
+MODULE_LICENSE("GPL");
index 4b143cf7b4ce1536f03e55c8716a057dbd87ff0d..38d7296315a25ee20466bfeed7f79ed1abcead86 100644 (file)
@@ -382,7 +382,7 @@ static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER;
  * llcc_slice_getd - get llcc slice descriptor
  * @uid: usecase_id for the client
  *
- * A pointer to llcc slice descriptor will be returned on success and
+ * A pointer to llcc slice descriptor will be returned on success
  * and error pointer is returned on failure
  */
 struct llcc_slice_desc *llcc_slice_getd(u32 uid)
index 366db493579b0463608f0f6be5abca748ce4685c..3f11554df2f38091434eedb5045f80ac795c1ffe 100644 (file)
@@ -108,6 +108,8 @@ EXPORT_SYMBOL_GPL(qcom_mdt_get_size);
  * qcom_mdt_read_metadata() - read header and metadata from mdt or mbn
  * @fw:                firmware of mdt header or mbn
  * @data_len:  length of the read metadata blob
+ * @fw_name:   name of the firmware, for construction of segment file names
+ * @dev:       device handle to associate resources with
  *
  * The mechanism that performs the authentication of the loading firmware
  * expects an ELF header directly followed by the segment of hashes, with no
@@ -192,7 +194,7 @@ EXPORT_SYMBOL_GPL(qcom_mdt_read_metadata);
  * qcom_mdt_pas_init() - initialize PAS region for firmware loading
  * @dev:       device handle to associate resources with
  * @fw:                firmware object for the mdt file
- * @firmware:  name of the firmware, for construction of segment file names
+ * @fw_name:   name of the firmware, for construction of segment file names
  * @pas_id:    PAS identifier
  * @mem_phys:  physical address of allocated memory region
  * @ctx:       PAS metadata context, to be released by caller
index 97fd24c178f8d330272c601dd3fd5268b167182a..c92d26b73e6fc700d4264e851f3030c4c68726ac 100644 (file)
@@ -194,14 +194,17 @@ struct ocmem *of_get_ocmem(struct device *dev)
        devnode = of_parse_phandle(dev->of_node, "sram", 0);
        if (!devnode || !devnode->parent) {
                dev_err(dev, "Cannot look up sram phandle\n");
+               of_node_put(devnode);
                return ERR_PTR(-ENODEV);
        }
 
        pdev = of_find_device_by_node(devnode->parent);
        if (!pdev) {
                dev_err(dev, "Cannot find device node %s\n", devnode->name);
+               of_node_put(devnode);
                return ERR_PTR(-EPROBE_DEFER);
        }
+       of_node_put(devnode);
 
        ocmem = platform_get_drvdata(pdev);
        if (!ocmem) {
index a59bb34e5ebafd772874d357031a7a85fd20ba25..18c856056475ce04ef05919367be1fa91b07b7c9 100644 (file)
@@ -399,8 +399,10 @@ static int qmp_cooling_devices_register(struct qmp *qmp)
                        continue;
                ret = qmp_cooling_device_add(qmp, &qmp->cooling_devs[count++],
                                             child);
-               if (ret)
+               if (ret) {
+                       of_node_put(child);
                        goto unroll;
+               }
        }
 
        if (!count)
index 05fff8691ee3f949aedfa0240e2e9e5318c86ce4..092f6ab09acf3c5d6ab11a60c3522c9eba6c15a5 100644 (file)
@@ -23,8 +23,8 @@
 /**
  * struct rpmhpd - top level RPMh power domain resource data structure
  * @dev:               rpmh power domain controller device
- * @pd:                        generic_pm_domain corrresponding to the power domain
- * @parent:            generic_pm_domain corrresponding to the parent's power domain
+ * @pd:                        generic_pm_domain corresponding to the power domain
+ * @parent:            generic_pm_domain corresponding to the parent's power domain
  * @peer:              A peer power domain in case Active only Voting is
  *                     supported
  * @active_only:       True if it represents an Active only peer
index 3b5b91621532276dc5b411cbffa8963ea8fbce14..5803038c744e58b24b641ad4c47fa7ffca7de392 100644 (file)
@@ -453,6 +453,7 @@ static const struct rpmpd_desc qcm2290_desc = {
 static const struct of_device_id rpmpd_match_table[] = {
        { .compatible = "qcom,mdm9607-rpmpd", .data = &mdm9607_desc },
        { .compatible = "qcom,msm8226-rpmpd", .data = &msm8226_desc },
+       { .compatible = "qcom,msm8909-rpmpd", .data = &msm8916_desc },
        { .compatible = "qcom,msm8916-rpmpd", .data = &msm8916_desc },
        { .compatible = "qcom,msm8939-rpmpd", .data = &msm8939_desc },
        { .compatible = "qcom,msm8953-rpmpd", .data = &msm8953_desc },
index 30dda1af63c8471078d153153d8b95f5ad4f8046..413f9f4ae9cd625c559a76a7be9783e6bea38773 100644 (file)
@@ -234,6 +234,7 @@ static const struct of_device_id qcom_smd_rpm_of_match[] = {
        { .compatible = "qcom,rpm-apq8084" },
        { .compatible = "qcom,rpm-ipq6018" },
        { .compatible = "qcom,rpm-msm8226" },
+       { .compatible = "qcom,rpm-msm8909" },
        { .compatible = "qcom,rpm-msm8916" },
        { .compatible = "qcom,rpm-msm8936" },
        { .compatible = "qcom,rpm-msm8953" },
index 59dbf4b61e6c2d7b903a7416311718af797ecb4e..d9c28a8a7cbf2333ec16afdece650d07dd331ee0 100644 (file)
@@ -119,6 +119,9 @@ struct smp2p_entry {
  * @out:       pointer to the outbound smem item
  * @smem_items:        ids of the two smem items
  * @valid_entries: already scanned inbound entries
+ * @ssr_ack_enabled: SMP2P_FEATURE_SSR_ACK feature is supported and was enabled
+ * @ssr_ack: current cached state of the local ack bit
+ * @negotiation_done: whether negotiating finished
  * @local_pid: processor id of the inbound edge
  * @remote_pid:        processor id of the outbound edge
  * @ipc_regmap:        regmap for the outbound ipc
index cee579a267a6b57c9588eabc200d425c9c79d4db..4554fb8655d34e393d3c60d25f8200f696dec81f 100644 (file)
@@ -328,10 +328,12 @@ static const struct soc_id soc_id[] = {
        { 455, "QRB5165" },
        { 457, "SM8450" },
        { 459, "SM7225" },
-       { 460, "SA8540P" },
+       { 460, "SA8295P" },
+       { 461, "SA8540P" },
        { 480, "SM8450" },
        { 482, "SM8450" },
        { 487, "SC7280" },
+       { 495, "SC7180P" },
 };
 
 static const char *socinfo_machine(struct device *dev, unsigned int id)
index f831420b7fd40d2527718375eb9ae58ade4d047e..484b42b7454e3c77d2a45615b46a296abc9929c0 100644 (file)
@@ -74,6 +74,18 @@ static const u16 spm_reg_offset_v3_0[SPM_REG_NR] = {
        [SPM_REG_SEQ_ENTRY]     = 0x400,
 };
 
+/* SPM register data for 8909 */
+static const struct spm_reg_data spm_reg_8909_cpu = {
+       .reg_offset = spm_reg_offset_v3_0,
+       .spm_cfg = 0x1,
+       .spm_dly = 0x3C102800,
+       .seq = { 0x60, 0x03, 0x60, 0x0B, 0x0F, 0x20, 0x10, 0x80, 0x30, 0x90,
+               0x5B, 0x60, 0x03, 0x60, 0x76, 0x76, 0x0B, 0x94, 0x5B, 0x80,
+               0x10, 0x26, 0x30, 0x0F },
+       .start_index[PM_SLEEP_MODE_STBY] = 0,
+       .start_index[PM_SLEEP_MODE_SPC] = 5,
+};
+
 /* SPM register data for 8916 */
 static const struct spm_reg_data spm_reg_8916_cpu = {
        .reg_offset = spm_reg_offset_v3_0,
@@ -195,6 +207,8 @@ static const struct of_device_id spm_match_table[] = {
          .data = &spm_reg_660_silver_l2 },
        { .compatible = "qcom,msm8226-saw2-v2.1-cpu",
          .data = &spm_reg_8226_cpu },
+       { .compatible = "qcom,msm8909-saw2-v3.0-cpu",
+         .data = &spm_reg_8909_cpu },
        { .compatible = "qcom,msm8916-saw2-v3.0-cpu",
          .data = &spm_reg_8916_cpu },
        { .compatible = "qcom,msm8974-saw2-v2.1-cpu",
index fdfc857df33492a65cf22ee7519ea7cdd4c0f7eb..04f1bc322ae7b671933d89189babec7c5e1b9bbd 100644 (file)
@@ -57,11 +57,11 @@ static struct rcar_gen4_sysc_area r8a779a0_areas[] __initdata = {
        { "a2cv6",      R8A779A0_PD_A2CV6, R8A779A0_PD_A3IR },
        { "a2cn2",      R8A779A0_PD_A2CN2, R8A779A0_PD_A3IR },
        { "a2imp23",    R8A779A0_PD_A2IMP23, R8A779A0_PD_A3IR },
-       { "a2dp1",      R8A779A0_PD_A2DP0, R8A779A0_PD_A3IR },
-       { "a2cv2",      R8A779A0_PD_A2CV0, R8A779A0_PD_A3IR },
-       { "a2cv3",      R8A779A0_PD_A2CV1, R8A779A0_PD_A3IR },
-       { "a2cv5",      R8A779A0_PD_A2CV4, R8A779A0_PD_A3IR },
-       { "a2cv7",      R8A779A0_PD_A2CV6, R8A779A0_PD_A3IR },
+       { "a2dp1",      R8A779A0_PD_A2DP1, R8A779A0_PD_A3IR },
+       { "a2cv2",      R8A779A0_PD_A2CV2, R8A779A0_PD_A3IR },
+       { "a2cv3",      R8A779A0_PD_A2CV3, R8A779A0_PD_A3IR },
+       { "a2cv5",      R8A779A0_PD_A2CV5, R8A779A0_PD_A3IR },
+       { "a2cv7",      R8A779A0_PD_A2CV7, R8A779A0_PD_A3IR },
        { "a2cn1",      R8A779A0_PD_A2CN1, R8A779A0_PD_A3IR },
        { "a1cnn0",     R8A779A0_PD_A1CNN0, R8A779A0_PD_A2CN0 },
        { "a1cnn2",     R8A779A0_PD_A1CNN2, R8A779A0_PD_A2CN2 },
index fe2d9825475423f0eeb697c41b8ba720ddaff1eb..388cfa8f8f9fd656a9a7b89217123517982860c2 100644 (file)
@@ -25,8 +25,8 @@
 struct rcar_gen4_sysc_area {
        const char *name;
        u8 pdr;                 /* PDRn */
-       int parent;             /* -1 if none */
-       unsigned int flags;     /* See PD_* */
+       s8 parent;              /* -1 if none */
+       u8 flags;               /* See PD_* */
 };
 
 /*
index 8d861c1cfdf78b6f03b43922ec644a2a45d2577c..266c599a0a9b9198e22e0a87817ca3764ae0c429 100644 (file)
@@ -31,8 +31,8 @@ struct rcar_sysc_area {
        u16 chan_offs;          /* Offset of PWRSR register for this area */
        u8 chan_bit;            /* Bit in PWR* (except for PWRUP in PWRSR) */
        u8 isr_bit;             /* Bit in SYSCI*R */
-       int parent;             /* -1 if none */
-       unsigned int flags;     /* See PD_* */
+       s8 parent;              /* -1 if none */
+       u8 flags;               /* See PD_* */
 };
 
 
index 1fef0e711056167280476697ec86db185e94d371..8aecbc9b197638c192ea022754c05220ab17ee5d 100644 (file)
@@ -6,6 +6,7 @@
 config SUNXI_MBUS
        bool
        default ARCH_SUNXI
+       depends on ARM || ARM64
        help
          Say y to enable the fixups needed to support the Allwinner
          MBUS DMA quirks.
index 0e4ba0f89533a8ade2f81e828a3269b621bcd6b8..6882c86b3ce541d6039ce213ada5edf0ea3be6d6 100644 (file)
@@ -338,6 +338,7 @@ static const struct of_device_id pruss_of_match[] = {
        { .compatible = "ti,am654-icssg", .data = &am65x_j721e_pruss_data, },
        { .compatible = "ti,j721e-icssg", .data = &am65x_j721e_pruss_data, },
        { .compatible = "ti,am642-icssg", .data = &am65x_j721e_pruss_data, },
+       { .compatible = "ti,am625-pruss", .data = &am65x_j721e_pruss_data, },
        {},
 };
 MODULE_DEVICE_TABLE(of, pruss_of_match);
index 0076d467ff6bff5b3d2c51a57b3005f41c6b8f7e..343c58ed58961044e03d304eeb5596a4a40bac8d 100644 (file)
@@ -688,7 +688,7 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev)
                                      &m3_ipc->sd_fw_name);
        if (ret) {
                dev_dbg(dev, "Voltage scaling data blob not provided from DT.\n");
-       };
+       }
 
        /*
         * Wait for firmware loading completion in a thread so we
index 5dcb7665fe225be9df2bb21fc0518356ce1566f9..2de082765befa7525e0156dbf5d96c9c8790f9ea 100644 (file)
@@ -647,8 +647,7 @@ static int xlnx_event_manager_probe(struct platform_device *pdev)
        cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "soc/event:starting",
                          xlnx_event_cpuhp_start, xlnx_event_cpuhp_down);
 
-       ret = zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_REGISTER_SGI, sgi_num,
-                                 0, NULL);
+       ret = zynqmp_pm_register_sgi(sgi_num, 0);
        if (ret) {
                dev_err(&pdev->dev, "SGI %d Registration over TF-A failed with %d\n", sgi_num, ret);
                xlnx_event_cleanup_sgi(pdev);
@@ -681,7 +680,7 @@ static int xlnx_event_manager_remove(struct platform_device *pdev)
                kfree(eve_data);
        }
 
-       ret = zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_REGISTER_SGI, 0, 1, NULL);
+       ret = zynqmp_pm_register_sgi(0, 1);
        if (ret)
                dev_err(&pdev->dev, "SGI unregistration over TF-A failed with %d\n", ret);
 
index 669d7573320b7220fc65564fcc80e4cdb948eead..00f7b490a95dcfdf0472ccb99e4349917a9f2046 100644 (file)
@@ -127,6 +127,71 @@ static bool find_slave(struct sdw_bus *bus,
        return true;
 }
 
+struct sdw_acpi_child_walk_data {
+       struct sdw_bus *bus;
+       struct acpi_device *adev;
+       struct sdw_slave_id id;
+       bool ignore_unique_id;
+};
+
+static int sdw_acpi_check_duplicate(struct acpi_device *adev, void *data)
+{
+       struct sdw_acpi_child_walk_data *cwd = data;
+       struct sdw_bus *bus = cwd->bus;
+       struct sdw_slave_id id;
+
+       if (adev == cwd->adev)
+               return 0;
+
+       if (!find_slave(bus, adev, &id))
+               return 0;
+
+       if (cwd->id.sdw_version != id.sdw_version || cwd->id.mfg_id != id.mfg_id ||
+           cwd->id.part_id != id.part_id || cwd->id.class_id != id.class_id)
+               return 0;
+
+       if (cwd->id.unique_id != id.unique_id) {
+               dev_dbg(bus->dev,
+                       "Valid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n",
+                       cwd->id.unique_id, id.unique_id, cwd->id.mfg_id,
+                       cwd->id.part_id);
+               cwd->ignore_unique_id = false;
+               return 0;
+       }
+
+       dev_err(bus->dev,
+               "Invalid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n",
+               cwd->id.unique_id, id.unique_id, cwd->id.mfg_id, cwd->id.part_id);
+       return -ENODEV;
+}
+
+static int sdw_acpi_find_one(struct acpi_device *adev, void *data)
+{
+       struct sdw_bus *bus = data;
+       struct sdw_acpi_child_walk_data cwd = {
+               .bus = bus,
+               .adev = adev,
+               .ignore_unique_id = true,
+       };
+       int ret;
+
+       if (!find_slave(bus, adev, &cwd.id))
+               return 0;
+
+       /* Brute-force O(N^2) search for duplicates. */
+       ret = acpi_dev_for_each_child(ACPI_COMPANION(bus->dev),
+                                     sdw_acpi_check_duplicate, &cwd);
+       if (ret)
+               return ret;
+
+       if (cwd.ignore_unique_id)
+               cwd.id.unique_id = SDW_IGNORED_UNIQUE_ID;
+
+       /* Ignore errors and continue. */
+       sdw_slave_add(bus, &cwd.id, acpi_fwnode_handle(adev));
+       return 0;
+}
+
 /*
  * sdw_acpi_find_slaves() - Find Slave devices in Master ACPI node
  * @bus: SDW bus instance
@@ -135,8 +200,7 @@ static bool find_slave(struct sdw_bus *bus,
  */
 int sdw_acpi_find_slaves(struct sdw_bus *bus)
 {
-       struct acpi_device *adev, *parent;
-       struct acpi_device *adev2, *parent2;
+       struct acpi_device *parent;
 
        parent = ACPI_COMPANION(bus->dev);
        if (!parent) {
@@ -144,54 +208,7 @@ int sdw_acpi_find_slaves(struct sdw_bus *bus)
                return -ENODEV;
        }
 
-       list_for_each_entry(adev, &parent->children, node) {
-               struct sdw_slave_id id;
-               struct sdw_slave_id id2;
-               bool ignore_unique_id = true;
-
-               if (!find_slave(bus, adev, &id))
-                       continue;
-
-               /* brute-force O(N^2) search for duplicates */
-               parent2 = parent;
-               list_for_each_entry(adev2, &parent2->children, node) {
-
-                       if (adev == adev2)
-                               continue;
-
-                       if (!find_slave(bus, adev2, &id2))
-                               continue;
-
-                       if (id.sdw_version != id2.sdw_version ||
-                           id.mfg_id != id2.mfg_id ||
-                           id.part_id != id2.part_id ||
-                           id.class_id != id2.class_id)
-                               continue;
-
-                       if (id.unique_id != id2.unique_id) {
-                               dev_dbg(bus->dev,
-                                       "Valid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n",
-                                       id.unique_id, id2.unique_id, id.mfg_id, id.part_id);
-                               ignore_unique_id = false;
-                       } else {
-                               dev_err(bus->dev,
-                                       "Invalid unique IDs 0x%x 0x%x for Slave mfg_id 0x%04x, part_id 0x%04x\n",
-                                       id.unique_id, id2.unique_id, id.mfg_id, id.part_id);
-                               return -ENODEV;
-                       }
-               }
-
-               if (ignore_unique_id)
-                       id.unique_id = SDW_IGNORED_UNIQUE_ID;
-
-               /*
-                * don't error check for sdw_slave_add as we want to continue
-                * adding Slaves
-                */
-               sdw_slave_add(bus, &id, acpi_fwnode_handle(adev));
-       }
-
-       return 0;
+       return acpi_dev_for_each_child(parent, sdw_acpi_find_one, bus);
 }
 
 #endif
index 3b1044ebc4006b58eb1f9f9ad7f5df78e3a67d44..e32f6a2058aed8baa0eb1c9c5ec0105d23ee95d1 100644 (file)
@@ -183,7 +183,7 @@ config SPI_BCM63XX
 
 config SPI_BCM63XX_HSSPI
        tristate "Broadcom BCM63XX HS SPI controller driver"
-       depends on BCM63XX || BMIPS_GENERIC || ARCH_BCM_63XX || COMPILE_TEST
+       depends on BCM63XX || BMIPS_GENERIC || ARCH_BCMBCA || COMPILE_TEST
        help
          This enables support for the High Speed SPI controller present on
          newer Broadcom BCM63XX SoCs.
@@ -371,6 +371,13 @@ config SPI_FSL_QUADSPI
          This controller does not support generic SPI messages. It only
          supports the high-level SPI memory interface.
 
+config SPI_GXP
+       tristate "GXP SPI driver"
+       depends on ARCH_HPE || COMPILE_TEST
+       help
+         This enables support for the driver for GXP bus attached SPI
+         controllers.
+
 config SPI_HISI_KUNPENG
        tristate "HiSilicon SPI Controller for Kunpeng SoCs"
        depends on (ARM64 && ACPI) || COMPILE_TEST
@@ -575,6 +582,15 @@ config SPI_MESON_SPIFC
          This enables master mode support for the SPIFC (SPI flash
          controller) available in Amlogic Meson SoCs.
 
+config SPI_MICROCHIP_CORE
+       tristate "Microchip FPGA SPI controllers"
+       depends on SPI_MASTER
+       help
+         This enables the SPI driver for Microchip FPGA SPI controllers.
+         Say Y or M here if you want to use the "hard" controllers on
+         PolarFire SoC.
+         If built as a module, it will be called spi-microchip-core.
+
 config SPI_MT65XX
        tristate "MediaTek SPI controller"
        depends on ARCH_MEDIATEK || COMPILE_TEST
index 0f44eb6083a53c47f44536eb4720df55d6a9b523..15d2f3835e45af8c04a6332e7a848eaf49c337f9 100644 (file)
@@ -57,6 +57,7 @@ obj-$(CONFIG_SPI_FSL_LPSPI)           += spi-fsl-lpspi.o
 obj-$(CONFIG_SPI_FSL_QUADSPI)          += spi-fsl-qspi.o
 obj-$(CONFIG_SPI_FSL_SPI)              += spi-fsl-spi.o
 obj-$(CONFIG_SPI_GPIO)                 += spi-gpio.o
+obj-$(CONFIG_SPI_GXP)                  += spi-gxp.o
 obj-$(CONFIG_SPI_HISI_KUNPENG)         += spi-hisi-kunpeng.o
 obj-$(CONFIG_SPI_HISI_SFC_V3XX)                += spi-hisi-sfc-v3xx.o
 obj-$(CONFIG_SPI_IMG_SPFI)             += spi-img-spfi.o
@@ -71,6 +72,7 @@ obj-$(CONFIG_SPI_LM70_LLP)            += spi-lm70llp.o
 obj-$(CONFIG_SPI_LP8841_RTC)           += spi-lp8841-rtc.o
 obj-$(CONFIG_SPI_MESON_SPICC)          += spi-meson-spicc.o
 obj-$(CONFIG_SPI_MESON_SPIFC)          += spi-meson-spifc.o
+obj-$(CONFIG_SPI_MICROCHIP_CORE)       += spi-microchip-core.o
 obj-$(CONFIG_SPI_MPC512x_PSC)          += spi-mpc512x-psc.o
 obj-$(CONFIG_SPI_MPC52xx_PSC)          += spi-mpc52xx-psc.o
 obj-$(CONFIG_SPI_MPC52xx)              += spi-mpc52xx.o
index 480c0c8c18e49d7a6cfb556d5db26e601b754389..976a217e356d5e53eb626b83fe6921797921cb9d 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/spi/spi-mem.h>
 
 /* QSPI register offsets */
@@ -285,7 +286,7 @@ static bool atmel_qspi_supports_op(struct spi_mem *mem,
 
        /* special case not supported by hardware */
        if (op->addr.nbytes == 2 && op->cmd.buswidth != op->addr.buswidth &&
-               op->dummy.nbytes == 0)
+           op->dummy.nbytes == 0)
                return false;
 
        return true;
@@ -417,9 +418,13 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
        if (op->addr.val + op->data.nbytes > aq->mmap_size)
                return -ENOTSUPP;
 
+       err = pm_runtime_resume_and_get(&aq->pdev->dev);
+       if (err < 0)
+               return err;
+
        err = atmel_qspi_set_cfg(aq, op, &offset);
        if (err)
-               return err;
+               goto pm_runtime_put;
 
        /* Skip to the final steps if there is no data */
        if (op->data.nbytes) {
@@ -441,7 +446,7 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
        /* Poll INSTRuction End status */
        sr = atmel_qspi_read(aq, QSPI_SR);
        if ((sr & QSPI_SR_CMD_COMPLETED) == QSPI_SR_CMD_COMPLETED)
-               return err;
+               goto pm_runtime_put;
 
        /* Wait for INSTRuction End interrupt */
        reinit_completion(&aq->cmd_completion);
@@ -452,6 +457,9 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
                err = -ETIMEDOUT;
        atmel_qspi_write(QSPI_SR_CMD_COMPLETED, aq, QSPI_IDR);
 
+pm_runtime_put:
+       pm_runtime_mark_last_busy(&aq->pdev->dev);
+       pm_runtime_put_autosuspend(&aq->pdev->dev);
        return err;
 }
 
@@ -472,6 +480,7 @@ static int atmel_qspi_setup(struct spi_device *spi)
        struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
        unsigned long src_rate;
        u32 scbr;
+       int ret;
 
        if (ctrl->busy)
                return -EBUSY;
@@ -488,9 +497,16 @@ static int atmel_qspi_setup(struct spi_device *spi)
        if (scbr > 0)
                scbr--;
 
+       ret = pm_runtime_resume_and_get(ctrl->dev.parent);
+       if (ret < 0)
+               return ret;
+
        aq->scr = QSPI_SCR_SCBR(scbr);
        atmel_qspi_write(aq->scr, aq, QSPI_SCR);
 
+       pm_runtime_mark_last_busy(ctrl->dev.parent);
+       pm_runtime_put_autosuspend(ctrl->dev.parent);
+
        return 0;
 }
 
@@ -621,11 +637,24 @@ static int atmel_qspi_probe(struct platform_device *pdev)
        if (err)
                goto disable_qspick;
 
+       pm_runtime_set_autosuspend_delay(&pdev->dev, 500);
+       pm_runtime_use_autosuspend(&pdev->dev);
+       pm_runtime_set_active(&pdev->dev);
+       pm_runtime_enable(&pdev->dev);
+       pm_runtime_get_noresume(&pdev->dev);
+
        atmel_qspi_init(aq);
 
        err = spi_register_controller(ctrl);
-       if (err)
+       if (err) {
+               pm_runtime_put_noidle(&pdev->dev);
+               pm_runtime_disable(&pdev->dev);
+               pm_runtime_set_suspended(&pdev->dev);
+               pm_runtime_dont_use_autosuspend(&pdev->dev);
                goto disable_qspick;
+       }
+       pm_runtime_mark_last_busy(&pdev->dev);
+       pm_runtime_put_autosuspend(&pdev->dev);
 
        return 0;
 
@@ -641,9 +670,18 @@ static int atmel_qspi_remove(struct platform_device *pdev)
 {
        struct spi_controller *ctrl = platform_get_drvdata(pdev);
        struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
+       int ret;
+
+       ret = pm_runtime_resume_and_get(&pdev->dev);
+       if (ret < 0)
+               return ret;
 
        spi_unregister_controller(ctrl);
        atmel_qspi_write(QSPI_CR_QSPIDIS, aq, QSPI_CR);
+
+       pm_runtime_disable(&pdev->dev);
+       pm_runtime_put_noidle(&pdev->dev);
+
        clk_disable_unprepare(aq->qspick);
        clk_disable_unprepare(aq->pclk);
        return 0;
@@ -653,10 +691,19 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev)
 {
        struct spi_controller *ctrl = dev_get_drvdata(dev);
        struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
+       int ret;
+
+       ret = pm_runtime_resume_and_get(dev);
+       if (ret < 0)
+               return ret;
 
        atmel_qspi_write(QSPI_CR_QSPIDIS, aq, QSPI_CR);
-       clk_disable_unprepare(aq->qspick);
-       clk_disable_unprepare(aq->pclk);
+
+       pm_runtime_mark_last_busy(dev);
+       pm_runtime_force_suspend(dev);
+
+       clk_unprepare(aq->qspick);
+       clk_unprepare(aq->pclk);
 
        return 0;
 }
@@ -665,19 +712,54 @@ static int __maybe_unused atmel_qspi_resume(struct device *dev)
 {
        struct spi_controller *ctrl = dev_get_drvdata(dev);
        struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
+       int ret;
 
-       clk_prepare_enable(aq->pclk);
-       clk_prepare_enable(aq->qspick);
+       clk_prepare(aq->pclk);
+       clk_prepare(aq->qspick);
+
+       ret = pm_runtime_force_resume(dev);
+       if (ret < 0)
+               return ret;
 
        atmel_qspi_init(aq);
 
        atmel_qspi_write(aq->scr, aq, QSPI_SCR);
 
+       pm_runtime_mark_last_busy(dev);
+       pm_runtime_put_autosuspend(dev);
+
+       return 0;
+}
+
+static int __maybe_unused atmel_qspi_runtime_suspend(struct device *dev)
+{
+       struct spi_controller *ctrl = dev_get_drvdata(dev);
+       struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
+
+       clk_disable(aq->qspick);
+       clk_disable(aq->pclk);
+
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(atmel_qspi_pm_ops, atmel_qspi_suspend,
-                        atmel_qspi_resume);
+static int __maybe_unused atmel_qspi_runtime_resume(struct device *dev)
+{
+       struct spi_controller *ctrl = dev_get_drvdata(dev);
+       struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
+       int ret;
+
+       ret = clk_enable(aq->pclk);
+       if (ret)
+               return ret;
+
+       return clk_enable(aq->qspick);
+}
+
+static const struct dev_pm_ops __maybe_unused atmel_qspi_pm_ops = {
+       SET_SYSTEM_SLEEP_PM_OPS(atmel_qspi_suspend, atmel_qspi_resume)
+       SET_RUNTIME_PM_OPS(atmel_qspi_runtime_suspend,
+                          atmel_qspi_runtime_resume, NULL)
+};
 
 static const struct atmel_qspi_caps atmel_sama5d2_qspi_caps = {};
 
@@ -704,7 +786,7 @@ static struct platform_driver atmel_qspi_driver = {
        .driver = {
                .name   = "atmel_qspi",
                .of_match_table = atmel_qspi_dt_ids,
-               .pm     = &atmel_qspi_pm_ops,
+               .pm     = pm_ptr(&atmel_qspi_pm_ops),
        },
        .probe          = atmel_qspi_probe,
        .remove         = atmel_qspi_remove,
index ca40923258af30741f085368ab16d1586e638c41..596e181ae1368678ccfe13f1a83f24aaa993aa63 100644 (file)
@@ -128,9 +128,9 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
        struct spi_master *master;
        struct altera_spi *hw;
        void __iomem *base;
-       int err = -ENODEV;
+       int err;
 
-       master = spi_alloc_master(dev, sizeof(struct altera_spi));
+       master = devm_spi_alloc_master(dev, sizeof(struct altera_spi));
        if (!master)
                return -ENOMEM;
 
@@ -159,10 +159,9 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
        altera_spi_init_master(master);
 
        err = devm_spi_register_master(dev, master);
-       if (err) {
-               dev_err(dev, "%s failed to register spi master %d\n", __func__, err);
-               goto exit;
-       }
+       if (err)
+               return dev_err_probe(dev, err, "%s failed to register spi master\n",
+                                    __func__);
 
        if (dfl_dev->revision == FME_FEATURE_REV_MAX10_SPI_N5010)
                strscpy(board_info.modalias, "m10-n5010", SPI_NAME_SIZE);
@@ -179,9 +178,6 @@ static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)
        }
 
        return 0;
-exit:
-       spi_master_put(master);
-       return err;
 }
 
 static const struct dfl_device_id dfl_spi_altera_ids[] = {
index efdcbe6c4c2665c5a3d350b9e95f6d7af7ef53b0..08df4f8d0531ca767f56a0e33d3d1b8f55f4647b 100644 (file)
 #define AMD_SPI_XFER_TX                1
 #define AMD_SPI_XFER_RX                2
 
+/**
+ * enum amd_spi_versions - SPI controller versions
+ * @AMD_SPI_V1:                AMDI0061 hardware version
+ * @AMD_SPI_V2:                AMDI0062 hardware version
+ */
 enum amd_spi_versions {
-       AMD_SPI_V1 = 1, /* AMDI0061 */
-       AMD_SPI_V2,     /* AMDI0062 */
+       AMD_SPI_V1 = 1,
+       AMD_SPI_V2,
 };
 
+/**
+ * struct amd_spi - SPI driver instance
+ * @io_remap_addr:     Start address of the SPI controller registers
+ * @version:           SPI controller hardware version
+ */
 struct amd_spi {
        void __iomem *io_remap_addr;
-       unsigned long io_base_addr;
        enum amd_spi_versions version;
 };
 
@@ -281,22 +290,19 @@ static int amd_spi_probe(struct platform_device *pdev)
        struct device *dev = &pdev->dev;
        struct spi_master *master;
        struct amd_spi *amd_spi;
-       int err = 0;
+       int err;
 
        /* Allocate storage for spi_master and driver private data */
-       master = spi_alloc_master(dev, sizeof(struct amd_spi));
-       if (!master) {
-               dev_err(dev, "Error allocating SPI master\n");
-               return -ENOMEM;
-       }
+       master = devm_spi_alloc_master(dev, sizeof(struct amd_spi));
+       if (!master)
+               return dev_err_probe(dev, -ENOMEM, "Error allocating SPI master\n");
 
        amd_spi = spi_master_get_devdata(master);
        amd_spi->io_remap_addr = devm_platform_ioremap_resource(pdev, 0);
-       if (IS_ERR(amd_spi->io_remap_addr)) {
-               err = PTR_ERR(amd_spi->io_remap_addr);
-               dev_err(dev, "error %d ioremap of SPI registers failed\n", err);
-               goto err_free_master;
-       }
+       if (IS_ERR(amd_spi->io_remap_addr))
+               return dev_err_probe(dev, PTR_ERR(amd_spi->io_remap_addr),
+                                    "ioremap of SPI registers failed\n");
+
        dev_dbg(dev, "io_remap_address: %p\n", amd_spi->io_remap_addr);
 
        amd_spi->version = (enum amd_spi_versions) device_get_match_data(dev);
@@ -313,17 +319,10 @@ static int amd_spi_probe(struct platform_device *pdev)
 
        /* Register the controller with SPI framework */
        err = devm_spi_register_master(dev, master);
-       if (err) {
-               dev_err(dev, "error %d registering SPI controller\n", err);
-               goto err_free_master;
-       }
+       if (err)
+               return dev_err_probe(dev, err, "error registering SPI controller\n");
 
        return 0;
-
-err_free_master:
-       spi_master_put(master);
-
-       return err;
 }
 
 #ifdef CONFIG_ACPI
index d8cc4b270644adfb06a0b55262eb8eecf9abf9d7..9df9fc40b783139347fa9be817478b7f8c0ff9ba 100644 (file)
@@ -497,7 +497,7 @@ static int a3700_spi_fifo_write(struct a3700_spi *a3700_spi)
 
        while (!a3700_is_wfifo_full(a3700_spi) && a3700_spi->buf_len) {
                val = *(u32 *)a3700_spi->tx_buf;
-               spireg_write(a3700_spi, A3700_SPI_DATA_OUT_REG, val);
+               spireg_write(a3700_spi, A3700_SPI_DATA_OUT_REG, cpu_to_le32(val));
                a3700_spi->buf_len -= 4;
                a3700_spi->tx_buf += 4;
        }
@@ -519,7 +519,7 @@ static int a3700_spi_fifo_read(struct a3700_spi *a3700_spi)
        while (!a3700_is_rfifo_empty(a3700_spi) && a3700_spi->buf_len) {
                val = spireg_read(a3700_spi, A3700_SPI_DATA_IN_REG);
                if (a3700_spi->buf_len >= 4) {
-
+                       val = le32_to_cpu(val);
                        memcpy(a3700_spi->rx_buf, &val, 4);
 
                        a3700_spi->buf_len -= 4;
index 9e300a932699cfd8c0813f09aa91aa0fb9c30c83..c4f22d50dba589f2b6630c22ebb39a5dd81c4bec 100644 (file)
@@ -1631,7 +1631,6 @@ static int atmel_spi_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int atmel_spi_runtime_suspend(struct device *dev)
 {
        struct spi_master *master = dev_get_drvdata(dev);
@@ -1653,7 +1652,6 @@ static int atmel_spi_runtime_resume(struct device *dev)
        return clk_prepare_enable(as->clk);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int atmel_spi_suspend(struct device *dev)
 {
        struct spi_master *master = dev_get_drvdata(dev);
@@ -1693,17 +1691,12 @@ static int atmel_spi_resume(struct device *dev)
        /* Start the queue running */
        return spi_master_resume(master);
 }
-#endif
 
 static const struct dev_pm_ops atmel_spi_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume)
-       SET_RUNTIME_PM_OPS(atmel_spi_runtime_suspend,
-                          atmel_spi_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume)
+       RUNTIME_PM_OPS(atmel_spi_runtime_suspend,
+                      atmel_spi_runtime_resume, NULL)
 };
-#define ATMEL_SPI_PM_OPS       (&atmel_spi_pm_ops)
-#else
-#define ATMEL_SPI_PM_OPS       NULL
-#endif
 
 static const struct of_device_id atmel_spi_dt_ids[] = {
        { .compatible = "atmel,at91rm9200-spi" },
@@ -1715,7 +1708,7 @@ MODULE_DEVICE_TABLE(of, atmel_spi_dt_ids);
 static struct platform_driver atmel_spi_driver = {
        .driver         = {
                .name   = "atmel_spi",
-               .pm     = ATMEL_SPI_PM_OPS,
+               .pm     = pm_ptr(&atmel_spi_pm_ops),
                .of_match_table = atmel_spi_dt_ids,
        },
        .probe          = atmel_spi_probe,
index 0933948d7df3d85c489395e84931f7f346dc61c8..747e03228c487237998802313bd0c8d3491b9bef 100644 (file)
@@ -372,6 +372,10 @@ static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id)
        struct bcm2835_spi *bs = dev_id;
        u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS);
 
+       /* Bail out early if interrupts are not enabled */
+       if (!(cs & BCM2835_SPI_CS_INTR))
+               return IRQ_NONE;
+
        /*
         * An interrupt is signaled either if DONE is set (TX FIFO empty)
         * or if RXR is set (RX FIFO >= ¾ full).
@@ -1369,8 +1373,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
        bcm2835_wr(bs, BCM2835_SPI_CS,
                   BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
 
-       err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt, 0,
-                              dev_name(&pdev->dev), bs);
+       err = devm_request_irq(&pdev->dev, bs->irq, bcm2835_spi_interrupt,
+                              IRQF_SHARED, dev_name(&pdev->dev), bs);
        if (err) {
                dev_err(&pdev->dev, "could not request IRQ: %d\n", err);
                goto out_dma_release;
index ecea471ff42c25f2506205cf76ff17c3d75c709b..f87d97ccd2d68330f456c0ce81f5bf62e0c95dc0 100644 (file)
@@ -307,8 +307,9 @@ static u32 dw_spi_prepare_cr0(struct dw_spi *dws, struct spi_device *spi)
                if (spi->mode & SPI_LOOP)
                        cr0 |= DW_HSSI_CTRLR0_SRL;
 
-               if (dws->caps & DW_SPI_CAP_KEEMBAY_MST)
-                       cr0 |= DW_HSSI_CTRLR0_KEEMBAY_MST;
+               /* CTRLR0[31] MST */
+               if (dw_spi_ver_is_ge(dws, HSSI, 102A))
+                       cr0 |= DW_HSSI_CTRLR0_MST;
        }
 
        return cr0;
@@ -942,7 +943,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
 
        if (dws->dma_ops && dws->dma_ops->dma_init) {
                ret = dws->dma_ops->dma_init(dev, dws);
-               if (ret) {
+               if (ret == -EPROBE_DEFER) {
+                       goto err_free_irq;
+               } else if (ret) {
                        dev_warn(dev, "DMA init failed\n");
                } else {
                        master->can_dma = dws->dma_ops->can_dma;
@@ -963,6 +966,7 @@ err_dma_exit:
        if (dws->dma_ops && dws->dma_ops->dma_exit)
                dws->dma_ops->dma_exit(dws);
        dw_spi_enable_chip(dws, 0);
+err_free_irq:
        free_irq(dws->irq, master);
 err_free_master:
        spi_controller_put(master);
index 63e5260100ecb97137cfc410728f0309a9a60f52..1322b8cce5b7c542f39b2022105fb50ed7aa1a26 100644 (file)
@@ -139,15 +139,20 @@ err_exit:
 
 static int dw_spi_dma_init_generic(struct device *dev, struct dw_spi *dws)
 {
-       dws->rxchan = dma_request_slave_channel(dev, "rx");
-       if (!dws->rxchan)
-               return -ENODEV;
+       int ret;
 
-       dws->txchan = dma_request_slave_channel(dev, "tx");
-       if (!dws->txchan) {
-               dma_release_channel(dws->rxchan);
+       dws->rxchan = dma_request_chan(dev, "rx");
+       if (IS_ERR(dws->rxchan)) {
+               ret = PTR_ERR(dws->rxchan);
                dws->rxchan = NULL;
-               return -ENODEV;
+               goto err_exit;
+       }
+
+       dws->txchan = dma_request_chan(dev, "tx");
+       if (IS_ERR(dws->txchan)) {
+               ret = PTR_ERR(dws->txchan);
+               dws->txchan = NULL;
+               goto free_rxchan;
        }
 
        dws->master->dma_rx = dws->rxchan;
@@ -160,6 +165,12 @@ static int dw_spi_dma_init_generic(struct device *dev, struct dw_spi *dws)
        dw_spi_dma_sg_burst_init(dws);
 
        return 0;
+
+free_rxchan:
+       dma_release_channel(dws->rxchan);
+       dws->rxchan = NULL;
+err_exit:
+       return ret;
 }
 
 static void dw_spi_dma_exit(struct dw_spi *dws)
index 5101c4c6017b6e41e135e2c793ad84adec54a2a9..26c40ea6dd1292c408ea5550f1ea81a60418fa6b 100644 (file)
@@ -214,11 +214,10 @@ static int dw_spi_hssi_init(struct platform_device *pdev,
        return 0;
 }
 
-static int dw_spi_keembay_init(struct platform_device *pdev,
-                              struct dw_spi_mmio *dwsmmio)
+static int dw_spi_intel_init(struct platform_device *pdev,
+                            struct dw_spi_mmio *dwsmmio)
 {
        dwsmmio->dws.ip = DW_HSSI_ID;
-       dwsmmio->dws.caps = DW_SPI_CAP_KEEMBAY_MST;
 
        return 0;
 }
@@ -349,7 +348,8 @@ static const struct of_device_id dw_spi_mmio_of_match[] = {
        { .compatible = "amazon,alpine-dw-apb-ssi", .data = dw_spi_alpine_init},
        { .compatible = "renesas,rzn1-spi", .data = dw_spi_pssi_init},
        { .compatible = "snps,dwc-ssi-1.01a", .data = dw_spi_hssi_init},
-       { .compatible = "intel,keembay-ssi", .data = dw_spi_keembay_init},
+       { .compatible = "intel,keembay-ssi", .data = dw_spi_intel_init},
+       { .compatible = "intel,thunderbay-ssi", .data = dw_spi_intel_init},
        { .compatible = "microchip,sparx5-spi", dw_spi_mscc_sparx5_init},
        { .compatible = "canaan,k210-spi", dw_spi_canaan_k210_init},
        { /* end of table */}
index d5ee5130601e1815bb0aa46947c3809b7eeb17ef..9e8eb2b52d5c79695274fe09b73e98f5447f9ab5 100644 (file)
@@ -23,7 +23,7 @@
        ((_dws)->ip == DW_ ## _ip ## _ID)
 
 #define __dw_spi_ver_cmp(_dws, _ip, _ver, _op) \
-       (dw_spi_ip_is(_dws, _ip) && (_dws)->ver _op DW_ ## _ip ## _ver)
+       (dw_spi_ip_is(_dws, _ip) && (_dws)->ver _op DW_ ## _ip ## _ ## _ver)
 
 #define dw_spi_ver_is(_dws, _ip, _ver) __dw_spi_ver_cmp(_dws, _ip, _ver, ==)
 
@@ -31,8 +31,7 @@
 
 /* DW SPI controller capabilities */
 #define DW_SPI_CAP_CS_OVERRIDE         BIT(0)
-#define DW_SPI_CAP_KEEMBAY_MST         BIT(1)
-#define DW_SPI_CAP_DFS32               BIT(2)
+#define DW_SPI_CAP_DFS32               BIT(1)
 
 /* Register offsets (Generic for both DWC APB SSI and DWC SSI IP-cores) */
 #define DW_SPI_CTRLR0                  0x00
 #define DW_HSSI_CTRLR0_SCPOL                   BIT(9)
 #define DW_HSSI_CTRLR0_TMOD_MASK               GENMASK(11, 10)
 #define DW_HSSI_CTRLR0_SRL                     BIT(13)
-
-/*
- * For Keem Bay, CTRLR0[31] is used to select controller mode.
- * 0: SSI is slave
- * 1: SSI is master
- */
-#define DW_HSSI_CTRLR0_KEEMBAY_MST             BIT(31)
+#define DW_HSSI_CTRLR0_MST                     BIT(31)
 
 /* Bit fields in CTRLR1 */
 #define DW_SPI_NDF_MASK                                GENMASK(15, 0)
index 72ab066ce552386b6a52ef2328528fc740a7907f..cf1e4f9ebd7276ec615cbf0d5ee87957fa79617b 100644 (file)
@@ -24,8 +24,7 @@
 #define FSI2SPI_IRQ                    0x20
 
 #define SPI_FSI_BASE                   0x70000
-#define SPI_FSI_INIT_TIMEOUT_MS                1000
-#define SPI_FSI_STATUS_TIMEOUT_MS      100
+#define SPI_FSI_TIMEOUT_MS             1000
 #define SPI_FSI_MAX_RX_SIZE            8
 #define SPI_FSI_MAX_TX_SIZE            40
 
@@ -299,6 +298,7 @@ static void fsi_spi_sequence_init(struct fsi_spi_sequence *seq)
 static int fsi_spi_transfer_data(struct fsi_spi *ctx,
                                 struct spi_transfer *transfer)
 {
+       int loops;
        int rc = 0;
        unsigned long end;
        u64 status = 0ULL;
@@ -317,9 +317,10 @@ static int fsi_spi_transfer_data(struct fsi_spi *ctx,
                        if (rc)
                                return rc;
 
-                       end = jiffies + msecs_to_jiffies(SPI_FSI_STATUS_TIMEOUT_MS);
+                       loops = 0;
+                       end = jiffies + msecs_to_jiffies(SPI_FSI_TIMEOUT_MS);
                        do {
-                               if (time_after(jiffies, end))
+                               if (loops++ && time_after(jiffies, end))
                                        return -ETIMEDOUT;
 
                                rc = fsi_spi_status(ctx, &status, "TX");
@@ -335,9 +336,10 @@ static int fsi_spi_transfer_data(struct fsi_spi *ctx,
                u8 *rx = transfer->rx_buf;
 
                while (transfer->len > recv) {
-                       end = jiffies + msecs_to_jiffies(SPI_FSI_STATUS_TIMEOUT_MS);
+                       loops = 0;
+                       end = jiffies + msecs_to_jiffies(SPI_FSI_TIMEOUT_MS);
                        do {
-                               if (time_after(jiffies, end))
+                               if (loops++ && time_after(jiffies, end))
                                        return -ETIMEDOUT;
 
                                rc = fsi_spi_status(ctx, &status, "RX");
@@ -359,6 +361,7 @@ static int fsi_spi_transfer_data(struct fsi_spi *ctx,
 
 static int fsi_spi_transfer_init(struct fsi_spi *ctx)
 {
+       int loops = 0;
        int rc;
        bool reset = false;
        unsigned long end;
@@ -369,9 +372,9 @@ static int fsi_spi_transfer_init(struct fsi_spi *ctx)
                SPI_FSI_CLOCK_CFG_SCK_NO_DEL |
                FIELD_PREP(SPI_FSI_CLOCK_CFG_SCK_DIV, 19);
 
-       end = jiffies + msecs_to_jiffies(SPI_FSI_INIT_TIMEOUT_MS);
+       end = jiffies + msecs_to_jiffies(SPI_FSI_TIMEOUT_MS);
        do {
-               if (time_after(jiffies, end))
+               if (loops++ && time_after(jiffies, end))
                        return -ETIMEDOUT;
 
                rc = fsi_spi_read_reg(ctx, SPI_FSI_STATUS, &status);
diff --git a/drivers/spi/spi-gxp.c b/drivers/spi/spi-gxp.c
new file mode 100644 (file)
index 0000000..9ea355f
--- /dev/null
@@ -0,0 +1,325 @@
+// SPDX-License-Identifier: GPL-2.0=or-later
+/* Copyright (C) 2022 Hewlett-Packard Development Company, L.P. */
+
+#include <linux/iopoll.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/spi-mem.h>
+
+#define GXP_SPI0_MAX_CHIPSELECT        2
+#define GXP_SPI_SLEEP_TIME     1
+#define GXP_SPI_TIMEOUT (130 * 1000000 / GXP_SPI_SLEEP_TIME)
+
+#define MANUAL_MODE            0
+#define DIRECT_MODE            1
+#define SPILDAT_LEN            256
+
+#define OFFSET_SPIMCFG         0x0
+#define OFFSET_SPIMCTRL                0x4
+#define OFFSET_SPICMD          0x5
+#define OFFSET_SPIDCNT         0x6
+#define OFFSET_SPIADDR         0x8
+#define OFFSET_SPIINTSTS       0xc
+
+#define SPIMCTRL_START         0x01
+#define SPIMCTRL_BUSY          0x02
+#define SPIMCTRL_DIR           0x08
+
+struct gxp_spi;
+
+struct gxp_spi_chip {
+       struct gxp_spi *spifi;
+       u32 cs;
+};
+
+struct gxp_spi_data {
+       u32 max_cs;
+       u32 mode_bits;
+};
+
+struct gxp_spi {
+       const struct gxp_spi_data *data;
+       void __iomem *reg_base;
+       void __iomem *dat_base;
+       void __iomem *dir_base;
+       struct device *dev;
+       struct gxp_spi_chip chips[GXP_SPI0_MAX_CHIPSELECT];
+};
+
+static void gxp_spi_set_mode(struct gxp_spi *spifi, int mode)
+{
+       u8 value;
+       void __iomem *reg_base = spifi->reg_base;
+
+       value = readb(reg_base + OFFSET_SPIMCTRL);
+
+       if (mode == MANUAL_MODE) {
+               writeb(0x55, reg_base + OFFSET_SPICMD);
+               writeb(0xaa, reg_base + OFFSET_SPICMD);
+               value &= ~0x30;
+       } else {
+               value |= 0x30;
+       }
+       writeb(value, reg_base + OFFSET_SPIMCTRL);
+}
+
+static int gxp_spi_read_reg(struct gxp_spi_chip *chip, const struct spi_mem_op *op)
+{
+       int ret;
+       struct gxp_spi *spifi = chip->spifi;
+       void __iomem *reg_base = spifi->reg_base;
+       u32 value;
+
+       value = readl(reg_base + OFFSET_SPIMCFG);
+       value &= ~(1 << 24);
+       value |= (chip->cs << 24);
+       value &= ~(0x07 << 16);
+       value &= ~(0x1f << 19);
+       writel(value, reg_base + OFFSET_SPIMCFG);
+
+       writel(0, reg_base + OFFSET_SPIADDR);
+
+       writeb(op->cmd.opcode, reg_base + OFFSET_SPICMD);
+
+       writew(op->data.nbytes, reg_base + OFFSET_SPIDCNT);
+
+       value = readb(reg_base + OFFSET_SPIMCTRL);
+       value &= ~SPIMCTRL_DIR;
+       value |= SPIMCTRL_START;
+
+       writeb(value, reg_base + OFFSET_SPIMCTRL);
+
+       ret = readb_poll_timeout(reg_base + OFFSET_SPIMCTRL, value,
+                                !(value & SPIMCTRL_BUSY),
+                                GXP_SPI_SLEEP_TIME, GXP_SPI_TIMEOUT);
+       if (ret) {
+               dev_warn(spifi->dev, "read reg busy time out\n");
+               return ret;
+       }
+
+       memcpy_fromio(op->data.buf.in, spifi->dat_base, op->data.nbytes);
+       return ret;
+}
+
+static int gxp_spi_write_reg(struct gxp_spi_chip *chip, const struct spi_mem_op *op)
+{
+       int ret;
+       struct gxp_spi *spifi = chip->spifi;
+       void __iomem *reg_base = spifi->reg_base;
+       u32 value;
+
+       value = readl(reg_base + OFFSET_SPIMCFG);
+       value &= ~(1 << 24);
+       value |= (chip->cs << 24);
+       value &= ~(0x07 << 16);
+       value &= ~(0x1f << 19);
+       writel(value, reg_base + OFFSET_SPIMCFG);
+
+       writel(0, reg_base + OFFSET_SPIADDR);
+
+       writeb(op->cmd.opcode, reg_base + OFFSET_SPICMD);
+
+       memcpy_toio(spifi->dat_base, op->data.buf.in, op->data.nbytes);
+
+       writew(op->data.nbytes, reg_base + OFFSET_SPIDCNT);
+
+       value = readb(reg_base + OFFSET_SPIMCTRL);
+       value |= SPIMCTRL_DIR;
+       value |= SPIMCTRL_START;
+
+       writeb(value, reg_base + OFFSET_SPIMCTRL);
+
+       ret = readb_poll_timeout(reg_base + OFFSET_SPIMCTRL, value,
+                                !(value & SPIMCTRL_BUSY),
+                                GXP_SPI_SLEEP_TIME, GXP_SPI_TIMEOUT);
+       if (ret)
+               dev_warn(spifi->dev, "write reg busy time out\n");
+
+       return ret;
+}
+
+static ssize_t gxp_spi_read(struct gxp_spi_chip *chip, const struct spi_mem_op *op)
+{
+       struct gxp_spi *spifi = chip->spifi;
+       u32 offset = op->addr.val;
+
+       if (chip->cs == 0)
+               offset += 0x4000000;
+
+       memcpy_fromio(op->data.buf.in, spifi->dir_base + offset, op->data.nbytes);
+
+       return 0;
+}
+
+static ssize_t gxp_spi_write(struct gxp_spi_chip *chip, const struct spi_mem_op *op)
+{
+       struct gxp_spi *spifi = chip->spifi;
+       void __iomem *reg_base = spifi->reg_base;
+       u32 write_len;
+       u32 value;
+       int ret;
+
+       write_len = op->data.nbytes;
+       if (write_len > SPILDAT_LEN)
+               write_len = SPILDAT_LEN;
+
+       value = readl(reg_base + OFFSET_SPIMCFG);
+       value &= ~(1 << 24);
+       value |= (chip->cs << 24);
+       value &= ~(0x07 << 16);
+       value |= (op->addr.nbytes << 16);
+       value &= ~(0x1f << 19);
+       writel(value, reg_base + OFFSET_SPIMCFG);
+
+       writel(op->addr.val, reg_base + OFFSET_SPIADDR);
+
+       writeb(op->cmd.opcode, reg_base + OFFSET_SPICMD);
+
+       writew(write_len, reg_base + OFFSET_SPIDCNT);
+
+       memcpy_toio(spifi->dat_base, op->data.buf.in, write_len);
+
+       value = readb(reg_base + OFFSET_SPIMCTRL);
+       value |= SPIMCTRL_DIR;
+       value |= SPIMCTRL_START;
+
+       writeb(value, reg_base + OFFSET_SPIMCTRL);
+
+       ret = readb_poll_timeout(reg_base + OFFSET_SPIMCTRL, value,
+                                !(value & SPIMCTRL_BUSY),
+                                GXP_SPI_SLEEP_TIME, GXP_SPI_TIMEOUT);
+       if (ret) {
+               dev_warn(spifi->dev, "write busy time out\n");
+               return ret;
+       }
+
+       return write_len;
+}
+
+static int do_gxp_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op)
+{
+       struct gxp_spi *spifi = spi_controller_get_devdata(mem->spi->master);
+       struct gxp_spi_chip *chip = &spifi->chips[mem->spi->chip_select];
+       int ret;
+
+       if (op->data.dir == SPI_MEM_DATA_IN) {
+               if (!op->addr.nbytes)
+                       ret = gxp_spi_read_reg(chip, op);
+               else
+                       ret = gxp_spi_read(chip, op);
+       } else {
+               if (!op->addr.nbytes)
+                       ret = gxp_spi_write_reg(chip, op);
+               else
+                       ret = gxp_spi_write(chip, op);
+       }
+
+       return ret;
+}
+
+static int gxp_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op)
+{
+       int ret;
+
+       ret = do_gxp_exec_mem_op(mem, op);
+       if (ret)
+               dev_err(&mem->spi->dev, "operation failed: %d", ret);
+
+       return ret;
+}
+
+static const struct spi_controller_mem_ops gxp_spi_mem_ops = {
+       .exec_op = gxp_exec_mem_op,
+};
+
+static int gxp_spi_setup(struct spi_device *spi)
+{
+       struct gxp_spi *spifi = spi_controller_get_devdata(spi->master);
+       unsigned int cs = spi->chip_select;
+       struct gxp_spi_chip *chip = &spifi->chips[cs];
+
+       chip->spifi = spifi;
+       chip->cs = cs;
+
+       gxp_spi_set_mode(spifi, MANUAL_MODE);
+
+       return 0;
+}
+
+static int gxp_spifi_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       const struct gxp_spi_data *data;
+       struct spi_controller *ctlr;
+       struct gxp_spi *spifi;
+       struct resource *res;
+       int ret;
+
+       data = of_device_get_match_data(&pdev->dev);
+
+       ctlr = devm_spi_alloc_master(dev, sizeof(*spifi));
+       if (!ctlr)
+               return -ENOMEM;
+
+       spifi = spi_controller_get_devdata(ctlr);
+
+       platform_set_drvdata(pdev, spifi);
+       spifi->data = data;
+       spifi->dev = dev;
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       spifi->reg_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(spifi->reg_base))
+               return PTR_ERR(spifi->reg_base);
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+       spifi->dat_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(spifi->dat_base))
+               return PTR_ERR(spifi->dat_base);
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
+       spifi->dir_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(spifi->dir_base))
+               return PTR_ERR(spifi->dir_base);
+
+       ctlr->mode_bits = data->mode_bits;
+       ctlr->bus_num = pdev->id;
+       ctlr->mem_ops = &gxp_spi_mem_ops;
+       ctlr->setup = gxp_spi_setup;
+       ctlr->num_chipselect = data->max_cs;
+       ctlr->dev.of_node = dev->of_node;
+
+       ret = devm_spi_register_controller(dev, ctlr);
+       if (ret) {
+               return dev_err_probe(&pdev->dev, ret,
+                                    "failed to register spi controller\n");
+       }
+
+       return 0;
+}
+
+static const struct gxp_spi_data gxp_spifi_data = {
+       .max_cs = 2,
+       .mode_bits = 0,
+};
+
+static const struct of_device_id gxp_spifi_match[] = {
+       {.compatible = "hpe,gxp-spifi", .data = &gxp_spifi_data },
+       { /* null */ }
+};
+MODULE_DEVICE_TABLE(of, gxp_spifi_match);
+
+static struct platform_driver gxp_spifi_driver = {
+       .probe = gxp_spifi_probe,
+       .driver = {
+               .name = "gxp-spifi",
+               .of_match_table = gxp_spifi_match,
+       },
+};
+module_platform_driver(gxp_spifi_driver);
+
+MODULE_DESCRIPTION("HPE GXP SPI Flash Interface driver");
+MODULE_AUTHOR("Nick Hawkins <nick.hawkins@hpe.com>");
+MODULE_LICENSE("GPL");
index f6eec7a869b6a7a3a0c05aa3bb134102e50b394d..f0d532ea40e82df79d258d6d2b5b25f9c8b7e41b 100644 (file)
@@ -74,6 +74,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
        { PCI_VDEVICE(INTEL, 0x54a4), (unsigned long)&cnl_info },
        { PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info },
        { PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
+       { PCI_VDEVICE(INTEL, 0x7e23), (unsigned long)&cnl_info },
        { PCI_VDEVICE(INTEL, 0xa0a4), (unsigned long)&bxt_info },
        { PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)&bxt_info },
        { PCI_VDEVICE(INTEL, 0xa224), (unsigned long)&bxt_info },
index 50f42983b9502c838a57c5b345dbfc26deabdefc..66063687ae2714745f869ddb78c903b32fcf031b 100644 (file)
@@ -1236,8 +1236,8 @@ static int intel_spi_populate_chip(struct intel_spi *ispi)
                return -ENOMEM;
 
        pdata->nr_parts = 1;
-       pdata->parts = devm_kcalloc(ispi->dev, sizeof(*pdata->parts),
-                                   pdata->nr_parts, GFP_KERNEL);
+       pdata->parts = devm_kcalloc(ispi->dev, pdata->nr_parts,
+                                   sizeof(*pdata->parts), GFP_KERNEL);
        if (!pdata->parts)
                return -ENOMEM;
 
diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
new file mode 100644 (file)
index 0000000..ce43853
--- /dev/null
@@ -0,0 +1,617 @@
+// SPDX-License-Identifier: (GPL-2.0)
+/*
+ * Microchip CoreSPI SPI controller driver
+ *
+ * Copyright (c) 2018-2022 Microchip Technology Inc. and its subsidiaries
+ *
+ * Author: Daire McNamara <daire.mcnamara@microchip.com>
+ * Author: Conor Dooley <conor.dooley@microchip.com>
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+
+#define MAX_LEN                                (0xffff)
+#define MAX_CS                         (8)
+#define DEFAULT_FRAMESIZE              (8)
+#define FIFO_DEPTH                     (32)
+#define CLK_GEN_MODE1_MAX              (255)
+#define CLK_GEN_MODE0_MAX              (15)
+#define CLK_GEN_MIN                    (0)
+#define MODE_X_MASK_SHIFT              (24)
+
+#define CONTROL_ENABLE                 BIT(0)
+#define CONTROL_MASTER                 BIT(1)
+#define CONTROL_RX_DATA_INT            BIT(4)
+#define CONTROL_TX_DATA_INT            BIT(5)
+#define CONTROL_RX_OVER_INT            BIT(6)
+#define CONTROL_TX_UNDER_INT           BIT(7)
+#define CONTROL_SPO                    BIT(24)
+#define CONTROL_SPH                    BIT(25)
+#define CONTROL_SPS                    BIT(26)
+#define CONTROL_FRAMEURUN              BIT(27)
+#define CONTROL_CLKMODE                        BIT(28)
+#define CONTROL_BIGFIFO                        BIT(29)
+#define CONTROL_OENOFF                 BIT(30)
+#define CONTROL_RESET                  BIT(31)
+
+#define CONTROL_MODE_MASK              GENMASK(3, 2)
+#define  MOTOROLA_MODE                 (0)
+#define CONTROL_FRAMECNT_MASK          GENMASK(23, 8)
+#define CONTROL_FRAMECNT_SHIFT         (8)
+
+#define STATUS_ACTIVE                  BIT(14)
+#define STATUS_SSEL                    BIT(13)
+#define STATUS_FRAMESTART              BIT(12)
+#define STATUS_TXFIFO_EMPTY_NEXT_READ  BIT(11)
+#define STATUS_TXFIFO_EMPTY            BIT(10)
+#define STATUS_TXFIFO_FULL_NEXT_WRITE  BIT(9)
+#define STATUS_TXFIFO_FULL             BIT(8)
+#define STATUS_RXFIFO_EMPTY_NEXT_READ  BIT(7)
+#define STATUS_RXFIFO_EMPTY            BIT(6)
+#define STATUS_RXFIFO_FULL_NEXT_WRITE  BIT(5)
+#define STATUS_RXFIFO_FULL             BIT(4)
+#define STATUS_TX_UNDERRUN             BIT(3)
+#define STATUS_RX_OVERFLOW             BIT(2)
+#define STATUS_RXDAT_RXED              BIT(1)
+#define STATUS_TXDAT_SENT              BIT(0)
+
+#define INT_TXDONE                     BIT(0)
+#define INT_RXRDY                      BIT(1)
+#define INT_RX_CHANNEL_OVERFLOW                BIT(2)
+#define INT_TX_CHANNEL_UNDERRUN                BIT(3)
+
+#define INT_ENABLE_MASK (CONTROL_RX_DATA_INT | CONTROL_TX_DATA_INT | \
+                        CONTROL_RX_OVER_INT | CONTROL_TX_UNDER_INT)
+
+#define REG_CONTROL            (0x00)
+#define REG_FRAME_SIZE         (0x04)
+#define REG_STATUS             (0x08)
+#define REG_INT_CLEAR          (0x0c)
+#define REG_RX_DATA            (0x10)
+#define REG_TX_DATA            (0x14)
+#define REG_CLK_GEN            (0x18)
+#define REG_SLAVE_SELECT       (0x1c)
+#define  SSEL_MASK             GENMASK(7, 0)
+#define  SSEL_DIRECT           BIT(8)
+#define  SSELOUT_SHIFT         9
+#define  SSELOUT               BIT(SSELOUT_SHIFT)
+#define REG_MIS                        (0x20)
+#define REG_RIS                        (0x24)
+#define REG_CONTROL2           (0x28)
+#define REG_COMMAND            (0x2c)
+#define REG_PKTSIZE            (0x30)
+#define REG_CMD_SIZE           (0x34)
+#define REG_HWSTATUS           (0x38)
+#define REG_STAT8              (0x3c)
+#define REG_CTRL2              (0x48)
+#define REG_FRAMESUP           (0x50)
+
+struct mchp_corespi {
+       void __iomem *regs;
+       struct clk *clk;
+       const u8 *tx_buf;
+       u8 *rx_buf;
+       u32 clk_gen; /* divider for spi output clock generated by the controller */
+       u32 clk_mode;
+       int irq;
+       int tx_len;
+       int rx_len;
+       int pending;
+};
+
+static inline u32 mchp_corespi_read(struct mchp_corespi *spi, unsigned int reg)
+{
+       return readl(spi->regs + reg);
+}
+
+static inline void mchp_corespi_write(struct mchp_corespi *spi, unsigned int reg, u32 val)
+{
+       writel(val, spi->regs + reg);
+}
+
+static inline void mchp_corespi_enable(struct mchp_corespi *spi)
+{
+       u32 control = mchp_corespi_read(spi, REG_CONTROL);
+
+       control |= CONTROL_ENABLE;
+
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static inline void mchp_corespi_disable(struct mchp_corespi *spi)
+{
+       u32 control = mchp_corespi_read(spi, REG_CONTROL);
+
+       control &= ~CONTROL_ENABLE;
+
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static inline void mchp_corespi_read_fifo(struct mchp_corespi *spi)
+{
+       u8 data;
+       int fifo_max, i = 0;
+
+       fifo_max = min(spi->rx_len, FIFO_DEPTH);
+
+       while ((i < fifo_max) && !(mchp_corespi_read(spi, REG_STATUS) & STATUS_RXFIFO_EMPTY)) {
+               data = mchp_corespi_read(spi, REG_RX_DATA);
+
+               if (spi->rx_buf)
+                       *spi->rx_buf++ = data;
+               i++;
+       }
+       spi->rx_len -= i;
+       spi->pending -= i;
+}
+
+static void mchp_corespi_enable_ints(struct mchp_corespi *spi)
+{
+       u32 control, mask = INT_ENABLE_MASK;
+
+       mchp_corespi_disable(spi);
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+
+       control |= mask;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+
+       control |= CONTROL_ENABLE;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static void mchp_corespi_disable_ints(struct mchp_corespi *spi)
+{
+       u32 control, mask = INT_ENABLE_MASK;
+
+       mchp_corespi_disable(spi);
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+       control &= ~mask;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+
+       control |= CONTROL_ENABLE;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static inline void mchp_corespi_set_xfer_size(struct mchp_corespi *spi, int len)
+{
+       u32 control;
+       u16 lenpart;
+
+       /*
+        * Disable the SPI controller. Writes to transfer length have
+        * no effect when the controller is enabled.
+        */
+       mchp_corespi_disable(spi);
+
+       /*
+        * The lower 16 bits of the frame count are stored in the control reg
+        * for legacy reasons, but the upper 16 written to a different register:
+        * FRAMESUP. While both the upper and lower bits can be *READ* from the
+        * FRAMESUP register, writing to the lower 16 bits is a NOP
+        */
+       lenpart = len & 0xffff;
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+       control &= ~CONTROL_FRAMECNT_MASK;
+       control |= lenpart << CONTROL_FRAMECNT_SHIFT;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+
+       lenpart = len & 0xffff0000;
+       mchp_corespi_write(spi, REG_FRAMESUP, lenpart);
+
+       control |= CONTROL_ENABLE;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static inline void mchp_corespi_write_fifo(struct mchp_corespi *spi)
+{
+       u8 byte;
+       int fifo_max, i = 0;
+
+       fifo_max = min(spi->tx_len, FIFO_DEPTH);
+       mchp_corespi_set_xfer_size(spi, fifo_max);
+
+       while ((i < fifo_max) && !(mchp_corespi_read(spi, REG_STATUS) & STATUS_TXFIFO_FULL)) {
+               byte = spi->tx_buf ? *spi->tx_buf++ : 0xaa;
+               mchp_corespi_write(spi, REG_TX_DATA, byte);
+               i++;
+       }
+
+       spi->tx_len -= i;
+       spi->pending += i;
+}
+
+static inline void mchp_corespi_set_framesize(struct mchp_corespi *spi, int bt)
+{
+       u32 control;
+
+       /*
+        * Disable the SPI controller. Writes to the frame size have
+        * no effect when the controller is enabled.
+        */
+       mchp_corespi_disable(spi);
+
+       mchp_corespi_write(spi, REG_FRAME_SIZE, bt);
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+       control |= CONTROL_ENABLE;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static void mchp_corespi_set_cs(struct spi_device *spi, bool disable)
+{
+       u32 reg;
+       struct mchp_corespi *corespi = spi_master_get_devdata(spi->master);
+
+       reg = mchp_corespi_read(corespi, REG_SLAVE_SELECT);
+       reg &= ~BIT(spi->chip_select);
+       reg |= !disable << spi->chip_select;
+
+       mchp_corespi_write(corespi, REG_SLAVE_SELECT, reg);
+}
+
+static int mchp_corespi_setup(struct spi_device *spi)
+{
+       struct mchp_corespi *corespi = spi_master_get_devdata(spi->master);
+       u32 reg;
+
+       /*
+        * Active high slaves need to be specifically set to their inactive
+        * states during probe by adding them to the "control group" & thus
+        * driving their select line low.
+        */
+       if (spi->mode & SPI_CS_HIGH) {
+               reg = mchp_corespi_read(corespi, REG_SLAVE_SELECT);
+               reg |= BIT(spi->chip_select);
+               mchp_corespi_write(corespi, REG_SLAVE_SELECT, reg);
+       }
+       return 0;
+}
+
+static void mchp_corespi_init(struct spi_master *master, struct mchp_corespi *spi)
+{
+       unsigned long clk_hz;
+       u32 control = mchp_corespi_read(spi, REG_CONTROL);
+
+       control |= CONTROL_MASTER;
+
+       control &= ~CONTROL_MODE_MASK;
+       control |= MOTOROLA_MODE;
+
+       mchp_corespi_set_framesize(spi, DEFAULT_FRAMESIZE);
+
+       /* max. possible spi clock rate is the apb clock rate */
+       clk_hz = clk_get_rate(spi->clk);
+       master->max_speed_hz = clk_hz;
+
+       /*
+        * The controller must be configured so that it doesn't remove Chip
+        * Select until the entire message has been transferred, even if at
+        * some points TX FIFO becomes empty.
+        *
+        * BIGFIFO mode is also enabled, which sets the fifo depth to 32 frames
+        * for the 8 bit transfers that this driver uses.
+        */
+       control = mchp_corespi_read(spi, REG_CONTROL);
+       control |= CONTROL_SPS | CONTROL_BIGFIFO;
+
+       mchp_corespi_write(spi, REG_CONTROL, control);
+
+       mchp_corespi_enable_ints(spi);
+
+       /*
+        * It is required to enable direct mode, otherwise control over the chip
+        * select is relinquished to the hardware. SSELOUT is enabled too so we
+        * can deal with active high slaves.
+        */
+       mchp_corespi_write(spi, REG_SLAVE_SELECT, SSELOUT | SSEL_DIRECT);
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+
+       control &= ~CONTROL_RESET;
+       control |= CONTROL_ENABLE;
+
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static inline void mchp_corespi_set_clk_gen(struct mchp_corespi *spi)
+{
+       u32 control;
+
+       mchp_corespi_disable(spi);
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+       if (spi->clk_mode)
+               control |= CONTROL_CLKMODE;
+       else
+               control &= ~CONTROL_CLKMODE;
+
+       mchp_corespi_write(spi, REG_CLK_GEN, spi->clk_gen);
+       mchp_corespi_write(spi, REG_CONTROL, control);
+       mchp_corespi_write(spi, REG_CONTROL, control | CONTROL_ENABLE);
+}
+
+static inline void mchp_corespi_set_mode(struct mchp_corespi *spi, unsigned int mode)
+{
+       u32 control, mode_val;
+
+       switch (mode & SPI_MODE_X_MASK) {
+       case SPI_MODE_0:
+               mode_val = 0;
+               break;
+       case SPI_MODE_1:
+               mode_val = CONTROL_SPH;
+               break;
+       case SPI_MODE_2:
+               mode_val = CONTROL_SPO;
+               break;
+       case SPI_MODE_3:
+               mode_val = CONTROL_SPH | CONTROL_SPO;
+               break;
+       }
+
+       /*
+        * Disable the SPI controller. Writes to the frame size have
+        * no effect when the controller is enabled.
+        */
+       mchp_corespi_disable(spi);
+
+       control = mchp_corespi_read(spi, REG_CONTROL);
+       control &= ~(SPI_MODE_X_MASK << MODE_X_MASK_SHIFT);
+       control |= mode_val;
+
+       mchp_corespi_write(spi, REG_CONTROL, control);
+
+       control |= CONTROL_ENABLE;
+       mchp_corespi_write(spi, REG_CONTROL, control);
+}
+
+static irqreturn_t mchp_corespi_interrupt(int irq, void *dev_id)
+{
+       struct spi_master *master = dev_id;
+       struct mchp_corespi *spi = spi_master_get_devdata(master);
+       u32 intfield = mchp_corespi_read(spi, REG_MIS) & 0xf;
+       bool finalise = false;
+
+       /* Interrupt line may be shared and not for us at all */
+       if (intfield == 0)
+               return IRQ_NONE;
+
+       if (intfield & INT_TXDONE) {
+               mchp_corespi_write(spi, REG_INT_CLEAR, INT_TXDONE);
+
+               if (spi->rx_len)
+                       mchp_corespi_read_fifo(spi);
+
+               if (spi->tx_len)
+                       mchp_corespi_write_fifo(spi);
+
+               if (!spi->rx_len)
+                       finalise = true;
+       }
+
+       if (intfield & INT_RXRDY)
+               mchp_corespi_write(spi, REG_INT_CLEAR, INT_RXRDY);
+
+       if (intfield & INT_RX_CHANNEL_OVERFLOW) {
+               mchp_corespi_write(spi, REG_INT_CLEAR, INT_RX_CHANNEL_OVERFLOW);
+               finalise = true;
+               dev_err(&master->dev,
+                       "%s: RX OVERFLOW: rxlen: %d, txlen: %d\n", __func__,
+                       spi->rx_len, spi->tx_len);
+       }
+
+       if (intfield & INT_TX_CHANNEL_UNDERRUN) {
+               mchp_corespi_write(spi, REG_INT_CLEAR, INT_TX_CHANNEL_UNDERRUN);
+               finalise = true;
+               dev_err(&master->dev,
+                       "%s: TX UNDERFLOW: rxlen: %d, txlen: %d\n", __func__,
+                       spi->rx_len, spi->tx_len);
+       }
+
+       if (finalise)
+               spi_finalize_current_transfer(master);
+
+       return IRQ_HANDLED;
+}
+
+static int mchp_corespi_calculate_clkgen(struct mchp_corespi *spi,
+                                        unsigned long target_hz)
+{
+       unsigned long clk_hz, spi_hz, clk_gen;
+
+       clk_hz = clk_get_rate(spi->clk);
+       if (!clk_hz)
+               return -EINVAL;
+       spi_hz = min(target_hz, clk_hz);
+
+       /*
+        * There are two possible clock modes for the controller generated
+        * clock's division ratio:
+        * CLK_MODE = 0: 1 / (2^(CLK_GEN + 1)) where CLK_GEN = 0 to 15.
+        * CLK_MODE = 1: 1 / (2 * CLK_GEN + 1) where CLK_GEN = 0 to 255.
+        * First try mode 1, fall back to 0 and if we have tried both modes and
+        * we /still/ can't get a good setting, we then throw the toys out of
+        * the pram and give up
+        * clk_gen is the register name for the clock divider on MPFS.
+        */
+       clk_gen = DIV_ROUND_UP(clk_hz, 2 * spi_hz) - 1;
+       if (clk_gen > CLK_GEN_MODE1_MAX || clk_gen <= CLK_GEN_MIN) {
+               clk_gen = DIV_ROUND_UP(clk_hz, spi_hz);
+               clk_gen = fls(clk_gen) - 1;
+
+               if (clk_gen > CLK_GEN_MODE0_MAX)
+                       return -EINVAL;
+
+               spi->clk_mode = 0;
+       } else {
+               spi->clk_mode = 1;
+       }
+
+       spi->clk_gen = clk_gen;
+       return 0;
+}
+
+static int mchp_corespi_transfer_one(struct spi_master *master,
+                                    struct spi_device *spi_dev,
+                                    struct spi_transfer *xfer)
+{
+       struct mchp_corespi *spi = spi_master_get_devdata(master);
+       int ret;
+
+       ret = mchp_corespi_calculate_clkgen(spi, (unsigned long)xfer->speed_hz);
+       if (ret) {
+               dev_err(&master->dev, "failed to set clk_gen for target %u Hz\n", xfer->speed_hz);
+               return ret;
+       }
+
+       mchp_corespi_set_clk_gen(spi);
+
+       spi->tx_buf = xfer->tx_buf;
+       spi->rx_buf = xfer->rx_buf;
+       spi->tx_len = xfer->len;
+       spi->rx_len = xfer->len;
+       spi->pending = 0;
+
+       mchp_corespi_set_xfer_size(spi, (spi->tx_len > FIFO_DEPTH)
+                                  ? FIFO_DEPTH : spi->tx_len);
+
+       if (spi->tx_len)
+               mchp_corespi_write_fifo(spi);
+       return 1;
+}
+
+static int mchp_corespi_prepare_message(struct spi_master *master,
+                                       struct spi_message *msg)
+{
+       struct spi_device *spi_dev = msg->spi;
+       struct mchp_corespi *spi = spi_master_get_devdata(master);
+
+       mchp_corespi_set_framesize(spi, DEFAULT_FRAMESIZE);
+       mchp_corespi_set_mode(spi, spi_dev->mode);
+
+       return 0;
+}
+
+static int mchp_corespi_probe(struct platform_device *pdev)
+{
+       struct spi_master *master;
+       struct mchp_corespi *spi;
+       struct resource *res;
+       u32 num_cs;
+       int ret = 0;
+
+       master = devm_spi_alloc_master(&pdev->dev, sizeof(*spi));
+       if (!master)
+               return dev_err_probe(&pdev->dev, -ENOMEM,
+                                    "unable to allocate master for SPI controller\n");
+
+       platform_set_drvdata(pdev, master);
+
+       if (of_property_read_u32(pdev->dev.of_node, "num-cs", &num_cs))
+               num_cs = MAX_CS;
+
+       master->num_chipselect = num_cs;
+       master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
+       master->setup = mchp_corespi_setup;
+       master->bits_per_word_mask = SPI_BPW_MASK(8);
+       master->transfer_one = mchp_corespi_transfer_one;
+       master->prepare_message = mchp_corespi_prepare_message;
+       master->set_cs = mchp_corespi_set_cs;
+       master->dev.of_node = pdev->dev.of_node;
+
+       spi = spi_master_get_devdata(master);
+
+       spi->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
+       if (IS_ERR(spi->regs))
+               return PTR_ERR(spi->regs);
+
+       spi->irq = platform_get_irq(pdev, 0);
+       if (spi->irq <= 0)
+               return dev_err_probe(&pdev->dev, -ENXIO,
+                                    "invalid IRQ %d for SPI controller\n",
+                                    spi->irq);
+
+       ret = devm_request_irq(&pdev->dev, spi->irq, mchp_corespi_interrupt,
+                              IRQF_SHARED, dev_name(&pdev->dev), master);
+       if (ret)
+               return dev_err_probe(&pdev->dev, ret,
+                                    "could not request irq: %d\n", ret);
+
+       spi->clk = devm_clk_get(&pdev->dev, NULL);
+       if (IS_ERR(spi->clk))
+               return dev_err_probe(&pdev->dev, PTR_ERR(spi->clk),
+                                    "could not get clk: %d\n", ret);
+
+       ret = clk_prepare_enable(spi->clk);
+       if (ret)
+               return dev_err_probe(&pdev->dev, ret,
+                                    "failed to enable clock\n");
+
+       mchp_corespi_init(master, spi);
+
+       ret = devm_spi_register_master(&pdev->dev, master);
+       if (ret) {
+               mchp_corespi_disable(spi);
+               clk_disable_unprepare(spi->clk);
+               return dev_err_probe(&pdev->dev, ret,
+                                    "unable to register master for SPI controller\n");
+       }
+
+       dev_info(&pdev->dev, "Registered SPI controller %d\n", master->bus_num);
+
+       return 0;
+}
+
+static int mchp_corespi_remove(struct platform_device *pdev)
+{
+       struct spi_master *master  = platform_get_drvdata(pdev);
+       struct mchp_corespi *spi = spi_master_get_devdata(master);
+
+       mchp_corespi_disable_ints(spi);
+       clk_disable_unprepare(spi->clk);
+       mchp_corespi_disable(spi);
+
+       return 0;
+}
+
+#define MICROCHIP_SPI_PM_OPS (NULL)
+
+/*
+ * Platform driver data structure
+ */
+
+#if defined(CONFIG_OF)
+static const struct of_device_id mchp_corespi_dt_ids[] = {
+       { .compatible = "microchip,mpfs-spi" },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mchp_corespi_dt_ids);
+#endif
+
+static struct platform_driver mchp_corespi_driver = {
+       .probe = mchp_corespi_probe,
+       .driver = {
+               .name = "microchip-corespi",
+               .pm = MICROCHIP_SPI_PM_OPS,
+               .of_match_table = of_match_ptr(mchp_corespi_dt_ids),
+       },
+       .remove = mchp_corespi_remove,
+};
+module_platform_driver(mchp_corespi_driver);
+MODULE_DESCRIPTION("Microchip coreSPI SPI controller driver");
+MODULE_AUTHOR("Daire McNamara <daire.mcnamara@microchip.com>");
+MODULE_AUTHOR("Conor Dooley <conor.dooley@microchip.com>");
+MODULE_LICENSE("GPL");
index 7654736c2c0e4173e5f80f5e39ad03bf9402098c..609311231e64b8955bcc5086a817ec1f4685b341 100644 (file)
@@ -37,12 +37,6 @@ struct mpc52xx_psc_spi {
        struct mpc52xx_psc_fifo __iomem *fifo;
        unsigned int irq;
        u8 bits_per_word;
-       u8 busy;
-
-       struct work_struct work;
-
-       struct list_head queue;
-       spinlock_t lock;
 
        struct completion done;
 };
@@ -198,69 +192,53 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
        return 0;
 }
 
-static void mpc52xx_psc_spi_work(struct work_struct *work)
+int mpc52xx_psc_spi_transfer_one_message(struct spi_controller *ctlr,
+                                        struct spi_message *m)
 {
-       struct mpc52xx_psc_spi *mps =
-               container_of(work, struct mpc52xx_psc_spi, work);
-
-       spin_lock_irq(&mps->lock);
-       mps->busy = 1;
-       while (!list_empty(&mps->queue)) {
-               struct spi_message *m;
-               struct spi_device *spi;
-               struct spi_transfer *t = NULL;
-               unsigned cs_change;
-               int status;
-
-               m = container_of(mps->queue.next, struct spi_message, queue);
-               list_del_init(&m->queue);
-               spin_unlock_irq(&mps->lock);
-
-               spi = m->spi;
-               cs_change = 1;
-               status = 0;
-               list_for_each_entry (t, &m->transfers, transfer_list) {
-                       if (t->bits_per_word || t->speed_hz) {
-                               status = mpc52xx_psc_spi_transfer_setup(spi, t);
-                               if (status < 0)
-                                       break;
-                       }
-
-                       if (cs_change)
-                               mpc52xx_psc_spi_activate_cs(spi);
-                       cs_change = t->cs_change;
-
-                       status = mpc52xx_psc_spi_transfer_rxtx(spi, t);
-                       if (status)
+       struct spi_device *spi;
+       struct spi_transfer *t = NULL;
+       unsigned cs_change;
+       int status;
+
+       spi = m->spi;
+       cs_change = 1;
+       status = 0;
+       list_for_each_entry (t, &m->transfers, transfer_list) {
+               if (t->bits_per_word || t->speed_hz) {
+                       status = mpc52xx_psc_spi_transfer_setup(spi, t);
+                       if (status < 0)
                                break;
-                       m->actual_length += t->len;
+               }
 
-                       spi_transfer_delay_exec(t);
+               if (cs_change)
+                       mpc52xx_psc_spi_activate_cs(spi);
+               cs_change = t->cs_change;
 
-                       if (cs_change)
-                               mpc52xx_psc_spi_deactivate_cs(spi);
-               }
+               status = mpc52xx_psc_spi_transfer_rxtx(spi, t);
+               if (status)
+                       break;
+               m->actual_length += t->len;
 
-               m->status = status;
-               if (m->complete)
-                       m->complete(m->context);
+               spi_transfer_delay_exec(t);
 
-               if (status || !cs_change)
+               if (cs_change)
                        mpc52xx_psc_spi_deactivate_cs(spi);
+       }
 
-               mpc52xx_psc_spi_transfer_setup(spi, NULL);
+       m->status = status;
+       if (status || !cs_change)
+               mpc52xx_psc_spi_deactivate_cs(spi);
 
-               spin_lock_irq(&mps->lock);
-       }
-       mps->busy = 0;
-       spin_unlock_irq(&mps->lock);
+       mpc52xx_psc_spi_transfer_setup(spi, NULL);
+
+       spi_finalize_current_message(ctlr);
+
+       return 0;
 }
 
 static int mpc52xx_psc_spi_setup(struct spi_device *spi)
 {
-       struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);
        struct mpc52xx_psc_spi_cs *cs = spi->controller_state;
-       unsigned long flags;
 
        if (spi->bits_per_word%8)
                return -EINVAL;
@@ -275,28 +253,6 @@ static int mpc52xx_psc_spi_setup(struct spi_device *spi)
        cs->bits_per_word = spi->bits_per_word;
        cs->speed_hz = spi->max_speed_hz;
 
-       spin_lock_irqsave(&mps->lock, flags);
-       if (!mps->busy)
-               mpc52xx_psc_spi_deactivate_cs(spi);
-       spin_unlock_irqrestore(&mps->lock, flags);
-
-       return 0;
-}
-
-static int mpc52xx_psc_spi_transfer(struct spi_device *spi,
-               struct spi_message *m)
-{
-       struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master);
-       unsigned long flags;
-
-       m->actual_length = 0;
-       m->status = -EINPROGRESS;
-
-       spin_lock_irqsave(&mps->lock, flags);
-       list_add_tail(&m->queue, &mps->queue);
-       schedule_work(&mps->work);
-       spin_unlock_irqrestore(&mps->lock, flags);
-
        return 0;
 }
 
@@ -391,7 +347,7 @@ static int mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
                master->num_chipselect = pdata->max_chipselect;
        }
        master->setup = mpc52xx_psc_spi_setup;
-       master->transfer = mpc52xx_psc_spi_transfer;
+       master->transfer_one_message = mpc52xx_psc_spi_transfer_one_message;
        master->cleanup = mpc52xx_psc_spi_cleanup;
        master->dev.of_node = dev->of_node;
 
@@ -415,10 +371,7 @@ static int mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
                goto free_irq;
        }
 
-       spin_lock_init(&mps->lock);
        init_completion(&mps->done);
-       INIT_WORK(&mps->work, mpc52xx_psc_spi_work);
-       INIT_LIST_HEAD(&mps->queue);
 
        ret = spi_register_master(master);
        if (ret < 0)
@@ -470,7 +423,6 @@ static int mpc52xx_psc_spi_of_remove(struct platform_device *op)
        struct spi_master *master = spi_master_get(platform_get_drvdata(op));
        struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master);
 
-       flush_work(&mps->work);
        spi_unregister_master(master);
        free_irq(mps->irq, mps);
        if (mps->psc)
index ba67dbed9fb8f902dcee29c08a648d4f9d7e6195..49f6424e35af0ee0a1ef283f0725d3028f14fd68 100644 (file)
@@ -36,6 +36,7 @@
 #define NPCM_FIU_UMA_DR1               0x34
 #define NPCM_FIU_UMA_DR2               0x38
 #define NPCM_FIU_UMA_DR3               0x3C
+#define NPCM_FIU_CFG                   0x78
 #define NPCM_FIU_MAX_REG_LIMIT         0x80
 
 /* FIU Direct Read Configuration Register */
 #define NPCM_FIU_UMA_DR3_RB13          GENMASK(15, 8)
 #define NPCM_FIU_UMA_DR3_RB12          GENMASK(7, 0)
 
+/* FIU Configuration Register */
+#define NPCM_FIU_CFG_FIU_FIX           BIT(31)
+
 /* FIU Read Mode */
 enum {
        DRD_SINGLE_WIRE_MODE    = 0,
@@ -187,6 +191,7 @@ enum {
        FIU0 = 0,
        FIU3,
        FIUX,
+       FIU1,
 };
 
 struct npcm_fiu_info {
@@ -214,6 +219,21 @@ static const struct fiu_data npcm7xx_fiu_data = {
        .fiu_max = 3,
 };
 
+static const struct npcm_fiu_info npxm8xx_fiu_info[] = {
+       {.name = "FIU0", .fiu_id = FIU0,
+               .max_map_size = MAP_SIZE_128MB, .max_cs = 2},
+       {.name = "FIU3", .fiu_id = FIU3,
+               .max_map_size = MAP_SIZE_128MB, .max_cs = 4},
+       {.name = "FIUX", .fiu_id = FIUX,
+               .max_map_size = MAP_SIZE_16MB, .max_cs = 2},
+       {.name = "FIU1", .fiu_id = FIU1,
+               .max_map_size = MAP_SIZE_16MB, .max_cs = 4} };
+
+static const struct fiu_data npxm8xx_fiu_data = {
+       .npcm_fiu_data_info = npxm8xx_fiu_info,
+       .fiu_max = 4,
+};
+
 struct npcm_fiu_spi;
 
 struct npcm_fiu_chip {
@@ -252,8 +272,7 @@ static void npcm_fiu_set_drd(struct npcm_fiu_spi *fiu,
        fiu->drd_op.addr.buswidth = op->addr.buswidth;
        regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG,
                           NPCM_FIU_DRD_CFG_DBW,
-                          ((op->dummy.nbytes * ilog2(op->addr.buswidth)) / BITS_PER_BYTE)
-                          << NPCM_FIU_DRD_DBW_SHIFT);
+                          op->dummy.nbytes << NPCM_FIU_DRD_DBW_SHIFT);
        fiu->drd_op.dummy.nbytes = op->dummy.nbytes;
        regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG,
                           NPCM_FIU_DRD_CFG_RDCMD, op->cmd.opcode);
@@ -625,6 +644,10 @@ static int npcm_fiu_dirmap_create(struct spi_mem_dirmap_desc *desc)
                regmap_update_bits(gcr_regmap, NPCM7XX_INTCR3_OFFSET,
                                   NPCM7XX_INTCR3_FIU_FIX,
                                   NPCM7XX_INTCR3_FIU_FIX);
+       } else {
+               regmap_update_bits(fiu->regmap, NPCM_FIU_CFG,
+                                  NPCM_FIU_CFG_FIU_FIX,
+                                  NPCM_FIU_CFG_FIU_FIX);
        }
 
        if (desc->info.op_tmpl.data.dir == SPI_MEM_DATA_IN) {
@@ -665,6 +688,7 @@ static const struct spi_controller_mem_ops npcm_fiu_mem_ops = {
 
 static const struct of_device_id npcm_fiu_dt_ids[] = {
        { .compatible = "nuvoton,npcm750-fiu", .data = &npcm7xx_fiu_data  },
+       { .compatible = "nuvoton,npcm845-fiu", .data = &npxm8xx_fiu_data  },
        { /* sentinel */ }
 };
 
index edb42d08857d0f0115276204676ea4bf3fd5a9d9..838d12e65144af77c431cf65a3da68bea2ee5c2d 100644 (file)
@@ -1404,6 +1404,10 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = {
        { PCI_VDEVICE(INTEL, 0x7aab), LPSS_CNL_SSP },
        { PCI_VDEVICE(INTEL, 0x7af9), LPSS_CNL_SSP },
        { PCI_VDEVICE(INTEL, 0x7afb), LPSS_CNL_SSP },
+       /* MTL-P */
+       { PCI_VDEVICE(INTEL, 0x7e27), LPSS_CNL_SSP },
+       { PCI_VDEVICE(INTEL, 0x7e30), LPSS_CNL_SSP },
+       { PCI_VDEVICE(INTEL, 0x7e46), LPSS_CNL_SSP },
        /* CNL-LP */
        { PCI_VDEVICE(INTEL, 0x9daa), LPSS_CNL_SSP },
        { PCI_VDEVICE(INTEL, 0x9dab), LPSS_CNL_SSP },
index c26440e9058d774c26b3d73531f17d9cb4f207b9..7f346866614abbd48ba430543da349e7ab2bb7ac 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <linux/platform_data/spi-s3c64xx.h>
 
-#define MAX_SPI_PORTS          6
+#define MAX_SPI_PORTS          12
 #define S3C64XX_SPI_QUIRK_POLL         (1 << 0)
 #define S3C64XX_SPI_QUIRK_CS_AUTO      (1 << 1)
 #define AUTOSUSPEND_TIMEOUT    2000
@@ -59,6 +59,7 @@
 #define S3C64XX_SPI_MODE_BUS_TSZ_HALFWORD      (1<<17)
 #define S3C64XX_SPI_MODE_BUS_TSZ_WORD          (2<<17)
 #define S3C64XX_SPI_MODE_BUS_TSZ_MASK          (3<<17)
+#define S3C64XX_SPI_MODE_SELF_LOOPBACK         (1<<3)
 #define S3C64XX_SPI_MODE_RXDMA_ON              (1<<2)
 #define S3C64XX_SPI_MODE_TXDMA_ON              (1<<1)
 #define S3C64XX_SPI_MODE_4BURST                        (1<<0)
@@ -130,11 +131,13 @@ struct s3c64xx_spi_dma_data {
  * @fifo_lvl_mask: Bit-mask for {TX|RX}_FIFO_LVL bits in SPI_STATUS register.
  * @rx_lvl_offset: Bit offset of RX_FIFO_LVL bits in SPI_STATUS regiter.
  * @tx_st_done: Bit offset of TX_DONE bit in SPI_STATUS regiter.
+ * @clk_div: Internal clock divider
  * @quirks: Bitmask of known quirks
  * @high_speed: True, if the controller supports HIGH_SPEED_EN bit.
  * @clk_from_cmu: True, if the controller does not include a clock mux and
  *     prescaler unit.
  * @clk_ioclk: True if clock is present on this device
+ * @has_loopback: True if loopback mode can be supported
  *
  * The Samsung s3c64xx SPI controller are used on various Samsung SoC's but
  * differ in some aspects such as the size of the fifo and spi bus clock
@@ -146,9 +149,11 @@ struct s3c64xx_spi_port_config {
        int     rx_lvl_offset;
        int     tx_st_done;
        int     quirks;
+       int     clk_div;
        bool    high_speed;
        bool    clk_from_cmu;
        bool    clk_ioclk;
+       bool    has_loopback;
 };
 
 /**
@@ -350,19 +355,59 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
        if (is_polling(sdd))
                return 0;
 
+       /* Requests DMA channels */
+       sdd->rx_dma.ch = dma_request_chan(&sdd->pdev->dev, "rx");
+       if (IS_ERR(sdd->rx_dma.ch)) {
+               dev_err(&sdd->pdev->dev, "Failed to get RX DMA channel\n");
+               sdd->rx_dma.ch = NULL;
+               return 0;
+       }
+
+       sdd->tx_dma.ch = dma_request_chan(&sdd->pdev->dev, "tx");
+       if (IS_ERR(sdd->tx_dma.ch)) {
+               dev_err(&sdd->pdev->dev, "Failed to get TX DMA channel\n");
+               dma_release_channel(sdd->rx_dma.ch);
+               sdd->tx_dma.ch = NULL;
+               sdd->rx_dma.ch = NULL;
+               return 0;
+       }
+
        spi->dma_rx = sdd->rx_dma.ch;
        spi->dma_tx = sdd->tx_dma.ch;
 
        return 0;
 }
 
+static int s3c64xx_spi_unprepare_transfer(struct spi_master *spi)
+{
+       struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi);
+
+       if (is_polling(sdd))
+               return 0;
+
+       /* Releases DMA channels if they are allocated */
+       if (sdd->rx_dma.ch && sdd->tx_dma.ch) {
+               dma_release_channel(sdd->rx_dma.ch);
+               dma_release_channel(sdd->tx_dma.ch);
+               sdd->rx_dma.ch = 0;
+               sdd->tx_dma.ch = 0;
+       }
+
+       return 0;
+}
+
 static bool s3c64xx_spi_can_dma(struct spi_master *master,
                                struct spi_device *spi,
                                struct spi_transfer *xfer)
 {
        struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
 
-       return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1;
+       if (sdd->rx_dma.ch && sdd->tx_dma.ch) {
+               return xfer->len > (FIFO_LVL_MASK(sdd) >> 1) + 1;
+       } else {
+               return false;
+       }
+
 }
 
 static int s3c64xx_enable_datapath(struct s3c64xx_spi_driver_data *sdd,
@@ -577,6 +622,7 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd)
        void __iomem *regs = sdd->regs;
        int ret;
        u32 val;
+       int div = sdd->port_conf->clk_div;
 
        /* Disable Clock */
        if (!sdd->port_conf->clk_from_cmu) {
@@ -619,19 +665,21 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd)
                break;
        }
 
+       if ((sdd->cur_mode & SPI_LOOP) && sdd->port_conf->has_loopback)
+               val |= S3C64XX_SPI_MODE_SELF_LOOPBACK;
+
        writel(val, regs + S3C64XX_SPI_MODE_CFG);
 
        if (sdd->port_conf->clk_from_cmu) {
-               /* The src_clk clock is divided internally by 2 */
-               ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * 2);
+               ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * div);
                if (ret)
                        return ret;
-               sdd->cur_speed = clk_get_rate(sdd->src_clk) / 2;
+               sdd->cur_speed = clk_get_rate(sdd->src_clk) / div;
        } else {
                /* Configure Clock */
                val = readl(regs + S3C64XX_SPI_CLK_CFG);
                val &= ~S3C64XX_SPI_PSR_MASK;
-               val |= ((clk_get_rate(sdd->src_clk) / sdd->cur_speed / 2 - 1)
+               val |= ((clk_get_rate(sdd->src_clk) / sdd->cur_speed / div - 1)
                                & S3C64XX_SPI_PSR_MASK);
                writel(val, regs + S3C64XX_SPI_CLK_CFG);
 
@@ -697,7 +745,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,
            sdd->rx_dma.ch && sdd->tx_dma.ch) {
                use_dma = 1;
 
-       } else if (is_polling(sdd) && xfer->len > fifo_len) {
+       } else if (xfer->len > fifo_len) {
                tx_buf = xfer->tx_buf;
                rx_buf = xfer->rx_buf;
                origin_len = xfer->len;
@@ -825,6 +873,7 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
        struct s3c64xx_spi_csinfo *cs = spi->controller_data;
        struct s3c64xx_spi_driver_data *sdd;
        int err;
+       int div;
 
        sdd = spi_master_get_devdata(spi->master);
        if (spi->dev.of_node) {
@@ -843,22 +892,24 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
 
        pm_runtime_get_sync(&sdd->pdev->dev);
 
+       div = sdd->port_conf->clk_div;
+
        /* Check if we can provide the requested rate */
        if (!sdd->port_conf->clk_from_cmu) {
                u32 psr, speed;
 
                /* Max possible */
-               speed = clk_get_rate(sdd->src_clk) / 2 / (0 + 1);
+               speed = clk_get_rate(sdd->src_clk) / div / (0 + 1);
 
                if (spi->max_speed_hz > speed)
                        spi->max_speed_hz = speed;
 
-               psr = clk_get_rate(sdd->src_clk) / 2 / spi->max_speed_hz - 1;
+               psr = clk_get_rate(sdd->src_clk) / div / spi->max_speed_hz - 1;
                psr &= S3C64XX_SPI_PSR_MASK;
                if (psr == S3C64XX_SPI_PSR_MASK)
                        psr--;
 
-               speed = clk_get_rate(sdd->src_clk) / 2 / (psr + 1);
+               speed = clk_get_rate(sdd->src_clk) / div / (psr + 1);
                if (spi->max_speed_hz < speed) {
                        if (psr+1 < S3C64XX_SPI_PSR_MASK) {
                                psr++;
@@ -868,7 +919,7 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
                        }
                }
 
-               speed = clk_get_rate(sdd->src_clk) / 2 / (psr + 1);
+               speed = clk_get_rate(sdd->src_clk) / div / (psr + 1);
                if (spi->max_speed_hz >= speed) {
                        spi->max_speed_hz = speed;
                } else {
@@ -1098,6 +1149,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
        master->setup = s3c64xx_spi_setup;
        master->cleanup = s3c64xx_spi_cleanup;
        master->prepare_transfer_hardware = s3c64xx_spi_prepare_transfer;
+       master->unprepare_transfer_hardware = s3c64xx_spi_unprepare_transfer;
        master->prepare_message = s3c64xx_spi_prepare_message;
        master->transfer_one = s3c64xx_spi_transfer_one;
        master->num_chipselect = sci->num_cs;
@@ -1107,6 +1159,8 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
                                        SPI_BPW_MASK(8);
        /* the spi->mode bits understood by this driver: */
        master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
+       if (sdd->port_conf->has_loopback)
+               master->mode_bits |= SPI_LOOP;
        master->auto_runtime_pm = true;
        if (!is_polling(sdd))
                master->can_dma = s3c64xx_spi_can_dma;
@@ -1167,22 +1221,6 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
                }
        }
 
-       if (!is_polling(sdd)) {
-               /* Acquire DMA channels */
-               sdd->rx_dma.ch = dma_request_chan(&pdev->dev, "rx");
-               if (IS_ERR(sdd->rx_dma.ch)) {
-                       dev_err(&pdev->dev, "Failed to get RX DMA channel\n");
-                       ret = PTR_ERR(sdd->rx_dma.ch);
-                       goto err_disable_io_clk;
-               }
-               sdd->tx_dma.ch = dma_request_chan(&pdev->dev, "tx");
-               if (IS_ERR(sdd->tx_dma.ch)) {
-                       dev_err(&pdev->dev, "Failed to get TX DMA channel\n");
-                       ret = PTR_ERR(sdd->tx_dma.ch);
-                       goto err_release_rx_dma;
-               }
-       }
-
        pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
        pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_set_active(&pdev->dev);
@@ -1228,12 +1266,6 @@ err_pm_put:
        pm_runtime_disable(&pdev->dev);
        pm_runtime_set_suspended(&pdev->dev);
 
-       if (!is_polling(sdd))
-               dma_release_channel(sdd->tx_dma.ch);
-err_release_rx_dma:
-       if (!is_polling(sdd))
-               dma_release_channel(sdd->rx_dma.ch);
-err_disable_io_clk:
        clk_disable_unprepare(sdd->ioclk);
 err_disable_src_clk:
        clk_disable_unprepare(sdd->src_clk);
@@ -1369,6 +1401,7 @@ static const struct s3c64xx_spi_port_config s3c2443_spi_port_config = {
        .fifo_lvl_mask  = { 0x7f },
        .rx_lvl_offset  = 13,
        .tx_st_done     = 21,
+       .clk_div        = 2,
        .high_speed     = true,
 };
 
@@ -1376,12 +1409,14 @@ static const struct s3c64xx_spi_port_config s3c6410_spi_port_config = {
        .fifo_lvl_mask  = { 0x7f, 0x7F },
        .rx_lvl_offset  = 13,
        .tx_st_done     = 21,
+       .clk_div        = 2,
 };
 
 static const struct s3c64xx_spi_port_config s5pv210_spi_port_config = {
        .fifo_lvl_mask  = { 0x1ff, 0x7F },
        .rx_lvl_offset  = 15,
        .tx_st_done     = 25,
+       .clk_div        = 2,
        .high_speed     = true,
 };
 
@@ -1389,6 +1424,7 @@ static const struct s3c64xx_spi_port_config exynos4_spi_port_config = {
        .fifo_lvl_mask  = { 0x1ff, 0x7F, 0x7F },
        .rx_lvl_offset  = 15,
        .tx_st_done     = 25,
+       .clk_div        = 2,
        .high_speed     = true,
        .clk_from_cmu   = true,
        .quirks         = S3C64XX_SPI_QUIRK_CS_AUTO,
@@ -1398,6 +1434,7 @@ static const struct s3c64xx_spi_port_config exynos7_spi_port_config = {
        .fifo_lvl_mask  = { 0x1ff, 0x7F, 0x7F, 0x7F, 0x7F, 0x1ff},
        .rx_lvl_offset  = 15,
        .tx_st_done     = 25,
+       .clk_div        = 2,
        .high_speed     = true,
        .clk_from_cmu   = true,
        .quirks         = S3C64XX_SPI_QUIRK_CS_AUTO,
@@ -1407,16 +1444,31 @@ static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = {
        .fifo_lvl_mask  = { 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff},
        .rx_lvl_offset  = 15,
        .tx_st_done     = 25,
+       .clk_div        = 2,
+       .high_speed     = true,
+       .clk_from_cmu   = true,
+       .clk_ioclk      = true,
+       .quirks         = S3C64XX_SPI_QUIRK_CS_AUTO,
+};
+
+static const struct s3c64xx_spi_port_config exynosautov9_spi_port_config = {
+       .fifo_lvl_mask  = { 0x1ff, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff, 0x7f,
+                           0x7f, 0x7f, 0x7f, 0x7f},
+       .rx_lvl_offset  = 15,
+       .tx_st_done     = 25,
+       .clk_div        = 4,
        .high_speed     = true,
        .clk_from_cmu   = true,
        .clk_ioclk      = true,
+       .has_loopback   = true,
        .quirks         = S3C64XX_SPI_QUIRK_CS_AUTO,
 };
 
-static struct s3c64xx_spi_port_config fsd_spi_port_config = {
+static const struct s3c64xx_spi_port_config fsd_spi_port_config = {
        .fifo_lvl_mask  = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f},
        .rx_lvl_offset  = 15,
        .tx_st_done     = 25,
+       .clk_div        = 2,
        .high_speed     = true,
        .clk_from_cmu   = true,
        .clk_ioclk      = false,
@@ -1453,6 +1505,9 @@ static const struct of_device_id s3c64xx_spi_dt_match[] = {
        { .compatible = "samsung,exynos5433-spi",
                        .data = (void *)&exynos5433_spi_port_config,
        },
+       { .compatible = "samsung,exynosautov9-spi",
+                       .data = (void *)&exynosautov9_spi_port_config,
+       },
        { .compatible = "tesla,fsd-spi",
                        .data = (void *)&fsd_spi_port_config,
        },
index 45f304935332199063387bea1fbd10607c5bac99..3e72fad99adfd4167e25166bb0ae98dfaf87eedb 100644 (file)
@@ -73,11 +73,8 @@ struct spi_sh_data {
        void __iomem *addr;
        int irq;
        struct spi_master *master;
-       struct list_head queue;
-       struct work_struct ws;
        unsigned long cr1;
        wait_queue_head_t wait;
-       spinlock_t lock;
        int width;
 };
 
@@ -271,47 +268,39 @@ static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg,
        return 0;
 }
 
-static void spi_sh_work(struct work_struct *work)
+static int spi_sh_transfer_one_message(struct spi_controller *ctlr,
+                                       struct spi_message *mesg)
 {
-       struct spi_sh_data *ss = container_of(work, struct spi_sh_data, ws);
-       struct spi_message *mesg;
+       struct spi_sh_data *ss = spi_controller_get_devdata(ctlr);
        struct spi_transfer *t;
-       unsigned long flags;
        int ret;
 
        pr_debug("%s: enter\n", __func__);
 
-       spin_lock_irqsave(&ss->lock, flags);
-       while (!list_empty(&ss->queue)) {
-               mesg = list_entry(ss->queue.next, struct spi_message, queue);
-               list_del_init(&mesg->queue);
-
-               spin_unlock_irqrestore(&ss->lock, flags);
-               list_for_each_entry(t, &mesg->transfers, transfer_list) {
-                       pr_debug("tx_buf = %p, rx_buf = %p\n",
-                                       t->tx_buf, t->rx_buf);
-                       pr_debug("len = %d, delay.value = %d\n",
-                                       t->len, t->delay.value);
-
-                       if (t->tx_buf) {
-                               ret = spi_sh_send(ss, mesg, t);
-                               if (ret < 0)
-                                       goto error;
-                       }
-                       if (t->rx_buf) {
-                               ret = spi_sh_receive(ss, mesg, t);
-                               if (ret < 0)
-                                       goto error;
-                       }
-                       mesg->actual_length += t->len;
-               }
-               spin_lock_irqsave(&ss->lock, flags);
+       spi_sh_clear_bit(ss, SPI_SH_SSA, SPI_SH_CR1);
 
-               mesg->status = 0;
-               if (mesg->complete)
-                       mesg->complete(mesg->context);
+       list_for_each_entry(t, &mesg->transfers, transfer_list) {
+               pr_debug("tx_buf = %p, rx_buf = %p\n",
+                        t->tx_buf, t->rx_buf);
+               pr_debug("len = %d, delay.value = %d\n",
+                        t->len, t->delay.value);
+
+               if (t->tx_buf) {
+                       ret = spi_sh_send(ss, mesg, t);
+                       if (ret < 0)
+                               goto error;
+               }
+               if (t->rx_buf) {
+                       ret = spi_sh_receive(ss, mesg, t);
+                       if (ret < 0)
+                               goto error;
+               }
+               mesg->actual_length += t->len;
        }
 
+       mesg->status = 0;
+       spi_finalize_current_message(ctlr);
+
        clear_fifo(ss);
        spi_sh_set_bit(ss, SPI_SH_SSD, SPI_SH_CR1);
        udelay(100);
@@ -321,12 +310,11 @@ static void spi_sh_work(struct work_struct *work)
 
        clear_fifo(ss);
 
-       spin_unlock_irqrestore(&ss->lock, flags);
-
-       return;
+       return 0;
 
  error:
        mesg->status = ret;
+       spi_finalize_current_message(ctlr);
        if (mesg->complete)
                mesg->complete(mesg->context);
 
@@ -334,6 +322,7 @@ static void spi_sh_work(struct work_struct *work)
                         SPI_SH_CR1);
        clear_fifo(ss);
 
+       return ret;
 }
 
 static int spi_sh_setup(struct spi_device *spi)
@@ -355,29 +344,6 @@ static int spi_sh_setup(struct spi_device *spi)
        return 0;
 }
 
-static int spi_sh_transfer(struct spi_device *spi, struct spi_message *mesg)
-{
-       struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
-       unsigned long flags;
-
-       pr_debug("%s: enter\n", __func__);
-       pr_debug("\tmode = %02x\n", spi->mode);
-
-       spin_lock_irqsave(&ss->lock, flags);
-
-       mesg->actual_length = 0;
-       mesg->status = -EINPROGRESS;
-
-       spi_sh_clear_bit(ss, SPI_SH_SSA, SPI_SH_CR1);
-
-       list_add_tail(&mesg->queue, &ss->queue);
-       schedule_work(&ss->ws);
-
-       spin_unlock_irqrestore(&ss->lock, flags);
-
-       return 0;
-}
-
 static void spi_sh_cleanup(struct spi_device *spi)
 {
        struct spi_sh_data *ss = spi_master_get_devdata(spi->master);
@@ -416,7 +382,6 @@ static int spi_sh_remove(struct platform_device *pdev)
        struct spi_sh_data *ss = platform_get_drvdata(pdev);
 
        spi_unregister_master(ss->master);
-       flush_work(&ss->ws);
        free_irq(ss->irq, ss);
 
        return 0;
@@ -467,9 +432,6 @@ static int spi_sh_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "ioremap error.\n");
                return -ENOMEM;
        }
-       INIT_LIST_HEAD(&ss->queue);
-       spin_lock_init(&ss->lock);
-       INIT_WORK(&ss->ws, spi_sh_work);
        init_waitqueue_head(&ss->wait);
 
        ret = request_irq(irq, spi_sh_irq, 0, "spi_sh", ss);
@@ -481,7 +443,7 @@ static int spi_sh_probe(struct platform_device *pdev)
        master->num_chipselect = 2;
        master->bus_num = pdev->id;
        master->setup = spi_sh_setup;
-       master->transfer = spi_sh_transfer;
+       master->transfer_one_message = spi_sh_transfer_one_message;
        master->cleanup = spi_sh_cleanup;
 
        ret = spi_register_master(master);
index f7c1e20432e074fdf656037101ecbfa7893dfa85..e29e85cee88a22eb61daf900c7411f8ab4d9f971 100644 (file)
@@ -427,6 +427,44 @@ static int sifive_spi_remove(struct platform_device *pdev)
        return 0;
 }
 
+static int sifive_spi_suspend(struct device *dev)
+{
+       struct spi_master *master = dev_get_drvdata(dev);
+       struct sifive_spi *spi = spi_master_get_devdata(master);
+       int ret;
+
+       ret = spi_master_suspend(master);
+       if (ret)
+               return ret;
+
+       /* Disable all the interrupts just in case */
+       sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0);
+
+       clk_disable_unprepare(spi->clk);
+
+       return ret;
+}
+
+static int sifive_spi_resume(struct device *dev)
+{
+       struct spi_master *master = dev_get_drvdata(dev);
+       struct sifive_spi *spi = spi_master_get_devdata(master);
+       int ret;
+
+       ret = clk_prepare_enable(spi->clk);
+       if (ret)
+               return ret;
+       ret = spi_master_resume(master);
+       if (ret)
+               clk_disable_unprepare(spi->clk);
+
+       return ret;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(sifive_spi_pm_ops,
+                               sifive_spi_suspend, sifive_spi_resume);
+
+
 static const struct of_device_id sifive_spi_of_match[] = {
        { .compatible = "sifive,spi0", },
        {}
@@ -438,6 +476,7 @@ static struct platform_driver sifive_spi_driver = {
        .remove = sifive_spi_remove,
        .driver = {
                .name = SIFIVE_SPI_DRIVER_NAME,
+               .pm = &sifive_spi_pm_ops,
                .of_match_table = sifive_spi_of_match,
        },
 };
index c0239e405c392218e174b08fabbde8c9199a69a9..f3fe92300639f35a1cb220d945e5eec1e0ec7f14 100644 (file)
@@ -299,8 +299,7 @@ static int stm32_qspi_wait_nobusy(struct stm32_qspi *qspi)
                                                 STM32_BUSY_TIMEOUT_US);
 }
 
-static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi,
-                              const struct spi_mem_op *op)
+static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi)
 {
        u32 cr, sr;
        int err = 0;
@@ -331,8 +330,7 @@ out:
        return err;
 }
 
-static int stm32_qspi_wait_poll_status(struct stm32_qspi *qspi,
-                                      const struct spi_mem_op *op)
+static int stm32_qspi_wait_poll_status(struct stm32_qspi *qspi)
 {
        u32 cr;
 
@@ -349,7 +347,7 @@ static int stm32_qspi_wait_poll_status(struct stm32_qspi *qspi,
        return 0;
 }
 
-static int stm32_qspi_get_mode(struct stm32_qspi *qspi, u8 buswidth)
+static int stm32_qspi_get_mode(u8 buswidth)
 {
        if (buswidth == 4)
                return CCR_BUSWIDTH_4;
@@ -382,11 +380,11 @@ static int stm32_qspi_send(struct spi_mem *mem, const struct spi_mem_op *op)
        ccr = qspi->fmode;
        ccr |= FIELD_PREP(CCR_INST_MASK, op->cmd.opcode);
        ccr |= FIELD_PREP(CCR_IMODE_MASK,
-                         stm32_qspi_get_mode(qspi, op->cmd.buswidth));
+                         stm32_qspi_get_mode(op->cmd.buswidth));
 
        if (op->addr.nbytes) {
                ccr |= FIELD_PREP(CCR_ADMODE_MASK,
-                                 stm32_qspi_get_mode(qspi, op->addr.buswidth));
+                                 stm32_qspi_get_mode(op->addr.buswidth));
                ccr |= FIELD_PREP(CCR_ADSIZE_MASK, op->addr.nbytes - 1);
        }
 
@@ -396,7 +394,7 @@ static int stm32_qspi_send(struct spi_mem *mem, const struct spi_mem_op *op)
 
        if (op->data.nbytes) {
                ccr |= FIELD_PREP(CCR_DMODE_MASK,
-                                 stm32_qspi_get_mode(qspi, op->data.buswidth));
+                                 stm32_qspi_get_mode(op->data.buswidth));
        }
 
        writel_relaxed(ccr, qspi->io_base + QSPI_CCR);
@@ -405,7 +403,7 @@ static int stm32_qspi_send(struct spi_mem *mem, const struct spi_mem_op *op)
                writel_relaxed(op->addr.val, qspi->io_base + QSPI_AR);
 
        if (qspi->fmode == CCR_FMODE_APM)
-               err_poll_status = stm32_qspi_wait_poll_status(qspi, op);
+               err_poll_status = stm32_qspi_wait_poll_status(qspi);
 
        err = stm32_qspi_tx(qspi, op);
 
@@ -420,7 +418,7 @@ static int stm32_qspi_send(struct spi_mem *mem, const struct spi_mem_op *op)
                goto abort;
 
        /* wait end of tx in indirect mode */
-       err = stm32_qspi_wait_cmd(qspi, op);
+       err = stm32_qspi_wait_cmd(qspi);
        if (err)
                goto abort;
 
index ea706d9629cb162f433e4844c2156f0e36259e6c..47cbe73137c23c930c1f4d1a309d5badba2ae7cf 100644 (file)
@@ -783,6 +783,7 @@ static int __maybe_unused synquacer_spi_resume(struct device *dev)
 
                ret = synquacer_spi_enable(master);
                if (ret) {
+                       clk_disable_unprepare(sspi->clk);
                        dev_err(dev, "failed to enable spi (%d)\n", ret);
                        return ret;
                }
index 38360434d6e9e06e7821da53b52eb8b2eba01e4e..148043d0c2b847bc9712af79755d9c80ea142693 100644 (file)
@@ -1136,7 +1136,7 @@ exit_free_master:
 
 static int tegra_slink_remove(struct platform_device *pdev)
 {
-       struct spi_master *master = platform_get_drvdata(pdev);
+       struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
        struct tegra_slink_data *tspi = spi_master_get_devdata(master);
 
        spi_unregister_master(master);
@@ -1151,6 +1151,7 @@ static int tegra_slink_remove(struct platform_device *pdev)
        if (tspi->rx_dma_chan)
                tegra_slink_deinit_dma_param(tspi, true);
 
+       spi_master_put(master);
        return 0;
 }
 
index 66f647f32876e34ee5fd752642ea02d4ac500a5d..c89592b21ffc5bcc6864e3465550cf4a9232da13 100644 (file)
 #define QSPI_RX_EN                             BIT(12)
 #define QSPI_CS_SW_VAL                         BIT(20)
 #define QSPI_CS_SW_HW                          BIT(21)
+
+#define QSPI_CS_POL_INACTIVE(n)                        (1 << (22 + (n)))
+#define QSPI_CS_POL_INACTIVE_MASK              (0xF << 22)
+#define QSPI_CS_SEL_0                          (0 << 26)
+#define QSPI_CS_SEL_1                          (1 << 26)
+#define QSPI_CS_SEL_2                          (2 << 26)
+#define QSPI_CS_SEL_3                          (3 << 26)
+#define QSPI_CS_SEL_MASK                       (3 << 26)
+#define QSPI_CS_SEL(x)                         (((x) & 0x3) << 26)
+
 #define QSPI_CONTROL_MODE_0                    (0 << 28)
 #define QSPI_CONTROL_MODE_3                    (3 << 28)
 #define QSPI_CONTROL_MODE_MASK                 (3 << 28)
 struct tegra_qspi_soc_data {
        bool has_dma;
        bool cmb_xfer_capable;
+       unsigned int cs_count;
 };
 
 struct tegra_qspi_client_data {
@@ -812,6 +823,7 @@ static u32 tegra_qspi_setup_transfer_one(struct spi_device *spi, struct spi_tran
                tegra_qspi_mask_clear_irq(tqspi);
 
                command1 = tqspi->def_command1_reg;
+               command1 |= QSPI_CS_SEL(spi->chip_select);
                command1 |= QSPI_BIT_LENGTH(bits_per_word - 1);
 
                command1 &= ~QSPI_CONTROL_MODE_MASK;
@@ -941,10 +953,11 @@ static int tegra_qspi_setup(struct spi_device *spi)
 
        /* keep default cs state to inactive */
        val = tqspi->def_command1_reg;
+       val |= QSPI_CS_SEL(spi->chip_select);
        if (spi->mode & SPI_CS_HIGH)
-               val &= ~QSPI_CS_SW_VAL;
+               val &= ~QSPI_CS_POL_INACTIVE(spi->chip_select);
        else
-               val |= QSPI_CS_SW_VAL;
+               val |= QSPI_CS_POL_INACTIVE(spi->chip_select);
 
        tqspi->def_command1_reg = val;
        tegra_qspi_writel(tqspi, tqspi->def_command1_reg, QSPI_COMMAND1);
@@ -1425,16 +1438,25 @@ static irqreturn_t tegra_qspi_isr_thread(int irq, void *context_data)
 static struct tegra_qspi_soc_data tegra210_qspi_soc_data = {
        .has_dma = true,
        .cmb_xfer_capable = false,
+       .cs_count = 1,
 };
 
 static struct tegra_qspi_soc_data tegra186_qspi_soc_data = {
        .has_dma = true,
        .cmb_xfer_capable = true,
+       .cs_count = 1,
 };
 
 static struct tegra_qspi_soc_data tegra234_qspi_soc_data = {
        .has_dma = false,
        .cmb_xfer_capable = true,
+       .cs_count = 1,
+};
+
+static struct tegra_qspi_soc_data tegra241_qspi_soc_data = {
+       .has_dma = false,
+       .cmb_xfer_capable = true,
+       .cs_count = 4,
 };
 
 static const struct of_device_id tegra_qspi_of_match[] = {
@@ -1450,6 +1472,9 @@ static const struct of_device_id tegra_qspi_of_match[] = {
        }, {
                .compatible = "nvidia,tegra234-qspi",
                .data       = &tegra234_qspi_soc_data,
+       }, {
+               .compatible = "nvidia,tegra241-qspi",
+               .data       = &tegra241_qspi_soc_data,
        },
        {}
 };
@@ -1467,6 +1492,9 @@ static const struct acpi_device_id tegra_qspi_acpi_match[] = {
        }, {
                .id = "NVDA1413",
                .driver_data = (kernel_ulong_t)&tegra234_qspi_soc_data,
+       }, {
+               .id = "NVDA1513",
+               .driver_data = (kernel_ulong_t)&tegra241_qspi_soc_data,
        },
        {}
 };
@@ -1506,6 +1534,7 @@ static int tegra_qspi_probe(struct platform_device *pdev)
        spin_lock_init(&tqspi->lock);
 
        tqspi->soc_data = device_get_match_data(&pdev->dev);
+       master->num_chipselect = tqspi->soc_data->cs_count;
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        tqspi->base = devm_ioremap_resource(&pdev->dev, r);
        if (IS_ERR(tqspi->base))
index b5b65d882d7adf77b3e283189c51d0205759e34b..60086869bcae4303bd031315519176b0f0002820 100644 (file)
@@ -57,7 +57,6 @@ struct ti_qspi {
        void                    *rx_bb_addr;
        struct dma_chan         *rx_chan;
 
-       u32 spi_max_frequency;
        u32 cmd;
        u32 dc;
 
@@ -140,37 +139,19 @@ static inline void ti_qspi_write(struct ti_qspi *qspi,
 static int ti_qspi_setup(struct spi_device *spi)
 {
        struct ti_qspi  *qspi = spi_master_get_devdata(spi->master);
-       struct ti_qspi_regs *ctx_reg = &qspi->ctx_reg;
-       int clk_div = 0, ret;
-       u32 clk_ctrl_reg, clk_rate, clk_mask;
+       int ret;
 
        if (spi->master->busy) {
                dev_dbg(qspi->dev, "master busy doing other transfers\n");
                return -EBUSY;
        }
 
-       if (!qspi->spi_max_frequency) {
+       if (!qspi->master->max_speed_hz) {
                dev_err(qspi->dev, "spi max frequency not defined\n");
                return -EINVAL;
        }
 
-       clk_rate = clk_get_rate(qspi->fclk);
-
-       clk_div = DIV_ROUND_UP(clk_rate, qspi->spi_max_frequency) - 1;
-
-       if (clk_div < 0) {
-               dev_dbg(qspi->dev, "clock divider < 0, using /1 divider\n");
-               return -EINVAL;
-       }
-
-       if (clk_div > QSPI_CLK_DIV_MAX) {
-               dev_dbg(qspi->dev, "clock divider >%d , using /%d divider\n",
-                               QSPI_CLK_DIV_MAX, QSPI_CLK_DIV_MAX + 1);
-               return -EINVAL;
-       }
-
-       dev_dbg(qspi->dev, "hz: %d, clock divider %d\n",
-                       qspi->spi_max_frequency, clk_div);
+       spi->max_speed_hz = min(spi->max_speed_hz, qspi->master->max_speed_hz);
 
        ret = pm_runtime_resume_and_get(qspi->dev);
        if (ret < 0) {
@@ -178,18 +159,6 @@ static int ti_qspi_setup(struct spi_device *spi)
                return ret;
        }
 
-       clk_ctrl_reg = ti_qspi_read(qspi, QSPI_SPI_CLOCK_CNTRL_REG);
-
-       clk_ctrl_reg &= ~QSPI_CLK_EN;
-
-       /* disable SCLK */
-       ti_qspi_write(qspi, clk_ctrl_reg, QSPI_SPI_CLOCK_CNTRL_REG);
-
-       /* enable SCLK */
-       clk_mask = QSPI_CLK_EN | clk_div;
-       ti_qspi_write(qspi, clk_mask, QSPI_SPI_CLOCK_CNTRL_REG);
-       ctx_reg->clkctrl = clk_mask;
-
        pm_runtime_mark_last_busy(qspi->dev);
        ret = pm_runtime_put_autosuspend(qspi->dev);
        if (ret < 0) {
@@ -200,6 +169,37 @@ static int ti_qspi_setup(struct spi_device *spi)
        return 0;
 }
 
+static void ti_qspi_setup_clk(struct ti_qspi *qspi, u32 speed_hz)
+{
+       struct ti_qspi_regs *ctx_reg = &qspi->ctx_reg;
+       int clk_div;
+       u32 clk_ctrl_reg, clk_rate, clk_ctrl_new;
+
+       clk_rate = clk_get_rate(qspi->fclk);
+       clk_div = DIV_ROUND_UP(clk_rate, speed_hz) - 1;
+       clk_div = clamp(clk_div, 0, QSPI_CLK_DIV_MAX);
+       dev_dbg(qspi->dev, "hz: %d, clock divider %d\n", speed_hz, clk_div);
+
+       pm_runtime_resume_and_get(qspi->dev);
+
+       clk_ctrl_new = QSPI_CLK_EN | clk_div;
+       if (ctx_reg->clkctrl != clk_ctrl_new) {
+               clk_ctrl_reg = ti_qspi_read(qspi, QSPI_SPI_CLOCK_CNTRL_REG);
+
+               clk_ctrl_reg &= ~QSPI_CLK_EN;
+
+               /* disable SCLK */
+               ti_qspi_write(qspi, clk_ctrl_reg, QSPI_SPI_CLOCK_CNTRL_REG);
+
+               /* enable SCLK */
+               ti_qspi_write(qspi, clk_ctrl_new, QSPI_SPI_CLOCK_CNTRL_REG);
+               ctx_reg->clkctrl = clk_ctrl_new;
+       }
+
+       pm_runtime_mark_last_busy(qspi->dev);
+       pm_runtime_put_autosuspend(qspi->dev);
+}
+
 static void ti_qspi_restore_ctx(struct ti_qspi *qspi)
 {
        struct ti_qspi_regs *ctx_reg = &qspi->ctx_reg;
@@ -623,8 +623,10 @@ static int ti_qspi_exec_mem_op(struct spi_mem *mem,
 
        mutex_lock(&qspi->list_lock);
 
-       if (!qspi->mmap_enabled || qspi->current_cs != mem->spi->chip_select)
+       if (!qspi->mmap_enabled || qspi->current_cs != mem->spi->chip_select) {
+               ti_qspi_setup_clk(qspi, mem->spi->max_speed_hz);
                ti_qspi_enable_memory_map(mem->spi);
+       }
        ti_qspi_setup_mmap_read(mem->spi, op->cmd.opcode, op->data.buswidth,
                                op->addr.nbytes, op->dummy.nbytes);
 
@@ -701,6 +703,7 @@ static int ti_qspi_start_transfer_one(struct spi_master *master,
                wlen = t->bits_per_word >> 3;
                transfer_len_words = min(t->len / wlen, frame_len_words);
 
+               ti_qspi_setup_clk(qspi, t->speed_hz);
                ret = qspi_transfer_msg(qspi, t, transfer_len_words * wlen);
                if (ret) {
                        dev_dbg(qspi->dev, "transfer message failed\n");
@@ -851,7 +854,7 @@ static int ti_qspi_probe(struct platform_device *pdev)
        pm_runtime_enable(&pdev->dev);
 
        if (!of_property_read_u32(np, "spi-max-frequency", &max_freq))
-               qspi->spi_max_frequency = max_freq;
+               master->max_speed_hz = max_freq;
 
        dma_cap_zero(mask);
        dma_cap_set(DMA_MEMCPY, mask);
index dfaa1d79a78be04e1f8cc4c45b765d7ee95a8ea8..cbb60198a7f003dc01046b8872f424d3a708f68a 100644 (file)
@@ -455,35 +455,10 @@ static void pch_spi_reset(struct spi_master *master)
 
 static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg)
 {
-
-       struct spi_transfer *transfer;
        struct pch_spi_data *data = spi_master_get_devdata(pspi->master);
        int retval;
        unsigned long flags;
 
-       spin_lock_irqsave(&data->lock, flags);
-       /* validate Tx/Rx buffers and Transfer length */
-       list_for_each_entry(transfer, &pmsg->transfers, transfer_list) {
-               if (!transfer->tx_buf && !transfer->rx_buf) {
-                       dev_err(&pspi->dev,
-                               "%s Tx and Rx buffer NULL\n", __func__);
-                       retval = -EINVAL;
-                       goto err_return_spinlock;
-               }
-
-               if (!transfer->len) {
-                       dev_err(&pspi->dev, "%s Transfer length invalid\n",
-                               __func__);
-                       retval = -EINVAL;
-                       goto err_return_spinlock;
-               }
-
-               dev_dbg(&pspi->dev,
-                       "%s Tx/Rx buffer valid. Transfer length valid\n",
-                       __func__);
-       }
-       spin_unlock_irqrestore(&data->lock, flags);
-
        /* We won't process any messages if we have been asked to terminate */
        if (data->status == STATUS_EXITING) {
                dev_err(&pspi->dev, "%s status = STATUS_EXITING.\n", __func__);
@@ -518,10 +493,6 @@ static int pch_spi_transfer(struct spi_device *pspi, struct spi_message *pmsg)
 err_out:
        dev_dbg(&pspi->dev, "%s RETURN=%d\n", __func__, retval);
        return retval;
-err_return_spinlock:
-       dev_dbg(&pspi->dev, "%s RETURN=%d\n", __func__, retval);
-       spin_unlock_irqrestore(&data->lock, flags);
-       return retval;
 }
 
 static inline void pch_spi_select_chip(struct pch_spi_data *data,
@@ -1365,6 +1336,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
        master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST;
        master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
        master->max_speed_hz = PCH_MAX_BAUDRATE;
+       master->flags = SPI_CONTROLLER_MUST_RX | SPI_CONTROLLER_MUST_TX;
 
        data->board_dat = board_dat;
        data->plat_dev = plat_dev;
index 2b5afae8ff7fc457a9c67054436bdaeb796fcf6c..c760aac070e54c1692aa3db0d79ef0bae582565a 100644 (file)
 #define GQSPI_DMA_UNALIGN              0x3
 #define GQSPI_DEFAULT_NUM_CS   1       /* Default number of chip selects */
 
+#define GQSPI_MAX_NUM_CS       2       /* Maximum number of chip selects */
+
 #define SPI_AUTOSUSPEND_TIMEOUT                3000
 enum mode_type {GQSPI_MODE_IO, GQSPI_MODE_DMA};
 
@@ -363,8 +365,13 @@ static void zynqmp_qspi_chipselect(struct spi_device *qspi, bool is_high)
        genfifoentry |= GQSPI_GENFIFO_MODE_SPI;
 
        if (!is_high) {
-               xqspi->genfifobus = GQSPI_GENFIFO_BUS_LOWER;
-               xqspi->genfifocs = GQSPI_GENFIFO_CS_LOWER;
+               if (!qspi->chip_select) {
+                       xqspi->genfifobus = GQSPI_GENFIFO_BUS_LOWER;
+                       xqspi->genfifocs = GQSPI_GENFIFO_CS_LOWER;
+               } else {
+                       xqspi->genfifobus = GQSPI_GENFIFO_BUS_UPPER;
+                       xqspi->genfifocs = GQSPI_GENFIFO_CS_UPPER;
+               }
                genfifoentry |= xqspi->genfifobus;
                genfifoentry |= xqspi->genfifocs;
                genfifoentry |= GQSPI_GENFIFO_CS_SETUP;
@@ -1099,6 +1106,7 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
        struct zynqmp_qspi *xqspi;
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
+       u32 num_cs;
 
        ctlr = spi_alloc_master(&pdev->dev, sizeof(*xqspi));
        if (!ctlr)
@@ -1176,8 +1184,19 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
        if (ret)
                goto clk_dis_all;
 
+       ret = of_property_read_u32(np, "num-cs", &num_cs);
+       if (ret < 0) {
+               ctlr->num_chipselect = GQSPI_DEFAULT_NUM_CS;
+       } else if (num_cs > GQSPI_MAX_NUM_CS) {
+               ret = -EINVAL;
+               dev_err(&pdev->dev, "only %d chip selects are available\n",
+                       GQSPI_MAX_NUM_CS);
+               goto clk_dis_all;
+       } else {
+               ctlr->num_chipselect = num_cs;
+       }
+
        ctlr->bits_per_word_mask = SPI_BPW_MASK(8);
-       ctlr->num_chipselect = GQSPI_DEFAULT_NUM_CS;
        ctlr->mem_ops = &zynqmp_qspi_mem_ops;
        ctlr->setup = zynqmp_qspi_setup_op;
        ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2;
index ea09d1b42bf63e20d464940b7d3c96b8be210d3a..1c14d682ffedd054e80b618c51a14fc5494644bf 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/idr.h>
 #include <linux/platform_data/x86/apple.h>
 #include <linux/ptp_clock_kernel.h>
+#include <linux/percpu.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/spi.h>
@@ -49,6 +50,7 @@ static void spidev_release(struct device *dev)
 
        spi_controller_put(spi->controller);
        kfree(spi->driver_override);
+       free_percpu(spi->pcpu_statistics);
        kfree(spi);
 }
 
@@ -93,6 +95,47 @@ static ssize_t driver_override_show(struct device *dev,
 }
 static DEVICE_ATTR_RW(driver_override);
 
+static struct spi_statistics *spi_alloc_pcpu_stats(struct device *dev)
+{
+       struct spi_statistics __percpu *pcpu_stats;
+
+       if (dev)
+               pcpu_stats = devm_alloc_percpu(dev, struct spi_statistics);
+       else
+               pcpu_stats = alloc_percpu_gfp(struct spi_statistics, GFP_KERNEL);
+
+       if (pcpu_stats) {
+               int cpu;
+
+               for_each_possible_cpu(cpu) {
+                       struct spi_statistics *stat;
+
+                       stat = per_cpu_ptr(pcpu_stats, cpu);
+                       u64_stats_init(&stat->syncp);
+               }
+       }
+       return pcpu_stats;
+}
+
+#define spi_pcpu_stats_totalize(ret, in, field)                                \
+do {                                                                   \
+       int i;                                                          \
+       ret = 0;                                                        \
+       for_each_possible_cpu(i) {                                      \
+               const struct spi_statistics *pcpu_stats;                \
+               u64 inc;                                                \
+               unsigned int start;                                     \
+               pcpu_stats = per_cpu_ptr(in, i);                        \
+               do {                                                    \
+                       start = u64_stats_fetch_begin_irq(              \
+                                       &pcpu_stats->syncp);            \
+                       inc = u64_stats_read(&pcpu_stats->field);       \
+               } while (u64_stats_fetch_retry_irq(                     \
+                                       &pcpu_stats->syncp, start));    \
+               ret += inc;                                             \
+       }                                                               \
+} while (0)
+
 #define SPI_STATISTICS_ATTRS(field, file)                              \
 static ssize_t spi_controller_##field##_show(struct device *dev,       \
                                             struct device_attribute *attr, \
@@ -100,7 +143,7 @@ static ssize_t spi_controller_##field##_show(struct device *dev,    \
 {                                                                      \
        struct spi_controller *ctlr = container_of(dev,                 \
                                         struct spi_controller, dev);   \
-       return spi_statistics_##field##_show(&ctlr->statistics, buf);   \
+       return spi_statistics_##field##_show(ctlr->pcpu_statistics, buf); \
 }                                                                      \
 static struct device_attribute dev_attr_spi_controller_##field = {     \
        .attr = { .name = file, .mode = 0444 },                         \
@@ -111,47 +154,46 @@ static ssize_t spi_device_##field##_show(struct device *dev,              \
                                        char *buf)                      \
 {                                                                      \
        struct spi_device *spi = to_spi_device(dev);                    \
-       return spi_statistics_##field##_show(&spi->statistics, buf);    \
+       return spi_statistics_##field##_show(spi->pcpu_statistics, buf); \
 }                                                                      \
 static struct device_attribute dev_attr_spi_device_##field = {         \
        .attr = { .name = file, .mode = 0444 },                         \
        .show = spi_device_##field##_show,                              \
 }
 
-#define SPI_STATISTICS_SHOW_NAME(name, file, field, format_string)     \
+#define SPI_STATISTICS_SHOW_NAME(name, file, field)                    \
 static ssize_t spi_statistics_##name##_show(struct spi_statistics *stat, \
                                            char *buf)                  \
 {                                                                      \
-       unsigned long flags;                                            \
        ssize_t len;                                                    \
-       spin_lock_irqsave(&stat->lock, flags);                          \
-       len = sysfs_emit(buf, format_string "\n", stat->field);         \
-       spin_unlock_irqrestore(&stat->lock, flags);                     \
+       u64 val;                                                        \
+       spi_pcpu_stats_totalize(val, stat, field);                      \
+       len = sysfs_emit(buf, "%llu\n", val);                           \
        return len;                                                     \
 }                                                                      \
 SPI_STATISTICS_ATTRS(name, file)
 
-#define SPI_STATISTICS_SHOW(field, format_string)                      \
+#define SPI_STATISTICS_SHOW(field)                                     \
        SPI_STATISTICS_SHOW_NAME(field, __stringify(field),             \
-                                field, format_string)
+                                field)
 
-SPI_STATISTICS_SHOW(messages, "%lu");
-SPI_STATISTICS_SHOW(transfers, "%lu");
-SPI_STATISTICS_SHOW(errors, "%lu");
-SPI_STATISTICS_SHOW(timedout, "%lu");
+SPI_STATISTICS_SHOW(messages);
+SPI_STATISTICS_SHOW(transfers);
+SPI_STATISTICS_SHOW(errors);
+SPI_STATISTICS_SHOW(timedout);
 
-SPI_STATISTICS_SHOW(spi_sync, "%lu");
-SPI_STATISTICS_SHOW(spi_sync_immediate, "%lu");
-SPI_STATISTICS_SHOW(spi_async, "%lu");
+SPI_STATISTICS_SHOW(spi_sync);
+SPI_STATISTICS_SHOW(spi_sync_immediate);
+SPI_STATISTICS_SHOW(spi_async);
 
-SPI_STATISTICS_SHOW(bytes, "%llu");
-SPI_STATISTICS_SHOW(bytes_rx, "%llu");
-SPI_STATISTICS_SHOW(bytes_tx, "%llu");
+SPI_STATISTICS_SHOW(bytes);
+SPI_STATISTICS_SHOW(bytes_rx);
+SPI_STATISTICS_SHOW(bytes_tx);
 
 #define SPI_STATISTICS_TRANSFER_BYTES_HISTO(index, number)             \
        SPI_STATISTICS_SHOW_NAME(transfer_bytes_histo##index,           \
                                 "transfer_bytes_histo_" number,        \
-                                transfer_bytes_histo[index],  "%lu")
+                                transfer_bytes_histo[index])
 SPI_STATISTICS_TRANSFER_BYTES_HISTO(0,  "0-1");
 SPI_STATISTICS_TRANSFER_BYTES_HISTO(1,  "2-3");
 SPI_STATISTICS_TRANSFER_BYTES_HISTO(2,  "4-7");
@@ -170,7 +212,7 @@ SPI_STATISTICS_TRANSFER_BYTES_HISTO(14, "16384-32767");
 SPI_STATISTICS_TRANSFER_BYTES_HISTO(15, "32768-65535");
 SPI_STATISTICS_TRANSFER_BYTES_HISTO(16, "65536+");
 
-SPI_STATISTICS_SHOW(transfers_split_maxsize, "%lu");
+SPI_STATISTICS_SHOW(transfers_split_maxsize);
 
 static struct attribute *spi_dev_attrs[] = {
        &dev_attr_modalias.attr,
@@ -267,30 +309,33 @@ static const struct attribute_group *spi_master_groups[] = {
        NULL,
 };
 
-static void spi_statistics_add_transfer_stats(struct spi_statistics *stats,
+static void spi_statistics_add_transfer_stats(struct spi_statistics *pcpu_stats,
                                              struct spi_transfer *xfer,
                                              struct spi_controller *ctlr)
 {
-       unsigned long flags;
        int l2len = min(fls(xfer->len), SPI_STATISTICS_HISTO_SIZE) - 1;
+       struct spi_statistics *stats;
 
        if (l2len < 0)
                l2len = 0;
 
-       spin_lock_irqsave(&stats->lock, flags);
+       get_cpu();
+       stats = this_cpu_ptr(pcpu_stats);
+       u64_stats_update_begin(&stats->syncp);
 
-       stats->transfers++;
-       stats->transfer_bytes_histo[l2len]++;
+       u64_stats_inc(&stats->transfers);
+       u64_stats_inc(&stats->transfer_bytes_histo[l2len]);
 
-       stats->bytes += xfer->len;
+       u64_stats_add(&stats->bytes, xfer->len);
        if ((xfer->tx_buf) &&
            (xfer->tx_buf != ctlr->dummy_tx))
-               stats->bytes_tx += xfer->len;
+               u64_stats_add(&stats->bytes_tx, xfer->len);
        if ((xfer->rx_buf) &&
            (xfer->rx_buf != ctlr->dummy_rx))
-               stats->bytes_rx += xfer->len;
+               u64_stats_add(&stats->bytes_rx, xfer->len);
 
-       spin_unlock_irqrestore(&stats->lock, flags);
+       u64_stats_update_end(&stats->syncp);
+       put_cpu();
 }
 
 /*
@@ -519,14 +564,19 @@ struct spi_device *spi_alloc_device(struct spi_controller *ctlr)
                return NULL;
        }
 
+       spi->pcpu_statistics = spi_alloc_pcpu_stats(NULL);
+       if (!spi->pcpu_statistics) {
+               kfree(spi);
+               spi_controller_put(ctlr);
+               return NULL;
+       }
+
        spi->master = spi->controller = ctlr;
        spi->dev.parent = &ctlr->dev;
        spi->dev.bus = &spi_bus_type;
        spi->dev.release = spidev_release;
        spi->mode = ctlr->buswidth_override_bits;
 
-       spin_lock_init(&spi->statistics.lock);
-
        device_initialize(&spi->dev);
        return spi;
 }
@@ -1225,8 +1275,8 @@ static int spi_transfer_wait(struct spi_controller *ctlr,
                             struct spi_message *msg,
                             struct spi_transfer *xfer)
 {
-       struct spi_statistics *statm = &ctlr->statistics;
-       struct spi_statistics *stats = &msg->spi->statistics;
+       struct spi_statistics *statm = ctlr->pcpu_statistics;
+       struct spi_statistics *stats = msg->spi->pcpu_statistics;
        u32 speed_hz = xfer->speed_hz;
        unsigned long long ms;
 
@@ -1304,7 +1354,7 @@ int spi_delay_to_ns(struct spi_delay *_delay, struct spi_transfer *xfer)
                /* Nothing to do here */
                break;
        case SPI_DELAY_UNIT_SCK:
-               /* clock cycles need to be obtained from spi_transfer */
+               /* Clock cycles need to be obtained from spi_transfer */
                if (!xfer)
                        return -EINVAL;
                /*
@@ -1353,7 +1403,7 @@ static void _spi_transfer_cs_change_delay(struct spi_message *msg,
        u32 unit = xfer->cs_change_delay.unit;
        int ret;
 
-       /* return early on "fast" mode - for everything but USECS */
+       /* Return early on "fast" mode - for everything but USECS */
        if (!delay) {
                if (unit == SPI_DELAY_UNIT_USECS)
                        _spi_transfer_delay_ns(default_delay_ns);
@@ -1382,8 +1432,8 @@ static int spi_transfer_one_message(struct spi_controller *ctlr,
        struct spi_transfer *xfer;
        bool keep_cs = false;
        int ret = 0;
-       struct spi_statistics *statm = &ctlr->statistics;
-       struct spi_statistics *stats = &msg->spi->statistics;
+       struct spi_statistics *statm = ctlr->pcpu_statistics;
+       struct spi_statistics *stats = msg->spi->pcpu_statistics;
 
        spi_set_cs(msg->spi, true, false);
 
@@ -1499,6 +1549,103 @@ static void spi_idle_runtime_pm(struct spi_controller *ctlr)
        }
 }
 
+static int __spi_pump_transfer_message(struct spi_controller *ctlr,
+               struct spi_message *msg, bool was_busy)
+{
+       struct spi_transfer *xfer;
+       int ret;
+
+       if (!was_busy && ctlr->auto_runtime_pm) {
+               ret = pm_runtime_get_sync(ctlr->dev.parent);
+               if (ret < 0) {
+                       pm_runtime_put_noidle(ctlr->dev.parent);
+                       dev_err(&ctlr->dev, "Failed to power device: %d\n",
+                               ret);
+                       return ret;
+               }
+       }
+
+       if (!was_busy)
+               trace_spi_controller_busy(ctlr);
+
+       if (!was_busy && ctlr->prepare_transfer_hardware) {
+               ret = ctlr->prepare_transfer_hardware(ctlr);
+               if (ret) {
+                       dev_err(&ctlr->dev,
+                               "failed to prepare transfer hardware: %d\n",
+                               ret);
+
+                       if (ctlr->auto_runtime_pm)
+                               pm_runtime_put(ctlr->dev.parent);
+
+                       msg->status = ret;
+                       spi_finalize_current_message(ctlr);
+
+                       return ret;
+               }
+       }
+
+       trace_spi_message_start(msg);
+
+       if (ctlr->prepare_message) {
+               ret = ctlr->prepare_message(ctlr, msg);
+               if (ret) {
+                       dev_err(&ctlr->dev, "failed to prepare message: %d\n",
+                               ret);
+                       msg->status = ret;
+                       spi_finalize_current_message(ctlr);
+                       return ret;
+               }
+               msg->prepared = true;
+       }
+
+       ret = spi_map_msg(ctlr, msg);
+       if (ret) {
+               msg->status = ret;
+               spi_finalize_current_message(ctlr);
+               return ret;
+       }
+
+       if (!ctlr->ptp_sts_supported && !ctlr->transfer_one) {
+               list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+                       xfer->ptp_sts_word_pre = 0;
+                       ptp_read_system_prets(xfer->ptp_sts);
+               }
+       }
+
+       /*
+        * Drivers implementation of transfer_one_message() must arrange for
+        * spi_finalize_current_message() to get called. Most drivers will do
+        * this in the calling context, but some don't. For those cases, a
+        * completion is used to guarantee that this function does not return
+        * until spi_finalize_current_message() is done accessing
+        * ctlr->cur_msg.
+        * Use of the following two flags enable to opportunistically skip the
+        * use of the completion since its use involves expensive spin locks.
+        * In case of a race with the context that calls
+        * spi_finalize_current_message() the completion will always be used,
+        * due to strict ordering of these flags using barriers.
+        */
+       WRITE_ONCE(ctlr->cur_msg_incomplete, true);
+       WRITE_ONCE(ctlr->cur_msg_need_completion, false);
+       reinit_completion(&ctlr->cur_msg_completion);
+       smp_wmb(); /* Make these available to spi_finalize_current_message() */
+
+       ret = ctlr->transfer_one_message(ctlr, msg);
+       if (ret) {
+               dev_err(&ctlr->dev,
+                       "failed to transfer one message from queue\n");
+               return ret;
+       }
+
+       WRITE_ONCE(ctlr->cur_msg_need_completion, true);
+       smp_mb(); /* See spi_finalize_current_message()... */
+       if (READ_ONCE(ctlr->cur_msg_incomplete))
+               wait_for_completion(&ctlr->cur_msg_completion);
+
+       return 0;
+}
+
 /**
  * __spi_pump_messages - function which processes spi message queue
  * @ctlr: controller to process queue for
@@ -1514,34 +1661,25 @@ static void spi_idle_runtime_pm(struct spi_controller *ctlr)
  */
 static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
 {
-       struct spi_transfer *xfer;
        struct spi_message *msg;
        bool was_busy = false;
        unsigned long flags;
        int ret;
 
+       /* Take the IO mutex */
+       mutex_lock(&ctlr->io_mutex);
+
        /* Lock queue */
        spin_lock_irqsave(&ctlr->queue_lock, flags);
 
        /* Make sure we are not already running a message */
-       if (ctlr->cur_msg) {
-               spin_unlock_irqrestore(&ctlr->queue_lock, flags);
-               return;
-       }
-
-       /* If another context is idling the device then defer */
-       if (ctlr->idling) {
-               kthread_queue_work(ctlr->kworker, &ctlr->pump_messages);
-               spin_unlock_irqrestore(&ctlr->queue_lock, flags);
-               return;
-       }
+       if (ctlr->cur_msg)
+               goto out_unlock;
 
        /* Check if the queue is idle */
        if (list_empty(&ctlr->queue) || !ctlr->running) {
-               if (!ctlr->busy) {
-                       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
-                       return;
-               }
+               if (!ctlr->busy)
+                       goto out_unlock;
 
                /* Defer any non-atomic teardown to the thread */
                if (!in_kthread) {
@@ -1549,17 +1687,16 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
                            !ctlr->unprepare_transfer_hardware) {
                                spi_idle_runtime_pm(ctlr);
                                ctlr->busy = false;
+                               ctlr->queue_empty = true;
                                trace_spi_controller_idle(ctlr);
                        } else {
                                kthread_queue_work(ctlr->kworker,
                                                   &ctlr->pump_messages);
                        }
-                       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
-                       return;
+                       goto out_unlock;
                }
 
                ctlr->busy = false;
-               ctlr->idling = true;
                spin_unlock_irqrestore(&ctlr->queue_lock, flags);
 
                kfree(ctlr->dummy_rx);
@@ -1574,9 +1711,8 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
                trace_spi_controller_idle(ctlr);
 
                spin_lock_irqsave(&ctlr->queue_lock, flags);
-               ctlr->idling = false;
-               spin_unlock_irqrestore(&ctlr->queue_lock, flags);
-               return;
+               ctlr->queue_empty = true;
+               goto out_unlock;
        }
 
        /* Extract head of queue */
@@ -1590,81 +1726,23 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
                ctlr->busy = true;
        spin_unlock_irqrestore(&ctlr->queue_lock, flags);
 
-       mutex_lock(&ctlr->io_mutex);
-
-       if (!was_busy && ctlr->auto_runtime_pm) {
-               ret = pm_runtime_resume_and_get(ctlr->dev.parent);
-               if (ret < 0) {
-                       dev_err(&ctlr->dev, "Failed to power device: %d\n",
-                               ret);
-                       mutex_unlock(&ctlr->io_mutex);
-                       return;
-               }
-       }
-
-       if (!was_busy)
-               trace_spi_controller_busy(ctlr);
-
-       if (!was_busy && ctlr->prepare_transfer_hardware) {
-               ret = ctlr->prepare_transfer_hardware(ctlr);
-               if (ret) {
-                       dev_err(&ctlr->dev,
-                               "failed to prepare transfer hardware: %d\n",
-                               ret);
-
-                       if (ctlr->auto_runtime_pm)
-                               pm_runtime_put(ctlr->dev.parent);
-
-                       msg->status = ret;
-                       spi_finalize_current_message(ctlr);
-
-                       mutex_unlock(&ctlr->io_mutex);
-                       return;
-               }
-       }
-
-       trace_spi_message_start(msg);
-
-       if (ctlr->prepare_message) {
-               ret = ctlr->prepare_message(ctlr, msg);
-               if (ret) {
-                       dev_err(&ctlr->dev, "failed to prepare message: %d\n",
-                               ret);
-                       msg->status = ret;
-                       spi_finalize_current_message(ctlr);
-                       goto out;
-               }
-               ctlr->cur_msg_prepared = true;
-       }
-
-       ret = spi_map_msg(ctlr, msg);
-       if (ret) {
-               msg->status = ret;
-               spi_finalize_current_message(ctlr);
-               goto out;
-       }
-
-       if (!ctlr->ptp_sts_supported && !ctlr->transfer_one) {
-               list_for_each_entry(xfer, &msg->transfers, transfer_list) {
-                       xfer->ptp_sts_word_pre = 0;
-                       ptp_read_system_prets(xfer->ptp_sts);
-               }
-       }
+       ret = __spi_pump_transfer_message(ctlr, msg, was_busy);
+       if (!ret)
+               kthread_queue_work(ctlr->kworker, &ctlr->pump_messages);
 
-       ret = ctlr->transfer_one_message(ctlr, msg);
-       if (ret) {
-               dev_err(&ctlr->dev,
-                       "failed to transfer one message from queue: %d\n",
-                       ret);
-               goto out;
-       }
+       ctlr->cur_msg = NULL;
+       ctlr->fallback = false;
 
-out:
        mutex_unlock(&ctlr->io_mutex);
 
        /* Prod the scheduler in case transfer_one() was busy waiting */
        if (!ret)
                cond_resched();
+       return;
+
+out_unlock:
+       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
+       mutex_unlock(&ctlr->io_mutex);
 }
 
 /**
@@ -1789,6 +1867,7 @@ static int spi_init_queue(struct spi_controller *ctlr)
 {
        ctlr->running = false;
        ctlr->busy = false;
+       ctlr->queue_empty = true;
 
        ctlr->kworker = kthread_create_worker(0, dev_name(&ctlr->dev));
        if (IS_ERR(ctlr->kworker)) {
@@ -1826,7 +1905,7 @@ struct spi_message *spi_get_next_queued_message(struct spi_controller *ctlr)
        struct spi_message *next;
        unsigned long flags;
 
-       /* get a pointer to the next message, if any */
+       /* Get a pointer to the next message, if any */
        spin_lock_irqsave(&ctlr->queue_lock, flags);
        next = list_first_entry_or_null(&ctlr->queue, struct spi_message,
                                        queue);
@@ -1847,12 +1926,9 @@ void spi_finalize_current_message(struct spi_controller *ctlr)
 {
        struct spi_transfer *xfer;
        struct spi_message *mesg;
-       unsigned long flags;
        int ret;
 
-       spin_lock_irqsave(&ctlr->queue_lock, flags);
        mesg = ctlr->cur_msg;
-       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
 
        if (!ctlr->ptp_sts_supported && !ctlr->transfer_one) {
                list_for_each_entry(xfer, &mesg->transfers, transfer_list) {
@@ -1876,7 +1952,7 @@ void spi_finalize_current_message(struct spi_controller *ctlr)
         */
        spi_res_release(ctlr, mesg);
 
-       if (ctlr->cur_msg_prepared && ctlr->unprepare_message) {
+       if (mesg->prepared && ctlr->unprepare_message) {
                ret = ctlr->unprepare_message(ctlr, mesg);
                if (ret) {
                        dev_err(&ctlr->dev, "failed to unprepare message: %d\n",
@@ -1884,12 +1960,12 @@ void spi_finalize_current_message(struct spi_controller *ctlr)
                }
        }
 
-       spin_lock_irqsave(&ctlr->queue_lock, flags);
-       ctlr->cur_msg = NULL;
-       ctlr->cur_msg_prepared = false;
-       ctlr->fallback = false;
-       kthread_queue_work(ctlr->kworker, &ctlr->pump_messages);
-       spin_unlock_irqrestore(&ctlr->queue_lock, flags);
+       mesg->prepared = false;
+
+       WRITE_ONCE(ctlr->cur_msg_incomplete, false);
+       smp_mb(); /* See __spi_pump_transfer_message()... */
+       if (READ_ONCE(ctlr->cur_msg_need_completion))
+               complete(&ctlr->cur_msg_completion);
 
        trace_spi_message_done(mesg);
 
@@ -1992,6 +2068,7 @@ static int __spi_queued_transfer(struct spi_device *spi,
        msg->status = -EINPROGRESS;
 
        list_add_tail(&msg->queue, &ctlr->queue);
+       ctlr->queue_empty = false;
        if (!ctlr->busy && need_pump)
                kthread_queue_work(ctlr->kworker, &ctlr->pump_messages);
 
@@ -2376,9 +2453,6 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
                        if (lookup->index != -1 && lookup->n++ != lookup->index)
                                return 1;
 
-                       if (lookup->index == -1 && !ctlr)
-                               return -ENODEV;
-
                        status = acpi_get_handle(NULL,
                                                 sb->resource_source.string_ptr,
                                                 &parent_handle);
@@ -2398,7 +2472,7 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
 
                                ctlr = acpi_spi_find_controller_by_adev(adev);
                                if (!ctlr)
-                                       return -ENODEV;
+                                       return -EPROBE_DEFER;
 
                                lookup->ctlr = ctlr;
                        }
@@ -2481,8 +2555,8 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
        acpi_dev_free_resource_list(&resource_list);
 
        if (ret < 0)
-               /* found SPI in _CRS but it points to another controller */
-               return ERR_PTR(-ENODEV);
+               /* Found SPI in _CRS but it points to another controller */
+               return ERR_PTR(ret);
 
        if (!lookup.max_speed_hz &&
            ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
@@ -2937,7 +3011,7 @@ int spi_register_controller(struct spi_controller *ctlr)
                return status;
 
        if (ctlr->bus_num >= 0) {
-               /* devices with a fixed bus num must check-in with the num */
+               /* Devices with a fixed bus num must check-in with the num */
                mutex_lock(&board_lock);
                id = idr_alloc(&spi_master_idr, ctlr, ctlr->bus_num,
                        ctlr->bus_num + 1, GFP_KERNEL);
@@ -2946,7 +3020,7 @@ int spi_register_controller(struct spi_controller *ctlr)
                        return id == -ENOSPC ? -EBUSY : id;
                ctlr->bus_num = id;
        } else if (ctlr->dev.of_node) {
-               /* allocate dynamic bus number using Linux idr */
+               /* Allocate dynamic bus number using Linux idr */
                id = of_alias_get_id(ctlr->dev.of_node, "spi");
                if (id >= 0) {
                        ctlr->bus_num = id;
@@ -2975,6 +3049,7 @@ int spi_register_controller(struct spi_controller *ctlr)
        }
        ctlr->bus_lock_flag = 0;
        init_completion(&ctlr->xfer_completion);
+       init_completion(&ctlr->cur_msg_completion);
        if (!ctlr->max_dma_len)
                ctlr->max_dma_len = INT_MAX;
 
@@ -3004,7 +3079,7 @@ int spi_register_controller(struct spi_controller *ctlr)
                goto free_bus_id;
        }
 
-       /* setting last_cs to -1 means no chip selected */
+       /* Setting last_cs to -1 means no chip selected */
        ctlr->last_cs = -1;
 
        status = device_add(&ctlr->dev);
@@ -3028,8 +3103,13 @@ int spi_register_controller(struct spi_controller *ctlr)
                        goto free_bus_id;
                }
        }
-       /* add statistics */
-       spin_lock_init(&ctlr->statistics.lock);
+       /* Add statistics */
+       ctlr->pcpu_statistics = spi_alloc_pcpu_stats(dev);
+       if (!ctlr->pcpu_statistics) {
+               dev_err(dev, "Error allocating per-cpu statistics\n");
+               status = -ENOMEM;
+               goto destroy_queue;
+       }
 
        mutex_lock(&board_lock);
        list_add_tail(&ctlr->list, &spi_controller_list);
@@ -3042,6 +3122,8 @@ int spi_register_controller(struct spi_controller *ctlr)
        acpi_register_spi_devices(ctlr);
        return status;
 
+destroy_queue:
+       spi_destroy_queue(ctlr);
 free_bus_id:
        mutex_lock(&board_lock);
        idr_remove(&spi_master_idr, ctlr->bus_num);
@@ -3050,9 +3132,9 @@ free_bus_id:
 }
 EXPORT_SYMBOL_GPL(spi_register_controller);
 
-static void devm_spi_unregister(void *ctlr)
+static void devm_spi_unregister(struct device *dev, void *res)
 {
-       spi_unregister_controller(ctlr);
+       spi_unregister_controller(*(struct spi_controller **)res);
 }
 
 /**
@@ -3071,13 +3153,22 @@ static void devm_spi_unregister(void *ctlr)
 int devm_spi_register_controller(struct device *dev,
                                 struct spi_controller *ctlr)
 {
+       struct spi_controller **ptr;
        int ret;
 
+       ptr = devres_alloc(devm_spi_unregister, sizeof(*ptr), GFP_KERNEL);
+       if (!ptr)
+               return -ENOMEM;
+
        ret = spi_register_controller(ctlr);
-       if (ret)
-               return ret;
+       if (!ret) {
+               *ptr = ctlr;
+               devres_add(dev, ptr);
+       } else {
+               devres_free(ptr);
+       }
 
-       return devm_add_action_or_reset(dev, devm_spi_unregister, ctlr);
+       return ret;
 }
 EXPORT_SYMBOL_GPL(devm_spi_register_controller);
 
@@ -3124,7 +3215,7 @@ void spi_unregister_controller(struct spi_controller *ctlr)
 
        device_del(&ctlr->dev);
 
-       /* free bus id */
+       /* Free bus id */
        mutex_lock(&board_lock);
        if (found == ctlr)
                idr_remove(&spi_master_idr, id);
@@ -3183,14 +3274,14 @@ static void __spi_replace_transfers_release(struct spi_controller *ctlr,
        struct spi_replaced_transfers *rxfer = res;
        size_t i;
 
-       /* call extra callback if requested */
+       /* Call extra callback if requested */
        if (rxfer->release)
                rxfer->release(ctlr, msg, res);
 
-       /* insert replaced transfers back into the message */
+       /* Insert replaced transfers back into the message */
        list_splice(&rxfer->replaced_transfers, rxfer->replaced_after);
 
-       /* remove the formerly inserted entries */
+       /* Remove the formerly inserted entries */
        for (i = 0; i < rxfer->inserted; i++)
                list_del(&rxfer->inserted_transfers[i].transfer_list);
 }
@@ -3223,7 +3314,7 @@ static struct spi_replaced_transfers *spi_replace_transfers(
        struct spi_transfer *xfer;
        size_t i;
 
-       /* allocate the structure using spi_res */
+       /* Allocate the structure using spi_res */
        rxfer = spi_res_alloc(msg->spi, __spi_replace_transfers_release,
                              struct_size(rxfer, inserted_transfers, insert)
                              + extradatasize,
@@ -3231,15 +3322,15 @@ static struct spi_replaced_transfers *spi_replace_transfers(
        if (!rxfer)
                return ERR_PTR(-ENOMEM);
 
-       /* the release code to invoke before running the generic release */
+       /* The release code to invoke before running the generic release */
        rxfer->release = release;
 
-       /* assign extradata */
+       /* Assign extradata */
        if (extradatasize)
                rxfer->extradata =
                        &rxfer->inserted_transfers[insert];
 
-       /* init the replaced_transfers list */
+       /* Init the replaced_transfers list */
        INIT_LIST_HEAD(&rxfer->replaced_transfers);
 
        /*
@@ -3248,7 +3339,7 @@ static struct spi_replaced_transfers *spi_replace_transfers(
         */
        rxfer->replaced_after = xfer_first->transfer_list.prev;
 
-       /* remove the requested number of transfers */
+       /* Remove the requested number of transfers */
        for (i = 0; i < remove; i++) {
                /*
                 * If the entry after replaced_after it is msg->transfers
@@ -3258,14 +3349,14 @@ static struct spi_replaced_transfers *spi_replace_transfers(
                if (rxfer->replaced_after->next == &msg->transfers) {
                        dev_err(&msg->spi->dev,
                                "requested to remove more spi_transfers than are available\n");
-                       /* insert replaced transfers back into the message */
+                       /* Insert replaced transfers back into the message */
                        list_splice(&rxfer->replaced_transfers,
                                    rxfer->replaced_after);
 
-                       /* free the spi_replace_transfer structure */
+                       /* Free the spi_replace_transfer structure... */
                        spi_res_free(rxfer);
 
-                       /* and return with an error */
+                       /* ...and return with an error */
                        return ERR_PTR(-EINVAL);
                }
 
@@ -3282,26 +3373,26 @@ static struct spi_replaced_transfers *spi_replace_transfers(
         * based on the first transfer to get removed.
         */
        for (i = 0; i < insert; i++) {
-               /* we need to run in reverse order */
+               /* We need to run in reverse order */
                xfer = &rxfer->inserted_transfers[insert - 1 - i];
 
-               /* copy all spi_transfer data */
+               /* Copy all spi_transfer data */
                memcpy(xfer, xfer_first, sizeof(*xfer));
 
-               /* add to list */
+               /* Add to list */
                list_add(&xfer->transfer_list, rxfer->replaced_after);
 
-               /* clear cs_change and delay for all but the last */
+               /* Clear cs_change and delay for all but the last */
                if (i) {
                        xfer->cs_change = false;
                        xfer->delay.value = 0;
                }
        }
 
-       /* set up inserted */
+       /* Set up inserted... */
        rxfer->inserted = insert;
 
-       /* and register it with spi_res/spi_message */
+       /* ...and register it with spi_res/spi_message */
        spi_res_add(msg, rxfer);
 
        return rxfer;
@@ -3318,10 +3409,10 @@ static int __spi_split_transfer_maxsize(struct spi_controller *ctlr,
        size_t offset;
        size_t count, i;
 
-       /* calculate how many we have to replace */
+       /* Calculate how many we have to replace */
        count = DIV_ROUND_UP(xfer->len, maxsize);
 
-       /* create replacement */
+       /* Create replacement */
        srt = spi_replace_transfers(msg, xfer, 1, count, NULL, 0, gfp);
        if (IS_ERR(srt))
                return PTR_ERR(srt);
@@ -3344,9 +3435,9 @@ static int __spi_split_transfer_maxsize(struct spi_controller *ctlr,
         */
        xfers[0].len = min_t(size_t, maxsize, xfer[0].len);
 
-       /* all the others need rx_buf/tx_buf also set */
+       /* All the others need rx_buf/tx_buf also set */
        for (i = 1, offset = maxsize; i < count; offset += maxsize, i++) {
-               /* update rx_buf, tx_buf and dma */
+               /* Update rx_buf, tx_buf and dma */
                if (xfers[i].rx_buf)
                        xfers[i].rx_buf += offset;
                if (xfers[i].rx_dma)
@@ -3356,7 +3447,7 @@ static int __spi_split_transfer_maxsize(struct spi_controller *ctlr,
                if (xfers[i].tx_dma)
                        xfers[i].tx_dma += offset;
 
-               /* update length */
+               /* Update length */
                xfers[i].len = min(maxsize, xfers[i].len - offset);
        }
 
@@ -3366,10 +3457,10 @@ static int __spi_split_transfer_maxsize(struct spi_controller *ctlr,
         */
        *xferp = &xfers[count - 1];
 
-       /* increment statistics counters */
-       SPI_STATISTICS_INCREMENT_FIELD(&ctlr->statistics,
+       /* Increment statistics counters */
+       SPI_STATISTICS_INCREMENT_FIELD(ctlr->pcpu_statistics,
                                       transfers_split_maxsize);
-       SPI_STATISTICS_INCREMENT_FIELD(&msg->spi->statistics,
+       SPI_STATISTICS_INCREMENT_FIELD(msg->spi->pcpu_statistics,
                                       transfers_split_maxsize);
 
        return 0;
@@ -3628,7 +3719,7 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
                        return ret;
 
                list_for_each_entry(xfer, &message->transfers, transfer_list) {
-                       /* don't change cs_change on the last entry in the list */
+                       /* Don't change cs_change on the last entry in the list */
                        if (list_is_last(&xfer->transfer_list, &message->transfers))
                                break;
                        xfer->cs_change = 1;
@@ -3721,7 +3812,7 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)
                                !(spi->mode & SPI_TX_QUAD))
                                return -EINVAL;
                }
-               /* check transfer rx_nbits */
+               /* Check transfer rx_nbits */
                if (xfer->rx_buf) {
                        if (spi->mode & SPI_NO_RX)
                                return -EINVAL;
@@ -3760,8 +3851,8 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
 
        message->spi = spi;
 
-       SPI_STATISTICS_INCREMENT_FIELD(&ctlr->statistics, spi_async);
-       SPI_STATISTICS_INCREMENT_FIELD(&spi->statistics, spi_async);
+       SPI_STATISTICS_INCREMENT_FIELD(ctlr->pcpu_statistics, spi_async);
+       SPI_STATISTICS_INCREMENT_FIELD(spi->pcpu_statistics, spi_async);
 
        trace_spi_message_submit(message);
 
@@ -3880,6 +3971,39 @@ static int spi_async_locked(struct spi_device *spi, struct spi_message *message)
 
 }
 
+static void __spi_transfer_message_noqueue(struct spi_controller *ctlr, struct spi_message *msg)
+{
+       bool was_busy;
+       int ret;
+
+       mutex_lock(&ctlr->io_mutex);
+
+       was_busy = ctlr->busy;
+
+       ctlr->cur_msg = msg;
+       ret = __spi_pump_transfer_message(ctlr, msg, was_busy);
+       if (ret)
+               goto out;
+
+       ctlr->cur_msg = NULL;
+       ctlr->fallback = false;
+
+       if (!was_busy) {
+               kfree(ctlr->dummy_rx);
+               ctlr->dummy_rx = NULL;
+               kfree(ctlr->dummy_tx);
+               ctlr->dummy_tx = NULL;
+               if (ctlr->unprepare_transfer_hardware &&
+                   ctlr->unprepare_transfer_hardware(ctlr))
+                       dev_err(&ctlr->dev,
+                               "failed to unprepare transfer hardware\n");
+               spi_idle_runtime_pm(ctlr);
+       }
+
+out:
+       mutex_unlock(&ctlr->io_mutex);
+}
+
 /*-------------------------------------------------------------------------*/
 
 /*
@@ -3898,51 +4022,51 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message)
        DECLARE_COMPLETION_ONSTACK(done);
        int status;
        struct spi_controller *ctlr = spi->controller;
-       unsigned long flags;
 
        status = __spi_validate(spi, message);
        if (status != 0)
                return status;
 
-       message->complete = spi_complete;
-       message->context = &done;
        message->spi = spi;
 
-       SPI_STATISTICS_INCREMENT_FIELD(&ctlr->statistics, spi_sync);
-       SPI_STATISTICS_INCREMENT_FIELD(&spi->statistics, spi_sync);
+       SPI_STATISTICS_INCREMENT_FIELD(ctlr->pcpu_statistics, spi_sync);
+       SPI_STATISTICS_INCREMENT_FIELD(spi->pcpu_statistics, spi_sync);
 
        /*
-        * If we're not using the legacy transfer method then we will
-        * try to transfer in the calling context so special case.
-        * This code would be less tricky if we could remove the
-        * support for driver implemented message queues.
+        * Checking queue_empty here only guarantees async/sync message
+        * ordering when coming from the same context. It does not need to
+        * guard against reentrancy from a different context. The io_mutex
+        * will catch those cases.
         */
-       if (ctlr->transfer == spi_queued_transfer) {
-               spin_lock_irqsave(&ctlr->bus_lock_spinlock, flags);
+       if (READ_ONCE(ctlr->queue_empty)) {
+               message->actual_length = 0;
+               message->status = -EINPROGRESS;
 
                trace_spi_message_submit(message);
 
-               status = __spi_queued_transfer(spi, message, false);
+               SPI_STATISTICS_INCREMENT_FIELD(ctlr->pcpu_statistics, spi_sync_immediate);
+               SPI_STATISTICS_INCREMENT_FIELD(spi->pcpu_statistics, spi_sync_immediate);
 
-               spin_unlock_irqrestore(&ctlr->bus_lock_spinlock, flags);
-       } else {
-               status = spi_async_locked(spi, message);
+               __spi_transfer_message_noqueue(ctlr, message);
+
+               return message->status;
        }
 
+       /*
+        * There are messages in the async queue that could have originated
+        * from the same context, so we need to preserve ordering.
+        * Therefor we send the message to the async queue and wait until they
+        * are completed.
+        */
+       message->complete = spi_complete;
+       message->context = &done;
+       status = spi_async_locked(spi, message);
        if (status == 0) {
-               /* Push out the messages in the calling context if we can */
-               if (ctlr->transfer == spi_queued_transfer) {
-                       SPI_STATISTICS_INCREMENT_FIELD(&ctlr->statistics,
-                                                      spi_sync_immediate);
-                       SPI_STATISTICS_INCREMENT_FIELD(&spi->statistics,
-                                                      spi_sync_immediate);
-                       __spi_pump_messages(ctlr, false);
-               }
-
                wait_for_completion(&done);
                status = message->status;
        }
        message->context = NULL;
+
        return status;
 }
 
@@ -4026,7 +4150,7 @@ int spi_bus_lock(struct spi_controller *ctlr)
        ctlr->bus_lock_flag = 1;
        spin_unlock_irqrestore(&ctlr->bus_lock_spinlock, flags);
 
-       /* mutex remains locked until spi_bus_unlock is called */
+       /* Mutex remains locked until spi_bus_unlock() is called */
 
        return 0;
 }
@@ -4055,7 +4179,7 @@ int spi_bus_unlock(struct spi_controller *ctlr)
 }
 EXPORT_SYMBOL_GPL(spi_bus_unlock);
 
-/* portable code must never pass more than 32 bytes */
+/* Portable code must never pass more than 32 bytes */
 #define        SPI_BUFSIZ      max(32, SMP_CACHE_BYTES)
 
 static u8      *buf;
@@ -4121,7 +4245,7 @@ int spi_write_then_read(struct spi_device *spi,
        x[0].tx_buf = local_buf;
        x[1].rx_buf = local_buf + n_tx;
 
-       /* do the i/o */
+       /* Do the i/o */
        status = spi_sync(spi, &message);
        if (status == 0)
                memcpy(rxbuf, x[1].rx_buf, n_rx);
@@ -4138,7 +4262,7 @@ EXPORT_SYMBOL_GPL(spi_write_then_read);
 /*-------------------------------------------------------------------------*/
 
 #if IS_ENABLED(CONFIG_OF_DYNAMIC)
-/* must call put_device() when done with returned spi_device device */
+/* Must call put_device() when done with returned spi_device device */
 static struct spi_device *of_find_spi_device_by_node(struct device_node *node)
 {
        struct device *dev = bus_find_device_by_of_node(&spi_bus_type, node);
@@ -4146,7 +4270,7 @@ static struct spi_device *of_find_spi_device_by_node(struct device_node *node)
        return dev ? to_spi_device(dev) : NULL;
 }
 
-/* the spi controllers are not using spi_bus, so we find it with another way */
+/* The spi controllers are not using spi_bus, so we find it with another way */
 static struct spi_controller *of_find_spi_controller_by_node(struct device_node *node)
 {
        struct device *dev;
@@ -4157,7 +4281,7 @@ static struct spi_controller *of_find_spi_controller_by_node(struct device_node
        if (!dev)
                return NULL;
 
-       /* reference got in class_find_device */
+       /* Reference got in class_find_device */
        return container_of(dev, struct spi_controller, dev);
 }
 
@@ -4172,7 +4296,7 @@ static int of_spi_notify(struct notifier_block *nb, unsigned long action,
        case OF_RECONFIG_CHANGE_ADD:
                ctlr = of_find_spi_controller_by_node(rd->dn->parent);
                if (ctlr == NULL)
-                       return NOTIFY_OK;       /* not for us */
+                       return NOTIFY_OK;       /* Not for us */
 
                if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) {
                        put_device(&ctlr->dev);
@@ -4191,19 +4315,19 @@ static int of_spi_notify(struct notifier_block *nb, unsigned long action,
                break;
 
        case OF_RECONFIG_CHANGE_REMOVE:
-               /* already depopulated? */
+               /* Already depopulated? */
                if (!of_node_check_flag(rd->dn, OF_POPULATED))
                        return NOTIFY_OK;
 
-               /* find our device by node */
+               /* Find our device by node */
                spi = of_find_spi_device_by_node(rd->dn);
                if (spi == NULL)
-                       return NOTIFY_OK;       /* no? not meant for us */
+                       return NOTIFY_OK;       /* No? not meant for us */
 
-               /* unregister takes one ref away */
+               /* Unregister takes one ref away */
                spi_unregister_device(spi);
 
-               /* and put the reference of the find */
+               /* And put the reference of the find */
                put_device(&spi->dev);
                break;
        }
index b8151d95a8068b83fb6d1ce8788dd7d3f8ee671d..b263b0fde03ca64c296579798aa1224836f144c7 100644 (file)
@@ -137,11 +137,9 @@ static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev,
 static u32 get_load(struct cpufreq_cooling_device *cpufreq_cdev, int cpu,
                    int cpu_idx)
 {
-       unsigned long max = arch_scale_cpu_capacity(cpu);
-       unsigned long util;
+       unsigned long util = sched_cpu_util(cpu);
 
-       util = sched_cpu_util(cpu, max);
-       return (util * 100) / max;
+       return (util * 100) / arch_scale_cpu_capacity(cpu);
 }
 #else /* !CONFIG_SMP */
 static u32 get_load(struct cpufreq_cooling_device *cpufreq_cdev, int cpu,
index 43eb25b167bc006ff0a1206772fc1dcfe48105cf..ccdf8a24ddc73f805b1dd254bb3c0e7bcd7e4e87 100644 (file)
@@ -399,6 +399,10 @@ static const struct of_device_id rcar_gen3_thermal_dt_ids[] = {
                .compatible = "renesas,r8a779a0-thermal",
                .data = &rcar_gen3_ths_tj_1,
        },
+       {
+               .compatible = "renesas,r8a779f0-thermal",
+               .data = &rcar_gen3_ths_tj_1,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
index c89daac0ad8c3721e5046651c14d7ee42254ecd3..b1f0dc8df47cde840a403f62699b9f5326b72c06 100644 (file)
@@ -301,37 +301,22 @@ static bool tb_acpi_bus_match(struct device *dev)
        return tb_is_switch(dev) || tb_is_usb4_port_device(dev);
 }
 
-static struct acpi_device *tb_acpi_find_port(struct acpi_device *adev,
-                                            const struct tb_port *port)
+static struct acpi_device *tb_acpi_switch_find_companion(struct tb_switch *sw)
 {
-       struct acpi_device *port_adev;
-
-       if (!adev)
-               return NULL;
+       struct acpi_device *adev = NULL;
+       struct tb_switch *parent_sw;
 
        /*
         * Device routers exists under the downstream facing USB4 port
         * of the parent router. Their _ADR is always 0.
         */
-       list_for_each_entry(port_adev, &adev->children, node) {
-               if (acpi_device_adr(port_adev) == port->port)
-                       return port_adev;
-       }
-
-       return NULL;
-}
-
-static struct acpi_device *tb_acpi_switch_find_companion(struct tb_switch *sw)
-{
-       struct acpi_device *adev = NULL;
-       struct tb_switch *parent_sw;
-
        parent_sw = tb_switch_parent(sw);
        if (parent_sw) {
                struct tb_port *port = tb_port_at(tb_route(sw), parent_sw);
                struct acpi_device *port_adev;
 
-               port_adev = tb_acpi_find_port(ACPI_COMPANION(&parent_sw->dev), port);
+               port_adev = acpi_find_child_by_adr(ACPI_COMPANION(&parent_sw->dev),
+                                                  port->port);
                if (port_adev)
                        adev = acpi_find_child_device(port_adev, 0, false);
        } else {
@@ -364,8 +349,8 @@ static struct acpi_device *tb_acpi_find_companion(struct device *dev)
        if (tb_is_switch(dev))
                return tb_acpi_switch_find_companion(tb_to_switch(dev));
        else if (tb_is_usb4_port_device(dev))
-               return tb_acpi_find_port(ACPI_COMPANION(dev->parent),
-                                        tb_to_usb4_port_device(dev)->port);
+               return acpi_find_child_by_adr(ACPI_COMPANION(dev->parent),
+                                             tb_to_usb4_port_device(dev)->port->port);
        return NULL;
 }
 
index a452748c69b254d231889e4826c88ca299fd06d8..7172cd1792dfc8cf6dca6a43a052c9fd75658301 100644 (file)
@@ -1099,8 +1099,8 @@ config SERIAL_TIMBERDALE
 config SERIAL_BCM63XX
        tristate "Broadcom BCM63xx/BCM33xx UART support"
        select SERIAL_CORE
-       depends on ARCH_BCM4908 || ARCH_BCM_63XX || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
-       default ARCH_BCM4908 || ARCH_BCM_63XX || BCM63XX || BMIPS_GENERIC
+       depends on ARCH_BCM4908 || ARCH_BCMBCA || BCM63XX || BMIPS_GENERIC || COMPILE_TEST
+       default ARCH_BCM4908 || ARCH_BCMBCA || BCM63XX || BMIPS_GENERIC
        help
          This enables the driver for the onchip UART core found on
          the following chipsets:
index c7b337480e3e7d0317fd4a2735c8af6ed593584b..3d367be7172866afc7cc7e6124c9a525c6e67ac6 100644 (file)
@@ -2953,37 +2953,59 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
                struct ufshcd_lrb *lrbp, int max_timeout)
 {
-       int err = 0;
-       unsigned long time_left;
+       unsigned long time_left = msecs_to_jiffies(max_timeout);
        unsigned long flags;
+       bool pending;
+       int err;
 
+retry:
        time_left = wait_for_completion_timeout(hba->dev_cmd.complete,
-                       msecs_to_jiffies(max_timeout));
+                                               time_left);
 
-       spin_lock_irqsave(hba->host->host_lock, flags);
-       hba->dev_cmd.complete = NULL;
        if (likely(time_left)) {
+               /*
+                * The completion handler called complete() and the caller of
+                * this function still owns the @lrbp tag so the code below does
+                * not trigger any race conditions.
+                */
+               hba->dev_cmd.complete = NULL;
                err = ufshcd_get_tr_ocs(lrbp);
                if (!err)
                        err = ufshcd_dev_cmd_completion(hba, lrbp);
-       }
-       spin_unlock_irqrestore(hba->host->host_lock, flags);
-
-       if (!time_left) {
+       } else {
                err = -ETIMEDOUT;
                dev_dbg(hba->dev, "%s: dev_cmd request timedout, tag %d\n",
                        __func__, lrbp->task_tag);
-               if (!ufshcd_clear_cmds(hba, 1U << lrbp->task_tag))
+               if (ufshcd_clear_cmds(hba, 1U << lrbp->task_tag) == 0) {
                        /* successfully cleared the command, retry if needed */
                        err = -EAGAIN;
-               /*
-                * in case of an error, after clearing the doorbell,
-                * we also need to clear the outstanding_request
-                * field in hba
-                */
-               spin_lock_irqsave(&hba->outstanding_lock, flags);
-               __clear_bit(lrbp->task_tag, &hba->outstanding_reqs);
-               spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+                       /*
+                        * Since clearing the command succeeded we also need to
+                        * clear the task tag bit from the outstanding_reqs
+                        * variable.
+                        */
+                       spin_lock_irqsave(&hba->outstanding_lock, flags);
+                       pending = test_bit(lrbp->task_tag,
+                                          &hba->outstanding_reqs);
+                       if (pending) {
+                               hba->dev_cmd.complete = NULL;
+                               __clear_bit(lrbp->task_tag,
+                                           &hba->outstanding_reqs);
+                       }
+                       spin_unlock_irqrestore(&hba->outstanding_lock, flags);
+
+                       if (!pending) {
+                               /*
+                                * The completion handler ran while we tried to
+                                * clear the command.
+                                */
+                               time_left = 1;
+                               goto retry;
+                       }
+               } else {
+                       dev_err(hba->dev, "%s: failed to clear tag %d\n",
+                               __func__, lrbp->task_tag);
+               }
        }
 
        return err;
index e7332cc65b1fecfaa1f62d683ea77391949a5c4e..173aea8e9997ce6ecb1bbba5a4f76d6a3dbd4d6d 100644 (file)
@@ -108,9 +108,20 @@ out:
        return ret;
 }
 
+static bool phandle_exists(const struct device_node *np,
+                          const char *phandle_name, int index)
+{
+       struct device_node *parse_np = of_parse_phandle(np, phandle_name, index);
+
+       if (parse_np)
+               of_node_put(parse_np);
+
+       return parse_np != NULL;
+}
+
 #define MAX_PROP_SIZE 32
 static int ufshcd_populate_vreg(struct device *dev, const char *name,
-               struct ufs_vreg **out_vreg)
+                               struct ufs_vreg **out_vreg)
 {
        char prop_name[MAX_PROP_SIZE];
        struct ufs_vreg *vreg = NULL;
@@ -122,7 +133,7 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name,
        }
 
        snprintf(prop_name, MAX_PROP_SIZE, "%s-supply", name);
-       if (!of_parse_phandle(np, prop_name, 0)) {
+       if (!phandle_exists(np, prop_name, 0)) {
                dev_info(dev, "%s: Unable to find %s regulator, assuming enabled\n",
                                __func__, prop_name);
                goto out;
index d4dcaefd0ea4012ddb9964fd21c8a837515d0fb5..6d93428432f13f1e2cc8461570eebae935c4429c 100644 (file)
@@ -124,22 +124,6 @@ out:
  */
 #define USB_ACPI_LOCATION_VALID (1 << 31)
 
-static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent,
-                                             int raw)
-{
-       struct acpi_device *adev;
-
-       if (!parent)
-               return NULL;
-
-       list_for_each_entry(adev, &parent->children, node) {
-               if (acpi_device_adr(adev) == raw)
-                       return adev;
-       }
-
-       return acpi_find_child_device(parent, raw, false);
-}
-
 static struct acpi_device *
 usb_acpi_get_companion_for_port(struct usb_port *port_dev)
 {
@@ -170,7 +154,7 @@ usb_acpi_get_companion_for_port(struct usb_port *port_dev)
                port1 = port_dev->portnum;
        }
 
-       return usb_acpi_find_port(adev, port1);
+       return acpi_find_child_by_adr(adev, port1);
 }
 
 static struct acpi_device *
index 46d9295d9a6e4a58a2e6d7658e270de31c48eed8..5e8321f43cbdd07e0ae3c89f998d4bd8615568d4 100644 (file)
@@ -528,9 +528,10 @@ static void bind_evtchn_to_cpu(evtchn_port_t evtchn, unsigned int cpu,
        BUG_ON(irq == -1);
 
        if (IS_ENABLED(CONFIG_SMP) && force_affinity) {
-               cpumask_copy(irq_get_affinity_mask(irq), cpumask_of(cpu));
-               cpumask_copy(irq_get_effective_affinity_mask(irq),
-                            cpumask_of(cpu));
+               struct irq_data *data = irq_get_irq_data(irq);
+
+               irq_data_update_affinity(data, cpumask_of(cpu));
+               irq_data_update_effective_affinity(data, cpumask_of(cpu));
        }
 
        xen_evtchn_port_bind_to_cpu(evtchn, cpu, info->cpu);
index dbe996b0dedfcf78a91c077b9ee51d132a73d8d1..b5b8835ddf1535784c74c048ec8dc43932f15212 100644 (file)
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -22,7 +22,7 @@
  * chown_ok - verify permissions to chown inode
  * @mnt_userns:        user namespace of the mount @inode was found from
  * @inode:     inode to check permissions on
- * @uid:       uid to chown @inode to
+ * @ia_vfsuid: uid to chown @inode to
  *
  * If the inode has been found through an idmapped mount the user namespace of
  * the vfsmount must be passed through @mnt_userns. This function will then
  * performed on the raw inode simply passs init_user_ns.
  */
 static bool chown_ok(struct user_namespace *mnt_userns,
-                    const struct inode *inode,
-                    kuid_t uid)
+                    const struct inode *inode, vfsuid_t ia_vfsuid)
 {
-       kuid_t kuid = i_uid_into_mnt(mnt_userns, inode);
-       if (uid_eq(current_fsuid(), kuid) && uid_eq(uid, inode->i_uid))
+       vfsuid_t vfsuid = i_uid_into_vfsuid(mnt_userns, inode);
+       if (vfsuid_eq_kuid(vfsuid, current_fsuid()) &&
+           vfsuid_eq(ia_vfsuid, vfsuid))
                return true;
        if (capable_wrt_inode_uidgid(mnt_userns, inode, CAP_CHOWN))
                return true;
-       if (uid_eq(kuid, INVALID_UID) &&
+       if (!vfsuid_valid(vfsuid) &&
            ns_capable(inode->i_sb->s_user_ns, CAP_CHOWN))
                return true;
        return false;
@@ -49,7 +49,7 @@ static bool chown_ok(struct user_namespace *mnt_userns,
  * chgrp_ok - verify permissions to chgrp inode
  * @mnt_userns:        user namespace of the mount @inode was found from
  * @inode:     inode to check permissions on
- * @gid:       gid to chown @inode to
+ * @ia_vfsgid: gid to chown @inode to
  *
  * If the inode has been found through an idmapped mount the user namespace of
  * the vfsmount must be passed through @mnt_userns. This function will then
@@ -58,21 +58,19 @@ static bool chown_ok(struct user_namespace *mnt_userns,
  * performed on the raw inode simply passs init_user_ns.
  */
 static bool chgrp_ok(struct user_namespace *mnt_userns,
-                    const struct inode *inode, kgid_t gid)
+                    const struct inode *inode, vfsgid_t ia_vfsgid)
 {
-       kgid_t kgid = i_gid_into_mnt(mnt_userns, inode);
-       if (uid_eq(current_fsuid(), i_uid_into_mnt(mnt_userns, inode))) {
-               kgid_t mapped_gid;
-
-               if (gid_eq(gid, inode->i_gid))
+       vfsgid_t vfsgid = i_gid_into_vfsgid(mnt_userns, inode);
+       vfsuid_t vfsuid = i_uid_into_vfsuid(mnt_userns, inode);
+       if (vfsuid_eq_kuid(vfsuid, current_fsuid())) {
+               if (vfsgid_eq(ia_vfsgid, vfsgid))
                        return true;
-               mapped_gid = mapped_kgid_fs(mnt_userns, i_user_ns(inode), gid);
-               if (in_group_p(mapped_gid))
+               if (vfsgid_in_group_p(ia_vfsgid))
                        return true;
        }
        if (capable_wrt_inode_uidgid(mnt_userns, inode, CAP_CHOWN))
                return true;
-       if (gid_eq(kgid, INVALID_GID) &&
+       if (!vfsgid_valid(vfsgid) &&
            ns_capable(inode->i_sb->s_user_ns, CAP_CHOWN))
                return true;
        return false;
@@ -120,28 +118,29 @@ int setattr_prepare(struct user_namespace *mnt_userns, struct dentry *dentry,
                goto kill_priv;
 
        /* Make sure a caller can chown. */
-       if ((ia_valid & ATTR_UID) && !chown_ok(mnt_userns, inode, attr->ia_uid))
+       if ((ia_valid & ATTR_UID) &&
+           !chown_ok(mnt_userns, inode, attr->ia_vfsuid))
                return -EPERM;
 
        /* Make sure caller can chgrp. */
-       if ((ia_valid & ATTR_GID) && !chgrp_ok(mnt_userns, inode, attr->ia_gid))
+       if ((ia_valid & ATTR_GID) &&
+           !chgrp_ok(mnt_userns, inode, attr->ia_vfsgid))
                return -EPERM;
 
        /* Make sure a caller can chmod. */
        if (ia_valid & ATTR_MODE) {
-               kgid_t mapped_gid;
+               vfsgid_t vfsgid;
 
                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);
+                       vfsgid = attr->ia_vfsgid;
                else
-                       mapped_gid = i_gid_into_mnt(mnt_userns, inode);
+                       vfsgid = i_gid_into_vfsgid(mnt_userns, inode);
 
                /* Also check the setgid bit! */
-               if (!in_group_p(mapped_gid) &&
+               if (!vfsgid_in_group_p(vfsgid) &&
                    !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
                        attr->ia_mode &= ~S_ISGID;
        }
@@ -219,9 +218,7 @@ EXPORT_SYMBOL(inode_newsize_ok);
  * setattr_copy must be called with i_mutex held.
  *
  * setattr_copy updates the inode's metadata with that specified
- * in attr on idmapped mounts. If file ownership is changed setattr_copy
- * doesn't map ia_uid and ia_gid. It will asssume the caller has already
- * provided the intended values. Necessary permission checks to determine
+ * in attr on idmapped mounts. Necessary permission checks to determine
  * whether or not the S_ISGID property needs to be removed are performed with
  * the correct idmapped mount permission helpers.
  * Noticeably missing is inode size update, which is more complex
@@ -242,10 +239,8 @@ void setattr_copy(struct user_namespace *mnt_userns, struct inode *inode,
 {
        unsigned int ia_valid = attr->ia_valid;
 
-       if (ia_valid & ATTR_UID)
-               inode->i_uid = attr->ia_uid;
-       if (ia_valid & ATTR_GID)
-               inode->i_gid = attr->ia_gid;
+       i_uid_update(mnt_userns, attr, inode);
+       i_gid_update(mnt_userns, attr, inode);
        if (ia_valid & ATTR_ATIME)
                inode->i_atime = attr->ia_atime;
        if (ia_valid & ATTR_MTIME)
@@ -254,8 +249,8 @@ void setattr_copy(struct user_namespace *mnt_userns, struct inode *inode,
                inode->i_ctime = attr->ia_ctime;
        if (ia_valid & ATTR_MODE) {
                umode_t mode = attr->ia_mode;
-               kgid_t kgid = i_gid_into_mnt(mnt_userns, inode);
-               if (!in_group_p(kgid) &&
+               vfsgid_t vfsgid = i_gid_into_vfsgid(mnt_userns, inode);
+               if (!vfsgid_in_group_p(vfsgid) &&
                    !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
                        mode &= ~S_ISGID;
                inode->i_mode = mode;
@@ -306,9 +301,6 @@ EXPORT_SYMBOL(may_setattr);
  * retry.  Because breaking a delegation may take a long time, the
  * caller should drop the i_mutex before doing so.
  *
- * If file ownership is changed notify_change() doesn't map ia_uid and
- * ia_gid. It will asssume the caller has already provided the intended values.
- *
  * Alternatively, a caller may pass NULL for delegated_inode.  This may
  * be appropriate for callers that expect the underlying filesystem not
  * to be NFS exported.  Also, passing NULL is fine for callers holding
@@ -397,23 +389,25 @@ int notify_change(struct user_namespace *mnt_userns, struct dentry *dentry,
         * namespace of the superblock.
         */
        if (ia_valid & ATTR_UID &&
-           !kuid_has_mapping(inode->i_sb->s_user_ns, attr->ia_uid))
+           !vfsuid_has_fsmapping(mnt_userns, inode->i_sb->s_user_ns,
+                                 attr->ia_vfsuid))
                return -EOVERFLOW;
        if (ia_valid & ATTR_GID &&
-           !kgid_has_mapping(inode->i_sb->s_user_ns, attr->ia_gid))
+           !vfsgid_has_fsmapping(mnt_userns, inode->i_sb->s_user_ns,
+                                 attr->ia_vfsgid))
                return -EOVERFLOW;
 
        /* Don't allow modifications of files with invalid uids or
         * gids unless those uids & gids are being made valid.
         */
        if (!(ia_valid & ATTR_UID) &&
-           !uid_valid(i_uid_into_mnt(mnt_userns, inode)))
+           !vfsuid_valid(i_uid_into_vfsuid(mnt_userns, inode)))
                return -EOVERFLOW;
        if (!(ia_valid & ATTR_GID) &&
-           !gid_valid(i_gid_into_mnt(mnt_userns, inode)))
+           !vfsgid_valid(i_gid_into_vfsgid(mnt_userns, inode)))
                return -EOVERFLOW;
 
-       error = security_inode_setattr(dentry, attr);
+       error = security_inode_setattr(mnt_userns, dentry, attr);
        if (error)
                return error;
        error = try_break_deleg(inode, delegated_inode);
index ee92634196a8e7809465f57a678f6390424e17e9..1105ce3c80cbddf5dc27eeae0dee77006bf29780 100644 (file)
@@ -9,6 +9,15 @@ menuconfig DLM
        A general purpose distributed lock manager for kernel or userspace
        applications.
 
+config DLM_DEPRECATED_API
+       bool "DLM deprecated API"
+       depends on DLM
+       help
+       Enables deprecated DLM timeout features that will be removed in
+        later Linux kernel releases.
+
+       If you are unsure, say N.
+
 config DLM_DEBUG
        bool "DLM debugging"
        depends on DLM
index 3545fdafc6fbbe86bcbfb7132677494eab3bb6a2..71dab733cf9a839dba588a506d15b87d43d29e4c 100644 (file)
@@ -9,7 +9,6 @@ dlm-y :=                        ast.o \
                                member.o \
                                memory.o \
                                midcomms.o \
-                               netlink.o \
                                lowcomms.o \
                                plock.o \
                                rcom.o \
@@ -18,5 +17,6 @@ dlm-y :=                      ast.o \
                                requestqueue.o \
                                user.o \
                                util.o 
+dlm-$(CONFIG_DLM_DEPRECATED_API) +=    netlink.o
 dlm-$(CONFIG_DLM_DEBUG) +=     debug_fs.o
 
index bfac462dd3e8f13c5b5b7ae06c61e9df71a62426..19ef136f9e4fc32f8a5881f621b491eb526f24c2 100644 (file)
@@ -255,13 +255,13 @@ void dlm_callback_work(struct work_struct *work)
                if (callbacks[i].flags & DLM_CB_SKIP) {
                        continue;
                } else if (callbacks[i].flags & DLM_CB_BAST) {
-                       bastfn(lkb->lkb_astparam, callbacks[i].mode);
                        trace_dlm_bast(ls, lkb, callbacks[i].mode);
+                       bastfn(lkb->lkb_astparam, callbacks[i].mode);
                } else if (callbacks[i].flags & DLM_CB_CAST) {
                        lkb->lkb_lksb->sb_status = callbacks[i].sb_status;
                        lkb->lkb_lksb->sb_flags = callbacks[i].sb_flags;
+                       trace_dlm_ast(ls, lkb);
                        castfn(lkb->lkb_astparam);
-                       trace_dlm_ast(ls, lkb, lkb->lkb_lksb);
                }
        }
 
index 42eee278375620e86c6e6ae9a5844bf73bb2238c..ac8b62106ce0e00e44a2f2b38ab6a8bd9e3fb403 100644 (file)
@@ -75,8 +75,9 @@ struct dlm_cluster {
        unsigned int cl_log_info;
        unsigned int cl_protocol;
        unsigned int cl_mark;
+#ifdef CONFIG_DLM_DEPRECATED_API
        unsigned int cl_timewarn_cs;
-       unsigned int cl_waitwarn_us;
+#endif
        unsigned int cl_new_rsb_count;
        unsigned int cl_recover_callbacks;
        char cl_cluster_name[DLM_LOCKSPACE_LEN];
@@ -102,8 +103,9 @@ enum {
        CLUSTER_ATTR_LOG_INFO,
        CLUSTER_ATTR_PROTOCOL,
        CLUSTER_ATTR_MARK,
+#ifdef CONFIG_DLM_DEPRECATED_API
        CLUSTER_ATTR_TIMEWARN_CS,
-       CLUSTER_ATTR_WAITWARN_US,
+#endif
        CLUSTER_ATTR_NEW_RSB_COUNT,
        CLUSTER_ATTR_RECOVER_CALLBACKS,
        CLUSTER_ATTR_CLUSTER_NAME,
@@ -224,8 +226,9 @@ CLUSTER_ATTR(log_debug, NULL);
 CLUSTER_ATTR(log_info, NULL);
 CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
 CLUSTER_ATTR(mark, NULL);
+#ifdef CONFIG_DLM_DEPRECATED_API
 CLUSTER_ATTR(timewarn_cs, dlm_check_zero);
-CLUSTER_ATTR(waitwarn_us, NULL);
+#endif
 CLUSTER_ATTR(new_rsb_count, NULL);
 CLUSTER_ATTR(recover_callbacks, NULL);
 
@@ -240,8 +243,9 @@ static struct configfs_attribute *cluster_attrs[] = {
        [CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info,
        [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
        [CLUSTER_ATTR_MARK] = &cluster_attr_mark,
+#ifdef CONFIG_DLM_DEPRECATED_API
        [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
-       [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us,
+#endif
        [CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
        [CLUSTER_ATTR_RECOVER_CALLBACKS] = &cluster_attr_recover_callbacks,
        [CLUSTER_ATTR_CLUSTER_NAME] = &cluster_attr_cluster_name,
@@ -432,8 +436,9 @@ static struct config_group *make_cluster(struct config_group *g,
        cl->cl_log_debug = dlm_config.ci_log_debug;
        cl->cl_log_info = dlm_config.ci_log_info;
        cl->cl_protocol = dlm_config.ci_protocol;
+#ifdef CONFIG_DLM_DEPRECATED_API
        cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
-       cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us;
+#endif
        cl->cl_new_rsb_count = dlm_config.ci_new_rsb_count;
        cl->cl_recover_callbacks = dlm_config.ci_recover_callbacks;
        memcpy(cl->cl_cluster_name, dlm_config.ci_cluster_name,
@@ -954,8 +959,9 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
 #define DEFAULT_LOG_INFO           1
 #define DEFAULT_PROTOCOL           DLM_PROTO_TCP
 #define DEFAULT_MARK               0
+#ifdef CONFIG_DLM_DEPRECATED_API
 #define DEFAULT_TIMEWARN_CS      500 /* 5 sec = 500 centiseconds */
-#define DEFAULT_WAITWARN_US       0
+#endif
 #define DEFAULT_NEW_RSB_COUNT    128
 #define DEFAULT_RECOVER_CALLBACKS  0
 #define DEFAULT_CLUSTER_NAME      ""
@@ -971,8 +977,9 @@ struct dlm_config_info dlm_config = {
        .ci_log_info = DEFAULT_LOG_INFO,
        .ci_protocol = DEFAULT_PROTOCOL,
        .ci_mark = DEFAULT_MARK,
+#ifdef CONFIG_DLM_DEPRECATED_API
        .ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
-       .ci_waitwarn_us = DEFAULT_WAITWARN_US,
+#endif
        .ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
        .ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
        .ci_cluster_name = DEFAULT_CLUSTER_NAME
index df92b0a07fc6c5300940f27f2ba30eadbda651c1..55c5f2c13ebd6d8f9c12ebe84c59347cd41767b5 100644 (file)
@@ -37,8 +37,9 @@ struct dlm_config_info {
        int ci_log_info;
        int ci_protocol;
        int ci_mark;
+#ifdef CONFIG_DLM_DEPRECATED_API
        int ci_timewarn_cs;
-       int ci_waitwarn_us;
+#endif
        int ci_new_rsb_count;
        int ci_recover_callbacks;
        char ci_cluster_name[DLM_LOCKSPACE_LEN];
index 776c3ed519f0231d8b62dab34fb41c5e886caad5..8aca8085d24e72e50bba324c94e532968e55b05a 100644 (file)
@@ -145,7 +145,9 @@ struct dlm_args {
        void                    (*bastfn) (void *astparam, int mode);
        int                     mode;
        struct dlm_lksb         *lksb;
+#ifdef CONFIG_DLM_DEPRECATED_API
        unsigned long           timeout;
+#endif
 };
 
 
@@ -203,10 +205,20 @@ struct dlm_args {
 #define DLM_IFL_OVERLAP_UNLOCK  0x00080000
 #define DLM_IFL_OVERLAP_CANCEL  0x00100000
 #define DLM_IFL_ENDOFLIFE      0x00200000
+#ifdef CONFIG_DLM_DEPRECATED_API
 #define DLM_IFL_WATCH_TIMEWARN 0x00400000
 #define DLM_IFL_TIMEOUT_CANCEL 0x00800000
+#endif
 #define DLM_IFL_DEADLOCK_CANCEL        0x01000000
 #define DLM_IFL_STUB_MS                0x02000000 /* magic number for m_flags */
+/* least significant 2 bytes are message changed, they are full transmitted
+ * but at receive side only the 2 bytes LSB will be set.
+ *
+ * Even wireshark dlm dissector does only evaluate the lower bytes and note
+ * that they may not be used on transceiver side, we assume the higher bytes
+ * are for internal use or reserved so long they are not parsed on receiver
+ * side.
+ */
 #define DLM_IFL_USER           0x00000001
 #define DLM_IFL_ORPHAN         0x00000002
 
@@ -249,10 +261,12 @@ struct dlm_lkb {
        struct list_head        lkb_rsb_lookup; /* waiting for rsb lookup */
        struct list_head        lkb_wait_reply; /* waiting for remote reply */
        struct list_head        lkb_ownqueue;   /* list of locks for a process */
-       struct list_head        lkb_time_list;
        ktime_t                 lkb_timestamp;
-       ktime_t                 lkb_wait_time;
+
+#ifdef CONFIG_DLM_DEPRECATED_API
+       struct list_head        lkb_time_list;
        unsigned long           lkb_timeout_cs;
+#endif
 
        struct mutex            lkb_cb_mutex;
        struct work_struct      lkb_cb_work;
@@ -568,8 +582,10 @@ struct dlm_ls {
        struct mutex            ls_orphans_mutex;
        struct list_head        ls_orphans;
 
+#ifdef CONFIG_DLM_DEPRECATED_API
        struct mutex            ls_timeout_mutex;
        struct list_head        ls_timeout;
+#endif
 
        spinlock_t              ls_new_rsb_spin;
        int                     ls_new_rsb_count;
@@ -606,8 +622,8 @@ struct dlm_ls {
 
        wait_queue_head_t       ls_uevent_wait; /* user part of join/leave */
        int                     ls_uevent_result;
-       struct completion       ls_members_done;
-       int                     ls_members_result;
+       struct completion       ls_recovery_done;
+       int                     ls_recovery_result;
 
        struct miscdevice       ls_device;
 
@@ -688,7 +704,9 @@ struct dlm_ls {
 #define LSFL_RCOM_READY                5
 #define LSFL_RCOM_WAIT         6
 #define LSFL_UEVENT_WAIT       7
+#ifdef CONFIG_DLM_DEPRECATED_API
 #define LSFL_TIMEWARN          8
+#endif
 #define LSFL_CB_DELAY          9
 #define LSFL_NODIR             10
 
@@ -741,9 +759,15 @@ static inline int dlm_no_directory(struct dlm_ls *ls)
        return test_bit(LSFL_NODIR, &ls->ls_flags);
 }
 
+#ifdef CONFIG_DLM_DEPRECATED_API
 int dlm_netlink_init(void);
 void dlm_netlink_exit(void);
 void dlm_timeout_warn(struct dlm_lkb *lkb);
+#else
+static inline int dlm_netlink_init(void) { return 0; }
+static inline void dlm_netlink_exit(void) { };
+static inline void dlm_timeout_warn(struct dlm_lkb *lkb) { };
+#endif
 int dlm_plock_init(void);
 void dlm_plock_exit(void);
 
index 226822f49d30976fd53cd61f1501396ae7cbaf00..dac7eb75dba95c17a26ee13153dd076e7f6e1a50 100644 (file)
@@ -296,12 +296,14 @@ static void queue_cast(struct dlm_rsb *r, struct dlm_lkb *lkb, int rv)
 
        DLM_ASSERT(lkb->lkb_lksb, dlm_print_lkb(lkb););
 
+#ifdef CONFIG_DLM_DEPRECATED_API
        /* if the operation was a cancel, then return -DLM_ECANCEL, if a
           timeout caused the cancel then return -ETIMEDOUT */
        if (rv == -DLM_ECANCEL && (lkb->lkb_flags & DLM_IFL_TIMEOUT_CANCEL)) {
                lkb->lkb_flags &= ~DLM_IFL_TIMEOUT_CANCEL;
                rv = -ETIMEDOUT;
        }
+#endif
 
        if (rv == -DLM_ECANCEL && (lkb->lkb_flags & DLM_IFL_DEADLOCK_CANCEL)) {
                lkb->lkb_flags &= ~DLM_IFL_DEADLOCK_CANCEL;
@@ -1210,7 +1212,9 @@ static int _create_lkb(struct dlm_ls *ls, struct dlm_lkb **lkb_ret,
        kref_init(&lkb->lkb_ref);
        INIT_LIST_HEAD(&lkb->lkb_ownqueue);
        INIT_LIST_HEAD(&lkb->lkb_rsb_lookup);
+#ifdef CONFIG_DLM_DEPRECATED_API
        INIT_LIST_HEAD(&lkb->lkb_time_list);
+#endif
        INIT_LIST_HEAD(&lkb->lkb_cb_list);
        mutex_init(&lkb->lkb_cb_mutex);
        INIT_WORK(&lkb->lkb_cb_work, dlm_callback_work);
@@ -1306,6 +1310,13 @@ static inline void hold_lkb(struct dlm_lkb *lkb)
        kref_get(&lkb->lkb_ref);
 }
 
+static void unhold_lkb_assert(struct kref *kref)
+{
+       struct dlm_lkb *lkb = container_of(kref, struct dlm_lkb, lkb_ref);
+
+       DLM_ASSERT(false, dlm_print_lkb(lkb););
+}
+
 /* This is called when we need to remove a reference and are certain
    it's not the last ref.  e.g. del_lkb is always called between a
    find_lkb/put_lkb and is always the inverse of a previous add_lkb.
@@ -1313,9 +1324,7 @@ static inline void hold_lkb(struct dlm_lkb *lkb)
 
 static inline void unhold_lkb(struct dlm_lkb *lkb)
 {
-       int rv;
-       rv = kref_put(&lkb->lkb_ref, kill_lkb);
-       DLM_ASSERT(!rv, dlm_print_lkb(lkb););
+       kref_put(&lkb->lkb_ref, unhold_lkb_assert);
 }
 
 static void lkb_add_ordered(struct list_head *new, struct list_head *head,
@@ -1402,75 +1411,6 @@ static int msg_reply_type(int mstype)
        return -1;
 }
 
-static int nodeid_warned(int nodeid, int num_nodes, int *warned)
-{
-       int i;
-
-       for (i = 0; i < num_nodes; i++) {
-               if (!warned[i]) {
-                       warned[i] = nodeid;
-                       return 0;
-               }
-               if (warned[i] == nodeid)
-                       return 1;
-       }
-       return 0;
-}
-
-void dlm_scan_waiters(struct dlm_ls *ls)
-{
-       struct dlm_lkb *lkb;
-       s64 us;
-       s64 debug_maxus = 0;
-       u32 debug_scanned = 0;
-       u32 debug_expired = 0;
-       int num_nodes = 0;
-       int *warned = NULL;
-
-       if (!dlm_config.ci_waitwarn_us)
-               return;
-
-       mutex_lock(&ls->ls_waiters_mutex);
-
-       list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) {
-               if (!lkb->lkb_wait_time)
-                       continue;
-
-               debug_scanned++;
-
-               us = ktime_to_us(ktime_sub(ktime_get(), lkb->lkb_wait_time));
-
-               if (us < dlm_config.ci_waitwarn_us)
-                       continue;
-
-               lkb->lkb_wait_time = 0;
-
-               debug_expired++;
-               if (us > debug_maxus)
-                       debug_maxus = us;
-
-               if (!num_nodes) {
-                       num_nodes = ls->ls_num_nodes;
-                       warned = kcalloc(num_nodes, sizeof(int), GFP_KERNEL);
-               }
-               if (!warned)
-                       continue;
-               if (nodeid_warned(lkb->lkb_wait_nodeid, num_nodes, warned))
-                       continue;
-
-               log_error(ls, "waitwarn %x %lld %d us check connection to "
-                         "node %d", lkb->lkb_id, (long long)us,
-                         dlm_config.ci_waitwarn_us, lkb->lkb_wait_nodeid);
-       }
-       mutex_unlock(&ls->ls_waiters_mutex);
-       kfree(warned);
-
-       if (debug_expired)
-               log_debug(ls, "scan_waiters %u warn %u over %d us max %lld us",
-                         debug_scanned, debug_expired,
-                         dlm_config.ci_waitwarn_us, (long long)debug_maxus);
-}
-
 /* add/remove lkb from global waiters list of lkb's waiting for
    a reply from a remote node */
 
@@ -1514,7 +1454,6 @@ static int add_to_waiters(struct dlm_lkb *lkb, int mstype, int to_nodeid)
 
        lkb->lkb_wait_count++;
        lkb->lkb_wait_type = mstype;
-       lkb->lkb_wait_time = ktime_get();
        lkb->lkb_wait_nodeid = to_nodeid; /* for debugging */
        hold_lkb(lkb);
        list_add(&lkb->lkb_wait_reply, &ls->ls_waiters);
@@ -1842,6 +1781,7 @@ void dlm_scan_rsbs(struct dlm_ls *ls)
        }
 }
 
+#ifdef CONFIG_DLM_DEPRECATED_API
 static void add_timeout(struct dlm_lkb *lkb)
 {
        struct dlm_ls *ls = lkb->lkb_resource->res_ls;
@@ -1962,17 +1902,11 @@ void dlm_adjust_timeouts(struct dlm_ls *ls)
        list_for_each_entry(lkb, &ls->ls_timeout, lkb_time_list)
                lkb->lkb_timestamp = ktime_add_us(lkb->lkb_timestamp, adj_us);
        mutex_unlock(&ls->ls_timeout_mutex);
-
-       if (!dlm_config.ci_waitwarn_us)
-               return;
-
-       mutex_lock(&ls->ls_waiters_mutex);
-       list_for_each_entry(lkb, &ls->ls_waiters, lkb_wait_reply) {
-               if (ktime_to_us(lkb->lkb_wait_time))
-                       lkb->lkb_wait_time = ktime_get();
-       }
-       mutex_unlock(&ls->ls_waiters_mutex);
 }
+#else
+static void add_timeout(struct dlm_lkb *lkb) { }
+static void del_timeout(struct dlm_lkb *lkb) { }
+#endif
 
 /* lkb is master or local copy */
 
@@ -2837,12 +2771,20 @@ static void confirm_master(struct dlm_rsb *r, int error)
        }
 }
 
+#ifdef CONFIG_DLM_DEPRECATED_API
 static int set_lock_args(int mode, struct dlm_lksb *lksb, uint32_t flags,
                         int namelen, unsigned long timeout_cs,
                         void (*ast) (void *astparam),
                         void *astparam,
                         void (*bast) (void *astparam, int mode),
                         struct dlm_args *args)
+#else
+static int set_lock_args(int mode, struct dlm_lksb *lksb, uint32_t flags,
+                        int namelen, void (*ast)(void *astparam),
+                        void *astparam,
+                        void (*bast)(void *astparam, int mode),
+                        struct dlm_args *args)
+#endif
 {
        int rv = -EINVAL;
 
@@ -2895,7 +2837,9 @@ static int set_lock_args(int mode, struct dlm_lksb *lksb, uint32_t flags,
        args->astfn = ast;
        args->astparam = astparam;
        args->bastfn = bast;
+#ifdef CONFIG_DLM_DEPRECATED_API
        args->timeout = timeout_cs;
+#endif
        args->mode = mode;
        args->lksb = lksb;
        rv = 0;
@@ -2951,7 +2895,9 @@ static int validate_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
        lkb->lkb_lksb = args->lksb;
        lkb->lkb_lvbptr = args->lksb->sb_lvbptr;
        lkb->lkb_ownpid = (int) current->pid;
+#ifdef CONFIG_DLM_DEPRECATED_API
        lkb->lkb_timeout_cs = args->timeout;
+#endif
        rv = 0;
  out:
        if (rv)
@@ -3472,10 +3418,15 @@ int dlm_lock(dlm_lockspace_t *lockspace,
        if (error)
                goto out;
 
-       trace_dlm_lock_start(ls, lkb, mode, flags);
+       trace_dlm_lock_start(ls, lkb, name, namelen, mode, flags);
 
+#ifdef CONFIG_DLM_DEPRECATED_API
        error = set_lock_args(mode, lksb, flags, namelen, 0, ast,
                              astarg, bast, &args);
+#else
+       error = set_lock_args(mode, lksb, flags, namelen, ast, astarg, bast,
+                             &args);
+#endif
        if (error)
                goto out_put;
 
@@ -3487,7 +3438,7 @@ int dlm_lock(dlm_lockspace_t *lockspace,
        if (error == -EINPROGRESS)
                error = 0;
  out_put:
-       trace_dlm_lock_end(ls, lkb, mode, flags, error);
+       trace_dlm_lock_end(ls, lkb, name, namelen, mode, flags, error);
 
        if (convert || error)
                __put_lkb(ls, lkb);
@@ -5839,9 +5790,14 @@ int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc)
        return 0;
 }
 
+#ifdef CONFIG_DLM_DEPRECATED_API
 int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
                     int mode, uint32_t flags, void *name, unsigned int namelen,
                     unsigned long timeout_cs)
+#else
+int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
+                    int mode, uint32_t flags, void *name, unsigned int namelen)
+#endif
 {
        struct dlm_lkb *lkb;
        struct dlm_args args;
@@ -5864,8 +5820,13 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
                        goto out;
                }
        }
+#ifdef CONFIG_DLM_DEPRECATED_API
        error = set_lock_args(mode, &ua->lksb, flags, namelen, timeout_cs,
                              fake_astfn, ua, fake_bastfn, &args);
+#else
+       error = set_lock_args(mode, &ua->lksb, flags, namelen, fake_astfn, ua,
+                             fake_bastfn, &args);
+#endif
        if (error) {
                kfree(ua->lksb.sb_lvbptr);
                ua->lksb.sb_lvbptr = NULL;
@@ -5904,9 +5865,14 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
        return error;
 }
 
+#ifdef CONFIG_DLM_DEPRECATED_API
 int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
                     int mode, uint32_t flags, uint32_t lkid, char *lvb_in,
                     unsigned long timeout_cs)
+#else
+int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
+                    int mode, uint32_t flags, uint32_t lkid, char *lvb_in)
+#endif
 {
        struct dlm_lkb *lkb;
        struct dlm_args args;
@@ -5941,8 +5907,13 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
        ua->bastaddr = ua_tmp->bastaddr;
        ua->user_lksb = ua_tmp->user_lksb;
 
+#ifdef CONFIG_DLM_DEPRECATED_API
        error = set_lock_args(mode, &ua->lksb, flags, 0, timeout_cs,
                              fake_astfn, ua, fake_bastfn, &args);
+#else
+       error = set_lock_args(mode, &ua->lksb, flags, 0, fake_astfn, ua,
+                             fake_bastfn, &args);
+#endif
        if (error)
                goto out_put;
 
@@ -5966,7 +5937,7 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
 
 int dlm_user_adopt_orphan(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
                     int mode, uint32_t flags, void *name, unsigned int namelen,
-                    unsigned long timeout_cs, uint32_t *lkid)
+                    uint32_t *lkid)
 {
        struct dlm_lkb *lkb = NULL, *iter;
        struct dlm_user_args *ua;
index 252a5898f9081de8786c1cf2bf17879a5da665d8..a7b6474f009dcd1b3472fa345ee8947f32d4ba95 100644 (file)
@@ -24,9 +24,15 @@ int dlm_put_lkb(struct dlm_lkb *lkb);
 void dlm_scan_rsbs(struct dlm_ls *ls);
 int dlm_lock_recovery_try(struct dlm_ls *ls);
 void dlm_unlock_recovery(struct dlm_ls *ls);
-void dlm_scan_waiters(struct dlm_ls *ls);
+
+#ifdef CONFIG_DLM_DEPRECATED_API
 void dlm_scan_timeout(struct dlm_ls *ls);
 void dlm_adjust_timeouts(struct dlm_ls *ls);
+#else
+static inline void dlm_scan_timeout(struct dlm_ls *ls) { }
+static inline void dlm_adjust_timeouts(struct dlm_ls *ls) { }
+#endif
+
 int dlm_master_lookup(struct dlm_ls *ls, int nodeid, char *name, int len,
                      unsigned int flags, int *r_nodeid, int *result);
 
@@ -41,15 +47,22 @@ void dlm_recover_waiters_pre(struct dlm_ls *ls);
 int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
 int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
 
+#ifdef CONFIG_DLM_DEPRECATED_API
 int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, int mode,
        uint32_t flags, void *name, unsigned int namelen,
        unsigned long timeout_cs);
 int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
        int mode, uint32_t flags, uint32_t lkid, char *lvb_in,
        unsigned long timeout_cs);
+#else
+int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, int mode,
+       uint32_t flags, void *name, unsigned int namelen);
+int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
+       int mode, uint32_t flags, uint32_t lkid, char *lvb_in);
+#endif
 int dlm_user_adopt_orphan(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
        int mode, uint32_t flags, void *name, unsigned int namelen,
-       unsigned long timeout_cs, uint32_t *lkid);
+       uint32_t *lkid);
 int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
        uint32_t flags, uint32_t lkid, char *lvb_in);
 int dlm_user_cancel(struct dlm_ls *ls,  struct dlm_user_args *ua_tmp,
index 19ed41a5da93cb3687a0caef270095e9b380c71d..3972f4d86c7551c6739fefa8573f956a279cb110 100644 (file)
@@ -275,7 +275,6 @@ static int dlm_scand(void *data)
                                ls->ls_scan_time = jiffies;
                                dlm_scan_rsbs(ls);
                                dlm_scan_timeout(ls);
-                               dlm_scan_waiters(ls);
                                dlm_unlock_recovery(ls);
                        } else {
                                ls->ls_scan_time += HZ;
@@ -490,13 +489,28 @@ static int new_lockspace(const char *name, const char *cluster,
                ls->ls_ops_arg = ops_arg;
        }
 
-       if (flags & DLM_LSFL_TIMEWARN)
+#ifdef CONFIG_DLM_DEPRECATED_API
+       if (flags & DLM_LSFL_TIMEWARN) {
+               pr_warn_once("===============================================================\n"
+                            "WARNING: the dlm DLM_LSFL_TIMEWARN flag is being deprecated and\n"
+                            "         will be removed in v6.2!\n"
+                            "         Inclusive DLM_LSFL_TIMEWARN define in UAPI header!\n"
+                            "===============================================================\n");
+
                set_bit(LSFL_TIMEWARN, &ls->ls_flags);
+       }
 
        /* ls_exflags are forced to match among nodes, and we don't
-          need to require all nodes to have some flags set */
+        * need to require all nodes to have some flags set
+        */
        ls->ls_exflags = (flags & ~(DLM_LSFL_TIMEWARN | DLM_LSFL_FS |
                                    DLM_LSFL_NEWEXCL));
+#else
+       /* ls_exflags are forced to match among nodes, and we don't
+        * need to require all nodes to have some flags set
+        */
+       ls->ls_exflags = (flags & ~(DLM_LSFL_FS | DLM_LSFL_NEWEXCL));
+#endif
 
        size = READ_ONCE(dlm_config.ci_rsbtbl_size);
        ls->ls_rsbtbl_size = size;
@@ -527,8 +541,10 @@ static int new_lockspace(const char *name, const char *cluster,
        mutex_init(&ls->ls_waiters_mutex);
        INIT_LIST_HEAD(&ls->ls_orphans);
        mutex_init(&ls->ls_orphans_mutex);
+#ifdef CONFIG_DLM_DEPRECATED_API
        INIT_LIST_HEAD(&ls->ls_timeout);
        mutex_init(&ls->ls_timeout_mutex);
+#endif
 
        INIT_LIST_HEAD(&ls->ls_new_rsb);
        spin_lock_init(&ls->ls_new_rsb_spin);
@@ -548,8 +564,8 @@ static int new_lockspace(const char *name, const char *cluster,
 
        init_waitqueue_head(&ls->ls_uevent_wait);
        ls->ls_uevent_result = 0;
-       init_completion(&ls->ls_members_done);
-       ls->ls_members_result = -1;
+       init_completion(&ls->ls_recovery_done);
+       ls->ls_recovery_result = -1;
 
        mutex_init(&ls->ls_cb_mutex);
        INIT_LIST_HEAD(&ls->ls_cb_delay);
@@ -645,8 +661,9 @@ static int new_lockspace(const char *name, const char *cluster,
        if (error)
                goto out_recoverd;
 
-       wait_for_completion(&ls->ls_members_done);
-       error = ls->ls_members_result;
+       /* wait until recovery is successful or failed */
+       wait_for_completion(&ls->ls_recovery_done);
+       error = ls->ls_recovery_result;
        if (error)
                goto out_members;
 
index 19e82f08c0e0ca6694b9ffb4a85a73abac5d8587..a4e84e8d94c873c95a2f6281e20c7cc87c613e8f 100644 (file)
@@ -529,7 +529,7 @@ static void lowcomms_write_space(struct sock *sk)
                return;
 
        if (!test_and_set_bit(CF_CONNECTED, &con->flags)) {
-               log_print("successful connected to node %d", con->nodeid);
+               log_print("connected to node %d", con->nodeid);
                queue_work(send_workqueue, &con->swork);
                return;
        }
@@ -1931,7 +1931,7 @@ static int dlm_sctp_connect(struct connection *con, struct socket *sock,
                return ret;
 
        if (!test_and_set_bit(CF_CONNECTED, &con->flags))
-               log_print("successful connected to node %d", con->nodeid);
+               log_print("connected to node %d", con->nodeid);
 
        return 0;
 }
index 98084e0cfccf27ad331ecdb616ac5377d0b2ea4b..2af2ccfe43a9d33b9ba1961a6bbd321a7d068b94 100644 (file)
@@ -534,7 +534,11 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
        int i, error, neg = 0, low = -1;
 
        /* previously removed members that we've not finished removing need to
-          count as a negative change so the "neg" recovery steps will happen */
+        * count as a negative change so the "neg" recovery steps will happen
+        *
+        * This functionality must report all member changes to lsops or
+        * midcomms layer and must never return before.
+        */
 
        list_for_each_entry(memb, &ls->ls_nodes_gone, list) {
                log_rinfo(ls, "prev removed member %d", memb->nodeid);
@@ -583,19 +587,6 @@ int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv, int *neg_out)
        *neg_out = neg;
 
        error = ping_members(ls);
-       /* error -EINTR means that a new recovery action is triggered.
-        * We ignore this recovery action and let run the new one which might
-        * have new member configuration.
-        */
-       if (error == -EINTR)
-               error = 0;
-
-       /* new_lockspace() may be waiting to know if the config
-        * is good or bad
-        */
-       ls->ls_members_result = error;
-       complete(&ls->ls_members_done);
-
        log_rinfo(ls, "dlm_recover_members %d nodes", ls->ls_num_nodes);
        return error;
 }
@@ -675,7 +666,16 @@ int dlm_ls_stop(struct dlm_ls *ls)
        if (!ls->ls_recover_begin)
                ls->ls_recover_begin = jiffies;
 
-       dlm_lsop_recover_prep(ls);
+       /* call recover_prep ops only once and not multiple times
+        * for each possible dlm_ls_stop() when recovery is already
+        * stopped.
+        *
+        * If we successful was able to clear LSFL_RUNNING bit and
+        * it was set we know it is the first dlm_ls_stop() call.
+        */
+       if (new)
+               dlm_lsop_recover_prep(ls);
+
        return 0;
 }
 
index 0993eebf206053bd269d1d0d792f023ffa0a1647..737f185aad8dd1c8b82271c3819a7de319194cc3 100644 (file)
@@ -29,6 +29,8 @@ struct plock_async_data {
 struct plock_op {
        struct list_head list;
        int done;
+       /* if lock op got interrupted while waiting dlm_controld reply */
+       bool sigint;
        struct dlm_plock_info info;
        /* if set indicates async handling */
        struct plock_async_data *data;
@@ -79,8 +81,7 @@ static void send_op(struct plock_op *op)
    abandoned waiter.  So, we have to insert the unlock-close when the
    lock call is interrupted. */
 
-static void do_unlock_close(struct dlm_ls *ls, u64 number,
-                           struct file *file, struct file_lock *fl)
+static void do_unlock_close(const struct dlm_plock_info *info)
 {
        struct plock_op *op;
 
@@ -89,15 +90,12 @@ static void do_unlock_close(struct dlm_ls *ls, u64 number,
                return;
 
        op->info.optype         = DLM_PLOCK_OP_UNLOCK;
-       op->info.pid            = fl->fl_pid;
-       op->info.fsid           = ls->ls_global_id;
-       op->info.number         = number;
+       op->info.pid            = info->pid;
+       op->info.fsid           = info->fsid;
+       op->info.number         = info->number;
        op->info.start          = 0;
        op->info.end            = OFFSET_MAX;
-       if (fl->fl_lmops && fl->fl_lmops->lm_grant)
-               op->info.owner  = (__u64) fl->fl_pid;
-       else
-               op->info.owner  = (__u64)(long) fl->fl_owner;
+       op->info.owner          = info->owner;
 
        op->info.flags |= DLM_PLOCK_FL_CLOSE;
        send_op(op);
@@ -161,16 +159,24 @@ int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
        rv = wait_event_interruptible(recv_wq, (op->done != 0));
        if (rv == -ERESTARTSYS) {
                spin_lock(&ops_lock);
-               list_del(&op->list);
+               /* recheck under ops_lock if we got a done != 0,
+                * if so this interrupt case should be ignored
+                */
+               if (op->done != 0) {
+                       spin_unlock(&ops_lock);
+                       goto do_lock_wait;
+               }
+
+               op->sigint = true;
                spin_unlock(&ops_lock);
-               log_print("%s: wait interrupted %x %llx, op removed",
+               log_debug(ls, "%s: wait interrupted %x %llx pid %d",
                          __func__, ls->ls_global_id,
-                         (unsigned long long)number);
-               dlm_release_plock_op(op);
-               do_unlock_close(ls, number, file, fl);
+                         (unsigned long long)number, op->info.pid);
                goto out;
        }
 
+do_lock_wait:
+
        WARN_ON(!list_empty(&op->list));
 
        rv = op->info.rv;
@@ -378,7 +384,7 @@ static ssize_t dev_read(struct file *file, char __user *u, size_t count,
 
        spin_lock(&ops_lock);
        if (!list_empty(&send_list)) {
-               op = list_entry(send_list.next, struct plock_op, list);
+               op = list_first_entry(&send_list, struct plock_op, list);
                if (op->info.flags & DLM_PLOCK_FL_CLOSE)
                        list_del(&op->list);
                else
@@ -425,6 +431,19 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
                if (iter->info.fsid == info.fsid &&
                    iter->info.number == info.number &&
                    iter->info.owner == info.owner) {
+                       if (iter->sigint) {
+                               list_del(&iter->list);
+                               spin_unlock(&ops_lock);
+
+                               pr_debug("%s: sigint cleanup %x %llx pid %d",
+                                         __func__, iter->info.fsid,
+                                         (unsigned long long)iter->info.number,
+                                         iter->info.pid);
+                               do_unlock_close(&iter->info);
+                               memcpy(&iter->info, &info, sizeof(info));
+                               dlm_release_plock_op(iter);
+                               return count;
+                       }
                        list_del_init(&iter->list);
                        memcpy(&iter->info, &info, sizeof(info));
                        if (iter->data)
@@ -443,7 +462,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
                else
                        wake_up(&recv_wq);
        } else
-               log_print("%s: no op %x %llx - may got interrupted?", __func__,
+               log_print("%s: no op %x %llx", __func__,
                          info.fsid, (unsigned long long)info.number);
        return count;
 }
index a55dfce705dd264b78d0dc8df352517c993f4a14..e15eb511b04b0a2a99f59cfb35c462880a620e5d 100644 (file)
@@ -70,6 +70,10 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
 
        /*
         * Add or remove nodes from the lockspace's ls_nodes list.
+        *
+        * Due to the fact that we must report all membership changes to lsops
+        * or midcomms layer, it is not permitted to abort ls_recover() until
+        * this is done.
         */
 
        error = dlm_recover_members(ls, rv, &neg);
@@ -239,14 +243,12 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
                  jiffies_to_msecs(jiffies - start));
        mutex_unlock(&ls->ls_recoverd_active);
 
-       dlm_lsop_recover_done(ls);
        return 0;
 
  fail:
        dlm_release_root_list(ls);
-       log_rinfo(ls, "dlm_recover %llu error %d",
-                 (unsigned long long)rv->seq, error);
        mutex_unlock(&ls->ls_recoverd_active);
+
        return error;
 }
 
@@ -257,6 +259,7 @@ static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv)
 static void do_ls_recovery(struct dlm_ls *ls)
 {
        struct dlm_recover *rv = NULL;
+       int error;
 
        spin_lock(&ls->ls_recover_lock);
        rv = ls->ls_recover_args;
@@ -266,7 +269,31 @@ static void do_ls_recovery(struct dlm_ls *ls)
        spin_unlock(&ls->ls_recover_lock);
 
        if (rv) {
-               ls_recover(ls, rv);
+               error = ls_recover(ls, rv);
+               switch (error) {
+               case 0:
+                       ls->ls_recovery_result = 0;
+                       complete(&ls->ls_recovery_done);
+
+                       dlm_lsop_recover_done(ls);
+                       break;
+               case -EINTR:
+                       /* if recovery was interrupted -EINTR we wait for the next
+                        * ls_recover() iteration until it hopefully succeeds.
+                        */
+                       log_rinfo(ls, "%s %llu interrupted and should be queued to run again",
+                                 __func__, (unsigned long long)rv->seq);
+                       break;
+               default:
+                       log_rinfo(ls, "%s %llu error %d", __func__,
+                                 (unsigned long long)rv->seq, error);
+
+                       /* let new_lockspace() get aware of critical error */
+                       ls->ls_recovery_result = error;
+                       complete(&ls->ls_recovery_done);
+                       break;
+               }
+
                kfree(rv->nodes);
                kfree(rv);
        }
index 1060b24f18d4df53151a4496a999edc1e71fdb3a..99e8f0744513c0272628ff2cba615b0689469c88 100644 (file)
@@ -250,6 +250,14 @@ static int device_user_lock(struct dlm_user_proc *proc,
                goto out;
        }
 
+#ifdef CONFIG_DLM_DEPRECATED_API
+       if (params->timeout)
+               pr_warn_once("========================================================\n"
+                            "WARNING: the lkb timeout feature is being deprecated and\n"
+                            "         will be removed in v6.2!\n"
+                            "========================================================\n");
+#endif
+
        ua = kzalloc(sizeof(struct dlm_user_args), GFP_NOFS);
        if (!ua)
                goto out;
@@ -262,23 +270,34 @@ static int device_user_lock(struct dlm_user_proc *proc,
        ua->xid = params->xid;
 
        if (params->flags & DLM_LKF_CONVERT) {
+#ifdef CONFIG_DLM_DEPRECATED_API
                error = dlm_user_convert(ls, ua,
                                         params->mode, params->flags,
                                         params->lkid, params->lvb,
                                         (unsigned long) params->timeout);
+#else
+               error = dlm_user_convert(ls, ua,
+                                        params->mode, params->flags,
+                                        params->lkid, params->lvb);
+#endif
        } else if (params->flags & DLM_LKF_ORPHAN) {
                error = dlm_user_adopt_orphan(ls, ua,
                                         params->mode, params->flags,
                                         params->name, params->namelen,
-                                        (unsigned long) params->timeout,
                                         &lkid);
                if (!error)
                        error = lkid;
        } else {
+#ifdef CONFIG_DLM_DEPRECATED_API
                error = dlm_user_request(ls, ua,
                                         params->mode, params->flags,
                                         params->name, params->namelen,
                                         (unsigned long) params->timeout);
+#else
+               error = dlm_user_request(ls, ua,
+                                        params->mode, params->flags,
+                                        params->name, params->namelen);
+#endif
                if (!error)
                        error = ua->lksb.sb_lkid;
        }
index 19e6c56a9f47184e0995baebbe4004a077fb10f8..26fa170090b8fb8c04c4463bbee4242c0e3d3c88 100644 (file)
@@ -17,7 +17,7 @@ struct z_erofs_decompress_req {
 
        /* indicate the algorithm will be used for decompression */
        unsigned int alg;
-       bool inplace_io, partial_decoding;
+       bool inplace_io, partial_decoding, fillgaps;
 };
 
 struct z_erofs_decompressor {
index fbb037ba326e5f807e9c0d6ed739ab32f3629c1c..fe8ac0e163f7ebf85e81c3b275e45b333b0efb17 100644 (file)
@@ -366,42 +366,33 @@ static sector_t erofs_bmap(struct address_space *mapping, sector_t block)
        return iomap_bmap(mapping, block, &erofs_iomap_ops);
 }
 
-static int erofs_prepare_dio(struct kiocb *iocb, struct iov_iter *to)
+static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 {
        struct inode *inode = file_inode(iocb->ki_filp);
-       loff_t align = iocb->ki_pos | iov_iter_count(to) |
-               iov_iter_alignment(to);
-       struct block_device *bdev = inode->i_sb->s_bdev;
-       unsigned int blksize_mask;
-
-       if (bdev)
-               blksize_mask = (1 << ilog2(bdev_logical_block_size(bdev))) - 1;
-       else
-               blksize_mask = (1 << inode->i_blkbits) - 1;
 
-       if (align & blksize_mask)
-               return -EINVAL;
-       return 0;
-}
-
-static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
-{
        /* no need taking (shared) inode lock since it's a ro filesystem */
        if (!iov_iter_count(to))
                return 0;
 
 #ifdef CONFIG_FS_DAX
-       if (IS_DAX(iocb->ki_filp->f_mapping->host))
+       if (IS_DAX(inode))
                return dax_iomap_rw(iocb, to, &erofs_iomap_ops);
 #endif
        if (iocb->ki_flags & IOCB_DIRECT) {
-               int err = erofs_prepare_dio(iocb, to);
+               struct block_device *bdev = inode->i_sb->s_bdev;
+               unsigned int blksize_mask;
+
+               if (bdev)
+                       blksize_mask = bdev_logical_block_size(bdev) - 1;
+               else
+                       blksize_mask = (1 << inode->i_blkbits) - 1;
+
+               if ((iocb->ki_pos | iov_iter_count(to) |
+                    iov_iter_alignment(to)) & blksize_mask)
+                       return -EINVAL;
 
-               if (!err)
-                       return iomap_dio_rw(iocb, to, &erofs_iomap_ops,
-                                           NULL, 0, NULL, 0);
-               if (err < 0)
-                       return err;
+               return iomap_dio_rw(iocb, to, &erofs_iomap_ops,
+                                   NULL, 0, NULL, 0);
        }
        return filemap_read(iocb, to, 0);
 }
index 6dca1900c7331de8b7c5e072a4097a57a56e1a0a..2d55569f96ace320b29edd1a7721c4e4ca94d7e4 100644 (file)
@@ -83,7 +83,7 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx,
                        j = 0;
 
                /* 'valid' bounced can only be tested after a complete round */
-               if (test_bit(j, bounced)) {
+               if (!rq->fillgaps && test_bit(j, bounced)) {
                        DBG_BUGON(i < lz4_max_distance_pages);
                        DBG_BUGON(top >= lz4_max_distance_pages);
                        availables[top++] = rq->out[i - lz4_max_distance_pages];
@@ -91,14 +91,18 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx,
 
                if (page) {
                        __clear_bit(j, bounced);
-                       if (kaddr) {
-                               if (kaddr + PAGE_SIZE == page_address(page))
+                       if (!PageHighMem(page)) {
+                               if (!i) {
+                                       kaddr = page_address(page);
+                                       continue;
+                               }
+                               if (kaddr &&
+                                   kaddr + PAGE_SIZE == page_address(page)) {
                                        kaddr += PAGE_SIZE;
-                               else
-                                       kaddr = NULL;
-                       } else if (!i) {
-                               kaddr = page_address(page);
+                                       continue;
+                               }
                        }
+                       kaddr = NULL;
                        continue;
                }
                kaddr = NULL;
index 05a3063cf2bc10081f56379a6eb0e2c186c79d80..5e59b3f523eb62f85e1061f51dfb1d000557b2ca 100644 (file)
@@ -143,6 +143,7 @@ again:
        DBG_BUGON(z_erofs_lzma_head);
        z_erofs_lzma_head = head;
        spin_unlock(&z_erofs_lzma_lock);
+       wake_up_all(&z_erofs_lzma_wq);
 
        z_erofs_lzma_max_dictsize = dict_size;
        mutex_unlock(&lzma_resize_mutex);
index 18e59821c5974179ebb6a8389531a89fdecc1ec4..ecf28f66b97d55d435b8687a8f53ef9dc33d203e 100644 (file)
@@ -22,10 +22,9 @@ static void debug_one_dentry(unsigned char d_type, const char *de_name,
 }
 
 static int erofs_fill_dentries(struct inode *dir, struct dir_context *ctx,
-                              void *dentry_blk, unsigned int *ofs,
+                              void *dentry_blk, struct erofs_dirent *de,
                               unsigned int nameoff, unsigned int maxsize)
 {
-       struct erofs_dirent *de = dentry_blk + *ofs;
        const struct erofs_dirent *end = dentry_blk + nameoff;
 
        while (de < end) {
@@ -59,9 +58,8 @@ static int erofs_fill_dentries(struct inode *dir, struct dir_context *ctx,
                        /* stopped by some reason */
                        return 1;
                ++de;
-               *ofs += sizeof(struct erofs_dirent);
+               ctx->pos += sizeof(struct erofs_dirent);
        }
-       *ofs = maxsize;
        return 0;
 }
 
@@ -90,33 +88,33 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
 
                nameoff = le16_to_cpu(de->nameoff);
                if (nameoff < sizeof(struct erofs_dirent) ||
-                   nameoff >= PAGE_SIZE) {
+                   nameoff >= EROFS_BLKSIZ) {
                        erofs_err(dir->i_sb,
                                  "invalid de[0].nameoff %u @ nid %llu",
                                  nameoff, EROFS_I(dir)->nid);
                        err = -EFSCORRUPTED;
-                       goto skip_this;
+                       break;
                }
 
                maxsize = min_t(unsigned int,
-                               dirsize - ctx->pos + ofs, PAGE_SIZE);
+                               dirsize - ctx->pos + ofs, EROFS_BLKSIZ);
 
                /* search dirents at the arbitrary position */
                if (initial) {
                        initial = false;
 
                        ofs = roundup(ofs, sizeof(struct erofs_dirent));
+                       ctx->pos = blknr_to_addr(i) + ofs;
                        if (ofs >= nameoff)
                                goto skip_this;
                }
 
-               err = erofs_fill_dentries(dir, ctx, de, &ofs,
+               err = erofs_fill_dentries(dir, ctx, de, (void *)de + ofs,
                                          nameoff, maxsize);
-skip_this:
-               ctx->pos = blknr_to_addr(i) + ofs;
-
                if (err)
                        break;
+skip_this:
+               ctx->pos = blknr_to_addr(i) + maxsize;
                ++i;
                ofs = 0;
        }
index 724bb57075f61e3f7a7524dee80a4e8a61f083e2..5792ca9e0d5efaf59a4b9abb65a1e1dd1c503078 100644 (file)
@@ -2,6 +2,7 @@
 /*
  * Copyright (C) 2018 HUAWEI, Inc.
  *             https://www.huawei.com/
+ * Copyright (C) 2022 Alibaba Cloud
  */
 #include "zdata.h"
 #include "compress.h"
@@ -26,6 +27,82 @@ static struct z_erofs_pcluster_slab pcluster_pool[] __read_mostly = {
        _PCLP(Z_EROFS_PCLUSTER_MAX_PAGES)
 };
 
+struct z_erofs_bvec_iter {
+       struct page *bvpage;
+       struct z_erofs_bvset *bvset;
+       unsigned int nr, cur;
+};
+
+static struct page *z_erofs_bvec_iter_end(struct z_erofs_bvec_iter *iter)
+{
+       if (iter->bvpage)
+               kunmap_local(iter->bvset);
+       return iter->bvpage;
+}
+
+static struct page *z_erofs_bvset_flip(struct z_erofs_bvec_iter *iter)
+{
+       unsigned long base = (unsigned long)((struct z_erofs_bvset *)0)->bvec;
+       /* have to access nextpage in advance, otherwise it will be unmapped */
+       struct page *nextpage = iter->bvset->nextpage;
+       struct page *oldpage;
+
+       DBG_BUGON(!nextpage);
+       oldpage = z_erofs_bvec_iter_end(iter);
+       iter->bvpage = nextpage;
+       iter->bvset = kmap_local_page(nextpage);
+       iter->nr = (PAGE_SIZE - base) / sizeof(struct z_erofs_bvec);
+       iter->cur = 0;
+       return oldpage;
+}
+
+static void z_erofs_bvec_iter_begin(struct z_erofs_bvec_iter *iter,
+                                   struct z_erofs_bvset_inline *bvset,
+                                   unsigned int bootstrap_nr,
+                                   unsigned int cur)
+{
+       *iter = (struct z_erofs_bvec_iter) {
+               .nr = bootstrap_nr,
+               .bvset = (struct z_erofs_bvset *)bvset,
+       };
+
+       while (cur > iter->nr) {
+               cur -= iter->nr;
+               z_erofs_bvset_flip(iter);
+       }
+       iter->cur = cur;
+}
+
+static int z_erofs_bvec_enqueue(struct z_erofs_bvec_iter *iter,
+                               struct z_erofs_bvec *bvec,
+                               struct page **candidate_bvpage)
+{
+       if (iter->cur == iter->nr) {
+               if (!*candidate_bvpage)
+                       return -EAGAIN;
+
+               DBG_BUGON(iter->bvset->nextpage);
+               iter->bvset->nextpage = *candidate_bvpage;
+               z_erofs_bvset_flip(iter);
+
+               iter->bvset->nextpage = NULL;
+               *candidate_bvpage = NULL;
+       }
+       iter->bvset->bvec[iter->cur++] = *bvec;
+       return 0;
+}
+
+static void z_erofs_bvec_dequeue(struct z_erofs_bvec_iter *iter,
+                                struct z_erofs_bvec *bvec,
+                                struct page **old_bvpage)
+{
+       if (iter->cur == iter->nr)
+               *old_bvpage = z_erofs_bvset_flip(iter);
+       else
+               *old_bvpage = NULL;
+       *bvec = iter->bvset->bvec[iter->cur++];
+}
+
 static void z_erofs_destroy_pcluster_pool(void)
 {
        int i;
@@ -46,7 +123,7 @@ static int z_erofs_create_pcluster_pool(void)
 
        for (pcs = pcluster_pool;
             pcs < pcluster_pool + ARRAY_SIZE(pcluster_pool); ++pcs) {
-               size = struct_size(a, compressed_pages, pcs->maxpages);
+               size = struct_size(a, compressed_bvecs, pcs->maxpages);
 
                sprintf(pcs->name, "erofs_pcluster-%u", pcs->maxpages);
                pcs->slab = kmem_cache_create(pcs->name, size, 0,
@@ -150,30 +227,29 @@ int __init z_erofs_init_zip_subsystem(void)
        return err;
 }
 
-enum z_erofs_collectmode {
-       COLLECT_SECONDARY,
-       COLLECT_PRIMARY,
+enum z_erofs_pclustermode {
+       Z_EROFS_PCLUSTER_INFLIGHT,
        /*
-        * The current collection was the tail of an exist chain, in addition
-        * that the previous processed chained collections are all decided to
+        * The current pclusters was the tail of an exist chain, in addition
+        * that the previous processed chained pclusters are all decided to
         * be hooked up to it.
-        * A new chain will be created for the remaining collections which are
-        * not processed yet, therefore different from COLLECT_PRIMARY_FOLLOWED,
-        * the next collection cannot reuse the whole page safely in
-        * the following scenario:
+        * A new chain will be created for the remaining pclusters which are
+        * not processed yet, so different from Z_EROFS_PCLUSTER_FOLLOWED,
+        * the next pcluster cannot reuse the whole page safely for inplace I/O
+        * in the following scenario:
         *  ________________________________________________________________
         * |      tail (partial) page     |       head (partial) page       |
-        * |   (belongs to the next cl)   |   (belongs to the current cl)   |
-        * |_______PRIMARY_FOLLOWED_______|________PRIMARY_HOOKED___________|
+        * |   (belongs to the next pcl)  |   (belongs to the current pcl)  |
+        * |_______PCLUSTER_FOLLOWED______|________PCLUSTER_HOOKED__________|
         */
-       COLLECT_PRIMARY_HOOKED,
+       Z_EROFS_PCLUSTER_HOOKED,
        /*
-        * a weak form of COLLECT_PRIMARY_FOLLOWED, the difference is that it
+        * a weak form of Z_EROFS_PCLUSTER_FOLLOWED, the difference is that it
         * could be dispatched into bypass queue later due to uptodated managed
         * pages. All related online pages cannot be reused for inplace I/O (or
-        * pagevec) since it can be directly decoded without I/O submission.
+        * bvpage) since it can be directly decoded without I/O submission.
         */
-       COLLECT_PRIMARY_FOLLOWED_NOINPLACE,
+       Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE,
        /*
         * The current collection has been linked with the owned chain, and
         * could also be linked with the remaining collections, which means
@@ -184,39 +260,36 @@ enum z_erofs_collectmode {
         *  ________________________________________________________________
         * |  tail (partial) page |          head (partial) page           |
         * |  (of the current cl) |      (of the previous collection)      |
-        * |  PRIMARY_FOLLOWED or |                                        |
-        * |_____PRIMARY_HOOKED___|____________PRIMARY_FOLLOWED____________|
+        * | PCLUSTER_FOLLOWED or |                                        |
+        * |_____PCLUSTER_HOOKED__|___________PCLUSTER_FOLLOWED____________|
         *
         * [  (*) the above page can be used as inplace I/O.               ]
         */
-       COLLECT_PRIMARY_FOLLOWED,
+       Z_EROFS_PCLUSTER_FOLLOWED,
 };
 
 struct z_erofs_decompress_frontend {
        struct inode *const inode;
        struct erofs_map_blocks map;
+       struct z_erofs_bvec_iter biter;
 
-       struct z_erofs_pagevec_ctor vector;
-
+       struct page *candidate_bvpage;
        struct z_erofs_pcluster *pcl, *tailpcl;
-       /* a pointer used to pick up inplace I/O pages */
-       struct page **icpage_ptr;
        z_erofs_next_pcluster_t owned_head;
-
-       enum z_erofs_collectmode mode;
+       enum z_erofs_pclustermode mode;
 
        bool readahead;
        /* used for applying cache strategy on the fly */
        bool backmost;
        erofs_off_t headoffset;
+
+       /* a pointer used to pick up inplace I/O pages */
+       unsigned int icur;
 };
 
 #define DECOMPRESS_FRONTEND_INIT(__i) { \
        .inode = __i, .owned_head = Z_EROFS_PCLUSTER_TAIL, \
-       .mode = COLLECT_PRIMARY_FOLLOWED, .backmost = true }
-
-static struct page *z_pagemap_global[Z_EROFS_VMAP_GLOBAL_PAGES];
-static DEFINE_MUTEX(z_pagemap_global_lock);
+       .mode = Z_EROFS_PCLUSTER_FOLLOWED, .backmost = true }
 
 static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe,
                               enum z_erofs_cache_alloctype type,
@@ -231,24 +304,21 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe,
         */
        gfp_t gfp = (mapping_gfp_mask(mc) & ~__GFP_DIRECT_RECLAIM) |
                        __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN;
-       struct page **pages;
-       pgoff_t index;
+       unsigned int i;
 
-       if (fe->mode < COLLECT_PRIMARY_FOLLOWED)
+       if (fe->mode < Z_EROFS_PCLUSTER_FOLLOWED)
                return;
 
-       pages = pcl->compressed_pages;
-       index = pcl->obj.index;
-       for (; index < pcl->obj.index + pcl->pclusterpages; ++index, ++pages) {
+       for (i = 0; i < pcl->pclusterpages; ++i) {
                struct page *page;
                compressed_page_t t;
                struct page *newpage = NULL;
 
                /* the compressed page was loaded before */
-               if (READ_ONCE(*pages))
+               if (READ_ONCE(pcl->compressed_bvecs[i].page))
                        continue;
 
-               page = find_get_page(mc, index);
+               page = find_get_page(mc, pcl->obj.index + i);
 
                if (page) {
                        t = tag_compressed_page_justfound(page);
@@ -269,7 +339,8 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe,
                        }
                }
 
-               if (!cmpxchg_relaxed(pages, NULL, tagptr_cast_ptr(t)))
+               if (!cmpxchg_relaxed(&pcl->compressed_bvecs[i].page, NULL,
+                                    tagptr_cast_ptr(t)))
                        continue;
 
                if (page)
@@ -283,7 +354,7 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe,
         * managed cache since it can be moved to the bypass queue instead.
         */
        if (standalone)
-               fe->mode = COLLECT_PRIMARY_FOLLOWED_NOINPLACE;
+               fe->mode = Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE;
 }
 
 /* called by erofs_shrinker to get rid of all compressed_pages */
@@ -300,7 +371,7 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
         * therefore no need to worry about available decompression users.
         */
        for (i = 0; i < pcl->pclusterpages; ++i) {
-               struct page *page = pcl->compressed_pages[i];
+               struct page *page = pcl->compressed_bvecs[i].page;
 
                if (!page)
                        continue;
@@ -313,7 +384,7 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
                        continue;
 
                /* barrier is implied in the following 'unlock_page' */
-               WRITE_ONCE(pcl->compressed_pages[i], NULL);
+               WRITE_ONCE(pcl->compressed_bvecs[i].page, NULL);
                detach_page_private(page);
                unlock_page(page);
        }
@@ -323,56 +394,59 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
 int erofs_try_to_free_cached_page(struct page *page)
 {
        struct z_erofs_pcluster *const pcl = (void *)page_private(page);
-       int ret = 0;    /* 0 - busy */
+       int ret, i;
 
-       if (erofs_workgroup_try_to_freeze(&pcl->obj, 1)) {
-               unsigned int i;
+       if (!erofs_workgroup_try_to_freeze(&pcl->obj, 1))
+               return 0;
 
-               DBG_BUGON(z_erofs_is_inline_pcluster(pcl));
-               for (i = 0; i < pcl->pclusterpages; ++i) {
-                       if (pcl->compressed_pages[i] == page) {
-                               WRITE_ONCE(pcl->compressed_pages[i], NULL);
-                               ret = 1;
-                               break;
-                       }
+       ret = 0;
+       DBG_BUGON(z_erofs_is_inline_pcluster(pcl));
+       for (i = 0; i < pcl->pclusterpages; ++i) {
+               if (pcl->compressed_bvecs[i].page == page) {
+                       WRITE_ONCE(pcl->compressed_bvecs[i].page, NULL);
+                       ret = 1;
+                       break;
                }
-               erofs_workgroup_unfreeze(&pcl->obj, 1);
-
-               if (ret)
-                       detach_page_private(page);
        }
+       erofs_workgroup_unfreeze(&pcl->obj, 1);
+       if (ret)
+               detach_page_private(page);
        return ret;
 }
 
-/* page_type must be Z_EROFS_PAGE_TYPE_EXCLUSIVE */
 static bool z_erofs_try_inplace_io(struct z_erofs_decompress_frontend *fe,
-                                  struct page *page)
+                                  struct z_erofs_bvec *bvec)
 {
        struct z_erofs_pcluster *const pcl = fe->pcl;
 
-       while (fe->icpage_ptr > pcl->compressed_pages)
-               if (!cmpxchg(--fe->icpage_ptr, NULL, page))
+       while (fe->icur > 0) {
+               if (!cmpxchg(&pcl->compressed_bvecs[--fe->icur].page,
+                            NULL, bvec->page)) {
+                       pcl->compressed_bvecs[fe->icur] = *bvec;
                        return true;
+               }
+       }
        return false;
 }
 
 /* callers must be with pcluster lock held */
 static int z_erofs_attach_page(struct z_erofs_decompress_frontend *fe,
-                              struct page *page, enum z_erofs_page_type type,
-                              bool pvec_safereuse)
+                              struct z_erofs_bvec *bvec, bool exclusive)
 {
        int ret;
 
-       /* give priority for inplaceio */
-       if (fe->mode >= COLLECT_PRIMARY &&
-           type == Z_EROFS_PAGE_TYPE_EXCLUSIVE &&
-           z_erofs_try_inplace_io(fe, page))
-               return 0;
-
-       ret = z_erofs_pagevec_enqueue(&fe->vector, page, type,
-                                     pvec_safereuse);
-       fe->pcl->vcnt += (unsigned int)ret;
-       return ret ? 0 : -EAGAIN;
+       if (exclusive) {
+               /* give priority for inplaceio to use file pages first */
+               if (z_erofs_try_inplace_io(fe, bvec))
+                       return 0;
+               /* otherwise, check if it can be used as a bvpage */
+               if (fe->mode >= Z_EROFS_PCLUSTER_FOLLOWED &&
+                   !fe->candidate_bvpage)
+                       fe->candidate_bvpage = bvec->page;
+       }
+       ret = z_erofs_bvec_enqueue(&fe->biter, bvec, &fe->candidate_bvpage);
+       fe->pcl->vcnt += (ret >= 0);
+       return ret;
 }
 
 static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f)
@@ -385,7 +459,7 @@ static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f)
                    *owned_head) == Z_EROFS_PCLUSTER_NIL) {
                *owned_head = &pcl->next;
                /* so we can attach this pcluster to our submission chain. */
-               f->mode = COLLECT_PRIMARY_FOLLOWED;
+               f->mode = Z_EROFS_PCLUSTER_FOLLOWED;
                return;
        }
 
@@ -393,66 +467,21 @@ static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f)
         * type 2, link to the end of an existing open chain, be careful
         * that its submission is controlled by the original attached chain.
         */
-       if (cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_TAIL,
+       if (*owned_head != &pcl->next && pcl != f->tailpcl &&
+           cmpxchg(&pcl->next, Z_EROFS_PCLUSTER_TAIL,
                    *owned_head) == Z_EROFS_PCLUSTER_TAIL) {
                *owned_head = Z_EROFS_PCLUSTER_TAIL;
-               f->mode = COLLECT_PRIMARY_HOOKED;
+               f->mode = Z_EROFS_PCLUSTER_HOOKED;
                f->tailpcl = NULL;
                return;
        }
        /* type 3, it belongs to a chain, but it isn't the end of the chain */
-       f->mode = COLLECT_PRIMARY;
+       f->mode = Z_EROFS_PCLUSTER_INFLIGHT;
 }
 
-static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe,
-                                  struct inode *inode,
-                                  struct erofs_map_blocks *map)
-{
-       struct z_erofs_pcluster *pcl = fe->pcl;
-       unsigned int length;
-
-       /* to avoid unexpected loop formed by corrupted images */
-       if (fe->owned_head == &pcl->next || pcl == fe->tailpcl) {
-               DBG_BUGON(1);
-               return -EFSCORRUPTED;
-       }
-
-       if (pcl->pageofs_out != (map->m_la & ~PAGE_MASK)) {
-               DBG_BUGON(1);
-               return -EFSCORRUPTED;
-       }
-
-       length = READ_ONCE(pcl->length);
-       if (length & Z_EROFS_PCLUSTER_FULL_LENGTH) {
-               if ((map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT) > length) {
-                       DBG_BUGON(1);
-                       return -EFSCORRUPTED;
-               }
-       } else {
-               unsigned int llen = map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT;
-
-               if (map->m_flags & EROFS_MAP_FULL_MAPPED)
-                       llen |= Z_EROFS_PCLUSTER_FULL_LENGTH;
-
-               while (llen > length &&
-                      length != cmpxchg_relaxed(&pcl->length, length, llen)) {
-                       cpu_relax();
-                       length = READ_ONCE(pcl->length);
-               }
-       }
-       mutex_lock(&pcl->lock);
-       /* used to check tail merging loop due to corrupted images */
-       if (fe->owned_head == Z_EROFS_PCLUSTER_TAIL)
-               fe->tailpcl = pcl;
-
-       z_erofs_try_to_claim_pcluster(fe);
-       return 0;
-}
-
-static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
-                                    struct inode *inode,
-                                    struct erofs_map_blocks *map)
+static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
 {
+       struct erofs_map_blocks *map = &fe->map;
        bool ztailpacking = map->m_flags & EROFS_MAP_META;
        struct z_erofs_pcluster *pcl;
        struct erofs_workgroup *grp;
@@ -471,14 +500,13 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
 
        atomic_set(&pcl->obj.refcount, 1);
        pcl->algorithmformat = map->m_algorithmformat;
-       pcl->length = (map->m_llen << Z_EROFS_PCLUSTER_LENGTH_BIT) |
-               (map->m_flags & EROFS_MAP_FULL_MAPPED ?
-                       Z_EROFS_PCLUSTER_FULL_LENGTH : 0);
+       pcl->length = 0;
+       pcl->partial = true;
 
        /* new pclusters should be claimed as type 1, primary and followed */
        pcl->next = fe->owned_head;
        pcl->pageofs_out = map->m_la & ~PAGE_MASK;
-       fe->mode = COLLECT_PRIMARY_FOLLOWED;
+       fe->mode = Z_EROFS_PCLUSTER_FOLLOWED;
 
        /*
         * lock all primary followed works before visible to others
@@ -494,7 +522,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
        } else {
                pcl->obj.index = map->m_pa >> PAGE_SHIFT;
 
-               grp = erofs_insert_workgroup(inode->i_sb, &pcl->obj);
+               grp = erofs_insert_workgroup(fe->inode->i_sb, &pcl->obj);
                if (IS_ERR(grp)) {
                        err = PTR_ERR(grp);
                        goto err_out;
@@ -520,11 +548,10 @@ err_out:
        return err;
 }
 
-static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe,
-                                  struct inode *inode,
-                                  struct erofs_map_blocks *map)
+static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)
 {
-       struct erofs_workgroup *grp;
+       struct erofs_map_blocks *map = &fe->map;
+       struct erofs_workgroup *grp = NULL;
        int ret;
 
        DBG_BUGON(fe->pcl);
@@ -533,38 +560,35 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe,
        DBG_BUGON(fe->owned_head == Z_EROFS_PCLUSTER_NIL);
        DBG_BUGON(fe->owned_head == Z_EROFS_PCLUSTER_TAIL_CLOSED);
 
-       if (map->m_flags & EROFS_MAP_META) {
-               if ((map->m_pa & ~PAGE_MASK) + map->m_plen > PAGE_SIZE) {
-                       DBG_BUGON(1);
-                       return -EFSCORRUPTED;
-               }
-               goto tailpacking;
+       if (!(map->m_flags & EROFS_MAP_META)) {
+               grp = erofs_find_workgroup(fe->inode->i_sb,
+                                          map->m_pa >> PAGE_SHIFT);
+       } else if ((map->m_pa & ~PAGE_MASK) + map->m_plen > PAGE_SIZE) {
+               DBG_BUGON(1);
+               return -EFSCORRUPTED;
        }
 
-       grp = erofs_find_workgroup(inode->i_sb, map->m_pa >> PAGE_SHIFT);
        if (grp) {
                fe->pcl = container_of(grp, struct z_erofs_pcluster, obj);
+               ret = -EEXIST;
        } else {
-tailpacking:
-               ret = z_erofs_register_pcluster(fe, inode, map);
-               if (!ret)
-                       goto out;
-               if (ret != -EEXIST)
-                       return ret;
+               ret = z_erofs_register_pcluster(fe);
        }
 
-       ret = z_erofs_lookup_pcluster(fe, inode, map);
-       if (ret) {
-               erofs_workgroup_put(&fe->pcl->obj);
+       if (ret == -EEXIST) {
+               mutex_lock(&fe->pcl->lock);
+               /* used to check tail merging loop due to corrupted images */
+               if (fe->owned_head == Z_EROFS_PCLUSTER_TAIL)
+                       fe->tailpcl = fe->pcl;
+
+               z_erofs_try_to_claim_pcluster(fe);
+       } else if (ret) {
                return ret;
        }
-
-out:
-       z_erofs_pagevec_ctor_init(&fe->vector, Z_EROFS_NR_INLINE_PAGEVECS,
-                                 fe->pcl->pagevec, fe->pcl->vcnt);
+       z_erofs_bvec_iter_begin(&fe->biter, &fe->pcl->bvset,
+                               Z_EROFS_INLINE_BVECS, fe->pcl->vcnt);
        /* since file-backed online pages are traversed in reverse order */
-       fe->icpage_ptr = fe->pcl->compressed_pages +
-                       z_erofs_pclusterpages(fe->pcl);
+       fe->icur = z_erofs_pclusterpages(fe->pcl);
        return 0;
 }
 
@@ -593,14 +617,19 @@ static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
        if (!pcl)
                return false;
 
-       z_erofs_pagevec_ctor_exit(&fe->vector, false);
+       z_erofs_bvec_iter_end(&fe->biter);
        mutex_unlock(&pcl->lock);
 
+       if (fe->candidate_bvpage) {
+               DBG_BUGON(z_erofs_is_shortlived_page(fe->candidate_bvpage));
+               fe->candidate_bvpage = NULL;
+       }
+
        /*
         * if all pending pages are added, don't hold its reference
         * any longer if the pcluster isn't hosted by ourselves.
         */
-       if (fe->mode < COLLECT_PRIMARY_FOLLOWED_NOINPLACE)
+       if (fe->mode < Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE)
                erofs_workgroup_put(&pcl->obj);
 
        fe->pcl = NULL;
@@ -628,11 +657,10 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
        struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
        struct erofs_map_blocks *const map = &fe->map;
        const loff_t offset = page_offset(page);
-       bool tight = true;
+       bool tight = true, exclusive;
 
        enum z_erofs_cache_alloctype cache_strategy;
-       enum z_erofs_page_type page_type;
-       unsigned int cur, end, spiltted, index;
+       unsigned int cur, end, spiltted;
        int err = 0;
 
        /* register locked file pages as online pages in pack */
@@ -653,7 +681,7 @@ repeat:
                map->m_llen = 0;
                err = z_erofs_map_blocks_iter(inode, map, 0);
                if (err)
-                       goto err_out;
+                       goto out;
        } else {
                if (fe->pcl)
                        goto hitted;
@@ -663,9 +691,9 @@ repeat:
        if (!(map->m_flags & EROFS_MAP_MAPPED))
                goto hitted;
 
-       err = z_erofs_collector_begin(fe, inode, map);
+       err = z_erofs_collector_begin(fe);
        if (err)
-               goto err_out;
+               goto out;
 
        if (z_erofs_is_inline_pcluster(fe->pcl)) {
                void *mp;
@@ -676,11 +704,12 @@ repeat:
                        err = PTR_ERR(mp);
                        erofs_err(inode->i_sb,
                                  "failed to get inline page, err %d", err);
-                       goto err_out;
+                       goto out;
                }
                get_page(fe->map.buf.page);
-               WRITE_ONCE(fe->pcl->compressed_pages[0], fe->map.buf.page);
-               fe->mode = COLLECT_PRIMARY_FOLLOWED_NOINPLACE;
+               WRITE_ONCE(fe->pcl->compressed_bvecs[0].page,
+                          fe->map.buf.page);
+               fe->mode = Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE;
        } else {
                /* bind cache first when cached decompression is preferred */
                if (should_alloc_managed_pages(fe, sbi->opt.cache_strategy,
@@ -696,10 +725,10 @@ hitted:
         * Ensure the current partial page belongs to this submit chain rather
         * than other concurrent submit chains or the noio(bypass) chain since
         * those chains are handled asynchronously thus the page cannot be used
-        * for inplace I/O or pagevec (should be processed in strict order.)
+        * for inplace I/O or bvpage (should be processed in a strict order.)
         */
-       tight &= (fe->mode >= COLLECT_PRIMARY_HOOKED &&
-                 fe->mode != COLLECT_PRIMARY_FOLLOWED_NOINPLACE);
+       tight &= (fe->mode >= Z_EROFS_PCLUSTER_HOOKED &&
+                 fe->mode != Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE);
 
        cur = end - min_t(unsigned int, offset + end - map->m_la, end);
        if (!(map->m_flags & EROFS_MAP_MAPPED)) {
@@ -707,60 +736,59 @@ hitted:
                goto next_part;
        }
 
-       /* let's derive page type */
-       page_type = cur ? Z_EROFS_VLE_PAGE_TYPE_HEAD :
-               (!spiltted ? Z_EROFS_PAGE_TYPE_EXCLUSIVE :
-                       (tight ? Z_EROFS_PAGE_TYPE_EXCLUSIVE :
-                               Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED));
-
+       exclusive = (!cur && (!spiltted || tight));
        if (cur)
-               tight &= (fe->mode >= COLLECT_PRIMARY_FOLLOWED);
+               tight &= (fe->mode >= Z_EROFS_PCLUSTER_FOLLOWED);
 
 retry:
-       err = z_erofs_attach_page(fe, page, page_type,
-                                 fe->mode >= COLLECT_PRIMARY_FOLLOWED);
-       /* should allocate an additional short-lived page for pagevec */
-       if (err == -EAGAIN) {
-               struct page *const newpage =
-                               alloc_page(GFP_NOFS | __GFP_NOFAIL);
-
-               set_page_private(newpage, Z_EROFS_SHORTLIVED_PAGE);
-               err = z_erofs_attach_page(fe, newpage,
-                                         Z_EROFS_PAGE_TYPE_EXCLUSIVE, true);
-               if (!err)
-                       goto retry;
+       err = z_erofs_attach_page(fe, &((struct z_erofs_bvec) {
+                                       .page = page,
+                                       .offset = offset - map->m_la,
+                                       .end = end,
+                                 }), exclusive);
+       /* should allocate an additional short-lived page for bvset */
+       if (err == -EAGAIN && !fe->candidate_bvpage) {
+               fe->candidate_bvpage = alloc_page(GFP_NOFS | __GFP_NOFAIL);
+               set_page_private(fe->candidate_bvpage,
+                                Z_EROFS_SHORTLIVED_PAGE);
+               goto retry;
        }
 
-       if (err)
-               goto err_out;
-
-       index = page->index - (map->m_la >> PAGE_SHIFT);
-
-       z_erofs_onlinepage_fixup(page, index, true);
+       if (err) {
+               DBG_BUGON(err == -EAGAIN && fe->candidate_bvpage);
+               goto out;
+       }
 
+       z_erofs_onlinepage_split(page);
        /* bump up the number of spiltted parts of a page */
        ++spiltted;
-       /* also update nr_pages */
-       fe->pcl->nr_pages = max_t(pgoff_t, fe->pcl->nr_pages, index + 1);
+       if (fe->pcl->pageofs_out != (map->m_la & ~PAGE_MASK))
+               fe->pcl->multibases = true;
+
+       if ((map->m_flags & EROFS_MAP_FULL_MAPPED) &&
+           fe->pcl->length == map->m_llen)
+               fe->pcl->partial = false;
+       if (fe->pcl->length < offset + end - map->m_la) {
+               fe->pcl->length = offset + end - map->m_la;
+               fe->pcl->pageofs_out = map->m_la & ~PAGE_MASK;
+       }
 next_part:
-       /* can be used for verification */
+       /* shorten the remaining extent to update progress */
        map->m_llen = offset + cur - map->m_la;
+       map->m_flags &= ~EROFS_MAP_FULL_MAPPED;
 
        end = cur;
        if (end > 0)
                goto repeat;
 
 out:
+       if (err)
+               z_erofs_page_mark_eio(page);
        z_erofs_onlinepage_endio(page);
 
        erofs_dbg("%s, finish page: %pK spiltted: %u map->m_llen %llu",
                  __func__, page, spiltted, map->m_llen);
        return err;
-
-       /* if some error occurred while processing this page */
-err_out:
-       SetPageError(page);
-       goto out;
 }
 
 static bool z_erofs_get_sync_decompress_policy(struct erofs_sb_info *sbi,
@@ -783,97 +811,137 @@ static bool z_erofs_page_is_invalidated(struct page *page)
        return !page->mapping && !z_erofs_is_shortlived_page(page);
 }
 
-static int z_erofs_decompress_pcluster(struct super_block *sb,
-                                      struct z_erofs_pcluster *pcl,
-                                      struct page **pagepool)
-{
-       struct erofs_sb_info *const sbi = EROFS_SB(sb);
-       unsigned int pclusterpages = z_erofs_pclusterpages(pcl);
-       struct z_erofs_pagevec_ctor ctor;
-       unsigned int i, inputsize, outputsize, llen, nr_pages;
-       struct page *pages_onstack[Z_EROFS_VMAP_ONSTACK_PAGES];
-       struct page **pages, **compressed_pages, *page;
+struct z_erofs_decompress_backend {
+       struct page *onstack_pages[Z_EROFS_ONSTACK_PAGES];
+       struct super_block *sb;
+       struct z_erofs_pcluster *pcl;
 
-       enum z_erofs_page_type page_type;
-       bool overlapped, partial;
-       int err;
+       /* pages with the longest decompressed length for deduplication */
+       struct page **decompressed_pages;
+       /* pages to keep the compressed data */
+       struct page **compressed_pages;
 
-       might_sleep();
-       DBG_BUGON(!READ_ONCE(pcl->nr_pages));
+       struct list_head decompressed_secondary_bvecs;
+       struct page **pagepool;
+       unsigned int onstack_used, nr_pages;
+};
 
-       mutex_lock(&pcl->lock);
-       nr_pages = pcl->nr_pages;
+struct z_erofs_bvec_item {
+       struct z_erofs_bvec bvec;
+       struct list_head list;
+};
 
-       if (nr_pages <= Z_EROFS_VMAP_ONSTACK_PAGES) {
-               pages = pages_onstack;
-       } else if (nr_pages <= Z_EROFS_VMAP_GLOBAL_PAGES &&
-                  mutex_trylock(&z_pagemap_global_lock)) {
-               pages = z_pagemap_global;
-       } else {
-               gfp_t gfp_flags = GFP_KERNEL;
+static void z_erofs_do_decompressed_bvec(struct z_erofs_decompress_backend *be,
+                                        struct z_erofs_bvec *bvec)
+{
+       struct z_erofs_bvec_item *item;
 
-               if (nr_pages > Z_EROFS_VMAP_GLOBAL_PAGES)
-                       gfp_flags |= __GFP_NOFAIL;
+       if (!((bvec->offset + be->pcl->pageofs_out) & ~PAGE_MASK)) {
+               unsigned int pgnr;
+               struct page *oldpage;
 
-               pages = kvmalloc_array(nr_pages, sizeof(struct page *),
-                                      gfp_flags);
+               pgnr = (bvec->offset + be->pcl->pageofs_out) >> PAGE_SHIFT;
+               DBG_BUGON(pgnr >= be->nr_pages);
+               oldpage = be->decompressed_pages[pgnr];
+               be->decompressed_pages[pgnr] = bvec->page;
 
-               /* fallback to global pagemap for the lowmem scenario */
-               if (!pages) {
-                       mutex_lock(&z_pagemap_global_lock);
-                       pages = z_pagemap_global;
-               }
+               if (!oldpage)
+                       return;
        }
 
-       for (i = 0; i < nr_pages; ++i)
-               pages[i] = NULL;
-
-       err = 0;
-       z_erofs_pagevec_ctor_init(&ctor, Z_EROFS_NR_INLINE_PAGEVECS,
-                                 pcl->pagevec, 0);
-
-       for (i = 0; i < pcl->vcnt; ++i) {
-               unsigned int pagenr;
+       /* (cold path) one pcluster is requested multiple times */
+       item = kmalloc(sizeof(*item), GFP_KERNEL | __GFP_NOFAIL);
+       item->bvec = *bvec;
+       list_add(&item->list, &be->decompressed_secondary_bvecs);
+}
 
-               page = z_erofs_pagevec_dequeue(&ctor, &page_type);
+static void z_erofs_fill_other_copies(struct z_erofs_decompress_backend *be,
+                                     int err)
+{
+       unsigned int off0 = be->pcl->pageofs_out;
+       struct list_head *p, *n;
+
+       list_for_each_safe(p, n, &be->decompressed_secondary_bvecs) {
+               struct z_erofs_bvec_item *bvi;
+               unsigned int end, cur;
+               void *dst, *src;
+
+               bvi = container_of(p, struct z_erofs_bvec_item, list);
+               cur = bvi->bvec.offset < 0 ? -bvi->bvec.offset : 0;
+               end = min_t(unsigned int, be->pcl->length - bvi->bvec.offset,
+                           bvi->bvec.end);
+               dst = kmap_local_page(bvi->bvec.page);
+               while (cur < end) {
+                       unsigned int pgnr, scur, len;
+
+                       pgnr = (bvi->bvec.offset + cur + off0) >> PAGE_SHIFT;
+                       DBG_BUGON(pgnr >= be->nr_pages);
+
+                       scur = bvi->bvec.offset + cur -
+                                       ((pgnr << PAGE_SHIFT) - off0);
+                       len = min_t(unsigned int, end - cur, PAGE_SIZE - scur);
+                       if (!be->decompressed_pages[pgnr]) {
+                               err = -EFSCORRUPTED;
+                               cur += len;
+                               continue;
+                       }
+                       src = kmap_local_page(be->decompressed_pages[pgnr]);
+                       memcpy(dst + cur, src + scur, len);
+                       kunmap_local(src);
+                       cur += len;
+               }
+               kunmap_local(dst);
+               if (err)
+                       z_erofs_page_mark_eio(bvi->bvec.page);
+               z_erofs_onlinepage_endio(bvi->bvec.page);
+               list_del(p);
+               kfree(bvi);
+       }
+}
 
-               /* all pages in pagevec ought to be valid */
-               DBG_BUGON(!page);
-               DBG_BUGON(z_erofs_page_is_invalidated(page));
+static void z_erofs_parse_out_bvecs(struct z_erofs_decompress_backend *be)
+{
+       struct z_erofs_pcluster *pcl = be->pcl;
+       struct z_erofs_bvec_iter biter;
+       struct page *old_bvpage;
+       int i;
 
-               if (z_erofs_put_shortlivedpage(pagepool, page))
-                       continue;
+       z_erofs_bvec_iter_begin(&biter, &pcl->bvset, Z_EROFS_INLINE_BVECS, 0);
+       for (i = 0; i < pcl->vcnt; ++i) {
+               struct z_erofs_bvec bvec;
 
-               if (page_type == Z_EROFS_VLE_PAGE_TYPE_HEAD)
-                       pagenr = 0;
-               else
-                       pagenr = z_erofs_onlinepage_index(page);
+               z_erofs_bvec_dequeue(&biter, &bvec, &old_bvpage);
 
-               DBG_BUGON(pagenr >= nr_pages);
+               if (old_bvpage)
+                       z_erofs_put_shortlivedpage(be->pagepool, old_bvpage);
 
-               /*
-                * currently EROFS doesn't support multiref(dedup),
-                * so here erroring out one multiref page.
-                */
-               if (pages[pagenr]) {
-                       DBG_BUGON(1);
-                       SetPageError(pages[pagenr]);
-                       z_erofs_onlinepage_endio(pages[pagenr]);
-                       err = -EFSCORRUPTED;
-               }
-               pages[pagenr] = page;
+               DBG_BUGON(z_erofs_page_is_invalidated(bvec.page));
+               z_erofs_do_decompressed_bvec(be, &bvec);
        }
-       z_erofs_pagevec_ctor_exit(&ctor, true);
 
-       overlapped = false;
-       compressed_pages = pcl->compressed_pages;
+       old_bvpage = z_erofs_bvec_iter_end(&biter);
+       if (old_bvpage)
+               z_erofs_put_shortlivedpage(be->pagepool, old_bvpage);
+}
 
+static int z_erofs_parse_in_bvecs(struct z_erofs_decompress_backend *be,
+                                 bool *overlapped)
+{
+       struct z_erofs_pcluster *pcl = be->pcl;
+       unsigned int pclusterpages = z_erofs_pclusterpages(pcl);
+       int i, err = 0;
+
+       *overlapped = false;
        for (i = 0; i < pclusterpages; ++i) {
-               unsigned int pagenr;
+               struct z_erofs_bvec *bvec = &pcl->compressed_bvecs[i];
+               struct page *page = bvec->page;
 
-               page = compressed_pages[i];
-               /* all compressed pages ought to be valid */
-               DBG_BUGON(!page);
+               /* compressed pages ought to be present before decompressing */
+               if (!page) {
+                       DBG_BUGON(1);
+                       continue;
+               }
+               be->compressed_pages[i] = page;
 
                if (z_erofs_is_inline_pcluster(pcl)) {
                        if (!PageUptodate(page))
@@ -883,109 +951,129 @@ static int z_erofs_decompress_pcluster(struct super_block *sb,
 
                DBG_BUGON(z_erofs_page_is_invalidated(page));
                if (!z_erofs_is_shortlived_page(page)) {
-                       if (erofs_page_is_managed(sbi, page)) {
+                       if (erofs_page_is_managed(EROFS_SB(be->sb), page)) {
                                if (!PageUptodate(page))
                                        err = -EIO;
                                continue;
                        }
+                       z_erofs_do_decompressed_bvec(be, bvec);
+                       *overlapped = true;
+               }
+       }
 
-                       /*
-                        * only if non-head page can be selected
-                        * for inplace decompression
-                        */
-                       pagenr = z_erofs_onlinepage_index(page);
-
-                       DBG_BUGON(pagenr >= nr_pages);
-                       if (pages[pagenr]) {
-                               DBG_BUGON(1);
-                               SetPageError(pages[pagenr]);
-                               z_erofs_onlinepage_endio(pages[pagenr]);
-                               err = -EFSCORRUPTED;
-                       }
-                       pages[pagenr] = page;
+       if (err)
+               return err;
+       return 0;
+}
 
-                       overlapped = true;
-               }
+static int z_erofs_decompress_pcluster(struct z_erofs_decompress_backend *be,
+                                      int err)
+{
+       struct erofs_sb_info *const sbi = EROFS_SB(be->sb);
+       struct z_erofs_pcluster *pcl = be->pcl;
+       unsigned int pclusterpages = z_erofs_pclusterpages(pcl);
+       unsigned int i, inputsize;
+       int err2;
+       struct page *page;
+       bool overlapped;
 
-               /* PG_error needs checking for all non-managed pages */
-               if (PageError(page)) {
-                       DBG_BUGON(PageUptodate(page));
-                       err = -EIO;
-               }
+       mutex_lock(&pcl->lock);
+       be->nr_pages = PAGE_ALIGN(pcl->length + pcl->pageofs_out) >> PAGE_SHIFT;
+
+       /* allocate (de)compressed page arrays if cannot be kept on stack */
+       be->decompressed_pages = NULL;
+       be->compressed_pages = NULL;
+       be->onstack_used = 0;
+       if (be->nr_pages <= Z_EROFS_ONSTACK_PAGES) {
+               be->decompressed_pages = be->onstack_pages;
+               be->onstack_used = be->nr_pages;
+               memset(be->decompressed_pages, 0,
+                      sizeof(struct page *) * be->nr_pages);
        }
 
+       if (pclusterpages + be->onstack_used <= Z_EROFS_ONSTACK_PAGES)
+               be->compressed_pages = be->onstack_pages + be->onstack_used;
+
+       if (!be->decompressed_pages)
+               be->decompressed_pages =
+                       kvcalloc(be->nr_pages, sizeof(struct page *),
+                                GFP_KERNEL | __GFP_NOFAIL);
+       if (!be->compressed_pages)
+               be->compressed_pages =
+                       kvcalloc(pclusterpages, sizeof(struct page *),
+                                GFP_KERNEL | __GFP_NOFAIL);
+
+       z_erofs_parse_out_bvecs(be);
+       err2 = z_erofs_parse_in_bvecs(be, &overlapped);
+       if (err2)
+               err = err2;
        if (err)
                goto out;
 
-       llen = pcl->length >> Z_EROFS_PCLUSTER_LENGTH_BIT;
-       if (nr_pages << PAGE_SHIFT >= pcl->pageofs_out + llen) {
-               outputsize = llen;
-               partial = !(pcl->length & Z_EROFS_PCLUSTER_FULL_LENGTH);
-       } else {
-               outputsize = (nr_pages << PAGE_SHIFT) - pcl->pageofs_out;
-               partial = true;
-       }
-
        if (z_erofs_is_inline_pcluster(pcl))
                inputsize = pcl->tailpacking_size;
        else
                inputsize = pclusterpages * PAGE_SIZE;
 
        err = z_erofs_decompress(&(struct z_erofs_decompress_req) {
-                                       .sb = sb,
-                                       .in = compressed_pages,
-                                       .out = pages,
+                                       .sb = be->sb,
+                                       .in = be->compressed_pages,
+                                       .out = be->decompressed_pages,
                                        .pageofs_in = pcl->pageofs_in,
                                        .pageofs_out = pcl->pageofs_out,
                                        .inputsize = inputsize,
-                                       .outputsize = outputsize,
+                                       .outputsize = pcl->length,
                                        .alg = pcl->algorithmformat,
                                        .inplace_io = overlapped,
-                                       .partial_decoding = partial
-                                }, pagepool);
+                                       .partial_decoding = pcl->partial,
+                                       .fillgaps = pcl->multibases,
+                                }, be->pagepool);
 
 out:
        /* must handle all compressed pages before actual file pages */
        if (z_erofs_is_inline_pcluster(pcl)) {
-               page = compressed_pages[0];
-               WRITE_ONCE(compressed_pages[0], NULL);
+               page = pcl->compressed_bvecs[0].page;
+               WRITE_ONCE(pcl->compressed_bvecs[0].page, NULL);
                put_page(page);
        } else {
                for (i = 0; i < pclusterpages; ++i) {
-                       page = compressed_pages[i];
+                       page = pcl->compressed_bvecs[i].page;
 
                        if (erofs_page_is_managed(sbi, page))
                                continue;
 
                        /* recycle all individual short-lived pages */
-                       (void)z_erofs_put_shortlivedpage(pagepool, page);
-                       WRITE_ONCE(compressed_pages[i], NULL);
+                       (void)z_erofs_put_shortlivedpage(be->pagepool, page);
+                       WRITE_ONCE(pcl->compressed_bvecs[i].page, NULL);
                }
        }
+       if (be->compressed_pages < be->onstack_pages ||
+           be->compressed_pages >= be->onstack_pages + Z_EROFS_ONSTACK_PAGES)
+               kvfree(be->compressed_pages);
+       z_erofs_fill_other_copies(be, err);
 
-       for (i = 0; i < nr_pages; ++i) {
-               page = pages[i];
+       for (i = 0; i < be->nr_pages; ++i) {
+               page = be->decompressed_pages[i];
                if (!page)
                        continue;
 
                DBG_BUGON(z_erofs_page_is_invalidated(page));
 
                /* recycle all individual short-lived pages */
-               if (z_erofs_put_shortlivedpage(pagepool, page))
+               if (z_erofs_put_shortlivedpage(be->pagepool, page))
                        continue;
-
-               if (err < 0)
-                       SetPageError(page);
-
+               if (err)
+                       z_erofs_page_mark_eio(page);
                z_erofs_onlinepage_endio(page);
        }
 
-       if (pages == z_pagemap_global)
-               mutex_unlock(&z_pagemap_global_lock);
-       else if (pages != pages_onstack)
-               kvfree(pages);
+       if (be->decompressed_pages != be->onstack_pages)
+               kvfree(be->decompressed_pages);
 
-       pcl->nr_pages = 0;
+       pcl->length = 0;
+       pcl->partial = true;
+       pcl->multibases = false;
+       pcl->bvset.nextpage = NULL;
        pcl->vcnt = 0;
 
        /* pcluster lock MUST be taken before the following line */
@@ -997,22 +1085,25 @@ out:
 static void z_erofs_decompress_queue(const struct z_erofs_decompressqueue *io,
                                     struct page **pagepool)
 {
+       struct z_erofs_decompress_backend be = {
+               .sb = io->sb,
+               .pagepool = pagepool,
+               .decompressed_secondary_bvecs =
+                       LIST_HEAD_INIT(be.decompressed_secondary_bvecs),
+       };
        z_erofs_next_pcluster_t owned = io->head;
 
        while (owned != Z_EROFS_PCLUSTER_TAIL_CLOSED) {
-               struct z_erofs_pcluster *pcl;
-
-               /* no possible that 'owned' equals Z_EROFS_WORK_TPTR_TAIL */
+               /* impossible that 'owned' equals Z_EROFS_WORK_TPTR_TAIL */
                DBG_BUGON(owned == Z_EROFS_PCLUSTER_TAIL);
-
-               /* no possible that 'owned' equals NULL */
+               /* impossible that 'owned' equals Z_EROFS_PCLUSTER_NIL */
                DBG_BUGON(owned == Z_EROFS_PCLUSTER_NIL);
 
-               pcl = container_of(owned, struct z_erofs_pcluster, next);
-               owned = READ_ONCE(pcl->next);
+               be.pcl = container_of(owned, struct z_erofs_pcluster, next);
+               owned = READ_ONCE(be.pcl->next);
 
-               z_erofs_decompress_pcluster(io->sb, pcl, pagepool);
-               erofs_workgroup_put(&pcl->obj);
+               z_erofs_decompress_pcluster(&be, io->eio ? -EIO : 0);
+               erofs_workgroup_put(&be.pcl->obj);
        }
 }
 
@@ -1038,7 +1129,6 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io,
        if (sync) {
                if (!atomic_add_return(bios, &io->pending_bios))
                        complete(&io->u.done);
-
                return;
        }
 
@@ -1071,7 +1161,7 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,
        int justfound;
 
 repeat:
-       page = READ_ONCE(pcl->compressed_pages[nr]);
+       page = READ_ONCE(pcl->compressed_bvecs[nr].page);
        oldpage = page;
 
        if (!page)
@@ -1087,7 +1177,7 @@ repeat:
         * otherwise, it will go inplace I/O path instead.
         */
        if (page->private == Z_EROFS_PREALLOCATED_PAGE) {
-               WRITE_ONCE(pcl->compressed_pages[nr], page);
+               WRITE_ONCE(pcl->compressed_bvecs[nr].page, page);
                set_page_private(page, 0);
                tocache = true;
                goto out_tocache;
@@ -1113,14 +1203,13 @@ repeat:
 
        /* the page is still in manage cache */
        if (page->mapping == mc) {
-               WRITE_ONCE(pcl->compressed_pages[nr], page);
+               WRITE_ONCE(pcl->compressed_bvecs[nr].page, page);
 
-               ClearPageError(page);
                if (!PagePrivate(page)) {
                        /*
                         * impossible to be !PagePrivate(page) for
                         * the current restriction as well if
-                        * the page is already in compressed_pages[].
+                        * the page is already in compressed_bvecs[].
                         */
                        DBG_BUGON(!justfound);
 
@@ -1149,7 +1238,8 @@ repeat:
        put_page(page);
 out_allocpage:
        page = erofs_allocpage(pagepool, gfp | __GFP_NOFAIL);
-       if (oldpage != cmpxchg(&pcl->compressed_pages[nr], oldpage, page)) {
+       if (oldpage != cmpxchg(&pcl->compressed_bvecs[nr].page,
+                              oldpage, page)) {
                erofs_pagepool_add(pagepool, page);
                cond_resched();
                goto repeat;
@@ -1186,6 +1276,7 @@ fg_out:
                q = fgq;
                init_completion(&fgq->u.done);
                atomic_set(&fgq->pending_bios, 0);
+               q->eio = false;
        }
        q->sb = sb;
        q->head = Z_EROFS_PCLUSTER_TAIL_CLOSED;
@@ -1246,26 +1337,25 @@ static void z_erofs_decompressqueue_endio(struct bio *bio)
                DBG_BUGON(PageUptodate(page));
                DBG_BUGON(z_erofs_page_is_invalidated(page));
 
-               if (err)
-                       SetPageError(page);
-
                if (erofs_page_is_managed(EROFS_SB(q->sb), page)) {
                        if (!err)
                                SetPageUptodate(page);
                        unlock_page(page);
                }
        }
+       if (err)
+               q->eio = true;
        z_erofs_decompress_kickoff(q, tagptr_unfold_tags(t), -1);
        bio_put(bio);
 }
 
-static void z_erofs_submit_queue(struct super_block *sb,
-                                struct z_erofs_decompress_frontend *f,
+static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
                                 struct page **pagepool,
                                 struct z_erofs_decompressqueue *fgq,
                                 bool *force_fg)
 {
-       struct erofs_sb_info *const sbi = EROFS_SB(sb);
+       struct super_block *sb = f->inode->i_sb;
+       struct address_space *mc = MNGD_MAPPING(EROFS_SB(sb));
        z_erofs_next_pcluster_t qtail[NR_JOBQUEUES];
        struct z_erofs_decompressqueue *q[NR_JOBQUEUES];
        void *bi_private;
@@ -1317,7 +1407,7 @@ static void z_erofs_submit_queue(struct super_block *sb,
                        struct page *page;
 
                        page = pickup_page_for_submission(pcl, i++, pagepool,
-                                                         MNGD_MAPPING(sbi));
+                                                         mc);
                        if (!page)
                                continue;
 
@@ -1369,15 +1459,14 @@ submit_bio_retry:
        z_erofs_decompress_kickoff(q[JQ_SUBMIT], *force_fg, nr_bios);
 }
 
-static void z_erofs_runqueue(struct super_block *sb,
-                            struct z_erofs_decompress_frontend *f,
+static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f,
                             struct page **pagepool, bool force_fg)
 {
        struct z_erofs_decompressqueue io[NR_JOBQUEUES];
 
        if (f->owned_head == Z_EROFS_PCLUSTER_TAIL)
                return;
-       z_erofs_submit_queue(sb, f, pagepool, io, &force_fg);
+       z_erofs_submit_queue(f, pagepool, io, &force_fg);
 
        /* handle bypass queue (no i/o pclusters) immediately */
        z_erofs_decompress_queue(&io[JQ_BYPASS], pagepool);
@@ -1475,7 +1564,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
        (void)z_erofs_collector_end(&f);
 
        /* if some compressed cluster ready, need submit them anyway */
-       z_erofs_runqueue(inode->i_sb, &f, &pagepool,
+       z_erofs_runqueue(&f, &pagepool,
                         z_erofs_get_sync_decompress_policy(sbi, 0));
 
        if (err)
@@ -1524,7 +1613,7 @@ static void z_erofs_readahead(struct readahead_control *rac)
        z_erofs_pcluster_readmore(&f, rac, 0, &pagepool, false);
        (void)z_erofs_collector_end(&f);
 
-       z_erofs_runqueue(inode->i_sb, &f, &pagepool,
+       z_erofs_runqueue(&f, &pagepool,
                         z_erofs_get_sync_decompress_policy(sbi, nr_pages));
        erofs_put_metabuf(&f.map.buf);
        erofs_release_pages(&pagepool);
index 58053bb5066f6095478014a92c9496700a7a1d10..e7f04c4fbb81c5742915f5120d5e198efce62218 100644 (file)
@@ -7,13 +7,10 @@
 #define __EROFS_FS_ZDATA_H
 
 #include "internal.h"
-#include "zpvec.h"
+#include "tagptr.h"
 
 #define Z_EROFS_PCLUSTER_MAX_PAGES     (Z_EROFS_PCLUSTER_MAX_SIZE / PAGE_SIZE)
-#define Z_EROFS_NR_INLINE_PAGEVECS      3
-
-#define Z_EROFS_PCLUSTER_FULL_LENGTH    0x00000001
-#define Z_EROFS_PCLUSTER_LENGTH_BIT     1
+#define Z_EROFS_INLINE_BVECS           2
 
 /*
  * let's leave a type here in case of introducing
  */
 typedef void *z_erofs_next_pcluster_t;
 
+struct z_erofs_bvec {
+       struct page *page;
+       int offset;
+       unsigned int end;
+};
+
+#define __Z_EROFS_BVSET(name, total) \
+struct name { \
+       /* point to the next page which contains the following bvecs */ \
+       struct page *nextpage; \
+       struct z_erofs_bvec bvec[total]; \
+}
+__Z_EROFS_BVSET(z_erofs_bvset,);
+__Z_EROFS_BVSET(z_erofs_bvset_inline, Z_EROFS_INLINE_BVECS);
+
 /*
  * Structure fields follow one of the following exclusion rules.
  *
@@ -38,24 +50,21 @@ struct z_erofs_pcluster {
        /* A: point to next chained pcluster or TAILs */
        z_erofs_next_pcluster_t next;
 
-       /* A: lower limit of decompressed length and if full length or not */
+       /* L: the maximum decompression size of this round */
        unsigned int length;
 
+       /* L: total number of bvecs */
+       unsigned int vcnt;
+
        /* I: page offset of start position of decompression */
        unsigned short pageofs_out;
 
        /* I: page offset of inline compressed data */
        unsigned short pageofs_in;
 
-       /* L: maximum relative page index in pagevec[] */
-       unsigned short nr_pages;
-
-       /* L: total number of pages in pagevec[] */
-       unsigned int vcnt;
-
        union {
-               /* L: inline a certain number of pagevecs for bootstrap */
-               erofs_vtptr_t pagevec[Z_EROFS_NR_INLINE_PAGEVECS];
+               /* L: inline a certain number of bvec for bootstrap */
+               struct z_erofs_bvset_inline bvset;
 
                /* I: can be used to free the pcluster by RCU. */
                struct rcu_head rcu;
@@ -72,8 +81,14 @@ struct z_erofs_pcluster {
        /* I: compression algorithm format */
        unsigned char algorithmformat;
 
-       /* A: compressed pages (can be cached or inplaced pages) */
-       struct page *compressed_pages[];
+       /* L: whether partial decompression or not */
+       bool partial;
+
+       /* L: indicate several pageofs_outs or not */
+       bool multibases;
+
+       /* A: compressed bvecs (can be cached or inplaced pages) */
+       struct z_erofs_bvec compressed_bvecs[];
 };
 
 /* let's avoid the valid 32-bit kernel addresses */
@@ -94,6 +109,8 @@ struct z_erofs_decompressqueue {
                struct completion done;
                struct work_struct work;
        } u;
+
+       bool eio;
 };
 
 static inline bool z_erofs_is_inline_pcluster(struct z_erofs_pcluster *pcl)
@@ -108,38 +125,17 @@ static inline unsigned int z_erofs_pclusterpages(struct z_erofs_pcluster *pcl)
        return pcl->pclusterpages;
 }
 
-#define Z_EROFS_ONLINEPAGE_COUNT_BITS   2
-#define Z_EROFS_ONLINEPAGE_COUNT_MASK   ((1 << Z_EROFS_ONLINEPAGE_COUNT_BITS) - 1)
-#define Z_EROFS_ONLINEPAGE_INDEX_SHIFT  (Z_EROFS_ONLINEPAGE_COUNT_BITS)
-
 /*
- * waiters (aka. ongoing_packs): # to unlock the page
- * sub-index: 0 - for partial page, >= 1 full page sub-index
+ * bit 31: I/O error occurred on this page
+ * bit 0 - 30: remaining parts to complete this page
  */
-typedef atomic_t z_erofs_onlinepage_t;
-
-/* type punning */
-union z_erofs_onlinepage_converter {
-       z_erofs_onlinepage_t *o;
-       unsigned long *v;
-};
-
-static inline unsigned int z_erofs_onlinepage_index(struct page *page)
-{
-       union z_erofs_onlinepage_converter u;
-
-       DBG_BUGON(!PagePrivate(page));
-       u.v = &page_private(page);
-
-       return atomic_read(u.o) >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT;
-}
+#define Z_EROFS_PAGE_EIO                       (1 << 31)
 
 static inline void z_erofs_onlinepage_init(struct page *page)
 {
        union {
-               z_erofs_onlinepage_t o;
+               atomic_t o;
                unsigned long v;
-       /* keep from being unlocked in advance */
        } u = { .o = ATOMIC_INIT(1) };
 
        set_page_private(page, u.v);
@@ -147,49 +143,36 @@ static inline void z_erofs_onlinepage_init(struct page *page)
        SetPagePrivate(page);
 }
 
-static inline void z_erofs_onlinepage_fixup(struct page *page,
-       uintptr_t index, bool down)
+static inline void z_erofs_onlinepage_split(struct page *page)
 {
-       union z_erofs_onlinepage_converter u = { .v = &page_private(page) };
-       int orig, orig_index, val;
-
-repeat:
-       orig = atomic_read(u.o);
-       orig_index = orig >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT;
-       if (orig_index) {
-               if (!index)
-                       return;
+       atomic_inc((atomic_t *)&page->private);
+}
 
-               DBG_BUGON(orig_index != index);
-       }
+static inline void z_erofs_page_mark_eio(struct page *page)
+{
+       int orig;
 
-       val = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) |
-               ((orig & Z_EROFS_ONLINEPAGE_COUNT_MASK) + (unsigned int)down);
-       if (atomic_cmpxchg(u.o, orig, val) != orig)
-               goto repeat;
+       do {
+               orig = atomic_read((atomic_t *)&page->private);
+       } while (atomic_cmpxchg((atomic_t *)&page->private, orig,
+                               orig | Z_EROFS_PAGE_EIO) != orig);
 }
 
 static inline void z_erofs_onlinepage_endio(struct page *page)
 {
-       union z_erofs_onlinepage_converter u;
        unsigned int v;
 
        DBG_BUGON(!PagePrivate(page));
-       u.v = &page_private(page);
-
-       v = atomic_dec_return(u.o);
-       if (!(v & Z_EROFS_ONLINEPAGE_COUNT_MASK)) {
+       v = atomic_dec_return((atomic_t *)&page->private);
+       if (!(v & ~Z_EROFS_PAGE_EIO)) {
                set_page_private(page, 0);
                ClearPagePrivate(page);
-               if (!PageError(page))
+               if (!(v & Z_EROFS_PAGE_EIO))
                        SetPageUptodate(page);
                unlock_page(page);
        }
-       erofs_dbg("%s, page %p value %x", __func__, page, atomic_read(u.o));
 }
 
-#define Z_EROFS_VMAP_ONSTACK_PAGES     \
-       min_t(unsigned int, THREAD_SIZE / 8 / sizeof(struct page *), 96U)
-#define Z_EROFS_VMAP_GLOBAL_PAGES      2048
+#define Z_EROFS_ONSTACK_PAGES          32
 
 #endif
diff --git a/fs/erofs/zpvec.h b/fs/erofs/zpvec.h
deleted file mode 100644 (file)
index b05464f..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2018 HUAWEI, Inc.
- *             https://www.huawei.com/
- */
-#ifndef __EROFS_FS_ZPVEC_H
-#define __EROFS_FS_ZPVEC_H
-
-#include "tagptr.h"
-
-/* page type in pagevec for decompress subsystem */
-enum z_erofs_page_type {
-       /* including Z_EROFS_VLE_PAGE_TAIL_EXCLUSIVE */
-       Z_EROFS_PAGE_TYPE_EXCLUSIVE,
-
-       Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED,
-
-       Z_EROFS_VLE_PAGE_TYPE_HEAD,
-       Z_EROFS_VLE_PAGE_TYPE_MAX
-};
-
-extern void __compiletime_error("Z_EROFS_PAGE_TYPE_EXCLUSIVE != 0")
-       __bad_page_type_exclusive(void);
-
-/* pagevec tagged pointer */
-typedef tagptr2_t      erofs_vtptr_t;
-
-/* pagevec collector */
-struct z_erofs_pagevec_ctor {
-       struct page *curr, *next;
-       erofs_vtptr_t *pages;
-
-       unsigned int nr, index;
-};
-
-static inline void z_erofs_pagevec_ctor_exit(struct z_erofs_pagevec_ctor *ctor,
-                                            bool atomic)
-{
-       if (!ctor->curr)
-               return;
-
-       if (atomic)
-               kunmap_atomic(ctor->pages);
-       else
-               kunmap(ctor->curr);
-}
-
-static inline struct page *
-z_erofs_pagevec_ctor_next_page(struct z_erofs_pagevec_ctor *ctor,
-                              unsigned int nr)
-{
-       unsigned int index;
-
-       /* keep away from occupied pages */
-       if (ctor->next)
-               return ctor->next;
-
-       for (index = 0; index < nr; ++index) {
-               const erofs_vtptr_t t = ctor->pages[index];
-               const unsigned int tags = tagptr_unfold_tags(t);
-
-               if (tags == Z_EROFS_PAGE_TYPE_EXCLUSIVE)
-                       return tagptr_unfold_ptr(t);
-       }
-       DBG_BUGON(nr >= ctor->nr);
-       return NULL;
-}
-
-static inline void
-z_erofs_pagevec_ctor_pagedown(struct z_erofs_pagevec_ctor *ctor,
-                             bool atomic)
-{
-       struct page *next = z_erofs_pagevec_ctor_next_page(ctor, ctor->nr);
-
-       z_erofs_pagevec_ctor_exit(ctor, atomic);
-
-       ctor->curr = next;
-       ctor->next = NULL;
-       ctor->pages = atomic ?
-               kmap_atomic(ctor->curr) : kmap(ctor->curr);
-
-       ctor->nr = PAGE_SIZE / sizeof(struct page *);
-       ctor->index = 0;
-}
-
-static inline void z_erofs_pagevec_ctor_init(struct z_erofs_pagevec_ctor *ctor,
-                                            unsigned int nr,
-                                            erofs_vtptr_t *pages,
-                                            unsigned int i)
-{
-       ctor->nr = nr;
-       ctor->curr = ctor->next = NULL;
-       ctor->pages = pages;
-
-       if (i >= nr) {
-               i -= nr;
-               z_erofs_pagevec_ctor_pagedown(ctor, false);
-               while (i > ctor->nr) {
-                       i -= ctor->nr;
-                       z_erofs_pagevec_ctor_pagedown(ctor, false);
-               }
-       }
-       ctor->next = z_erofs_pagevec_ctor_next_page(ctor, i);
-       ctor->index = i;
-}
-
-static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
-                                          struct page *page,
-                                          enum z_erofs_page_type type,
-                                          bool pvec_safereuse)
-{
-       if (!ctor->next) {
-               /* some pages cannot be reused as pvec safely without I/O */
-               if (type == Z_EROFS_PAGE_TYPE_EXCLUSIVE && !pvec_safereuse)
-                       type = Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED;
-
-               if (type != Z_EROFS_PAGE_TYPE_EXCLUSIVE &&
-                   ctor->index + 1 == ctor->nr)
-                       return false;
-       }
-
-       if (ctor->index >= ctor->nr)
-               z_erofs_pagevec_ctor_pagedown(ctor, false);
-
-       /* exclusive page type must be 0 */
-       if (Z_EROFS_PAGE_TYPE_EXCLUSIVE != (uintptr_t)NULL)
-               __bad_page_type_exclusive();
-
-       /* should remind that collector->next never equal to 1, 2 */
-       if (type == (uintptr_t)ctor->next) {
-               ctor->next = page;
-       }
-       ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, page, type);
-       return true;
-}
-
-static inline struct page *
-z_erofs_pagevec_dequeue(struct z_erofs_pagevec_ctor *ctor,
-                       enum z_erofs_page_type *type)
-{
-       erofs_vtptr_t t;
-
-       if (ctor->index >= ctor->nr) {
-               DBG_BUGON(!ctor->next);
-               z_erofs_pagevec_ctor_pagedown(ctor, true);
-       }
-
-       t = ctor->pages[ctor->index];
-
-       *type = tagptr_unfold_tags(t);
-
-       /* should remind that collector->next never equal to 1, 2 */
-       if (*type == (uintptr_t)ctor->next)
-               ctor->next = tagptr_unfold_ptr(t);
-
-       ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, NULL, 0);
-       return tagptr_unfold_ptr(t);
-}
-#endif
index e6b932219803ed9984c08d656806c6242bb430f0..7a192e4e7fa93551f2fd5e731056021623299230 100644 (file)
@@ -1679,14 +1679,14 @@ int ext2_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (error)
                return error;
 
-       if (is_quota_modification(inode, iattr)) {
+       if (is_quota_modification(mnt_userns, inode, iattr)) {
                error = dquot_initialize(inode);
                if (error)
                        return error;
        }
-       if ((iattr->ia_valid & ATTR_UID && !uid_eq(iattr->ia_uid, inode->i_uid)) ||
-           (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid))) {
-               error = dquot_transfer(inode, iattr);
+       if (i_uid_needs_update(mnt_userns, iattr, inode) ||
+           i_gid_needs_update(mnt_userns, iattr, inode)) {
+               error = dquot_transfer(mnt_userns, inode, iattr);
                if (error)
                        return error;
        }
index f6a19f6d9f6d5b73908e89289c17b7d0850cb288..6f475d2e3b183c30b1e00c7403e8405a3a122e7e 100644 (file)
@@ -1059,9 +1059,10 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
                        sbi->s_frags_per_group);
                goto failed_mount;
        }
-       if (sbi->s_inodes_per_group > sb->s_blocksize * 8) {
+       if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
+           sbi->s_inodes_per_group > sb->s_blocksize * 8) {
                ext2_msg(sb, KERN_ERR,
-                       "error: #inodes per group too big: %lu",
+                       "error: invalid #inodes per group: %lu",
                        sbi->s_inodes_per_group);
                goto failed_mount;
        }
@@ -1071,6 +1072,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
        sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) -
                                le32_to_cpu(es->s_first_data_block) - 1)
                                        / EXT2_BLOCKS_PER_GROUP(sb)) + 1;
+       if ((u64)sbi->s_groups_count * sbi->s_inodes_per_group !=
+           le32_to_cpu(es->s_inodes_count)) {
+               ext2_msg(sb, KERN_ERR, "error: invalid #inodes: %u vs computed %llu",
+                        le32_to_cpu(es->s_inodes_count),
+                        (u64)sbi->s_groups_count * sbi->s_inodes_per_group);
+               goto failed_mount;
+       }
        db_count = (sbi->s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) /
                   EXT2_DESC_PER_BLOCK(sb);
        sbi->s_group_desc = kmalloc_array(db_count,
@@ -1490,8 +1498,7 @@ static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data,
                len = i_size-off;
        toread = len;
        while (toread > 0) {
-               tocopy = sb->s_blocksize - offset < toread ?
-                               sb->s_blocksize - offset : toread;
+               tocopy = min_t(size_t, sb->s_blocksize - offset, toread);
 
                tmp_bh.b_state = 0;
                tmp_bh.b_size = sb->s_blocksize;
@@ -1529,8 +1536,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
        struct buffer_head *bh;
 
        while (towrite > 0) {
-               tocopy = sb->s_blocksize - offset < towrite ?
-                               sb->s_blocksize - offset : towrite;
+               tocopy = min_t(size_t, sb->s_blocksize - offset, towrite);
 
                tmp_bh.b_state = 0;
                tmp_bh.b_size = sb->s_blocksize;
index 84c0eb55071d65621f0c2fe6590382908ee8d35b..3dcc1dd1f1799e09d1b7c7e2a4867b8d4d9e12ad 100644 (file)
@@ -5350,14 +5350,14 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (error)
                return error;
 
-       if (is_quota_modification(inode, attr)) {
+       if (is_quota_modification(mnt_userns, inode, attr)) {
                error = dquot_initialize(inode);
                if (error)
                        return error;
        }
 
-       if ((ia_valid & ATTR_UID && !uid_eq(attr->ia_uid, inode->i_uid)) ||
-           (ia_valid & ATTR_GID && !gid_eq(attr->ia_gid, inode->i_gid))) {
+       if (i_uid_needs_update(mnt_userns, attr, inode) ||
+           i_gid_needs_update(mnt_userns, attr, inode)) {
                handle_t *handle;
 
                /* (user+group)*(old+new) structure, inode write (sb,
@@ -5374,7 +5374,7 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                 * counts xattr inode references.
                 */
                down_read(&EXT4_I(inode)->xattr_sem);
-               error = dquot_transfer(inode, attr);
+               error = dquot_transfer(mnt_userns, inode, attr);
                up_read(&EXT4_I(inode)->xattr_sem);
 
                if (error) {
@@ -5383,10 +5383,8 @@ int ext4_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                }
                /* Update corresponding info in inode so that everything is in
                 * one transaction */
-               if (attr->ia_valid & ATTR_UID)
-                       inode->i_uid = attr->ia_uid;
-               if (attr->ia_valid & ATTR_GID)
-                       inode->i_gid = attr->ia_gid;
+               i_uid_update(mnt_userns, attr, inode);
+               i_gid_update(mnt_userns, attr, inode);
                error = ext4_mark_inode_dirty(handle, inode);
                ext4_journal_stop(handle);
                if (unlikely(error)) {
index bd14cef1b08fd2761b1bddd27f178abddc98a36e..d66e37d80a2da52fb49e1c6461dfb4c7417d5898 100644 (file)
@@ -861,10 +861,8 @@ static void __setattr_copy(struct user_namespace *mnt_userns,
 {
        unsigned int ia_valid = attr->ia_valid;
 
-       if (ia_valid & ATTR_UID)
-               inode->i_uid = attr->ia_uid;
-       if (ia_valid & ATTR_GID)
-               inode->i_gid = attr->ia_gid;
+       i_uid_update(mnt_userns, attr, inode);
+       i_gid_update(mnt_userns, attr, inode);
        if (ia_valid & ATTR_ATIME)
                inode->i_atime = attr->ia_atime;
        if (ia_valid & ATTR_MTIME)
@@ -917,17 +915,15 @@ int f2fs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (err)
                return err;
 
-       if (is_quota_modification(inode, attr)) {
+       if (is_quota_modification(mnt_userns, inode, attr)) {
                err = f2fs_dquot_initialize(inode);
                if (err)
                        return err;
        }
-       if ((attr->ia_valid & ATTR_UID &&
-               !uid_eq(attr->ia_uid, inode->i_uid)) ||
-               (attr->ia_valid & ATTR_GID &&
-               !gid_eq(attr->ia_gid, inode->i_gid))) {
+       if (i_uid_needs_update(mnt_userns, attr, inode) ||
+           i_gid_needs_update(mnt_userns, attr, inode)) {
                f2fs_lock_op(F2FS_I_SB(inode));
-               err = dquot_transfer(inode, attr);
+               err = dquot_transfer(mnt_userns, inode, attr);
                if (err) {
                        set_sbi_flag(F2FS_I_SB(inode),
                                        SBI_QUOTA_NEED_REPAIR);
@@ -938,10 +934,8 @@ int f2fs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                 * update uid/gid under lock_op(), so that dquot and inode can
                 * be updated atomically.
                 */
-               if (attr->ia_valid & ATTR_UID)
-                       inode->i_uid = attr->ia_uid;
-               if (attr->ia_valid & ATTR_GID)
-                       inode->i_gid = attr->ia_gid;
+               i_uid_update(mnt_userns, attr, inode);
+               i_gid_update(mnt_userns, attr, inode);
                f2fs_mark_inode_dirty_sync(inode, true);
                f2fs_unlock_op(F2FS_I_SB(inode));
        }
index 3cb7f8a43b4d7e11c1248e39728a359c54e3f2d6..dcd0a1e35095175178dff56c7b1f48e9d2fce680 100644 (file)
@@ -255,18 +255,18 @@ static int recover_quota_data(struct inode *inode, struct page *page)
 
        memset(&attr, 0, sizeof(attr));
 
-       attr.ia_uid = make_kuid(inode->i_sb->s_user_ns, i_uid);
-       attr.ia_gid = make_kgid(inode->i_sb->s_user_ns, i_gid);
+       attr.ia_vfsuid = VFSUIDT_INIT(make_kuid(inode->i_sb->s_user_ns, i_uid));
+       attr.ia_vfsgid = VFSGIDT_INIT(make_kgid(inode->i_sb->s_user_ns, i_gid));
 
-       if (!uid_eq(attr.ia_uid, inode->i_uid))
+       if (!vfsuid_eq(attr.ia_vfsuid, i_uid_into_vfsuid(&init_user_ns, inode)))
                attr.ia_valid |= ATTR_UID;
-       if (!gid_eq(attr.ia_gid, inode->i_gid))
+       if (!vfsgid_eq(attr.ia_vfsgid, i_gid_into_vfsgid(&init_user_ns, inode)))
                attr.ia_valid |= ATTR_GID;
 
        if (!attr.ia_valid)
                return 0;
 
-       err = dquot_transfer(inode, &attr);
+       err = dquot_transfer(&init_user_ns, inode, &attr);
        if (err)
                set_sbi_flag(F2FS_I_SB(inode), SBI_QUOTA_NEED_REPAIR);
        return err;
index 3dae3ed60f3a3652709dac70ea74c7bc9300f50f..3e4eb3467cb44beb276b91f82dded1fe1d0ad331 100644 (file)
@@ -90,7 +90,8 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)
         * out the RO attribute for checking by the security
         * module, just because it maps to a file mode.
         */
-       err = security_inode_setattr(file->f_path.dentry, &ia);
+       err = security_inode_setattr(file_mnt_user_ns(file),
+                                    file->f_path.dentry, &ia);
        if (err)
                goto out_unlock_inode;
 
@@ -516,9 +517,11 @@ int fat_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        }
 
        if (((attr->ia_valid & ATTR_UID) &&
-            (!uid_eq(attr->ia_uid, sbi->options.fs_uid))) ||
+            (!uid_eq(from_vfsuid(mnt_userns, i_user_ns(inode), attr->ia_vfsuid),
+                     sbi->options.fs_uid))) ||
            ((attr->ia_valid & ATTR_GID) &&
-            (!gid_eq(attr->ia_gid, sbi->options.fs_gid))) ||
+            (!gid_eq(from_vfsgid(mnt_userns, i_user_ns(inode), attr->ia_vfsgid),
+                     sbi->options.fs_gid))) ||
            ((attr->ia_valid & ATTR_MODE) &&
             (attr->ia_mode & ~FAT_VALID_MODE)))
                error = -EPERM;
index 1d732fd223d4a900a280f3615a5f6e600bf5b8f0..332dc9ac47a9161856a884ca9f782076d8fe0e45 100644 (file)
@@ -95,14 +95,14 @@ int jfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (rc)
                return rc;
 
-       if (is_quota_modification(inode, iattr)) {
+       if (is_quota_modification(mnt_userns, inode, iattr)) {
                rc = dquot_initialize(inode);
                if (rc)
                        return rc;
        }
        if ((iattr->ia_valid & ATTR_UID && !uid_eq(iattr->ia_uid, inode->i_uid)) ||
            (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid))) {
-               rc = dquot_transfer(inode, iattr);
+               rc = dquot_transfer(mnt_userns, inode, iattr);
                if (rc)
                        return rc;
        }
index 05efcdf7a4a73edbed63c9903856951ff061f2a1..7c849024999f9b106c8ac029ce9de1a1b0171d7b 100644 (file)
@@ -963,7 +963,7 @@ ssize_t ksmbd_vfs_getxattr(struct user_namespace *user_ns,
  */
 int ksmbd_vfs_setxattr(struct user_namespace *user_ns,
                       struct dentry *dentry, const char *attr_name,
-                      const void *attr_value, size_t attr_size, int flags)
+                      void *attr_value, size_t attr_size, int flags)
 {
        int err;
 
index 8c37aaf936ab114c1c30c24224dc6b84a7c254e5..70da4c0ba7adae399ec02ac3dff1fadda2bd143e 100644 (file)
@@ -109,7 +109,7 @@ ssize_t ksmbd_vfs_casexattr_len(struct user_namespace *user_ns,
                                int attr_name_len);
 int ksmbd_vfs_setxattr(struct user_namespace *user_ns,
                       struct dentry *dentry, const char *attr_name,
-                      const void *attr_value, size_t attr_size, int flags);
+                      void *attr_value, size_t attr_size, int flags);
 int ksmbd_vfs_xattr_stream_name(char *stream_name, char **xattr_stream_name,
                                size_t *xattr_stream_name_size, int s_type);
 int ksmbd_vfs_remove_xattr(struct user_namespace *user_ns,
index ca28e0e50e569f3ad761949e71bfab646b9979c5..c266cfdc3291f92902481f8d9ed289ae08fe839c 100644 (file)
@@ -425,21 +425,9 @@ static inline int flock_translate_cmd(int cmd) {
 }
 
 /* Fill in a file_lock structure with an appropriate FLOCK lock. */
-static struct file_lock *
-flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl)
+static void flock_make_lock(struct file *filp, struct file_lock *fl, int type)
 {
-       int type = flock_translate_cmd(cmd);
-
-       if (type < 0)
-               return ERR_PTR(type);
-
-       if (fl == NULL) {
-               fl = locks_alloc_lock();
-               if (fl == NULL)
-                       return ERR_PTR(-ENOMEM);
-       } else {
-               locks_init_lock(fl);
-       }
+       locks_init_lock(fl);
 
        fl->fl_file = filp;
        fl->fl_owner = filp;
@@ -447,8 +435,6 @@ flock_make_lock(struct file *filp, unsigned int cmd, struct file_lock *fl)
        fl->fl_flags = FL_FLOCK;
        fl->fl_type = type;
        fl->fl_end = OFFSET_MAX;
-
-       return fl;
 }
 
 static int assign_type(struct file_lock *fl, long type)
@@ -2097,21 +2083,9 @@ EXPORT_SYMBOL(locks_lock_inode_wait);
  */
 SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
 {
-       struct fd f = fdget(fd);
-       struct file_lock *lock;
-       int can_sleep, unlock;
-       int error;
-
-       error = -EBADF;
-       if (!f.file)
-               goto out;
-
-       can_sleep = !(cmd & LOCK_NB);
-       cmd &= ~LOCK_NB;
-       unlock = (cmd == LOCK_UN);
-
-       if (!unlock && !(f.file->f_mode & (FMODE_READ|FMODE_WRITE)))
-               goto out_putf;
+       int can_sleep, error, type;
+       struct file_lock fl;
+       struct fd f;
 
        /*
         * LOCK_MAND locks were broken for a long time in that they never
@@ -2123,36 +2097,41 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
         */
        if (cmd & LOCK_MAND) {
                pr_warn_once("Attempt to set a LOCK_MAND lock via flock(2). This support has been removed and the request ignored.\n");
-               error = 0;
-               goto out_putf;
+               return 0;
        }
 
-       lock = flock_make_lock(f.file, cmd, NULL);
-       if (IS_ERR(lock)) {
-               error = PTR_ERR(lock);
+       type = flock_translate_cmd(cmd & ~LOCK_NB);
+       if (type < 0)
+               return type;
+
+       error = -EBADF;
+       f = fdget(fd);
+       if (!f.file)
+               return error;
+
+       if (type != F_UNLCK && !(f.file->f_mode & (FMODE_READ | FMODE_WRITE)))
                goto out_putf;
-       }
 
-       if (can_sleep)
-               lock->fl_flags |= FL_SLEEP;
+       flock_make_lock(f.file, &fl, type);
 
-       error = security_file_lock(f.file, lock->fl_type);
+       error = security_file_lock(f.file, fl.fl_type);
        if (error)
-               goto out_free;
+               goto out_putf;
+
+       can_sleep = !(cmd & LOCK_NB);
+       if (can_sleep)
+               fl.fl_flags |= FL_SLEEP;
 
        if (f.file->f_op->flock)
                error = f.file->f_op->flock(f.file,
-                                         (can_sleep) ? F_SETLKW : F_SETLK,
-                                         lock);
+                                           (can_sleep) ? F_SETLKW : F_SETLK,
+                                           &fl);
        else
-               error = locks_lock_file_wait(f.file, lock);
-
- out_free:
-       locks_free_lock(lock);
+               error = locks_lock_file_wait(f.file, &fl);
 
  out_putf:
        fdput(f);
- out:
+
        return error;
 }
 
@@ -2614,7 +2593,7 @@ locks_remove_flock(struct file *filp, struct file_lock_context *flctx)
        if (list_empty(&flctx->flc_flock))
                return;
 
-       flock_make_lock(filp, LOCK_UN, &fl);
+       flock_make_lock(filp, &fl, F_UNLCK);
        fl.fl_flags |= FL_CLOSE;
 
        if (filp->f_op->flock)
index 4f897e1095470aa93eed851fb0da1e3c5b45c21f..cd7d09a569fff98684698609beaef412bb226754 100644 (file)
@@ -295,12 +295,13 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
                                     const void *data, int data_type,
                                     struct inode *dir)
 {
-       __u32 marks_mask = 0, marks_ignored_mask = 0;
+       __u32 marks_mask = 0, marks_ignore_mask = 0;
        __u32 test_mask, user_mask = FANOTIFY_OUTGOING_EVENTS |
                                     FANOTIFY_EVENT_FLAGS;
        const struct path *path = fsnotify_data_path(data, data_type);
        unsigned int fid_mode = FAN_GROUP_FLAG(group, FANOTIFY_FID_BITS);
        struct fsnotify_mark *mark;
+       bool ondir = event_mask & FAN_ONDIR;
        int type;
 
        pr_debug("%s: report_mask=%x mask=%x data=%p data_type=%d\n",
@@ -315,19 +316,21 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
                        return 0;
        } else if (!(fid_mode & FAN_REPORT_FID)) {
                /* Do we have a directory inode to report? */
-               if (!dir && !(event_mask & FS_ISDIR))
+               if (!dir && !ondir)
                        return 0;
        }
 
        fsnotify_foreach_iter_mark_type(iter_info, mark, type) {
-               /* Apply ignore mask regardless of mark's ISDIR flag */
-               marks_ignored_mask |= mark->ignored_mask;
+               /*
+                * Apply ignore mask depending on event flags in ignore mask.
+                */
+               marks_ignore_mask |=
+                       fsnotify_effective_ignore_mask(mark, ondir, type);
 
                /*
-                * If the event is on dir and this mark doesn't care about
-                * events on dir, don't send it!
+                * Send the event depending on event flags in mark mask.
                 */
-               if (event_mask & FS_ISDIR && !(mark->mask & FS_ISDIR))
+               if (!fsnotify_mask_applicable(mark->mask, ondir, type))
                        continue;
 
                marks_mask |= mark->mask;
@@ -336,7 +339,7 @@ static u32 fanotify_group_event_mask(struct fsnotify_group *group,
                *match_mask |= 1U << type;
        }
 
-       test_mask = event_mask & marks_mask & ~marks_ignored_mask;
+       test_mask = event_mask & marks_mask & ~marks_ignore_mask;
 
        /*
         * For dirent modification events (create/delete/move) that do not carry
index 80e0ec95b11310179c00fa2c0eb31ea9f0006451..1d9f11255c64f5408e6d0ce900b9c8c61867e686 100644 (file)
@@ -499,6 +499,8 @@ static inline unsigned int fanotify_mark_user_flags(struct fsnotify_mark *mark)
                mflags |= FAN_MARK_IGNORED_SURV_MODIFY;
        if (mark->flags & FSNOTIFY_MARK_FLAG_NO_IREF)
                mflags |= FAN_MARK_EVICTABLE;
+       if (mark->flags & FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS)
+               mflags |= FAN_MARK_IGNORE;
 
        return mflags;
 }
index b08ce0d821a7f6c2839fdd9386f3607d69c7641e..f0e49a406ffa820bcca39c2eb7bf99adb880635a 100644 (file)
@@ -1009,10 +1009,10 @@ static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark,
        mask &= ~umask;
        spin_lock(&fsn_mark->lock);
        oldmask = fsnotify_calc_mask(fsn_mark);
-       if (!(flags & FAN_MARK_IGNORED_MASK)) {
+       if (!(flags & FANOTIFY_MARK_IGNORE_BITS)) {
                fsn_mark->mask &= ~mask;
        } else {
-               fsn_mark->ignored_mask &= ~mask;
+               fsn_mark->ignore_mask &= ~mask;
        }
        newmask = fsnotify_calc_mask(fsn_mark);
        /*
@@ -1021,7 +1021,7 @@ static __u32 fanotify_mark_remove_from_mask(struct fsnotify_mark *fsn_mark,
         * changes to the mask.
         * Destroy mark when only umask bits remain.
         */
-       *destroy = !((fsn_mark->mask | fsn_mark->ignored_mask) & ~umask);
+       *destroy = !((fsn_mark->mask | fsn_mark->ignore_mask) & ~umask);
        spin_unlock(&fsn_mark->lock);
 
        return oldmask & ~newmask;
@@ -1085,15 +1085,24 @@ static bool fanotify_mark_update_flags(struct fsnotify_mark *fsn_mark,
                                       unsigned int fan_flags)
 {
        bool want_iref = !(fan_flags & FAN_MARK_EVICTABLE);
+       unsigned int ignore = fan_flags & FANOTIFY_MARK_IGNORE_BITS;
        bool recalc = false;
 
+       /*
+        * When using FAN_MARK_IGNORE for the first time, mark starts using
+        * independent event flags in ignore mask.  After that, trying to
+        * update the ignore mask with the old FAN_MARK_IGNORED_MASK API
+        * will result in EEXIST error.
+        */
+       if (ignore == FAN_MARK_IGNORE)
+               fsn_mark->flags |= FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS;
+
        /*
         * Setting FAN_MARK_IGNORED_SURV_MODIFY for the first time may lead to
         * the removal of the FS_MODIFY bit in calculated mask if it was set
-        * because of an ignored mask that is now going to survive FS_MODIFY.
+        * because of an ignore mask that is now going to survive FS_MODIFY.
         */
-       if ((fan_flags & FAN_MARK_IGNORED_MASK) &&
-           (fan_flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
+       if (ignore && (fan_flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
            !(fsn_mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY)) {
                fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY;
                if (!(fsn_mark->mask & FS_MODIFY))
@@ -1120,10 +1129,10 @@ static bool fanotify_mark_add_to_mask(struct fsnotify_mark *fsn_mark,
        bool recalc;
 
        spin_lock(&fsn_mark->lock);
-       if (!(fan_flags & FAN_MARK_IGNORED_MASK))
+       if (!(fan_flags & FANOTIFY_MARK_IGNORE_BITS))
                fsn_mark->mask |= mask;
        else
-               fsn_mark->ignored_mask |= mask;
+               fsn_mark->ignore_mask |= mask;
 
        recalc = fsnotify_calc_mask(fsn_mark) &
                ~fsnotify_conn_mask(fsn_mark->connector);
@@ -1187,6 +1196,37 @@ static int fanotify_group_init_error_pool(struct fsnotify_group *group)
                                         sizeof(struct fanotify_error_event));
 }
 
+static int fanotify_may_update_existing_mark(struct fsnotify_mark *fsn_mark,
+                                             unsigned int fan_flags)
+{
+       /*
+        * Non evictable mark cannot be downgraded to evictable mark.
+        */
+       if (fan_flags & FAN_MARK_EVICTABLE &&
+           !(fsn_mark->flags & FSNOTIFY_MARK_FLAG_NO_IREF))
+               return -EEXIST;
+
+       /*
+        * New ignore mask semantics cannot be downgraded to old semantics.
+        */
+       if (fan_flags & FAN_MARK_IGNORED_MASK &&
+           fsn_mark->flags & FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS)
+               return -EEXIST;
+
+       /*
+        * An ignore mask that survives modify could never be downgraded to not
+        * survive modify.  With new FAN_MARK_IGNORE semantics we make that rule
+        * explicit and return an error when trying to update the ignore mask
+        * without the original FAN_MARK_IGNORED_SURV_MODIFY value.
+        */
+       if (fan_flags & FAN_MARK_IGNORE &&
+           !(fan_flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
+           fsn_mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY)
+               return -EEXIST;
+
+       return 0;
+}
+
 static int fanotify_add_mark(struct fsnotify_group *group,
                             fsnotify_connp_t *connp, unsigned int obj_type,
                             __u32 mask, unsigned int fan_flags,
@@ -1208,19 +1248,18 @@ static int fanotify_add_mark(struct fsnotify_group *group,
        }
 
        /*
-        * Non evictable mark cannot be downgraded to evictable mark.
+        * Check if requested mark flags conflict with an existing mark flags.
         */
-       if (fan_flags & FAN_MARK_EVICTABLE &&
-           !(fsn_mark->flags & FSNOTIFY_MARK_FLAG_NO_IREF)) {
-               ret = -EEXIST;
+       ret = fanotify_may_update_existing_mark(fsn_mark, fan_flags);
+       if (ret)
                goto out;
-       }
 
        /*
         * Error events are pre-allocated per group, only if strictly
         * needed (i.e. FAN_FS_ERROR was requested).
         */
-       if (!(fan_flags & FAN_MARK_IGNORED_MASK) && (mask & FAN_FS_ERROR)) {
+       if (!(fan_flags & FANOTIFY_MARK_IGNORE_BITS) &&
+           (mask & FAN_FS_ERROR)) {
                ret = fanotify_group_init_error_pool(group);
                if (ret)
                        goto out;
@@ -1261,10 +1300,10 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group,
 
        /*
         * If some other task has this inode open for write we should not add
-        * an ignored mark, unless that ignored mark is supposed to survive
+        * an ignore mask, unless that ignore mask is supposed to survive
         * modification changes anyway.
         */
-       if ((flags & FAN_MARK_IGNORED_MASK) &&
+       if ((flags & FANOTIFY_MARK_IGNORE_BITS) &&
            !(flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
            inode_is_open_for_write(inode))
                return 0;
@@ -1520,7 +1559,8 @@ static int fanotify_events_supported(struct fsnotify_group *group,
        unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS;
        /* Strict validation of events in non-dir inode mask with v5.17+ APIs */
        bool strict_dir_events = FAN_GROUP_FLAG(group, FAN_REPORT_TARGET_FID) ||
-                                (mask & FAN_RENAME);
+                                (mask & FAN_RENAME) ||
+                                (flags & FAN_MARK_IGNORE);
 
        /*
         * Some filesystems such as 'proc' acquire unusual locks when opening
@@ -1557,7 +1597,8 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
        __kernel_fsid_t __fsid, *fsid = NULL;
        u32 valid_mask = FANOTIFY_EVENTS | FANOTIFY_EVENT_FLAGS;
        unsigned int mark_type = flags & FANOTIFY_MARK_TYPE_BITS;
-       bool ignored = flags & FAN_MARK_IGNORED_MASK;
+       unsigned int mark_cmd = flags & FANOTIFY_MARK_CMD_BITS;
+       unsigned int ignore = flags & FANOTIFY_MARK_IGNORE_BITS;
        unsigned int obj_type, fid_mode;
        u32 umask = 0;
        int ret;
@@ -1586,7 +1627,7 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
                return -EINVAL;
        }
 
-       switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_FLUSH)) {
+       switch (mark_cmd) {
        case FAN_MARK_ADD:
        case FAN_MARK_REMOVE:
                if (!mask)
@@ -1606,9 +1647,19 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
        if (mask & ~valid_mask)
                return -EINVAL;
 
-       /* Event flags (ONDIR, ON_CHILD) are meaningless in ignored mask */
-       if (ignored)
+
+       /* We don't allow FAN_MARK_IGNORE & FAN_MARK_IGNORED_MASK together */
+       if (ignore == (FAN_MARK_IGNORE | FAN_MARK_IGNORED_MASK))
+               return -EINVAL;
+
+       /*
+        * Event flags (FAN_ONDIR, FAN_EVENT_ON_CHILD) have no effect with
+        * FAN_MARK_IGNORED_MASK.
+        */
+       if (ignore == FAN_MARK_IGNORED_MASK) {
                mask &= ~FANOTIFY_EVENT_FLAGS;
+               umask = FANOTIFY_EVENT_FLAGS;
+       }
 
        f = fdget(fanotify_fd);
        if (unlikely(!f.file))
@@ -1672,7 +1723,7 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
        if (mask & FAN_RENAME && !(fid_mode & FAN_REPORT_NAME))
                goto fput_and_out;
 
-       if (flags & FAN_MARK_FLUSH) {
+       if (mark_cmd == FAN_MARK_FLUSH) {
                ret = 0;
                if (mark_type == FAN_MARK_MOUNT)
                        fsnotify_clear_vfsmount_marks_by_group(group);
@@ -1688,7 +1739,7 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
        if (ret)
                goto fput_and_out;
 
-       if (flags & FAN_MARK_ADD) {
+       if (mark_cmd == FAN_MARK_ADD) {
                ret = fanotify_events_supported(group, &path, mask, flags);
                if (ret)
                        goto path_put_and_out;
@@ -1712,6 +1763,13 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
        else
                mnt = path.mnt;
 
+       ret = mnt ? -EINVAL : -EISDIR;
+       /* FAN_MARK_IGNORE requires SURV_MODIFY for sb/mount/dir marks */
+       if (mark_cmd == FAN_MARK_ADD && ignore == FAN_MARK_IGNORE &&
+           (mnt || S_ISDIR(inode->i_mode)) &&
+           !(flags & FAN_MARK_IGNORED_SURV_MODIFY))
+               goto path_put_and_out;
+
        /* Mask out FAN_EVENT_ON_CHILD flag for sb/mount/non-dir marks */
        if (mnt || !S_ISDIR(inode->i_mode)) {
                mask &= ~FAN_EVENT_ON_CHILD;
@@ -1721,12 +1779,12 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
                 * events with parent/name info for non-directory.
                 */
                if ((fid_mode & FAN_REPORT_DIR_FID) &&
-                   (flags & FAN_MARK_ADD) && !ignored)
+                   (flags & FAN_MARK_ADD) && !ignore)
                        mask |= FAN_EVENT_ON_CHILD;
        }
 
        /* create/update an inode mark */
-       switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) {
+       switch (mark_cmd) {
        case FAN_MARK_ADD:
                if (mark_type == FAN_MARK_MOUNT)
                        ret = fanotify_add_vfsmount_mark(group, mnt, mask,
@@ -1804,7 +1862,7 @@ static int __init fanotify_user_setup(void)
 
        BUILD_BUG_ON(FANOTIFY_INIT_FLAGS & FANOTIFY_INTERNAL_GROUP_FLAGS);
        BUILD_BUG_ON(HWEIGHT32(FANOTIFY_INIT_FLAGS) != 12);
-       BUILD_BUG_ON(HWEIGHT32(FANOTIFY_MARK_FLAGS) != 10);
+       BUILD_BUG_ON(HWEIGHT32(FANOTIFY_MARK_FLAGS) != 11);
 
        fanotify_mark_cache = KMEM_CACHE(fsnotify_mark,
                                         SLAB_PANIC|SLAB_ACCOUNT);
index 59fb40abe33d373d433b39d1003948d750eb3ca4..55081ae3a6ec0d5ace8135e06f92184b4990d8c1 100644 (file)
@@ -113,7 +113,7 @@ static void fanotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
                        return;
                seq_printf(m, "fanotify ino:%lx sdev:%x mflags:%x mask:%x ignored_mask:%x ",
                           inode->i_ino, inode->i_sb->s_dev,
-                          mflags, mark->mask, mark->ignored_mask);
+                          mflags, mark->mask, mark->ignore_mask);
                show_mark_fhandle(m, inode);
                seq_putc(m, '\n');
                iput(inode);
@@ -121,12 +121,12 @@ static void fanotify_fdinfo(struct seq_file *m, struct fsnotify_mark *mark)
                struct mount *mnt = fsnotify_conn_mount(mark->connector);
 
                seq_printf(m, "fanotify mnt_id:%x mflags:%x mask:%x ignored_mask:%x\n",
-                          mnt->mnt_id, mflags, mark->mask, mark->ignored_mask);
+                          mnt->mnt_id, mflags, mark->mask, mark->ignore_mask);
        } else if (mark->connector->type == FSNOTIFY_OBJ_TYPE_SB) {
                struct super_block *sb = fsnotify_conn_sb(mark->connector);
 
                seq_printf(m, "fanotify sdev:%x mflags:%x mask:%x ignored_mask:%x\n",
-                          sb->s_dev, mflags, mark->mask, mark->ignored_mask);
+                          sb->s_dev, mflags, mark->mask, mark->ignore_mask);
        }
 }
 
index 0b3e74935cb4f07f7f8bcff5295f08d48854adad..7974e91ffe134f49d866bbc0ceb55a0ec1998897 100644 (file)
@@ -100,7 +100,7 @@ void fsnotify_sb_delete(struct super_block *sb)
  * Given an inode, first check if we care what happens to our children.  Inotify
  * and dnotify both tell their parents about events.  If we care about any event
  * on a child we run all of our children and set a dentry flag saying that the
- * parent cares.  Thus when an event happens on a child it can quickly tell if
+ * parent cares.  Thus when an event happens on a child it can quickly tell
  * if there is a need to find a parent and send the event to the parent.
  */
 void __fsnotify_update_child_dentry_flags(struct inode *inode)
@@ -324,7 +324,8 @@ static int send_to_group(__u32 mask, const void *data, int data_type,
        struct fsnotify_group *group = NULL;
        __u32 test_mask = (mask & ALL_FSNOTIFY_EVENTS);
        __u32 marks_mask = 0;
-       __u32 marks_ignored_mask = 0;
+       __u32 marks_ignore_mask = 0;
+       bool is_dir = mask & FS_ISDIR;
        struct fsnotify_mark *mark;
        int type;
 
@@ -336,7 +337,7 @@ static int send_to_group(__u32 mask, const void *data, int data_type,
                fsnotify_foreach_iter_mark_type(iter_info, mark, type) {
                        if (!(mark->flags &
                              FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY))
-                               mark->ignored_mask = 0;
+                               mark->ignore_mask = 0;
                }
        }
 
@@ -344,14 +345,15 @@ static int send_to_group(__u32 mask, const void *data, int data_type,
        fsnotify_foreach_iter_mark_type(iter_info, mark, type) {
                group = mark->group;
                marks_mask |= mark->mask;
-               marks_ignored_mask |= mark->ignored_mask;
+               marks_ignore_mask |=
+                       fsnotify_effective_ignore_mask(mark, is_dir, type);
        }
 
-       pr_debug("%s: group=%p mask=%x marks_mask=%x marks_ignored_mask=%x data=%p data_type=%d dir=%p cookie=%d\n",
-                __func__, group, mask, marks_mask, marks_ignored_mask,
+       pr_debug("%s: group=%p mask=%x marks_mask=%x marks_ignore_mask=%x data=%p data_type=%d dir=%p cookie=%d\n",
+                __func__, group, mask, marks_mask, marks_ignore_mask,
                 data, data_type, dir, cookie);
 
-       if (!(test_mask & marks_mask & ~marks_ignored_mask))
+       if (!(test_mask & marks_mask & ~marks_ignore_mask))
                return 0;
 
        if (group->ops->handle_event) {
@@ -423,7 +425,8 @@ static bool fsnotify_iter_select_report_types(
                         * But is *this mark* watching children?
                         */
                        if (type == FSNOTIFY_ITER_TYPE_PARENT &&
-                           !(mark->mask & FS_EVENT_ON_CHILD))
+                           !(mark->mask & FS_EVENT_ON_CHILD) &&
+                           !(fsnotify_ignore_mask(mark) & FS_EVENT_ON_CHILD))
                                continue;
 
                        fsnotify_iter_set_report_type(iter_info, type);
@@ -532,8 +535,8 @@ int fsnotify(__u32 mask, const void *data, int data_type, struct inode *dir,
 
 
        /*
-        * If this is a modify event we may need to clear some ignored masks.
-        * In that case, the object with ignored masks will have the FS_MODIFY
+        * If this is a modify event we may need to clear some ignore masks.
+        * In that case, the object with ignore masks will have the FS_MODIFY
         * event in its mask.
         * Otherwise, return if none of the marks care about this type of event.
         */
index ed42a189faa25d32f46c590ac3f1cd53a17fb7d6..1c4bfdab008d9b4232cdbf5604bf42f87f5288eb 100644 (file)
@@ -136,7 +136,7 @@ static inline u32 inotify_mask_to_arg(__u32 mask)
                       IN_Q_OVERFLOW);
 }
 
-/* intofiy userspace file descriptor functions */
+/* inotify userspace file descriptor functions */
 static __poll_t inotify_poll(struct file *file, poll_table *wait)
 {
        struct fsnotify_group *group = file->private_data;
index 4de597a83b88dd717459b33ff4c363888f72de60..52615e6090e1c80cbc9c326a54cc9003ba9daf1f 100644 (file)
@@ -592,8 +592,12 @@ static int ntfs_attr_find(const ATTR_TYPE type, const ntfschar *name,
                a = (ATTR_RECORD*)((u8*)ctx->attr +
                                le32_to_cpu(ctx->attr->length));
        for (;; a = (ATTR_RECORD*)((u8*)a + le32_to_cpu(a->length))) {
-               if ((u8*)a < (u8*)ctx->mrec || (u8*)a > (u8*)ctx->mrec +
-                               le32_to_cpu(ctx->mrec->bytes_allocated))
+               u8 *mrec_end = (u8 *)ctx->mrec +
+                              le32_to_cpu(ctx->mrec->bytes_allocated);
+               u8 *name_end = (u8 *)a + le16_to_cpu(a->name_offset) +
+                              a->name_length * sizeof(ntfschar);
+               if ((u8*)a < (u8*)ctx->mrec || (u8*)a > mrec_end ||
+                   name_end > mrec_end)
                        break;
                ctx->attr = a;
                if (unlikely(le32_to_cpu(a->type) > le32_to_cpu(type) ||
index 7497cd59225861d4521df92e83b25277e02b09e3..9c67edd215d5ae70c50827ec6d6cc11527cac1ff 100644 (file)
@@ -1146,7 +1146,7 @@ int ocfs2_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        if (status)
                return status;
 
-       if (is_quota_modification(inode, attr)) {
+       if (is_quota_modification(mnt_userns, inode, attr)) {
                status = dquot_initialize(inode);
                if (status)
                        return status;
index 3375275714612663b759fd676270ab6067071b32..740b64238312733c81ec4b89cfe1da106c37bc65 100644 (file)
@@ -277,7 +277,6 @@ enum ocfs2_mount_options
        OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT = 1 << 15,  /* Journal Async Commit */
        OCFS2_MOUNT_ERRORS_CONT = 1 << 16, /* Return EIO to the calling process on error */
        OCFS2_MOUNT_ERRORS_ROFS = 1 << 17, /* Change filesystem to read-only on error */
-       OCFS2_MOUNT_NOCLUSTER = 1 << 18, /* No cluster aware filesystem mount */
 };
 
 #define OCFS2_OSB_SOFT_RO      0x0001
@@ -673,8 +672,7 @@ static inline int ocfs2_cluster_o2cb_global_heartbeat(struct ocfs2_super *osb)
 
 static inline int ocfs2_mount_local(struct ocfs2_super *osb)
 {
-       return ((osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT)
-               || (osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER));
+       return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT);
 }
 
 static inline int ocfs2_uses_extended_slot_map(struct ocfs2_super *osb)
index 0b0ae3ebb0cf5ea2e5ce5cfb4547e1f16238a117..da7718cef735e53e08539f152677042bbf71ad1a 100644 (file)
@@ -252,16 +252,14 @@ static int __ocfs2_find_empty_slot(struct ocfs2_slot_info *si,
        int i, ret = -ENOSPC;
 
        if ((preferred >= 0) && (preferred < si->si_num_slots)) {
-               if (!si->si_slots[preferred].sl_valid ||
-                   !si->si_slots[preferred].sl_node_num) {
+               if (!si->si_slots[preferred].sl_valid) {
                        ret = preferred;
                        goto out;
                }
        }
 
        for(i = 0; i < si->si_num_slots; i++) {
-               if (!si->si_slots[i].sl_valid ||
-                   !si->si_slots[i].sl_node_num) {
+               if (!si->si_slots[i].sl_valid) {
                        ret = i;
                        break;
                }
@@ -456,30 +454,24 @@ int ocfs2_find_slot(struct ocfs2_super *osb)
        spin_lock(&osb->osb_lock);
        ocfs2_update_slot_info(si);
 
-       if (ocfs2_mount_local(osb))
-               /* use slot 0 directly in local mode */
-               slot = 0;
-       else {
-               /* search for ourselves first and take the slot if it already
-                * exists. Perhaps we need to mark this in a variable for our
-                * own journal recovery? Possibly not, though we certainly
-                * need to warn to the user */
-               slot = __ocfs2_node_num_to_slot(si, osb->node_num);
+       /* search for ourselves first and take the slot if it already
+        * exists. Perhaps we need to mark this in a variable for our
+        * own journal recovery? Possibly not, though we certainly
+        * need to warn to the user */
+       slot = __ocfs2_node_num_to_slot(si, osb->node_num);
+       if (slot < 0) {
+               /* if no slot yet, then just take 1st available
+                * one. */
+               slot = __ocfs2_find_empty_slot(si, osb->preferred_slot);
                if (slot < 0) {
-                       /* if no slot yet, then just take 1st available
-                        * one. */
-                       slot = __ocfs2_find_empty_slot(si, osb->preferred_slot);
-                       if (slot < 0) {
-                               spin_unlock(&osb->osb_lock);
-                               mlog(ML_ERROR, "no free slots available!\n");
-                               status = -EINVAL;
-                               goto bail;
-                       }
-               } else
-                       printk(KERN_INFO "ocfs2: Slot %d on device (%s) was "
-                              "already allocated to this node!\n",
-                              slot, osb->dev_str);
-       }
+                       spin_unlock(&osb->osb_lock);
+                       mlog(ML_ERROR, "no free slots available!\n");
+                       status = -EINVAL;
+                       goto bail;
+               }
+       } else
+               printk(KERN_INFO "ocfs2: Slot %d on device (%s) was already "
+                      "allocated to this node!\n", slot, osb->dev_str);
 
        ocfs2_set_slot(si, slot, osb->node_num);
        osb->slot_num = slot;
index f7298816d8d9ba4dbf3bc667e55653a1e50b7cdc..438be028935d2e6960729f29b20d534a87076c28 100644 (file)
@@ -172,7 +172,6 @@ enum {
        Opt_dir_resv_level,
        Opt_journal_async_commit,
        Opt_err_cont,
-       Opt_nocluster,
        Opt_err,
 };
 
@@ -206,7 +205,6 @@ static const match_table_t tokens = {
        {Opt_dir_resv_level, "dir_resv_level=%u"},
        {Opt_journal_async_commit, "journal_async_commit"},
        {Opt_err_cont, "errors=continue"},
-       {Opt_nocluster, "nocluster"},
        {Opt_err, NULL}
 };
 
@@ -618,13 +616,6 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
                goto out;
        }
 
-       tmp = OCFS2_MOUNT_NOCLUSTER;
-       if ((osb->s_mount_opt & tmp) != (parsed_options.mount_opt & tmp)) {
-               ret = -EINVAL;
-               mlog(ML_ERROR, "Cannot change nocluster option on remount\n");
-               goto out;
-       }
-
        tmp = OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL |
                OCFS2_MOUNT_HB_NONE;
        if ((osb->s_mount_opt & tmp) != (parsed_options.mount_opt & tmp)) {
@@ -865,7 +856,6 @@ static int ocfs2_verify_userspace_stack(struct ocfs2_super *osb,
        }
 
        if (ocfs2_userspace_stack(osb) &&
-           !(osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER) &&
            strncmp(osb->osb_cluster_stack, mopt->cluster_stack,
                    OCFS2_STACK_LABEL_LEN)) {
                mlog(ML_ERROR,
@@ -1137,11 +1127,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
               osb->s_mount_opt & OCFS2_MOUNT_DATA_WRITEBACK ? "writeback" :
               "ordered");
 
-       if ((osb->s_mount_opt & OCFS2_MOUNT_NOCLUSTER) &&
-          !(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT))
-               printk(KERN_NOTICE "ocfs2: The shared device (%s) is mounted "
-                      "without cluster aware mode.\n", osb->dev_str);
-
        atomic_set(&osb->vol_state, VOLUME_MOUNTED);
        wake_up(&osb->osb_mount_event);
 
@@ -1452,9 +1437,6 @@ static int ocfs2_parse_options(struct super_block *sb,
                case Opt_journal_async_commit:
                        mopt->mount_opt |= OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT;
                        break;
-               case Opt_nocluster:
-                       mopt->mount_opt |= OCFS2_MOUNT_NOCLUSTER;
-                       break;
                default:
                        mlog(ML_ERROR,
                             "Unrecognized mount option \"%s\" "
@@ -1566,9 +1548,6 @@ static int ocfs2_show_options(struct seq_file *s, struct dentry *root)
        if (opts & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
                seq_printf(s, ",journal_async_commit");
 
-       if (opts & OCFS2_MOUNT_NOCLUSTER)
-               seq_printf(s, ",nocluster");
-
        return 0;
 }
 
index 1d57fbde2feb1c27e7bd059731abb31477eb6ba4..2790aac66e58e05095d6ce88de2d4edfd521460b 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -663,6 +663,42 @@ SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode)
        return do_fchmodat(AT_FDCWD, filename, mode);
 }
 
+/**
+ * setattr_vfsuid - check and set ia_fsuid attribute
+ * @kuid: new inode owner
+ *
+ * Check whether @kuid is valid and if so generate and set vfsuid_t in
+ * ia_vfsuid.
+ *
+ * Return: true if @kuid is valid, false if not.
+ */
+static inline bool setattr_vfsuid(struct iattr *attr, kuid_t kuid)
+{
+       if (!uid_valid(kuid))
+               return false;
+       attr->ia_valid |= ATTR_UID;
+       attr->ia_vfsuid = VFSUIDT_INIT(kuid);
+       return true;
+}
+
+/**
+ * setattr_vfsgid - check and set ia_fsgid attribute
+ * @kgid: new inode owner
+ *
+ * Check whether @kgid is valid and if so generate and set vfsgid_t in
+ * ia_vfsgid.
+ *
+ * Return: true if @kgid is valid, false if not.
+ */
+static inline bool setattr_vfsgid(struct iattr *attr, kgid_t kgid)
+{
+       if (!gid_valid(kgid))
+               return false;
+       attr->ia_valid |= ATTR_GID;
+       attr->ia_vfsgid = VFSGIDT_INIT(kgid);
+       return true;
+}
+
 int chown_common(const struct path *path, uid_t user, gid_t group)
 {
        struct user_namespace *mnt_userns, *fs_userns;
@@ -678,28 +714,22 @@ int chown_common(const struct path *path, uid_t user, gid_t group)
 
        mnt_userns = mnt_user_ns(path->mnt);
        fs_userns = i_user_ns(inode);
-       uid = mapped_kuid_user(mnt_userns, fs_userns, uid);
-       gid = mapped_kgid_user(mnt_userns, fs_userns, gid);
 
 retry_deleg:
        newattrs.ia_valid =  ATTR_CTIME;
-       if (user != (uid_t) -1) {
-               if (!uid_valid(uid))
-                       return -EINVAL;
-               newattrs.ia_valid |= ATTR_UID;
-               newattrs.ia_uid = uid;
-       }
-       if (group != (gid_t) -1) {
-               if (!gid_valid(gid))
-                       return -EINVAL;
-               newattrs.ia_valid |= ATTR_GID;
-               newattrs.ia_gid = gid;
-       }
+       if ((user != (uid_t)-1) && !setattr_vfsuid(&newattrs, uid))
+               return -EINVAL;
+       if ((group != (gid_t)-1) && !setattr_vfsgid(&newattrs, gid))
+               return -EINVAL;
        if (!S_ISDIR(inode->i_mode))
                newattrs.ia_valid |=
                        ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
        inode_lock(inode);
-       error = security_path_chown(path, uid, gid);
+       /* Continue to send actual fs values, not the mount values. */
+       error = security_path_chown(
+               path,
+               from_vfsuid(mnt_userns, fs_userns, newattrs.ia_vfsuid),
+               from_vfsgid(mnt_userns, fs_userns, newattrs.ia_vfsgid));
        if (!error)
                error = notify_change(mnt_userns, path->dentry, &newattrs,
                                      &delegated_inode);
index 714ec569d25b31129831418d5f58a1d525580e0f..245e2cb627080d32d3af6e71aa9a8050de8b907d 100644 (file)
@@ -331,8 +331,8 @@ int ovl_set_attr(struct ovl_fs *ofs, struct dentry *upperdentry,
        if (!err) {
                struct iattr attr = {
                        .ia_valid = ATTR_UID | ATTR_GID,
-                       .ia_uid = stat->uid,
-                       .ia_gid = stat->gid,
+                       .ia_vfsuid = VFSUIDT_INIT(stat->uid),
+                       .ia_vfsgid = VFSGIDT_INIT(stat->gid),
                };
                err = ovl_do_notify_change(ofs, upperdentry, &attr);
        }
index 492eddeb481f3b8aa8b6e1b2feefb287ccfda481..7922b619f6c8b9f125804c58793fbe941aa8146a 100644 (file)
@@ -454,23 +454,94 @@ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size)
        return res;
 }
 
+/*
+ * Apply the idmapping of the layer to POSIX ACLs. The caller must pass a clone
+ * of the POSIX ACLs retrieved from the lower layer to this function to not
+ * alter the POSIX ACLs for the underlying filesystem.
+ */
+static void ovl_idmap_posix_acl(struct user_namespace *mnt_userns,
+                               struct posix_acl *acl)
+{
+       for (unsigned int i = 0; i < acl->a_count; i++) {
+               vfsuid_t vfsuid;
+               vfsgid_t vfsgid;
+
+               struct posix_acl_entry *e = &acl->a_entries[i];
+               switch (e->e_tag) {
+               case ACL_USER:
+                       vfsuid = make_vfsuid(mnt_userns, &init_user_ns, e->e_uid);
+                       e->e_uid = vfsuid_into_kuid(vfsuid);
+                       break;
+               case ACL_GROUP:
+                       vfsgid = make_vfsgid(mnt_userns, &init_user_ns, e->e_gid);
+                       e->e_gid = vfsgid_into_kgid(vfsgid);
+                       break;
+               }
+       }
+}
+
+/*
+ * When the relevant layer is an idmapped mount we need to take the idmapping
+ * of the layer into account and translate any ACL_{GROUP,USER} values
+ * according to the idmapped mount.
+ *
+ * We cannot alter the ACLs returned from the relevant layer as that would
+ * alter the cached values filesystem wide for the lower filesystem. Instead we
+ * can clone the ACLs and then apply the relevant idmapping of the layer.
+ *
+ * This is obviously only relevant when idmapped layers are used.
+ */
 struct posix_acl *ovl_get_acl(struct inode *inode, int type, bool rcu)
 {
        struct inode *realinode = ovl_inode_real(inode);
-       const struct cred *old_cred;
-       struct posix_acl *acl;
+       struct posix_acl *acl, *clone;
+       struct path realpath;
 
        if (!IS_ENABLED(CONFIG_FS_POSIX_ACL) || !IS_POSIXACL(realinode))
                return NULL;
 
-       if (rcu)
-               return get_cached_acl_rcu(realinode, type);
+       /* Careful in RCU walk mode */
+       ovl_i_path_real(inode, &realpath);
+       if (!realpath.dentry) {
+               WARN_ON(!rcu);
+               return ERR_PTR(-ECHILD);
+       }
 
-       old_cred = ovl_override_creds(inode->i_sb);
-       acl = get_acl(realinode, type);
-       revert_creds(old_cred);
+       if (rcu) {
+               acl = get_cached_acl_rcu(realinode, type);
+       } else {
+               const struct cred *old_cred;
+
+               old_cred = ovl_override_creds(inode->i_sb);
+               acl = get_acl(realinode, type);
+               revert_creds(old_cred);
+       }
+       /*
+        * If there are no POSIX ACLs, or we encountered an error,
+        * or the layer isn't idmapped we don't need to do anything.
+        */
+       if (!is_idmapped_mnt(realpath.mnt) || IS_ERR_OR_NULL(acl))
+               return acl;
 
-       return acl;
+       /*
+        * We only get here if the layer is idmapped. So drop out of RCU path
+        * walk so we can clone the ACLs. There's no need to release the ACLs
+        * since get_cached_acl_rcu() doesn't take a reference on the ACLs.
+        */
+       if (rcu)
+               return ERR_PTR(-ECHILD);
+
+       clone = posix_acl_clone(acl, GFP_KERNEL);
+       if (!clone)
+               clone = ERR_PTR(-ENOMEM);
+       else
+               ovl_idmap_posix_acl(mnt_user_ns(realpath.mnt), clone);
+       /*
+        * Since we're not in RCU path walk we always need to release the
+        * original ACLs.
+        */
+       posix_acl_release(acl);
+       return clone;
 }
 
 int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags)
index 4f34b7e02eeeb5659345c7929afa147646a4f594..6ec815b84d4880acb01aa7fc66cfdd424fe15938 100644 (file)
@@ -139,17 +139,7 @@ static inline int ovl_do_notify_change(struct ovl_fs *ofs,
                                       struct dentry *upperdentry,
                                       struct iattr *attr)
 {
-       struct user_namespace *upper_mnt_userns = ovl_upper_mnt_userns(ofs);
-       struct user_namespace *fs_userns = i_user_ns(d_inode(upperdentry));
-
-       if (attr->ia_valid & ATTR_UID)
-               attr->ia_uid = mapped_kuid_user(upper_mnt_userns,
-                                               fs_userns, attr->ia_uid);
-       if (attr->ia_valid & ATTR_GID)
-               attr->ia_gid = mapped_kgid_user(upper_mnt_userns,
-                                               fs_userns, attr->ia_gid);
-
-       return notify_change(upper_mnt_userns, upperdentry, attr, NULL);
+       return notify_change(ovl_upper_mnt_userns(ofs), upperdentry, attr, NULL);
 }
 
 static inline int ovl_do_rmdir(struct ovl_fs *ofs,
@@ -259,7 +249,8 @@ static inline int ovl_do_setxattr(struct ovl_fs *ofs, struct dentry *dentry,
                                  const char *name, const void *value,
                                  size_t size, int flags)
 {
-       int err = vfs_setxattr(ovl_upper_mnt_userns(ofs), dentry, name, value, size, flags);
+       int err = vfs_setxattr(ovl_upper_mnt_userns(ofs), dentry, name,
+                              (void *)value, size, flags);
 
        pr_debug("setxattr(%pd2, \"%s\", \"%*pE\", %zu, %d) = %i\n",
                 dentry, name, min((int)size, 48), value, size, flags, err);
index 1ce5c9698393731229d0a083cc1d7b4bad51c1e5..e0a2e0468ee7f1e4bb668df4a9d13cea9d34082b 100644 (file)
@@ -1003,9 +1003,6 @@ ovl_posix_acl_xattr_get(const struct xattr_handler *handler,
                        struct dentry *dentry, struct inode *inode,
                        const char *name, void *buffer, size_t size)
 {
-       if (!IS_POSIXACL(inode))
-               return -EOPNOTSUPP;
-
        return ovl_xattr_get(dentry, inode, handler->name, buffer, size);
 }
 
@@ -1021,9 +1018,6 @@ ovl_posix_acl_xattr_set(const struct xattr_handler *handler,
        struct posix_acl *acl = NULL;
        int err;
 
-       if (!IS_POSIXACL(inode))
-               return -EOPNOTSUPP;
-
        /* Check that everything is OK before copy-up */
        if (value) {
                acl = posix_acl_from_xattr(&init_user_ns, value, size);
@@ -1966,20 +1960,6 @@ static struct dentry *ovl_get_root(struct super_block *sb,
        return root;
 }
 
-static bool ovl_has_idmapped_layers(struct ovl_fs *ofs)
-{
-
-       unsigned int i;
-       const struct vfsmount *mnt;
-
-       for (i = 0; i < ofs->numlayer; i++) {
-               mnt = ofs->layers[i].mnt;
-               if (mnt && is_idmapped_mnt(mnt))
-                       return true;
-       }
-       return false;
-}
-
 static int ovl_fill_super(struct super_block *sb, void *data, int silent)
 {
        struct path upperpath = { };
@@ -2149,10 +2129,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
        sb->s_xattr = ofs->config.userxattr ? ovl_user_xattr_handlers :
                ovl_trusted_xattr_handlers;
        sb->s_fs_info = ofs;
-       if (ovl_has_idmapped_layers(ofs))
-               pr_warn("POSIX ACLs are not yet supported with idmapped layers, mounting without ACL support.\n");
-       else
-               sb->s_flags |= SB_POSIXACL;
+       sb->s_flags |= SB_POSIXACL;
        sb->s_iflags |= SB_I_SKIP_SYNC;
 
        err = -ENOMEM;
index 962d32468eb487afd42a14da7afd7589aaeaac98..1d17d7b13dcd0c2f0d8a26c38f9024eb084b6d39 100644 (file)
@@ -199,7 +199,7 @@ EXPORT_SYMBOL(posix_acl_alloc);
 /*
  * Clone an ACL.
  */
-static struct posix_acl *
+struct posix_acl *
 posix_acl_clone(const struct posix_acl *acl, gfp_t flags)
 {
        struct posix_acl *clone = NULL;
@@ -213,6 +213,7 @@ posix_acl_clone(const struct posix_acl *acl, gfp_t flags)
        }
        return clone;
 }
+EXPORT_SYMBOL_GPL(posix_acl_clone);
 
 /*
  * Check if an acl is valid. Returns 0 if it is, or -E... otherwise.
@@ -361,8 +362,8 @@ posix_acl_permission(struct user_namespace *mnt_userns, struct inode *inode,
 {
        const struct posix_acl_entry *pa, *pe, *mask_obj;
        int found = 0;
-       kuid_t uid;
-       kgid_t gid;
+       vfsuid_t vfsuid;
+       vfsgid_t vfsgid;
 
        want &= MAY_READ | MAY_WRITE | MAY_EXEC;
 
@@ -370,30 +371,28 @@ posix_acl_permission(struct user_namespace *mnt_userns, struct inode *inode,
                 switch(pa->e_tag) {
                         case ACL_USER_OBJ:
                                /* (May have been checked already) */
-                               uid = i_uid_into_mnt(mnt_userns, inode);
-                               if (uid_eq(uid, current_fsuid()))
+                               vfsuid = i_uid_into_vfsuid(mnt_userns, inode);
+                               if (vfsuid_eq_kuid(vfsuid, current_fsuid()))
                                         goto check_perm;
                                 break;
                         case ACL_USER:
-                               uid = mapped_kuid_fs(mnt_userns,
-                                                    i_user_ns(inode),
+                               vfsuid = make_vfsuid(mnt_userns, &init_user_ns,
                                                     pa->e_uid);
-                               if (uid_eq(uid, current_fsuid()))
+                               if (vfsuid_eq_kuid(vfsuid, current_fsuid()))
                                         goto mask;
                                break;
                         case ACL_GROUP_OBJ:
-                               gid = i_gid_into_mnt(mnt_userns, inode);
-                               if (in_group_p(gid)) {
+                               vfsgid = i_gid_into_vfsgid(mnt_userns, inode);
+                               if (vfsgid_in_group_p(vfsgid)) {
                                        found = 1;
                                        if ((pa->e_perm & want) == want)
                                                goto mask;
                                 }
                                break;
                         case ACL_GROUP:
-                               gid = mapped_kgid_fs(mnt_userns,
-                                                    i_user_ns(inode),
+                               vfsgid = make_vfsgid(mnt_userns, &init_user_ns,
                                                     pa->e_gid);
-                               if (in_group_p(gid)) {
+                               if (vfsgid_in_group_p(vfsgid)) {
                                        found = 1;
                                        if ((pa->e_perm & want) == want)
                                                goto mask;
@@ -699,7 +698,7 @@ int posix_acl_update_mode(struct user_namespace *mnt_userns,
                return error;
        if (error == 0)
                *acl = NULL;
-       if (!in_group_p(i_gid_into_mnt(mnt_userns, inode)) &&
+       if (!vfsgid_in_group_p(i_gid_into_vfsgid(mnt_userns, inode)) &&
            !capable_wrt_inode_uidgid(mnt_userns, inode, CAP_FSETID))
                mode &= ~S_ISGID;
        *mode_p = mode;
@@ -710,46 +709,127 @@ EXPORT_SYMBOL(posix_acl_update_mode);
 /*
  * Fix up the uids and gids in posix acl extended attributes in place.
  */
-static void posix_acl_fix_xattr_userns(
-       struct user_namespace *to, struct user_namespace *from,
-       struct user_namespace *mnt_userns,
-       void *value, size_t size, bool from_user)
+static int posix_acl_fix_xattr_common(void *value, size_t size)
+{
+       struct posix_acl_xattr_header *header = value;
+       int count;
+
+       if (!header)
+               return -EINVAL;
+       if (size < sizeof(struct posix_acl_xattr_header))
+               return -EINVAL;
+       if (header->a_version != cpu_to_le32(POSIX_ACL_XATTR_VERSION))
+               return -EINVAL;
+
+       count = posix_acl_xattr_count(size);
+       if (count < 0)
+               return -EINVAL;
+       if (count == 0)
+               return -EINVAL;
+
+       return count;
+}
+
+void posix_acl_getxattr_idmapped_mnt(struct user_namespace *mnt_userns,
+                                    const struct inode *inode,
+                                    void *value, size_t size)
 {
        struct posix_acl_xattr_header *header = value;
        struct posix_acl_xattr_entry *entry = (void *)(header + 1), *end;
        int count;
+       vfsuid_t vfsuid;
+       vfsgid_t vfsgid;
        kuid_t uid;
        kgid_t gid;
 
-       if (!value)
+       if (no_idmapping(mnt_userns, i_user_ns(inode)))
                return;
-       if (size < sizeof(struct posix_acl_xattr_header))
+
+       count = posix_acl_fix_xattr_common(value, size);
+       if (count < 0)
                return;
-       if (header->a_version != cpu_to_le32(POSIX_ACL_XATTR_VERSION))
+
+       for (end = entry + count; entry != end; entry++) {
+               switch (le16_to_cpu(entry->e_tag)) {
+               case ACL_USER:
+                       uid = make_kuid(&init_user_ns, le32_to_cpu(entry->e_id));
+                       vfsuid = make_vfsuid(mnt_userns, &init_user_ns, uid);
+                       entry->e_id = cpu_to_le32(from_kuid(&init_user_ns,
+                                               vfsuid_into_kuid(vfsuid)));
+                       break;
+               case ACL_GROUP:
+                       gid = make_kgid(&init_user_ns, le32_to_cpu(entry->e_id));
+                       vfsgid = make_vfsgid(mnt_userns, &init_user_ns, gid);
+                       entry->e_id = cpu_to_le32(from_kgid(&init_user_ns,
+                                               vfsgid_into_kgid(vfsgid)));
+                       break;
+               default:
+                       break;
+               }
+       }
+}
+
+void posix_acl_setxattr_idmapped_mnt(struct user_namespace *mnt_userns,
+                                    const struct inode *inode,
+                                    void *value, size_t size)
+{
+       struct posix_acl_xattr_header *header = value;
+       struct posix_acl_xattr_entry *entry = (void *)(header + 1), *end;
+       int count;
+       vfsuid_t vfsuid;
+       vfsgid_t vfsgid;
+       kuid_t uid;
+       kgid_t gid;
+
+       if (no_idmapping(mnt_userns, i_user_ns(inode)))
                return;
 
-       count = posix_acl_xattr_count(size);
+       count = posix_acl_fix_xattr_common(value, size);
        if (count < 0)
                return;
-       if (count == 0)
+
+       for (end = entry + count; entry != end; entry++) {
+               switch (le16_to_cpu(entry->e_tag)) {
+               case ACL_USER:
+                       uid = make_kuid(&init_user_ns, le32_to_cpu(entry->e_id));
+                       vfsuid = VFSUIDT_INIT(uid);
+                       uid = from_vfsuid(mnt_userns, &init_user_ns, vfsuid);
+                       entry->e_id = cpu_to_le32(from_kuid(&init_user_ns, uid));
+                       break;
+               case ACL_GROUP:
+                       gid = make_kgid(&init_user_ns, le32_to_cpu(entry->e_id));
+                       vfsgid = VFSGIDT_INIT(gid);
+                       gid = from_vfsgid(mnt_userns, &init_user_ns, vfsgid);
+                       entry->e_id = cpu_to_le32(from_kgid(&init_user_ns, gid));
+                       break;
+               default:
+                       break;
+               }
+       }
+}
+
+static void posix_acl_fix_xattr_userns(
+       struct user_namespace *to, struct user_namespace *from,
+       void *value, size_t size)
+{
+       struct posix_acl_xattr_header *header = value;
+       struct posix_acl_xattr_entry *entry = (void *)(header + 1), *end;
+       int count;
+       kuid_t uid;
+       kgid_t gid;
+
+       count = posix_acl_fix_xattr_common(value, size);
+       if (count < 0)
                return;
 
        for (end = entry + count; entry != end; entry++) {
                switch(le16_to_cpu(entry->e_tag)) {
                case ACL_USER:
                        uid = make_kuid(from, le32_to_cpu(entry->e_id));
-                       if (from_user)
-                               uid = mapped_kuid_user(mnt_userns, &init_user_ns, uid);
-                       else
-                               uid = mapped_kuid_fs(mnt_userns, &init_user_ns, uid);
                        entry->e_id = cpu_to_le32(from_kuid(to, uid));
                        break;
                case ACL_GROUP:
                        gid = make_kgid(from, le32_to_cpu(entry->e_id));
-                       if (from_user)
-                               gid = mapped_kgid_user(mnt_userns, &init_user_ns, gid);
-                       else
-                               gid = mapped_kgid_fs(mnt_userns, &init_user_ns, gid);
                        entry->e_id = cpu_to_le32(from_kgid(to, gid));
                        break;
                default:
@@ -758,34 +838,20 @@ static void posix_acl_fix_xattr_userns(
        }
 }
 
-void posix_acl_fix_xattr_from_user(struct user_namespace *mnt_userns,
-                                  struct inode *inode,
-                                  void *value, size_t size)
+void posix_acl_fix_xattr_from_user(void *value, size_t size)
 {
        struct user_namespace *user_ns = current_user_ns();
-
-       /* Leave ids untouched on non-idmapped mounts. */
-       if (no_idmapping(mnt_userns, i_user_ns(inode)))
-               mnt_userns = &init_user_ns;
-       if ((user_ns == &init_user_ns) && (mnt_userns == &init_user_ns))
+       if (user_ns == &init_user_ns)
                return;
-       posix_acl_fix_xattr_userns(&init_user_ns, user_ns, mnt_userns, value,
-                                  size, true);
+       posix_acl_fix_xattr_userns(&init_user_ns, user_ns, value, size);
 }
 
-void posix_acl_fix_xattr_to_user(struct user_namespace *mnt_userns,
-                                struct inode *inode,
-                                void *value, size_t size)
+void posix_acl_fix_xattr_to_user(void *value, size_t size)
 {
        struct user_namespace *user_ns = current_user_ns();
-
-       /* Leave ids untouched on non-idmapped mounts. */
-       if (no_idmapping(mnt_userns, i_user_ns(inode)))
-               mnt_userns = &init_user_ns;
-       if ((user_ns == &init_user_ns) && (mnt_userns == &init_user_ns))
+       if (user_ns == &init_user_ns)
                return;
-       posix_acl_fix_xattr_userns(user_ns, &init_user_ns, mnt_userns, value,
-                                  size, false);
+       posix_acl_fix_xattr_userns(user_ns, &init_user_ns, value, size);
 }
 
 /*
index 09d1307959d085720769839b95f5c99f0478de78..28966da7834ea254d1c23e3526917520b388b570 100644 (file)
@@ -2085,7 +2085,8 @@ EXPORT_SYMBOL(__dquot_transfer);
 /* Wrapper for transferring ownership of an inode for uid/gid only
  * Called from FSXXX_setattr()
  */
-int dquot_transfer(struct inode *inode, struct iattr *iattr)
+int dquot_transfer(struct user_namespace *mnt_userns, struct inode *inode,
+                  struct iattr *iattr)
 {
        struct dquot *transfer_to[MAXQUOTAS] = {};
        struct dquot *dquot;
@@ -2095,8 +2096,11 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
        if (!dquot_active(inode))
                return 0;
 
-       if (iattr->ia_valid & ATTR_UID && !uid_eq(iattr->ia_uid, inode->i_uid)){
-               dquot = dqget(sb, make_kqid_uid(iattr->ia_uid));
+       if (i_uid_needs_update(mnt_userns, iattr, inode)) {
+               kuid_t kuid = from_vfsuid(mnt_userns, i_user_ns(inode),
+                                         iattr->ia_vfsuid);
+
+               dquot = dqget(sb, make_kqid_uid(kuid));
                if (IS_ERR(dquot)) {
                        if (PTR_ERR(dquot) != -ESRCH) {
                                ret = PTR_ERR(dquot);
@@ -2106,8 +2110,11 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
                }
                transfer_to[USRQUOTA] = dquot;
        }
-       if (iattr->ia_valid & ATTR_GID && !gid_eq(iattr->ia_gid, inode->i_gid)){
-               dquot = dqget(sb, make_kqid_gid(iattr->ia_gid));
+       if (i_gid_needs_update(mnt_userns, iattr, inode)) {
+               kgid_t kgid = from_vfsgid(mnt_userns, i_user_ns(inode),
+                                         iattr->ia_vfsgid);
+
+               dquot = dqget(sb, make_kqid_gid(kgid));
                if (IS_ERR(dquot)) {
                        if (PTR_ERR(dquot) != -ESRCH) {
                                ret = PTR_ERR(dquot);
index e0777eefd84650debb0bed304401f81d8ccb1c8e..397da0236607ee10c90b4b2a02d9183813d203f9 100644 (file)
@@ -1263,6 +1263,9 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
                                          count, fl);
                file_end_write(out.file);
        } else {
+               if (out.file->f_flags & O_NONBLOCK)
+                       fl |= SPLICE_F_NONBLOCK;
+
                retval = splice_file_to_pipe(in.file, opipe, &pos, count, fl);
        }
 
index 0cffe054b78e16f5a23bb7ada98eb73c518874cb..0df48d17673270413e9ebb547fb1d833ea13254e 100644 (file)
@@ -290,7 +290,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
        struct buffer_head *bh;
        struct item_head *ih, tmp_ih;
        b_blocknr_t blocknr;
-       char *p = NULL;
+       char *p;
        int chars;
        int ret;
        int result;
@@ -305,8 +305,6 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
        result = search_for_position_by_key(inode->i_sb, &key, &path);
        if (result != POSITION_FOUND) {
                pathrelse(&path);
-               if (p)
-                       kunmap(bh_result->b_page);
                if (result == IO_ERROR)
                        return -EIO;
                /*
@@ -352,8 +350,6 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
                }
 
                pathrelse(&path);
-               if (p)
-                       kunmap(bh_result->b_page);
                return ret;
        }
        /* requested data are in direct item(s) */
@@ -363,8 +359,6 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
                 * when it is stored in direct item(s)
                 */
                pathrelse(&path);
-               if (p)
-                       kunmap(bh_result->b_page);
                return -ENOENT;
        }
 
@@ -396,9 +390,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block,
         * sure we need to.  But, this means the item might move if
         * kmap schedules
         */
-       if (!p)
-               p = (char *)kmap(bh_result->b_page);
-
+       p = (char *)kmap(bh_result->b_page);
        p += offset;
        memset(p, 0, inode->i_sb->s_blocksize);
        do {
@@ -3284,7 +3276,7 @@ int reiserfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        /* must be turned off for recursive notify_change calls */
        ia_valid = attr->ia_valid &= ~(ATTR_KILL_SUID|ATTR_KILL_SGID);
 
-       if (is_quota_modification(inode, attr)) {
+       if (is_quota_modification(mnt_userns, inode, attr)) {
                error = dquot_initialize(inode);
                if (error)
                        return error;
@@ -3367,7 +3359,7 @@ int reiserfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                reiserfs_write_unlock(inode->i_sb);
                if (error)
                        goto out;
-               error = dquot_transfer(inode, attr);
+               error = dquot_transfer(mnt_userns, inode, attr);
                reiserfs_write_lock(inode->i_sb);
                if (error) {
                        journal_end(&th);
index e943370107d06afab21d37fc43e2aa3714fb816e..de86f5b2859f941c9d2b385197764a33356b155b 100644 (file)
@@ -192,17 +192,19 @@ static inline void msg_init(struct uffd_msg *msg)
 }
 
 static inline struct uffd_msg userfault_msg(unsigned long address,
+                                           unsigned long real_address,
                                            unsigned int flags,
                                            unsigned long reason,
                                            unsigned int features)
 {
        struct uffd_msg msg;
+
        msg_init(&msg);
        msg.event = UFFD_EVENT_PAGEFAULT;
 
-       if (!(features & UFFD_FEATURE_EXACT_ADDRESS))
-               address &= PAGE_MASK;
-       msg.arg.pagefault.address = address;
+       msg.arg.pagefault.address = (features & UFFD_FEATURE_EXACT_ADDRESS) ?
+                                   real_address : address;
+
        /*
         * These flags indicate why the userfault occurred:
         * - UFFD_PAGEFAULT_FLAG_WP indicates a write protect fault.
@@ -488,8 +490,8 @@ vm_fault_t handle_userfault(struct vm_fault *vmf, unsigned long reason)
 
        init_waitqueue_func_entry(&uwq.wq, userfaultfd_wake_function);
        uwq.wq.private = current;
-       uwq.msg = userfault_msg(vmf->real_address, vmf->flags, reason,
-                       ctx->features);
+       uwq.msg = userfault_msg(vmf->address, vmf->real_address, vmf->flags,
+                               reason, ctx->features);
        uwq.ctx = ctx;
        uwq.waken = false;
 
index e8dd03e4561e81a812e52f7730771d389d96169f..a1f4998bc6be30efe98aa47f494a533c25153c7f 100644 (file)
@@ -282,9 +282,15 @@ out:
 }
 EXPORT_SYMBOL_GPL(__vfs_setxattr_locked);
 
+static inline bool is_posix_acl_xattr(const char *name)
+{
+       return (strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
+              (strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0);
+}
+
 int
 vfs_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
-            const char *name, const void *value, size_t size, int flags)
+            const char *name, void *value, size_t size, int flags)
 {
        struct inode *inode = dentry->d_inode;
        struct inode *delegated_inode = NULL;
@@ -292,12 +298,16 @@ vfs_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
        int error;
 
        if (size && strcmp(name, XATTR_NAME_CAPS) == 0) {
-               error = cap_convert_nscap(mnt_userns, dentry, &value, size);
+               error = cap_convert_nscap(mnt_userns, dentry,
+                                         (const void **)&value, size);
                if (error < 0)
                        return error;
                size = error;
        }
 
+       if (size && is_posix_acl_xattr(name))
+               posix_acl_setxattr_idmapped_mnt(mnt_userns, inode, value, size);
+
 retry_deleg:
        inode_lock(inode);
        error = __vfs_setxattr_locked(mnt_userns, dentry, name, value, size,
@@ -431,7 +441,10 @@ vfs_getxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
                return ret;
        }
 nolsm:
-       return __vfs_getxattr(dentry, inode, name, value, size);
+       error = __vfs_getxattr(dentry, inode, name, value, size);
+       if (error > 0 && is_posix_acl_xattr(name))
+               posix_acl_getxattr_idmapped_mnt(mnt_userns, inode, value, size);
+       return error;
 }
 EXPORT_SYMBOL_GPL(vfs_getxattr);
 
@@ -577,8 +590,7 @@ static void setxattr_convert(struct user_namespace *mnt_userns,
        if (ctx->size &&
                ((strcmp(ctx->kname->name, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
                (strcmp(ctx->kname->name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0)))
-               posix_acl_fix_xattr_from_user(mnt_userns, d_inode(d),
-                                               ctx->kvalue, ctx->size);
+               posix_acl_fix_xattr_from_user(ctx->kvalue, ctx->size);
 }
 
 int do_setxattr(struct user_namespace *mnt_userns, struct dentry *dentry,
@@ -695,8 +707,7 @@ do_getxattr(struct user_namespace *mnt_userns, struct dentry *d,
        if (error > 0) {
                if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
                    (strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
-                       posix_acl_fix_xattr_to_user(mnt_userns, d_inode(d),
-                                                       ctx->kvalue, error);
+                       posix_acl_fix_xattr_to_user(ctx->kvalue, error);
                if (ctx->size && copy_to_user(ctx->value, ctx->kvalue, error))
                        error = -EFAULT;
        } else if (error == -ERANGE && ctx->size >= XATTR_SIZE_MAX) {
index 29f5b8b8aca69a0887fae8f961b208fcf308638e..a7402f6ea510406b4787570904e637e00f9cd899 100644 (file)
@@ -667,13 +667,15 @@ xfs_setattr_nonsize(
                uint    qflags = 0;
 
                if ((mask & ATTR_UID) && XFS_IS_UQUOTA_ON(mp)) {
-                       uid = iattr->ia_uid;
+                       uid = from_vfsuid(mnt_userns, i_user_ns(inode),
+                                         iattr->ia_vfsuid);
                        qflags |= XFS_QMOPT_UQUOTA;
                } else {
                        uid = inode->i_uid;
                }
                if ((mask & ATTR_GID) && XFS_IS_GQUOTA_ON(mp)) {
-                       gid = iattr->ia_gid;
+                       gid = from_vfsgid(mnt_userns, i_user_ns(inode),
+                                         iattr->ia_vfsgid);
                        qflags |= XFS_QMOPT_GQUOTA;
                }  else {
                        gid = inode->i_gid;
@@ -704,13 +706,13 @@ xfs_setattr_nonsize(
         * didn't have the inode locked, inode's dquot(s) would have changed
         * also.
         */
-       if ((mask & ATTR_UID) && XFS_IS_UQUOTA_ON(mp) &&
-           !uid_eq(inode->i_uid, iattr->ia_uid)) {
+       if (XFS_IS_UQUOTA_ON(mp) &&
+           i_uid_needs_update(mnt_userns, iattr, inode)) {
                ASSERT(udqp);
                old_udqp = xfs_qm_vop_chown(tp, ip, &ip->i_udquot, udqp);
        }
-       if ((mask & ATTR_GID) && XFS_IS_GQUOTA_ON(mp) &&
-           !gid_eq(inode->i_gid, iattr->ia_gid)) {
+       if (XFS_IS_GQUOTA_ON(mp) &&
+           i_gid_needs_update(mnt_userns, iattr, inode)) {
                ASSERT(xfs_has_pquotino(mp) || !XFS_IS_PQUOTA_ON(mp));
                ASSERT(gdqp);
                old_gdqp = xfs_qm_vop_chown(tp, ip, &ip->i_gdquot, gdqp);
index 053299758deb98abfe8a2154dd14fb6e32646a07..f5d8338967cb27e62500211350dcdee2f683e86c 100644 (file)
@@ -616,7 +616,7 @@ static int zonefs_inode_setattr(struct user_namespace *mnt_userns,
             !uid_eq(iattr->ia_uid, inode->i_uid)) ||
            ((iattr->ia_valid & ATTR_GID) &&
             !gid_eq(iattr->ia_gid, inode->i_gid))) {
-               ret = dquot_transfer(inode, iattr);
+               ret = dquot_transfer(mnt_userns, inode, iattr);
                if (ret)
                        return ret;
        }
index a1690000ac95fe6ff8b2b268d57eb1c38e1480c8..e7d27373ff71ff9dc508585eacc118405029fa97 100644 (file)
@@ -366,8 +366,6 @@ struct acpi_device {
        acpi_handle handle;             /* no handle for fixed hardware */
        struct fwnode_handle fwnode;
        struct acpi_device *parent;
-       struct list_head children;
-       struct list_head node;
        struct list_head wakeup_list;
        struct list_head del_list;
        struct acpi_device_status status;
@@ -380,7 +378,6 @@ struct acpi_device {
        struct acpi_device_data data;
        struct acpi_scan_handler *handler;
        struct acpi_hotplug_context *hp;
-       struct acpi_driver *driver;
        const struct acpi_gpio_mapping *driver_gpios;
        void *driver_data;
        struct device dev;
@@ -484,6 +481,9 @@ extern struct bus_type acpi_bus_type;
 int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data);
 int acpi_dev_for_each_child(struct acpi_device *adev,
                            int (*fn)(struct acpi_device *, void *), void *data);
+int acpi_dev_for_each_child_reverse(struct acpi_device *adev,
+                                   int (*fn)(struct acpi_device *, void *),
+                                   void *data);
 
 /*
  * Events
@@ -522,6 +522,7 @@ const char *acpi_power_state_string(int state);
 int acpi_device_set_power(struct acpi_device *device, int state);
 int acpi_bus_init_power(struct acpi_device *device);
 int acpi_device_fix_up_power(struct acpi_device *device);
+void acpi_device_fix_up_power_extended(struct acpi_device *adev);
 int acpi_bus_update_power(acpi_handle handle, int *state_p);
 int acpi_device_update_power(struct acpi_device *device, int *state_p);
 bool acpi_bus_power_manageable(acpi_handle handle);
@@ -623,6 +624,8 @@ static inline int acpi_dma_configure(struct device *dev,
 }
 struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
                                           u64 address, bool check_children);
+struct acpi_device *acpi_find_child_by_adr(struct acpi_device *adev,
+                                          acpi_bus_address adr);
 int acpi_is_root_bridge(acpi_handle);
 struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
 
index d389bab54241d75d598940e9aa6a690c58926c5d..f73d357ecdf5ff06a5e3c898df9bfd8182ee2e03 100644 (file)
@@ -17,7 +17,7 @@
 #include <acpi/pcc.h>
 #include <acpi/processor.h>
 
-/* Support CPPCv2 and CPPCv3  */
+/* CPPCv2 and CPPCv3 support */
 #define CPPC_V2_REV    2
 #define CPPC_V3_REV    3
 #define CPPC_V2_NUM_ENT        21
index 1940273719285e2b63e2abc9c78d4210fa449a8c..9fa49686957ada1fd1f63ae3c293e48052bc4800 100644 (file)
@@ -441,9 +441,12 @@ static inline int acpi_processor_hotplug(struct acpi_processor *pr)
 #endif /* CONFIG_ACPI_PROCESSOR_IDLE */
 
 /* in processor_thermal.c */
-int acpi_processor_get_limit_info(struct acpi_processor *pr);
+int acpi_processor_thermal_init(struct acpi_processor *pr,
+                               struct acpi_device *device);
+void acpi_processor_thermal_exit(struct acpi_processor *pr,
+                                struct acpi_device *device);
 extern const struct thermal_cooling_device_ops processor_cooling_ops;
-#if defined(CONFIG_ACPI_CPU_FREQ_PSS) & defined(CONFIG_CPU_FREQ)
+#ifdef CONFIG_CPU_FREQ
 void acpi_thermal_cpufreq_init(struct cpufreq_policy *policy);
 void acpi_thermal_cpufreq_exit(struct cpufreq_policy *policy);
 #else
@@ -455,6 +458,6 @@ static inline void acpi_thermal_cpufreq_exit(struct cpufreq_policy *policy)
 {
        return;
 }
-#endif /* CONFIG_ACPI_CPU_FREQ_PSS */
+#endif /* CONFIG_CPU_FREQ */
 
 #endif
index fd7e8fbaeef1585ddf6cd40a07cb8323d344cd1f..961f4d88f9ef784c3c8fbafd6925579698a93d5f 100644 (file)
 #define wmb()  do { kcsan_wmb(); __wmb(); } while (0)
 #endif
 
+#ifdef __dma_mb
+#define dma_mb()       do { kcsan_mb(); __dma_mb(); } while (0)
+#endif
+
 #ifdef __dma_rmb
 #define dma_rmb()      do { kcsan_rmb(); __dma_rmb(); } while (0)
 #endif
 #define wmb()  mb()
 #endif
 
+#ifndef dma_mb
+#define dma_mb()       mb()
+#endif
+
 #ifndef dma_rmb
 #define dma_rmb()      rmb()
 #endif
index 7ce93aaf69f8dbd45d054ff0b708d802cf786bfb..72974cb81343edfffa97029e826363b86e5b6c8e 100644 (file)
@@ -964,7 +964,34 @@ static inline void iounmap(volatile void __iomem *addr)
 #elif defined(CONFIG_GENERIC_IOREMAP)
 #include <linux/pgtable.h>
 
-void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot);
+/*
+ * Arch code can implement the following two hooks when using GENERIC_IOREMAP
+ * ioremap_allowed() return a bool,
+ *   - true means continue to remap
+ *   - false means skip remap and return directly
+ * iounmap_allowed() return a bool,
+ *   - true means continue to vunmap
+ *   - false means skip vunmap and return directly
+ */
+#ifndef ioremap_allowed
+#define ioremap_allowed ioremap_allowed
+static inline bool ioremap_allowed(phys_addr_t phys_addr, size_t size,
+                                  unsigned long prot)
+{
+       return true;
+}
+#endif
+
+#ifndef iounmap_allowed
+#define iounmap_allowed iounmap_allowed
+static inline bool iounmap_allowed(void *addr)
+{
+       return true;
+}
+#endif
+
+void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
+                          unsigned long prot);
 void iounmap(volatile void __iomem *addr);
 
 static inline void __iomem *ioremap(phys_addr_t addr, size_t size)
@@ -1125,9 +1152,7 @@ static inline void memcpy_toio(volatile void __iomem *addr, const void *buffer,
 }
 #endif
 
-#ifndef CONFIG_GENERIC_DEVMEM_IS_ALLOWED
 extern int devmem_is_allowed(unsigned long pfn);
-#endif
 
 #endif /* __KERNEL__ */
 
index f6da8a1326398d45409415354880cf35e3f06956..b0f80cfd2a263ba04200dd7cc733674d8fb87138 100644 (file)
@@ -247,148 +247,4 @@ int omap_dm_timers_active(void);
 #define OMAP_TIMER_TICK_INT_MASK_COUNT_REG                             \
                (_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT))
 
-/*
- * The below are inlined to optimize code size for system timers. Other code
- * should not need these at all.
- */
-#if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS)
-static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg,
-                                               int posted)
-{
-       if (posted)
-               while (readl_relaxed(timer->pend) & (reg >> WPSHIFT))
-                       cpu_relax();
-
-       return readl_relaxed(timer->func_base + (reg & 0xff));
-}
-
-static inline void __omap_dm_timer_write(struct omap_dm_timer *timer,
-                                       u32 reg, u32 val, int posted)
-{
-       if (posted)
-               while (readl_relaxed(timer->pend) & (reg >> WPSHIFT))
-                       cpu_relax();
-
-       writel_relaxed(val, timer->func_base + (reg & 0xff));
-}
-
-static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
-{
-       u32 tidr;
-
-       /* Assume v1 ip if bits [31:16] are zero */
-       tidr = readl_relaxed(timer->io_base);
-       if (!(tidr >> 16)) {
-               timer->revision = 1;
-               timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
-               timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
-               timer->irq_dis = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
-               timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET;
-               timer->func_base = timer->io_base;
-       } else {
-               timer->revision = 2;
-               timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
-               timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
-               timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;
-               timer->pend = timer->io_base +
-                       _OMAP_TIMER_WRITE_PEND_OFFSET +
-                               OMAP_TIMER_V2_FUNC_OFFSET;
-               timer->func_base = timer->io_base + OMAP_TIMER_V2_FUNC_OFFSET;
-       }
-}
-
-/*
- * __omap_dm_timer_enable_posted - enables write posted mode
- * @timer:      pointer to timer instance handle
- *
- * Enables the write posted mode for the timer. When posted mode is enabled
- * writes to certain timer registers are immediately acknowledged by the
- * internal bus and hence prevents stalling the CPU waiting for the write to
- * complete. Enabling this feature can improve performance for writing to the
- * timer registers.
- */
-static inline void __omap_dm_timer_enable_posted(struct omap_dm_timer *timer)
-{
-       if (timer->posted)
-               return;
-
-       if (timer->errata & OMAP_TIMER_ERRATA_I103_I767) {
-               timer->posted = OMAP_TIMER_NONPOSTED;
-               __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG, 0, 0);
-               return;
-       }
-
-       __omap_dm_timer_write(timer, OMAP_TIMER_IF_CTRL_REG,
-                             OMAP_TIMER_CTRL_POSTED, 0);
-       timer->context.tsicr = OMAP_TIMER_CTRL_POSTED;
-       timer->posted = OMAP_TIMER_POSTED;
-}
-
-/**
- * __omap_dm_timer_override_errata - override errata flags for a timer
- * @timer:      pointer to timer handle
- * @errata:    errata flags to be ignored
- *
- * For a given timer, override a timer errata by clearing the flags
- * specified by the errata argument. A specific erratum should only be
- * overridden for a timer if the timer is used in such a way the erratum
- * has no impact.
- */
-static inline void __omap_dm_timer_override_errata(struct omap_dm_timer *timer,
-                                                  u32 errata)
-{
-       timer->errata &= ~errata;
-}
-
-static inline void __omap_dm_timer_stop(struct omap_dm_timer *timer,
-                                       int posted, unsigned long rate)
-{
-       u32 l;
-
-       l = __omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
-       if (l & OMAP_TIMER_CTRL_ST) {
-               l &= ~0x1;
-               __omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, l, posted);
-#ifdef CONFIG_ARCH_OMAP2PLUS
-               /* Readback to make sure write has completed */
-               __omap_dm_timer_read(timer, OMAP_TIMER_CTRL_REG, posted);
-               /*
-                * Wait for functional clock period x 3.5 to make sure that
-                * timer is stopped
-                */
-               udelay(3500000 / rate + 1);
-#endif
-       }
-
-       /* Ack possibly pending interrupt */
-       writel_relaxed(OMAP_TIMER_INT_OVERFLOW, timer->irq_stat);
-}
-
-static inline void __omap_dm_timer_load_start(struct omap_dm_timer *timer,
-                                               u32 ctrl, unsigned int load,
-                                               int posted)
-{
-       __omap_dm_timer_write(timer, OMAP_TIMER_COUNTER_REG, load, posted);
-       __omap_dm_timer_write(timer, OMAP_TIMER_CTRL_REG, ctrl, posted);
-}
-
-static inline void __omap_dm_timer_int_enable(struct omap_dm_timer *timer,
-                                               unsigned int value)
-{
-       writel_relaxed(value, timer->irq_ena);
-       __omap_dm_timer_write(timer, OMAP_TIMER_WAKEUP_EN_REG, value, 0);
-}
-
-static inline unsigned int
-__omap_dm_timer_read_counter(struct omap_dm_timer *timer, int posted)
-{
-       return __omap_dm_timer_read(timer, OMAP_TIMER_COUNTER_REG, posted);
-}
-
-static inline void __omap_dm_timer_write_status(struct omap_dm_timer *timer,
-                                               unsigned int value)
-{
-       writel_relaxed(value, timer->irq_stat);
-}
-#endif /* CONFIG_ARCH_OMAP1 || CONFIG_ARCH_OMAP2PLUS */
 #endif /* __CLOCKSOURCE_DMTIMER_H */
index 1f8701691d62841ef13f6c7cfb0b13ceb4507a9d..8256e7430b63d59a3df6176760c5311801500a7a 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/nuvoton,npcm845-clk.h b/include/dt-bindings/clock/nuvoton,npcm845-clk.h
new file mode 100644 (file)
index 0000000..e5cce08
--- /dev/null
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (C) 2021 Nuvoton Technologies.
+ * Author: Tomer Maimon <tomer.maimon@nuvoton.com>
+ *
+ * Device Tree binding constants for NPCM8XX clock controller.
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_NPCM8XX_H
+#define __DT_BINDINGS_CLOCK_NPCM8XX_H
+
+#define NPCM8XX_CLK_CPU                0
+#define NPCM8XX_CLK_GFX_PIXEL  1
+#define NPCM8XX_CLK_MC         2
+#define NPCM8XX_CLK_ADC                3
+#define NPCM8XX_CLK_AHB                4
+#define NPCM8XX_CLK_TIMER      5
+#define NPCM8XX_CLK_UART       6
+#define NPCM8XX_CLK_UART2      7
+#define NPCM8XX_CLK_MMC                8
+#define NPCM8XX_CLK_SPI3       9
+#define NPCM8XX_CLK_PCI                10
+#define NPCM8XX_CLK_AXI                11
+#define NPCM8XX_CLK_APB4       12
+#define NPCM8XX_CLK_APB3       13
+#define NPCM8XX_CLK_APB2       14
+#define NPCM8XX_CLK_APB1       15
+#define NPCM8XX_CLK_APB5       16
+#define NPCM8XX_CLK_CLKOUT     17
+#define NPCM8XX_CLK_GFX                18
+#define NPCM8XX_CLK_SU         19
+#define NPCM8XX_CLK_SU48       20
+#define NPCM8XX_CLK_SDHC       21
+#define NPCM8XX_CLK_SPI0       22
+#define NPCM8XX_CLK_SPI1       23
+#define NPCM8XX_CLK_SPIX       24
+#define NPCM8XX_CLK_RG         25
+#define NPCM8XX_CLK_RCP                26
+#define NPCM8XX_CLK_PRE_ADC    27
+#define NPCM8XX_CLK_ATB                28
+#define NPCM8XX_CLK_PRE_CLK    29
+#define NPCM8XX_CLK_TH         30
+#define NPCM8XX_CLK_REFCLK     31
+#define NPCM8XX_CLK_SYSBYPCK   32
+#define NPCM8XX_CLK_MCBYPCK    33
+
+#define NPCM8XX_NUM_CLOCKS     (NPCM8XX_CLK_MCBYPCK + 1)
+
+#endif
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 8e2bec1c91bf9827b138f2b3b1db324a583fa537..55f8322a1e50a9a8fa274bae0881d8b8a6380649 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
diff --git a/include/dt-bindings/clock/sunplus,sp7021-clkc.h b/include/dt-bindings/clock/sunplus,sp7021-clkc.h
new file mode 100644 (file)
index 0000000..cd84321
--- /dev/null
@@ -0,0 +1,88 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (C) Sunplus Technology Co., Ltd.
+ *       All rights reserved.
+ */
+#ifndef _DT_BINDINGS_CLOCK_SUNPLUS_SP7021_H
+#define _DT_BINDINGS_CLOCK_SUNPLUS_SP7021_H
+
+/* gates */
+#define CLK_RTC         0
+#define CLK_OTPRX       1
+#define CLK_NOC         2
+#define CLK_BR          3
+#define CLK_SPIFL       4
+#define CLK_PERI0       5
+#define CLK_PERI1       6
+#define CLK_STC0        7
+#define CLK_STC_AV0     8
+#define CLK_STC_AV1     9
+#define CLK_STC_AV2     10
+#define CLK_UA0         11
+#define CLK_UA1         12
+#define CLK_UA2         13
+#define CLK_UA3         14
+#define CLK_UA4         15
+#define CLK_HWUA        16
+#define CLK_DDC0        17
+#define CLK_UADMA       18
+#define CLK_CBDMA0      19
+#define CLK_CBDMA1      20
+#define CLK_SPI_COMBO_0 21
+#define CLK_SPI_COMBO_1 22
+#define CLK_SPI_COMBO_2 23
+#define CLK_SPI_COMBO_3 24
+#define CLK_AUD         25
+#define CLK_USBC0       26
+#define CLK_USBC1       27
+#define CLK_UPHY0       28
+#define CLK_UPHY1       29
+#define CLK_I2CM0       30
+#define CLK_I2CM1       31
+#define CLK_I2CM2       32
+#define CLK_I2CM3       33
+#define CLK_PMC         34
+#define CLK_CARD_CTL0   35
+#define CLK_CARD_CTL1   36
+#define CLK_CARD_CTL4   37
+#define CLK_BCH         38
+#define CLK_DDFCH       39
+#define CLK_CSIIW0      40
+#define CLK_CSIIW1      41
+#define CLK_MIPICSI0    42
+#define CLK_MIPICSI1    43
+#define CLK_HDMI_TX     44
+#define CLK_VPOST       45
+#define CLK_TGEN        46
+#define CLK_DMIX        47
+#define CLK_TCON        48
+#define CLK_GPIO        49
+#define CLK_MAILBOX     50
+#define CLK_SPIND       51
+#define CLK_I2C2CBUS    52
+#define CLK_SEC         53
+#define CLK_DVE         54
+#define CLK_GPOST0      55
+#define CLK_OSD0        56
+#define CLK_DISP_PWM    57
+#define CLK_UADBG       58
+#define CLK_FIO_CTL     59
+#define CLK_FPGA        60
+#define CLK_L2SW        61
+#define CLK_ICM         62
+#define CLK_AXI_GLOBAL  63
+
+/* plls */
+#define PLL_A           64
+#define PLL_E           65
+#define PLL_E_2P5       66
+#define PLL_E_25        67
+#define PLL_E_112P5     68
+#define PLL_F           69
+#define PLL_TV          70
+#define PLL_TV_A        71
+#define PLL_SYS         72
+
+#define CLK_MAX         73
+
+#endif
index bd4c3086a2dad7cd95debdf66c81dce65efc32d1..173364a93381ad992a58f2043afad52b5e6e8a00 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 9296d0bb5f34e70adfd1c90c3228b48bb42d6ae1..fbfa3febc66d401d593bfa92b824c5ebce196e1a 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 e3b0e9da295dafc622786fc90aa53bc3824a7301..62987b47ce81c150847b4ddf60bc36713b7b8182 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
diff --git a/include/dt-bindings/power/mt6795-power.h b/include/dt-bindings/power/mt6795-power.h
new file mode 100644 (file)
index 0000000..b0fc26c
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+#ifndef _DT_BINDINGS_POWER_MT6795_POWER_H
+#define _DT_BINDINGS_POWER_MT6795_POWER_H
+
+#define MT6795_POWER_DOMAIN_MM         0
+#define MT6795_POWER_DOMAIN_VDEC       1
+#define MT6795_POWER_DOMAIN_VENC       2
+#define MT6795_POWER_DOMAIN_ISP                3
+#define MT6795_POWER_DOMAIN_MJC                4
+#define MT6795_POWER_DOMAIN_AUDIO      5
+#define MT6795_POWER_DOMAIN_MFG_ASYNC  6
+#define MT6795_POWER_DOMAIN_MFG_2D     7
+#define MT6795_POWER_DOMAIN_MFG                8
+#define MT6795_POWER_DOMAIN_MODEM      9
+
+#endif /* _DT_BINDINGS_POWER_MT6795_POWER_H */
index 6cce5b7aa940ab50248f4f80570c18518cf584b6..d81de63ae31cf0403158531e7fa5837777b3ecb4 100644 (file)
 #define MSM8916_VDDMX          3
 #define MSM8916_VDDMX_AO       4
 
+/* MSM8909 Power Domain Indexes */
+#define MSM8909_VDDCX          MSM8916_VDDCX
+#define MSM8909_VDDCX_AO       MSM8916_VDDCX_AO
+#define MSM8909_VDDCX_VFC      MSM8916_VDDCX_VFC
+#define MSM8909_VDDMX          MSM8916_VDDMX
+#define MSM8909_VDDMX_AO       MSM8916_VDDMX_AO
+
 /* MSM8953 Power Domain Indexes */
 #define MSM8953_VDDMD          0
 #define MSM8953_VDDMD_AO       1
index f610eee9bce8f8db20703d0bfe89ef7401010ec2..ae9286cef85c7268b48e409937d4b784a908045b 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
diff --git a/include/dt-bindings/reset/sunplus,sp7021-reset.h b/include/dt-bindings/reset/sunplus,sp7021-reset.h
new file mode 100644 (file)
index 0000000..ab48670
--- /dev/null
@@ -0,0 +1,87 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (C) Sunplus Technology Co., Ltd.
+ *       All rights reserved.
+ */
+#ifndef _DT_BINDINGS_RST_SUNPLUS_SP7021_H
+#define _DT_BINDINGS_RST_SUNPLUS_SP7021_H
+
+#define RST_SYSTEM              0
+#define RST_RTC                 1
+#define RST_IOCTL               2
+#define RST_IOP                 3
+#define RST_OTPRX               4
+#define RST_NOC                 5
+#define RST_BR                  6
+#define RST_RBUS_L00            7
+#define RST_SPIFL               8
+#define RST_SDCTRL0             9
+#define RST_PERI0               10
+#define RST_A926                11
+#define RST_UMCTL2              12
+#define RST_PERI1               13
+#define RST_DDR_PHY0            14
+#define RST_ACHIP               15
+#define RST_STC0                16
+#define RST_STC_AV0             17
+#define RST_STC_AV1             18
+#define RST_STC_AV2             19
+#define RST_UA0                 20
+#define RST_UA1                 21
+#define RST_UA2                 22
+#define RST_UA3                 23
+#define RST_UA4                 24
+#define RST_HWUA                25
+#define RST_DDC0                26
+#define RST_UADMA               27
+#define RST_CBDMA0              28
+#define RST_CBDMA1              29
+#define RST_SPI_COMBO_0         30
+#define RST_SPI_COMBO_1         31
+#define RST_SPI_COMBO_2         32
+#define RST_SPI_COMBO_3         33
+#define RST_AUD                 34
+#define RST_USBC0               35
+#define RST_USBC1               36
+#define RST_UPHY0               37
+#define RST_UPHY1               38
+#define RST_I2CM0               39
+#define RST_I2CM1               40
+#define RST_I2CM2               41
+#define RST_I2CM3               42
+#define RST_PMC                 43
+#define RST_CARD_CTL0           44
+#define RST_CARD_CTL1           45
+#define RST_CARD_CTL4           46
+#define RST_BCH                 47
+#define RST_DDFCH               48
+#define RST_CSIIW0              49
+#define RST_CSIIW1              50
+#define RST_MIPICSI0            51
+#define RST_MIPICSI1            52
+#define RST_HDMI_TX             53
+#define RST_VPOST               54
+#define RST_TGEN                55
+#define RST_DMIX                56
+#define RST_TCON                57
+#define RST_INTERRUPT           58
+#define RST_RGST                59
+#define RST_GPIO                60
+#define RST_RBUS_TOP            61
+#define RST_MAILBOX             62
+#define RST_SPIND               63
+#define RST_I2C2CBUS            64
+#define RST_SEC                 65
+#define RST_DVE                 66
+#define RST_GPOST0              67
+#define RST_OSD0                68
+#define RST_DISP_PWM            69
+#define RST_UADBG               70
+#define RST_DUMMY_MASTER        71
+#define RST_FIO_CTL             72
+#define RST_FPGA                73
+#define RST_L2SW                74
+#define RST_ICM                 75
+#define RST_AXI_GLOBAL          76
+
+#endif
index 547ca3b60caaa09d286a000c9bf69dc7ec1a29cc..d48d22b2bc7fd8361c8ae69a021c526bba2b1d40 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 7c46f152106b3f329671f2febdafa713e18b6953..ce00cca3f1bdf908b99c9aeb1532c29358164faf 100644 (file)
@@ -105,6 +105,7 @@ enum acpi_irq_model_id {
        ACPI_IRQ_MODEL_IOSAPIC,
        ACPI_IRQ_MODEL_PLATFORM,
        ACPI_IRQ_MODEL_GIC,
+       ACPI_IRQ_MODEL_LPIC,
        ACPI_IRQ_MODEL_COUNT
 };
 
@@ -356,7 +357,8 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
 
 void acpi_set_irq_model(enum acpi_irq_model_id model,
-                       struct fwnode_handle *fwnode);
+                       struct fwnode_handle *(*)(u32));
+void acpi_set_gsi_to_irq_fallback(u32 (*)(u32));
 
 struct irq_domain *acpi_irq_create_hierarchy(unsigned int flags,
                                             unsigned int size,
index 1eb8ee5b0e5fec531ff6627102308bc2b30f0a5d..a5a1224315637780054d7dcb11a405ed6c80f5cf 100644 (file)
@@ -6,9 +6,11 @@
 #include <linux/acpi.h>
 
 #ifdef CONFIG_ACPI_VIOT
+void __init acpi_viot_early_init(void);
 void __init acpi_viot_init(void);
 int viot_iommu_configure(struct device *dev);
 #else
+static inline void acpi_viot_early_init(void) {}
 static inline void acpi_viot_init(void) {}
 static inline int viot_iommu_configure(struct device *dev)
 {
index d4427d0a0e1872c8c0af741199547957e10397fb..187b54a9567ecc61ff9f4e4b9a24120bf3ca7ffc 100644 (file)
@@ -288,6 +288,10 @@ struct css_set {
 
 struct cgroup_base_stat {
        struct task_cputime cputime;
+
+#ifdef CONFIG_SCHED_CORE
+       u64 forceidle_sum;
+#endif
 };
 
 /*
index 19f0dbfdd7fe3e1a425fd9fd95337d36ce9ab9b1..f61447913db97e5461a85b8daec0ef0e6fe4cc93 100644 (file)
@@ -130,7 +130,6 @@ enum cpuhp_state {
        CPUHP_ZCOMP_PREPARE,
        CPUHP_TIMERS_PREPARE,
        CPUHP_MIPS_SOC_PREPARE,
-       CPUHP_LOONGARCH_SOC_PREPARE,
        CPUHP_BP_PREPARE_DYN,
        CPUHP_BP_PREPARE_DYN_END                = CPUHP_BP_PREPARE_DYN + 20,
        CPUHP_BRINGUP_CPU,
@@ -151,6 +150,7 @@ enum cpuhp_state {
        CPUHP_AP_IRQ_BCM2836_STARTING,
        CPUHP_AP_IRQ_MIPS_GIC_STARTING,
        CPUHP_AP_IRQ_RISCV_STARTING,
+       CPUHP_AP_IRQ_LOONGARCH_STARTING,
        CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
        CPUHP_AP_ARM_MVEBU_COHERENCY,
        CPUHP_AP_MICROCODE_LOADER,
@@ -230,6 +230,7 @@ enum cpuhp_state {
        CPUHP_AP_PERF_ARM_HISI_PA_ONLINE,
        CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE,
        CPUHP_AP_PERF_ARM_HISI_PCIE_PMU_ONLINE,
+       CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE,
        CPUHP_AP_PERF_ARM_L2X0_ONLINE,
        CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE,
        CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE,
index 4c374be702472a393894f6659757b2b899082d0e..aa63e0b3c0a296bf62d1ebf880a0c493ba3f5b18 100644 (file)
@@ -21,7 +21,8 @@ extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
                                             void *xattr_value,
                                             size_t xattr_value_len,
                                             struct integrity_iint_cache *iint);
-extern int evm_inode_setattr(struct dentry *dentry, struct iattr *attr);
+extern int evm_inode_setattr(struct user_namespace *mnt_userns,
+                            struct dentry *dentry, struct iattr *attr);
 extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
 extern int evm_inode_setxattr(struct user_namespace *mnt_userns,
                              struct dentry *dentry, const char *name,
@@ -68,7 +69,8 @@ static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
 }
 #endif
 
-static inline int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
+static inline int evm_inode_setattr(struct user_namespace *mnt_userns,
+                                   struct dentry *dentry, struct iattr *attr)
 {
        return 0;
 }
index e517dbcf74ed2f522e8835e5d2340638374c02bb..8ad743def6f393c406dbeea9525839db638fec05 100644 (file)
 #define FANOTIFY_MARK_TYPE_BITS        (FAN_MARK_INODE | FAN_MARK_MOUNT | \
                                 FAN_MARK_FILESYSTEM)
 
+#define FANOTIFY_MARK_CMD_BITS (FAN_MARK_ADD | FAN_MARK_REMOVE | \
+                                FAN_MARK_FLUSH)
+
+#define FANOTIFY_MARK_IGNORE_BITS (FAN_MARK_IGNORED_MASK | \
+                                  FAN_MARK_IGNORE)
+
 #define FANOTIFY_MARK_FLAGS    (FANOTIFY_MARK_TYPE_BITS | \
-                                FAN_MARK_ADD | \
-                                FAN_MARK_REMOVE | \
+                                FANOTIFY_MARK_CMD_BITS | \
+                                FANOTIFY_MARK_IGNORE_BITS | \
                                 FAN_MARK_DONT_FOLLOW | \
                                 FAN_MARK_ONLYDIR | \
-                                FAN_MARK_IGNORED_MASK | \
                                 FAN_MARK_IGNORED_SURV_MODIFY | \
-                                FAN_MARK_EVICTABLE | \
-                                FAN_MARK_FLUSH)
+                                FAN_MARK_EVICTABLE)
 
 /*
  * Events that can be reported with data type FSNOTIFY_EVENT_PATH.
index 1ec73d5352c3c2853d30cd32746a68dec5e400dc..cbde3b1fa414bad81359711409f2606b4b4d5629 100644 (file)
@@ -34,6 +34,7 @@
 #define PM_API_VERSION_2       2
 
 /* ATF only commands */
+#define TF_A_PM_REGISTER_SGI           0xa04
 #define PM_GET_TRUSTZONE_VERSION       0xa03
 #define PM_SET_SUSPEND_MODE            0xa02
 #define GET_CALLBACK_DATA              0xa01
@@ -468,6 +469,7 @@ int zynqmp_pm_feature(const u32 api_id);
 int zynqmp_pm_is_function_supported(const u32 api_id, const u32 id);
 int zynqmp_pm_set_feature_config(enum pm_feature_config_id id, u32 value);
 int zynqmp_pm_get_feature_config(enum pm_feature_config_id id, u32 *payload);
+int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset);
 #else
 static inline int zynqmp_pm_get_api_version(u32 *version)
 {
@@ -733,6 +735,11 @@ static inline int zynqmp_pm_get_feature_config(enum pm_feature_config_id id,
 {
        return -ENODEV;
 }
+
+static inline int zynqmp_pm_register_sgi(u32 sgi_num, u32 reset)
+{
+       return -ENODEV;
+}
 #endif
 
 #endif /* __FIRMWARE_ZYNQMP_H__ */
index 9ad5e3520fae577c2a216859aba20f8d26241172..ec2e358867793bf9295a605d6091205d5fc768c2 100644 (file)
@@ -221,8 +221,26 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
 struct iattr {
        unsigned int    ia_valid;
        umode_t         ia_mode;
-       kuid_t          ia_uid;
-       kgid_t          ia_gid;
+       /*
+        * The two anonymous unions wrap structures with the same member.
+        *
+        * Filesystems raising FS_ALLOW_IDMAP need to use ia_vfs{g,u}id which
+        * are a dedicated type requiring the filesystem to use the dedicated
+        * helpers. Other filesystem can continue to use ia_{g,u}id until they
+        * have been ported.
+        *
+        * They always contain the same value. In other words FS_ALLOW_IDMAP
+        * pass down the same value on idmapped mounts as they would on regular
+        * mounts.
+        */
+       union {
+               kuid_t          ia_uid;
+               vfsuid_t        ia_vfsuid;
+       };
+       union {
+               kgid_t          ia_gid;
+               vfsgid_t        ia_vfsgid;
+       };
        loff_t          ia_size;
        struct timespec64 ia_atime;
        struct timespec64 ia_mtime;
@@ -1600,13 +1618,68 @@ static inline void i_gid_write(struct inode *inode, gid_t gid)
  * @mnt_userns: user namespace of the mount the inode was found from
  * @inode: inode to map
  *
+ * Note, this will eventually be removed completely in favor of the type-safe
+ * i_uid_into_vfsuid().
+ *
  * Return: the inode's i_uid mapped down according to @mnt_userns.
  * If the inode's i_uid has no mapping INVALID_UID is returned.
  */
 static inline kuid_t i_uid_into_mnt(struct user_namespace *mnt_userns,
                                    const struct inode *inode)
 {
-       return mapped_kuid_fs(mnt_userns, i_user_ns(inode), inode->i_uid);
+       return AS_KUIDT(make_vfsuid(mnt_userns, i_user_ns(inode), inode->i_uid));
+}
+
+/**
+ * i_uid_into_vfsuid - map an inode's i_uid down into a mnt_userns
+ * @mnt_userns: user namespace of the mount the inode was found from
+ * @inode: inode to map
+ *
+ * Return: whe inode's i_uid mapped down according to @mnt_userns.
+ * If the inode's i_uid has no mapping INVALID_VFSUID is returned.
+ */
+static inline vfsuid_t i_uid_into_vfsuid(struct user_namespace *mnt_userns,
+                                        const struct inode *inode)
+{
+       return make_vfsuid(mnt_userns, i_user_ns(inode), inode->i_uid);
+}
+
+/**
+ * i_uid_needs_update - check whether inode's i_uid needs to be updated
+ * @mnt_userns: user namespace of the mount the inode was found from
+ * @attr: the new attributes of @inode
+ * @inode: the inode to update
+ *
+ * Check whether the $inode's i_uid field needs to be updated taking idmapped
+ * mounts into account if the filesystem supports it.
+ *
+ * Return: true if @inode's i_uid field needs to be updated, false if not.
+ */
+static inline bool i_uid_needs_update(struct user_namespace *mnt_userns,
+                                     const struct iattr *attr,
+                                     const struct inode *inode)
+{
+       return ((attr->ia_valid & ATTR_UID) &&
+               !vfsuid_eq(attr->ia_vfsuid,
+                          i_uid_into_vfsuid(mnt_userns, inode)));
+}
+
+/**
+ * i_uid_update - update @inode's i_uid field
+ * @mnt_userns: user namespace of the mount the inode was found from
+ * @attr: the new attributes of @inode
+ * @inode: the inode to update
+ *
+ * Safely update @inode's i_uid field translating the vfsuid of any idmapped
+ * mount into the filesystem kuid.
+ */
+static inline void i_uid_update(struct user_namespace *mnt_userns,
+                               const struct iattr *attr,
+                               struct inode *inode)
+{
+       if (attr->ia_valid & ATTR_UID)
+               inode->i_uid = from_vfsuid(mnt_userns, i_user_ns(inode),
+                                          attr->ia_vfsuid);
 }
 
 /**
@@ -1614,13 +1687,68 @@ static inline kuid_t i_uid_into_mnt(struct user_namespace *mnt_userns,
  * @mnt_userns: user namespace of the mount the inode was found from
  * @inode: inode to map
  *
+ * Note, this will eventually be removed completely in favor of the type-safe
+ * i_gid_into_vfsgid().
+ *
  * Return: the inode's i_gid mapped down according to @mnt_userns.
  * If the inode's i_gid has no mapping INVALID_GID is returned.
  */
 static inline kgid_t i_gid_into_mnt(struct user_namespace *mnt_userns,
                                    const struct inode *inode)
 {
-       return mapped_kgid_fs(mnt_userns, i_user_ns(inode), inode->i_gid);
+       return AS_KGIDT(make_vfsgid(mnt_userns, i_user_ns(inode), inode->i_gid));
+}
+
+/**
+ * i_gid_into_vfsgid - map an inode's i_gid down into a mnt_userns
+ * @mnt_userns: user namespace of the mount the inode was found from
+ * @inode: inode to map
+ *
+ * Return: the inode's i_gid mapped down according to @mnt_userns.
+ * If the inode's i_gid has no mapping INVALID_VFSGID is returned.
+ */
+static inline vfsgid_t i_gid_into_vfsgid(struct user_namespace *mnt_userns,
+                                        const struct inode *inode)
+{
+       return make_vfsgid(mnt_userns, i_user_ns(inode), inode->i_gid);
+}
+
+/**
+ * i_gid_needs_update - check whether inode's i_gid needs to be updated
+ * @mnt_userns: user namespace of the mount the inode was found from
+ * @attr: the new attributes of @inode
+ * @inode: the inode to update
+ *
+ * Check whether the $inode's i_gid field needs to be updated taking idmapped
+ * mounts into account if the filesystem supports it.
+ *
+ * Return: true if @inode's i_gid field needs to be updated, false if not.
+ */
+static inline bool i_gid_needs_update(struct user_namespace *mnt_userns,
+                                     const struct iattr *attr,
+                                     const struct inode *inode)
+{
+       return ((attr->ia_valid & ATTR_GID) &&
+               !vfsgid_eq(attr->ia_vfsgid,
+                          i_gid_into_vfsgid(mnt_userns, inode)));
+}
+
+/**
+ * i_gid_update - update @inode's i_gid field
+ * @mnt_userns: user namespace of the mount the inode was found from
+ * @attr: the new attributes of @inode
+ * @inode: the inode to update
+ *
+ * Safely update @inode's i_gid field translating the vfsgid of any idmapped
+ * mount into the filesystem kgid.
+ */
+static inline void i_gid_update(struct user_namespace *mnt_userns,
+                               const struct iattr *attr,
+                               struct inode *inode)
+{
+       if (attr->ia_valid & ATTR_GID)
+               inode->i_gid = from_vfsgid(mnt_userns, i_user_ns(inode),
+                                          attr->ia_vfsgid);
 }
 
 /**
@@ -2195,8 +2323,8 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags
 static inline bool HAS_UNMAPPED_ID(struct user_namespace *mnt_userns,
                                   struct inode *inode)
 {
-       return !uid_valid(i_uid_into_mnt(mnt_userns, inode)) ||
-              !gid_valid(i_gid_into_mnt(mnt_userns, inode));
+       return !vfsuid_valid(i_uid_into_vfsuid(mnt_userns, inode)) ||
+              !vfsgid_valid(i_gid_into_vfsgid(mnt_userns, inode));
 }
 
 static inline int iocb_flags(struct file *file);
index 9560734759fa6bff7eef0e5c3db31f4f54f03e80..d7d96c806bff2b41f33fd4abdee5c1e9471d34db 100644 (file)
@@ -518,8 +518,8 @@ struct fsnotify_mark {
        struct hlist_node obj_list;
        /* Head of list of marks for an object [mark ref] */
        struct fsnotify_mark_connector *connector;
-       /* Events types to ignore [mark->lock, group->mark_mutex] */
-       __u32 ignored_mask;
+       /* Events types and flags to ignore [mark->lock, group->mark_mutex] */
+       __u32 ignore_mask;
        /* General fsnotify mark flags */
 #define FSNOTIFY_MARK_FLAG_ALIVE               0x0001
 #define FSNOTIFY_MARK_FLAG_ATTACHED            0x0002
@@ -529,6 +529,7 @@ struct fsnotify_mark {
        /* fanotify mark flags */
 #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x0100
 #define FSNOTIFY_MARK_FLAG_NO_IREF             0x0200
+#define FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS    0x0400
        unsigned int flags;             /* flags [mark->lock] */
 };
 
@@ -655,15 +656,91 @@ extern void fsnotify_remove_queued_event(struct fsnotify_group *group,
 
 /* functions used to manipulate the marks attached to inodes */
 
-/* Get mask for calculating object interest taking ignored mask into account */
+/*
+ * Canonical "ignore mask" including event flags.
+ *
+ * Note the subtle semantic difference from the legacy ->ignored_mask.
+ * ->ignored_mask traditionally only meant which events should be ignored,
+ * while ->ignore_mask also includes flags regarding the type of objects on
+ * which events should be ignored.
+ */
+static inline __u32 fsnotify_ignore_mask(struct fsnotify_mark *mark)
+{
+       __u32 ignore_mask = mark->ignore_mask;
+
+       /* The event flags in ignore mask take effect */
+       if (mark->flags & FSNOTIFY_MARK_FLAG_HAS_IGNORE_FLAGS)
+               return ignore_mask;
+
+       /*
+        * Legacy behavior:
+        * - Always ignore events on dir
+        * - Ignore events on child if parent is watching children
+        */
+       ignore_mask |= FS_ISDIR;
+       ignore_mask &= ~FS_EVENT_ON_CHILD;
+       ignore_mask |= mark->mask & FS_EVENT_ON_CHILD;
+
+       return ignore_mask;
+}
+
+/* Legacy ignored_mask - only event types to ignore */
+static inline __u32 fsnotify_ignored_events(struct fsnotify_mark *mark)
+{
+       return mark->ignore_mask & ALL_FSNOTIFY_EVENTS;
+}
+
+/*
+ * Check if mask (or ignore mask) should be applied depending if victim is a
+ * directory and whether it is reported to a watching parent.
+ */
+static inline bool fsnotify_mask_applicable(__u32 mask, bool is_dir,
+                                           int iter_type)
+{
+       /* Should mask be applied to a directory? */
+       if (is_dir && !(mask & FS_ISDIR))
+               return false;
+
+       /* Should mask be applied to a child? */
+       if (iter_type == FSNOTIFY_ITER_TYPE_PARENT &&
+           !(mask & FS_EVENT_ON_CHILD))
+               return false;
+
+       return true;
+}
+
+/*
+ * Effective ignore mask taking into account if event victim is a
+ * directory and whether it is reported to a watching parent.
+ */
+static inline __u32 fsnotify_effective_ignore_mask(struct fsnotify_mark *mark,
+                                                  bool is_dir, int iter_type)
+{
+       __u32 ignore_mask = fsnotify_ignored_events(mark);
+
+       if (!ignore_mask)
+               return 0;
+
+       /* For non-dir and non-child, no need to consult the event flags */
+       if (!is_dir && iter_type != FSNOTIFY_ITER_TYPE_PARENT)
+               return ignore_mask;
+
+       ignore_mask = fsnotify_ignore_mask(mark);
+       if (!fsnotify_mask_applicable(ignore_mask, is_dir, iter_type))
+               return 0;
+
+       return ignore_mask & ALL_FSNOTIFY_EVENTS;
+}
+
+/* Get mask for calculating object interest taking ignore mask into account */
 static inline __u32 fsnotify_calc_mask(struct fsnotify_mark *mark)
 {
        __u32 mask = mark->mask;
 
-       if (!mark->ignored_mask)
+       if (!fsnotify_ignored_events(mark))
                return mask;
 
-       /* Interest in FS_MODIFY may be needed for clearing ignored mask */
+       /* Interest in FS_MODIFY may be needed for clearing ignore mask */
        if (!(mark->flags & FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY))
                mask |= FS_MODIFY;
 
@@ -671,7 +748,7 @@ static inline __u32 fsnotify_calc_mask(struct fsnotify_mark *mark)
         * If mark is interested in ignoring events on children, the object must
         * show interest in those events for fsnotify_parent() to notice it.
         */
-       return mask | (mark->ignored_mask & ALL_FSNOTIFY_EVENTS);
+       return mask | mark->ignore_mask;
 }
 
 /* Get mask of events for a list of marks */
index 2d2ccae933c207cc9818679129f37d66f78959c8..0ace7759acd22345908edc19280f451ab015f214 100644 (file)
@@ -348,7 +348,7 @@ struct vm_area_struct;
 #define GFP_DMA32      __GFP_DMA32
 #define GFP_HIGHUSER   (GFP_USER | __GFP_HIGHMEM)
 #define GFP_HIGHUSER_MOVABLE   (GFP_HIGHUSER | __GFP_MOVABLE | \
-                        __GFP_SKIP_KASAN_POISON)
+                        __GFP_SKIP_KASAN_POISON | __GFP_SKIP_KASAN_UNPOISON)
 #define GFP_TRANSHUGE_LIGHT    ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
                         __GFP_NOMEMALLOC | __GFP_NOWARN) & ~__GFP_RECLAIM)
 #define GFP_TRANSHUGE  (GFP_TRANSHUGE_LIGHT | __GFP_DIRECT_RECLAIM)
index 54c3c6506503f48f72e1620dd6a0452e30760d2b..6aeea1071b1b2d69643e4ff5dbc82b9f41df1189 100644 (file)
@@ -12,6 +12,8 @@
 #include <linux/property.h>
 #include <linux/types.h>
 
+#include <asm/msi.h>
+
 struct gpio_desc;
 struct of_phandle_args;
 struct device_node;
@@ -23,6 +25,13 @@ enum gpio_lookup_flags;
 
 struct gpio_chip;
 
+union gpio_irq_fwspec {
+       struct irq_fwspec       fwspec;
+#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
+       msi_alloc_info_t        msiinfo;
+#endif
+};
+
 #define GPIO_LINE_DIRECTION_IN 1
 #define GPIO_LINE_DIRECTION_OUT        0
 
@@ -103,9 +112,10 @@ struct gpio_irq_chip {
         * variant named &gpiochip_populate_parent_fwspec_fourcell is also
         * available.
         */
-       void *(*populate_parent_alloc_arg)(struct gpio_chip *gc,
-                                      unsigned int parent_hwirq,
-                                      unsigned int parent_type);
+       int (*populate_parent_alloc_arg)(struct gpio_chip *gc,
+                                        union gpio_irq_fwspec *fwspec,
+                                        unsigned int parent_hwirq,
+                                        unsigned int parent_type);
 
        /**
         * @child_offset_to_irq:
@@ -649,28 +659,14 @@ struct bgpio_pdata {
 
 #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
 
-void *gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
+int gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
+                                           union gpio_irq_fwspec *gfwspec,
+                                           unsigned int parent_hwirq,
+                                           unsigned int parent_type);
+int gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
+                                            union gpio_irq_fwspec *gfwspec,
                                             unsigned int parent_hwirq,
                                             unsigned int parent_type);
-void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
-                                             unsigned int parent_hwirq,
-                                             unsigned int parent_type);
-
-#else
-
-static inline void *gpiochip_populate_parent_fwspec_twocell(struct gpio_chip *gc,
-                                                   unsigned int parent_hwirq,
-                                                   unsigned int parent_type)
-{
-       return NULL;
-}
-
-static inline void *gpiochip_populate_parent_fwspec_fourcell(struct gpio_chip *gc,
-                                                    unsigned int parent_hwirq,
-                                                    unsigned int parent_type)
-{
-       return NULL;
-}
 
 #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */
 
index de29821231c9b304ffc21cf3c979ba397bc95716..4ddaf6ad73efa78d4030e207252a56b7710decc0 100644 (file)
@@ -461,4 +461,16 @@ static inline int split_folio_to_list(struct folio *folio,
        return split_huge_page_to_list(&folio->page, list);
 }
 
+/*
+ * archs that select ARCH_WANTS_THP_SWAP but don't support THP_SWP due to
+ * limitations in the implementation like arm64 MTE can override this to
+ * false
+ */
+#ifndef arch_thp_swp_supported
+static inline bool arch_thp_swp_supported(void)
+{
+       return true;
+}
+#endif
+
 #endif /* _LINUX_HUGE_MM_H */
index 426b1744215e397a01d7109674e52b1a0fd1baf1..81708ca0ebc74e0eae26c5d097432b25d1aa0806 100644 (file)
@@ -140,6 +140,11 @@ static inline int ima_measure_critical_data(const char *event_label,
 
 #endif /* CONFIG_IMA */
 
+#ifdef CONFIG_HAVE_IMA_KEXEC
+int __init ima_free_kexec_buffer(void);
+int __init ima_get_kexec_buffer(void **addr, size_t *size);
+#endif
+
 #ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT
 extern bool arch_ima_get_secureboot(void);
 extern const char * const *arch_get_ima_policy(void);
index 505308253d23ce49fed4b8f947437170ffa5571c..c3eb89606c2b17c01a930211080038eb5db7f157 100644 (file)
@@ -151,7 +151,9 @@ struct irq_common_data {
 #endif
        void                    *handler_data;
        struct msi_desc         *msi_desc;
+#ifdef CONFIG_SMP
        cpumask_var_t           affinity;
+#endif
 #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
        cpumask_var_t           effective_affinity;
 #endif
@@ -879,21 +881,34 @@ static inline int irq_data_get_node(struct irq_data *d)
        return irq_common_data_get_node(d->common);
 }
 
-static inline struct cpumask *irq_get_affinity_mask(int irq)
+static inline
+const struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
 {
-       struct irq_data *d = irq_get_irq_data(irq);
+#ifdef CONFIG_SMP
+       return d->common->affinity;
+#else
+       return cpumask_of(0);
+#endif
+}
 
-       return d ? d->common->affinity : NULL;
+static inline void irq_data_update_affinity(struct irq_data *d,
+                                           const struct cpumask *m)
+{
+#ifdef CONFIG_SMP
+       cpumask_copy(d->common->affinity, m);
+#endif
 }
 
-static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
+static inline const struct cpumask *irq_get_affinity_mask(int irq)
 {
-       return d->common->affinity;
+       struct irq_data *d = irq_get_irq_data(irq);
+
+       return d ? irq_data_get_affinity_mask(d) : NULL;
 }
 
 #ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
 static inline
-struct cpumask *irq_data_get_effective_affinity_mask(struct irq_data *d)
+const struct cpumask *irq_data_get_effective_affinity_mask(struct irq_data *d)
 {
        return d->common->effective_affinity;
 }
@@ -908,13 +923,14 @@ static inline void irq_data_update_effective_affinity(struct irq_data *d,
 {
 }
 static inline
-struct cpumask *irq_data_get_effective_affinity_mask(struct irq_data *d)
+const struct cpumask *irq_data_get_effective_affinity_mask(struct irq_data *d)
 {
-       return d->common->affinity;
+       return irq_data_get_affinity_mask(d);
 }
 #endif
 
-static inline struct cpumask *irq_get_effective_affinity_mask(unsigned int irq)
+static inline
+const struct cpumask *irq_get_effective_affinity_mask(unsigned int irq)
 {
        struct irq_data *d = irq_get_irq_data(irq);
 
@@ -1121,6 +1137,7 @@ int irq_gc_set_wake(struct irq_data *d, unsigned int on);
 /* Setup functions for irq_chip_generic */
 int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
                         irq_hw_number_t hw_irq);
+void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq);
 struct irq_chip_generic *
 irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
                       void __iomem *reg_base, irq_flow_handler_t handler);
index cb8455c87c8aaaa6774a7dc45f91562b85c95e30..aa1813749a4f1e19cf256959b518d928aca8d5f8 100644 (file)
@@ -4,4 +4,7 @@
 
 extern struct irq_chip icu_irq_chip;
 
+extern void icu_init_irq(void);
+extern void mmp2_init_icu(void);
+
 #endif /* __IRQCHIP_MMP_H */
index a77584593f7d1eace40ab092c508f9423def5651..1cd4e36890fbf680859c3daf2d8a9f9295c12b8d 100644 (file)
@@ -209,14 +209,15 @@ static inline void irq_set_handler_locked(struct irq_data *data,
  * Must be called with irq_desc locked and valid parameters.
  */
 static inline void
-irq_set_chip_handler_name_locked(struct irq_data *data, struct irq_chip *chip,
+irq_set_chip_handler_name_locked(struct irq_data *data,
+                                const struct irq_chip *chip,
                                 irq_flow_handler_t handler, const char *name)
 {
        struct irq_desc *desc = irq_data_to_desc(data);
 
        desc->handle_irq = handler;
        desc->name = name;
-       data->chip = chip;
+       data->chip = (struct irq_chip *)chip;
 }
 
 bool irq_check_status_bit(unsigned int irq, unsigned int bitmask);
index bf1eef337a074284904b61d970c0c72512baa620..570831ca9951841704f7b371a23029d1d021c1b2 100644 (file)
@@ -220,8 +220,6 @@ extern void jump_label_lock(void);
 extern void jump_label_unlock(void);
 extern void arch_jump_label_transform(struct jump_entry *entry,
                                      enum jump_label_type type);
-extern void arch_jump_label_transform_static(struct jump_entry *entry,
-                                            enum jump_label_type type);
 extern bool arch_jump_label_transform_queue(struct jump_entry *entry,
                                            enum jump_label_type type);
 extern void arch_jump_label_transform_apply(void);
@@ -230,12 +228,12 @@ extern void static_key_slow_inc(struct static_key *key);
 extern void static_key_slow_dec(struct static_key *key);
 extern void static_key_slow_inc_cpuslocked(struct static_key *key);
 extern void static_key_slow_dec_cpuslocked(struct static_key *key);
-extern void jump_label_apply_nops(struct module *mod);
 extern int static_key_count(struct static_key *key);
 extern void static_key_enable(struct static_key *key);
 extern void static_key_disable(struct static_key *key);
 extern void static_key_enable_cpuslocked(struct static_key *key);
 extern void static_key_disable_cpuslocked(struct static_key *key);
+extern enum jump_label_type jump_label_init_type(struct jump_entry *entry);
 
 /*
  * We should be using ATOMIC_INIT() for initializing .enabled, but
@@ -303,11 +301,6 @@ static inline int jump_label_text_reserved(void *start, void *end)
 static inline void jump_label_lock(void) {}
 static inline void jump_label_unlock(void) {}
 
-static inline int jump_label_apply_nops(struct module *mod)
-{
-       return 0;
-}
-
 static inline void static_key_enable(struct static_key *key)
 {
        STATIC_KEY_CHECK_USE(key);
index 69ae6b27846452392b9beacb2ba2fbb7278c731c..ddb5a358fd829f453d20f0c702f84cda168eef25 100644 (file)
@@ -28,6 +28,9 @@ enum cpu_usage_stat {
        CPUTIME_STEAL,
        CPUTIME_GUEST,
        CPUTIME_GUEST_NICE,
+#ifdef CONFIG_SCHED_CORE
+       CPUTIME_FORCEIDLE,
+#endif
        NR_STATS,
 };
 
@@ -115,4 +118,8 @@ extern void account_process_tick(struct task_struct *, int user);
 
 extern void account_idle_ticks(unsigned long ticks);
 
+#ifdef CONFIG_SCHED_CORE
+extern void __account_forceidle_time(struct task_struct *tsk, u64 delta);
+#endif
+
 #endif /* _LINUX_KERNEL_STAT_H */
index b6829b970093665db5f1fd783f1617de76409003..1f1099dac3f051535a8edc0929cb582ef9849782 100644 (file)
@@ -188,7 +188,7 @@ static inline void
 lockdep_init_map_waits(struct lockdep_map *lock, const char *name,
                       struct lock_class_key *key, int subclass, u8 inner, u8 outer)
 {
-       lockdep_init_map_type(lock, name, key, subclass, inner, LD_WAIT_INV, LD_LOCK_NORMAL);
+       lockdep_init_map_type(lock, name, key, subclass, inner, outer, LD_LOCK_NORMAL);
 }
 
 static inline void
@@ -211,24 +211,28 @@ static inline void lockdep_init_map(struct lockdep_map *lock, const char *name,
  * or they are too narrow (they suffer from a false class-split):
  */
 #define lockdep_set_class(lock, key)                           \
-       lockdep_init_map_waits(&(lock)->dep_map, #key, key, 0,  \
-                              (lock)->dep_map.wait_type_inner, \
-                              (lock)->dep_map.wait_type_outer)
+       lockdep_init_map_type(&(lock)->dep_map, #key, key, 0,   \
+                             (lock)->dep_map.wait_type_inner,  \
+                             (lock)->dep_map.wait_type_outer,  \
+                             (lock)->dep_map.lock_type)
 
 #define lockdep_set_class_and_name(lock, key, name)            \
-       lockdep_init_map_waits(&(lock)->dep_map, name, key, 0,  \
-                              (lock)->dep_map.wait_type_inner, \
-                              (lock)->dep_map.wait_type_outer)
+       lockdep_init_map_type(&(lock)->dep_map, name, key, 0,   \
+                             (lock)->dep_map.wait_type_inner,  \
+                             (lock)->dep_map.wait_type_outer,  \
+                             (lock)->dep_map.lock_type)
 
 #define lockdep_set_class_and_subclass(lock, key, sub)         \
-       lockdep_init_map_waits(&(lock)->dep_map, #key, key, sub,\
-                              (lock)->dep_map.wait_type_inner, \
-                              (lock)->dep_map.wait_type_outer)
+       lockdep_init_map_type(&(lock)->dep_map, #key, key, sub, \
+                             (lock)->dep_map.wait_type_inner,  \
+                             (lock)->dep_map.wait_type_outer,  \
+                             (lock)->dep_map.lock_type)
 
 #define lockdep_set_subclass(lock, sub)                                        \
-       lockdep_init_map_waits(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\
-                              (lock)->dep_map.wait_type_inner,         \
-                              (lock)->dep_map.wait_type_outer)
+       lockdep_init_map_type(&(lock)->dep_map, #lock, (lock)->dep_map.key, sub,\
+                             (lock)->dep_map.wait_type_inner,          \
+                             (lock)->dep_map.wait_type_outer,          \
+                             (lock)->dep_map.lock_type)
 
 #define lockdep_set_novalidate_class(lock) \
        lockdep_set_class_and_name(lock, &__lockdep_no_validate__, #lock)
index ed37dc40e82a821a990cc4442c61d8a8b6842c0f..f70a810c55f7d5e886df22cd027c48c50fdf7a16 100644 (file)
@@ -9,6 +9,7 @@ struct bcm2835_pm {
        struct device *dev;
        void __iomem *base;
        void __iomem *asb;
+       void __iomem *rpivid_asb;
 };
 
 #endif /* BCM2835_MFD_PM_H */
index cf3d0d673f6be67fd978ef8c0d3f277a81c132b7..7898e29bcfb5448178004f196d583d2e362b20f6 100644 (file)
@@ -1130,23 +1130,27 @@ static inline bool is_zone_movable_page(const struct page *page)
 #if defined(CONFIG_ZONE_DEVICE) && defined(CONFIG_FS_DAX)
 DECLARE_STATIC_KEY_FALSE(devmap_managed_key);
 
-bool __put_devmap_managed_page(struct page *page);
-static inline bool put_devmap_managed_page(struct page *page)
+bool __put_devmap_managed_page_refs(struct page *page, int refs);
+static inline bool put_devmap_managed_page_refs(struct page *page, int refs)
 {
        if (!static_branch_unlikely(&devmap_managed_key))
                return false;
        if (!is_zone_device_page(page))
                return false;
-       return __put_devmap_managed_page(page);
+       return __put_devmap_managed_page_refs(page, refs);
 }
-
 #else /* CONFIG_ZONE_DEVICE && CONFIG_FS_DAX */
-static inline bool put_devmap_managed_page(struct page *page)
+static inline bool put_devmap_managed_page_refs(struct page *page, int refs)
 {
        return false;
 }
 #endif /* CONFIG_ZONE_DEVICE && CONFIG_FS_DAX */
 
+static inline bool put_devmap_managed_page(struct page *page)
+{
+       return put_devmap_managed_page_refs(page, 1);
+}
+
 /* 127: arbitrary random number, small enough to assemble well */
 #define folio_ref_zero_or_close_to_overflow(folio) \
        ((unsigned int) folio_ref_count(folio) + 127u <= 127u)
index ee5a217de2a8808cecd0f0f605d38aab88f39fdf..f6e5369d2928e9a96ca1ba2becb3eaeaa4b6e172 100644 (file)
@@ -13,6 +13,129 @@ struct user_namespace;
  */
 extern struct user_namespace init_user_ns;
 
+typedef struct {
+       uid_t val;
+} vfsuid_t;
+
+typedef struct {
+       gid_t val;
+} vfsgid_t;
+
+static_assert(sizeof(vfsuid_t) == sizeof(kuid_t));
+static_assert(sizeof(vfsgid_t) == sizeof(kgid_t));
+static_assert(offsetof(vfsuid_t, val) == offsetof(kuid_t, val));
+static_assert(offsetof(vfsgid_t, val) == offsetof(kgid_t, val));
+
+#ifdef CONFIG_MULTIUSER
+static inline uid_t __vfsuid_val(vfsuid_t uid)
+{
+       return uid.val;
+}
+
+static inline gid_t __vfsgid_val(vfsgid_t gid)
+{
+       return gid.val;
+}
+#else
+static inline uid_t __vfsuid_val(vfsuid_t uid)
+{
+       return 0;
+}
+
+static inline gid_t __vfsgid_val(vfsgid_t gid)
+{
+       return 0;
+}
+#endif
+
+static inline bool vfsuid_valid(vfsuid_t uid)
+{
+       return __vfsuid_val(uid) != (uid_t)-1;
+}
+
+static inline bool vfsgid_valid(vfsgid_t gid)
+{
+       return __vfsgid_val(gid) != (gid_t)-1;
+}
+
+static inline bool vfsuid_eq(vfsuid_t left, vfsuid_t right)
+{
+       return vfsuid_valid(left) && __vfsuid_val(left) == __vfsuid_val(right);
+}
+
+static inline bool vfsgid_eq(vfsgid_t left, vfsgid_t right)
+{
+       return vfsgid_valid(left) && __vfsgid_val(left) == __vfsgid_val(right);
+}
+
+/**
+ * vfsuid_eq_kuid - check whether kuid and vfsuid have the same value
+ * @vfsuid: the vfsuid to compare
+ * @kuid: the kuid to compare
+ *
+ * Check whether @vfsuid and @kuid have the same values.
+ *
+ * Return: true if @vfsuid and @kuid have the same value, false if not.
+ * Comparison between two invalid uids returns false.
+ */
+static inline bool vfsuid_eq_kuid(vfsuid_t vfsuid, kuid_t kuid)
+{
+       return vfsuid_valid(vfsuid) && __vfsuid_val(vfsuid) == __kuid_val(kuid);
+}
+
+/**
+ * vfsgid_eq_kgid - check whether kgid and vfsgid have the same value
+ * @vfsgid: the vfsgid to compare
+ * @kgid: the kgid to compare
+ *
+ * Check whether @vfsgid and @kgid have the same values.
+ *
+ * Return: true if @vfsgid and @kgid have the same value, false if not.
+ * Comparison between two invalid gids returns false.
+ */
+static inline bool vfsgid_eq_kgid(vfsgid_t vfsgid, kgid_t kgid)
+{
+       return vfsgid_valid(vfsgid) && __vfsgid_val(vfsgid) == __kgid_val(kgid);
+}
+
+/*
+ * vfs{g,u}ids are created from k{g,u}ids.
+ * We don't allow them to be created from regular {u,g}id.
+ */
+#define VFSUIDT_INIT(val) (vfsuid_t){ __kuid_val(val) }
+#define VFSGIDT_INIT(val) (vfsgid_t){ __kgid_val(val) }
+
+#define INVALID_VFSUID VFSUIDT_INIT(INVALID_UID)
+#define INVALID_VFSGID VFSGIDT_INIT(INVALID_GID)
+
+/*
+ * Allow a vfs{g,u}id to be used as a k{g,u}id where we want to compare
+ * whether the mapped value is identical to value of a k{g,u}id.
+ */
+#define AS_KUIDT(val) (kuid_t){ __vfsuid_val(val) }
+#define AS_KGIDT(val) (kgid_t){ __vfsgid_val(val) }
+
+#ifdef CONFIG_MULTIUSER
+/**
+ * vfsgid_in_group_p() - check whether a vfsuid matches the caller's groups
+ * @vfsgid: the mnt gid to match
+ *
+ * This function can be used to determine whether @vfsuid matches any of the
+ * caller's groups.
+ *
+ * Return: 1 if vfsuid matches caller's groups, 0 if not.
+ */
+static inline int vfsgid_in_group_p(vfsgid_t vfsgid)
+{
+       return in_group_p(AS_KGIDT(vfsgid));
+}
+#else
+static inline int vfsgid_in_group_p(vfsgid_t vfsgid)
+{
+       return 1;
+}
+#endif
+
 /**
  * initial_idmapping - check whether this is the initial mapping
  * @ns: idmapping to check
@@ -48,7 +171,7 @@ static inline bool no_idmapping(const struct user_namespace *mnt_userns,
 }
 
 /**
- * mapped_kuid_fs - map a filesystem kuid into a mnt_userns
+ * make_vfsuid - map a filesystem kuid into a mnt_userns
  * @mnt_userns: the mount's idmapping
  * @fs_userns: the filesystem's idmapping
  * @kuid : kuid to be mapped
@@ -67,25 +190,33 @@ static inline bool no_idmapping(const struct user_namespace *mnt_userns,
  * If @kuid has no mapping in either @mnt_userns or @fs_userns INVALID_UID is
  * returned.
  */
-static inline kuid_t mapped_kuid_fs(struct user_namespace *mnt_userns,
-                                   struct user_namespace *fs_userns,
-                                   kuid_t kuid)
+
+static inline vfsuid_t make_vfsuid(struct user_namespace *mnt_userns,
+                                  struct user_namespace *fs_userns,
+                                  kuid_t kuid)
 {
        uid_t uid;
 
        if (no_idmapping(mnt_userns, fs_userns))
-               return kuid;
+               return VFSUIDT_INIT(kuid);
        if (initial_idmapping(fs_userns))
                uid = __kuid_val(kuid);
        else
                uid = from_kuid(fs_userns, kuid);
        if (uid == (uid_t)-1)
-               return INVALID_UID;
-       return make_kuid(mnt_userns, uid);
+               return INVALID_VFSUID;
+       return VFSUIDT_INIT(make_kuid(mnt_userns, uid));
+}
+
+static inline kuid_t mapped_kuid_fs(struct user_namespace *mnt_userns,
+                                   struct user_namespace *fs_userns,
+                                   kuid_t kuid)
+{
+       return AS_KUIDT(make_vfsuid(mnt_userns, fs_userns, kuid));
 }
 
 /**
- * mapped_kgid_fs - map a filesystem kgid into a mnt_userns
+ * make_vfsgid - map a filesystem kgid into a mnt_userns
  * @mnt_userns: the mount's idmapping
  * @fs_userns: the filesystem's idmapping
  * @kgid : kgid to be mapped
@@ -104,21 +235,56 @@ static inline kuid_t mapped_kuid_fs(struct user_namespace *mnt_userns,
  * If @kgid has no mapping in either @mnt_userns or @fs_userns INVALID_GID is
  * returned.
  */
-static inline kgid_t mapped_kgid_fs(struct user_namespace *mnt_userns,
-                                   struct user_namespace *fs_userns,
-                                   kgid_t kgid)
+
+static inline vfsgid_t make_vfsgid(struct user_namespace *mnt_userns,
+                                  struct user_namespace *fs_userns,
+                                  kgid_t kgid)
 {
        gid_t gid;
 
        if (no_idmapping(mnt_userns, fs_userns))
-               return kgid;
+               return VFSGIDT_INIT(kgid);
        if (initial_idmapping(fs_userns))
                gid = __kgid_val(kgid);
        else
                gid = from_kgid(fs_userns, kgid);
        if (gid == (gid_t)-1)
-               return INVALID_GID;
-       return make_kgid(mnt_userns, gid);
+               return INVALID_VFSGID;
+       return VFSGIDT_INIT(make_kgid(mnt_userns, gid));
+}
+
+static inline kgid_t mapped_kgid_fs(struct user_namespace *mnt_userns,
+                                   struct user_namespace *fs_userns,
+                                   kgid_t kgid)
+{
+       return AS_KGIDT(make_vfsgid(mnt_userns, fs_userns, kgid));
+}
+
+/**
+ * from_vfsuid - map a vfsuid into the filesystem idmapping
+ * @mnt_userns: the mount's idmapping
+ * @fs_userns: the filesystem's idmapping
+ * @vfsuid : vfsuid to be mapped
+ *
+ * Map @vfsuid into the filesystem idmapping. This function has to be used in
+ * order to e.g. write @vfsuid to inode->i_uid.
+ *
+ * Return: @vfsuid mapped into the filesystem idmapping
+ */
+static inline kuid_t from_vfsuid(struct user_namespace *mnt_userns,
+                                struct user_namespace *fs_userns,
+                                vfsuid_t vfsuid)
+{
+       uid_t uid;
+
+       if (no_idmapping(mnt_userns, fs_userns))
+               return AS_KUIDT(vfsuid);
+       uid = from_kuid(mnt_userns, AS_KUIDT(vfsuid));
+       if (uid == (uid_t)-1)
+               return INVALID_UID;
+       if (initial_idmapping(fs_userns))
+               return KUIDT_INIT(uid);
+       return make_kuid(fs_userns, uid);
 }
 
 /**
@@ -145,16 +311,66 @@ static inline kuid_t mapped_kuid_user(struct user_namespace *mnt_userns,
                                      struct user_namespace *fs_userns,
                                      kuid_t kuid)
 {
-       uid_t uid;
+       return from_vfsuid(mnt_userns, fs_userns, VFSUIDT_INIT(kuid));
+}
+
+/**
+ * vfsuid_has_fsmapping - check whether a vfsuid maps into the filesystem
+ * @mnt_userns: the mount's idmapping
+ * @fs_userns: the filesystem's idmapping
+ * @vfsuid: vfsuid to be mapped
+ *
+ * Check whether @vfsuid has a mapping in the filesystem idmapping. Use this
+ * function to check whether the filesystem idmapping has a mapping for
+ * @vfsuid.
+ *
+ * Return: true if @vfsuid has a mapping in the filesystem, false if not.
+ */
+static inline bool vfsuid_has_fsmapping(struct user_namespace *mnt_userns,
+                                       struct user_namespace *fs_userns,
+                                       vfsuid_t vfsuid)
+{
+       return uid_valid(from_vfsuid(mnt_userns, fs_userns, vfsuid));
+}
+
+/**
+ * vfsuid_into_kuid - convert vfsuid into kuid
+ * @vfsuid: the vfsuid to convert
+ *
+ * This can be used when a vfsuid is committed as a kuid.
+ *
+ * Return: a kuid with the value of @vfsuid
+ */
+static inline kuid_t vfsuid_into_kuid(vfsuid_t vfsuid)
+{
+       return AS_KUIDT(vfsuid);
+}
+
+/**
+ * from_vfsgid - map a vfsgid into the filesystem idmapping
+ * @mnt_userns: the mount's idmapping
+ * @fs_userns: the filesystem's idmapping
+ * @vfsgid : vfsgid to be mapped
+ *
+ * Map @vfsgid into the filesystem idmapping. This function has to be used in
+ * order to e.g. write @vfsgid to inode->i_gid.
+ *
+ * Return: @vfsgid mapped into the filesystem idmapping
+ */
+static inline kgid_t from_vfsgid(struct user_namespace *mnt_userns,
+                                struct user_namespace *fs_userns,
+                                vfsgid_t vfsgid)
+{
+       gid_t gid;
 
        if (no_idmapping(mnt_userns, fs_userns))
-               return kuid;
-       uid = from_kuid(mnt_userns, kuid);
-       if (uid == (uid_t)-1)
-               return INVALID_UID;
+               return AS_KGIDT(vfsgid);
+       gid = from_kgid(mnt_userns, AS_KGIDT(vfsgid));
+       if (gid == (gid_t)-1)
+               return INVALID_GID;
        if (initial_idmapping(fs_userns))
-               return KUIDT_INIT(uid);
-       return make_kuid(fs_userns, uid);
+               return KGIDT_INIT(gid);
+       return make_kgid(fs_userns, gid);
 }
 
 /**
@@ -181,16 +397,39 @@ static inline kgid_t mapped_kgid_user(struct user_namespace *mnt_userns,
                                      struct user_namespace *fs_userns,
                                      kgid_t kgid)
 {
-       gid_t gid;
+       return from_vfsgid(mnt_userns, fs_userns, VFSGIDT_INIT(kgid));
+}
 
-       if (no_idmapping(mnt_userns, fs_userns))
-               return kgid;
-       gid = from_kgid(mnt_userns, kgid);
-       if (gid == (gid_t)-1)
-               return INVALID_GID;
-       if (initial_idmapping(fs_userns))
-               return KGIDT_INIT(gid);
-       return make_kgid(fs_userns, gid);
+/**
+ * vfsgid_has_fsmapping - check whether a vfsgid maps into the filesystem
+ * @mnt_userns: the mount's idmapping
+ * @fs_userns: the filesystem's idmapping
+ * @vfsgid: vfsgid to be mapped
+ *
+ * Check whether @vfsgid has a mapping in the filesystem idmapping. Use this
+ * function to check whether the filesystem idmapping has a mapping for
+ * @vfsgid.
+ *
+ * Return: true if @vfsgid has a mapping in the filesystem, false if not.
+ */
+static inline bool vfsgid_has_fsmapping(struct user_namespace *mnt_userns,
+                                       struct user_namespace *fs_userns,
+                                       vfsgid_t vfsgid)
+{
+       return gid_valid(from_vfsgid(mnt_userns, fs_userns, vfsgid));
+}
+
+/**
+ * vfsgid_into_kgid - convert vfsgid into kgid
+ * @vfsgid: the vfsgid to convert
+ *
+ * This can be used when a vfsgid is committed as a kgid.
+ *
+ * Return: a kgid with the value of @vfsgid
+ */
+static inline kgid_t vfsgid_into_kgid(vfsgid_t vfsgid)
+{
+       return AS_KGIDT(vfsgid);
 }
 
 /**
@@ -209,7 +448,8 @@ static inline kgid_t mapped_kgid_user(struct user_namespace *mnt_userns,
 static inline kuid_t mapped_fsuid(struct user_namespace *mnt_userns,
                                  struct user_namespace *fs_userns)
 {
-       return mapped_kuid_user(mnt_userns, fs_userns, current_fsuid());
+       return from_vfsuid(mnt_userns, fs_userns,
+                          VFSUIDT_INIT(current_fsuid()));
 }
 
 /**
@@ -228,7 +468,8 @@ static inline kuid_t mapped_fsuid(struct user_namespace *mnt_userns,
 static inline kgid_t mapped_fsgid(struct user_namespace *mnt_userns,
                                  struct user_namespace *fs_userns)
 {
-       return mapped_kgid_user(mnt_userns, fs_userns, current_fsgid());
+       return from_vfsgid(mnt_userns, fs_userns,
+                          VFSGIDT_INIT(current_fsgid()));
 }
 
 #endif /* _LINUX_MNT_IDMAPPING_H */
index f0a5d6b10c5a7af542c9c9f41440ba0f133a9571..20a4e7cb7afe5c808d9f9bf94a88eac1e0be4cd2 100644 (file)
@@ -441,8 +441,6 @@ void *of_kexec_alloc_and_setup_fdt(const struct kimage *image,
                                   unsigned long initrd_load_addr,
                                   unsigned long initrd_len,
                                   const char *cmdline, size_t extra_fdt_size);
-int ima_get_kexec_buffer(void **addr, size_t *size);
-int ima_free_kexec_buffer(void);
 #else /* CONFIG_OF */
 
 static inline void of_core_init(void)
index 861e606b820fab8b09aa0e781ea7a270a17a2776..b7bce4983638f8c7d14388142e048f4ddde8b187 100644 (file)
@@ -9,15 +9,27 @@
  */
 #define DO_ONCE_LITE(func, ...)                                                \
        DO_ONCE_LITE_IF(true, func, ##__VA_ARGS__)
-#define DO_ONCE_LITE_IF(condition, func, ...)                          \
+
+#define __ONCE_LITE_IF(condition)                                      \
        ({                                                              \
                static bool __section(".data.once") __already_done;     \
-               bool __ret_do_once = !!(condition);                     \
+               bool __ret_cond = !!(condition);                        \
+               bool __ret_once = false;                                \
                                                                        \
-               if (unlikely(__ret_do_once && !__already_done)) {       \
+               if (unlikely(__ret_cond && !__already_done)) {          \
                        __already_done = true;                          \
-                       func(__VA_ARGS__);                              \
+                       __ret_once = true;                              \
                }                                                       \
+               unlikely(__ret_once);                                   \
+       })
+
+#define DO_ONCE_LITE_IF(condition, func, ...)                          \
+       ({                                                              \
+               bool __ret_do_once = !!(condition);                     \
+                                                                       \
+               if (__ONCE_LITE_IF(__ret_do_once))                      \
+                       func(__VA_ARGS__);                              \
+                                                                       \
                unlikely(__ret_do_once);                                \
        })
 
index 0178823ce8c20a9cf896f91be03db25af1967a5e..7fa460ccf7fa17cd770949dc599e9a56aeb77a47 100644 (file)
 #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493
 #define PCI_DEVICE_ID_AMD_17H_M60H_DF_F3 0x144b
 #define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
+#define PCI_DEVICE_ID_AMD_17H_MA0H_DF_F3 0x1727
 #define PCI_DEVICE_ID_AMD_19H_DF_F3    0x1653
 #define PCI_DEVICE_ID_AMD_19H_M10H_DF_F3 0x14b0
 #define PCI_DEVICE_ID_AMD_19H_M40H_DF_F3 0x167c
 #define PCI_DEVICE_ID_AMD_19H_M50H_DF_F3 0x166d
+#define PCI_DEVICE_ID_AMD_19H_M60H_DF_F3 0x14e3
+#define PCI_DEVICE_ID_AMD_19H_M70H_DF_F3 0x14f3
 #define PCI_DEVICE_ID_AMD_CNB17H_F3    0x1703
 #define PCI_DEVICE_ID_AMD_LANCE                0x2000
 #define PCI_DEVICE_ID_AMD_LANCE_HOME   0x2001
index 46f9b6fe306e7890b9796ef480af8dfd50308f4f..bf66fe011fa81d5cf123c31485be2d93bf0cb9f6 100644 (file)
@@ -56,9 +56,13 @@ struct riscv_pmu {
 
        struct cpu_hw_events    __percpu *hw_events;
        struct hlist_node       node;
+       struct notifier_block   riscv_pm_nb;
 };
 
 #define to_riscv_pmu(p) (container_of(p, struct riscv_pmu, pmu))
+
+void riscv_pmu_start(struct perf_event *event, int flags);
+void riscv_pmu_stop(struct perf_event *event, int flags);
 unsigned long riscv_pmu_ctr_read_csr(unsigned long csr);
 int riscv_pmu_event_set_period(struct perf_event *event);
 uint64_t riscv_pmu_ctr_get_width_mask(struct perf_event *event);
index da759560eec5646f51ec8af94b2d561b786c3a2b..ee8b9ecdc03b752d0aa093f7d5446b01beb4e077 100644 (file)
@@ -759,6 +759,8 @@ struct perf_event {
        struct pid_namespace            *ns;
        u64                             id;
 
+       atomic64_t                      lost_samples;
+
        u64                             (*clock)(void);
        perf_overflow_handler_t         overflow_handler;
        void                            *overflow_handler_context;
index b65c877d92b8b2e5fde978a34671542b3eaa5dcc..7d1e604c13250bfb0c8e8d8d588668f0deb174da 100644 (file)
@@ -73,6 +73,7 @@ extern int set_posix_acl(struct user_namespace *, struct inode *, int,
                         struct posix_acl *);
 
 struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type);
+struct posix_acl *posix_acl_clone(const struct posix_acl *acl, gfp_t flags);
 
 #ifdef CONFIG_FS_POSIX_ACL
 int posix_acl_chmod(struct user_namespace *, struct inode *, umode_t);
index 1766e1de695600968b9501c7d51d6a4db00b53a3..b6bd3eac2bcc885ebbee9f2bbcb525dd81991a17 100644 (file)
@@ -33,21 +33,31 @@ posix_acl_xattr_count(size_t size)
 }
 
 #ifdef CONFIG_FS_POSIX_ACL
-void posix_acl_fix_xattr_from_user(struct user_namespace *mnt_userns,
-                                  struct inode *inode,
-                                  void *value, size_t size);
-void posix_acl_fix_xattr_to_user(struct user_namespace *mnt_userns,
-                                  struct inode *inode,
-                                void *value, size_t size);
+void posix_acl_fix_xattr_from_user(void *value, size_t size);
+void posix_acl_fix_xattr_to_user(void *value, size_t size);
+void posix_acl_getxattr_idmapped_mnt(struct user_namespace *mnt_userns,
+                                    const struct inode *inode,
+                                    void *value, size_t size);
+void posix_acl_setxattr_idmapped_mnt(struct user_namespace *mnt_userns,
+                                    const struct inode *inode,
+                                    void *value, size_t size);
 #else
-static inline void posix_acl_fix_xattr_from_user(struct user_namespace *mnt_userns,
-                                                struct inode *inode,
-                                                void *value, size_t size)
+static inline void posix_acl_fix_xattr_from_user(void *value, size_t size)
 {
 }
-static inline void posix_acl_fix_xattr_to_user(struct user_namespace *mnt_userns,
-                                              struct inode *inode,
-                                              void *value, size_t size)
+static inline void posix_acl_fix_xattr_to_user(void *value, size_t size)
+{
+}
+static inline void
+posix_acl_getxattr_idmapped_mnt(struct user_namespace *mnt_userns,
+                               const struct inode *inode, void *value,
+                               size_t size)
+{
+}
+static inline void
+posix_acl_setxattr_idmapped_mnt(struct user_namespace *mnt_userns,
+                               const struct inode *inode, void *value,
+                               size_t size)
 {
 }
 #endif
index 9771a0761a40e016c0f8a7696489091c0ebc9d97..9429930c556696b38e2249200a689e8611b56374 100644 (file)
@@ -6,9 +6,6 @@
 #include <linux/mutex.h>
 #include <linux/of.h>
 
-struct pwm_capture;
-struct seq_file;
-
 struct pwm_chip;
 
 /**
@@ -251,6 +248,16 @@ pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle,
        return 0;
 }
 
+/**
+ * struct pwm_capture - PWM capture data
+ * @period: period of the PWM signal (in nanoseconds)
+ * @duty_cycle: duty cycle of the PWM signal (in nanoseconds)
+ */
+struct pwm_capture {
+       unsigned int period;
+       unsigned int duty_cycle;
+};
+
 /**
  * struct pwm_ops - PWM controller operations
  * @request: optional hook for requesting a PWM
@@ -261,10 +268,6 @@ pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle,
  *            called once per PWM device when the PWM chip is
  *            registered.
  * @owner: helps prevent removal of modules exporting active PWMs
- * @config: configure duty cycles and period length for this PWM
- * @set_polarity: configure the polarity of this PWM
- * @enable: enable PWM output toggling
- * @disable: disable PWM output toggling
  */
 struct pwm_ops {
        int (*request)(struct pwm_chip *chip, struct pwm_device *pwm);
@@ -276,14 +279,6 @@ struct pwm_ops {
        void (*get_state)(struct pwm_chip *chip, struct pwm_device *pwm,
                          struct pwm_state *state);
        struct module *owner;
-
-       /* Only used by legacy drivers */
-       int (*config)(struct pwm_chip *chip, struct pwm_device *pwm,
-                     int duty_ns, int period_ns);
-       int (*set_polarity)(struct pwm_chip *chip, struct pwm_device *pwm,
-                           enum pwm_polarity polarity);
-       int (*enable)(struct pwm_chip *chip, struct pwm_device *pwm);
-       void (*disable)(struct pwm_chip *chip, struct pwm_device *pwm);
 };
 
 /**
@@ -312,16 +307,6 @@ struct pwm_chip {
        struct pwm_device *pwms;
 };
 
-/**
- * struct pwm_capture - PWM capture data
- * @period: period of the PWM signal (in nanoseconds)
- * @duty_cycle: duty cycle of the PWM signal (in nanoseconds)
- */
-struct pwm_capture {
-       unsigned int period;
-       unsigned int duty_cycle;
-};
-
 #if IS_ENABLED(CONFIG_PWM)
 /* PWM user APIs */
 struct pwm_device *pwm_request(int pwm_id, const char *label);
index a0f6668924d3ef068635e54ceef71d59421fe099..0d8625d717339ebbbe4c6d990cbb1680330e0288 100644 (file)
@@ -20,11 +20,12 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb)
 }
 
 /* i_mutex must being held */
-static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
+static inline bool is_quota_modification(struct user_namespace *mnt_userns,
+                                        struct inode *inode, struct iattr *ia)
 {
-       return (ia->ia_valid & ATTR_SIZE) ||
-               (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) ||
-               (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid));
+       return ((ia->ia_valid & ATTR_SIZE) ||
+               i_uid_needs_update(mnt_userns, ia, inode) ||
+               i_gid_needs_update(mnt_userns, ia, inode));
 }
 
 #if defined(CONFIG_QUOTA)
@@ -115,7 +116,8 @@ int dquot_set_dqblk(struct super_block *sb, struct kqid id,
                struct qc_dqblk *di);
 
 int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
-int dquot_transfer(struct inode *inode, struct iattr *iattr);
+int dquot_transfer(struct user_namespace *mnt_userns, struct inode *inode,
+                  struct iattr *iattr);
 
 static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
 {
@@ -234,7 +236,8 @@ static inline void dquot_free_inode(struct inode *inode)
 {
 }
 
-static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
+static inline int dquot_transfer(struct user_namespace *mnt_userns,
+                                struct inode *inode, struct iattr *iattr)
 {
        return 0;
 }
index 8952fa3d0d59332d494f95e5a94bc97aee838d29..7cf2157134acd475e61e1cd3632dc6d2dc356573 100644 (file)
@@ -1336,6 +1336,22 @@ static inline int regmap_field_update_bits(struct regmap_field *field,
                                             NULL, false, false);
 }
 
+static inline int regmap_field_set_bits(struct regmap_field *field,
+                                       unsigned int bits)
+{
+       return regmap_field_update_bits_base(field, bits, bits, NULL, false,
+                                            false);
+}
+
+static inline int regmap_field_clear_bits(struct regmap_field *field,
+                                         unsigned int bits)
+{
+       return regmap_field_update_bits_base(field, bits, 0, NULL, false,
+                                            false);
+}
+
+int regmap_field_test_bits(struct regmap_field *field, unsigned int bits);
+
 static inline int
 regmap_field_force_update_bits(struct regmap_field *field,
                               unsigned int mask, unsigned int val)
@@ -1424,6 +1440,8 @@ struct regmap_irq_sub_irq_map {
        unsigned int *offset;
 };
 
+struct regmap_irq_chip_data;
+
 /**
  * struct regmap_irq_chip - Description of a generic regmap irq_chip.
  *
@@ -1451,32 +1469,50 @@ struct regmap_irq_sub_irq_map {
  *                main_status set.
  *
  * @status_base: Base status register address.
- * @mask_base:   Base mask register address.
- * @mask_writeonly: Base mask register is write only.
- * @unmask_base:  Base unmask register address. for chips who have
- *                separate mask and unmask registers
+ * @mask_base:   Base mask register address. Mask bits are set to 1 when an
+ *               interrupt is masked, 0 when unmasked.
+ * @unmask_base:  Base unmask register address. Unmask bits are set to 1 when
+ *                an interrupt is unmasked and 0 when masked.
  * @ack_base:    Base ack address. If zero then the chip is clear on read.
  *               Using zero value is possible with @use_ack bit.
  * @wake_base:   Base address for wake enables.  If zero unsupported.
- * @type_base:   Base address for irq type.  If zero unsupported.
- * @virt_reg_base:   Base addresses for extra config regs.
+ * @type_base:   Base address for irq type.  If zero unsupported.  Deprecated,
+ *              use @config_base instead.
+ * @virt_reg_base:   Base addresses for extra config regs. Deprecated, use
+ *                  @config_base instead.
+ * @config_base: Base address for IRQ type config regs. If null unsupported.
  * @irq_reg_stride:  Stride to use for chips where registers are not contiguous.
  * @init_ack_masked: Ack all masked interrupts once during initalization.
  * @mask_invert: Inverted mask register: cleared bits are masked out.
+ *              Deprecated; prefer describing an inverted mask register as
+ *              an unmask register.
+ * @mask_unmask_non_inverted: Controls mask bit inversion for chips that set
+ *     both @mask_base and @unmask_base. If false, mask and unmask bits are
+ *     inverted (which is deprecated behavior); if true, bits will not be
+ *     inverted and the registers keep their normal behavior. Note that if
+ *     you use only one of @mask_base or @unmask_base, this flag has no
+ *     effect and is unnecessary. Any new drivers that set both @mask_base
+ *     and @unmask_base should set this to true to avoid relying on the
+ *     deprecated behavior.
  * @use_ack:     Use @ack register even if it is zero.
  * @ack_invert:  Inverted ack register: cleared bits for ack.
  * @clear_ack:  Use this to set 1 and 0 or vice-versa to clear interrupts.
  * @wake_invert: Inverted wake register: cleared bits are wake enabled.
- * @type_invert: Invert the type flags.
- * @type_in_mask: Use the mask registers for controlling irq type. For
- *                interrupts defining type_rising/falling_mask use mask_base
- *                for edge configuration and never update bits in type_base.
+ * @type_invert: Invert the type flags. Deprecated, use config registers
+ *              instead.
+ * @type_in_mask: Use the mask registers for controlling irq type. Use this if
+ *               the hardware provides separate bits for rising/falling edge
+ *               or low/high level interrupts and they should be combined into
+ *               a single logical interrupt. Use &struct regmap_irq_type data
+ *               to define the mask bit for each irq type.
  * @clear_on_unmask: For chips with interrupts cleared on read: read the status
  *                   registers before unmasking interrupts to clear any bits
  *                   set when they were masked.
  * @not_fixed_stride: Used when chip peripherals are not laid out with fixed
- *                   stride. Must be used with sub_reg_offsets containing the
- *                   offsets to each peripheral.
+ *                   stride. Must be used with sub_reg_offsets containing the
+ *                   offsets to each peripheral. Deprecated; the same thing
+ *                   can be accomplished with a @get_irq_reg callback, without
+ *                   the need for a @sub_reg_offsets table.
  * @status_invert: Inverted status register: cleared bits are active interrupts.
  * @runtime_pm:  Hold a runtime PM lock on the device when accessing it.
  *
@@ -1484,17 +1520,28 @@ struct regmap_irq_sub_irq_map {
  * @irqs:        Descriptors for individual IRQs.  Interrupt numbers are
  *               assigned based on the index in the array of the interrupt.
  * @num_irqs:    Number of descriptors.
- * @num_type_reg:    Number of type registers.
+ * @num_type_reg:    Number of type registers. Deprecated, use config registers
+ *                  instead.
  * @num_virt_regs:   Number of non-standard irq configuration registers.
- *                  If zero unsupported.
- * @type_reg_stride: Stride to use for chips where type registers are not
- *                     contiguous.
+ *                  If zero unsupported. Deprecated, use config registers
+ *                  instead.
+ * @num_config_bases:  Number of config base registers.
+ * @num_config_regs:   Number of config registers for each config base register.
  * @handle_pre_irq:  Driver specific callback to handle interrupt from device
  *                  before regmap_irq_handler process the interrupts.
  * @handle_post_irq: Driver specific callback to handle interrupt from device
  *                  after handling the interrupts in regmap_irq_handler().
  * @set_type_virt:   Driver specific callback to extend regmap_irq_set_type()
- *                  and configure virt regs.
+ *                  and configure virt regs. Deprecated, use @set_type_config
+ *                  callback and config registers instead.
+ * @set_type_config: Callback used for configuring irq types.
+ * @get_irq_reg: Callback for mapping (base register, index) pairs to register
+ *              addresses. The base register will be one of @status_base,
+ *              @mask_base, etc., @main_status, or any of @config_base.
+ *              The index will be in the range [0, num_main_regs[ for the
+ *              main status base, [0, num_type_settings[ for any config
+ *              register base, and [0, num_regs[ for any other base.
+ *              If unspecified then regmap_irq_get_irq_reg_linear() is used.
  * @irq_drv_data:    Driver specific IRQ data which is passed as parameter when
  *                  driver specific pre/post interrupt handler is called.
  *
@@ -1517,20 +1564,21 @@ struct regmap_irq_chip {
        unsigned int wake_base;
        unsigned int type_base;
        unsigned int *virt_reg_base;
+       const unsigned int *config_base;
        unsigned int irq_reg_stride;
-       bool mask_writeonly:1;
-       bool init_ack_masked:1;
-       bool mask_invert:1;
-       bool use_ack:1;
-       bool ack_invert:1;
-       bool clear_ack:1;
-       bool wake_invert:1;
-       bool runtime_pm:1;
-       bool type_invert:1;
-       bool type_in_mask:1;
-       bool clear_on_unmask:1;
-       bool not_fixed_stride:1;
-       bool status_invert:1;
+       unsigned int init_ack_masked:1;
+       unsigned int mask_invert:1;
+       unsigned int mask_unmask_non_inverted:1;
+       unsigned int use_ack:1;
+       unsigned int ack_invert:1;
+       unsigned int clear_ack:1;
+       unsigned int wake_invert:1;
+       unsigned int runtime_pm:1;
+       unsigned int type_invert:1;
+       unsigned int type_in_mask:1;
+       unsigned int clear_on_unmask:1;
+       unsigned int not_fixed_stride:1;
+       unsigned int status_invert:1;
 
        int num_regs;
 
@@ -1539,16 +1587,24 @@ struct regmap_irq_chip {
 
        int num_type_reg;
        int num_virt_regs;
-       unsigned int type_reg_stride;
+       int num_config_bases;
+       int num_config_regs;
 
        int (*handle_pre_irq)(void *irq_drv_data);
        int (*handle_post_irq)(void *irq_drv_data);
        int (*set_type_virt)(unsigned int **buf, unsigned int type,
                             unsigned long hwirq, int reg);
+       int (*set_type_config)(unsigned int **buf, unsigned int type,
+                              const struct regmap_irq *irq_data, int idx);
+       unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
+                                   unsigned int base, int index);
        void *irq_drv_data;
 };
 
-struct regmap_irq_chip_data;
+unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
+                                          unsigned int base, int index);
+int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
+                                     const struct regmap_irq *irq_data, int idx);
 
 int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
                        int irq_base, const struct regmap_irq_chip *chip,
@@ -1769,6 +1825,27 @@ regmap_field_force_update_bits(struct regmap_field *field,
        return -EINVAL;
 }
 
+static inline int regmap_field_set_bits(struct regmap_field *field,
+                                       unsigned int bits)
+{
+       WARN_ONCE(1, "regmap API is disabled");
+       return -EINVAL;
+}
+
+static inline int regmap_field_clear_bits(struct regmap_field *field,
+                                         unsigned int bits)
+{
+       WARN_ONCE(1, "regmap API is disabled");
+       return -EINVAL;
+}
+
+static inline int regmap_field_test_bits(struct regmap_field *field,
+                                        unsigned int bits)
+{
+       WARN_ONCE(1, "regmap API is disabled");
+       return -EINVAL;
+}
+
 static inline int regmap_fields_write(struct regmap_field *field,
                                      unsigned int id, unsigned int val)
 {
index bbf6590a6dec25846d742600e9ef88e322f67e8e..bc6cda706d1fe108e20b376ad75e66d7cb1633f4 100644 (file)
@@ -171,10 +171,13 @@ struct regulator;
 /**
  * struct regulator_bulk_data - Data used for bulk regulator operations.
  *
- * @supply:   The name of the supply.  Initialised by the user before
- *            using the bulk regulator APIs.
- * @consumer: The regulator consumer for the supply.  This will be managed
- *            by the bulk API.
+ * @supply:       The name of the supply.  Initialised by the user before
+ *                using the bulk regulator APIs.
+ * @init_load_uA: After getting the regulator, regulator_set_load() will be
+ *                called with this load.  Initialised by the user before
+ *                using the bulk regulator APIs.
+ * @consumer:     The regulator consumer for the supply.  This will be managed
+ *                by the bulk API.
  *
  * The regulator APIs provide a series of regulator_bulk_() API calls as
  * a convenience to consumers which require multiple supplies.  This
@@ -182,6 +185,7 @@ struct regulator;
  */
 struct regulator_bulk_data {
        const char *supply;
+       int init_load_uA;
        struct regulator *consumer;
 
        /* private: Internal use */
@@ -240,6 +244,10 @@ int __must_check regulator_bulk_get(struct device *dev, int num_consumers,
                                    struct regulator_bulk_data *consumers);
 int __must_check devm_regulator_bulk_get(struct device *dev, int num_consumers,
                                         struct regulator_bulk_data *consumers);
+int __must_check devm_regulator_bulk_get_const(
+       struct device *dev, int num_consumers,
+       const struct regulator_bulk_data *in_consumers,
+       struct regulator_bulk_data **out_consumers);
 int __must_check regulator_bulk_enable(int num_consumers,
                                       struct regulator_bulk_data *consumers);
 int regulator_bulk_disable(int num_consumers,
index 0228caaa67413c81cedeb8f74bc3e3fb15110e75..f9a7461e72b80ef345ef3165262ac82bce201ed7 100644 (file)
@@ -348,6 +348,7 @@ enum regulator_type {
  * @ramp_delay_table:  Table for mapping the regulator ramp-rate values. Values
  *                     should be given in units of V/S (uV/uS). See the
  *                     regulator_set_ramp_delay_regmap().
+ * @n_ramp_values:     number of elements at @ramp_delay_table.
  *
  * @enable_time: Time taken for initial enable of regulator (in uS).
  * @off_on_delay: guard time (in uS), before re-enabling a regulator
index c46f3a63b758f31f78c42863e69ae0feefc5a3e0..88b8817b827dd9bd7fe8f2764db7a2fcf05cd2cd 100644 (file)
@@ -2257,7 +2257,7 @@ static inline bool owner_on_cpu(struct task_struct *owner)
 }
 
 /* Returns effective CPU energy utilization, as seen by the scheduler */
-unsigned long sched_cpu_util(int cpu, unsigned long max);
+unsigned long sched_cpu_util(int cpu);
 #endif /* CONFIG_SMP */
 
 #ifdef CONFIG_RSEQ
index e5af028c08b4945a2572e5f797ed33d46e4b0123..994c25640e156f09ce8232340b8bfd0365154b36 100644 (file)
@@ -39,20 +39,12 @@ static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *p)
 }
 extern void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task);
 extern void rt_mutex_adjust_pi(struct task_struct *p);
-static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
-{
-       return tsk->pi_blocked_on != NULL;
-}
 #else
 static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task)
 {
        return NULL;
 }
 # define rt_mutex_adjust_pi(p)         do { } while (0)
-static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
-{
-       return false;
-}
 #endif
 
 extern void normalize_rt_tasks(void);
index 56cffe42abbc4b634b376c3198783806ae1417a6..816df6cc444e1c790c4d6a387428bc334a9a43ef 100644 (file)
@@ -81,6 +81,7 @@ struct sched_domain_shared {
        atomic_t        ref;
        atomic_t        nr_busy_cpus;
        int             has_idle_cores;
+       int             nr_idle_scan;
 };
 
 struct sched_domain {
index 704111f63993739f48d0dda2efd8728ab527122c..7f4f9df1b20f4b10819c46549be84e9eb8841843 100644 (file)
@@ -560,6 +560,116 @@ struct scmi_voltage_proto_ops {
                         s32 *volt_uV);
 };
 
+/**
+ * struct scmi_powercap_info  - Describe one available Powercap domain
+ *
+ * @id: Domain ID as advertised by the platform.
+ * @notify_powercap_cap_change: CAP change notification support.
+ * @notify_powercap_measurement_change: MEASUREMENTS change notifications
+ *                                    support.
+ * @async_powercap_cap_set: Asynchronous CAP set support.
+ * @powercap_cap_config: CAP configuration support.
+ * @powercap_monitoring: Monitoring (measurements) support.
+ * @powercap_pai_config: PAI configuration support.
+ * @powercap_scale_mw: Domain reports power data in milliwatt units.
+ * @powercap_scale_uw: Domain reports power data in microwatt units.
+ *                    Note that, when both @powercap_scale_mw and
+ *                    @powercap_scale_uw are set to false, the domain
+ *                    reports power data on an abstract linear scale.
+ * @name: name assigned to the Powercap Domain by platform.
+ * @min_pai: Minimum configurable PAI.
+ * @max_pai: Maximum configurable PAI.
+ * @pai_step: Step size between two consecutive PAI values.
+ * @min_power_cap: Minimum configurable CAP.
+ * @max_power_cap: Maximum configurable CAP.
+ * @power_cap_step: Step size between two consecutive CAP values.
+ * @sustainable_power: Maximum sustainable power consumption for this domain
+ *                    under normal conditions.
+ * @accuracy: The accuracy with which the power is measured and reported in
+ *           integral multiples of 0.001 percent.
+ * @parent_id: Identifier of the containing parent power capping domain, or the
+ *            value 0xFFFFFFFF if this powercap domain is a root domain not
+ *            contained in any other domain.
+ */
+struct scmi_powercap_info {
+       unsigned int id;
+       bool notify_powercap_cap_change;
+       bool notify_powercap_measurement_change;
+       bool async_powercap_cap_set;
+       bool powercap_cap_config;
+       bool powercap_monitoring;
+       bool powercap_pai_config;
+       bool powercap_scale_mw;
+       bool powercap_scale_uw;
+       bool fastchannels;
+       char name[SCMI_MAX_STR_SIZE];
+       unsigned int min_pai;
+       unsigned int max_pai;
+       unsigned int pai_step;
+       unsigned int min_power_cap;
+       unsigned int max_power_cap;
+       unsigned int power_cap_step;
+       unsigned int sustainable_power;
+       unsigned int accuracy;
+#define SCMI_POWERCAP_ROOT_ZONE_ID     0xFFFFFFFFUL
+       unsigned int parent_id;
+       struct scmi_fc_info *fc_info;
+};
+
+/**
+ * struct scmi_powercap_proto_ops - represents the various operations provided
+ * by SCMI Powercap Protocol
+ *
+ * @num_domains_get: get the count of powercap domains provided by SCMI.
+ * @info_get: get the information for the specified domain.
+ * @cap_get: get the current CAP value for the specified domain.
+ * @cap_set: set the CAP value for the specified domain to the provided value;
+ *          if the domain supports setting the CAP with an asynchronous command
+ *          this request will finally trigger an asynchronous transfer, but, if
+ *          @ignore_dresp here is set to true, this call will anyway return
+ *          immediately without waiting for the related delayed response.
+ * @pai_get: get the current PAI value for the specified domain.
+ * @pai_set: set the PAI value for the specified domain to the provided value.
+ * @measurements_get: retrieve the current average power measurements for the
+ *                   specified domain and the related PAI upon which is
+ *                   calculated.
+ * @measurements_threshold_set: set the desired low and high power thresholds
+ *                             to be used when registering for notification
+ *                             of type POWERCAP_MEASUREMENTS_NOTIFY with this
+ *                             powercap domain.
+ *                             Note that this must be called at least once
+ *                             before registering any callback with the usual
+ *                             @scmi_notify_ops; moreover, in case this method
+ *                             is called with measurement notifications already
+ *                             enabled it will also trigger, transparently, a
+ *                             proper update of the power thresholds configured
+ *                             in the SCMI backend server.
+ * @measurements_threshold_get: get the currently configured low and high power
+ *                             thresholds used when registering callbacks for
+ *                             notification POWERCAP_MEASUREMENTS_NOTIFY.
+ */
+struct scmi_powercap_proto_ops {
+       int (*num_domains_get)(const struct scmi_protocol_handle *ph);
+       const struct scmi_powercap_info __must_check *(*info_get)
+               (const struct scmi_protocol_handle *ph, u32 domain_id);
+       int (*cap_get)(const struct scmi_protocol_handle *ph, u32 domain_id,
+                      u32 *power_cap);
+       int (*cap_set)(const struct scmi_protocol_handle *ph, u32 domain_id,
+                      u32 power_cap, bool ignore_dresp);
+       int (*pai_get)(const struct scmi_protocol_handle *ph, u32 domain_id,
+                      u32 *pai);
+       int (*pai_set)(const struct scmi_protocol_handle *ph, u32 domain_id,
+                      u32 pai);
+       int (*measurements_get)(const struct scmi_protocol_handle *ph,
+                               u32 domain_id, u32 *average_power, u32 *pai);
+       int (*measurements_threshold_set)(const struct scmi_protocol_handle *ph,
+                                         u32 domain_id, u32 power_thresh_low,
+                                         u32 power_thresh_high);
+       int (*measurements_threshold_get)(const struct scmi_protocol_handle *ph,
+                                         u32 domain_id, u32 *power_thresh_low,
+                                         u32 *power_thresh_high);
+};
+
 /**
  * struct scmi_notify_ops  - represents notifications' operations provided by
  * SCMI core
@@ -624,6 +734,9 @@ struct scmi_notify_ops {
  *
  * @dev: pointer to the SCMI device
  * @version: pointer to the structure containing SCMI version information
+ * @devm_protocol_acquire: devres managed method to get hold of a protocol,
+ *                        causing its initialization and related resource
+ *                        accounting
  * @devm_protocol_get: devres managed method to acquire a protocol and get specific
  *                    operations and a dedicated protocol handler
  * @devm_protocol_put: devres managed method to release a protocol
@@ -642,6 +755,8 @@ struct scmi_handle {
        struct device *dev;
        struct scmi_revision_info *version;
 
+       int __must_check (*devm_protocol_acquire)(struct scmi_device *sdev,
+                                                 u8 proto);
        const void __must_check *
                (*devm_protocol_get)(struct scmi_device *sdev, u8 proto,
                                     struct scmi_protocol_handle **ph);
@@ -661,6 +776,7 @@ enum scmi_std_protocol {
        SCMI_PROTOCOL_SENSOR = 0x15,
        SCMI_PROTOCOL_RESET = 0x16,
        SCMI_PROTOCOL_VOLTAGE = 0x17,
+       SCMI_PROTOCOL_POWERCAP = 0x18,
 };
 
 enum scmi_system_events {
@@ -762,6 +878,8 @@ enum scmi_notification_events {
        SCMI_EVENT_RESET_ISSUED = 0x0,
        SCMI_EVENT_BASE_ERROR_EVENT = 0x0,
        SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER = 0x0,
+       SCMI_EVENT_POWERCAP_CAP_CHANGED = 0x0,
+       SCMI_EVENT_POWERCAP_MEASUREMENTS_CHANGED = 0x1,
 };
 
 struct scmi_power_state_changed_report {
@@ -781,8 +899,10 @@ struct scmi_clock_rate_notif_report {
 struct scmi_system_power_state_notifier_report {
        ktime_t         timestamp;
        unsigned int    agent_id;
+#define SCMI_SYSPOWER_IS_REQUEST_GRACEFUL(flags)       ((flags) & BIT(0))
        unsigned int    flags;
        unsigned int    system_state;
+       unsigned int    timeout;
 };
 
 struct scmi_perf_limits_report {
@@ -830,4 +950,18 @@ struct scmi_base_error_report {
        unsigned long long      reports[];
 };
 
+struct scmi_powercap_cap_changed_report {
+       ktime_t         timestamp;
+       unsigned int    agent_id;
+       unsigned int    domain_id;
+       unsigned int    power_cap;
+       unsigned int    pai;
+};
+
+struct scmi_powercap_meas_changed_report {
+       ktime_t         timestamp;
+       unsigned int    agent_id;
+       unsigned int    domain_id;
+       unsigned int    power;
+};
 #endif /* _LINUX_SCMI_PROTOCOL_H */
index 7fc4e9f49f542b521afb53514f1229bca0683edc..4d0baf30266ed52edbc0dc54f94305b463affa43 100644 (file)
@@ -353,7 +353,8 @@ int security_inode_readlink(struct dentry *dentry);
 int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
                               bool rcu);
 int security_inode_permission(struct inode *inode, int mask);
-int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
+int security_inode_setattr(struct user_namespace *mnt_userns,
+                          struct dentry *dentry, struct iattr *attr);
 int security_inode_getattr(const struct path *path);
 int security_inode_setxattr(struct user_namespace *mnt_userns,
                            struct dentry *dentry, const char *name,
@@ -848,8 +849,9 @@ static inline int security_inode_permission(struct inode *inode, int mask)
        return 0;
 }
 
-static inline int security_inode_setattr(struct dentry *dentry,
-                                         struct iattr *attr)
+static inline int security_inode_setattr(struct user_namespace *mnt_userns,
+                                        struct dentry *dentry,
+                                        struct iattr *attr)
 {
        return 0;
 }
index 6fe4ffbde290a1438a36f52462f8463289e7f3bf..a0f4f51a3b45dc2e7849020b3a37aff9414600ed 100644 (file)
@@ -10,11 +10,33 @@ struct regmap;
 struct device;
 struct mtk_mutex;
 
+enum mtk_mutex_mod_index {
+       /* MDP table index */
+       MUTEX_MOD_IDX_MDP_RDMA0,
+       MUTEX_MOD_IDX_MDP_RSZ0,
+       MUTEX_MOD_IDX_MDP_RSZ1,
+       MUTEX_MOD_IDX_MDP_TDSHP0,
+       MUTEX_MOD_IDX_MDP_WROT0,
+       MUTEX_MOD_IDX_MDP_WDMA,
+       MUTEX_MOD_IDX_MDP_AAL0,
+       MUTEX_MOD_IDX_MDP_CCORR0,
+
+       MUTEX_MOD_IDX_MAX               /* ALWAYS keep at the end */
+};
+
+enum mtk_mutex_sof_index {
+       MUTEX_SOF_IDX_SINGLE_MODE,
+
+       MUTEX_SOF_IDX_MAX               /* ALWAYS keep at the end */
+};
+
 struct mtk_mutex *mtk_mutex_get(struct device *dev);
 int mtk_mutex_prepare(struct mtk_mutex *mutex);
 void mtk_mutex_add_comp(struct mtk_mutex *mutex,
                        enum mtk_ddp_comp_id id);
 void mtk_mutex_enable(struct mtk_mutex *mutex);
+int mtk_mutex_enable_by_cmdq(struct mtk_mutex *mutex,
+                            void *pkt);
 void mtk_mutex_disable(struct mtk_mutex *mutex);
 void mtk_mutex_remove_comp(struct mtk_mutex *mutex,
                           enum mtk_ddp_comp_id id);
@@ -22,5 +44,10 @@ void mtk_mutex_unprepare(struct mtk_mutex *mutex);
 void mtk_mutex_put(struct mtk_mutex *mutex);
 void mtk_mutex_acquire(struct mtk_mutex *mutex);
 void mtk_mutex_release(struct mtk_mutex *mutex);
+int mtk_mutex_write_mod(struct mtk_mutex *mutex,
+                       enum mtk_mutex_mod_index idx,
+                       bool clear);
+int mtk_mutex_write_sof(struct mtk_mutex *mutex,
+                       enum mtk_mutex_sof_index idx);
 
 #endif /* MTK_MUTEX_H */
index d361ba26203b6c3c2e47b42d80ee0d1f108ba521..e6c73d5ff1a8298dcde9641f187cd6d8806ca20d 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <uapi/linux/spi/spi.h>
 #include <linux/acpi.h>
+#include <linux/u64_stats_sync.h>
 
 struct dma_chan;
 struct software_node;
@@ -34,7 +35,8 @@ extern struct bus_type spi_bus_type;
 
 /**
  * struct spi_statistics - statistics for spi transfers
- * @lock:          lock protecting this structure
+ * @syncp:         seqcount to protect members in this struct for per-cpu udate
+ *                 on 32-bit systems
  *
  * @messages:      number of spi-messages handled
  * @transfers:     number of spi_transfers handled
@@ -59,37 +61,48 @@ extern struct bus_type spi_bus_type;
  *                 maxsize limit
  */
 struct spi_statistics {
-       spinlock_t              lock; /* lock for the whole structure */
+       struct u64_stats_sync   syncp;
 
-       unsigned long           messages;
-       unsigned long           transfers;
-       unsigned long           errors;
-       unsigned long           timedout;
+       u64_stats_t             messages;
+       u64_stats_t             transfers;
+       u64_stats_t             errors;
+       u64_stats_t             timedout;
 
-       unsigned long           spi_sync;
-       unsigned long           spi_sync_immediate;
-       unsigned long           spi_async;
+       u64_stats_t             spi_sync;
+       u64_stats_t             spi_sync_immediate;
+       u64_stats_t             spi_async;
 
-       unsigned long long      bytes;
-       unsigned long long      bytes_rx;
-       unsigned long long      bytes_tx;
+       u64_stats_t             bytes;
+       u64_stats_t             bytes_rx;
+       u64_stats_t             bytes_tx;
 
 #define SPI_STATISTICS_HISTO_SIZE 17
-       unsigned long transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE];
+       u64_stats_t     transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE];
 
-       unsigned long transfers_split_maxsize;
+       u64_stats_t     transfers_split_maxsize;
 };
 
-#define SPI_STATISTICS_ADD_TO_FIELD(stats, field, count)       \
-       do {                                                    \
-               unsigned long flags;                            \
-               spin_lock_irqsave(&(stats)->lock, flags);       \
-               (stats)->field += count;                        \
-               spin_unlock_irqrestore(&(stats)->lock, flags);  \
+#define SPI_STATISTICS_ADD_TO_FIELD(pcpu_stats, field, count)          \
+       do {                                                            \
+               struct spi_statistics *__lstats;                        \
+               get_cpu();                                              \
+               __lstats = this_cpu_ptr(pcpu_stats);                    \
+               u64_stats_update_begin(&__lstats->syncp);               \
+               u64_stats_add(&__lstats->field, count);                 \
+               u64_stats_update_end(&__lstats->syncp);                 \
+               put_cpu();                                              \
        } while (0)
 
-#define SPI_STATISTICS_INCREMENT_FIELD(stats, field)   \
-       SPI_STATISTICS_ADD_TO_FIELD(stats, field, 1)
+#define SPI_STATISTICS_INCREMENT_FIELD(pcpu_stats, field)              \
+       do {                                                            \
+               struct spi_statistics *__lstats;                        \
+               get_cpu();                                              \
+               __lstats = this_cpu_ptr(pcpu_stats);                    \
+               u64_stats_update_begin(&__lstats->syncp);               \
+               u64_stats_inc(&__lstats->field);                        \
+               u64_stats_update_end(&__lstats->syncp);                 \
+               put_cpu();                                              \
+       } while (0)
 
 /**
  * struct spi_delay - SPI delay information
@@ -149,7 +162,7 @@ extern int spi_delay_exec(struct spi_delay *_delay, struct spi_transfer *xfer);
  * @cs_inactive: delay to be introduced by the controller after CS is
  *     deasserted. If @cs_change_delay is used from @spi_transfer, then the
  *     two delays will be added up.
- * @statistics: statistics for the spi_device
+ * @pcpu_statistics: statistics for the spi_device
  *
  * A @spi_device is used to interchange data between an SPI slave
  * (usually a discrete chip) and CPU memory.
@@ -163,13 +176,13 @@ extern int spi_delay_exec(struct spi_delay *_delay, struct spi_transfer *xfer);
 struct spi_device {
        struct device           dev;
        struct spi_controller   *controller;
-       struct spi_controller   *master;        /* compatibility layer */
+       struct spi_controller   *master;        /* Compatibility layer */
        u32                     max_speed_hz;
        u8                      chip_select;
        u8                      bits_per_word;
        bool                    rt;
-#define SPI_NO_TX      BIT(31)         /* no transmit wire */
-#define SPI_NO_RX      BIT(30)         /* no receive wire */
+#define SPI_NO_TX      BIT(31)         /* No transmit wire */
+#define SPI_NO_RX      BIT(30)         /* No receive wire */
        /*
         * All bits defined above should be covered by SPI_MODE_KERNEL_MASK.
         * The SPI_MODE_KERNEL_MASK has the SPI_MODE_USER_MASK counterpart,
@@ -186,15 +199,15 @@ struct spi_device {
        void                    *controller_data;
        char                    modalias[SPI_NAME_SIZE];
        const char              *driver_override;
-       struct gpio_desc        *cs_gpiod;      /* chip select gpio desc */
-       struct spi_delay        word_delay; /* inter-word delay */
+       struct gpio_desc        *cs_gpiod;      /* Chip select gpio desc */
+       struct spi_delay        word_delay; /* Inter-word delay */
        /* CS delays */
        struct spi_delay        cs_setup;
        struct spi_delay        cs_hold;
        struct spi_delay        cs_inactive;
 
-       /* the statistics */
-       struct spi_statistics   statistics;
+       /* The statistics */
+       struct spi_statistics __percpu  *pcpu_statistics;
 
        /*
         * likely need more hooks for more protocol options affecting how
@@ -215,7 +228,7 @@ static inline struct spi_device *to_spi_device(struct device *dev)
        return dev ? container_of(dev, struct spi_device, dev) : NULL;
 }
 
-/* most drivers won't need to care about device refcounting */
+/* Most drivers won't need to care about device refcounting */
 static inline struct spi_device *spi_dev_get(struct spi_device *spi)
 {
        return (spi && get_device(&spi->dev)) ? spi : NULL;
@@ -238,7 +251,7 @@ static inline void spi_set_ctldata(struct spi_device *spi, void *state)
        spi->controller_state = state;
 }
 
-/* device driver data */
+/* Device driver data */
 
 static inline void spi_set_drvdata(struct spi_device *spi, void *data)
 {
@@ -305,7 +318,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
 
 extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 chip_select);
 
-/* use a define to avoid include chaining to get THIS_MODULE */
+/* Use a define to avoid include chaining to get THIS_MODULE */
 #define spi_register_driver(driver) \
        __spi_register_driver(THIS_MODULE, driver)
 
@@ -370,10 +383,14 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
  * @pump_messages: work struct for scheduling work to the message pump
  * @queue_lock: spinlock to syncronise access to message queue
  * @queue: message queue
- * @idling: the device is entering idle state
  * @cur_msg: the currently in-flight message
- * @cur_msg_prepared: spi_prepare_message was called for the currently
- *                    in-flight message
+ * @cur_msg_completion: a completion for the current in-flight message
+ * @cur_msg_incomplete: Flag used internally to opportunistically skip
+ *     the @cur_msg_completion. This flag is used to check if the driver has
+ *     already called spi_finalize_current_message().
+ * @cur_msg_need_completion: Flag used internally to opportunistically skip
+ *     the @cur_msg_completion. This flag is used to signal the context that
+ *     is running spi_finalize_current_message() that it needs to complete()
  * @cur_msg_mapped: message has been mapped for DMA
  * @last_cs: the last chip_select that is recorded by set_cs, -1 on non chip
  *           selected
@@ -433,7 +450,7 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
  * @max_native_cs: When cs_gpiods is used, and this field is filled in,
  *     spi_register_controller() will validate all native CS (including the
  *     unused native CS) against this value.
- * @statistics: statistics for the spi_controller
+ * @pcpu_statistics: statistics for the spi_controller
  * @dma_tx: DMA transmit channel
  * @dma_rx: DMA receive channel
  * @dummy_rx: dummy receive buffer for full-duplex devices
@@ -450,6 +467,8 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
  * @irq_flags: Interrupt enable state during PTP system timestamping
  * @fallback: fallback to pio if dma transfer return failure with
  *     SPI_TRANS_FAIL_NO_START.
+ * @queue_empty: signal green light for opportunistically skipping the queue
+ *     for spi_sync transfers.
  *
  * Each SPI controller can communicate with one or more @spi_device
  * children.  These make a small bus, sharing MOSI, MISO and SCK signals
@@ -467,7 +486,7 @@ struct spi_controller {
 
        struct list_head list;
 
-       /* other than negative (== assign one dynamically), bus_num is fully
+       /* Other than negative (== assign one dynamically), bus_num is fully
         * board-specific.  usually that simplifies to being SOC-specific.
         * example:  one SOC has three SPI controllers, numbered 0..2,
         * and one board's schematics might show it using SPI-2.  software
@@ -480,7 +499,7 @@ struct spi_controller {
         */
        u16                     num_chipselect;
 
-       /* some SPI controllers pose alignment requirements on DMAable
+       /* Some SPI controllers pose alignment requirements on DMAable
         * buffers; let protocol drivers know about these requirements.
         */
        u16                     dma_alignment;
@@ -491,29 +510,29 @@ struct spi_controller {
        /* spi_device.mode flags override flags for this controller */
        u32                     buswidth_override_bits;
 
-       /* bitmask of supported bits_per_word for transfers */
+       /* Bitmask of supported bits_per_word for transfers */
        u32                     bits_per_word_mask;
 #define SPI_BPW_MASK(bits) BIT((bits) - 1)
 #define SPI_BPW_RANGE_MASK(min, max) GENMASK((max) - 1, (min) - 1)
 
-       /* limits on transfer speed */
+       /* Limits on transfer speed */
        u32                     min_speed_hz;
        u32                     max_speed_hz;
 
-       /* other constraints relevant to this driver */
+       /* Other constraints relevant to this driver */
        u16                     flags;
-#define SPI_CONTROLLER_HALF_DUPLEX     BIT(0)  /* can't do full duplex */
-#define SPI_CONTROLLER_NO_RX           BIT(1)  /* can't do buffer read */
-#define SPI_CONTROLLER_NO_TX           BIT(2)  /* can't do buffer write */
-#define SPI_CONTROLLER_MUST_RX         BIT(3)  /* requires rx */
-#define SPI_CONTROLLER_MUST_TX         BIT(4)  /* requires tx */
+#define SPI_CONTROLLER_HALF_DUPLEX     BIT(0)  /* Can't do full duplex */
+#define SPI_CONTROLLER_NO_RX           BIT(1)  /* Can't do buffer read */
+#define SPI_CONTROLLER_NO_TX           BIT(2)  /* Can't do buffer write */
+#define SPI_CONTROLLER_MUST_RX         BIT(3)  /* Requires rx */
+#define SPI_CONTROLLER_MUST_TX         BIT(4)  /* Requires tx */
 
 #define SPI_MASTER_GPIO_SS             BIT(5)  /* GPIO CS must select slave */
 
-       /* flag indicating if the allocation of this struct is devres-managed */
+       /* Flag indicating if the allocation of this struct is devres-managed */
        bool                    devm_allocated;
 
-       /* flag indicating this is an SPI slave controller */
+       /* Flag indicating this is an SPI slave controller */
        bool                    slave;
 
        /*
@@ -529,11 +548,11 @@ struct spi_controller {
        /* Used to avoid adding the same CS twice */
        struct mutex            add_lock;
 
-       /* lock and mutex for SPI bus locking */
+       /* Lock and mutex for SPI bus locking */
        spinlock_t              bus_lock_spinlock;
        struct mutex            bus_lock_mutex;
 
-       /* flag indicating that the SPI bus is locked for exclusive use */
+       /* Flag indicating that the SPI bus is locked for exclusive use */
        bool                    bus_lock_flag;
 
        /* Setup mode and clock, etc (spi driver may call many times).
@@ -554,7 +573,7 @@ struct spi_controller {
         */
        int (*set_cs_timing)(struct spi_device *spi);
 
-       /* bidirectional bulk transfers
+       /* Bidirectional bulk transfers
         *
         * + The transfer() method may not sleep; its main role is
         *   just to add the message to the queue.
@@ -576,7 +595,7 @@ struct spi_controller {
        int                     (*transfer)(struct spi_device *spi,
                                                struct spi_message *mesg);
 
-       /* called on release() to free memory provided by spi_controller */
+       /* Called on release() to free memory provided by spi_controller */
        void                    (*cleanup)(struct spi_device *spi);
 
        /*
@@ -603,12 +622,13 @@ struct spi_controller {
        spinlock_t                      queue_lock;
        struct list_head                queue;
        struct spi_message              *cur_msg;
-       bool                            idling;
+       struct completion               cur_msg_completion;
+       bool                            cur_msg_incomplete;
+       bool                            cur_msg_need_completion;
        bool                            busy;
        bool                            running;
        bool                            rt;
        bool                            auto_runtime_pm;
-       bool                            cur_msg_prepared;
        bool                            cur_msg_mapped;
        char                            last_cs;
        bool                            last_cs_mode_high;
@@ -646,14 +666,14 @@ struct spi_controller {
        s8                      unused_native_cs;
        s8                      max_native_cs;
 
-       /* statistics */
-       struct spi_statistics   statistics;
+       /* Statistics */
+       struct spi_statistics __percpu  *pcpu_statistics;
 
        /* DMA channels for use with core dmaengine helpers */
        struct dma_chan         *dma_tx;
        struct dma_chan         *dma_rx;
 
-       /* dummy data for full duplex devices */
+       /* Dummy data for full duplex devices */
        void                    *dummy_rx;
        void                    *dummy_tx;
 
@@ -667,6 +687,9 @@ struct spi_controller {
 
        /* Interrupt enable state during PTP system timestamping */
        unsigned long           irq_flags;
+
+       /* Flag for enabling opportunistic skipping of the queue in spi_sync */
+       bool                    queue_empty;
 };
 
 static inline void *spi_controller_get_devdata(struct spi_controller *ctlr)
@@ -715,7 +738,7 @@ void spi_take_timestamp_post(struct spi_controller *ctlr,
                             struct spi_transfer *xfer,
                             size_t progress, bool irqs_off);
 
-/* the spi driver core manages memory for the spi_controller classdev */
+/* The spi driver core manages memory for the spi_controller classdev */
 extern struct spi_controller *__spi_alloc_controller(struct device *host,
                                                unsigned int size, bool slave);
 
@@ -785,7 +808,7 @@ typedef void (*spi_res_release_t)(struct spi_controller *ctlr,
 struct spi_res {
        struct list_head        entry;
        spi_res_release_t       release;
-       unsigned long long      data[]; /* guarantee ull alignment */
+       unsigned long long      data[]; /* Guarantee ull alignment */
 };
 
 /*---------------------------------------------------------------------------*/
@@ -918,7 +941,7 @@ struct spi_res {
  * and its transfers, ignore them until its completion callback.
  */
 struct spi_transfer {
-       /* it's ok if tx_buf == rx_buf (right?)
+       /* It's ok if tx_buf == rx_buf (right?)
         * for MicroWire, one buffer must be null
         * buffers must work with dma_*map_single() calls, unless
         *   spi_message.is_dma_mapped reports a pre-existing mapping
@@ -975,6 +998,7 @@ struct spi_transfer {
  * @queue: for use by whichever driver currently owns the message
  * @state: for use by whichever driver currently owns the message
  * @resources: for resource management when the spi message is processed
+ * @prepared: spi_prepare_message was called for the this message
  *
  * A @spi_message is used to execute an atomic sequence of data transfers,
  * each represented by a struct spi_transfer.  The sequence is "atomic"
@@ -1008,22 +1032,25 @@ struct spi_message {
         * tell them about such special cases.
         */
 
-       /* completion is reported through a callback */
+       /* Completion is reported through a callback */
        void                    (*complete)(void *context);
        void                    *context;
        unsigned                frame_length;
        unsigned                actual_length;
        int                     status;
 
-       /* for optional use by whatever driver currently owns the
+       /* For optional use by whatever driver currently owns the
         * spi_message ...  between calls to spi_async and then later
         * complete(), that's the spi_controller controller driver.
         */
        struct list_head        queue;
        void                    *state;
 
-       /* list of spi_res reources when the spi message is processed */
+       /* List of spi_res reources when the spi message is processed */
        struct list_head        resources;
+
+       /* spi_prepare_message() was called for this message */
+       bool                    prepared;
 };
 
 static inline void spi_message_init_no_memset(struct spi_message *m)
@@ -1127,7 +1154,7 @@ spi_max_transfer_size(struct spi_device *spi)
        if (ctlr->max_transfer_size)
                tr_max = ctlr->max_transfer_size(spi);
 
-       /* transfer size limit must not be greater than messsage size limit */
+       /* Transfer size limit must not be greater than message size limit */
        return min(tr_max, msg_max);
 }
 
@@ -1278,7 +1305,7 @@ spi_read(struct spi_device *spi, void *buf, size_t len)
        return spi_sync_transfer(spi, &t, 1);
 }
 
-/* this copies txbuf and rxbuf data; for small transfers only! */
+/* This copies txbuf and rxbuf data; for small transfers only! */
 extern int spi_write_then_read(struct spi_device *spi,
                const void *txbuf, unsigned n_tx,
                void *rxbuf, unsigned n_rx);
@@ -1301,7 +1328,7 @@ static inline ssize_t spi_w8r8(struct spi_device *spi, u8 cmd)
 
        status = spi_write_then_read(spi, &cmd, 1, &result, 1);
 
-       /* return negative errno or unsigned value */
+       /* Return negative errno or unsigned value */
        return (status < 0) ? status : result;
 }
 
@@ -1326,7 +1353,7 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
 
        status = spi_write_then_read(spi, &cmd, 1, &result, 2);
 
-       /* return negative errno or unsigned value */
+       /* Return negative errno or unsigned value */
        return (status < 0) ? status : result;
 }
 
@@ -1406,7 +1433,7 @@ static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
  * are active in some dynamic board configuration models.
  */
 struct spi_board_info {
-       /* the device name and module name are coupled, like platform_bus;
+       /* The device name and module name are coupled, like platform_bus;
         * "modalias" is normally the driver name.
         *
         * platform_data goes to spi_device.dev.platform_data,
@@ -1419,7 +1446,7 @@ struct spi_board_info {
        void            *controller_data;
        int             irq;
 
-       /* slower signaling on noisy or low voltage boards */
+       /* Slower signaling on noisy or low voltage boards */
        u32             max_speed_hz;
 
 
@@ -1448,7 +1475,7 @@ struct spi_board_info {
 extern int
 spi_register_board_info(struct spi_board_info const *info, unsigned n);
 #else
-/* board init code may ignore whether SPI is configured or not */
+/* Board init code may ignore whether SPI is configured or not */
 static inline int
 spi_register_board_info(struct spi_board_info const *info, unsigned n)
        { return 0; }
index 851e07da2583fb231e647db74fbc6ce07cb6e2f0..58cfbf81447cc10373cf8a90baf84a5ce2592098 100644 (file)
@@ -544,10 +544,11 @@ do {                                                                              \
                                                                                \
        hrtimer_init_sleeper_on_stack(&__t, CLOCK_MONOTONIC,                    \
                                      HRTIMER_MODE_REL);                        \
-       if ((timeout) != KTIME_MAX)                                             \
-               hrtimer_start_range_ns(&__t.timer, timeout,                     \
-                                      current->timer_slack_ns,                 \
-                                      HRTIMER_MODE_REL);                       \
+       if ((timeout) != KTIME_MAX) {                                           \
+               hrtimer_set_expires_range_ns(&__t.timer, timeout,               \
+                                       current->timer_slack_ns);               \
+               hrtimer_sleeper_start_expires(&__t, HRTIMER_MODE_REL);          \
+       }                                                                       \
                                                                                \
        __ret = ___wait_event(wq_head, condition, state, 0, 0,                  \
                if (!__t.task) {                                                \
index 4c379d23ec6e73b9590fba7c16e1152fb79376fd..979a9d3e5bfbfc32c8764a5186efb3f8b6968ee8 100644 (file)
@@ -61,7 +61,7 @@ int __vfs_setxattr_locked(struct user_namespace *, struct dentry *,
                          const char *, const void *, size_t, int,
                          struct inode **);
 int vfs_setxattr(struct user_namespace *, struct dentry *, const char *,
-                const void *, size_t, int);
+                void *, size_t, int);
 int __vfs_removexattr(struct user_namespace *, struct dentry *, const char *);
 int __vfs_removexattr_locked(struct user_namespace *, struct dentry *,
                             const char *, struct inode **);
index f7506f08e505a97321e27134ad2d7ab0b9c6f7d6..c04f359655b86feed2b4b42cc69b90c63088238a 100644 (file)
@@ -405,6 +405,9 @@ static inline bool ip6_ignore_linkdown(const struct net_device *dev)
 {
        const struct inet6_dev *idev = __in6_dev_get(dev);
 
+       if (unlikely(!idev))
+               return true;
+
        return !!idev->cnf.ignore_routes_with_linkdown;
 }
 
index 3c4f550e5a8b75199c080c183d5e013c81eb6929..2f766e3437ce2e1bb7ea7b560ec3d0474535241c 100644 (file)
@@ -847,6 +847,7 @@ enum {
 };
 
 void l2cap_chan_hold(struct l2cap_chan *c);
+struct l2cap_chan *l2cap_chan_hold_unless_zero(struct l2cap_chan *c);
 void l2cap_chan_put(struct l2cap_chan *c);
 
 static inline void l2cap_chan_lock(struct l2cap_chan *chan)
index 85cd695e7fd1d37cc59ac471c873d72517a40638..ee88f0f1350f4e1d8a9c3daea7c7bf8310b2fa62 100644 (file)
@@ -321,7 +321,7 @@ void inet_csk_update_fastreuse(struct inet_bind_bucket *tb,
 
 struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu);
 
-#define TCP_PINGPONG_THRESH    3
+#define TCP_PINGPONG_THRESH    1
 
 static inline void inet_csk_enter_pingpong_mode(struct sock *sk)
 {
@@ -338,14 +338,6 @@ static inline bool inet_csk_in_pingpong_mode(struct sock *sk)
        return inet_csk(sk)->icsk_ack.pingpong >= TCP_PINGPONG_THRESH;
 }
 
-static inline void inet_csk_inc_pingpong_cnt(struct sock *sk)
-{
-       struct inet_connection_sock *icsk = inet_csk(sk);
-
-       if (icsk->icsk_ack.pingpong < U8_MAX)
-               icsk->icsk_ack.pingpong++;
-}
-
 static inline bool inet_csk_has_ulp(struct sock *sk)
 {
        return inet_sk(sk)->is_icsk && !!inet_csk(sk)->icsk_ulp_ops;
index 9fa54762e07752313a181fec44df21794cdfc982..7a48991cdb198ab85b3f2449bf72e9dbb4e227a2 100644 (file)
@@ -2843,18 +2843,18 @@ static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
 {
        /* Does this proto have per netns sysctl_wmem ? */
        if (proto->sysctl_wmem_offset)
-               return *(int *)((void *)sock_net(sk) + proto->sysctl_wmem_offset);
+               return READ_ONCE(*(int *)((void *)sock_net(sk) + proto->sysctl_wmem_offset));
 
-       return *proto->sysctl_wmem;
+       return READ_ONCE(*proto->sysctl_wmem);
 }
 
 static inline int sk_get_rmem0(const struct sock *sk, const struct proto *proto)
 {
        /* Does this proto have per netns sysctl_rmem ? */
        if (proto->sysctl_rmem_offset)
-               return *(int *)((void *)sock_net(sk) + proto->sysctl_rmem_offset);
+               return READ_ONCE(*(int *)((void *)sock_net(sk) + proto->sysctl_rmem_offset));
 
-       return *proto->sysctl_rmem;
+       return READ_ONCE(*proto->sysctl_rmem);
 }
 
 /* Default TCP Small queue budget is ~1 ms of data (1sec >> 10)
index 071735e10872c1d6cf603f4673f7a20965fb3a7c..78a64e1b33a7e70b586bdb420b06694d5a98fae0 100644 (file)
@@ -1419,7 +1419,7 @@ void tcp_select_initial_window(const struct sock *sk, int __space,
 
 static inline int tcp_win_from_space(const struct sock *sk, int space)
 {
-       int tcp_adv_win_scale = sock_net(sk)->ipv4.sysctl_tcp_adv_win_scale;
+       int tcp_adv_win_scale = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_adv_win_scale);
 
        return tcp_adv_win_scale <= 0 ?
                (space>>(-tcp_adv_win_scale)) :
index 32088c6032445a7e078a8e14611c5d8b9d8980dc..bad21222130efed1628eaf9373b7af8cb249ca07 100644 (file)
 /* note: we begin tracing dlm_lock_start() only if ls and lkb are found */
 TRACE_EVENT(dlm_lock_start,
 
-       TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, int mode,
-                __u32 flags),
+       TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, void *name,
+                unsigned int namelen, int mode, __u32 flags),
 
-       TP_ARGS(ls, lkb, mode, flags),
+       TP_ARGS(ls, lkb, name, namelen, mode, flags),
 
        TP_STRUCT__entry(
                __field(__u32, ls_id)
                __field(__u32, lkb_id)
                __field(int, mode)
                __field(__u32, flags)
+               __dynamic_array(unsigned char, res_name,
+                               lkb->lkb_resource ? lkb->lkb_resource->res_length : namelen)
        ),
 
        TP_fast_assign(
+               struct dlm_rsb *r;
+
                __entry->ls_id = ls->ls_global_id;
                __entry->lkb_id = lkb->lkb_id;
                __entry->mode = mode;
                __entry->flags = flags;
+
+               r = lkb->lkb_resource;
+               if (r)
+                       memcpy(__get_dynamic_array(res_name), r->res_name,
+                              __get_dynamic_array_len(res_name));
+               else if (name)
+                       memcpy(__get_dynamic_array(res_name), name,
+                              __get_dynamic_array_len(res_name));
        ),
 
-       TP_printk("ls_id=%u lkb_id=%x mode=%s flags=%s",
+       TP_printk("ls_id=%u lkb_id=%x mode=%s flags=%s res_name=%s",
                  __entry->ls_id, __entry->lkb_id,
                  show_lock_mode(__entry->mode),
-                 show_lock_flags(__entry->flags))
+                 show_lock_flags(__entry->flags),
+                 __print_hex_str(__get_dynamic_array(res_name),
+                                 __get_dynamic_array_len(res_name)))
 
 );
 
 TRACE_EVENT(dlm_lock_end,
 
-       TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, int mode, __u32 flags,
-                int error),
+       TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, void *name,
+                unsigned int namelen, int mode, __u32 flags, int error),
 
-       TP_ARGS(ls, lkb, mode, flags, error),
+       TP_ARGS(ls, lkb, name, namelen, mode, flags, error),
 
        TP_STRUCT__entry(
                __field(__u32, ls_id)
@@ -88,14 +102,26 @@ TRACE_EVENT(dlm_lock_end,
                __field(int, mode)
                __field(__u32, flags)
                __field(int, error)
+               __dynamic_array(unsigned char, res_name,
+                               lkb->lkb_resource ? lkb->lkb_resource->res_length : namelen)
        ),
 
        TP_fast_assign(
+               struct dlm_rsb *r;
+
                __entry->ls_id = ls->ls_global_id;
                __entry->lkb_id = lkb->lkb_id;
                __entry->mode = mode;
                __entry->flags = flags;
 
+               r = lkb->lkb_resource;
+               if (r)
+                       memcpy(__get_dynamic_array(res_name), r->res_name,
+                              __get_dynamic_array_len(res_name));
+               else if (name)
+                       memcpy(__get_dynamic_array(res_name), name,
+                              __get_dynamic_array_len(res_name));
+
                /* return value will be zeroed in those cases by dlm_lock()
                 * we do it here again to not introduce more overhead if
                 * trace isn't running and error reflects the return value.
@@ -104,12 +130,15 @@ TRACE_EVENT(dlm_lock_end,
                        __entry->error = 0;
                else
                        __entry->error = error;
+
        ),
 
-       TP_printk("ls_id=%u lkb_id=%x mode=%s flags=%s error=%d",
+       TP_printk("ls_id=%u lkb_id=%x mode=%s flags=%s error=%d res_name=%s",
                  __entry->ls_id, __entry->lkb_id,
                  show_lock_mode(__entry->mode),
-                 show_lock_flags(__entry->flags), __entry->error)
+                 show_lock_flags(__entry->flags), __entry->error,
+                 __print_hex_str(__get_dynamic_array(res_name),
+                                 __get_dynamic_array_len(res_name)))
 
 );
 
@@ -123,42 +152,65 @@ TRACE_EVENT(dlm_bast,
                __field(__u32, ls_id)
                __field(__u32, lkb_id)
                __field(int, mode)
+               __dynamic_array(unsigned char, res_name,
+                               lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
        ),
 
        TP_fast_assign(
+               struct dlm_rsb *r;
+
                __entry->ls_id = ls->ls_global_id;
                __entry->lkb_id = lkb->lkb_id;
                __entry->mode = mode;
+
+               r = lkb->lkb_resource;
+               if (r)
+                       memcpy(__get_dynamic_array(res_name), r->res_name,
+                              __get_dynamic_array_len(res_name));
        ),
 
-       TP_printk("ls_id=%u lkb_id=%x mode=%s", __entry->ls_id,
-                 __entry->lkb_id, show_lock_mode(__entry->mode))
+       TP_printk("ls_id=%u lkb_id=%x mode=%s res_name=%s",
+                 __entry->ls_id, __entry->lkb_id,
+                 show_lock_mode(__entry->mode),
+                 __print_hex_str(__get_dynamic_array(res_name),
+                                 __get_dynamic_array_len(res_name)))
 
 );
 
 TRACE_EVENT(dlm_ast,
 
-       TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb, struct dlm_lksb *lksb),
+       TP_PROTO(struct dlm_ls *ls, struct dlm_lkb *lkb),
 
-       TP_ARGS(ls, lkb, lksb),
+       TP_ARGS(ls, lkb),
 
        TP_STRUCT__entry(
                __field(__u32, ls_id)
                __field(__u32, lkb_id)
                __field(u8, sb_flags)
                __field(int, sb_status)
+               __dynamic_array(unsigned char, res_name,
+                               lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
        ),
 
        TP_fast_assign(
+               struct dlm_rsb *r;
+
                __entry->ls_id = ls->ls_global_id;
                __entry->lkb_id = lkb->lkb_id;
-               __entry->sb_flags = lksb->sb_flags;
-               __entry->sb_status = lksb->sb_status;
+               __entry->sb_flags = lkb->lkb_lksb->sb_flags;
+               __entry->sb_status = lkb->lkb_lksb->sb_status;
+
+               r = lkb->lkb_resource;
+               if (r)
+                       memcpy(__get_dynamic_array(res_name), r->res_name,
+                              __get_dynamic_array_len(res_name));
        ),
 
-       TP_printk("ls_id=%u lkb_id=%x sb_flags=%s sb_status=%d",
+       TP_printk("ls_id=%u lkb_id=%x sb_flags=%s sb_status=%d res_name=%s",
                  __entry->ls_id, __entry->lkb_id,
-                 show_dlm_sb_flags(__entry->sb_flags), __entry->sb_status)
+                 show_dlm_sb_flags(__entry->sb_flags), __entry->sb_status,
+                 __print_hex_str(__get_dynamic_array(res_name),
+                                 __get_dynamic_array_len(res_name)))
 
 );
 
@@ -173,17 +225,28 @@ TRACE_EVENT(dlm_unlock_start,
                __field(__u32, ls_id)
                __field(__u32, lkb_id)
                __field(__u32, flags)
+               __dynamic_array(unsigned char, res_name,
+                               lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
        ),
 
        TP_fast_assign(
+               struct dlm_rsb *r;
+
                __entry->ls_id = ls->ls_global_id;
                __entry->lkb_id = lkb->lkb_id;
                __entry->flags = flags;
+
+               r = lkb->lkb_resource;
+               if (r)
+                       memcpy(__get_dynamic_array(res_name), r->res_name,
+                              __get_dynamic_array_len(res_name));
        ),
 
-       TP_printk("ls_id=%u lkb_id=%x flags=%s",
+       TP_printk("ls_id=%u lkb_id=%x flags=%s res_name=%s",
                  __entry->ls_id, __entry->lkb_id,
-                 show_lock_flags(__entry->flags))
+                 show_lock_flags(__entry->flags),
+                 __print_hex_str(__get_dynamic_array(res_name),
+                                 __get_dynamic_array_len(res_name)))
 
 );
 
@@ -199,18 +262,29 @@ TRACE_EVENT(dlm_unlock_end,
                __field(__u32, lkb_id)
                __field(__u32, flags)
                __field(int, error)
+               __dynamic_array(unsigned char, res_name,
+                               lkb->lkb_resource ? lkb->lkb_resource->res_length : 0)
        ),
 
        TP_fast_assign(
+               struct dlm_rsb *r;
+
                __entry->ls_id = ls->ls_global_id;
                __entry->lkb_id = lkb->lkb_id;
                __entry->flags = flags;
                __entry->error = error;
+
+               r = lkb->lkb_resource;
+               if (r)
+                       memcpy(__get_dynamic_array(res_name), r->res_name,
+                              __get_dynamic_array_len(res_name));
        ),
 
-       TP_printk("ls_id=%u lkb_id=%x flags=%s error=%d",
+       TP_printk("ls_id=%u lkb_id=%x flags=%s error=%d res_name=%s",
                  __entry->ls_id, __entry->lkb_id,
-                 show_lock_flags(__entry->flags), __entry->error)
+                 show_lock_flags(__entry->flags), __entry->error,
+                 __print_hex_str(__get_dynamic_array(res_name),
+                                 __get_dynamic_array_len(res_name)))
 
 );
 
index f76668305ac503c23790b5e1a93842a81692543a..4cb51ace600d41db56b51cb7d8f3b27bcdb5b380 100644 (file)
@@ -13,11 +13,12 @@ DECLARE_EVENT_CLASS(kmem_alloc,
 
        TP_PROTO(unsigned long call_site,
                 const void *ptr,
+                struct kmem_cache *s,
                 size_t bytes_req,
                 size_t bytes_alloc,
                 gfp_t gfp_flags),
 
-       TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags),
+       TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags),
 
        TP_STRUCT__entry(
                __field(        unsigned long,  call_site       )
@@ -25,6 +26,7 @@ DECLARE_EVENT_CLASS(kmem_alloc,
                __field(        size_t,         bytes_req       )
                __field(        size_t,         bytes_alloc     )
                __field(        unsigned long,  gfp_flags       )
+               __field(        bool,           accounted       )
        ),
 
        TP_fast_assign(
@@ -33,42 +35,47 @@ DECLARE_EVENT_CLASS(kmem_alloc,
                __entry->bytes_req      = bytes_req;
                __entry->bytes_alloc    = bytes_alloc;
                __entry->gfp_flags      = (__force unsigned long)gfp_flags;
+               __entry->accounted      = IS_ENABLED(CONFIG_MEMCG_KMEM) ?
+                                         ((gfp_flags & __GFP_ACCOUNT) ||
+                                         (s && s->flags & SLAB_ACCOUNT)) : false;
        ),
 
-       TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s",
+       TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s accounted=%s",
                (void *)__entry->call_site,
                __entry->ptr,
                __entry->bytes_req,
                __entry->bytes_alloc,
-               show_gfp_flags(__entry->gfp_flags))
+               show_gfp_flags(__entry->gfp_flags),
+               __entry->accounted ? "true" : "false")
 );
 
 DEFINE_EVENT(kmem_alloc, kmalloc,
 
-       TP_PROTO(unsigned long call_site, const void *ptr,
+       TP_PROTO(unsigned long call_site, const void *ptr, struct kmem_cache *s,
                 size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags),
 
-       TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)
+       TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags)
 );
 
 DEFINE_EVENT(kmem_alloc, kmem_cache_alloc,
 
-       TP_PROTO(unsigned long call_site, const void *ptr,
+       TP_PROTO(unsigned long call_site, const void *ptr, struct kmem_cache *s,
                 size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags),
 
-       TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags)
+       TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags)
 );
 
 DECLARE_EVENT_CLASS(kmem_alloc_node,
 
        TP_PROTO(unsigned long call_site,
                 const void *ptr,
+                struct kmem_cache *s,
                 size_t bytes_req,
                 size_t bytes_alloc,
                 gfp_t gfp_flags,
                 int node),
 
-       TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node),
+       TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags, node),
 
        TP_STRUCT__entry(
                __field(        unsigned long,  call_site       )
@@ -77,6 +84,7 @@ DECLARE_EVENT_CLASS(kmem_alloc_node,
                __field(        size_t,         bytes_alloc     )
                __field(        unsigned long,  gfp_flags       )
                __field(        int,            node            )
+               __field(        bool,           accounted       )
        ),
 
        TP_fast_assign(
@@ -86,33 +94,37 @@ DECLARE_EVENT_CLASS(kmem_alloc_node,
                __entry->bytes_alloc    = bytes_alloc;
                __entry->gfp_flags      = (__force unsigned long)gfp_flags;
                __entry->node           = node;
+               __entry->accounted      = IS_ENABLED(CONFIG_MEMCG_KMEM) ?
+                                         ((gfp_flags & __GFP_ACCOUNT) ||
+                                         (s && s->flags & SLAB_ACCOUNT)) : false;
        ),
 
-       TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d",
+       TP_printk("call_site=%pS ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d accounted=%s",
                (void *)__entry->call_site,
                __entry->ptr,
                __entry->bytes_req,
                __entry->bytes_alloc,
                show_gfp_flags(__entry->gfp_flags),
-               __entry->node)
+               __entry->node,
+               __entry->accounted ? "true" : "false")
 );
 
 DEFINE_EVENT(kmem_alloc_node, kmalloc_node,
 
        TP_PROTO(unsigned long call_site, const void *ptr,
-                size_t bytes_req, size_t bytes_alloc,
+                struct kmem_cache *s, size_t bytes_req, size_t bytes_alloc,
                 gfp_t gfp_flags, int node),
 
-       TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)
+       TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags, node)
 );
 
 DEFINE_EVENT(kmem_alloc_node, kmem_cache_alloc_node,
 
        TP_PROTO(unsigned long call_site, const void *ptr,
-                size_t bytes_req, size_t bytes_alloc,
+                struct kmem_cache *s, size_t bytes_req, size_t bytes_alloc,
                 gfp_t gfp_flags, int node),
 
-       TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node)
+       TP_ARGS(call_site, ptr, s, bytes_req, bytes_alloc, gfp_flags, node)
 );
 
 TRACE_EVENT(kfree,
index cee4b2b64ae44e658a2ce99a7b2a435b57bf0ee6..65016a767b7ae9e8d041ec406a22ebe8e49ade05 100644 (file)
@@ -7,6 +7,31 @@
 
 #include <linux/tracepoint.h>
 
+TRACE_EVENT(scmi_fc_call,
+       TP_PROTO(u8 protocol_id, u8 msg_id, u32 res_id, u32 val1, u32 val2),
+       TP_ARGS(protocol_id, msg_id, res_id, val1, val2),
+
+       TP_STRUCT__entry(
+               __field(u8, protocol_id)
+               __field(u8, msg_id)
+               __field(u32, res_id)
+               __field(u32, val1)
+               __field(u32, val2)
+       ),
+
+       TP_fast_assign(
+               __entry->protocol_id = protocol_id;
+               __entry->msg_id = msg_id;
+               __entry->res_id = res_id;
+               __entry->val1 = val1;
+               __entry->val2 = val2;
+       ),
+
+       TP_printk("[0x%02X]:[0x%02X]:[%08X]:%u:%u",
+                 __entry->protocol_id, __entry->msg_id,
+                 __entry->res_id, __entry->val1, __entry->val2)
+);
+
 TRACE_EVENT(scmi_xfer_begin,
        TP_PROTO(int transfer_id, u8 msg_id, u8 protocol_id, u16 seq,
                 bool poll),
@@ -112,6 +137,37 @@ TRACE_EVENT(scmi_rx_done,
                __entry->transfer_id, __entry->msg_id, __entry->protocol_id,
                __entry->seq, __entry->msg_type)
 );
+
+TRACE_EVENT(scmi_msg_dump,
+       TP_PROTO(u8 protocol_id, u8 msg_id, unsigned char *tag, u16 seq,
+                int status, void *buf, size_t len),
+       TP_ARGS(protocol_id, msg_id, tag, seq, status, buf, len),
+
+       TP_STRUCT__entry(
+               __field(u8, protocol_id)
+               __field(u8, msg_id)
+               __array(char, tag, 5)
+               __field(u16, seq)
+               __field(int, status)
+               __field(size_t, len)
+               __dynamic_array(unsigned char, cmd, len)
+       ),
+
+       TP_fast_assign(
+               __entry->protocol_id = protocol_id;
+               __entry->msg_id = msg_id;
+               strscpy(__entry->tag, tag, 5);
+               __entry->seq = seq;
+               __entry->status = status;
+               __entry->len = len;
+               memcpy(__get_dynamic_array(cmd), buf, __entry->len);
+       ),
+
+       TP_printk("pt=%02X t=%s msg_id=%02X seq=%04X s=%d pyld=%s",
+                 __entry->protocol_id, __entry->tag, __entry->msg_id,
+                 __entry->seq, __entry->status,
+               __print_hex_str(__get_dynamic_array(cmd), __entry->len))
+);
 #endif /* _TRACE_SCMI_H */
 
 /* This part must be outside protection */
index f13d37b60775475cb38347116800b9b452a08ff9..1ecdb911add8de3b16f4b05dff630a0ca47285d1 100644 (file)
@@ -192,6 +192,7 @@ struct f_owner_ex {
 
 #define F_LINUX_SPECIFIC_BASE  1024
 
+#ifndef HAVE_ARCH_STRUCT_FLOCK
 struct flock {
        short   l_type;
        short   l_whence;
@@ -216,5 +217,6 @@ struct flock64 {
        __ARCH_FLOCK64_PAD
 #endif
 };
+#endif /* HAVE_ARCH_STRUCT_FLOCK */
 
 #endif /* _ASM_GENERIC_FCNTL_H */
index f1f89132d60e25c25b3b54e88e3c45cb06416bba..d8536d77fea1ca4b15599a97550b379c77b9d62d 100644 (file)
 #define FAN_MARK_FLUSH         0x00000080
 /* FAN_MARK_FILESYSTEM is      0x00000100 */
 #define FAN_MARK_EVICTABLE     0x00000200
+/* This bit is mutually exclusive with FAN_MARK_IGNORED_MASK bit */
+#define FAN_MARK_IGNORE                0x00000400
 
 /* These are NOT bitwise flags.  Both bits can be used togther.  */
 #define FAN_MARK_INODE         0x00000000
 #define FAN_MARK_MOUNT         0x00000010
 #define FAN_MARK_FILESYSTEM    0x00000100
 
+/*
+ * Convenience macro - FAN_MARK_IGNORE requires FAN_MARK_IGNORED_SURV_MODIFY
+ * for non-inode mark types.
+ */
+#define FAN_MARK_IGNORE_SURV   (FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY)
+
 /* Deprecated - do not use this in programs and do not add new flags here! */
 #define FAN_ALL_MARK_FLAGS     (FAN_MARK_ADD |\
                                 FAN_MARK_REMOVE |\
index d37629dbad72f72bc3920e3f22e4fa2752109c5c..0474ee362151f87fa007d2021e405309ac21563a 100644 (file)
@@ -301,6 +301,7 @@ enum {
  *       { u64         time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
  *       { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
  *       { u64         id;           } && PERF_FORMAT_ID
+ *       { u64         lost;         } && PERF_FORMAT_LOST
  *     } && !PERF_FORMAT_GROUP
  *
  *     { u64           nr;
@@ -308,6 +309,7 @@ enum {
  *       { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
  *       { u64         value;
  *         { u64       id;           } && PERF_FORMAT_ID
+ *         { u64       lost;         } && PERF_FORMAT_LOST
  *       }             cntr[nr];
  *     } && PERF_FORMAT_GROUP
  * };
@@ -317,8 +319,9 @@ enum perf_event_read_format {
        PERF_FORMAT_TOTAL_TIME_RUNNING          = 1U << 1,
        PERF_FORMAT_ID                          = 1U << 2,
        PERF_FORMAT_GROUP                       = 1U << 3,
+       PERF_FORMAT_LOST                        = 1U << 4,
 
-       PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
+       PERF_FORMAT_MAX = 1U << 5,              /* non-ABI */
 };
 
 #define PERF_ATTR_SIZE_VER0    64      /* sizeof first published struct */
index 24b5c2ab55983abb4321d4e0ec792d5c8b2e1b7b..feb59380c89627e30dbe197722ff2c5fc2f830ba 100644 (file)
@@ -310,6 +310,9 @@ static void cgroup_base_stat_add(struct cgroup_base_stat *dst_bstat,
        dst_bstat->cputime.utime += src_bstat->cputime.utime;
        dst_bstat->cputime.stime += src_bstat->cputime.stime;
        dst_bstat->cputime.sum_exec_runtime += src_bstat->cputime.sum_exec_runtime;
+#ifdef CONFIG_SCHED_CORE
+       dst_bstat->forceidle_sum += src_bstat->forceidle_sum;
+#endif
 }
 
 static void cgroup_base_stat_sub(struct cgroup_base_stat *dst_bstat,
@@ -318,6 +321,9 @@ static void cgroup_base_stat_sub(struct cgroup_base_stat *dst_bstat,
        dst_bstat->cputime.utime -= src_bstat->cputime.utime;
        dst_bstat->cputime.stime -= src_bstat->cputime.stime;
        dst_bstat->cputime.sum_exec_runtime -= src_bstat->cputime.sum_exec_runtime;
+#ifdef CONFIG_SCHED_CORE
+       dst_bstat->forceidle_sum -= src_bstat->forceidle_sum;
+#endif
 }
 
 static void cgroup_base_stat_flush(struct cgroup *cgrp, int cpu)
@@ -398,6 +404,11 @@ void __cgroup_account_cputime_field(struct cgroup *cgrp,
        case CPUTIME_SOFTIRQ:
                rstatc->bstat.cputime.stime += delta_exec;
                break;
+#ifdef CONFIG_SCHED_CORE
+       case CPUTIME_FORCEIDLE:
+               rstatc->bstat.forceidle_sum += delta_exec;
+               break;
+#endif
        default:
                break;
        }
@@ -411,8 +422,9 @@ void __cgroup_account_cputime_field(struct cgroup *cgrp,
  * with how it is done by __cgroup_account_cputime_field for each bit of
  * cpu time attributed to a cgroup.
  */
-static void root_cgroup_cputime(struct task_cputime *cputime)
+static void root_cgroup_cputime(struct cgroup_base_stat *bstat)
 {
+       struct task_cputime *cputime = &bstat->cputime;
        int i;
 
        cputime->stime = 0;
@@ -438,6 +450,10 @@ static void root_cgroup_cputime(struct task_cputime *cputime)
                cputime->sum_exec_runtime += user;
                cputime->sum_exec_runtime += sys;
                cputime->sum_exec_runtime += cpustat[CPUTIME_STEAL];
+
+#ifdef CONFIG_SCHED_CORE
+               bstat->forceidle_sum += cpustat[CPUTIME_FORCEIDLE];
+#endif
        }
 }
 
@@ -445,27 +461,43 @@ void cgroup_base_stat_cputime_show(struct seq_file *seq)
 {
        struct cgroup *cgrp = seq_css(seq)->cgroup;
        u64 usage, utime, stime;
-       struct task_cputime cputime;
+       struct cgroup_base_stat bstat;
+#ifdef CONFIG_SCHED_CORE
+       u64 forceidle_time;
+#endif
 
        if (cgroup_parent(cgrp)) {
                cgroup_rstat_flush_hold(cgrp);
                usage = cgrp->bstat.cputime.sum_exec_runtime;
                cputime_adjust(&cgrp->bstat.cputime, &cgrp->prev_cputime,
                               &utime, &stime);
+#ifdef CONFIG_SCHED_CORE
+               forceidle_time = cgrp->bstat.forceidle_sum;
+#endif
                cgroup_rstat_flush_release();
        } else {
-               root_cgroup_cputime(&cputime);
-               usage = cputime.sum_exec_runtime;
-               utime = cputime.utime;
-               stime = cputime.stime;
+               root_cgroup_cputime(&bstat);
+               usage = bstat.cputime.sum_exec_runtime;
+               utime = bstat.cputime.utime;
+               stime = bstat.cputime.stime;
+#ifdef CONFIG_SCHED_CORE
+               forceidle_time = bstat.forceidle_sum;
+#endif
        }
 
        do_div(usage, NSEC_PER_USEC);
        do_div(utime, NSEC_PER_USEC);
        do_div(stime, NSEC_PER_USEC);
+#ifdef CONFIG_SCHED_CORE
+       do_div(forceidle_time, NSEC_PER_USEC);
+#endif
 
        seq_printf(seq, "usage_usec %llu\n"
                   "user_usec %llu\n"
                   "system_usec %llu\n",
                   usage, utime, stime);
+
+#ifdef CONFIG_SCHED_CORE
+       seq_printf(seq, "core_sched.force_idle_usec %llu\n", forceidle_time);
+#endif
 }
index dcd86f32f4ed69420c566b68dbcd47e2913f05df..6fac5b405334e199148a41a3320809b8fa7423eb 100644 (file)
@@ -7,12 +7,11 @@ CONFIG_DEBUG_SLAB=y
 CONFIG_DEBUG_KMEMLEAK=y
 CONFIG_DEBUG_PAGEALLOC=y
 CONFIG_SLUB_DEBUG_ON=y
-CONFIG_KMEMCHECK=y
 CONFIG_DEBUG_OBJECTS=y
 CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
 CONFIG_GCOV_KERNEL=y
 CONFIG_LOCKDEP=y
 CONFIG_PROVE_LOCKING=y
 CONFIG_SCHEDSTATS=y
-CONFIG_VMLINUX_VALIDATION=y
+CONFIG_NOINSTR_VALIDATION=y
 CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
index d2b354991bf5a73982cf817a93fd47a9e6cd50a5..c9d32d4d2e204169b3623e2edb50f390f4322794 100644 (file)
@@ -1819,6 +1819,9 @@ static void __perf_event_read_size(struct perf_event *event, int nr_siblings)
        if (event->attr.read_format & PERF_FORMAT_ID)
                entry += sizeof(u64);
 
+       if (event->attr.read_format & PERF_FORMAT_LOST)
+               entry += sizeof(u64);
+
        if (event->attr.read_format & PERF_FORMAT_GROUP) {
                nr += nr_siblings;
                size += sizeof(u64);
@@ -5260,11 +5263,15 @@ static int __perf_read_group_add(struct perf_event *leader,
        values[n++] += perf_event_count(leader);
        if (read_format & PERF_FORMAT_ID)
                values[n++] = primary_event_id(leader);
+       if (read_format & PERF_FORMAT_LOST)
+               values[n++] = atomic64_read(&leader->lost_samples);
 
        for_each_sibling_event(sub, leader) {
                values[n++] += perf_event_count(sub);
                if (read_format & PERF_FORMAT_ID)
                        values[n++] = primary_event_id(sub);
+               if (read_format & PERF_FORMAT_LOST)
+                       values[n++] = atomic64_read(&sub->lost_samples);
        }
 
        raw_spin_unlock_irqrestore(&ctx->lock, flags);
@@ -5321,7 +5328,7 @@ static int perf_read_one(struct perf_event *event,
                                 u64 read_format, char __user *buf)
 {
        u64 enabled, running;
-       u64 values[4];
+       u64 values[5];
        int n = 0;
 
        values[n++] = __perf_event_read_value(event, &enabled, &running);
@@ -5331,6 +5338,8 @@ static int perf_read_one(struct perf_event *event,
                values[n++] = running;
        if (read_format & PERF_FORMAT_ID)
                values[n++] = primary_event_id(event);
+       if (read_format & PERF_FORMAT_LOST)
+               values[n++] = atomic64_read(&event->lost_samples);
 
        if (copy_to_user(buf, values, n * sizeof(u64)))
                return -EFAULT;
@@ -6858,7 +6867,7 @@ static void perf_output_read_one(struct perf_output_handle *handle,
                                 u64 enabled, u64 running)
 {
        u64 read_format = event->attr.read_format;
-       u64 values[4];
+       u64 values[5];
        int n = 0;
 
        values[n++] = perf_event_count(event);
@@ -6872,6 +6881,8 @@ static void perf_output_read_one(struct perf_output_handle *handle,
        }
        if (read_format & PERF_FORMAT_ID)
                values[n++] = primary_event_id(event);
+       if (read_format & PERF_FORMAT_LOST)
+               values[n++] = atomic64_read(&event->lost_samples);
 
        __output_copy(handle, values, n * sizeof(u64));
 }
@@ -6882,7 +6893,7 @@ static void perf_output_read_group(struct perf_output_handle *handle,
 {
        struct perf_event *leader = event->group_leader, *sub;
        u64 read_format = event->attr.read_format;
-       u64 values[5];
+       u64 values[6];
        int n = 0;
 
        values[n++] = 1 + leader->nr_siblings;
@@ -6900,6 +6911,8 @@ static void perf_output_read_group(struct perf_output_handle *handle,
        values[n++] = perf_event_count(leader);
        if (read_format & PERF_FORMAT_ID)
                values[n++] = primary_event_id(leader);
+       if (read_format & PERF_FORMAT_LOST)
+               values[n++] = atomic64_read(&leader->lost_samples);
 
        __output_copy(handle, values, n * sizeof(u64));
 
@@ -6913,6 +6926,8 @@ static void perf_output_read_group(struct perf_output_handle *handle,
                values[n++] = perf_event_count(sub);
                if (read_format & PERF_FORMAT_ID)
                        values[n++] = primary_event_id(sub);
+               if (read_format & PERF_FORMAT_LOST)
+                       values[n++] = atomic64_read(&sub->lost_samples);
 
                __output_copy(handle, values, n * sizeof(u64));
        }
index fb35b926024caeda34d6678f4bc98db6b70069b2..726132039c388eb03740e56555e522f8a97325b6 100644 (file)
@@ -172,8 +172,10 @@ __perf_output_begin(struct perf_output_handle *handle,
                goto out;
 
        if (unlikely(rb->paused)) {
-               if (rb->nr_pages)
+               if (rb->nr_pages) {
                        local_inc(&rb->lost);
+                       atomic64_inc(&event->lost_samples);
+               }
                goto out;
        }
 
@@ -254,6 +256,7 @@ __perf_output_begin(struct perf_output_handle *handle,
 
 fail:
        local_inc(&rb->lost);
+       atomic64_inc(&event->lost_samples);
        perf_output_put_handle(handle);
 out:
        rcu_read_unlock();
index 10929eda9825829b14352ab68b82d3b4fd9bae3b..db3d174c53d484b8ebd5b69020b632ad131fd0b6 100644 (file)
@@ -24,6 +24,7 @@ config GENERIC_IRQ_SHOW_LEVEL
 
 # Supports effective affinity mask
 config GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       depends on SMP
        bool
 
 # Support for delayed migration from interrupt context
@@ -82,6 +83,7 @@ config IRQ_FASTEOI_HIERARCHY_HANDLERS
 # Generic IRQ IPI support
 config GENERIC_IRQ_IPI
        bool
+       depends on SMP
        select IRQ_DOMAIN_HIERARCHY
 
 # Generic MSI interrupt support
index 886789dcee435dab42179778931ea8068699edbf..8ac37e8e738a3b48f685fab8079bbd49ed06c279 100644 (file)
@@ -188,7 +188,8 @@ enum {
 
 #ifdef CONFIG_SMP
 static int
-__irq_startup_managed(struct irq_desc *desc, struct cpumask *aff, bool force)
+__irq_startup_managed(struct irq_desc *desc, const struct cpumask *aff,
+                     bool force)
 {
        struct irq_data *d = irq_desc_get_irq_data(desc);
 
@@ -224,7 +225,8 @@ __irq_startup_managed(struct irq_desc *desc, struct cpumask *aff, bool force)
 }
 #else
 static __always_inline int
-__irq_startup_managed(struct irq_desc *desc, struct cpumask *aff, bool force)
+__irq_startup_managed(struct irq_desc *desc, const struct cpumask *aff,
+                     bool force)
 {
        return IRQ_STARTUP_NORMAL;
 }
@@ -252,7 +254,7 @@ static int __irq_startup(struct irq_desc *desc)
 int irq_startup(struct irq_desc *desc, bool resend, bool force)
 {
        struct irq_data *d = irq_desc_get_irq_data(desc);
-       struct cpumask *aff = irq_data_get_affinity_mask(d);
+       const struct cpumask *aff = irq_data_get_affinity_mask(d);
        int ret = 0;
 
        desc->depth = 0;
@@ -1516,7 +1518,8 @@ int irq_chip_request_resources_parent(struct irq_data *data)
        if (data->chip->irq_request_resources)
                return data->chip->irq_request_resources(data);
 
-       return -ENOSYS;
+       /* no error on missing optional irq_chip::irq_request_resources */
+       return 0;
 }
 EXPORT_SYMBOL_GPL(irq_chip_request_resources_parent);
 
index bc8e40cf2b65adc4c8ac0e1a56909b4dc2f078dc..bbcaac64038ef7e4e01cdaa298f15b081f3a67b1 100644 (file)
@@ -30,7 +30,7 @@ static void irq_debug_show_bits(struct seq_file *m, int ind, unsigned int state,
 static void irq_debug_show_masks(struct seq_file *m, struct irq_desc *desc)
 {
        struct irq_data *data = irq_desc_get_irq_data(desc);
-       struct cpumask *msk;
+       const struct cpumask *msk;
 
        msk = irq_data_get_affinity_mask(data);
        seq_printf(m, "affinity: %*pbl\n", cpumask_pr_args(msk));
index f0862eb6b506ce1f665961a2f35a6451df902cef..c653cd31548d03ee01c1d146e02a5570fef61071 100644 (file)
@@ -431,7 +431,7 @@ int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
        return 0;
 }
 
-static void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq)
+void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq)
 {
        struct irq_data *data = irq_domain_get_irq_data(d, virq);
        struct irq_domain_chip_generic *dgc = d->gc;
index 08ce7da3b57ceca4c0d51776478d063bfa75beb2..bbd945bacef08dc8536781696542eee0be3c9b02 100644 (file)
@@ -115,11 +115,11 @@ free_descs:
 int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest)
 {
        struct irq_data *data = irq_get_irq_data(irq);
-       struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL;
+       const struct cpumask *ipimask;
        struct irq_domain *domain;
        unsigned int nr_irqs;
 
-       if (!irq || !data || !ipimask)
+       if (!irq || !data)
                return -EINVAL;
 
        domain = data->domain;
@@ -131,7 +131,8 @@ int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest)
                return -EINVAL;
        }
 
-       if (WARN_ON(!cpumask_subset(dest, ipimask)))
+       ipimask = irq_data_get_affinity_mask(data);
+       if (!ipimask || WARN_ON(!cpumask_subset(dest, ipimask)))
                /*
                 * Must be destroying a subset of CPUs to which this IPI
                 * was set up to target
@@ -162,12 +163,13 @@ int irq_destroy_ipi(unsigned int irq, const struct cpumask *dest)
 irq_hw_number_t ipi_get_hwirq(unsigned int irq, unsigned int cpu)
 {
        struct irq_data *data = irq_get_irq_data(irq);
-       struct cpumask *ipimask = data ? irq_data_get_affinity_mask(data) : NULL;
+       const struct cpumask *ipimask;
 
-       if (!data || !ipimask || cpu >= nr_cpu_ids)
+       if (!data || cpu >= nr_cpu_ids)
                return INVALID_HWIRQ;
 
-       if (!cpumask_test_cpu(cpu, ipimask))
+       ipimask = irq_data_get_affinity_mask(data);
+       if (!ipimask || !cpumask_test_cpu(cpu, ipimask))
                return INVALID_HWIRQ;
 
        /*
@@ -186,7 +188,7 @@ EXPORT_SYMBOL_GPL(ipi_get_hwirq);
 static int ipi_send_verify(struct irq_chip *chip, struct irq_data *data,
                           const struct cpumask *dest, unsigned int cpu)
 {
-       struct cpumask *ipimask = irq_data_get_affinity_mask(data);
+       const struct cpumask *ipimask = irq_data_get_affinity_mask(data);
 
        if (!chip || !ipimask)
                return -EINVAL;
index d323b180b0f371b1176e1926e2d3130497e146b8..5db0230aa6b52fbd945bba99d60b498a08c66277 100644 (file)
@@ -251,7 +251,7 @@ static ssize_t actions_show(struct kobject *kobj,
        char *p = "";
 
        raw_spin_lock_irq(&desc->lock);
-       for (action = desc->action; action != NULL; action = action->next) {
+       for_each_action_of_desc(desc, action) {
                ret += scnprintf(buf + ret, PAGE_SIZE - ret, "%s%s",
                                 p, action->name);
                p = ",";
index d5ce965105493df4fcb098d1fd6f86af52ae5073..8fe1da9614ee8db33ff75a21010e6da45f9dfbc2 100644 (file)
@@ -147,7 +147,8 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int s
        static atomic_t unknown_domains;
 
        if (WARN_ON((size && direct_max) ||
-                   (!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && direct_max)))
+                   (!IS_ENABLED(CONFIG_IRQ_DOMAIN_NOMAP) && direct_max) ||
+                   (direct_max && (direct_max != hwirq_max))))
                return NULL;
 
        domain = kzalloc_node(struct_size(domain, revmap, size),
@@ -219,7 +220,6 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, unsigned int s
        domain->hwirq_max = hwirq_max;
 
        if (direct_max) {
-               size = direct_max;
                domain->flags |= IRQ_DOMAIN_FLAG_NO_MAP;
        }
 
@@ -650,9 +650,9 @@ unsigned int irq_create_direct_mapping(struct irq_domain *domain)
                pr_debug("create_direct virq allocation failed\n");
                return 0;
        }
-       if (virq >= domain->revmap_size) {
-               pr_err("ERROR: no free irqs available below %i maximum\n",
-                       domain->revmap_size);
+       if (virq >= domain->hwirq_max) {
+               pr_err("ERROR: no free irqs available below %lu maximum\n",
+                       domain->hwirq_max);
                irq_free_desc(virq);
                return 0;
        }
@@ -906,10 +906,12 @@ struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain,
                return desc;
 
        if (irq_domain_is_nomap(domain)) {
-               if (hwirq < domain->revmap_size) {
+               if (hwirq < domain->hwirq_max) {
                        data = irq_domain_get_irq_data(domain, hwirq);
                        if (data && data->hwirq == hwirq)
                                desc = irq_data_to_desc(data);
+                       if (irq && desc)
+                               *irq = hwirq;
                }
 
                return desc;
index 8c396319d5ac2f4d3619bbdde7fa98dc625e776d..40fe7806cc8c991a5b84d5986023367f3b334e7e 100644 (file)
@@ -205,16 +205,8 @@ static void irq_validate_effective_affinity(struct irq_data *data)
        pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n",
                     chip->name, data->irq);
 }
-
-static inline void irq_init_effective_affinity(struct irq_data *data,
-                                              const struct cpumask *mask)
-{
-       cpumask_copy(irq_data_get_effective_affinity_mask(data), mask);
-}
 #else
 static inline void irq_validate_effective_affinity(struct irq_data *data) { }
-static inline void irq_init_effective_affinity(struct irq_data *data,
-                                              const struct cpumask *mask) { }
 #endif
 
 int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
@@ -347,7 +339,7 @@ static bool irq_set_affinity_deactivated(struct irq_data *data,
                return false;
 
        cpumask_copy(desc->irq_common_data.affinity, mask);
-       irq_init_effective_affinity(data, mask);
+       irq_data_update_effective_affinity(data, mask);
        irqd_set(data, IRQD_AFFINITY_SET);
        return true;
 }
index ca71123a61305f399cd7ec421b8c71884dea483e..c556bc49d2137ea30f27d18016b2104d5c48f456 100644 (file)
@@ -147,7 +147,6 @@ void suspend_device_irqs(void)
                        synchronize_irq(irq);
        }
 }
-EXPORT_SYMBOL_GPL(suspend_device_irqs);
 
 static void resume_irq(struct irq_desc *desc)
 {
@@ -259,4 +258,3 @@ void resume_device_irqs(void)
 {
        resume_irqs(false);
 }
-EXPORT_SYMBOL_GPL(resume_device_irqs);
index b156e152d6b48d093e4eb1e54290179e0c75743d..714ac4c3b556de14ab896f45d6d9a905552bb118 100644 (file)
@@ -332,17 +332,13 @@ static int __jump_label_text_reserved(struct jump_entry *iter_start,
        return 0;
 }
 
-/*
- * Update code which is definitely not currently executing.
- * Architectures which need heavyweight synchronization to modify
- * running code can override this to make the non-live update case
- * cheaper.
- */
-void __weak __init_or_module arch_jump_label_transform_static(struct jump_entry *entry,
-                                           enum jump_label_type type)
+#ifndef arch_jump_label_transform_static
+static void arch_jump_label_transform_static(struct jump_entry *entry,
+                                            enum jump_label_type type)
 {
-       arch_jump_label_transform(entry, type);
+       /* nothing to do on most architectures */
 }
+#endif
 
 static inline struct jump_entry *static_key_entries(struct static_key *key)
 {
@@ -508,7 +504,7 @@ void __init jump_label_init(void)
 
 #ifdef CONFIG_MODULES
 
-static enum jump_label_type jump_label_init_type(struct jump_entry *entry)
+enum jump_label_type jump_label_init_type(struct jump_entry *entry)
 {
        struct static_key *key = jump_entry_key(entry);
        bool type = static_key_type(key);
@@ -596,31 +592,6 @@ static void __jump_label_mod_update(struct static_key *key)
        }
 }
 
-/***
- * apply_jump_label_nops - patch module jump labels with arch_get_jump_label_nop()
- * @mod: module to patch
- *
- * Allow for run-time selection of the optimal nops. Before the module
- * loads patch these with arch_get_jump_label_nop(), which is specified by
- * the arch specific jump label code.
- */
-void jump_label_apply_nops(struct module *mod)
-{
-       struct jump_entry *iter_start = mod->jump_entries;
-       struct jump_entry *iter_stop = iter_start + mod->num_jump_entries;
-       struct jump_entry *iter;
-
-       /* if the module doesn't have jump label entries, just return */
-       if (iter_start == iter_stop)
-               return;
-
-       for (iter = iter_start; iter < iter_stop; iter++) {
-               /* Only write NOPs for arch_branch_static(). */
-               if (jump_label_init_type(iter) == JUMP_LABEL_NOP)
-                       arch_jump_label_transform_static(iter, JUMP_LABEL_NOP);
-       }
-}
-
 static int jump_label_add_module(struct module *mod)
 {
        struct jump_entry *iter_start = mod->jump_entries;
index f06b91ca6482d36777d42e0af52c82f2b6ba6bb0..e2f179491b086d02e7911da76685dad82e6322e8 100644 (file)
@@ -5238,9 +5238,10 @@ __lock_set_class(struct lockdep_map *lock, const char *name,
                return 0;
        }
 
-       lockdep_init_map_waits(lock, name, key, 0,
-                              lock->wait_type_inner,
-                              lock->wait_type_outer);
+       lockdep_init_map_type(lock, name, key, 0,
+                             lock->wait_type_inner,
+                             lock->wait_type_outer,
+                             lock->lock_type);
        class = register_lock_class(lock, subclass, 0);
        hlock->class_idx = class - lock_classes;
 
index 9d1db4a54d34e9db4ba2c8b1a4e3d231b52f1b37..65f0262f635e124e9ee1ad046e2ca034d9c89724 100644 (file)
@@ -335,8 +335,6 @@ struct rwsem_waiter {
        struct task_struct *task;
        enum rwsem_waiter_type type;
        unsigned long timeout;
-
-       /* Writer only, not initialized in reader */
        bool handoff_set;
 };
 #define rwsem_first_waiter(sem) \
@@ -459,10 +457,12 @@ static void rwsem_mark_wake(struct rw_semaphore *sem,
                         * to give up the lock), request a HANDOFF to
                         * force the issue.
                         */
-                       if (!(oldcount & RWSEM_FLAG_HANDOFF) &&
-                           time_after(jiffies, waiter->timeout)) {
-                               adjustment -= RWSEM_FLAG_HANDOFF;
-                               lockevent_inc(rwsem_rlock_handoff);
+                       if (time_after(jiffies, waiter->timeout)) {
+                               if (!(oldcount & RWSEM_FLAG_HANDOFF)) {
+                                       adjustment -= RWSEM_FLAG_HANDOFF;
+                                       lockevent_inc(rwsem_rlock_handoff);
+                               }
+                               waiter->handoff_set = true;
                        }
 
                        atomic_long_add(-adjustment, &sem->count);
@@ -599,7 +599,7 @@ rwsem_del_wake_waiter(struct rw_semaphore *sem, struct rwsem_waiter *waiter,
 static inline bool rwsem_try_write_lock(struct rw_semaphore *sem,
                                        struct rwsem_waiter *waiter)
 {
-       bool first = rwsem_first_waiter(sem) == waiter;
+       struct rwsem_waiter *first = rwsem_first_waiter(sem);
        long count, new;
 
        lockdep_assert_held(&sem->wait_lock);
@@ -609,11 +609,20 @@ static inline bool rwsem_try_write_lock(struct rw_semaphore *sem,
                bool has_handoff = !!(count & RWSEM_FLAG_HANDOFF);
 
                if (has_handoff) {
-                       if (!first)
+                       /*
+                        * Honor handoff bit and yield only when the first
+                        * waiter is the one that set it. Otherwisee, we
+                        * still try to acquire the rwsem.
+                        */
+                       if (first->handoff_set && (waiter != first))
                                return false;
 
-                       /* First waiter inherits a previously set handoff bit */
-                       waiter->handoff_set = true;
+                       /*
+                        * First waiter can inherit a previously set handoff
+                        * bit and spin on rwsem if lock acquisition fails.
+                        */
+                       if (waiter == first)
+                               waiter->handoff_set = true;
                }
 
                new = count;
@@ -1027,6 +1036,7 @@ queue:
        waiter.task = current;
        waiter.type = RWSEM_WAITING_FOR_READ;
        waiter.timeout = jiffies + RWSEM_WAIT_TIMEOUT;
+       waiter.handoff_set = false;
 
        raw_spin_lock_irq(&sem->wait_lock);
        if (list_empty(&sem->wait_list)) {
index 97ac20b4f7387f9276a3434b9a17fa61508997ae..bda8175f8f9932979ab5d41a08ea5cf4fa3916e4 100644 (file)
@@ -18,8 +18,9 @@
 #define CREATE_TRACE_POINTS
 #include <trace/events/rseq.h>
 
-#define RSEQ_CS_PREEMPT_MIGRATE_FLAGS (RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE | \
-                                      RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT)
+#define RSEQ_CS_NO_RESTART_FLAGS (RSEQ_CS_FLAG_NO_RESTART_ON_PREEMPT | \
+                                 RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL | \
+                                 RSEQ_CS_FLAG_NO_RESTART_ON_MIGRATE)
 
 /*
  *
@@ -175,23 +176,15 @@ static int rseq_need_restart(struct task_struct *t, u32 cs_flags)
        u32 flags, event_mask;
        int ret;
 
+       if (WARN_ON_ONCE(cs_flags & RSEQ_CS_NO_RESTART_FLAGS) || cs_flags)
+               return -EINVAL;
+
        /* Get thread flags. */
        ret = get_user(flags, &t->rseq->flags);
        if (ret)
                return ret;
 
-       /* Take critical section flags into account. */
-       flags |= cs_flags;
-
-       /*
-        * Restart on signal can only be inhibited when restart on
-        * preempt and restart on migrate are inhibited too. Otherwise,
-        * a preempted signal handler could fail to restart the prior
-        * execution context on sigreturn.
-        */
-       if (unlikely((flags & RSEQ_CS_FLAG_NO_RESTART_ON_SIGNAL) &&
-                    (flags & RSEQ_CS_PREEMPT_MIGRATE_FLAGS) !=
-                    RSEQ_CS_PREEMPT_MIGRATE_FLAGS))
+       if (WARN_ON_ONCE(flags & RSEQ_CS_NO_RESTART_FLAGS) || flags)
                return -EINVAL;
 
        /*
@@ -203,7 +196,7 @@ static int rseq_need_restart(struct task_struct *t, u32 cs_flags)
        t->rseq_event_mask = 0;
        preempt_enable();
 
-       return !!(event_mask & ~flags);
+       return !!event_mask;
 }
 
 static int clear_rseq_cs(struct task_struct *t)
index da0bf6fe9ecdcf697a1f9dff304c71d0d3433155..5555e49c4e120cdfab2803393ec0f02879741815 100644 (file)
@@ -873,15 +873,11 @@ static inline void hrtick_rq_init(struct rq *rq)
        ({                                                              \
                typeof(ptr) _ptr = (ptr);                               \
                typeof(mask) _mask = (mask);                            \
-               typeof(*_ptr) _old, _val = *_ptr;                       \
+               typeof(*_ptr) _val = *_ptr;                             \
                                                                        \
-               for (;;) {                                              \
-                       _old = cmpxchg(_ptr, _val, _val | _mask);       \
-                       if (_old == _val)                               \
-                               break;                                  \
-                       _val = _old;                                    \
-               }                                                       \
-       _old;                                                           \
+               do {                                                    \
+               } while (!try_cmpxchg(_ptr, &_val, _val | _mask));      \
+       _val;                                                           \
 })
 
 #if defined(CONFIG_SMP) && defined(TIF_POLLING_NRFLAG)
@@ -890,7 +886,7 @@ static inline void hrtick_rq_init(struct rq *rq)
  * this avoids any races wrt polling state changes and thereby avoids
  * spurious IPIs.
  */
-static bool set_nr_and_not_polling(struct task_struct *p)
+static inline bool set_nr_and_not_polling(struct task_struct *p)
 {
        struct thread_info *ti = task_thread_info(p);
        return !(fetch_or(&ti->flags, _TIF_NEED_RESCHED) & _TIF_POLLING_NRFLAG);
@@ -905,30 +901,28 @@ static bool set_nr_and_not_polling(struct task_struct *p)
 static bool set_nr_if_polling(struct task_struct *p)
 {
        struct thread_info *ti = task_thread_info(p);
-       typeof(ti->flags) old, val = READ_ONCE(ti->flags);
+       typeof(ti->flags) val = READ_ONCE(ti->flags);
 
        for (;;) {
                if (!(val & _TIF_POLLING_NRFLAG))
                        return false;
                if (val & _TIF_NEED_RESCHED)
                        return true;
-               old = cmpxchg(&ti->flags, val, val | _TIF_NEED_RESCHED);
-               if (old == val)
+               if (try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED))
                        break;
-               val = old;
        }
        return true;
 }
 
 #else
-static bool set_nr_and_not_polling(struct task_struct *p)
+static inline bool set_nr_and_not_polling(struct task_struct *p)
 {
        set_tsk_need_resched(p);
        return true;
 }
 
 #ifdef CONFIG_SMP
-static bool set_nr_if_polling(struct task_struct *p)
+static inline bool set_nr_if_polling(struct task_struct *p)
 {
        return false;
 }
@@ -3808,7 +3802,7 @@ bool cpus_share_cache(int this_cpu, int that_cpu)
        return per_cpu(sd_llc_id, this_cpu) == per_cpu(sd_llc_id, that_cpu);
 }
 
-static inline bool ttwu_queue_cond(int cpu, int wake_flags)
+static inline bool ttwu_queue_cond(int cpu)
 {
        /*
         * Do not complicate things with the async wake_list while the CPU is
@@ -3824,13 +3818,21 @@ static inline bool ttwu_queue_cond(int cpu, int wake_flags)
        if (!cpus_share_cache(smp_processor_id(), cpu))
                return true;
 
+       if (cpu == smp_processor_id())
+               return false;
+
        /*
-        * If the task is descheduling and the only running task on the
-        * CPU then use the wakelist to offload the task activation to
-        * the soon-to-be-idle CPU as the current CPU is likely busy.
-        * nr_running is checked to avoid unnecessary task stacking.
+        * If the wakee cpu is idle, or the task is descheduling and the
+        * only running task on the CPU, then use the wakelist to offload
+        * the task activation to the idle (or soon-to-be-idle) CPU as
+        * the current CPU is likely busy. nr_running is checked to
+        * avoid unnecessary task stacking.
+        *
+        * Note that we can only get here with (wakee) p->on_rq=0,
+        * p->on_cpu can be whatever, we've done the dequeue, so
+        * the wakee has been accounted out of ->nr_running.
         */
-       if ((wake_flags & WF_ON_CPU) && cpu_rq(cpu)->nr_running <= 1)
+       if (!cpu_rq(cpu)->nr_running)
                return true;
 
        return false;
@@ -3838,10 +3840,7 @@ static inline bool ttwu_queue_cond(int cpu, int wake_flags)
 
 static bool ttwu_queue_wakelist(struct task_struct *p, int cpu, int wake_flags)
 {
-       if (sched_feat(TTWU_QUEUE) && ttwu_queue_cond(cpu, wake_flags)) {
-               if (WARN_ON_ONCE(cpu == smp_processor_id()))
-                       return false;
-
+       if (sched_feat(TTWU_QUEUE) && ttwu_queue_cond(cpu)) {
                sched_clock_cpu(cpu); /* Sync clocks across CPUs */
                __ttwu_queue_wakelist(p, cpu, wake_flags);
                return true;
@@ -4163,7 +4162,7 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
         * scheduling.
         */
        if (smp_load_acquire(&p->on_cpu) &&
-           ttwu_queue_wakelist(p, task_cpu(p), wake_flags | WF_ON_CPU))
+           ttwu_queue_wakelist(p, task_cpu(p), wake_flags))
                goto unlock;
 
        /*
@@ -4753,7 +4752,8 @@ static inline void prepare_task(struct task_struct *next)
         * Claim the task as running, we do this before switching to it
         * such that any running task will have this set.
         *
-        * See the ttwu() WF_ON_CPU case and its ordering comment.
+        * See the smp_load_acquire(&p->on_cpu) case in ttwu() and
+        * its ordering comment.
         */
        WRITE_ONCE(next->on_cpu, 1);
 #endif
@@ -6500,8 +6500,12 @@ static inline void sched_submit_work(struct task_struct *tsk)
                        io_wq_worker_sleeping(tsk);
        }
 
-       if (tsk_is_pi_blocked(tsk))
-               return;
+       /*
+        * spinlock and rwlock must not flush block requests.  This will
+        * deadlock if the callback attempts to acquire a lock which is
+        * already acquired.
+        */
+       SCHED_WARN_ON(current->__state & TASK_RTLOCK_WAIT);
 
        /*
         * If we are going to sleep and we have plugged IO queued,
@@ -6998,17 +7002,29 @@ out_unlock:
 EXPORT_SYMBOL(set_user_nice);
 
 /*
- * can_nice - check if a task can reduce its nice value
+ * is_nice_reduction - check if nice value is an actual reduction
+ *
+ * Similar to can_nice() but does not perform a capability check.
+ *
  * @p: task
  * @nice: nice value
  */
-int can_nice(const struct task_struct *p, const int nice)
+static bool is_nice_reduction(const struct task_struct *p, const int nice)
 {
        /* Convert nice value [19,-20] to rlimit style value [1,40]: */
        int nice_rlim = nice_to_rlimit(nice);
 
-       return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
-               capable(CAP_SYS_NICE));
+       return (nice_rlim <= task_rlimit(p, RLIMIT_NICE));
+}
+
+/*
+ * can_nice - check if a task can reduce its nice value
+ * @p: task
+ * @nice: nice value
+ */
+int can_nice(const struct task_struct *p, const int nice)
+{
+       return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
 }
 
 #ifdef __ARCH_WANT_SYS_NICE
@@ -7137,12 +7153,14 @@ struct task_struct *idle_task(int cpu)
  * required to meet deadlines.
  */
 unsigned long effective_cpu_util(int cpu, unsigned long util_cfs,
-                                unsigned long max, enum cpu_util_type type,
+                                enum cpu_util_type type,
                                 struct task_struct *p)
 {
-       unsigned long dl_util, util, irq;
+       unsigned long dl_util, util, irq, max;
        struct rq *rq = cpu_rq(cpu);
 
+       max = arch_scale_cpu_capacity(cpu);
+
        if (!uclamp_is_used() &&
            type == FREQUENCY_UTIL && rt_rq_is_runnable(&rq->rt)) {
                return max;
@@ -7222,10 +7240,9 @@ unsigned long effective_cpu_util(int cpu, unsigned long util_cfs,
        return min(max, util);
 }
 
-unsigned long sched_cpu_util(int cpu, unsigned long max)
+unsigned long sched_cpu_util(int cpu)
 {
-       return effective_cpu_util(cpu, cpu_util_cfs(cpu), max,
-                                 ENERGY_UTIL, NULL);
+       return effective_cpu_util(cpu, cpu_util_cfs(cpu), ENERGY_UTIL, NULL);
 }
 #endif /* CONFIG_SMP */
 
@@ -7287,6 +7304,69 @@ static bool check_same_owner(struct task_struct *p)
        return match;
 }
 
+/*
+ * Allow unprivileged RT tasks to decrease priority.
+ * Only issue a capable test if needed and only once to avoid an audit
+ * event on permitted non-privileged operations:
+ */
+static int user_check_sched_setscheduler(struct task_struct *p,
+                                        const struct sched_attr *attr,
+                                        int policy, int reset_on_fork)
+{
+       if (fair_policy(policy)) {
+               if (attr->sched_nice < task_nice(p) &&
+                   !is_nice_reduction(p, attr->sched_nice))
+                       goto req_priv;
+       }
+
+       if (rt_policy(policy)) {
+               unsigned long rlim_rtprio = task_rlimit(p, RLIMIT_RTPRIO);
+
+               /* Can't set/change the rt policy: */
+               if (policy != p->policy && !rlim_rtprio)
+                       goto req_priv;
+
+               /* Can't increase priority: */
+               if (attr->sched_priority > p->rt_priority &&
+                   attr->sched_priority > rlim_rtprio)
+                       goto req_priv;
+       }
+
+       /*
+        * Can't set/change SCHED_DEADLINE policy at all for now
+        * (safest behavior); in the future we would like to allow
+        * unprivileged DL tasks to increase their relative deadline
+        * or reduce their runtime (both ways reducing utilization)
+        */
+       if (dl_policy(policy))
+               goto req_priv;
+
+       /*
+        * Treat SCHED_IDLE as nice 20. Only allow a switch to
+        * SCHED_NORMAL if the RLIMIT_NICE would normally permit it.
+        */
+       if (task_has_idle_policy(p) && !idle_policy(policy)) {
+               if (!is_nice_reduction(p, task_nice(p)))
+                       goto req_priv;
+       }
+
+       /* Can't change other user's priorities: */
+       if (!check_same_owner(p))
+               goto req_priv;
+
+       /* Normal users shall not reset the sched_reset_on_fork flag: */
+       if (p->sched_reset_on_fork && !reset_on_fork)
+               goto req_priv;
+
+       return 0;
+
+req_priv:
+       if (!capable(CAP_SYS_NICE))
+               return -EPERM;
+
+       return 0;
+}
+
 static int __sched_setscheduler(struct task_struct *p,
                                const struct sched_attr *attr,
                                bool user, bool pi)
@@ -7328,58 +7408,11 @@ recheck:
            (rt_policy(policy) != (attr->sched_priority != 0)))
                return -EINVAL;
 
-       /*
-        * Allow unprivileged RT tasks to decrease priority:
-        */
-       if (user && !capable(CAP_SYS_NICE)) {
-               if (fair_policy(policy)) {
-                       if (attr->sched_nice < task_nice(p) &&
-                           !can_nice(p, attr->sched_nice))
-                               return -EPERM;
-               }
-
-               if (rt_policy(policy)) {
-                       unsigned long rlim_rtprio =
-                                       task_rlimit(p, RLIMIT_RTPRIO);
-
-                       /* Can't set/change the rt policy: */
-                       if (policy != p->policy && !rlim_rtprio)
-                               return -EPERM;
-
-                       /* Can't increase priority: */
-                       if (attr->sched_priority > p->rt_priority &&
-                           attr->sched_priority > rlim_rtprio)
-                               return -EPERM;
-               }
-
-                /*
-                 * Can't set/change SCHED_DEADLINE policy at all for now
-                 * (safest behavior); in the future we would like to allow
-                 * unprivileged DL tasks to increase their relative deadline
-                 * or reduce their runtime (both ways reducing utilization)
-                 */
-               if (dl_policy(policy))
-                       return -EPERM;
-
-               /*
-                * Treat SCHED_IDLE as nice 20. Only allow a switch to
-                * SCHED_NORMAL if the RLIMIT_NICE would normally permit it.
-                */
-               if (task_has_idle_policy(p) && !idle_policy(policy)) {
-                       if (!can_nice(p, task_nice(p)))
-                               return -EPERM;
-               }
-
-               /* Can't change other user's priorities: */
-               if (!check_same_owner(p))
-                       return -EPERM;
-
-               /* Normal users shall not reset the sched_reset_on_fork flag: */
-               if (p->sched_reset_on_fork && !reset_on_fork)
-                       return -EPERM;
-       }
-
        if (user) {
+               retval = user_check_sched_setscheduler(p, attr, policy, reset_on_fork);
+               if (retval)
+                       return retval;
+
                if (attr->sched_flags & SCHED_FLAG_SUGOV)
                        return -EINVAL;
 
@@ -9531,7 +9564,7 @@ static struct kmem_cache *task_group_cache __read_mostly;
 #endif
 
 DECLARE_PER_CPU(cpumask_var_t, load_balance_mask);
-DECLARE_PER_CPU(cpumask_var_t, select_idle_mask);
+DECLARE_PER_CPU(cpumask_var_t, select_rq_mask);
 
 void __init sched_init(void)
 {
@@ -9580,7 +9613,7 @@ void __init sched_init(void)
        for_each_possible_cpu(i) {
                per_cpu(load_balance_mask, i) = (cpumask_var_t)kzalloc_node(
                        cpumask_size(), GFP_KERNEL, cpu_to_node(i));
-               per_cpu(select_idle_mask, i) = (cpumask_var_t)kzalloc_node(
+               per_cpu(select_rq_mask, i) = (cpumask_var_t)kzalloc_node(
                        cpumask_size(), GFP_KERNEL, cpu_to_node(i));
        }
 #endif /* CONFIG_CPUMASK_OFFSTACK */
index 38a2cec21014d8805f433cdb87e71553546fe600..93878cb2a46dcaab88465c2f9c76db353144c275 100644 (file)
@@ -56,7 +56,6 @@ static unsigned long sched_core_update_cookie(struct task_struct *p,
        unsigned long old_cookie;
        struct rq_flags rf;
        struct rq *rq;
-       bool enqueued;
 
        rq = task_rq_lock(p, &rf);
 
@@ -68,14 +67,16 @@ static unsigned long sched_core_update_cookie(struct task_struct *p,
         */
        SCHED_WARN_ON((p->core_cookie || cookie) && !sched_core_enabled(rq));
 
-       enqueued = sched_core_enqueued(p);
-       if (enqueued)
+       if (sched_core_enqueued(p))
                sched_core_dequeue(rq, p, DEQUEUE_SAVE);
 
        old_cookie = p->core_cookie;
        p->core_cookie = cookie;
 
-       if (enqueued)
+       /*
+        * Consider the cases: !prev_cookie and !cookie.
+        */
+       if (cookie && task_on_rq_queued(p))
                sched_core_enqueue(rq, p);
 
        /*
@@ -277,7 +278,11 @@ void __sched_core_account_forceidle(struct rq *rq)
                if (p == rq_i->idle)
                        continue;
 
-               __schedstat_add(p->stats.core_forceidle_sum, delta);
+               /*
+                * Note: this will account forceidle to the current cpu, even
+                * if it comes from our SMT sibling.
+                */
+               __account_forceidle_time(p, delta);
        }
 }
 
index 3dbf351d12d52900096b293e09b9406e75c7903a..1207c78f85c11fab5ac211098ae175d14c66526d 100644 (file)
@@ -157,11 +157,10 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy,
 static void sugov_get_util(struct sugov_cpu *sg_cpu)
 {
        struct rq *rq = cpu_rq(sg_cpu->cpu);
-       unsigned long max = arch_scale_cpu_capacity(sg_cpu->cpu);
 
-       sg_cpu->max = max;
+       sg_cpu->max = arch_scale_cpu_capacity(sg_cpu->cpu);
        sg_cpu->bw_dl = cpu_bw_dl(rq);
-       sg_cpu->util = effective_cpu_util(sg_cpu->cpu, cpu_util_cfs(sg_cpu->cpu), max,
+       sg_cpu->util = effective_cpu_util(sg_cpu->cpu, cpu_util_cfs(sg_cpu->cpu),
                                          FREQUENCY_UTIL, NULL);
 }
 
index 78a233d43757fca50aa693092790f8e41bdd649f..95fc778537434da8f1689cc2a788450da8fc2b1d 100644 (file)
@@ -226,6 +226,21 @@ void account_idle_time(u64 cputime)
                cpustat[CPUTIME_IDLE] += cputime;
 }
 
+
+#ifdef CONFIG_SCHED_CORE
+/*
+ * Account for forceidle time due to core scheduling.
+ *
+ * REQUIRES: schedstat is enabled.
+ */
+void __account_forceidle_time(struct task_struct *p, u64 delta)
+{
+       __schedstat_add(p->stats.core_forceidle_sum, delta);
+
+       task_group_account_field(p, CPUTIME_FORCEIDLE, delta);
+}
+#endif
+
 /*
  * When a guest is interrupted for a longer amount of time, missed clock
  * ticks are not redelivered later. Due to that, this function may on
index 7bf561262cb86a3b87b2502b842cedcfe2115209..0ab79d819a0d64f0b533683605b914d8b9398443 100644 (file)
@@ -30,14 +30,16 @@ static struct ctl_table sched_dl_sysctls[] = {
                .data           = &sysctl_sched_dl_period_max,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec,
+               .proc_handler   = proc_douintvec_minmax,
+               .extra1         = (void *)&sysctl_sched_dl_period_min,
        },
        {
                .procname       = "sched_deadline_period_min_us",
                .data           = &sysctl_sched_dl_period_min,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec,
+               .proc_handler   = proc_douintvec_minmax,
+               .extra2         = (void *)&sysctl_sched_dl_period_max,
        },
        {}
 };
index 77b2048a932622a0188f8f93680d9215559a941c..914096c5b1ae1eae09e4fde0b0c859f3dbdf3ae6 100644 (file)
@@ -612,11 +612,8 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
        }
 
        /* ensure we never gain time by being placed backwards. */
-       cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime);
-#ifndef CONFIG_64BIT
-       smp_wmb();
-       cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;
-#endif
+       u64_u32_store(cfs_rq->min_vruntime,
+                     max_vruntime(cfs_rq->min_vruntime, vruntime));
 }
 
 static inline bool __entity_less(struct rb_node *a, const struct rb_node *b)
@@ -1055,6 +1052,33 @@ update_stats_curr_start(struct cfs_rq *cfs_rq, struct sched_entity *se)
  * Scheduling class queueing methods:
  */
 
+#ifdef CONFIG_NUMA
+#define NUMA_IMBALANCE_MIN 2
+
+static inline long
+adjust_numa_imbalance(int imbalance, int dst_running, int imb_numa_nr)
+{
+       /*
+        * Allow a NUMA imbalance if busy CPUs is less than the maximum
+        * threshold. Above this threshold, individual tasks may be contending
+        * for both memory bandwidth and any shared HT resources.  This is an
+        * approximation as the number of running tasks may not be related to
+        * the number of busy CPUs due to sched_setaffinity.
+        */
+       if (dst_running > imb_numa_nr)
+               return imbalance;
+
+       /*
+        * Allow a small imbalance based on a simple pair of communicating
+        * tasks that remain local when the destination is lightly loaded.
+        */
+       if (imbalance <= NUMA_IMBALANCE_MIN)
+               return 0;
+
+       return imbalance;
+}
+#endif /* CONFIG_NUMA */
+
 #ifdef CONFIG_NUMA_BALANCING
 /*
  * Approximate time to scan a full NUMA task in ms. The task scan period is
@@ -1548,8 +1572,6 @@ struct task_numa_env {
 
 static unsigned long cpu_load(struct rq *rq);
 static unsigned long cpu_runnable(struct rq *rq);
-static inline long adjust_numa_imbalance(int imbalance,
-                                       int dst_running, int imb_numa_nr);
 
 static inline enum
 numa_type numa_classify(unsigned int imbalance_pct,
@@ -1790,6 +1812,15 @@ static bool task_numa_compare(struct task_numa_env *env,
         */
        cur_ng = rcu_dereference(cur->numa_group);
        if (cur_ng == p_ng) {
+               /*
+                * Do not swap within a group or between tasks that have
+                * no group if there is spare capacity. Swapping does
+                * not address the load imbalance and helps one task at
+                * the cost of punishing another.
+                */
+               if (env->dst_stats.node_type == node_has_spare)
+                       goto unlock;
+
                imp = taskimp + task_weight(cur, env->src_nid, dist) -
                      task_weight(cur, env->dst_nid, dist);
                /*
@@ -2885,6 +2916,7 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
        p->node_stamp                   = 0;
        p->numa_scan_seq                = mm ? mm->numa_scan_seq : 0;
        p->numa_scan_period             = sysctl_numa_balancing_scan_delay;
+       p->numa_migrate_retry           = 0;
        /* Protect against double add, see task_tick_numa and task_numa_work */
        p->numa_work.next               = &p->numa_work;
        p->numa_faults                  = NULL;
@@ -3144,6 +3176,8 @@ void reweight_task(struct task_struct *p, int prio)
        load->inv_weight = sched_prio_to_wmult[prio];
 }
 
+static inline int throttled_hierarchy(struct cfs_rq *cfs_rq);
+
 #ifdef CONFIG_FAIR_GROUP_SCHED
 #ifdef CONFIG_SMP
 /*
@@ -3254,8 +3288,6 @@ static long calc_group_shares(struct cfs_rq *cfs_rq)
 }
 #endif /* CONFIG_SMP */
 
-static inline int throttled_hierarchy(struct cfs_rq *cfs_rq);
-
 /*
  * Recomputes the group entity based on the current state of its group
  * runqueue.
@@ -3313,6 +3345,34 @@ static inline void cfs_rq_util_change(struct cfs_rq *cfs_rq, int flags)
 }
 
 #ifdef CONFIG_SMP
+static inline bool load_avg_is_decayed(struct sched_avg *sa)
+{
+       if (sa->load_sum)
+               return false;
+
+       if (sa->util_sum)
+               return false;
+
+       if (sa->runnable_sum)
+               return false;
+
+       /*
+        * _avg must be null when _sum are null because _avg = _sum / divider
+        * Make sure that rounding and/or propagation of PELT values never
+        * break this.
+        */
+       SCHED_WARN_ON(sa->load_avg ||
+                     sa->util_avg ||
+                     sa->runnable_avg);
+
+       return true;
+}
+
+static inline u64 cfs_rq_last_update_time(struct cfs_rq *cfs_rq)
+{
+       return u64_u32_load_copy(cfs_rq->avg.last_update_time,
+                                cfs_rq->last_update_time_copy);
+}
 #ifdef CONFIG_FAIR_GROUP_SCHED
 /*
  * Because list_add_leaf_cfs_rq always places a child cfs_rq on the list
@@ -3345,27 +3405,12 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq)
        if (cfs_rq->load.weight)
                return false;
 
-       if (cfs_rq->avg.load_sum)
-               return false;
-
-       if (cfs_rq->avg.util_sum)
-               return false;
-
-       if (cfs_rq->avg.runnable_sum)
+       if (!load_avg_is_decayed(&cfs_rq->avg))
                return false;
 
        if (child_cfs_rq_on_list(cfs_rq))
                return false;
 
-       /*
-        * _avg must be null when _sum are null because _avg = _sum / divider
-        * Make sure that rounding and/or propagation of PELT values never
-        * break this.
-        */
-       SCHED_WARN_ON(cfs_rq->avg.load_avg ||
-                     cfs_rq->avg.util_avg ||
-                     cfs_rq->avg.runnable_avg);
-
        return true;
 }
 
@@ -3423,27 +3468,9 @@ void set_task_rq_fair(struct sched_entity *se,
        if (!(se->avg.last_update_time && prev))
                return;
 
-#ifndef CONFIG_64BIT
-       {
-               u64 p_last_update_time_copy;
-               u64 n_last_update_time_copy;
-
-               do {
-                       p_last_update_time_copy = prev->load_last_update_time_copy;
-                       n_last_update_time_copy = next->load_last_update_time_copy;
-
-                       smp_rmb();
-
-                       p_last_update_time = prev->avg.last_update_time;
-                       n_last_update_time = next->avg.last_update_time;
+       p_last_update_time = cfs_rq_last_update_time(prev);
+       n_last_update_time = cfs_rq_last_update_time(next);
 
-               } while (p_last_update_time != p_last_update_time_copy ||
-                        n_last_update_time != n_last_update_time_copy);
-       }
-#else
-       p_last_update_time = prev->avg.last_update_time;
-       n_last_update_time = next->avg.last_update_time;
-#endif
        __update_load_avg_blocked_se(p_last_update_time, se);
        se->avg.last_update_time = n_last_update_time;
 }
@@ -3722,6 +3749,89 @@ static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum
 
 #endif /* CONFIG_FAIR_GROUP_SCHED */
 
+#ifdef CONFIG_NO_HZ_COMMON
+static inline void migrate_se_pelt_lag(struct sched_entity *se)
+{
+       u64 throttled = 0, now, lut;
+       struct cfs_rq *cfs_rq;
+       struct rq *rq;
+       bool is_idle;
+
+       if (load_avg_is_decayed(&se->avg))
+               return;
+
+       cfs_rq = cfs_rq_of(se);
+       rq = rq_of(cfs_rq);
+
+       rcu_read_lock();
+       is_idle = is_idle_task(rcu_dereference(rq->curr));
+       rcu_read_unlock();
+
+       /*
+        * The lag estimation comes with a cost we don't want to pay all the
+        * time. Hence, limiting to the case where the source CPU is idle and
+        * we know we are at the greatest risk to have an outdated clock.
+        */
+       if (!is_idle)
+               return;
+
+       /*
+        * Estimated "now" is: last_update_time + cfs_idle_lag + rq_idle_lag, where:
+        *
+        *   last_update_time (the cfs_rq's last_update_time)
+        *      = cfs_rq_clock_pelt()@cfs_rq_idle
+        *      = rq_clock_pelt()@cfs_rq_idle
+        *        - cfs->throttled_clock_pelt_time@cfs_rq_idle
+        *
+        *   cfs_idle_lag (delta between rq's update and cfs_rq's update)
+        *      = rq_clock_pelt()@rq_idle - rq_clock_pelt()@cfs_rq_idle
+        *
+        *   rq_idle_lag (delta between now and rq's update)
+        *      = sched_clock_cpu() - rq_clock()@rq_idle
+        *
+        * We can then write:
+        *
+        *    now = rq_clock_pelt()@rq_idle - cfs->throttled_clock_pelt_time +
+        *          sched_clock_cpu() - rq_clock()@rq_idle
+        * Where:
+        *      rq_clock_pelt()@rq_idle is rq->clock_pelt_idle
+        *      rq_clock()@rq_idle      is rq->clock_idle
+        *      cfs->throttled_clock_pelt_time@cfs_rq_idle
+        *                              is cfs_rq->throttled_pelt_idle
+        */
+
+#ifdef CONFIG_CFS_BANDWIDTH
+       throttled = u64_u32_load(cfs_rq->throttled_pelt_idle);
+       /* The clock has been stopped for throttling */
+       if (throttled == U64_MAX)
+               return;
+#endif
+       now = u64_u32_load(rq->clock_pelt_idle);
+       /*
+        * Paired with _update_idle_rq_clock_pelt(). It ensures at the worst case
+        * is observed the old clock_pelt_idle value and the new clock_idle,
+        * which lead to an underestimation. The opposite would lead to an
+        * overestimation.
+        */
+       smp_rmb();
+       lut = cfs_rq_last_update_time(cfs_rq);
+
+       now -= throttled;
+       if (now < lut)
+               /*
+                * cfs_rq->avg.last_update_time is more recent than our
+                * estimation, let's use it.
+                */
+               now = lut;
+       else
+               now += sched_clock_cpu(cpu_of(rq)) - u64_u32_load(rq->clock_idle);
+
+       __update_load_avg_blocked_se(now, se);
+}
+#else
+static void migrate_se_pelt_lag(struct sched_entity *se) {}
+#endif
+
 /**
  * update_cfs_rq_load_avg - update the cfs_rq's load/util averages
  * @now: current time, as per cfs_rq_clock_pelt()
@@ -3796,12 +3906,9 @@ update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
        }
 
        decayed |= __update_load_avg_cfs_rq(now, cfs_rq);
-
-#ifndef CONFIG_64BIT
-       smp_wmb();
-       cfs_rq->load_last_update_time_copy = sa->last_update_time;
-#endif
-
+       u64_u32_store_copy(sa->last_update_time,
+                          cfs_rq->last_update_time_copy,
+                          sa->last_update_time);
        return decayed;
 }
 
@@ -3933,27 +4040,6 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
        }
 }
 
-#ifndef CONFIG_64BIT
-static inline u64 cfs_rq_last_update_time(struct cfs_rq *cfs_rq)
-{
-       u64 last_update_time_copy;
-       u64 last_update_time;
-
-       do {
-               last_update_time_copy = cfs_rq->load_last_update_time_copy;
-               smp_rmb();
-               last_update_time = cfs_rq->avg.last_update_time;
-       } while (last_update_time != last_update_time_copy);
-
-       return last_update_time;
-}
-#else
-static inline u64 cfs_rq_last_update_time(struct cfs_rq *cfs_rq)
-{
-       return cfs_rq->avg.last_update_time;
-}
-#endif
-
 /*
  * Synchronize entity load avg of dequeued entity without locking
  * the previous rq.
@@ -4368,16 +4454,11 @@ enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
                __enqueue_entity(cfs_rq, se);
        se->on_rq = 1;
 
-       /*
-        * When bandwidth control is enabled, cfs might have been removed
-        * because of a parent been throttled but cfs->nr_running > 1. Try to
-        * add it unconditionally.
-        */
-       if (cfs_rq->nr_running == 1 || cfs_bandwidth_used())
-               list_add_leaf_cfs_rq(cfs_rq);
-
-       if (cfs_rq->nr_running == 1)
+       if (cfs_rq->nr_running == 1) {
                check_enqueue_throttle(cfs_rq);
+               if (!throttled_hierarchy(cfs_rq))
+                       list_add_leaf_cfs_rq(cfs_rq);
+       }
 }
 
 static void __clear_buddies_last(struct sched_entity *se)
@@ -4477,6 +4558,9 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
         */
        if ((flags & (DEQUEUE_SAVE | DEQUEUE_MOVE)) != DEQUEUE_SAVE)
                update_min_vruntime(cfs_rq);
+
+       if (cfs_rq->nr_running == 0)
+               update_idle_cfs_rq_clock_pelt(cfs_rq);
 }
 
 /*
@@ -4992,11 +5076,18 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
        /* update hierarchical throttle state */
        walk_tg_tree_from(cfs_rq->tg, tg_nop, tg_unthrottle_up, (void *)rq);
 
-       /* Nothing to run but something to decay (on_list)? Complete the branch */
        if (!cfs_rq->load.weight) {
-               if (cfs_rq->on_list)
-                       goto unthrottle_throttle;
-               return;
+               if (!cfs_rq->on_list)
+                       return;
+               /*
+                * Nothing to run but something to decay (on_list)?
+                * Complete the branch.
+                */
+               for_each_sched_entity(se) {
+                       if (list_add_leaf_cfs_rq(cfs_rq_of(se)))
+                               break;
+               }
+               goto unthrottle_throttle;
        }
 
        task_delta = cfs_rq->h_nr_running;
@@ -5034,31 +5125,12 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)
                /* end evaluation on encountering a throttled cfs_rq */
                if (cfs_rq_throttled(qcfs_rq))
                        goto unthrottle_throttle;
-
-               /*
-                * One parent has been throttled and cfs_rq removed from the
-                * list. Add it back to not break the leaf list.
-                */
-               if (throttled_hierarchy(qcfs_rq))
-                       list_add_leaf_cfs_rq(qcfs_rq);
        }
 
        /* At this point se is NULL and we are at root level*/
        add_nr_running(rq, task_delta);
 
 unthrottle_throttle:
-       /*
-        * The cfs_rq_throttled() breaks in the above iteration can result in
-        * incomplete leaf list maintenance, resulting in triggering the
-        * assertion below.
-        */
-       for_each_sched_entity(se) {
-               struct cfs_rq *qcfs_rq = cfs_rq_of(se);
-
-               if (list_add_leaf_cfs_rq(qcfs_rq))
-                       break;
-       }
-
        assert_list_leaf_cfs_rq(rq);
 
        /* Determine whether we need to wake up potentially idle CPU: */
@@ -5713,13 +5785,6 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
                /* end evaluation on encountering a throttled cfs_rq */
                if (cfs_rq_throttled(cfs_rq))
                        goto enqueue_throttle;
-
-               /*
-                * One parent has been throttled and cfs_rq removed from the
-                * list. Add it back to not break the leaf list.
-                */
-               if (throttled_hierarchy(cfs_rq))
-                       list_add_leaf_cfs_rq(cfs_rq);
        }
 
        /* At this point se is NULL and we are at root level*/
@@ -5743,21 +5808,6 @@ enqueue_task_fair(struct rq *rq, struct task_struct *p, int flags)
                update_overutilized_status(rq);
 
 enqueue_throttle:
-       if (cfs_bandwidth_used()) {
-               /*
-                * When bandwidth control is enabled; the cfs_rq_throttled()
-                * breaks in the above iteration can result in incomplete
-                * leaf list maintenance, resulting in triggering the assertion
-                * below.
-                */
-               for_each_sched_entity(se) {
-                       cfs_rq = cfs_rq_of(se);
-
-                       if (list_add_leaf_cfs_rq(cfs_rq))
-                               break;
-               }
-       }
-
        assert_list_leaf_cfs_rq(rq);
 
        hrtick_update(rq);
@@ -5844,7 +5894,7 @@ dequeue_throttle:
 
 /* Working cpumask for: load_balance, load_balance_newidle. */
 DEFINE_PER_CPU(cpumask_var_t, load_balance_mask);
-DEFINE_PER_CPU(cpumask_var_t, select_idle_mask);
+DEFINE_PER_CPU(cpumask_var_t, select_rq_mask);
 
 #ifdef CONFIG_NO_HZ_COMMON
 
@@ -6334,8 +6384,9 @@ static inline int select_idle_smt(struct task_struct *p, struct sched_domain *sd
  */
 static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool has_idle_core, int target)
 {
-       struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
+       struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_rq_mask);
        int i, cpu, idle_cpu = -1, nr = INT_MAX;
+       struct sched_domain_shared *sd_share;
        struct rq *this_rq = this_rq();
        int this = smp_processor_id();
        struct sched_domain *this_sd;
@@ -6375,6 +6426,17 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool
                time = cpu_clock(this);
        }
 
+       if (sched_feat(SIS_UTIL)) {
+               sd_share = rcu_dereference(per_cpu(sd_llc_shared, target));
+               if (sd_share) {
+                       /* because !--nr is the condition to stop scan */
+                       nr = READ_ONCE(sd_share->nr_idle_scan) + 1;
+                       /* overloaded LLC is unlikely to have idle cpu/core */
+                       if (nr == 1)
+                               return -1;
+               }
+       }
+
        for_each_cpu_wrap(cpu, cpus, target + 1) {
                if (has_idle_core) {
                        i = select_idle_core(p, cpu, cpus, &idle_cpu);
@@ -6420,7 +6482,7 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
        int cpu, best_cpu = -1;
        struct cpumask *cpus;
 
-       cpus = this_cpu_cpumask_var_ptr(select_idle_mask);
+       cpus = this_cpu_cpumask_var_ptr(select_rq_mask);
        cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr);
 
        task_util = uclamp_task_util(p);
@@ -6470,7 +6532,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
        }
 
        /*
-        * per-cpu select_idle_mask usage
+        * per-cpu select_rq_mask usage
         */
        lockdep_assert_irqs_disabled();
 
@@ -6640,62 +6702,96 @@ static unsigned long cpu_util_without(int cpu, struct task_struct *p)
 }
 
 /*
- * compute_energy(): Estimates the energy that @pd would consume if @p was
- * migrated to @dst_cpu. compute_energy() predicts what will be the utilization
- * landscape of @pd's CPUs after the task migration, and uses the Energy Model
- * to compute what would be the energy if we decided to actually migrate that
- * task.
+ * energy_env - Utilization landscape for energy estimation.
+ * @task_busy_time: Utilization contribution by the task for which we test the
+ *                  placement. Given by eenv_task_busy_time().
+ * @pd_busy_time:   Utilization of the whole perf domain without the task
+ *                  contribution. Given by eenv_pd_busy_time().
+ * @cpu_cap:        Maximum CPU capacity for the perf domain.
+ * @pd_cap:         Entire perf domain capacity. (pd->nr_cpus * cpu_cap).
+ */
+struct energy_env {
+       unsigned long task_busy_time;
+       unsigned long pd_busy_time;
+       unsigned long cpu_cap;
+       unsigned long pd_cap;
+};
+
+/*
+ * Compute the task busy time for compute_energy(). This time cannot be
+ * injected directly into effective_cpu_util() because of the IRQ scaling.
+ * The latter only makes sense with the most recent CPUs where the task has
+ * run.
+ */
+static inline void eenv_task_busy_time(struct energy_env *eenv,
+                                      struct task_struct *p, int prev_cpu)
+{
+       unsigned long busy_time, max_cap = arch_scale_cpu_capacity(prev_cpu);
+       unsigned long irq = cpu_util_irq(cpu_rq(prev_cpu));
+
+       if (unlikely(irq >= max_cap))
+               busy_time = max_cap;
+       else
+               busy_time = scale_irq_capacity(task_util_est(p), irq, max_cap);
+
+       eenv->task_busy_time = busy_time;
+}
+
+/*
+ * Compute the perf_domain (PD) busy time for compute_energy(). Based on the
+ * utilization for each @pd_cpus, it however doesn't take into account
+ * clamping since the ratio (utilization / cpu_capacity) is already enough to
+ * scale the EM reported power consumption at the (eventually clamped)
+ * cpu_capacity.
+ *
+ * The contribution of the task @p for which we want to estimate the
+ * energy cost is removed (by cpu_util_next()) and must be calculated
+ * separately (see eenv_task_busy_time). This ensures:
+ *
+ *   - A stable PD utilization, no matter which CPU of that PD we want to place
+ *     the task on.
+ *
+ *   - A fair comparison between CPUs as the task contribution (task_util())
+ *     will always be the same no matter which CPU utilization we rely on
+ *     (util_avg or util_est).
+ *
+ * Set @eenv busy time for the PD that spans @pd_cpus. This busy time can't
+ * exceed @eenv->pd_cap.
  */
-static long
-compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd)
+static inline void eenv_pd_busy_time(struct energy_env *eenv,
+                                    struct cpumask *pd_cpus,
+                                    struct task_struct *p)
 {
-       struct cpumask *pd_mask = perf_domain_span(pd);
-       unsigned long cpu_cap = arch_scale_cpu_capacity(cpumask_first(pd_mask));
-       unsigned long max_util = 0, sum_util = 0;
-       unsigned long _cpu_cap = cpu_cap;
+       unsigned long busy_time = 0;
        int cpu;
 
-       _cpu_cap -= arch_scale_thermal_pressure(cpumask_first(pd_mask));
+       for_each_cpu(cpu, pd_cpus) {
+               unsigned long util = cpu_util_next(cpu, p, -1);
 
-       /*
-        * The capacity state of CPUs of the current rd can be driven by CPUs
-        * of another rd if they belong to the same pd. So, account for the
-        * utilization of these CPUs too by masking pd with cpu_online_mask
-        * instead of the rd span.
-        *
-        * If an entire pd is outside of the current rd, it will not appear in
-        * its pd list and will not be accounted by compute_energy().
-        */
-       for_each_cpu_and(cpu, pd_mask, cpu_online_mask) {
-               unsigned long util_freq = cpu_util_next(cpu, p, dst_cpu);
-               unsigned long cpu_util, util_running = util_freq;
-               struct task_struct *tsk = NULL;
+               busy_time += effective_cpu_util(cpu, util, ENERGY_UTIL, NULL);
+       }
 
-               /*
-                * When @p is placed on @cpu:
-                *
-                * util_running = max(cpu_util, cpu_util_est) +
-                *                max(task_util, _task_util_est)
-                *
-                * while cpu_util_next is: max(cpu_util + task_util,
-                *                             cpu_util_est + _task_util_est)
-                */
-               if (cpu == dst_cpu) {
-                       tsk = p;
-                       util_running =
-                               cpu_util_next(cpu, p, -1) + task_util_est(p);
-               }
+       eenv->pd_busy_time = min(eenv->pd_cap, busy_time);
+}
 
-               /*
-                * Busy time computation: utilization clamping is not
-                * required since the ratio (sum_util / cpu_capacity)
-                * is already enough to scale the EM reported power
-                * consumption at the (eventually clamped) cpu_capacity.
-                */
-               cpu_util = effective_cpu_util(cpu, util_running, cpu_cap,
-                                             ENERGY_UTIL, NULL);
+/*
+ * Compute the maximum utilization for compute_energy() when the task @p
+ * is placed on the cpu @dst_cpu.
+ *
+ * Returns the maximum utilization among @eenv->cpus. This utilization can't
+ * exceed @eenv->cpu_cap.
+ */
+static inline unsigned long
+eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
+                struct task_struct *p, int dst_cpu)
+{
+       unsigned long max_util = 0;
+       int cpu;
 
-               sum_util += min(cpu_util, _cpu_cap);
+       for_each_cpu(cpu, pd_cpus) {
+               struct task_struct *tsk = (cpu == dst_cpu) ? p : NULL;
+               unsigned long util = cpu_util_next(cpu, p, dst_cpu);
+               unsigned long cpu_util;
 
                /*
                 * Performance domain frequency: utilization clamping
@@ -6704,12 +6800,29 @@ compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd)
                 * NOTE: in case RT tasks are running, by default the
                 * FREQUENCY_UTIL's utilization can be max OPP.
                 */
-               cpu_util = effective_cpu_util(cpu, util_freq, cpu_cap,
-                                             FREQUENCY_UTIL, tsk);
-               max_util = max(max_util, min(cpu_util, _cpu_cap));
+               cpu_util = effective_cpu_util(cpu, util, FREQUENCY_UTIL, tsk);
+               max_util = max(max_util, cpu_util);
        }
 
-       return em_cpu_energy(pd->em_pd, max_util, sum_util, _cpu_cap);
+       return min(max_util, eenv->cpu_cap);
+}
+
+/*
+ * compute_energy(): Use the Energy Model to estimate the energy that @pd would
+ * consume for a given utilization landscape @eenv. When @dst_cpu < 0, the task
+ * contribution is ignored.
+ */
+static inline unsigned long
+compute_energy(struct energy_env *eenv, struct perf_domain *pd,
+              struct cpumask *pd_cpus, struct task_struct *p, int dst_cpu)
+{
+       unsigned long max_util = eenv_pd_max_util(eenv, pd_cpus, p, dst_cpu);
+       unsigned long busy_time = eenv->pd_busy_time;
+
+       if (dst_cpu >= 0)
+               busy_time = min(eenv->pd_cap, busy_time + eenv->task_busy_time);
+
+       return em_cpu_energy(pd->em_pd, max_util, busy_time, eenv->cpu_cap);
 }
 
 /*
@@ -6753,12 +6866,13 @@ compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd)
  */
 static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
 {
+       struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_rq_mask);
        unsigned long prev_delta = ULONG_MAX, best_delta = ULONG_MAX;
-       struct root_domain *rd = cpu_rq(smp_processor_id())->rd;
-       int cpu, best_energy_cpu = prev_cpu, target = -1;
-       unsigned long cpu_cap, util, base_energy = 0;
+       struct root_domain *rd = this_rq()->rd;
+       int cpu, best_energy_cpu, target = -1;
        struct sched_domain *sd;
        struct perf_domain *pd;
+       struct energy_env eenv;
 
        rcu_read_lock();
        pd = rcu_dereference(rd->pd);
@@ -6781,20 +6895,39 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
        if (!task_util_est(p))
                goto unlock;
 
+       eenv_task_busy_time(&eenv, p, prev_cpu);
+
        for (; pd; pd = pd->next) {
-               unsigned long cur_delta, spare_cap, max_spare_cap = 0;
+               unsigned long cpu_cap, cpu_thermal_cap, util;
+               unsigned long cur_delta, max_spare_cap = 0;
                bool compute_prev_delta = false;
-               unsigned long base_energy_pd;
                int max_spare_cap_cpu = -1;
+               unsigned long base_energy;
+
+               cpumask_and(cpus, perf_domain_span(pd), cpu_online_mask);
+
+               if (cpumask_empty(cpus))
+                       continue;
+
+               /* Account thermal pressure for the energy estimation */
+               cpu = cpumask_first(cpus);
+               cpu_thermal_cap = arch_scale_cpu_capacity(cpu);
+               cpu_thermal_cap -= arch_scale_thermal_pressure(cpu);
+
+               eenv.cpu_cap = cpu_thermal_cap;
+               eenv.pd_cap = 0;
+
+               for_each_cpu(cpu, cpus) {
+                       eenv.pd_cap += cpu_thermal_cap;
+
+                       if (!cpumask_test_cpu(cpu, sched_domain_span(sd)))
+                               continue;
 
-               for_each_cpu_and(cpu, perf_domain_span(pd), sched_domain_span(sd)) {
                        if (!cpumask_test_cpu(cpu, p->cpus_ptr))
                                continue;
 
                        util = cpu_util_next(cpu, p, cpu);
                        cpu_cap = capacity_of(cpu);
-                       spare_cap = cpu_cap;
-                       lsub_positive(&spare_cap, util);
 
                        /*
                         * Skip CPUs that cannot satisfy the capacity request.
@@ -6807,15 +6940,17 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
                        if (!fits_capacity(util, cpu_cap))
                                continue;
 
+                       lsub_positive(&cpu_cap, util);
+
                        if (cpu == prev_cpu) {
                                /* Always use prev_cpu as a candidate. */
                                compute_prev_delta = true;
-                       } else if (spare_cap > max_spare_cap) {
+                       } else if (cpu_cap > max_spare_cap) {
                                /*
                                 * Find the CPU with the maximum spare capacity
                                 * in the performance domain.
                                 */
-                               max_spare_cap = spare_cap;
+                               max_spare_cap = cpu_cap;
                                max_spare_cap_cpu = cpu;
                        }
                }
@@ -6823,25 +6958,29 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
                if (max_spare_cap_cpu < 0 && !compute_prev_delta)
                        continue;
 
+               eenv_pd_busy_time(&eenv, cpus, p);
                /* Compute the 'base' energy of the pd, without @p */
-               base_energy_pd = compute_energy(p, -1, pd);
-               base_energy += base_energy_pd;
+               base_energy = compute_energy(&eenv, pd, cpus, p, -1);
 
                /* Evaluate the energy impact of using prev_cpu. */
                if (compute_prev_delta) {
-                       prev_delta = compute_energy(p, prev_cpu, pd);
-                       if (prev_delta < base_energy_pd)
+                       prev_delta = compute_energy(&eenv, pd, cpus, p,
+                                                   prev_cpu);
+                       /* CPU utilization has changed */
+                       if (prev_delta < base_energy)
                                goto unlock;
-                       prev_delta -= base_energy_pd;
+                       prev_delta -= base_energy;
                        best_delta = min(best_delta, prev_delta);
                }
 
                /* Evaluate the energy impact of using max_spare_cap_cpu. */
                if (max_spare_cap_cpu >= 0) {
-                       cur_delta = compute_energy(p, max_spare_cap_cpu, pd);
-                       if (cur_delta < base_energy_pd)
+                       cur_delta = compute_energy(&eenv, pd, cpus, p,
+                                                  max_spare_cap_cpu);
+                       /* CPU utilization has changed */
+                       if (cur_delta < base_energy)
                                goto unlock;
-                       cur_delta -= base_energy_pd;
+                       cur_delta -= base_energy;
                        if (cur_delta < best_delta) {
                                best_delta = cur_delta;
                                best_energy_cpu = max_spare_cap_cpu;
@@ -6850,12 +6989,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
        }
        rcu_read_unlock();
 
-       /*
-        * Pick the best CPU if prev_cpu cannot be used, or if it saves at
-        * least 6% of the energy used by prev_cpu.
-        */
-       if ((prev_delta == ULONG_MAX) ||
-           (prev_delta - best_delta) > ((prev_delta + base_energy) >> 4))
+       if (best_delta < prev_delta)
                target = best_energy_cpu;
 
        return target;
@@ -6951,6 +7085,8 @@ static void detach_entity_cfs_rq(struct sched_entity *se);
  */
 static void migrate_task_rq_fair(struct task_struct *p, int new_cpu)
 {
+       struct sched_entity *se = &p->se;
+
        /*
         * As blocked tasks retain absolute vruntime the migration needs to
         * deal with this by subtracting the old and adding the new
@@ -6958,23 +7094,9 @@ static void migrate_task_rq_fair(struct task_struct *p, int new_cpu)
         * the task on the new runqueue.
         */
        if (READ_ONCE(p->__state) == TASK_WAKING) {
-               struct sched_entity *se = &p->se;
                struct cfs_rq *cfs_rq = cfs_rq_of(se);
-               u64 min_vruntime;
-
-#ifndef CONFIG_64BIT
-               u64 min_vruntime_copy;
-
-               do {
-                       min_vruntime_copy = cfs_rq->min_vruntime_copy;
-                       smp_rmb();
-                       min_vruntime = cfs_rq->min_vruntime;
-               } while (min_vruntime != min_vruntime_copy);
-#else
-               min_vruntime = cfs_rq->min_vruntime;
-#endif
 
-               se->vruntime -= min_vruntime;
+               se->vruntime -= u64_u32_load(cfs_rq->min_vruntime);
        }
 
        if (p->on_rq == TASK_ON_RQ_MIGRATING) {
@@ -6983,25 +7105,29 @@ static void migrate_task_rq_fair(struct task_struct *p, int new_cpu)
                 * rq->lock and can modify state directly.
                 */
                lockdep_assert_rq_held(task_rq(p));
-               detach_entity_cfs_rq(&p->se);
+               detach_entity_cfs_rq(se);
 
        } else {
+               remove_entity_load_avg(se);
+
                /*
-                * We are supposed to update the task to "current" time, then
-                * its up to date and ready to go to new CPU/cfs_rq. But we
-                * have difficulty in getting what current time is, so simply
-                * throw away the out-of-date time. This will result in the
-                * wakee task is less decayed, but giving the wakee more load
-                * sounds not bad.
+                * Here, the task's PELT values have been updated according to
+                * the current rq's clock. But if that clock hasn't been
+                * updated in a while, a substantial idle time will be missed,
+                * leading to an inflation after wake-up on the new rq.
+                *
+                * Estimate the missing time from the cfs_rq last_update_time
+                * and update sched_avg to improve the PELT continuity after
+                * migration.
                 */
-               remove_entity_load_avg(&p->se);
+               migrate_se_pelt_lag(se);
        }
 
        /* Tell new CPU we are migrated */
-       p->se.avg.last_update_time = 0;
+       se->avg.last_update_time = 0;
 
        /* We have migrated, no longer consider this task hot */
-       p->se.exec_start = 0;
+       se->exec_start = 0;
 
        update_scan_period(p, new_cpu);
 }
@@ -7585,8 +7711,8 @@ enum group_type {
         */
        group_fully_busy,
        /*
-        * SD_ASYM_CPUCAPACITY only: One task doesn't fit with CPU's capacity
-        * and must be migrated to a more powerful CPU.
+        * One task doesn't fit with CPU's capacity and must be migrated to a
+        * more powerful CPU.
         */
        group_misfit_task,
        /*
@@ -8167,6 +8293,9 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
                if (update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq)) {
                        update_tg_load_avg(cfs_rq);
 
+                       if (cfs_rq->nr_running == 0)
+                               update_idle_cfs_rq_clock_pelt(cfs_rq);
+
                        if (cfs_rq == &rq->cfs)
                                decayed = true;
                }
@@ -8500,7 +8629,7 @@ static inline int sg_imbalanced(struct sched_group *group)
 /*
  * group_has_capacity returns true if the group has spare capacity that could
  * be used by some tasks.
- * We consider that a group has spare capacity if the  * number of task is
+ * We consider that a group has spare capacity if the number of task is
  * smaller than the number of CPUs or if the utilization is lower than the
  * available capacity for CFS tasks.
  * For the latter, we use a threshold to stabilize the state, to take into
@@ -8669,6 +8798,19 @@ sched_asym(struct lb_env *env, struct sd_lb_stats *sds,  struct sg_lb_stats *sgs
        return sched_asym_prefer(env->dst_cpu, group->asym_prefer_cpu);
 }
 
+static inline bool
+sched_reduced_capacity(struct rq *rq, struct sched_domain *sd)
+{
+       /*
+        * When there is more than 1 task, the group_overloaded case already
+        * takes care of cpu with reduced capacity
+        */
+       if (rq->cfs.h_nr_running != 1)
+               return false;
+
+       return check_cpu_capacity(rq, sd);
+}
+
 /**
  * update_sg_lb_stats - Update sched_group's statistics for load balancing.
  * @env: The load balancing environment.
@@ -8691,8 +8833,9 @@ static inline void update_sg_lb_stats(struct lb_env *env,
 
        for_each_cpu_and(i, sched_group_span(group), env->cpus) {
                struct rq *rq = cpu_rq(i);
+               unsigned long load = cpu_load(rq);
 
-               sgs->group_load += cpu_load(rq);
+               sgs->group_load += load;
                sgs->group_util += cpu_util_cfs(i);
                sgs->group_runnable += cpu_runnable(rq);
                sgs->sum_h_nr_running += rq->cfs.h_nr_running;
@@ -8722,11 +8865,17 @@ static inline void update_sg_lb_stats(struct lb_env *env,
                if (local_group)
                        continue;
 
-               /* Check for a misfit task on the cpu */
-               if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
-                   sgs->group_misfit_task_load < rq->misfit_task_load) {
-                       sgs->group_misfit_task_load = rq->misfit_task_load;
-                       *sg_status |= SG_OVERLOAD;
+               if (env->sd->flags & SD_ASYM_CPUCAPACITY) {
+                       /* Check for a misfit task on the cpu */
+                       if (sgs->group_misfit_task_load < rq->misfit_task_load) {
+                               sgs->group_misfit_task_load = rq->misfit_task_load;
+                               *sg_status |= SG_OVERLOAD;
+                       }
+               } else if ((env->idle != CPU_NOT_IDLE) &&
+                          sched_reduced_capacity(rq, env->sd)) {
+                       /* Check for a task running on a CPU with reduced capacity */
+                       if (sgs->group_misfit_task_load < load)
+                               sgs->group_misfit_task_load = load;
                }
        }
 
@@ -8779,7 +8928,8 @@ static bool update_sd_pick_busiest(struct lb_env *env,
         * CPUs in the group should either be possible to resolve
         * internally or be covered by avg_load imbalance (eventually).
         */
-       if (sgs->group_type == group_misfit_task &&
+       if ((env->sd->flags & SD_ASYM_CPUCAPACITY) &&
+           (sgs->group_type == group_misfit_task) &&
            (!capacity_greater(capacity_of(env->dst_cpu), sg->sgc->max_capacity) ||
             sds->local_stat.group_type != group_has_spare))
                return false;
@@ -9057,16 +9207,6 @@ static bool update_pick_idlest(struct sched_group *idlest,
        return true;
 }
 
-/*
- * Allow a NUMA imbalance if busy CPUs is less than 25% of the domain.
- * This is an approximation as the number of running tasks may not be
- * related to the number of busy CPUs due to sched_setaffinity.
- */
-static inline bool allow_numa_imbalance(int running, int imb_numa_nr)
-{
-       return running <= imb_numa_nr;
-}
-
 /*
  * find_idlest_group() finds and returns the least busy CPU group within the
  * domain.
@@ -9183,7 +9323,9 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu)
                break;
 
        case group_has_spare:
+#ifdef CONFIG_NUMA
                if (sd->flags & SD_NUMA) {
+                       int imb_numa_nr = sd->imb_numa_nr;
 #ifdef CONFIG_NUMA_BALANCING
                        int idlest_cpu;
                        /*
@@ -9196,17 +9338,31 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu)
                        idlest_cpu = cpumask_first(sched_group_span(idlest));
                        if (cpu_to_node(idlest_cpu) == p->numa_preferred_nid)
                                return idlest;
-#endif
+#endif /* CONFIG_NUMA_BALANCING */
                        /*
                         * Otherwise, keep the task close to the wakeup source
                         * and improve locality if the number of running tasks
                         * would remain below threshold where an imbalance is
-                        * allowed. If there is a real need of migration,
-                        * periodic load balance will take care of it.
+                        * allowed while accounting for the possibility the
+                        * task is pinned to a subset of CPUs. If there is a
+                        * real need of migration, periodic load balance will
+                        * take care of it.
                         */
-                       if (allow_numa_imbalance(local_sgs.sum_nr_running + 1, sd->imb_numa_nr))
+                       if (p->nr_cpus_allowed != NR_CPUS) {
+                               struct cpumask *cpus = this_cpu_cpumask_var_ptr(select_rq_mask);
+
+                               cpumask_and(cpus, sched_group_span(local), p->cpus_ptr);
+                               imb_numa_nr = min(cpumask_weight(cpus), sd->imb_numa_nr);
+                       }
+
+                       imbalance = abs(local_sgs.idle_cpus - idlest_sgs.idle_cpus);
+                       if (!adjust_numa_imbalance(imbalance,
+                                                  local_sgs.sum_nr_running + 1,
+                                                  imb_numa_nr)) {
                                return NULL;
+                       }
                }
+#endif /* CONFIG_NUMA */
 
                /*
                 * Select group with highest number of idle CPUs. We could also
@@ -9222,6 +9378,77 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, int this_cpu)
        return idlest;
 }
 
+static void update_idle_cpu_scan(struct lb_env *env,
+                                unsigned long sum_util)
+{
+       struct sched_domain_shared *sd_share;
+       int llc_weight, pct;
+       u64 x, y, tmp;
+       /*
+        * Update the number of CPUs to scan in LLC domain, which could
+        * be used as a hint in select_idle_cpu(). The update of sd_share
+        * could be expensive because it is within a shared cache line.
+        * So the write of this hint only occurs during periodic load
+        * balancing, rather than CPU_NEWLY_IDLE, because the latter
+        * can fire way more frequently than the former.
+        */
+       if (!sched_feat(SIS_UTIL) || env->idle == CPU_NEWLY_IDLE)
+               return;
+
+       llc_weight = per_cpu(sd_llc_size, env->dst_cpu);
+       if (env->sd->span_weight != llc_weight)
+               return;
+
+       sd_share = rcu_dereference(per_cpu(sd_llc_shared, env->dst_cpu));
+       if (!sd_share)
+               return;
+
+       /*
+        * The number of CPUs to search drops as sum_util increases, when
+        * sum_util hits 85% or above, the scan stops.
+        * The reason to choose 85% as the threshold is because this is the
+        * imbalance_pct(117) when a LLC sched group is overloaded.
+        *
+        * let y = SCHED_CAPACITY_SCALE - p * x^2                       [1]
+        * and y'= y / SCHED_CAPACITY_SCALE
+        *
+        * x is the ratio of sum_util compared to the CPU capacity:
+        * x = sum_util / (llc_weight * SCHED_CAPACITY_SCALE)
+        * y' is the ratio of CPUs to be scanned in the LLC domain,
+        * and the number of CPUs to scan is calculated by:
+        *
+        * nr_scan = llc_weight * y'                                    [2]
+        *
+        * When x hits the threshold of overloaded, AKA, when
+        * x = 100 / pct, y drops to 0. According to [1],
+        * p should be SCHED_CAPACITY_SCALE * pct^2 / 10000
+        *
+        * Scale x by SCHED_CAPACITY_SCALE:
+        * x' = sum_util / llc_weight;                                  [3]
+        *
+        * and finally [1] becomes:
+        * y = SCHED_CAPACITY_SCALE -
+        *     x'^2 * pct^2 / (10000 * SCHED_CAPACITY_SCALE)            [4]
+        *
+        */
+       /* equation [3] */
+       x = sum_util;
+       do_div(x, llc_weight);
+
+       /* equation [4] */
+       pct = env->sd->imbalance_pct;
+       tmp = x * x * pct * pct;
+       do_div(tmp, 10000 * SCHED_CAPACITY_SCALE);
+       tmp = min_t(long, tmp, SCHED_CAPACITY_SCALE);
+       y = SCHED_CAPACITY_SCALE - tmp;
+
+       /* equation [2] */
+       y *= llc_weight;
+       do_div(y, SCHED_CAPACITY_SCALE);
+       if ((int)y != sd_share->nr_idle_scan)
+               WRITE_ONCE(sd_share->nr_idle_scan, (int)y);
+}
+
 /**
  * update_sd_lb_stats - Update sched_domain's statistics for load balancing.
  * @env: The load balancing environment.
@@ -9234,6 +9461,7 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
        struct sched_group *sg = env->sd->groups;
        struct sg_lb_stats *local = &sds->local_stat;
        struct sg_lb_stats tmp_sgs;
+       unsigned long sum_util = 0;
        int sg_status = 0;
 
        do {
@@ -9266,6 +9494,7 @@ next_group:
                sds->total_load += sgs->group_load;
                sds->total_capacity += sgs->group_capacity;
 
+               sum_util += sgs->group_util;
                sg = sg->next;
        } while (sg != env->sd->groups);
 
@@ -9291,24 +9520,8 @@ next_group:
                WRITE_ONCE(rd->overutilized, SG_OVERUTILIZED);
                trace_sched_overutilized_tp(rd, SG_OVERUTILIZED);
        }
-}
-
-#define NUMA_IMBALANCE_MIN 2
-
-static inline long adjust_numa_imbalance(int imbalance,
-                               int dst_running, int imb_numa_nr)
-{
-       if (!allow_numa_imbalance(dst_running, imb_numa_nr))
-               return imbalance;
 
-       /*
-        * Allow a small imbalance based on a simple pair of communicating
-        * tasks that remain local when the destination is lightly loaded.
-        */
-       if (imbalance <= NUMA_IMBALANCE_MIN)
-               return 0;
-
-       return imbalance;
+       update_idle_cpu_scan(env, sum_util);
 }
 
 /**
@@ -9325,9 +9538,18 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
        busiest = &sds->busiest_stat;
 
        if (busiest->group_type == group_misfit_task) {
-               /* Set imbalance to allow misfit tasks to be balanced. */
-               env->migration_type = migrate_misfit;
-               env->imbalance = 1;
+               if (env->sd->flags & SD_ASYM_CPUCAPACITY) {
+                       /* Set imbalance to allow misfit tasks to be balanced. */
+                       env->migration_type = migrate_misfit;
+                       env->imbalance = 1;
+               } else {
+                       /*
+                        * Set load imbalance to allow moving task from cpu
+                        * with reduced capacity.
+                        */
+                       env->migration_type = migrate_load;
+                       env->imbalance = busiest->group_misfit_task_load;
+               }
                return;
        }
 
@@ -9395,7 +9617,7 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
                         */
                        env->migration_type = migrate_task;
                        lsub_positive(&nr_diff, local->sum_nr_running);
-                       env->imbalance = nr_diff >> 1;
+                       env->imbalance = nr_diff;
                } else {
 
                        /*
@@ -9403,15 +9625,21 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
                         * idle cpus.
                         */
                        env->migration_type = migrate_task;
-                       env->imbalance = max_t(long, 0, (local->idle_cpus -
-                                                busiest->idle_cpus) >> 1);
+                       env->imbalance = max_t(long, 0,
+                                              (local->idle_cpus - busiest->idle_cpus));
                }
 
+#ifdef CONFIG_NUMA
                /* Consider allowing a small imbalance between NUMA groups */
                if (env->sd->flags & SD_NUMA) {
                        env->imbalance = adjust_numa_imbalance(env->imbalance,
-                               local->sum_nr_running + 1, env->sd->imb_numa_nr);
+                                                              local->sum_nr_running + 1,
+                                                              env->sd->imb_numa_nr);
                }
+#endif
+
+               /* Number of tasks to move to restore balance */
+               env->imbalance >>= 1;
 
                return;
        }
@@ -9834,9 +10062,15 @@ static int should_we_balance(struct lb_env *env)
        /*
         * In the newly idle case, we will allow all the CPUs
         * to do the newly idle load balance.
+        *
+        * However, we bail out if we already have tasks or a wakeup pending,
+        * to optimize wakeup latency.
         */
-       if (env->idle == CPU_NEWLY_IDLE)
+       if (env->idle == CPU_NEWLY_IDLE) {
+               if (env->dst_rq->nr_running > 0 || env->dst_rq->ttwu_pending)
+                       return 0;
                return 1;
+       }
 
        /* Try to find first idle CPU */
        for_each_cpu_and(cpu, group_balance_mask(sg), env->cpus) {
@@ -11287,9 +11521,13 @@ static inline bool vruntime_normalized(struct task_struct *p)
  */
 static void propagate_entity_cfs_rq(struct sched_entity *se)
 {
-       struct cfs_rq *cfs_rq;
+       struct cfs_rq *cfs_rq = cfs_rq_of(se);
 
-       list_add_leaf_cfs_rq(cfs_rq_of(se));
+       if (cfs_rq_throttled(cfs_rq))
+               return;
+
+       if (!throttled_hierarchy(cfs_rq))
+               list_add_leaf_cfs_rq(cfs_rq);
 
        /* Start to propagate at parent */
        se = se->parent;
@@ -11297,14 +11535,13 @@ static void propagate_entity_cfs_rq(struct sched_entity *se)
        for_each_sched_entity(se) {
                cfs_rq = cfs_rq_of(se);
 
-               if (!cfs_rq_throttled(cfs_rq)){
-                       update_load_avg(cfs_rq, se, UPDATE_TG);
-                       list_add_leaf_cfs_rq(cfs_rq);
-                       continue;
-               }
+               update_load_avg(cfs_rq, se, UPDATE_TG);
 
-               if (list_add_leaf_cfs_rq(cfs_rq))
+               if (cfs_rq_throttled(cfs_rq))
                        break;
+
+               if (!throttled_hierarchy(cfs_rq))
+                       list_add_leaf_cfs_rq(cfs_rq);
        }
 }
 #else
@@ -11422,10 +11659,7 @@ static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first)
 void init_cfs_rq(struct cfs_rq *cfs_rq)
 {
        cfs_rq->tasks_timeline = RB_ROOT_CACHED;
-       cfs_rq->min_vruntime = (u64)(-(1LL << 20));
-#ifndef CONFIG_64BIT
-       cfs_rq->min_vruntime_copy = cfs_rq->min_vruntime;
-#endif
+       u64_u32_store(cfs_rq->min_vruntime, (u64)(-(1LL << 20)));
 #ifdef CONFIG_SMP
        raw_spin_lock_init(&cfs_rq->removed.lock);
 #endif
index 1cf435bbcd9cad2ddcb417ee17fd7cd3d1bf21d9..ee7f23c76bd33692647627426ee30e503ccbf95a 100644 (file)
@@ -60,7 +60,8 @@ SCHED_FEAT(TTWU_QUEUE, true)
 /*
  * When doing wakeups, attempt to limit superfluous scans of the LLC domain.
  */
-SCHED_FEAT(SIS_PROP, true)
+SCHED_FEAT(SIS_PROP, false)
+SCHED_FEAT(SIS_UTIL, true)
 
 /*
  * Issue a WARN when we do multiple update_rq_clock() calls
index 4ff2ed4f8fa157fc20866581a7b388329ae51157..3a0e0dc28721960276b97a67eba0bc3ea7343ff5 100644 (file)
@@ -61,6 +61,25 @@ static inline void cfs_se_util_change(struct sched_avg *avg)
        WRITE_ONCE(avg->util_est.enqueued, enqueued);
 }
 
+static inline u64 rq_clock_pelt(struct rq *rq)
+{
+       lockdep_assert_rq_held(rq);
+       assert_clock_updated(rq);
+
+       return rq->clock_pelt - rq->lost_idle_time;
+}
+
+/* The rq is idle, we can sync to clock_task */
+static inline void _update_idle_rq_clock_pelt(struct rq *rq)
+{
+       rq->clock_pelt  = rq_clock_task(rq);
+
+       u64_u32_store(rq->clock_idle, rq_clock(rq));
+       /* Paired with smp_rmb in migrate_se_pelt_lag() */
+       smp_wmb();
+       u64_u32_store(rq->clock_pelt_idle, rq_clock_pelt(rq));
+}
+
 /*
  * The clock_pelt scales the time to reflect the effective amount of
  * computation done during the running delta time but then sync back to
@@ -76,8 +95,7 @@ static inline void cfs_se_util_change(struct sched_avg *avg)
 static inline void update_rq_clock_pelt(struct rq *rq, s64 delta)
 {
        if (unlikely(is_idle_task(rq->curr))) {
-               /* The rq is idle, we can sync to clock_task */
-               rq->clock_pelt  = rq_clock_task(rq);
+               _update_idle_rq_clock_pelt(rq);
                return;
        }
 
@@ -130,17 +148,23 @@ static inline void update_idle_rq_clock_pelt(struct rq *rq)
         */
        if (util_sum >= divider)
                rq->lost_idle_time += rq_clock_task(rq) - rq->clock_pelt;
+
+       _update_idle_rq_clock_pelt(rq);
 }
 
-static inline u64 rq_clock_pelt(struct rq *rq)
+#ifdef CONFIG_CFS_BANDWIDTH
+static inline void update_idle_cfs_rq_clock_pelt(struct cfs_rq *cfs_rq)
 {
-       lockdep_assert_rq_held(rq);
-       assert_clock_updated(rq);
+       u64 throttled;
 
-       return rq->clock_pelt - rq->lost_idle_time;
+       if (unlikely(cfs_rq->throttle_count))
+               throttled = U64_MAX;
+       else
+               throttled = cfs_rq->throttled_clock_pelt_time;
+
+       u64_u32_store(cfs_rq->throttled_pelt_idle, throttled);
 }
 
-#ifdef CONFIG_CFS_BANDWIDTH
 /* rq->task_clock normalized against any time this cfs_rq has spent throttled */
 static inline u64 cfs_rq_clock_pelt(struct cfs_rq *cfs_rq)
 {
@@ -150,6 +174,7 @@ static inline u64 cfs_rq_clock_pelt(struct cfs_rq *cfs_rq)
        return rq_clock_pelt(rq_of(cfs_rq)) - cfs_rq->throttled_clock_pelt_time;
 }
 #else
+static inline void update_idle_cfs_rq_clock_pelt(struct cfs_rq *cfs_rq) { }
 static inline u64 cfs_rq_clock_pelt(struct cfs_rq *cfs_rq)
 {
        return rq_clock_pelt(rq_of(cfs_rq));
@@ -204,6 +229,7 @@ update_rq_clock_pelt(struct rq *rq, s64 delta) { }
 static inline void
 update_idle_rq_clock_pelt(struct rq *rq) { }
 
+static inline void update_idle_cfs_rq_clock_pelt(struct cfs_rq *cfs_rq) { }
 #endif
 
 
index 8c9ed96648409011f3742ee17e2a9ef403476e0e..55f39c8f42032817f8be1c1304c0585903dfbd5b 100644 (file)
@@ -480,7 +480,7 @@ static inline void rt_queue_push_tasks(struct rq *rq)
 #endif /* CONFIG_SMP */
 
 static void enqueue_top_rt_rq(struct rt_rq *rt_rq);
-static void dequeue_top_rt_rq(struct rt_rq *rt_rq);
+static void dequeue_top_rt_rq(struct rt_rq *rt_rq, unsigned int count);
 
 static inline int on_rt_rq(struct sched_rt_entity *rt_se)
 {
@@ -601,7 +601,7 @@ static void sched_rt_rq_dequeue(struct rt_rq *rt_rq)
        rt_se = rt_rq->tg->rt_se[cpu];
 
        if (!rt_se) {
-               dequeue_top_rt_rq(rt_rq);
+               dequeue_top_rt_rq(rt_rq, rt_rq->rt_nr_running);
                /* Kick cpufreq (see the comment in kernel/sched/sched.h). */
                cpufreq_update_util(rq_of_rt_rq(rt_rq), 0);
        }
@@ -687,7 +687,7 @@ static inline void sched_rt_rq_enqueue(struct rt_rq *rt_rq)
 
 static inline void sched_rt_rq_dequeue(struct rt_rq *rt_rq)
 {
-       dequeue_top_rt_rq(rt_rq);
+       dequeue_top_rt_rq(rt_rq, rt_rq->rt_nr_running);
 }
 
 static inline int rt_rq_throttled(struct rt_rq *rt_rq)
@@ -1089,7 +1089,7 @@ static void update_curr_rt(struct rq *rq)
 }
 
 static void
-dequeue_top_rt_rq(struct rt_rq *rt_rq)
+dequeue_top_rt_rq(struct rt_rq *rt_rq, unsigned int count)
 {
        struct rq *rq = rq_of_rt_rq(rt_rq);
 
@@ -1100,7 +1100,7 @@ dequeue_top_rt_rq(struct rt_rq *rt_rq)
 
        BUG_ON(!rq->nr_running);
 
-       sub_nr_running(rq, rt_rq->rt_nr_running);
+       sub_nr_running(rq, count);
        rt_rq->rt_queued = 0;
 
 }
@@ -1486,18 +1486,21 @@ static void __dequeue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flag
 static void dequeue_rt_stack(struct sched_rt_entity *rt_se, unsigned int flags)
 {
        struct sched_rt_entity *back = NULL;
+       unsigned int rt_nr_running;
 
        for_each_sched_rt_entity(rt_se) {
                rt_se->back = back;
                back = rt_se;
        }
 
-       dequeue_top_rt_rq(rt_rq_of_se(back));
+       rt_nr_running = rt_rq_of_se(back)->rt_nr_running;
 
        for (rt_se = back; rt_se; rt_se = rt_se->back) {
                if (on_rt_rq(rt_se))
                        __dequeue_rt_entity(rt_se, flags);
        }
+
+       dequeue_top_rt_rq(rt_rq_of_se(back), rt_nr_running);
 }
 
 static void enqueue_rt_entity(struct sched_rt_entity *rt_se, unsigned int flags)
index 47b89a0fc6e558595c9f78346ac0424006b858bd..aad7f5ee9666cc3d0001ae7d5d03b1b58bca77f5 100644 (file)
@@ -520,6 +520,45 @@ struct cfs_bandwidth { };
 
 #endif /* CONFIG_CGROUP_SCHED */
 
+/*
+ * u64_u32_load/u64_u32_store
+ *
+ * Use a copy of a u64 value to protect against data race. This is only
+ * applicable for 32-bits architectures.
+ */
+#ifdef CONFIG_64BIT
+# define u64_u32_load_copy(var, copy)       var
+# define u64_u32_store_copy(var, copy, val) (var = val)
+#else
+# define u64_u32_load_copy(var, copy)                                  \
+({                                                                     \
+       u64 __val, __val_copy;                                          \
+       do {                                                            \
+               __val_copy = copy;                                      \
+               /*                                                      \
+                * paired with u64_u32_store_copy(), ordering access    \
+                * to var and copy.                                     \
+                */                                                     \
+               smp_rmb();                                              \
+               __val = var;                                            \
+       } while (__val != __val_copy);                                  \
+       __val;                                                          \
+})
+# define u64_u32_store_copy(var, copy, val)                            \
+do {                                                                   \
+       typeof(val) __val = (val);                                      \
+       var = __val;                                                    \
+       /*                                                              \
+        * paired with u64_u32_load_copy(), ordering access to var and  \
+        * copy.                                                        \
+        */                                                             \
+       smp_wmb();                                                      \
+       copy = __val;                                                   \
+} while (0)
+#endif
+# define u64_u32_load(var)      u64_u32_load_copy(var, var##_copy)
+# define u64_u32_store(var, val) u64_u32_store_copy(var, var##_copy, val)
+
 /* CFS-related fields in a runqueue */
 struct cfs_rq {
        struct load_weight      load;
@@ -560,7 +599,7 @@ struct cfs_rq {
         */
        struct sched_avg        avg;
 #ifndef CONFIG_64BIT
-       u64                     load_last_update_time_copy;
+       u64                     last_update_time_copy;
 #endif
        struct {
                raw_spinlock_t  lock ____cacheline_aligned;
@@ -609,6 +648,10 @@ struct cfs_rq {
        int                     runtime_enabled;
        s64                     runtime_remaining;
 
+       u64                     throttled_pelt_idle;
+#ifndef CONFIG_64BIT
+       u64                     throttled_pelt_idle_copy;
+#endif
        u64                     throttled_clock;
        u64                     throttled_clock_pelt;
        u64                     throttled_clock_pelt_time;
@@ -981,6 +1024,12 @@ struct rq {
        u64                     clock_task ____cacheline_aligned;
        u64                     clock_pelt;
        unsigned long           lost_idle_time;
+       u64                     clock_pelt_idle;
+       u64                     clock_idle;
+#ifndef CONFIG_64BIT
+       u64                     clock_pelt_idle_copy;
+       u64                     clock_idle_copy;
+#endif
 
        atomic_t                nr_iowait;
 
@@ -1815,15 +1864,6 @@ static inline struct cpumask *group_balance_mask(struct sched_group *sg)
        return to_cpumask(sg->sgc->cpumask);
 }
 
-/**
- * group_first_cpu - Returns the first CPU in the cpumask of a sched_group.
- * @group: The group whose first CPU is to be returned.
- */
-static inline unsigned int group_first_cpu(struct sched_group *group)
-{
-       return cpumask_first(sched_group_span(group));
-}
-
 extern int group_balance_cpu(struct sched_group *sg);
 
 #ifdef CONFIG_SCHED_DEBUG
@@ -2044,7 +2084,6 @@ static inline int task_on_rq_migrating(struct task_struct *p)
 
 #define WF_SYNC     0x10 /* Waker goes to sleep after wakeup */
 #define WF_MIGRATED 0x20 /* Internal use, task got migrated */
-#define WF_ON_CPU   0x40 /* Wakee is on_cpu */
 
 #ifdef CONFIG_SMP
 static_assert(WF_EXEC == SD_BALANCE_EXEC);
@@ -2852,7 +2891,7 @@ enum cpu_util_type {
 };
 
 unsigned long effective_cpu_util(int cpu, unsigned long util_cfs,
-                                unsigned long max, enum cpu_util_type type,
+                                enum cpu_util_type type,
                                 struct task_struct *p);
 
 static inline unsigned long cpu_bw_dl(struct rq *rq)
index 05b6c2ad90b9cc10383b256b0bc385fefa9db729..8739c2a5a54eabbff18bb5c7666454e75a34c663 100644 (file)
@@ -2316,23 +2316,30 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
 
                                /*
                                 * For a single LLC per node, allow an
-                                * imbalance up to 25% of the node. This is an
-                                * arbitrary cutoff based on SMT-2 to balance
-                                * between memory bandwidth and avoiding
-                                * premature sharing of HT resources and SMT-4
-                                * or SMT-8 *may* benefit from a different
-                                * cutoff.
+                                * imbalance up to 12.5% of the node. This is
+                                * arbitrary cutoff based two factors -- SMT and
+                                * memory channels. For SMT-2, the intent is to
+                                * avoid premature sharing of HT resources but
+                                * SMT-4 or SMT-8 *may* benefit from a different
+                                * cutoff. For memory channels, this is a very
+                                * rough estimate of how many channels may be
+                                * active and is based on recent CPUs with
+                                * many cores.
                                 *
                                 * For multiple LLCs, allow an imbalance
                                 * until multiple tasks would share an LLC
                                 * on one node while LLCs on another node
-                                * remain idle.
+                                * remain idle. This assumes that there are
+                                * enough logical CPUs per LLC to avoid SMT
+                                * factors and that there is a correlation
+                                * between LLCs and memory channels.
                                 */
                                nr_llcs = sd->span_weight / child->span_weight;
                                if (nr_llcs == 1)
-                                       imb = sd->span_weight >> 2;
+                                       imb = sd->span_weight >> 3;
                                else
                                        imb = nr_llcs;
+                               imb = max(1U, imb);
                                sd->imb_numa_nr = imb;
 
                                /* Set span based on the first NUMA domain. */
index bb9962b33f95cec8cd6203f62fe3adf1fca1a480..59ddb00d6944778e7210c5ad70584b7e04ec2fa9 100644 (file)
@@ -454,6 +454,33 @@ void init_watch(struct watch *watch, struct watch_queue *wqueue)
        rcu_assign_pointer(watch->queue, wqueue);
 }
 
+static int add_one_watch(struct watch *watch, struct watch_list *wlist, struct watch_queue *wqueue)
+{
+       const struct cred *cred;
+       struct watch *w;
+
+       hlist_for_each_entry(w, &wlist->watchers, list_node) {
+               struct watch_queue *wq = rcu_access_pointer(w->queue);
+               if (wqueue == wq && watch->id == w->id)
+                       return -EBUSY;
+       }
+
+       cred = current_cred();
+       if (atomic_inc_return(&cred->user->nr_watches) > task_rlimit(current, RLIMIT_NOFILE)) {
+               atomic_dec(&cred->user->nr_watches);
+               return -EAGAIN;
+       }
+
+       watch->cred = get_cred(cred);
+       rcu_assign_pointer(watch->watch_list, wlist);
+
+       kref_get(&wqueue->usage);
+       kref_get(&watch->usage);
+       hlist_add_head(&watch->queue_node, &wqueue->watches);
+       hlist_add_head_rcu(&watch->list_node, &wlist->watchers);
+       return 0;
+}
+
 /**
  * add_watch_to_object - Add a watch on an object to a watch list
  * @watch: The watch to add
@@ -468,34 +495,21 @@ void init_watch(struct watch *watch, struct watch_queue *wqueue)
  */
 int add_watch_to_object(struct watch *watch, struct watch_list *wlist)
 {
-       struct watch_queue *wqueue = rcu_access_pointer(watch->queue);
-       struct watch *w;
-
-       hlist_for_each_entry(w, &wlist->watchers, list_node) {
-               struct watch_queue *wq = rcu_access_pointer(w->queue);
-               if (wqueue == wq && watch->id == w->id)
-                       return -EBUSY;
-       }
-
-       watch->cred = get_current_cred();
-       rcu_assign_pointer(watch->watch_list, wlist);
+       struct watch_queue *wqueue;
+       int ret = -ENOENT;
 
-       if (atomic_inc_return(&watch->cred->user->nr_watches) >
-           task_rlimit(current, RLIMIT_NOFILE)) {
-               atomic_dec(&watch->cred->user->nr_watches);
-               put_cred(watch->cred);
-               return -EAGAIN;
-       }
+       rcu_read_lock();
 
+       wqueue = rcu_access_pointer(watch->queue);
        if (lock_wqueue(wqueue)) {
-               kref_get(&wqueue->usage);
-               kref_get(&watch->usage);
-               hlist_add_head(&watch->queue_node, &wqueue->watches);
+               spin_lock(&wlist->lock);
+               ret = add_one_watch(watch, wlist, wqueue);
+               spin_unlock(&wlist->lock);
                unlock_wqueue(wqueue);
        }
 
-       hlist_add_head(&watch->list_node, &wlist->watchers);
-       return 0;
+       rcu_read_unlock();
+       return ret;
 }
 EXPORT_SYMBOL(add_watch_to_object);
 
index 1ea50f6be843698965a14a13a7498834fc510e36..aa8a82bc673845f9798403c80c2cdac6900f2291 100644 (file)
@@ -5001,7 +5001,10 @@ static void unbind_workers(int cpu)
 
                for_each_pool_worker(worker, pool) {
                        kthread_set_per_cpu(worker->task, -1);
-                       WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, wq_unbound_cpumask) < 0);
+                       if (cpumask_intersects(wq_unbound_cpumask, cpu_active_mask))
+                               WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, wq_unbound_cpumask) < 0);
+                       else
+                               WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, cpu_possible_mask) < 0);
                }
 
                mutex_unlock(&wq_pool_attach_mutex);
index 5512644076246d9baaa4873c9019cde4e17a2e37..e2a39e30756d5421c6cb2dc5f950a9fae98eeb4a 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -87,7 +87,8 @@ retry:
         * belongs to this folio.
         */
        if (unlikely(page_folio(page) != folio)) {
-               folio_put_refs(folio, refs);
+               if (!put_devmap_managed_page_refs(&folio->page, refs))
+                       folio_put_refs(folio, refs);
                goto retry;
        }
 
@@ -176,7 +177,8 @@ static void gup_put_folio(struct folio *folio, int refs, unsigned int flags)
                        refs *= GUP_PIN_COUNTING_BIAS;
        }
 
-       folio_put_refs(folio, refs);
+       if (!put_devmap_managed_page_refs(&folio->page, refs))
+               folio_put_refs(folio, refs);
 }
 
 /**
index 3fd3242c5e50fef17f4832ad196458207f579954..f2aa63b94d9bd8903157a9d25e48df96f762b3a7 100644 (file)
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -212,14 +212,6 @@ int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr,
                unsigned long end, unsigned long hmm_pfns[], pmd_t pmd);
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
-static inline bool hmm_is_device_private_entry(struct hmm_range *range,
-               swp_entry_t entry)
-{
-       return is_device_private_entry(entry) &&
-               pfn_swap_entry_to_page(entry)->pgmap->owner ==
-               range->dev_private_owner;
-}
-
 static inline unsigned long pte_to_hmm_pfn_flags(struct hmm_range *range,
                                                 pte_t pte)
 {
@@ -252,10 +244,12 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
                swp_entry_t entry = pte_to_swp_entry(pte);
 
                /*
-                * Never fault in device private pages, but just report
-                * the PFN even if not present.
+                * Don't fault in device private pages owned by the caller,
+                * just report the PFN.
                 */
-               if (hmm_is_device_private_entry(range, entry)) {
+               if (is_device_private_entry(entry) &&
+                   pfn_swap_entry_to_page(entry)->pgmap->owner ==
+                   range->dev_private_owner) {
                        cpu_flags = HMM_PFN_VALID;
                        if (is_writable_device_private_entry(entry))
                                cpu_flags |= HMM_PFN_WRITE;
@@ -273,6 +267,9 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
                if (!non_swap_entry(entry))
                        goto fault;
 
+               if (is_device_private_entry(entry))
+                       goto fault;
+
                if (is_device_exclusive_entry(entry))
                        goto fault;
 
index a57e1be41401b4105c27c7fc84bc54c1ac7cc555..a18c071c294e35c33823edf0f21dd3094afd031b 100644 (file)
@@ -4788,8 +4788,13 @@ again:
                         * sharing with another vma.
                         */
                        ;
-               } else if (unlikely(is_hugetlb_entry_migration(entry) ||
-                                   is_hugetlb_entry_hwpoisoned(entry))) {
+               } else if (unlikely(is_hugetlb_entry_hwpoisoned(entry))) {
+                       bool uffd_wp = huge_pte_uffd_wp(entry);
+
+                       if (!userfaultfd_wp(dst_vma) && uffd_wp)
+                               entry = huge_pte_clear_uffd_wp(entry);
+                       set_huge_pte_at(dst, addr, dst_pte, entry);
+               } else if (unlikely(is_hugetlb_entry_migration(entry))) {
                        swp_entry_t swp_entry = pte_to_swp_entry(entry);
                        bool uffd_wp = huge_pte_uffd_wp(entry);
 
@@ -5947,6 +5952,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
 
                page = alloc_huge_page(dst_vma, dst_addr, 0);
                if (IS_ERR(page)) {
+                       put_page(*pagep);
                        ret = -ENOMEM;
                        *pagep = NULL;
                        goto out;
index 5fe598ecd9b732f312ac62633fac1bc84be9641e..8652426282cc5adabeddb89758131eff805c9ed0 100644 (file)
 #include <linux/io.h>
 #include <linux/export.h>
 
-void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot)
+void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
+                          unsigned long prot)
 {
        unsigned long offset, vaddr;
        phys_addr_t last_addr;
        struct vm_struct *area;
 
        /* Disallow wrap-around or zero size */
-       last_addr = addr + size - 1;
-       if (!size || last_addr < addr)
+       last_addr = phys_addr + size - 1;
+       if (!size || last_addr < phys_addr)
                return NULL;
 
        /* Page-align mappings */
-       offset = addr & (~PAGE_MASK);
-       addr -= offset;
+       offset = phys_addr & (~PAGE_MASK);
+       phys_addr -= offset;
        size = PAGE_ALIGN(size + offset);
 
+       if (!ioremap_allowed(phys_addr, size, prot))
+               return NULL;
+
        area = get_vm_area_caller(size, VM_IOREMAP,
                        __builtin_return_address(0));
        if (!area)
                return NULL;
        vaddr = (unsigned long)area->addr;
+       area->phys_addr = phys_addr;
 
-       if (ioremap_page_range(vaddr, vaddr + size, addr, __pgprot(prot))) {
+       if (ioremap_page_range(vaddr, vaddr + size, phys_addr,
+                              __pgprot(prot))) {
                free_vm_area(area);
                return NULL;
        }
@@ -44,6 +50,12 @@ EXPORT_SYMBOL(ioremap_prot);
 
 void iounmap(volatile void __iomem *addr)
 {
-       vunmap((void *)((unsigned long)addr & PAGE_MASK));
+       void *vaddr = (void *)((unsigned long)addr & PAGE_MASK);
+
+       if (!iounmap_allowed(vaddr))
+               return;
+
+       if (is_vmalloc_addr(vaddr))
+               vunmap(vaddr);
 }
 EXPORT_SYMBOL(iounmap);
index c40c0e7b3b5f1da97efbe9b409b1002ce2b83304..78be2beb7453af57a179acdacebb5701dbd42b02 100644 (file)
@@ -108,9 +108,10 @@ void __kasan_unpoison_pages(struct page *page, unsigned int order, bool init)
                return;
 
        tag = kasan_random_tag();
+       kasan_unpoison(set_tag(page_address(page), tag),
+                      PAGE_SIZE << order, init);
        for (i = 0; i < (1 << order); i++)
                page_kasan_tag_set(page + i, tag);
-       kasan_unpoison(page_address(page), PAGE_SIZE << order, init);
 }
 
 void __kasan_poison_pages(struct page *page, unsigned int order, bool init)
index 4b5e5a3d3a6388cb42197459da7144552a1bbd52..6aff49f6b79ecfe000272177830621392ef9df79 100644 (file)
@@ -603,14 +603,6 @@ static unsigned long kfence_init_pool(void)
                addr += 2 * PAGE_SIZE;
        }
 
-       /*
-        * The pool is live and will never be deallocated from this point on.
-        * Remove the pool object from the kmemleak object tree, as it would
-        * otherwise overlap with allocations returned by kfence_alloc(), which
-        * are registered with kmemleak through the slab post-alloc hook.
-        */
-       kmemleak_free(__kfence_pool);
-
        return 0;
 }
 
@@ -623,8 +615,16 @@ static bool __init kfence_init_pool_early(void)
 
        addr = kfence_init_pool();
 
-       if (!addr)
+       if (!addr) {
+               /*
+                * The pool is live and will never be deallocated from this point on.
+                * Ignore the pool object from the kmemleak phys object tree, as it would
+                * otherwise overlap with allocations returned by kfence_alloc(), which
+                * are registered with kmemleak through the slab post-alloc hook.
+                */
+               kmemleak_ignore_phys(__pa(__kfence_pool));
                return true;
+       }
 
        /*
         * Only release unprotected pages, and do not try to go back and change
index 4cf7d4b6c950d9f4cddd2ff92d6f479b568fae44..1c6027adc5426b48f89e3e4e820e0c0144d5a579 100644 (file)
@@ -3043,7 +3043,7 @@ static inline void wp_page_reuse(struct vm_fault *vmf)
        pte_t entry;
 
        VM_BUG_ON(!(vmf->flags & FAULT_FLAG_WRITE));
-       VM_BUG_ON(PageAnon(page) && !PageAnonExclusive(page));
+       VM_BUG_ON(page && PageAnon(page) && !PageAnonExclusive(page));
 
        /*
         * Clear the pages cpupid information as the existing
@@ -4369,9 +4369,12 @@ vm_fault_t finish_fault(struct vm_fault *vmf)
                        return VM_FAULT_OOM;
        }
 
-       /* See comment in handle_pte_fault() */
+       /*
+        * See comment in handle_pte_fault() for how this scenario happens, we
+        * need to return NOPAGE so that we drop this page.
+        */
        if (pmd_devmap_trans_unstable(vmf->pmd))
-               return 0;
+               return VM_FAULT_NOPAGE;
 
        vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,
                                      vmf->address, &vmf->ptl);
index b870a659eee67f8edbdf620df9a10ae0a3fae77a..745eea0f99c39cd78c6edfcfed35058748613d08 100644 (file)
@@ -499,7 +499,7 @@ void free_zone_device_page(struct page *page)
 }
 
 #ifdef CONFIG_FS_DAX
-bool __put_devmap_managed_page(struct page *page)
+bool __put_devmap_managed_page_refs(struct page *page, int refs)
 {
        if (page->pgmap->type != MEMORY_DEVICE_FS_DAX)
                return false;
@@ -509,9 +509,9 @@ bool __put_devmap_managed_page(struct page *page)
         * refcount is 1, then the page is free and the refcount is
         * stable because nobody holds a reference on the page.
         */
-       if (page_ref_dec_return(page) == 1)
+       if (page_ref_sub_return(page, refs) == 1)
                wake_up_var(&page->_refcount);
        return true;
 }
-EXPORT_SYMBOL(__put_devmap_managed_page);
+EXPORT_SYMBOL(__put_devmap_managed_page_refs);
 #endif /* CONFIG_FS_DAX */
index e008a3df0485c79ac24ef31b4407dd5921a9649a..b0bcab50f0a356a33480da25e14c190d419bca33 100644 (file)
@@ -2361,7 +2361,7 @@ static inline bool check_new_pcp(struct page *page, unsigned int order)
 }
 #endif /* CONFIG_DEBUG_VM */
 
-static inline bool should_skip_kasan_unpoison(gfp_t flags, bool init_tags)
+static inline bool should_skip_kasan_unpoison(gfp_t flags)
 {
        /* Don't skip if a software KASAN mode is enabled. */
        if (IS_ENABLED(CONFIG_KASAN_GENERIC) ||
@@ -2373,12 +2373,10 @@ static inline bool should_skip_kasan_unpoison(gfp_t flags, bool init_tags)
                return true;
 
        /*
-        * With hardware tag-based KASAN enabled, skip if either:
-        *
-        * 1. Memory tags have already been cleared via tag_clear_highpage().
-        * 2. Skipping has been requested via __GFP_SKIP_KASAN_UNPOISON.
+        * With hardware tag-based KASAN enabled, skip if this has been
+        * requested via __GFP_SKIP_KASAN_UNPOISON.
         */
-       return init_tags || (flags & __GFP_SKIP_KASAN_UNPOISON);
+       return flags & __GFP_SKIP_KASAN_UNPOISON;
 }
 
 static inline bool should_skip_init(gfp_t flags)
@@ -2397,6 +2395,7 @@ inline void post_alloc_hook(struct page *page, unsigned int order,
        bool init = !want_init_on_free() && want_init_on_alloc(gfp_flags) &&
                        !should_skip_init(gfp_flags);
        bool init_tags = init && (gfp_flags & __GFP_ZEROTAGS);
+       int i;
 
        set_page_private(page, 0);
        set_page_refcounted(page);
@@ -2422,8 +2421,6 @@ inline void post_alloc_hook(struct page *page, unsigned int order,
         * should be initialized as well).
         */
        if (init_tags) {
-               int i;
-
                /* Initialize both memory and tags. */
                for (i = 0; i != 1 << order; ++i)
                        tag_clear_highpage(page + i);
@@ -2431,13 +2428,17 @@ inline void post_alloc_hook(struct page *page, unsigned int order,
                /* Note that memory is already initialized by the loop above. */
                init = false;
        }
-       if (!should_skip_kasan_unpoison(gfp_flags, init_tags)) {
+       if (!should_skip_kasan_unpoison(gfp_flags)) {
                /* Unpoison shadow memory or set memory tags. */
                kasan_unpoison_pages(page, order, init);
 
                /* Note that memory is already initialized by KASAN. */
                if (kasan_has_integrated_init())
                        init = false;
+       } else {
+               /* Ensure page_address() dereferencing does not fault. */
+               for (i = 0; i != 1 << order; ++i)
+                       page_kasan_tag_reset(page + i);
        }
        /* If memory is still not initialized, do it now. */
        if (init)
@@ -3968,11 +3969,15 @@ static inline bool zone_watermark_fast(struct zone *z, unsigned int order,
         * need to be calculated.
         */
        if (!order) {
-               long fast_free;
+               long usable_free;
+               long reserved;
+
+               usable_free = free_pages;
+               reserved = __zone_watermark_unusable_free(z, 0, alloc_flags);
 
-               fast_free = free_pages;
-               fast_free -= __zone_watermark_unusable_free(z, 0, alloc_flags);
-               if (fast_free > mark + z->lowmem_reserve[highest_zoneidx])
+               /* reserved may over estimate high-atomic reserves. */
+               usable_free -= min(usable_free, reserved);
+               if (usable_free > mark + z->lowmem_reserve[highest_zoneidx])
                        return true;
        }
 
index 206ed6b40c1d0fcfbb6abcbced65581c647c1892..f06279d6190a5f0eca83cb2ef5710b67077288da 100644 (file)
@@ -55,22 +55,28 @@ static vm_fault_t secretmem_fault(struct vm_fault *vmf)
        gfp_t gfp = vmf->gfp_mask;
        unsigned long addr;
        struct page *page;
+       vm_fault_t ret;
        int err;
 
        if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
                return vmf_error(-EINVAL);
 
+       filemap_invalidate_lock_shared(mapping);
+
 retry:
        page = find_lock_page(mapping, offset);
        if (!page) {
                page = alloc_page(gfp | __GFP_ZERO);
-               if (!page)
-                       return VM_FAULT_OOM;
+               if (!page) {
+                       ret = VM_FAULT_OOM;
+                       goto out;
+               }
 
                err = set_direct_map_invalid_noflush(page);
                if (err) {
                        put_page(page);
-                       return vmf_error(err);
+                       ret = vmf_error(err);
+                       goto out;
                }
 
                __SetPageUptodate(page);
@@ -86,7 +92,8 @@ retry:
                        if (err == -EEXIST)
                                goto retry;
 
-                       return vmf_error(err);
+                       ret = vmf_error(err);
+                       goto out;
                }
 
                addr = (unsigned long)page_address(page);
@@ -94,7 +101,11 @@ retry:
        }
 
        vmf->page = page;
-       return VM_FAULT_LOCKED;
+       ret = VM_FAULT_LOCKED;
+
+out:
+       filemap_invalidate_unlock_shared(mapping);
+       return ret;
 }
 
 static const struct vm_operations_struct secretmem_vm_ops = {
@@ -162,12 +173,20 @@ static int secretmem_setattr(struct user_namespace *mnt_userns,
                             struct dentry *dentry, struct iattr *iattr)
 {
        struct inode *inode = d_inode(dentry);
+       struct address_space *mapping = inode->i_mapping;
        unsigned int ia_valid = iattr->ia_valid;
+       int ret;
+
+       filemap_invalidate_lock(mapping);
 
        if ((ia_valid & ATTR_SIZE) && inode->i_size)
-               return -EINVAL;
+               ret = -EINVAL;
+       else
+               ret = simple_setattr(mnt_userns, dentry, iattr);
 
-       return simple_setattr(mnt_userns, dentry, iattr);
+       filemap_invalidate_unlock(mapping);
+
+       return ret;
 }
 
 static const struct inode_operations secretmem_iops = {
index a6f56530813387b8767a0a98f51324de58a6584c..b7f2d4a5686733ee75ed2ee6c9fda01b6196f387 100644 (file)
@@ -3392,7 +3392,7 @@ static int shmem_parse_one(struct fs_context *fc, struct fs_parameter *param)
                break;
        case Opt_nr_blocks:
                ctx->blocks = memparse(param->string, &rest);
-               if (*rest)
+               if (*rest || ctx->blocks > S64_MAX)
                        goto bad_value;
                ctx->seen |= SHMEM_SEEN_BLOCKS;
                break;
@@ -3514,10 +3514,7 @@ static int shmem_reconfigure(struct fs_context *fc)
 
        raw_spin_lock(&sbinfo->stat_lock);
        inodes = sbinfo->max_inodes - sbinfo->free_inodes;
-       if (ctx->blocks > S64_MAX) {
-               err = "Number of blocks too large";
-               goto out;
-       }
+
        if ((ctx->seen & SHMEM_SEEN_BLOCKS) && ctx->blocks) {
                if (!sbinfo->max_blocks) {
                        err = "Cannot retroactively limit size";
index f8cd00f4ba13cb8fd46617c5753aa19960e7664e..5e73e2d802223e35de72985304a18c1f5e628ddf 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3230,7 +3230,7 @@ slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, size_t orig_
        }
        /* ___cache_alloc_node can fall back to other nodes */
        ptr = ____cache_alloc_node(cachep, flags, nodeid);
-  out:
+out:
        local_irq_restore(save_flags);
        ptr = cache_alloc_debugcheck_after(cachep, flags, ptr, caller);
        init = slab_want_init_on_alloc(flags, cachep);
@@ -3259,7 +3259,7 @@ __do_cache_alloc(struct kmem_cache *cache, gfp_t flags)
        if (!objp)
                objp = ____cache_alloc_node(cache, flags, numa_mem_id());
 
-  out:
+out:
        return objp;
 }
 #else
@@ -3406,9 +3406,10 @@ static __always_inline void __cache_free(struct kmem_cache *cachep, void *objp,
 {
        bool init;
 
+       memcg_slab_free_hook(cachep, virt_to_slab(objp), &objp, 1);
+
        if (is_kfence_address(objp)) {
                kmemleak_free_recursive(objp, cachep->flags);
-               memcg_slab_free_hook(cachep, &objp, 1);
                __kfence_free(objp);
                return;
        }
@@ -3441,7 +3442,6 @@ void ___cache_free(struct kmem_cache *cachep, void *objp,
        check_irq_off();
        kmemleak_free_recursive(objp, cachep->flags);
        objp = cache_free_debugcheck(cachep, objp, caller);
-       memcg_slab_free_hook(cachep, &objp, 1);
 
        /*
         * Skip calling cache_free_alien() when the platform is not numa.
@@ -3478,7 +3478,7 @@ void *__kmem_cache_alloc_lru(struct kmem_cache *cachep, struct list_lru *lru,
 {
        void *ret = slab_alloc(cachep, lru, flags, cachep->object_size, _RET_IP_);
 
-       trace_kmem_cache_alloc(_RET_IP_, ret,
+       trace_kmem_cache_alloc(_RET_IP_, ret, cachep,
                               cachep->object_size, cachep->size, flags);
 
        return ret;
@@ -3553,7 +3553,7 @@ error:
        local_irq_enable();
        cache_alloc_debugcheck_after_bulk(s, flags, i, p, _RET_IP_);
        slab_post_alloc_hook(s, objcg, flags, i, p, false);
-       __kmem_cache_free_bulk(s, i, p);
+       kmem_cache_free_bulk(s, i, p);
        return 0;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_bulk);
@@ -3567,7 +3567,7 @@ kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size)
        ret = slab_alloc(cachep, NULL, flags, size, _RET_IP_);
 
        ret = kasan_kmalloc(cachep, ret, size, flags);
-       trace_kmalloc(_RET_IP_, ret,
+       trace_kmalloc(_RET_IP_, ret, cachep,
                      size, cachep->size, flags);
        return ret;
 }
@@ -3592,7 +3592,7 @@ void *kmem_cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)
 {
        void *ret = slab_alloc_node(cachep, flags, nodeid, cachep->object_size, _RET_IP_);
 
-       trace_kmem_cache_alloc_node(_RET_IP_, ret,
+       trace_kmem_cache_alloc_node(_RET_IP_, ret, cachep,
                                    cachep->object_size, cachep->size,
                                    flags, nodeid);
 
@@ -3611,7 +3611,7 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
        ret = slab_alloc_node(cachep, flags, nodeid, size, _RET_IP_);
 
        ret = kasan_kmalloc(cachep, ret, size, flags);
-       trace_kmalloc_node(_RET_IP_, ret,
+       trace_kmalloc_node(_RET_IP_, ret, cachep,
                           size, cachep->size,
                           flags, nodeid);
        return ret;
@@ -3694,7 +3694,7 @@ static __always_inline void *__do_kmalloc(size_t size, gfp_t flags,
        ret = slab_alloc(cachep, NULL, flags, size, caller);
 
        ret = kasan_kmalloc(cachep, ret, size, flags);
-       trace_kmalloc(caller, ret,
+       trace_kmalloc(caller, ret, cachep,
                      size, cachep->size, flags);
 
        return ret;
index db9fb5c8dae73c89b45b29a9392e86eadbf1614e..4ec82bec15ecd3b4f50e67bdde6a954bc50781df 100644 (file)
--- a/mm/slab.h
+++ b/mm/slab.h
@@ -380,15 +380,6 @@ void slabinfo_show_stats(struct seq_file *m, struct kmem_cache *s);
 ssize_t slabinfo_write(struct file *file, const char __user *buffer,
                       size_t count, loff_t *ppos);
 
-/*
- * Generic implementation of bulk operations
- * These are useful for situations in which the allocator cannot
- * perform optimizations. In that case segments of the object listed
- * may be allocated or freed using these operations.
- */
-void __kmem_cache_free_bulk(struct kmem_cache *, size_t, void **);
-int __kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **);
-
 static inline enum node_stat_item cache_vmstat_idx(struct kmem_cache *s)
 {
        return (s->flags & SLAB_RECLAIM_ACCOUNT) ?
@@ -547,36 +538,22 @@ static inline void memcg_slab_post_alloc_hook(struct kmem_cache *s,
        obj_cgroup_put(objcg);
 }
 
-static inline void memcg_slab_free_hook(struct kmem_cache *s_orig,
+static inline void memcg_slab_free_hook(struct kmem_cache *s, struct slab *slab,
                                        void **p, int objects)
 {
-       struct kmem_cache *s;
        struct obj_cgroup **objcgs;
-       struct obj_cgroup *objcg;
-       struct slab *slab;
-       unsigned int off;
        int i;
 
        if (!memcg_kmem_enabled())
                return;
 
-       for (i = 0; i < objects; i++) {
-               if (unlikely(!p[i]))
-                       continue;
-
-               slab = virt_to_slab(p[i]);
-               /* we could be given a kmalloc_large() object, skip those */
-               if (!slab)
-                       continue;
-
-               objcgs = slab_objcgs(slab);
-               if (!objcgs)
-                       continue;
+       objcgs = slab_objcgs(slab);
+       if (!objcgs)
+               return;
 
-               if (!s_orig)
-                       s = slab->slab_cache;
-               else
-                       s = s_orig;
+       for (i = 0; i < objects; i++) {
+               struct obj_cgroup *objcg;
+               unsigned int off;
 
                off = obj_to_index(s, slab, p[i]);
                objcg = objcgs[off];
@@ -628,7 +605,7 @@ static inline void memcg_slab_post_alloc_hook(struct kmem_cache *s,
 {
 }
 
-static inline void memcg_slab_free_hook(struct kmem_cache *s,
+static inline void memcg_slab_free_hook(struct kmem_cache *s, struct slab *slab,
                                        void **p, int objects)
 {
 }
index 77c3adf40e50436694ba481b3a4021c914921ef2..17996649cfe3e9efb174a16c00b5c8c22176067b 100644 (file)
 #include <linux/memcontrol.h>
 #include <linux/stackdepot.h>
 
-#define CREATE_TRACE_POINTS
-#include <trace/events/kmem.h>
-
 #include "internal.h"
-
 #include "slab.h"
 
+#define CREATE_TRACE_POINTS
+#include <trace/events/kmem.h>
+
 enum slab_state slab_state;
 LIST_HEAD(slab_caches);
 DEFINE_MUTEX(slab_mutex);
@@ -105,33 +104,6 @@ static inline int kmem_cache_sanity_check(const char *name, unsigned int size)
 }
 #endif
 
-void __kmem_cache_free_bulk(struct kmem_cache *s, size_t nr, void **p)
-{
-       size_t i;
-
-       for (i = 0; i < nr; i++) {
-               if (s)
-                       kmem_cache_free(s, p[i]);
-               else
-                       kfree(p[i]);
-       }
-}
-
-int __kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t nr,
-                                                               void **p)
-{
-       size_t i;
-
-       for (i = 0; i < nr; i++) {
-               void *x = p[i] = kmem_cache_alloc(s, flags);
-               if (!x) {
-                       __kmem_cache_free_bulk(s, i, p);
-                       return 0;
-               }
-       }
-       return i;
-}
-
 /*
  * Figure out what the alignment of the objects will be given a set of
  * flags, a user specified alignment and the size of the objects.
@@ -959,7 +931,7 @@ EXPORT_SYMBOL(kmalloc_order);
 void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
 {
        void *ret = kmalloc_order(size, flags, order);
-       trace_kmalloc(_RET_IP_, ret, size, PAGE_SIZE << order, flags);
+       trace_kmalloc(_RET_IP_, ret, NULL, size, PAGE_SIZE << order, flags);
        return ret;
 }
 EXPORT_SYMBOL(kmalloc_order_trace);
index f47811f09aca0ffc1ddb6d31732dce0f24a56e30..2bd4f476c34085ce7fafc57b4c22331fd7c4dc61 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -507,7 +507,7 @@ __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller)
                *m = size;
                ret = (void *)m + minalign;
 
-               trace_kmalloc_node(caller, ret,
+               trace_kmalloc_node(caller, ret, NULL,
                                   size, size + minalign, gfp, node);
        } else {
                unsigned int order = get_order(size);
@@ -516,7 +516,7 @@ __do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller)
                        gfp |= __GFP_COMP;
                ret = slob_new_pages(gfp, order, node);
 
-               trace_kmalloc_node(caller, ret,
+               trace_kmalloc_node(caller, ret, NULL,
                                   size, PAGE_SIZE << order, gfp, node);
        }
 
@@ -616,12 +616,12 @@ static void *slob_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
 
        if (c->size < PAGE_SIZE) {
                b = slob_alloc(c->size, flags, c->align, node, 0);
-               trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size,
+               trace_kmem_cache_alloc_node(_RET_IP_, b, NULL, c->object_size,
                                            SLOB_UNITS(c->size) * SLOB_UNIT,
                                            flags, node);
        } else {
                b = slob_new_pages(flags, get_order(c->size), node);
-               trace_kmem_cache_alloc_node(_RET_IP_, b, c->object_size,
+               trace_kmem_cache_alloc_node(_RET_IP_, b, NULL, c->object_size,
                                            PAGE_SIZE << get_order(c->size),
                                            flags, node);
        }
@@ -692,16 +692,33 @@ void kmem_cache_free(struct kmem_cache *c, void *b)
 }
 EXPORT_SYMBOL(kmem_cache_free);
 
-void kmem_cache_free_bulk(struct kmem_cache *s, size_t size, void **p)
+void kmem_cache_free_bulk(struct kmem_cache *s, size_t nr, void **p)
 {
-       __kmem_cache_free_bulk(s, size, p);
+       size_t i;
+
+       for (i = 0; i < nr; i++) {
+               if (s)
+                       kmem_cache_free(s, p[i]);
+               else
+                       kfree(p[i]);
+       }
 }
 EXPORT_SYMBOL(kmem_cache_free_bulk);
 
-int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size,
+int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t nr,
                                                                void **p)
 {
-       return __kmem_cache_alloc_bulk(s, flags, size, p);
+       size_t i;
+
+       for (i = 0; i < nr; i++) {
+               void *x = p[i] = kmem_cache_alloc(s, flags);
+
+               if (!x) {
+                       kmem_cache_free_bulk(s, i, p);
+                       return 0;
+               }
+       }
+       return i;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_bulk);
 
index b1281b8654bd32efc4861ea3fe5b3e446a862950..862dbd9af4f521fe820a9b5bdb69e7a726ba3d5d 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3257,7 +3257,7 @@ void *__kmem_cache_alloc_lru(struct kmem_cache *s, struct list_lru *lru,
 {
        void *ret = slab_alloc(s, lru, gfpflags, _RET_IP_, s->object_size);
 
-       trace_kmem_cache_alloc(_RET_IP_, ret, s->object_size,
+       trace_kmem_cache_alloc(_RET_IP_, ret, s, s->object_size,
                                s->size, gfpflags);
 
        return ret;
@@ -3280,7 +3280,7 @@ EXPORT_SYMBOL(kmem_cache_alloc_lru);
 void *kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size)
 {
        void *ret = slab_alloc(s, NULL, gfpflags, _RET_IP_, size);
-       trace_kmalloc(_RET_IP_, ret, size, s->size, gfpflags);
+       trace_kmalloc(_RET_IP_, ret, s, size, s->size, gfpflags);
        ret = kasan_kmalloc(s, ret, size, gfpflags);
        return ret;
 }
@@ -3292,7 +3292,7 @@ void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node)
 {
        void *ret = slab_alloc_node(s, NULL, gfpflags, node, _RET_IP_, s->object_size);
 
-       trace_kmem_cache_alloc_node(_RET_IP_, ret,
+       trace_kmem_cache_alloc_node(_RET_IP_, ret, s,
                                    s->object_size, s->size, gfpflags, node);
 
        return ret;
@@ -3306,7 +3306,7 @@ void *kmem_cache_alloc_node_trace(struct kmem_cache *s,
 {
        void *ret = slab_alloc_node(s, NULL, gfpflags, node, _RET_IP_, size);
 
-       trace_kmalloc_node(_RET_IP_, ret,
+       trace_kmalloc_node(_RET_IP_, ret, s,
                           size, s->size, gfpflags, node);
 
        ret = kasan_kmalloc(s, ret, size, gfpflags);
@@ -3464,9 +3464,6 @@ static __always_inline void do_slab_free(struct kmem_cache *s,
        struct kmem_cache_cpu *c;
        unsigned long tid;
 
-       /* memcg_slab_free_hook() is already called for bulk free. */
-       if (!tail)
-               memcg_slab_free_hook(s, &head, 1);
 redo:
        /*
         * Determine the currently cpus per cpu slab.
@@ -3526,9 +3523,10 @@ redo:
 }
 
 static __always_inline void slab_free(struct kmem_cache *s, struct slab *slab,
-                                     void *head, void *tail, int cnt,
+                                     void *head, void *tail, void **p, int cnt,
                                      unsigned long addr)
 {
+       memcg_slab_free_hook(s, slab, p, cnt);
        /*
         * With KASAN enabled slab_free_freelist_hook modifies the freelist
         * to remove objects, whose reuse must be delayed.
@@ -3550,7 +3548,7 @@ void kmem_cache_free(struct kmem_cache *s, void *x)
        if (!s)
                return;
        trace_kmem_cache_free(_RET_IP_, x, s->name);
-       slab_free(s, virt_to_slab(x), x, NULL, 1, _RET_IP_);
+       slab_free(s, virt_to_slab(x), x, NULL, &x, 1, _RET_IP_);
 }
 EXPORT_SYMBOL(kmem_cache_free);
 
@@ -3591,88 +3589,67 @@ static inline
 int build_detached_freelist(struct kmem_cache *s, size_t size,
                            void **p, struct detached_freelist *df)
 {
-       size_t first_skipped_index = 0;
        int lookahead = 3;
        void *object;
        struct folio *folio;
-       struct slab *slab;
-
-       /* Always re-init detached_freelist */
-       df->slab = NULL;
-
-       do {
-               object = p[--size];
-               /* Do we need !ZERO_OR_NULL_PTR(object) here? (for kfree) */
-       } while (!object && size);
-
-       if (!object)
-               return 0;
+       size_t same;
 
+       object = p[--size];
        folio = virt_to_folio(object);
        if (!s) {
                /* Handle kalloc'ed objects */
                if (unlikely(!folio_test_slab(folio))) {
                        free_large_kmalloc(folio, object);
-                       p[size] = NULL; /* mark object processed */
+                       df->slab = NULL;
                        return size;
                }
                /* Derive kmem_cache from object */
-               slab = folio_slab(folio);
-               df->s = slab->slab_cache;
+               df->slab = folio_slab(folio);
+               df->s = df->slab->slab_cache;
        } else {
-               slab = folio_slab(folio);
+               df->slab = folio_slab(folio);
                df->s = cache_from_obj(s, object); /* Support for memcg */
        }
 
-       if (is_kfence_address(object)) {
-               slab_free_hook(df->s, object, false);
-               __kfence_free(object);
-               p[size] = NULL; /* mark object processed */
-               return size;
-       }
-
        /* Start new detached freelist */
-       df->slab = slab;
-       set_freepointer(df->s, object, NULL);
        df->tail = object;
        df->freelist = object;
-       p[size] = NULL; /* mark object processed */
        df->cnt = 1;
 
+       if (is_kfence_address(object))
+               return size;
+
+       set_freepointer(df->s, object, NULL);
+
+       same = size;
        while (size) {
                object = p[--size];
-               if (!object)
-                       continue; /* Skip processed objects */
-
                /* df->slab is always set at this point */
                if (df->slab == virt_to_slab(object)) {
                        /* Opportunity build freelist */
                        set_freepointer(df->s, object, df->freelist);
                        df->freelist = object;
                        df->cnt++;
-                       p[size] = NULL; /* mark object processed */
-
+                       same--;
+                       if (size != same)
+                               swap(p[size], p[same]);
                        continue;
                }
 
                /* Limit look ahead search */
                if (!--lookahead)
                        break;
-
-               if (!first_skipped_index)
-                       first_skipped_index = size + 1;
        }
 
-       return first_skipped_index;
+       return same;
 }
 
 /* Note that interrupts must be enabled when calling this function. */
 void kmem_cache_free_bulk(struct kmem_cache *s, size_t size, void **p)
 {
-       if (WARN_ON(!size))
+       if (!size)
                return;
 
-       memcg_slab_free_hook(s, p, size);
        do {
                struct detached_freelist df;
 
@@ -3680,7 +3657,8 @@ void kmem_cache_free_bulk(struct kmem_cache *s, size_t size, void **p)
                if (!df.slab)
                        continue;
 
-               slab_free(df.s, df.slab, df.freelist, df.tail, df.cnt, _RET_IP_);
+               slab_free(df.s, df.slab, df.freelist, df.tail, &p[size], df.cnt,
+                         _RET_IP_);
        } while (likely(size));
 }
 EXPORT_SYMBOL(kmem_cache_free_bulk);
@@ -3760,7 +3738,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size,
 error:
        slub_put_cpu_ptr(s->cpu_slab);
        slab_post_alloc_hook(s, objcg, flags, i, p, false);
-       __kmem_cache_free_bulk(s, i, p);
+       kmem_cache_free_bulk(s, i, p);
        return 0;
 }
 EXPORT_SYMBOL(kmem_cache_alloc_bulk);
@@ -4441,7 +4419,7 @@ void *__kmalloc(size_t size, gfp_t flags)
 
        ret = slab_alloc(s, NULL, flags, _RET_IP_, size);
 
-       trace_kmalloc(_RET_IP_, ret, size, s->size, flags);
+       trace_kmalloc(_RET_IP_, ret, s, size, s->size, flags);
 
        ret = kasan_kmalloc(s, ret, size, flags);
 
@@ -4475,7 +4453,7 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
        if (unlikely(size > KMALLOC_MAX_CACHE_SIZE)) {
                ret = kmalloc_large_node(size, flags, node);
 
-               trace_kmalloc_node(_RET_IP_, ret,
+               trace_kmalloc_node(_RET_IP_, ret, NULL,
                                   size, PAGE_SIZE << get_order(size),
                                   flags, node);
 
@@ -4489,7 +4467,7 @@ void *__kmalloc_node(size_t size, gfp_t flags, int node)
 
        ret = slab_alloc_node(s, NULL, flags, node, _RET_IP_, size);
 
-       trace_kmalloc_node(_RET_IP_, ret, size, s->size, flags, node);
+       trace_kmalloc_node(_RET_IP_, ret, s, size, s->size, flags, node);
 
        ret = kasan_kmalloc(s, ret, size, flags);
 
@@ -4581,7 +4559,7 @@ void kfree(const void *x)
                return;
        }
        slab = folio_slab(folio);
-       slab_free(slab->slab_cache, slab, object, NULL, 1, _RET_IP_);
+       slab_free(slab->slab_cache, slab, object, NULL, &object, 1, _RET_IP_);
 }
 EXPORT_SYMBOL(kfree);
 
@@ -4890,6 +4868,9 @@ __kmem_cache_alias(const char *name, unsigned int size, unsigned int align,
 
        s = find_mergeable(size, align, flags, name, ctor);
        if (s) {
+               if (sysfs_slab_alias(s, name))
+                       return NULL;
+
                s->refcount++;
 
                /*
@@ -4898,11 +4879,6 @@ __kmem_cache_alias(const char *name, unsigned int size, unsigned int align,
                 */
                s->object_size = max(s->object_size, size);
                s->inuse = max(s->inuse, ALIGN(size, sizeof(void *)));
-
-               if (sysfs_slab_alias(s, name)) {
-                       s->refcount--;
-                       s = NULL;
-               }
        }
 
        return s;
@@ -4948,7 +4924,7 @@ void *__kmalloc_track_caller(size_t size, gfp_t gfpflags, unsigned long caller)
        ret = slab_alloc(s, NULL, gfpflags, caller, size);
 
        /* Honor the call site pointer we received. */
-       trace_kmalloc(caller, ret, size, s->size, gfpflags);
+       trace_kmalloc(caller, ret, s, size, s->size, gfpflags);
 
        return ret;
 }
@@ -4964,7 +4940,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
        if (unlikely(size > KMALLOC_MAX_CACHE_SIZE)) {
                ret = kmalloc_large_node(size, gfpflags, node);
 
-               trace_kmalloc_node(caller, ret,
+               trace_kmalloc_node(caller, ret, NULL,
                                   size, PAGE_SIZE << get_order(size),
                                   gfpflags, node);
 
@@ -4979,7 +4955,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
        ret = slab_alloc_node(s, NULL, gfpflags, node, caller, size);
 
        /* Honor the call site pointer we received. */
-       trace_kmalloc_node(caller, ret, size, s->size, gfpflags, node);
+       trace_kmalloc_node(caller, ret, s, size, s->size, gfpflags, node);
 
        return ret;
 }
index 2a65a89b5b4d7392c86b2b7dc169c0a233cce193..10b94d64cc257aadcc826ed4102a94def8fa1c6e 100644 (file)
@@ -307,7 +307,7 @@ swp_entry_t folio_alloc_swap(struct folio *folio)
        entry.val = 0;
 
        if (folio_test_large(folio)) {
-               if (IS_ENABLED(CONFIG_THP_SWAP))
+               if (IS_ENABLED(CONFIG_THP_SWAP) && arch_thp_swp_supported())
                        get_swap_pages(1, &entry, folio_nr_pages(folio));
                goto out;
        }
index 1739e8cb3291eff52cfba8f85cc84536deb426c9..c17021642234ba25553f635cd2dd3c900c31c438 100644 (file)
@@ -4973,6 +4973,9 @@ int hci_suspend_sync(struct hci_dev *hdev)
                return err;
        }
 
+       /* Update event mask so only the allowed event can wakeup the host */
+       hci_set_event_mask_sync(hdev);
+
        /* Only configure accept list if disconnect succeeded and wake
         * isn't being prevented.
         */
@@ -4984,9 +4987,6 @@ int hci_suspend_sync(struct hci_dev *hdev)
        /* Unpause to take care of updating scanning params */
        hdev->scanning_paused = false;
 
-       /* Update event mask so only the allowed event can wakeup the host */
-       hci_set_event_mask_sync(hdev);
-
        /* Enable event filter for paired devices */
        hci_update_event_filter_sync(hdev);
 
index ae78490ecd3d4b3e641cd4ed28084eed52027194..52668662ae8de1f02a4b19e5f9afe63bd1fe8221 100644 (file)
@@ -111,7 +111,8 @@ static struct l2cap_chan *__l2cap_get_chan_by_scid(struct l2cap_conn *conn,
 }
 
 /* Find channel with given SCID.
- * Returns locked channel. */
+ * Returns a reference locked channel.
+ */
 static struct l2cap_chan *l2cap_get_chan_by_scid(struct l2cap_conn *conn,
                                                 u16 cid)
 {
@@ -119,15 +120,19 @@ static struct l2cap_chan *l2cap_get_chan_by_scid(struct l2cap_conn *conn,
 
        mutex_lock(&conn->chan_lock);
        c = __l2cap_get_chan_by_scid(conn, cid);
-       if (c)
-               l2cap_chan_lock(c);
+       if (c) {
+               /* Only lock if chan reference is not 0 */
+               c = l2cap_chan_hold_unless_zero(c);
+               if (c)
+                       l2cap_chan_lock(c);
+       }
        mutex_unlock(&conn->chan_lock);
 
        return c;
 }
 
 /* Find channel with given DCID.
- * Returns locked channel.
+ * Returns a reference locked channel.
  */
 static struct l2cap_chan *l2cap_get_chan_by_dcid(struct l2cap_conn *conn,
                                                 u16 cid)
@@ -136,8 +141,12 @@ static struct l2cap_chan *l2cap_get_chan_by_dcid(struct l2cap_conn *conn,
 
        mutex_lock(&conn->chan_lock);
        c = __l2cap_get_chan_by_dcid(conn, cid);
-       if (c)
-               l2cap_chan_lock(c);
+       if (c) {
+               /* Only lock if chan reference is not 0 */
+               c = l2cap_chan_hold_unless_zero(c);
+               if (c)
+                       l2cap_chan_lock(c);
+       }
        mutex_unlock(&conn->chan_lock);
 
        return c;
@@ -162,8 +171,12 @@ static struct l2cap_chan *l2cap_get_chan_by_ident(struct l2cap_conn *conn,
 
        mutex_lock(&conn->chan_lock);
        c = __l2cap_get_chan_by_ident(conn, ident);
-       if (c)
-               l2cap_chan_lock(c);
+       if (c) {
+               /* Only lock if chan reference is not 0 */
+               c = l2cap_chan_hold_unless_zero(c);
+               if (c)
+                       l2cap_chan_lock(c);
+       }
        mutex_unlock(&conn->chan_lock);
 
        return c;
@@ -497,6 +510,16 @@ void l2cap_chan_hold(struct l2cap_chan *c)
        kref_get(&c->kref);
 }
 
+struct l2cap_chan *l2cap_chan_hold_unless_zero(struct l2cap_chan *c)
+{
+       BT_DBG("chan %p orig refcnt %u", c, kref_read(&c->kref));
+
+       if (!kref_get_unless_zero(&c->kref))
+               return NULL;
+
+       return c;
+}
+
 void l2cap_chan_put(struct l2cap_chan *c)
 {
        BT_DBG("chan %p orig refcnt %u", c, kref_read(&c->kref));
@@ -1968,7 +1991,10 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
                        src_match = !bacmp(&c->src, src);
                        dst_match = !bacmp(&c->dst, dst);
                        if (src_match && dst_match) {
-                               l2cap_chan_hold(c);
+                               c = l2cap_chan_hold_unless_zero(c);
+                               if (!c)
+                                       continue;
+
                                read_unlock(&chan_list_lock);
                                return c;
                        }
@@ -1983,7 +2009,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,
        }
 
        if (c1)
-               l2cap_chan_hold(c1);
+               c1 = l2cap_chan_hold_unless_zero(c1);
 
        read_unlock(&chan_list_lock);
 
@@ -4463,6 +4489,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn,
 
 unlock:
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
        return err;
 }
 
@@ -4577,6 +4604,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn,
 
 done:
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
        return err;
 }
 
@@ -5304,6 +5332,7 @@ send_move_response:
        l2cap_send_move_chan_rsp(chan, result);
 
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 
        return 0;
 }
@@ -5396,6 +5425,7 @@ static void l2cap_move_continue(struct l2cap_conn *conn, u16 icid, u16 result)
        }
 
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 }
 
 static void l2cap_move_fail(struct l2cap_conn *conn, u8 ident, u16 icid,
@@ -5425,6 +5455,7 @@ static void l2cap_move_fail(struct l2cap_conn *conn, u8 ident, u16 icid,
        l2cap_send_move_chan_cfm(chan, L2CAP_MC_UNCONFIRMED);
 
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 }
 
 static int l2cap_move_channel_rsp(struct l2cap_conn *conn,
@@ -5488,6 +5519,7 @@ static int l2cap_move_channel_confirm(struct l2cap_conn *conn,
        l2cap_send_move_chan_cfm_rsp(conn, cmd->ident, icid);
 
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 
        return 0;
 }
@@ -5523,6 +5555,7 @@ static inline int l2cap_move_channel_confirm_rsp(struct l2cap_conn *conn,
        }
 
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 
        return 0;
 }
@@ -5895,12 +5928,11 @@ static inline int l2cap_le_credits(struct l2cap_conn *conn,
        if (credits > max_credits) {
                BT_ERR("LE credits overflow");
                l2cap_send_disconn_req(chan, ECONNRESET);
-               l2cap_chan_unlock(chan);
 
                /* Return 0 so that we don't trigger an unnecessary
                 * command reject packet.
                 */
-               return 0;
+               goto unlock;
        }
 
        chan->tx_credits += credits;
@@ -5911,7 +5943,9 @@ static inline int l2cap_le_credits(struct l2cap_conn *conn,
        if (chan->tx_credits)
                chan->ops->resume(chan);
 
+unlock:
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 
        return 0;
 }
@@ -7597,6 +7631,7 @@ drop:
 
 done:
        l2cap_chan_unlock(chan);
+       l2cap_chan_put(chan);
 }
 
 static void l2cap_conless_channel(struct l2cap_conn *conn, __le16 psm,
@@ -8085,7 +8120,7 @@ static struct l2cap_chan *l2cap_global_fixed_chan(struct l2cap_chan *c,
                if (src_type != c->src_type)
                        continue;
 
-               l2cap_chan_hold(c);
+               c = l2cap_chan_hold_unless_zero(c);
                read_unlock(&chan_list_lock);
                return c;
        }
index ae758ab1b558d3c0975517969aa1491eabb00fa4..2f91a8c2b6780900d4561cb8abfae62df26c4fb9 100644 (file)
@@ -4723,7 +4723,6 @@ static int __add_adv_patterns_monitor(struct sock *sk, struct hci_dev *hdev,
                else
                        status = MGMT_STATUS_FAILED;
 
-               mgmt_pending_remove(cmd);
                goto unlock;
        }
 
index bb01776d2d88c46ac29ba94c2647fe26ff3468df..c96509c442a57cc023b7f3054242d35b8759c064 100644 (file)
@@ -589,9 +589,13 @@ static int br_fill_ifinfo(struct sk_buff *skb,
        }
 
 done:
+       if (af) {
+               if (nlmsg_get_pos(skb) - (void *)af > nla_attr_size(0))
+                       nla_nest_end(skb, af);
+               else
+                       nla_nest_cancel(skb, af);
+       }
 
-       if (af)
-               nla_nest_end(skb, af);
        nlmsg_end(skb, nlh);
        return 0;
 
index 251e666ba9a28d0f4f480995dec252592d481b97..748be72532485acd47b34bb329abf3749f8ece79 100644 (file)
@@ -47,7 +47,7 @@ enum caif_states {
 struct caifsock {
        struct sock sk; /* must be first member */
        struct cflayer layer;
-       u32 flow_state;
+       unsigned long flow_state;
        struct caif_connect_request conn_req;
        struct mutex readlock;
        struct dentry *debugfs_socket_dir;
@@ -56,38 +56,32 @@ struct caifsock {
 
 static int rx_flow_is_on(struct caifsock *cf_sk)
 {
-       return test_bit(RX_FLOW_ON_BIT,
-                       (void *) &cf_sk->flow_state);
+       return test_bit(RX_FLOW_ON_BIT, &cf_sk->flow_state);
 }
 
 static int tx_flow_is_on(struct caifsock *cf_sk)
 {
-       return test_bit(TX_FLOW_ON_BIT,
-                       (void *) &cf_sk->flow_state);
+       return test_bit(TX_FLOW_ON_BIT, &cf_sk->flow_state);
 }
 
 static void set_rx_flow_off(struct caifsock *cf_sk)
 {
-        clear_bit(RX_FLOW_ON_BIT,
-                (void *) &cf_sk->flow_state);
+       clear_bit(RX_FLOW_ON_BIT, &cf_sk->flow_state);
 }
 
 static void set_rx_flow_on(struct caifsock *cf_sk)
 {
-        set_bit(RX_FLOW_ON_BIT,
-                       (void *) &cf_sk->flow_state);
+       set_bit(RX_FLOW_ON_BIT, &cf_sk->flow_state);
 }
 
 static void set_tx_flow_off(struct caifsock *cf_sk)
 {
-        clear_bit(TX_FLOW_ON_BIT,
-               (void *) &cf_sk->flow_state);
+       clear_bit(TX_FLOW_ON_BIT, &cf_sk->flow_state);
 }
 
 static void set_tx_flow_on(struct caifsock *cf_sk)
 {
-        set_bit(TX_FLOW_ON_BIT,
-               (void *) &cf_sk->flow_state);
+       set_bit(TX_FLOW_ON_BIT, &cf_sk->flow_state);
 }
 
 static void caif_read_lock(struct sock *sk)
index dc92a67baea39484cd4c93913d3eae8ac4463538..7d542eb46172955ebab7e4bebcc15493a6c51b72 100644 (file)
@@ -480,8 +480,8 @@ static struct sock *dn_alloc_sock(struct net *net, struct socket *sock, gfp_t gf
        sk->sk_family      = PF_DECnet;
        sk->sk_protocol    = 0;
        sk->sk_allocation  = gfp;
-       sk->sk_sndbuf      = sysctl_decnet_wmem[1];
-       sk->sk_rcvbuf      = sysctl_decnet_rmem[1];
+       sk->sk_sndbuf      = READ_ONCE(sysctl_decnet_wmem[1]);
+       sk->sk_rcvbuf      = READ_ONCE(sysctl_decnet_rmem[1]);
 
        /* Initialization of DECnet Session Control Port                */
        scp = DN_SK(sk);
index 2b56218fc57c765aa3ba7ac7da8b87e0a43cab0e..4dfd68cf61c5a32184c1408816431a5cf80cafcd 100644 (file)
@@ -344,6 +344,7 @@ static int dsa_switch_do_lag_fdb_add(struct dsa_switch *ds, struct dsa_lag *lag,
 
        ether_addr_copy(a->addr, addr);
        a->vid = vid;
+       a->db = db;
        refcount_set(&a->refcount, 1);
        list_add_tail(&a->list, &lag->fdbs);
 
index 46e8a5125853aeb95c97252e65be94a185b52c3d..452ff177e4da954f518c948ae7004565938e7667 100644 (file)
@@ -1042,6 +1042,7 @@ fib_find_matching_alias(struct net *net, const struct fib_rt_info *fri)
 
 void fib_alias_hw_flags_set(struct net *net, const struct fib_rt_info *fri)
 {
+       u8 fib_notify_on_flag_change;
        struct fib_alias *fa_match;
        struct sk_buff *skb;
        int err;
@@ -1063,14 +1064,16 @@ void fib_alias_hw_flags_set(struct net *net, const struct fib_rt_info *fri)
        WRITE_ONCE(fa_match->offload, fri->offload);
        WRITE_ONCE(fa_match->trap, fri->trap);
 
+       fib_notify_on_flag_change = READ_ONCE(net->ipv4.sysctl_fib_notify_on_flag_change);
+
        /* 2 means send notifications only if offload_failed was changed. */
-       if (net->ipv4.sysctl_fib_notify_on_flag_change == 2 &&
+       if (fib_notify_on_flag_change == 2 &&
            READ_ONCE(fa_match->offload_failed) == fri->offload_failed)
                goto out;
 
        WRITE_ONCE(fa_match->offload_failed, fri->offload_failed);
 
-       if (!net->ipv4.sysctl_fib_notify_on_flag_change)
+       if (!fib_notify_on_flag_change)
                goto out;
 
        skb = nlmsg_new(fib_nlmsg_size(fa_match->fa_info), GFP_ATOMIC);
index 2faaaaf540ac1df534d0e7ded33e07cd3897f3e8..766881775abb795c884d048d51c361e805b91989 100644 (file)
@@ -452,8 +452,8 @@ void tcp_init_sock(struct sock *sk)
 
        icsk->icsk_sync_mss = tcp_sync_mss;
 
-       WRITE_ONCE(sk->sk_sndbuf, sock_net(sk)->ipv4.sysctl_tcp_wmem[1]);
-       WRITE_ONCE(sk->sk_rcvbuf, sock_net(sk)->ipv4.sysctl_tcp_rmem[1]);
+       WRITE_ONCE(sk->sk_sndbuf, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[1]));
+       WRITE_ONCE(sk->sk_rcvbuf, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[1]));
 
        sk_sockets_allocated_inc(sk);
 }
@@ -686,7 +686,7 @@ static bool tcp_should_autocork(struct sock *sk, struct sk_buff *skb,
                                int size_goal)
 {
        return skb->len < size_goal &&
-              sock_net(sk)->ipv4.sysctl_tcp_autocorking &&
+              READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_autocorking) &&
               !tcp_rtx_queue_empty(sk) &&
               refcount_read(&sk->sk_wmem_alloc) > skb->truesize &&
               tcp_skb_can_collapse_to(skb);
@@ -1724,7 +1724,7 @@ int tcp_set_rcvlowat(struct sock *sk, int val)
        if (sk->sk_userlocks & SOCK_RCVBUF_LOCK)
                cap = sk->sk_rcvbuf >> 1;
        else
-               cap = sock_net(sk)->ipv4.sysctl_tcp_rmem[2] >> 1;
+               cap = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]) >> 1;
        val = min(val, cap);
        WRITE_ONCE(sk->sk_rcvlowat, val ? : 1);
 
@@ -4459,9 +4459,18 @@ tcp_inbound_md5_hash(const struct sock *sk, const struct sk_buff *skb,
                return SKB_DROP_REASON_TCP_MD5UNEXPECTED;
        }
 
-       /* check the signature */
-       genhash = tp->af_specific->calc_md5_hash(newhash, hash_expected,
-                                                NULL, skb);
+       /* Check the signature.
+        * To support dual stack listeners, we need to handle
+        * IPv4-mapped case.
+        */
+       if (family == AF_INET)
+               genhash = tcp_v4_md5_hash_skb(newhash,
+                                             hash_expected,
+                                             NULL, skb);
+       else
+               genhash = tp->af_specific->calc_md5_hash(newhash,
+                                                        hash_expected,
+                                                        NULL, skb);
 
        if (genhash || memcmp(hash_location, newhash, 16) != 0) {
                NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPMD5FAILURE);
index 07dbcbae7782880baaf5fbca1d344170aa032c12..b1637990d570841d014a8d034ab0128a6658aea1 100644 (file)
@@ -426,7 +426,7 @@ static void tcp_sndbuf_expand(struct sock *sk)
 
        if (sk->sk_sndbuf < sndmem)
                WRITE_ONCE(sk->sk_sndbuf,
-                          min(sndmem, sock_net(sk)->ipv4.sysctl_tcp_wmem[2]));
+                          min(sndmem, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[2])));
 }
 
 /* 2. Tuning advertised window (window_clamp, rcv_ssthresh)
@@ -461,7 +461,7 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb,
        struct tcp_sock *tp = tcp_sk(sk);
        /* Optimize this! */
        int truesize = tcp_win_from_space(sk, skbtruesize) >> 1;
-       int window = tcp_win_from_space(sk, sock_net(sk)->ipv4.sysctl_tcp_rmem[2]) >> 1;
+       int window = tcp_win_from_space(sk, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2])) >> 1;
 
        while (tp->rcv_ssthresh <= window) {
                if (truesize <= skb->len)
@@ -534,7 +534,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb,
  */
 static void tcp_init_buffer_space(struct sock *sk)
 {
-       int tcp_app_win = sock_net(sk)->ipv4.sysctl_tcp_app_win;
+       int tcp_app_win = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_app_win);
        struct tcp_sock *tp = tcp_sk(sk);
        int maxwin;
 
@@ -574,16 +574,17 @@ static void tcp_clamp_window(struct sock *sk)
        struct tcp_sock *tp = tcp_sk(sk);
        struct inet_connection_sock *icsk = inet_csk(sk);
        struct net *net = sock_net(sk);
+       int rmem2;
 
        icsk->icsk_ack.quick = 0;
+       rmem2 = READ_ONCE(net->ipv4.sysctl_tcp_rmem[2]);
 
-       if (sk->sk_rcvbuf < net->ipv4.sysctl_tcp_rmem[2] &&
+       if (sk->sk_rcvbuf < rmem2 &&
            !(sk->sk_userlocks & SOCK_RCVBUF_LOCK) &&
            !tcp_under_memory_pressure(sk) &&
            sk_memory_allocated(sk) < sk_prot_mem_limits(sk, 0)) {
                WRITE_ONCE(sk->sk_rcvbuf,
-                          min(atomic_read(&sk->sk_rmem_alloc),
-                              net->ipv4.sysctl_tcp_rmem[2]));
+                          min(atomic_read(&sk->sk_rmem_alloc), rmem2));
        }
        if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
                tp->rcv_ssthresh = min(tp->window_clamp, 2U * tp->advmss);
@@ -724,7 +725,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
         * <prev RTT . ><current RTT .. ><next RTT .... >
         */
 
-       if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf &&
+       if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf) &&
            !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
                int rcvmem, rcvbuf;
                u64 rcvwin, grow;
@@ -745,7 +746,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
 
                do_div(rcvwin, tp->advmss);
                rcvbuf = min_t(u64, rcvwin * rcvmem,
-                              sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);
+                              READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));
                if (rcvbuf > sk->sk_rcvbuf) {
                        WRITE_ONCE(sk->sk_rcvbuf, rcvbuf);
 
@@ -910,9 +911,9 @@ static void tcp_update_pacing_rate(struct sock *sk)
         *       end of slow start and should slow down.
         */
        if (tcp_snd_cwnd(tp) < tp->snd_ssthresh / 2)
-               rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio;
+               rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio);
        else
-               rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio;
+               rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio);
 
        rate *= max(tcp_snd_cwnd(tp), tp->packets_out);
 
@@ -2175,7 +2176,7 @@ void tcp_enter_loss(struct sock *sk)
         * loss recovery is underway except recurring timeout(s) on
         * the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing
         */
-       tp->frto = net->ipv4.sysctl_tcp_frto &&
+       tp->frto = READ_ONCE(net->ipv4.sysctl_tcp_frto) &&
                   (new_recovery || icsk->icsk_retransmits) &&
                   !inet_csk(sk)->icsk_mtup.probe_size;
 }
@@ -3058,7 +3059,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una,
 
 static void tcp_update_rtt_min(struct sock *sk, u32 rtt_us, const int flag)
 {
-       u32 wlen = sock_net(sk)->ipv4.sysctl_tcp_min_rtt_wlen * HZ;
+       u32 wlen = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_rtt_wlen) * HZ;
        struct tcp_sock *tp = tcp_sk(sk);
 
        if ((flag & FLAG_ACK_MAYBE_DELAYED) && rtt_us > tcp_min_rtt(tp)) {
@@ -3581,7 +3582,8 @@ static bool __tcp_oow_rate_limited(struct net *net, int mib_idx,
        if (*last_oow_ack_time) {
                s32 elapsed = (s32)(tcp_jiffies32 - *last_oow_ack_time);
 
-               if (0 <= elapsed && elapsed < net->ipv4.sysctl_tcp_invalid_ratelimit) {
+               if (0 <= elapsed &&
+                   elapsed < READ_ONCE(net->ipv4.sysctl_tcp_invalid_ratelimit)) {
                        NET_INC_STATS(net, mib_idx);
                        return true;    /* rate-limited: don't send yet! */
                }
@@ -3629,7 +3631,7 @@ static void tcp_send_challenge_ack(struct sock *sk)
        /* Then check host-wide RFC 5961 rate limit. */
        now = jiffies / HZ;
        if (now != challenge_timestamp) {
-               u32 ack_limit = net->ipv4.sysctl_tcp_challenge_ack_limit;
+               u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);
                u32 half = (ack_limit + 1) >> 1;
 
                challenge_timestamp = now;
@@ -4426,7 +4428,7 @@ static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
 {
        struct tcp_sock *tp = tcp_sk(sk);
 
-       if (tcp_is_sack(tp) && sock_net(sk)->ipv4.sysctl_tcp_dsack) {
+       if (tcp_is_sack(tp) && READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_dsack)) {
                int mib_idx;
 
                if (before(seq, tp->rcv_nxt))
@@ -4473,7 +4475,7 @@ static void tcp_send_dupack(struct sock *sk, const struct sk_buff *skb)
                NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
                tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);
 
-               if (tcp_is_sack(tp) && sock_net(sk)->ipv4.sysctl_tcp_dsack) {
+               if (tcp_is_sack(tp) && READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_dsack)) {
                        u32 end_seq = TCP_SKB_CB(skb)->end_seq;
 
                        tcp_rcv_spurious_retrans(sk, skb);
@@ -5519,7 +5521,7 @@ send_now:
        }
 
        if (!tcp_is_sack(tp) ||
-           tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr)
+           tp->compressed_ack >= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr))
                goto send_now;
 
        if (tp->compressed_ack_rcv_nxt != tp->rcv_nxt) {
@@ -5540,11 +5542,12 @@ send_now:
        if (tp->srtt_us && tp->srtt_us < rtt)
                rtt = tp->srtt_us;
 
-       delay = min_t(unsigned long, sock_net(sk)->ipv4.sysctl_tcp_comp_sack_delay_ns,
+       delay = min_t(unsigned long,
+                     READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_delay_ns),
                      rtt * (NSEC_PER_USEC >> 3)/20);
        sock_hold(sk);
        hrtimer_start_range_ns(&tp->compressed_ack_timer, ns_to_ktime(delay),
-                              sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns,
+                              READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns),
                               HRTIMER_MODE_REL_PINNED_SOFT);
 }
 
index d16e6e40f47ba4aee2b1a412c42d2f9791698e27..586c102ce152d01430e89d400d70f2573483b423 100644 (file)
@@ -1006,7 +1006,7 @@ static int tcp_v4_send_synack(const struct sock *sk, struct dst_entry *dst,
        if (skb) {
                __tcp_v4_send_check(skb, ireq->ir_loc_addr, ireq->ir_rmt_addr);
 
-               tos = sock_net(sk)->ipv4.sysctl_tcp_reflect_tos ?
+               tos = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos) ?
                                (tcp_rsk(req)->syn_tos & ~INET_ECN_MASK) |
                                (inet_sk(sk)->tos & INET_ECN_MASK) :
                                inet_sk(sk)->tos;
@@ -1526,7 +1526,7 @@ struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
        /* Set ToS of the new socket based upon the value of incoming SYN.
         * ECT bits are set later in tcp_init_transfer().
         */
-       if (sock_net(sk)->ipv4.sysctl_tcp_reflect_tos)
+       if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos))
                newinet->tos = tcp_rsk(req)->syn_tos & ~INET_ECN_MASK;
 
        if (!dst) {
index a501150deaa3b326f1cffdbdd7924d856dde6682..d58e672be31c764805ca6ad120459eb2d86b4d87 100644 (file)
@@ -329,7 +329,7 @@ void tcp_update_metrics(struct sock *sk)
        int m;
 
        sk_dst_confirm(sk);
-       if (net->ipv4.sysctl_tcp_nometrics_save || !dst)
+       if (READ_ONCE(net->ipv4.sysctl_tcp_nometrics_save) || !dst)
                return;
 
        rcu_read_lock();
@@ -385,7 +385,7 @@ void tcp_update_metrics(struct sock *sk)
 
        if (tcp_in_initial_slowstart(tp)) {
                /* Slow start still did not finish. */
-               if (!net->ipv4.sysctl_tcp_no_ssthresh_metrics_save &&
+               if (!READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) &&
                    !tcp_metric_locked(tm, TCP_METRIC_SSTHRESH)) {
                        val = tcp_metric_get(tm, TCP_METRIC_SSTHRESH);
                        if (val && (tcp_snd_cwnd(tp) >> 1) > val)
@@ -401,7 +401,7 @@ void tcp_update_metrics(struct sock *sk)
        } else if (!tcp_in_slow_start(tp) &&
                   icsk->icsk_ca_state == TCP_CA_Open) {
                /* Cong. avoidance phase, cwnd is reliable. */
-               if (!net->ipv4.sysctl_tcp_no_ssthresh_metrics_save &&
+               if (!READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) &&
                    !tcp_metric_locked(tm, TCP_METRIC_SSTHRESH))
                        tcp_metric_set(tm, TCP_METRIC_SSTHRESH,
                                       max(tcp_snd_cwnd(tp) >> 1, tp->snd_ssthresh));
@@ -418,7 +418,7 @@ void tcp_update_metrics(struct sock *sk)
                        tcp_metric_set(tm, TCP_METRIC_CWND,
                                       (val + tp->snd_ssthresh) >> 1);
                }
-               if (!net->ipv4.sysctl_tcp_no_ssthresh_metrics_save &&
+               if (!READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) &&
                    !tcp_metric_locked(tm, TCP_METRIC_SSTHRESH)) {
                        val = tcp_metric_get(tm, TCP_METRIC_SSTHRESH);
                        if (val && tp->snd_ssthresh > val)
@@ -463,7 +463,7 @@ void tcp_init_metrics(struct sock *sk)
        if (tcp_metric_locked(tm, TCP_METRIC_CWND))
                tp->snd_cwnd_clamp = tcp_metric_get(tm, TCP_METRIC_CWND);
 
-       val = net->ipv4.sysctl_tcp_no_ssthresh_metrics_save ?
+       val = READ_ONCE(net->ipv4.sysctl_tcp_no_ssthresh_metrics_save) ?
              0 : tcp_metric_get(tm, TCP_METRIC_SSTHRESH);
        if (val) {
                tp->snd_ssthresh = val;
index c38e07b50639c7f9ac11975d1750d6a0099d74e4..4c376b6d87649cde305a5b6e7b19cefd1cac72a8 100644 (file)
@@ -167,16 +167,13 @@ static void tcp_event_data_sent(struct tcp_sock *tp,
        if (tcp_packets_in_flight(tp) == 0)
                tcp_ca_event(sk, CA_EVENT_TX_START);
 
-       /* If this is the first data packet sent in response to the
-        * previous received data,
-        * and it is a reply for ato after last received packet,
-        * increase pingpong count.
-        */
-       if (before(tp->lsndtime, icsk->icsk_ack.lrcvtime) &&
-           (u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato)
-               inet_csk_inc_pingpong_cnt(sk);
-
        tp->lsndtime = now;
+
+       /* If it is a reply for ato after last received
+        * packet, enter pingpong mode.
+        */
+       if ((u32)(now - icsk->icsk_ack.lrcvtime) < icsk->icsk_ack.ato)
+               inet_csk_enter_pingpong_mode(sk);
 }
 
 /* Account for an ACK we sent. */
@@ -230,7 +227,7 @@ void tcp_select_initial_window(const struct sock *sk, int __space, __u32 mss,
         * which we interpret as a sign the remote TCP is not
         * misinterpreting the window field as a signed quantity.
         */
-       if (sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows)
+       if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows))
                (*rcv_wnd) = min(space, MAX_TCP_WINDOW);
        else
                (*rcv_wnd) = min_t(u32, space, U16_MAX);
@@ -241,7 +238,7 @@ void tcp_select_initial_window(const struct sock *sk, int __space, __u32 mss,
        *rcv_wscale = 0;
        if (wscale_ok) {
                /* Set window scaling on max possible window */
-               space = max_t(u32, space, sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);
+               space = max_t(u32, space, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));
                space = max_t(u32, space, sysctl_rmem_max);
                space = min_t(u32, space, *window_clamp);
                *rcv_wscale = clamp_t(int, ilog2(space) - 15,
@@ -285,7 +282,7 @@ static u16 tcp_select_window(struct sock *sk)
         * scaled window.
         */
        if (!tp->rx_opt.rcv_wscale &&
-           sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows)
+           READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_workaround_signed_windows))
                new_win = min(new_win, MAX_TCP_WINDOW);
        else
                new_win = min(new_win, (65535U << tp->rx_opt.rcv_wscale));
@@ -1976,7 +1973,7 @@ static u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
 
        bytes = sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift);
 
-       r = tcp_min_rtt(tcp_sk(sk)) >> sock_net(sk)->ipv4.sysctl_tcp_tso_rtt_log;
+       r = tcp_min_rtt(tcp_sk(sk)) >> READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_tso_rtt_log);
        if (r < BITS_PER_TYPE(sk->sk_gso_max_size))
                bytes += sk->sk_gso_max_size >> r;
 
@@ -1995,7 +1992,7 @@ static u32 tcp_tso_segs(struct sock *sk, unsigned int mss_now)
 
        min_tso = ca_ops->min_tso_segs ?
                        ca_ops->min_tso_segs(sk) :
-                       sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs;
+                       READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs);
 
        tso_segs = tcp_tso_autosize(sk, mss_now, min_tso);
        return min_t(u32, tso_segs, sk->sk_gso_max_segs);
@@ -2507,7 +2504,7 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb,
                      sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift));
        if (sk->sk_pacing_status == SK_PACING_NONE)
                limit = min_t(unsigned long, limit,
-                             sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);
+                             READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes));
        limit <<= factor;
 
        if (static_branch_unlikely(&tcp_tx_delay_enabled) &&
index 7f695c39d9a8c4410e619b88add23e39f2beabae..87c699d57b36699f1e739f98118376c448e6094e 100644 (file)
@@ -1522,7 +1522,6 @@ static void mld_query_work(struct work_struct *work)
 
                if (++cnt >= MLD_MAX_QUEUE) {
                        rework = true;
-                       schedule_delayed_work(&idev->mc_query_work, 0);
                        break;
                }
        }
@@ -1533,8 +1532,10 @@ static void mld_query_work(struct work_struct *work)
                __mld_query_work(skb);
        mutex_unlock(&idev->mc_lock);
 
-       if (!rework)
-               in6_dev_put(idev);
+       if (rework && queue_delayed_work(mld_wq, &idev->mc_query_work, 0))
+               return;
+
+       in6_dev_put(idev);
 }
 
 /* called with rcu_read_lock() */
@@ -1624,7 +1625,6 @@ static void mld_report_work(struct work_struct *work)
 
                if (++cnt >= MLD_MAX_QUEUE) {
                        rework = true;
-                       schedule_delayed_work(&idev->mc_report_work, 0);
                        break;
                }
        }
@@ -1635,8 +1635,10 @@ static void mld_report_work(struct work_struct *work)
                __mld_report_work(skb);
        mutex_unlock(&idev->mc_lock);
 
-       if (!rework)
-               in6_dev_put(idev);
+       if (rework && queue_delayed_work(mld_wq, &idev->mc_report_work, 0))
+               return;
+
+       in6_dev_put(idev);
 }
 
 static bool is_in(struct ifmcaddr6 *pmc, struct ip6_sf_list *psf, int type,
index ecf3a553a0dc46f361cc0429e816412efde7ee25..8c6c2d82c1cd6d1c0680026f201e1b3b286b78bc 100644 (file)
 #include <linux/proc_fs.h>
 #include <net/ping.h>
 
+static void ping_v6_destroy(struct sock *sk)
+{
+       inet6_destroy_sock(sk);
+}
+
 /* Compatibility glue so we can support IPv6 when it's compiled as a module */
 static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
                                 int *addr_len)
@@ -181,6 +186,7 @@ struct proto pingv6_prot = {
        .owner =        THIS_MODULE,
        .init =         ping_init_sock,
        .close =        ping_close,
+       .destroy =      ping_v6_destroy,
        .connect =      ip6_datagram_connect_v6_only,
        .disconnect =   __udp_disconnect,
        .setsockopt =   ipv6_setsockopt,
index 9d3ede2932582e716d9fa15dd2fad7795ea1b993..be09941fe6d9a84029c02464406f4d7bd78968da 100644 (file)
@@ -546,7 +546,7 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
                if (np->repflow && ireq->pktopts)
                        fl6->flowlabel = ip6_flowlabel(ipv6_hdr(ireq->pktopts));
 
-               tclass = sock_net(sk)->ipv4.sysctl_tcp_reflect_tos ?
+               tclass = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos) ?
                                (tcp_rsk(req)->syn_tos & ~INET_ECN_MASK) |
                                (np->tclass & INET_ECN_MASK) :
                                np->tclass;
@@ -1314,7 +1314,7 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
        /* Set ToS of the new socket based upon the value of incoming SYN.
         * ECT bits are set later in tcp_init_transfer().
         */
-       if (sock_net(sk)->ipv4.sysctl_tcp_reflect_tos)
+       if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_reflect_tos))
                newnp->tclass = tcp_rsk(req)->syn_tos & ~INET_ECN_MASK;
 
        /* Clone native IPv6 options from listening socket (if any)
index 15a73b7fdd75a18dc2d1e5d8d30173a94b6ca2a9..1a9ada41187932bdc0891c31001434592eb54f30 100644 (file)
@@ -377,9 +377,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
        bool cancel_scan;
        struct cfg80211_nan_func *func;
 
-       spin_lock_bh(&local->fq.lock);
        clear_bit(SDATA_STATE_RUNNING, &sdata->state);
-       spin_unlock_bh(&local->fq.lock);
+       synchronize_rcu(); /* flush _ieee80211_wake_txqs() */
 
        cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata;
        if (cancel_scan)
index bd8f0f425be4ca1d09076a054da1f9e8accf363b..30d289044e71b17c4d4866b643b60290fc4bde1c 100644 (file)
@@ -1271,7 +1271,7 @@ raise_win:
                if (unlikely(th->syn))
                        new_win = min(new_win, 65535U) << tp->rx_opt.rcv_wscale;
                if (!tp->rx_opt.rcv_wscale &&
-                   sock_net(ssk)->ipv4.sysctl_tcp_workaround_signed_windows)
+                   READ_ONCE(sock_net(ssk)->ipv4.sysctl_tcp_workaround_signed_windows))
                        new_win = min(new_win, MAX_TCP_WINDOW);
                else
                        new_win = min(new_win, (65535U << tp->rx_opt.rcv_wscale));
index 21a3ed64226e56b589e344d3a726d0e7a1fc1723..7e1518bb6115d592a4276f3e655ce39dedef51d0 100644 (file)
@@ -1908,7 +1908,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
        if (msk->rcvq_space.copied <= msk->rcvq_space.space)
                goto new_measure;
 
-       if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf &&
+       if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf) &&
            !(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
                int rcvmem, rcvbuf;
                u64 rcvwin, grow;
@@ -1926,7 +1926,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
 
                do_div(rcvwin, advmss);
                rcvbuf = min_t(u64, rcvwin * rcvmem,
-                              sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);
+                              READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));
 
                if (rcvbuf > sk->sk_rcvbuf) {
                        u32 window_clamp;
@@ -2669,8 +2669,8 @@ static int mptcp_init_sock(struct sock *sk)
        mptcp_ca_reset(sk);
 
        sk_sockets_allocated_inc(sk);
-       sk->sk_rcvbuf = sock_net(sk)->ipv4.sysctl_tcp_rmem[1];
-       sk->sk_sndbuf = sock_net(sk)->ipv4.sysctl_tcp_wmem[1];
+       sk->sk_rcvbuf = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[1]);
+       sk->sk_sndbuf = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[1]);
 
        return 0;
 }
index 63e8892ec807d33a2dd0070e87902fd6a2289837..af28f3b6038994214ea542dbe29dd3ebe85b6b72 100644 (file)
@@ -1533,7 +1533,7 @@ int __mptcp_subflow_connect(struct sock *sk, const struct mptcp_addr_info *loc,
        mptcp_sock_graft(ssk, sk->sk_socket);
        iput(SOCK_INODE(sf));
        WRITE_ONCE(msk->allow_infinite_fallback, false);
-       return err;
+       return 0;
 
 failed_unlink:
        list_del(&subflow->node);
index 646d5fd53604bd94d64770ff6a5030e617b69f72..9f976b11d89671091082fff74166c26a0c32a157 100644 (file)
@@ -3340,6 +3340,8 @@ int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain)
                        if (err < 0)
                                return err;
                }
+
+               cond_resched();
        }
 
        return 0;
@@ -9367,9 +9369,13 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
                                break;
                        }
                }
+
+               cond_resched();
        }
 
        list_for_each_entry(set, &ctx->table->sets, list) {
+               cond_resched();
+
                if (!nft_is_active_next(ctx->net, set))
                        continue;
                if (!(set->flags & NFT_SET_MAP) ||
index a364f8e5e698f8b2b2dd450faa727eaa2faddeee..87a9009d5234dd7bdac5b64e0ab376b82266f47b 100644 (file)
@@ -843,11 +843,16 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
 }
 
 static int
-nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff)
+nfqnl_mangle(void *data, unsigned int data_len, struct nf_queue_entry *e, int diff)
 {
        struct sk_buff *nskb;
 
        if (diff < 0) {
+               unsigned int min_len = skb_transport_offset(e->skb);
+
+               if (data_len < min_len)
+                       return -EINVAL;
+
                if (pskb_trim(e->skb, data_len))
                        return -ENOMEM;
        } else if (diff > 0) {
index 15e4b7640dc00041dab7ddaebd26c20d26235753..da29e92c03e276e7a6a101fcd3b24eae1416ee37 100644 (file)
@@ -68,6 +68,31 @@ static void nft_queue_sreg_eval(const struct nft_expr *expr,
        regs->verdict.code = ret;
 }
 
+static int nft_queue_validate(const struct nft_ctx *ctx,
+                             const struct nft_expr *expr,
+                             const struct nft_data **data)
+{
+       static const unsigned int supported_hooks = ((1 << NF_INET_PRE_ROUTING) |
+                                                    (1 << NF_INET_LOCAL_IN) |
+                                                    (1 << NF_INET_FORWARD) |
+                                                    (1 << NF_INET_LOCAL_OUT) |
+                                                    (1 << NF_INET_POST_ROUTING));
+
+       switch (ctx->family) {
+       case NFPROTO_IPV4:
+       case NFPROTO_IPV6:
+       case NFPROTO_INET:
+       case NFPROTO_BRIDGE:
+               break;
+       case NFPROTO_NETDEV: /* lacks okfn */
+               fallthrough;
+       default:
+               return -EOPNOTSUPP;
+       }
+
+       return nft_chain_validate_hooks(ctx->chain, supported_hooks);
+}
+
 static const struct nla_policy nft_queue_policy[NFTA_QUEUE_MAX + 1] = {
        [NFTA_QUEUE_NUM]        = { .type = NLA_U16 },
        [NFTA_QUEUE_TOTAL]      = { .type = NLA_U16 },
@@ -164,6 +189,7 @@ static const struct nft_expr_ops nft_queue_ops = {
        .eval           = nft_queue_eval,
        .init           = nft_queue_init,
        .dump           = nft_queue_dump,
+       .validate       = nft_queue_validate,
        .reduce         = NFT_REDUCE_READONLY,
 };
 
@@ -173,6 +199,7 @@ static const struct nft_expr_ops nft_queue_sreg_ops = {
        .eval           = nft_queue_sreg_eval,
        .init           = nft_queue_sreg_init,
        .dump           = nft_queue_sreg_dump,
+       .validate       = nft_queue_validate,
        .reduce         = NFT_REDUCE_READONLY,
 };
 
index be29da09cc7ab08ec2fd9e24f7b5c53c407ea931..3460abceba443bcfaf7483847c74af45bf0523c7 100644 (file)
@@ -229,9 +229,8 @@ static struct sctp_association *sctp_association_init(
        if (!sctp_ulpq_init(&asoc->ulpq, asoc))
                goto fail_init;
 
-       if (sctp_stream_init(&asoc->stream, asoc->c.sinit_num_ostreams,
-                            0, gfp))
-               goto fail_init;
+       if (sctp_stream_init(&asoc->stream, asoc->c.sinit_num_ostreams, 0, gfp))
+               goto stream_free;
 
        /* Initialize default path MTU. */
        asoc->pathmtu = sp->pathmtu;
index 6dc95dcc0ff4f065014dbc376aa01b86eb9b2db0..ef9fceadef8d5a9b643567ae8ebb802608354a96 100644 (file)
@@ -137,7 +137,7 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
 
        ret = sctp_stream_alloc_out(stream, outcnt, gfp);
        if (ret)
-               goto out_err;
+               return ret;
 
        for (i = 0; i < stream->outcnt; i++)
                SCTP_SO(stream, i)->state = SCTP_STREAM_OPEN;
@@ -145,22 +145,9 @@ int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
 handle_in:
        sctp_stream_interleave_init(stream);
        if (!incnt)
-               goto out;
-
-       ret = sctp_stream_alloc_in(stream, incnt, gfp);
-       if (ret)
-               goto in_err;
-
-       goto out;
+               return 0;
 
-in_err:
-       sched->free(stream);
-       genradix_free(&stream->in);
-out_err:
-       genradix_free(&stream->out);
-       stream->outcnt = 0;
-out:
-       return ret;
+       return sctp_stream_alloc_in(stream, incnt, gfp);
 }
 
 int sctp_stream_init_ext(struct sctp_stream *stream, __u16 sid)
index 518b1b9bf89d68ed37d2e67f4e370636a824cd25..1ad565ed56273c5996ddf1efcb5b54f4f6778c60 100644 (file)
@@ -160,7 +160,7 @@ int sctp_sched_set_sched(struct sctp_association *asoc,
                if (!SCTP_SO(&asoc->stream, i)->ext)
                        continue;
 
-               ret = n->init_sid(&asoc->stream, i, GFP_KERNEL);
+               ret = n->init_sid(&asoc->stream, i, GFP_ATOMIC);
                if (ret)
                        goto err;
        }
index 43509c7e90fc2827110fd55cc98506b493951035..f1c3b8eb4b3d3356070f77f7065591bd23681480 100644 (file)
@@ -517,7 +517,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock,
        timer_setup(&sk->sk_timer, tipc_sk_timeout, 0);
        sk->sk_shutdown = 0;
        sk->sk_backlog_rcv = tipc_sk_backlog_rcv;
-       sk->sk_rcvbuf = sysctl_tipc_rmem[1];
+       sk->sk_rcvbuf = READ_ONCE(sysctl_tipc_rmem[1]);
        sk->sk_data_ready = tipc_data_ready;
        sk->sk_write_space = tipc_write_space;
        sk->sk_destruct = tipc_sock_destruct;
index 879b9024678edf37380e032508ee9c598194c49c..9975df34d9c243e990613167836591ad82ca3ca9 100644 (file)
@@ -1376,8 +1376,13 @@ static int tls_device_down(struct net_device *netdev)
                 * by tls_device_free_ctx. rx_conf and tx_conf stay in TLS_HW.
                 * Now release the ref taken above.
                 */
-               if (refcount_dec_and_test(&ctx->refcount))
+               if (refcount_dec_and_test(&ctx->refcount)) {
+                       /* sk_destruct ran after tls_device_down took a ref, and
+                        * it returned early. Complete the destruction here.
+                        */
+                       list_del(&ctx->list);
                        tls_device_free_ctx(ctx);
+               }
        }
 
        up_write(&device_offload_lock);
index 7adab4618035bc7e5984f4880489ef93a5c49994..379e86c71bed3453cf0e4be6fbec766a7561ad75 100755 (executable)
@@ -41,3 +41,5 @@ if [ -n "${building_out_of_srctree}" ]; then
 fi
 
 rm -f scripts/extract-cert
+
+rm -f arch/x86/purgatory/kexec-purgatory.c
index cc88f02c7562159c258e0de27dc5f4868144d8a1..93e8bc047a736f4658e84c08b57125a5910b0c88 100644 (file)
@@ -755,13 +755,14 @@ void evm_inode_post_removexattr(struct dentry *dentry, const char *xattr_name)
        evm_update_evmxattr(dentry, xattr_name, NULL, 0);
 }
 
-static int evm_attr_change(struct dentry *dentry, struct iattr *attr)
+static int evm_attr_change(struct user_namespace *mnt_userns,
+                          struct dentry *dentry, struct iattr *attr)
 {
        struct inode *inode = d_backing_inode(dentry);
        unsigned int ia_valid = attr->ia_valid;
 
-       if ((!(ia_valid & ATTR_UID) || uid_eq(attr->ia_uid, inode->i_uid)) &&
-           (!(ia_valid & ATTR_GID) || gid_eq(attr->ia_gid, inode->i_gid)) &&
+       if (!i_uid_needs_update(mnt_userns, attr, inode) &&
+           !i_gid_needs_update(mnt_userns, attr, inode) &&
            (!(ia_valid & ATTR_MODE) || attr->ia_mode == inode->i_mode))
                return 0;
 
@@ -775,7 +776,8 @@ static int evm_attr_change(struct dentry *dentry, struct iattr *attr)
  * Permit update of file attributes when files have a valid EVM signature,
  * except in the case of them having an immutable portable signature.
  */
-int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
+int evm_inode_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
+                     struct iattr *attr)
 {
        unsigned int ia_valid = attr->ia_valid;
        enum integrity_status evm_status;
@@ -801,7 +803,7 @@ int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
                return 0;
 
        if (evm_status == INTEGRITY_PASS_IMMUTABLE &&
-           !evm_attr_change(dentry, attr))
+           !evm_attr_change(mnt_userns, dentry, attr))
                return 0;
 
        integrity_audit_msg(AUDIT_INTEGRITY_METADATA, d_backing_inode(dentry),
index 13753136f03f089a31dc9ff245b1e4bded915d99..419dc405c8310b5d9486e0bfda8c15655e29ed28 100644 (file)
@@ -137,7 +137,7 @@ void ima_add_kexec_buffer(struct kimage *image)
 /*
  * Restore the measurement list from the previous kernel.
  */
-void ima_load_kexec_buffer(void)
+void __init ima_load_kexec_buffer(void)
 {
        void *kexec_buffer = NULL;
        size_t kexec_buffer_size = 0;
index 188b8f7822206042dfbefb2764e611029a0b78a0..f85afb02ea1c22c8b66720687dd9f0e77dcee629 100644 (file)
@@ -1324,7 +1324,8 @@ int security_inode_permission(struct inode *inode, int mask)
        return call_int_hook(inode_permission, 0, inode, mask);
 }
 
-int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
+int security_inode_setattr(struct user_namespace *mnt_userns,
+                          struct dentry *dentry, struct iattr *attr)
 {
        int ret;
 
@@ -1333,7 +1334,7 @@ int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
        ret = call_int_hook(inode_setattr, 0, dentry, attr);
        if (ret)
                return ret;
-       return evm_inode_setattr(dentry, attr);
+       return evm_inode_setattr(mnt_userns, dentry, attr);
 }
 EXPORT_SYMBOL_GPL(security_inode_setattr);
 
index 00f5227c8459870d142a4dce759a997467448b50..a77b915d36a8ed8885f4c33e11597a3950102747 100644 (file)
 #define X86_FEATURE_RETPOLINE_LFENCE   (11*32+13) /* "" Use LFENCE for Spectre variant 2 */
 #define X86_FEATURE_RETHUNK            (11*32+14) /* "" Use REturn THUNK */
 #define X86_FEATURE_UNRET              (11*32+15) /* "" AMD BTB untrain return */
+#define X86_FEATURE_USE_IBPB_FW                (11*32+16) /* "" Use IBPB during runtime firmware calls */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
 #define X86_FEATURE_AVX_VNNI           (12*32+ 4) /* AVX VNNI instructions */
index 0197042b7dfbd8550b1691a74ad2cd6bf7a5bdba..1ecdb911add8de3b16f4b05dff630a0ca47285d1 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
 #ifndef _ASM_GENERIC_FCNTL_H
 #define _ASM_GENERIC_FCNTL_H
 
@@ -90,7 +91,7 @@
 
 /* a horrid kludge trying to make sure that this will fail on old kernels */
 #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
-#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
+#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)      
 
 #ifndef O_NDELAY
 #define O_NDELAY       O_NONBLOCK
 #define F_GETSIG       11      /* for sockets. */
 #endif
 
+#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
 #ifndef F_GETLK64
 #define F_GETLK64      12      /*  using 'struct flock64' */
 #define F_SETLK64      13
 #define F_SETLKW64     14
 #endif
+#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
 
 #ifndef F_SETOWN_EX
 #define F_SETOWN_EX    15
@@ -178,6 +181,10 @@ struct f_owner_ex {
                                   blocking */
 #define LOCK_UN                8       /* remove lock */
 
+/*
+ * LOCK_MAND support has been removed from the kernel. We leave the symbols
+ * here to not break legacy builds, but these should not be used in new code.
+ */
 #define LOCK_MAND      32      /* This is a mandatory flock ... */
 #define LOCK_READ      64      /* which allows concurrent read operations */
 #define LOCK_WRITE     128     /* which allows concurrent write operations */
@@ -185,6 +192,7 @@ struct f_owner_ex {
 
 #define F_LINUX_SPECIFIC_BASE  1024
 
+#ifndef HAVE_ARCH_STRUCT_FLOCK
 struct flock {
        short   l_type;
        short   l_whence;
@@ -209,5 +217,6 @@ struct flock64 {
        __ARCH_FLOCK64_PAD
 #endif
 };
+#endif /* HAVE_ARCH_STRUCT_FLOCK */
 
 #endif /* _ASM_GENERIC_FCNTL_H */
index 5f57d9829956ca0ea2ad1978613ef8002c831c36..4339692a8d0b1435e1e6d772da9a4ba7b0b8580e 100755 (executable)
@@ -61,7 +61,7 @@ def get_optional(perf_dict, field):
 
 def get_offset(perf_dict, field):
        if field in perf_dict:
-               return f"+0x{perf_dict[field]:x}"
+               return "+%#x" % perf_dict[field]
        return ""
 
 def get_dso_file_path(dso_name, dso_build_id):
@@ -76,7 +76,7 @@ def get_dso_file_path(dso_name, dso_build_id):
        else:
                append = "/elf"
 
-       dso_path = f"{os.environ['PERF_BUILDID_DIR']}/{dso_name}/{dso_build_id}{append}"
+       dso_path = os.environ['PERF_BUILDID_DIR'] + "/" + dso_name + "/" + dso_build_id + append;
        # Replace duplicate slash chars to single slash char
        dso_path = dso_path.replace('//', '/', 1)
        return dso_path
@@ -94,8 +94,8 @@ def read_disam(dso_fname, dso_start, start_addr, stop_addr):
                start_addr = start_addr - dso_start;
                stop_addr = stop_addr - dso_start;
                disasm = [ options.objdump_name, "-d", "-z",
-                          f"--start-address=0x{start_addr:x}",
-                          f"--stop-address=0x{stop_addr:x}" ]
+                          "--start-address="+format(start_addr,"#x"),
+                          "--stop-address="+format(stop_addr,"#x") ]
                disasm += [ dso_fname ]
                disasm_output = check_output(disasm).decode('utf-8').split('\n')
                disasm_cache[addr_range] = disasm_output
@@ -109,12 +109,14 @@ def print_disam(dso_fname, dso_start, start_addr, stop_addr):
                        m = disasm_re.search(line)
                        if m is None:
                                continue
-               print(f"\t{line}")
+               print("\t" + line)
 
 def print_sample(sample):
-       print(f"Sample = {{ cpu: {sample['cpu']:04} addr: 0x{sample['addr']:016x} " \
-             f"phys_addr: 0x{sample['phys_addr']:016x} ip: 0x{sample['ip']:016x} " \
-             f"pid: {sample['pid']} tid: {sample['tid']} period: {sample['period']} time: {sample['time']} }}")
+       print("Sample = { cpu: %04d addr: 0x%016x phys_addr: 0x%016x ip: 0x%016x " \
+             "pid: %d tid: %d period: %d time: %d }" % \
+             (sample['cpu'], sample['addr'], sample['phys_addr'], \
+              sample['ip'], sample['pid'], sample['tid'], \
+              sample['period'], sample['time']))
 
 def trace_begin():
        print('ARM CoreSight Trace Data Assembler Dump')
@@ -131,7 +133,7 @@ def common_start_str(comm, sample):
        cpu = sample["cpu"]
        pid = sample["pid"]
        tid = sample["tid"]
-       return f"{comm:>16} {pid:>5}/{tid:<5} [{cpu:04}] {sec:9}.{ns:09}  "
+       return "%16s %5u/%-5u [%04u] %9u.%09u  " % (comm, pid, tid, cpu, sec, ns)
 
 # This code is copied from intel-pt-events.py for printing source code
 # line and symbols.
@@ -171,7 +173,7 @@ def print_srccode(comm, param_dict, sample, symbol, dso):
        glb_line_number = line_number
        glb_source_file_name = source_file_name
 
-       print(f"{start_str}{src_str}")
+       print(start_str, src_str)
 
 def process_event(param_dict):
        global cache_size
@@ -188,7 +190,7 @@ def process_event(param_dict):
        symbol = get_optional(param_dict, "symbol")
 
        if (options.verbose == True):
-               print(f"Event type: {name}")
+               print("Event type: %s" % name)
                print_sample(sample)
 
        # If cannot find dso so cannot dump assembler, bail out
@@ -197,7 +199,7 @@ def process_event(param_dict):
 
        # Validate dso start and end addresses
        if ((dso_start == '[unknown]') or (dso_end == '[unknown]')):
-               print(f"Failed to find valid dso map for dso {dso}")
+               print("Failed to find valid dso map for dso %s" % dso)
                return
 
        if (name[0:12] == "instructions"):
@@ -244,15 +246,15 @@ def process_event(param_dict):
 
        # Handle CS_ETM_TRACE_ON packet if start_addr=0 and stop_addr=4
        if (start_addr == 0 and stop_addr == 4):
-               print(f"CPU{cpu}: CS_ETM_TRACE_ON packet is inserted")
+               print("CPU%d: CS_ETM_TRACE_ON packet is inserted" % cpu)
                return
 
        if (start_addr < int(dso_start) or start_addr > int(dso_end)):
-               print(f"Start address 0x{start_addr:x} is out of range [ 0x{dso_start:x} .. 0x{dso_end:x} ] for dso {dso}")
+               print("Start address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (start_addr, int(dso_start), int(dso_end), dso))
                return
 
        if (stop_addr < int(dso_start) or stop_addr > int(dso_end)):
-               print(f"Stop address 0x{stop_addr:x} is out of range [ 0x{dso_start:x} .. 0x{dso_end:x} ] for dso {dso}")
+               print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso))
                return
 
        if (options.objdump_name != None):
@@ -267,6 +269,6 @@ def process_event(param_dict):
                if path.exists(dso_fname):
                        print_disam(dso_fname, dso_vm_start, start_addr, stop_addr)
                else:
-                       print(f"Failed to find dso {dso} for address range [ 0x{start_addr:x} .. 0x{stop_addr:x} ]")
+                       print("Failed to find dso %s for address range [ 0x%x .. 0x%x ]" % (dso, start_addr, stop_addr))
 
        print_srccode(comm, param_dict, sample, symbol, dso)
index f8ad581ea2479097ad0b52ca3db664ef42a8017b..cdd6463a5b684ebeba34e699c1429cb31b127ecc 100644 (file)
@@ -63,20 +63,16 @@ static struct hashmap *bpf_map_hash;
 static struct bpf_perf_object *
 bpf_perf_object__next(struct bpf_perf_object *prev)
 {
-       struct bpf_perf_object *next;
-
-       if (!prev)
-               next = list_first_entry(&bpf_objects_list,
-                                       struct bpf_perf_object,
-                                       list);
-       else
-               next = list_next_entry(prev, list);
+       if (!prev) {
+               if (list_empty(&bpf_objects_list))
+                       return NULL;
 
-       /* Empty list is noticed here so don't need checking on entry. */
-       if (&next->list == &bpf_objects_list)
+               return list_first_entry(&bpf_objects_list, struct bpf_perf_object, list);
+       }
+       if (list_is_last(&prev->list, &bpf_objects_list))
                return NULL;
 
-       return next;
+       return list_next_entry(prev, list);
 }
 
 #define bpf_perf_object__for_each(perf_obj, tmp)       \
index ecd377938eea8e5e5346c45e84f22f56aa607b96..b3be5b1d9dbb00bcde88661bdb7e03a2505d2ca8 100644 (file)
@@ -233,6 +233,33 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
        return NULL;
 }
 
+static int elf_read_program_header(Elf *elf, u64 vaddr, GElf_Phdr *phdr)
+{
+       size_t i, phdrnum;
+       u64 sz;
+
+       if (elf_getphdrnum(elf, &phdrnum))
+               return -1;
+
+       for (i = 0; i < phdrnum; i++) {
+               if (gelf_getphdr(elf, i, phdr) == NULL)
+                       return -1;
+
+               if (phdr->p_type != PT_LOAD)
+                       continue;
+
+               sz = max(phdr->p_memsz, phdr->p_filesz);
+               if (!sz)
+                       continue;
+
+               if (vaddr >= phdr->p_vaddr && (vaddr < phdr->p_vaddr + sz))
+                       return 0;
+       }
+
+       /* Not found any valid program header */
+       return -1;
+}
+
 static bool want_demangle(bool is_kernel_sym)
 {
        return is_kernel_sym ? symbol_conf.demangle_kernel : symbol_conf.demangle;
@@ -1209,6 +1236,7 @@ dso__load_sym_internal(struct dso *dso, struct map *map, struct symsrc *syms_ss,
                                        sym.st_value);
                        used_opd = true;
                }
+
                /*
                 * When loading symbols in a data mapping, ABS symbols (which
                 * has a value of SHN_ABS in its st_shndx) failed at
@@ -1227,6 +1255,17 @@ dso__load_sym_internal(struct dso *dso, struct map *map, struct symsrc *syms_ss,
 
                gelf_getshdr(sec, &shdr);
 
+               /*
+                * If the attribute bit SHF_ALLOC is not set, the section
+                * doesn't occupy memory during process execution.
+                * E.g. ".gnu.warning.*" section is used by linker to generate
+                * warnings when calling deprecated functions, the symbols in
+                * the section aren't loaded to memory during process execution,
+                * so skip them.
+                */
+               if (!(shdr.sh_flags & SHF_ALLOC))
+                       continue;
+
                secstrs = secstrs_sym;
 
                /*
@@ -1262,11 +1301,20 @@ dso__load_sym_internal(struct dso *dso, struct map *map, struct symsrc *syms_ss,
                                goto out_elf_end;
                } else if ((used_opd && runtime_ss->adjust_symbols) ||
                           (!used_opd && syms_ss->adjust_symbols)) {
+                       GElf_Phdr phdr;
+
+                       if (elf_read_program_header(syms_ss->elf,
+                                                   (u64)sym.st_value, &phdr)) {
+                               pr_warning("%s: failed to find program header for "
+                                          "symbol: %s st_value: %#" PRIx64 "\n",
+                                          __func__, elf_name, (u64)sym.st_value);
+                               continue;
+                       }
                        pr_debug4("%s: adjusting symbol: st_value: %#" PRIx64 " "
-                                 "sh_addr: %#" PRIx64 " sh_offset: %#" PRIx64 "\n", __func__,
-                                 (u64)sym.st_value, (u64)shdr.sh_addr,
-                                 (u64)shdr.sh_offset);
-                       sym.st_value -= shdr.sh_addr - shdr.sh_offset;
+                                 "p_vaddr: %#" PRIx64 " p_offset: %#" PRIx64 "\n",
+                                 __func__, (u64)sym.st_value, (u64)phdr.p_vaddr,
+                                 (u64)phdr.p_offset);
+                       sym.st_value -= phdr.p_vaddr - phdr.p_offset;
                }
 
                demangled = demangle_sym(dso, kmodule, elf_name);
index 83844f8b862ada41db6ce2c061851e263a0d416d..b0ca44c70e83ee9f628eeda73c33861ce14e093e 100644 (file)
@@ -417,6 +417,7 @@ int main(int argc, char *argv[])
 {
        int ret = 0;
        int fd;
+       uint32_t request;
 
        parse_opts(argc, argv);
 
@@ -430,13 +431,23 @@ int main(int argc, char *argv[])
        /*
         * spi mode
         */
+       /* WR is make a request to assign 'mode' */
+       request = mode;
        ret = ioctl(fd, SPI_IOC_WR_MODE32, &mode);
        if (ret == -1)
                pabort("can't set spi mode");
 
+       /* RD is read what mode the device actually is in */
        ret = ioctl(fd, SPI_IOC_RD_MODE32, &mode);
        if (ret == -1)
                pabort("can't get spi mode");
+       /* Drivers can reject some mode bits without returning an error.
+        * Read the current value to identify what mode it is in, and if it
+        * differs from the requested mode, warn the user.
+        */
+       if (request != mode)
+               printf("WARNING device does not support requested mode 0x%x\n",
+                       request);
 
        /*
         * bits per word
index b86642f90d7fd3fb7da6e8123c7304896b5e888a..3a391c9bf4689af405b83b50fbebfa80069fcb5a 100644 (file)
@@ -86,7 +86,7 @@ do {                                                                  \
 
 #define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs)               \
        RSEQ_INJECT_ASM(1)                                              \
-       "la     "RSEQ_ASM_TMP_REG_1 ", " __rseq_str(cs_label) "\n"      \
+       "la     " RSEQ_ASM_TMP_REG_1 ", " __rseq_str(cs_label) "\n"     \
        REG_S   RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(rseq_cs) "]\n"     \
        __rseq_str(label) ":\n"
 
@@ -103,17 +103,17 @@ do {                                                                      \
 
 #define RSEQ_ASM_OP_CMPEQ(var, expect, label)                          \
        REG_L   RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n"         \
-       "bne    "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ,"     \
+       "bne    " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ,"    \
                  __rseq_str(label) "\n"
 
 #define RSEQ_ASM_OP_CMPEQ32(var, expect, label)                                \
-       "lw     "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n"        \
-       "bne    "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ,"     \
+       "lw     " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n"       \
+       "bne    " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ,"    \
                  __rseq_str(label) "\n"
 
 #define RSEQ_ASM_OP_CMPNE(var, expect, label)                          \
        REG_L   RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n"         \
-       "beq    "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ,"     \
+       "beq    " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(expect) "] ,"    \
                  __rseq_str(label) "\n"
 
 #define RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, label)             \
@@ -127,12 +127,12 @@ do {                                                                      \
        REG_S   RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(var) "]\n"
 
 #define RSEQ_ASM_OP_R_LOAD_OFF(offset)                                 \
-       "add    "RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(offset) "], "     \
+       "add    " RSEQ_ASM_TMP_REG_1 ", %[" __rseq_str(offset) "], "    \
                 RSEQ_ASM_TMP_REG_1 "\n"                                \
        REG_L   RSEQ_ASM_TMP_REG_1 ", (" RSEQ_ASM_TMP_REG_1 ")\n"
 
 #define RSEQ_ASM_OP_R_ADD(count)                                       \
-       "add    "RSEQ_ASM_TMP_REG_1 ", " RSEQ_ASM_TMP_REG_1             \
+       "add    " RSEQ_ASM_TMP_REG_1 ", " RSEQ_ASM_TMP_REG_1            \
                ", %[" __rseq_str(count) "]\n"
 
 #define RSEQ_ASM_OP_FINAL_STORE(value, var, post_commit_label)         \
@@ -194,8 +194,8 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [v]                 "m" (*v),
                                    [expect]            "r" (expect),
                                    [newv]              "r" (newv)
@@ -251,8 +251,8 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [v]                 "m" (*v),
                                    [expectnot]         "r" (expectnot),
                                    [load]              "m" (*load),
@@ -301,8 +301,8 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [v]                 "m" (*v),
                                    [count]             "r" (count)
                                    RSEQ_INJECT_INPUT
@@ -352,8 +352,8 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [expect]            "r" (expect),
                                    [v]                 "m" (*v),
                                    [newv]              "r" (newv),
@@ -411,8 +411,8 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect,
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [expect]            "r" (expect),
                                    [v]                 "m" (*v),
                                    [newv]              "r" (newv),
@@ -472,8 +472,8 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [v]                 "m" (*v),
                                    [expect]            "r" (expect),
                                    [v2]                        "m" (*v2),
@@ -532,8 +532,8 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [expect]            "r" (expect),
                                    [v]                 "m" (*v),
                                    [newv]              "r" (newv),
@@ -593,8 +593,8 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]    "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]    "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [expect]            "r" (expect),
                                    [v]                 "m" (*v),
                                    [newv]              "r" (newv),
@@ -651,8 +651,8 @@ int rseq_offset_deref_addv(intptr_t *ptr, off_t off, intptr_t inc, int cpu)
                                  RSEQ_ASM_DEFINE_ABORT(4, abort)
                                  : /* gcc asm goto does not allow outputs */
                                  : [cpu_id]            "r" (cpu),
-                                   [current_cpu_id]      "m" (__rseq_abi.cpu_id),
-                                   [rseq_cs]           "m" (__rseq_abi.rseq_cs),
+                                   [current_cpu_id]      "m" (rseq_get_abi()->cpu_id),
+                                   [rseq_cs]           "m" (rseq_get_abi()->rseq_cs.arch.ptr),
                                    [ptr]                       "r" (ptr),
                                    [off]                       "er" (off),
                                    [inc]                       "er" (inc)
index 986b9458efb2643e92d1715e52a0febf8beb9b2b..4177f9507bbeedf47f9d602dff4ab7aae0d1b0f0 100644 (file)
@@ -111,7 +111,8 @@ void rseq_init(void)
        libc_rseq_offset_p = dlsym(RTLD_NEXT, "__rseq_offset");
        libc_rseq_size_p = dlsym(RTLD_NEXT, "__rseq_size");
        libc_rseq_flags_p = dlsym(RTLD_NEXT, "__rseq_flags");
-       if (libc_rseq_size_p && libc_rseq_offset_p && libc_rseq_flags_p) {
+       if (libc_rseq_size_p && libc_rseq_offset_p && libc_rseq_flags_p &&
+                       *libc_rseq_size_p != 0) {
                /* rseq registration owned by glibc */
                rseq_offset = *libc_rseq_offset_p;
                rseq_size = *libc_rseq_size_p;
index 9b68658b6bb859a5390ac29bbfd35520c79e633c..5b98f3ee58a58b579dce4ccc4b70ddb89a0b5e52 100644 (file)
@@ -233,6 +233,24 @@ static unsigned long read_slab_obj(struct slabinfo *s, const char *name)
        return l;
 }
 
+static unsigned long read_debug_slab_obj(struct slabinfo *s, const char *name)
+{
+       char x[128];
+       FILE *f;
+       size_t l;
+
+       snprintf(x, 128, "/sys/kernel/debug/slab/%s/%s", s->name, name);
+       f = fopen(x, "r");
+       if (!f) {
+               buffer[0] = 0;
+               l = 0;
+       } else {
+               l = fread(buffer, 1, sizeof(buffer), f);
+               buffer[l] = 0;
+               fclose(f);
+       }
+       return l;
+}
 
 /*
  * Put a size string together
@@ -409,14 +427,18 @@ static void show_tracking(struct slabinfo *s)
 {
        printf("\n%s: Kernel object allocation\n", s->name);
        printf("-----------------------------------------------------------------------\n");
-       if (read_slab_obj(s, "alloc_calls"))
+       if (read_debug_slab_obj(s, "alloc_traces"))
+               printf("%s", buffer);
+       else if (read_slab_obj(s, "alloc_calls"))
                printf("%s", buffer);
        else
                printf("No Data\n");
 
        printf("\n%s: Kernel object freeing\n", s->name);
        printf("------------------------------------------------------------------------\n");
-       if (read_slab_obj(s, "free_calls"))
+       if (read_debug_slab_obj(s, "free_traces"))
+               printf("%s", buffer);
+       else if (read_slab_obj(s, "free_calls"))
                printf("%s", buffer);
        else
                printf("No Data\n");